Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Instance Methods | Class Methods | Protected Attributes
Myapp Class Reference

#import "Myapp.h"

Inheritance diagram for Myapp:
[legend]
Collaboration diagram for Myapp:
[legend]

Instance Methods

(int- appOpenFile:type:
 
(BOOL) - appAcceptsAnotherFile:
 
(id) - openfile:
 
(id) - print:
 
(id) - save:
 
(id) - saveTypeEPS:
 
(id) - saveTypeTiff:
 
(int- setCompType
 
() - return(self) [implementation]
 

Class Methods

(id) + new
 

Protected Attributes

id openpanel
 
id savepanel
 
id savePanelAccessory
 
id compPopUP
 
int saveType
 

Detailed Description

Definition at line 25 of file Myapp.m.

Method Documentation

- (BOOL) appAcceptsAnotherFile: (id)  sender

Definition at line 47 of file Myapp.m.

47  :sender
48 {
49  return YES;
50 }
#define YES
Definition: scanargs.c:59
- (int) appOpenFile: (const char *)  fullPath
type: (const char *)  type 

Definition at line 34 of file Myapp.m.

References RLE::init, and RLE::open:.

34  :(const char *)fullPath type:(const char *)type
35 {
36  id ptr;
37 
38  [self activateSelf:NO];
39  if (!strcmp(type,"rle"))
40  ptr = [[RLE alloc]init];
41  else
42  ptr = [[RASF alloc]init];
43  [ptr open:(char *)fullPath];
44  return YES;
45 }
int type
Definition: getx11.c:92
Definition: RLE.h:13
int * ptr
Definition: scanargs.c:57
#define YES
Definition: scanargs.c:59
Definition: RASF.h:13
void init()
Definition: painttorle.c:177

Here is the call graph for this function:

+ (id) new
- (id) openfile: (id)  sender

Definition at line 52 of file Myapp.m.

References openpanel.

52  :sender
53 {
54  char temp[1024];
55  char directory[1024];
56  char *extension;
57  id ptr;
58  int loop;
59  static const char *const opentypes[] = {"rle","rasf",NULL};
60 
61  openpanel = [OpenPanel new];
62 
63  [openpanel allowMultipleFiles:YES];
64 
65  if ([openpanel runModalForTypes:opentypes]) {
66  loop = 0;
67  strncpy(directory,[openpanel directory],1024);
68  while ([openpanel filenames][loop]) {
69  sprintf(temp,"%s/%s",directory,[openpanel filenames][loop]);
70  extension = rindex(temp,'.');
71  if (!strcmp(extension,".rle"))
72  ptr = [[RLE alloc]init];
73  else
74  ptr = [[RASF alloc]init];
75 
76  [ptr open:temp];
77  ++loop;
78  }
79  }
80  return(self);
81 }
#define rindex
Definition: rle_config.h:97
id openpanel
Definition: Myapp.h:13
static char temp[]
Definition: into.c:45
Definition: RLE.h:13
int * ptr
Definition: scanargs.c:57
Definition: RASF.h:13
- (id) print: (id)  sender

Definition at line 83 of file Myapp.m.

83  :sender
84 {
85  [[mainWindow contentView] printPSCode:sender];
86  return(self);
87 }
- (return(self))
implementation
- (id) save: (id)  sender

Definition at line 89 of file Myapp.m.

References savepanel, savePanelAccessory, and saveType.

89  :sender
90 {
91  savepanel = [SavePanel new];
92  [savepanel setAccessoryView:savePanelAccessory];
93  [savepanel setRequiredFileType:"tiff"];
94  [savepanel setTitle:"Save To TIFF"];
95  [compPopUP setEnabled:YES];
96  saveType = 1;
97 
98  if (mainWindow != nil){
99  if ([savepanel runModal]){
100  if (saveType == 1){
101  [[mainWindow contentView] saveAsTiff:[savepanel filename] usingCompression:[self setCompType]];
102  }else{
103  [[mainWindow contentView] saveAsEPS:[savepanel filename]];
104  }
105  }
106  }
107  return(self);
108 }
id savepanel
Definition: Myapp.h:14
int saveType
Definition: Myapp.h:17
- (id) saveTypeEPS: (id)  sender

Definition at line 110 of file Myapp.m.

References savepanel, and saveType.

110  :sender
111 {
112  [savepanel setRequiredFileType:"eps"];
113  [savepanel setTitle:"Save To EPS"];
114  [compPopUP setEnabled:NO];
115  saveType = 2;
116  return (self);
117 }
int saveType
Definition: Myapp.h:17
- (id) saveTypeTiff: (id)  sender

Definition at line 119 of file Myapp.m.

References savepanel, and saveType.

119  :sender
120 {
121  [savepanel setRequiredFileType:"tiff"];
122  [savepanel setTitle:"Save To TIFF"];
123  [compPopUP setEnabled:YES];
124  saveType = 1;
125  return(self);
126 }
int saveType
Definition: Myapp.h:17
- (int) setCompType

Definition at line 128 of file Myapp.m.

References compPopUP.

129 {
130 
131  const char *selected_Cell = [[compPopUP selectedCell] title];
132 
133  switch(selected_Cell[0]){
134  case 'L':
135  return(NX_TIFF_COMPRESSION_LZW);
136  case 'P':
137  return(NX_TIFF_COMPRESSION_PACKBITS);
138  case 'N':
139  return(NX_TIFF_COMPRESSION_NONE);
140  case 'J':
141  return(NX_TIFF_COMPRESSION_JPEG);
142  }
143  return(NX_TIFF_COMPRESSION_LZW);
144 }

Field Documentation

- (id) compPopUP
protected

Definition at line 16 of file Myapp.h.

Referenced by setCompType.

- (id) openpanel
protected

Definition at line 13 of file Myapp.h.

Referenced by openfile:.

- (id) savepanel
protected

Definition at line 14 of file Myapp.h.

Referenced by save:, saveTypeEPS:, and saveTypeTiff:.

- (id) savePanelAccessory
protected

Definition at line 15 of file Myapp.h.

Referenced by save:.

- (int) saveType
protected

Definition at line 17 of file Myapp.h.

Referenced by save:, saveTypeEPS:, and saveTypeTiff:.


The documentation for this class was generated from the following files: