| 1 |
root |
1.1 |
/* |
| 2 |
|
|
CrossEdit, A Editor for CrossFire, A Multiplayer game |
| 3 |
|
|
for X-windows |
| 4 |
|
|
|
| 5 |
|
|
Copyright (C) 1993 Jarkko Sonninen & Petri Heinila |
| 6 |
|
|
|
| 7 |
|
|
This program is free software; you can redistribute it and/or modify |
| 8 |
|
|
it under the terms of the GNU General Public License as published by |
| 9 |
|
|
the Free Software Foundation; either version 2 of the License, or |
| 10 |
|
|
(at your option) any later version. |
| 11 |
|
|
|
| 12 |
|
|
This program is distributed in the hope that it will be useful, |
| 13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
|
|
GNU General Public License for more details. |
| 16 |
|
|
|
| 17 |
|
|
You should have received a copy of the GNU General Public License |
| 18 |
|
|
along with this program; if not, write to the Free Software |
| 19 |
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 |
|
|
|
| 21 |
|
|
The authors can be reached via e-mail to Jarkko.Sonninen@lut.fi |
| 22 |
|
|
or Petri.Heinila@lut.fi . |
| 23 |
|
|
*/ |
| 24 |
|
|
|
| 25 |
|
|
#ifndef _App_h |
| 26 |
|
|
#define _App_h |
| 27 |
|
|
|
| 28 |
|
|
#include "Defines.h" |
| 29 |
|
|
#include "Edit.h" |
| 30 |
|
|
#include "Cnv.h" |
| 31 |
|
|
|
| 32 |
|
|
/**********************************************************************/ |
| 33 |
|
|
|
| 34 |
|
|
typedef struct { |
| 35 |
|
|
Widget w; |
| 36 |
pippijn |
1.2 |
const char *name; |
| 37 |
root |
1.1 |
unsigned long flags; |
| 38 |
|
|
} ArchFlagsRec; |
| 39 |
|
|
|
| 40 |
|
|
|
| 41 |
|
|
typedef struct { |
| 42 |
|
|
Widget w; |
| 43 |
|
|
unsigned long flags; |
| 44 |
|
|
unsigned int all:1; |
| 45 |
|
|
} Arch; |
| 46 |
|
|
|
| 47 |
|
|
/* |
| 48 |
|
|
* item to insert |
| 49 |
|
|
*/ |
| 50 |
|
|
typedef struct { |
| 51 |
|
|
Widget w; /* ??? */ |
| 52 |
|
|
Widget name; /* name of insrted object */ |
| 53 |
|
|
Widget face; /* inserted object looks like this */ |
| 54 |
|
|
Edit edit; /* cloned object comes from this Edit */ |
| 55 |
|
|
object *clone; /* clone this object */ |
| 56 |
|
|
int wall_set; /* if wall use this set */ |
| 57 |
|
|
mapstruct *wall_map; /* if wall use this Map */ |
| 58 |
|
|
} Item; |
| 59 |
|
|
/* |
| 60 |
|
|
* Item or area to look about |
| 61 |
|
|
*/ |
| 62 |
|
|
typedef struct { |
| 63 |
|
|
Widget w; /* ??? */ |
| 64 |
|
|
Widget info; /* ??? */ |
| 65 |
|
|
Widget menu; /* ??? */ |
| 66 |
|
|
Edit edit; /* last selected area fro this editor */ |
| 67 |
|
|
XRectangle rect; /* rectangle over selected area */ |
| 68 |
|
|
} Look; |
| 69 |
|
|
|
| 70 |
|
|
/* |
| 71 |
|
|
* Application Resources. Some can be setted by command line flags |
| 72 |
|
|
*/ |
| 73 |
|
|
typedef struct { |
| 74 |
|
|
Dimension mapWidth; /* maximum width of shown map */ |
| 75 |
|
|
Dimension mapHeight; /* maximum height of shown map */ |
| 76 |
|
|
Boolean usePixmaps; /* use pixmaps instead fonts */ |
| 77 |
|
|
Boolean useColorPixmaps; /* use color pixmaps instead fonts */ |
| 78 |
|
|
Boolean usePng; /* use png images instead fonts */ |
| 79 |
|
|
String cmdCrossfire; /* to run crossfire */ |
| 80 |
|
|
String cmdReset; /* to run reset on crossfire */ |
| 81 |
|
|
String cmdGoto; /* to run goto on crossfire */ |
| 82 |
|
|
String creator; /* user configurable own name */ |
| 83 |
|
|
String email; /* user configurable internet address */ |
| 84 |
|
|
} AppRes; |
| 85 |
|
|
|
| 86 |
|
|
/* |
| 87 |
|
|
* Application domain data |
| 88 |
|
|
*/ |
| 89 |
|
|
struct _App { |
| 90 |
|
|
Display *display; /* user in this display */ |
| 91 |
|
|
Widget shell; /* application level shell widget */ |
| 92 |
|
|
Edit edit; /* list ofmap editors */ |
| 93 |
|
|
Edit clip; /* clipboard (editor) */ |
| 94 |
|
|
unsigned int clipon:1; /* is clipboard up */ |
| 95 |
|
|
Look look; /* look part in application dialog */ |
| 96 |
|
|
Arch arch; /* archetype list in application dialog */ |
| 97 |
|
|
Item item; /* insertion item part in application dialog */ |
| 98 |
|
|
CnvPath path; /* file selector */ |
| 99 |
|
|
AppRes res; /* application resources */ |
| 100 |
|
|
Attr attr; /* to edit objects attributes */ |
| 101 |
|
|
CnvFiles picks; /* pick some objects */ |
| 102 |
|
|
CnvFiles walls; /* pick some walls */ |
| 103 |
|
|
CnvFiles infof; /* documentation files */ |
| 104 |
|
|
CnvBrowse info; /* to show docs */ |
| 105 |
|
|
}; |
| 106 |
|
|
|
| 107 |
|
|
extern Pixmap *pixmaps; /* list of pixmaps */ |
| 108 |
|
|
|
| 109 |
|
|
/* |
| 110 |
|
|
* Macro interface |
| 111 |
|
|
*/ |
| 112 |
|
|
#define AppItemGetEdit(a) ((a)->item.edit) |
| 113 |
|
|
#define AppItemGetMap(a) ((a)->item.wall_map) |
| 114 |
|
|
#define AppItemGetWall(a) ((a)->item.wall_set) |
| 115 |
|
|
#define AppItemGetObject(a) ((a)->item.clone) |
| 116 |
|
|
|
| 117 |
|
|
#define AppItemNoWall -1 |
| 118 |
|
|
|
| 119 |
|
|
/* |
| 120 |
|
|
* Function interface |
| 121 |
|
|
*/ |
| 122 |
|
|
extern App AppCreate ( XtAppContext appCon, String displayString, XtResource resources[], Cardinal resourcesNum, XrmOptionDescRec *options, Cardinal optionsNum, int *argc, char *argv[] ); |
| 123 |
|
|
extern void AppUpdate ( App self ); |
| 124 |
|
|
extern void AppSelectSet ( App self, Edit edit, XRectangle rect ); |
| 125 |
|
|
extern void AppSelectUnset ( App self ); |
| 126 |
|
|
extern void AppItemSet ( App self, Edit edit, object *obj, int wallSet ); |
| 127 |
|
|
extern void AppEditDeattach ( App self, Edit edit ); |
| 128 |
|
|
|
| 129 |
|
|
#endif /* _App_h */ |
| 130 |
|
|
|
| 131 |
|
|
|