| 1 |
root |
1.1 |
#ifndef _Edit_h |
| 2 |
|
|
#define _Edit_h |
| 3 |
|
|
|
| 4 |
|
|
#include "Defines.h" |
| 5 |
|
|
#include "Cnv.h" |
| 6 |
|
|
|
| 7 |
|
|
typedef enum _EditReturn { |
| 8 |
|
|
EditOk = 1, EditError |
| 9 |
|
|
} EditReturn; |
| 10 |
|
|
|
| 11 |
|
|
|
| 12 |
|
|
typedef enum _EditType { |
| 13 |
|
|
Regular = 1, Pick, Wall, ClipBoard |
| 14 |
|
|
} EditType; |
| 15 |
|
|
|
| 16 |
|
|
struct _Edit{ |
| 17 |
|
|
struct _Edit *next; /* in list of editors */ |
| 18 |
|
|
App app; /* in this application context */ |
| 19 |
|
|
MapAttr mapattr; /* map attributes */ |
| 20 |
|
|
Widget w; /* mapEditor widget */ |
| 21 |
|
|
Widget view; /* viewport of mapEditor */ |
| 22 |
|
|
Widget shell; /* shell widget of map */ |
| 23 |
|
|
Map emap; /* map-struct itself */ |
| 24 |
|
|
unsigned int modified:1; /* map has bee touched */ |
| 25 |
|
|
unsigned int read_only:1; /* cannot modify */ |
| 26 |
|
|
unsigned int overwrite:1; /* deletes object under insertion */ |
| 27 |
|
|
unsigned int auto_choose:1; /* select object to inserted */ |
| 28 |
|
|
struct { |
| 29 |
|
|
#if 0 |
| 30 |
|
|
Widget path; |
| 31 |
|
|
Widget size; |
| 32 |
|
|
Widget start; |
| 33 |
|
|
#endif |
| 34 |
|
|
Widget refresh; |
| 35 |
|
|
Widget read_only; |
| 36 |
|
|
Widget weak_walls; |
| 37 |
|
|
Widget overwrite; |
| 38 |
|
|
Widget auto_choose; |
| 39 |
|
|
Widget stacking; |
| 40 |
|
|
} iw; |
| 41 |
|
|
EditType type; |
| 42 |
|
|
}; |
| 43 |
|
|
|
| 44 |
|
|
extern const XRectangle EditRectAll; |
| 45 |
|
|
|
| 46 |
|
|
/* |
| 47 |
|
|
* macros |
| 48 |
|
|
*/ |
| 49 |
|
|
#define EditGetPath(self) (self->emap ? self->emap->path : NULL) |
| 50 |
|
|
#define EditGetMap(self) (self->emap) |
| 51 |
|
|
#define EditIsModified(self) (self->modified) |
| 52 |
|
|
|
| 53 |
|
|
/* |
| 54 |
|
|
* members |
| 55 |
|
|
*/ |
| 56 |
|
|
extern void EditResizeScroll ( Edit self, int width, int height, int dx, int dy ); |
| 57 |
|
|
extern Edit EditCreate ( App app, EditType type, String path ); |
| 58 |
|
|
extern void EditDestroy ( Edit self ); |
| 59 |
|
|
extern void EditUpdate ( Edit self ); |
| 60 |
|
|
extern EditReturn EditSave ( Edit self ); |
| 61 |
|
|
extern EditReturn EditLoad ( Edit self ); |
| 62 |
|
|
extern void EditPerformFill ( Edit self, int x, int y ); |
| 63 |
|
|
extern void EditPerformFillBelow ( Edit self, int x, int y ); |
| 64 |
|
|
extern void EditFillRectangle ( Edit self, XRectangle rec ); |
| 65 |
|
|
extern void EditWipeRectangle ( Edit self, XRectangle rec ); |
| 66 |
|
|
extern void EditShaveRectangle ( Edit self, XRectangle rec ); |
| 67 |
|
|
extern void EditShaveRectangleBelow ( Edit self, XRectangle rec ); |
| 68 |
|
|
extern void EditCopyRectangle ( Edit self, Edit src, XRectangle rect, int sx, int sy ); |
| 69 |
|
|
extern void EditDeletePoint ( Edit self, int x, int y ); |
| 70 |
|
|
extern void EditModified ( Edit self ); |
| 71 |
|
|
extern void EditUnmodified ( Edit self ); |
| 72 |
|
|
extern Boolean EditDelete ( Edit self, int x, int y, int z ); |
| 73 |
|
|
extern Boolean EditInsert ( Edit self, int x, int y, int z ); |
| 74 |
|
|
extern Boolean EditObjectInsert ( Edit self, object *obj, int x, int y, int z ); |
| 75 |
|
|
extern void EditSetPath ( Edit self, String path ); |
| 76 |
|
|
|
| 77 |
|
|
#endif /* _Edit_h */ |
| 78 |
|
|
|
| 79 |
|
|
|