00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef MMSTHEMEBASE_H_
00034 #define MMSTHEMEBASE_H_
00035
00036 #include "mmstools/mmstafffile.h"
00037 #include "mmsgui/mmsguitools.h"
00038
00039
00040
00041
00042 typedef enum {
00043
00044 MMSALIGNMENT_NOTSET=0,
00045
00046 MMSALIGNMENT_CENTER,
00047
00048 MMSALIGNMENT_LEFT,
00049
00050 MMSALIGNMENT_RIGHT,
00051
00052 MMSALIGNMENT_JUSTIFY,
00053
00054 MMSALIGNMENT_TOP_CENTER,
00055
00056 MMSALIGNMENT_TOP_LEFT,
00057
00058 MMSALIGNMENT_TOP_RIGHT,
00059
00060 MMSALIGNMENT_TOP_JUSTIFY,
00061
00062 MMSALIGNMENT_BOTTOM_CENTER,
00063
00064 MMSALIGNMENT_BOTTOM_LEFT,
00065
00066 MMSALIGNMENT_BOTTOM_RIGHT,
00067
00068 MMSALIGNMENT_BOTTOM_JUSTIFY
00069 } MMSALIGNMENT;
00070
00071
00072 MMSALIGNMENT getAlignmentFromString(string inputstr);
00073 MMSALIGNMENT swapAlignmentHorizontal(MMSALIGNMENT alignment);
00074
00075 typedef enum {
00076 MMSDIRECTION_NOTSET=0,
00077 MMSDIRECTION_LEFT,
00078 MMSDIRECTION_RIGHT,
00079 MMSDIRECTION_UP,
00080 MMSDIRECTION_DOWN,
00081 MMSDIRECTION_UP_LEFT,
00082 MMSDIRECTION_UP_RIGHT,
00083 MMSDIRECTION_DOWN_LEFT,
00084 MMSDIRECTION_DOWN_RIGHT,
00085 MMSDIRECTION_SIZE
00086 } MMSDIRECTION;
00087
00088
00089 MMSDIRECTION getDirectionFromString(string inputstr);
00090
00091
00092 typedef enum {
00093 MMSPOSITION_NOTSET=0,
00094 MMSPOSITION_LEFT,
00095 MMSPOSITION_RIGHT,
00096 MMSPOSITION_TOP,
00097 MMSPOSITION_BOTTOM,
00098 MMSPOSITION_TOP_LEFT,
00099 MMSPOSITION_TOP_RIGHT,
00100 MMSPOSITION_BOTTOM_LEFT,
00101 MMSPOSITION_BOTTOM_RIGHT,
00102 MMSPOSITION_SIZE
00103 } MMSPOSITION;
00104
00105
00106 MMSPOSITION getPositionFromString(string inputstr);
00107
00108
00109 #define MMSTHEMECLASS_INIT_STRING(x) \
00110 this->ed.x = NULL; \
00111 this->id.is##x = false;
00112
00113 #define MMSTHEMECLASS_FREE_STRING(x) \
00114 if (this->ed.x) delete this->ed.x; \
00115 this->ed.x = NULL; \
00116 this->id.is##x = false;
00117
00118 #define MMSTHEMECLASS_SET_STRING(x) \
00119 if (!this->ed.x) this->ed.x = new string(x); \
00120 else *(this->ed.x) = x; \
00121 this->id.is##x = true;
00122
00123 #define MMSTHEMECLASS_GET_STRING(x) \
00124 if (!this->id.is##x) return false; \
00125 x = *(this->ed.x); \
00126 return true;
00127
00128
00129
00130 #define MMSTHEMECLASS_INIT_STRINGS(x,c) \
00131 for (int cc=0;cc<c;cc++) \
00132 this->ed.x[cc] = NULL; \
00133 this->id.is##x = false;
00134
00135 #define MMSTHEMECLASS_FREE_STRINGS(x,c) \
00136 for (int cc=0;cc<c;cc++) { \
00137 if (this->ed.x[cc]) delete this->ed.x[cc]; \
00138 this->ed.x[cc] = NULL; \
00139 } \
00140 this->id.is##x = false;
00141
00142 #define MMSTHEMECLASS_SET_STRINGS(x,c,y) \
00143 if (!this->ed.x[c]) this->ed.x[c] = new string(y); \
00144 else *(this->ed.x[c]) = y; \
00145 this->id.is##x = true;
00146
00147 #define MMSTHEMECLASS_GET_STRINGS(x,c,y) \
00148 if (!this->id.is##x) return false; \
00149 if (!this->ed.x[c]) return false; \
00150 y = *(this->ed.x[c]); \
00151 return true;
00152
00153 #define MMSTHEMECLASS_UNSET_STRINGS(x,c) \
00154 for (int cc=0;cc<c;cc++) \
00155 if (this->ed.x[cc]) *(this->ed.x[cc]) = ""; \
00156 this->id.is##x = false;
00157
00158
00159
00160 #define MMSTHEMECLASS_INIT_BASIC(x) \
00161 this->id.is##x = false;
00162
00163 #define MMSTHEMECLASS_FREE_BASIC(x) \
00164 this->id.is##x = false;
00165
00166 #define MMSTHEMECLASS_SET_BASIC(x) \
00167 this->id.x = x; \
00168 this->id.is##x = true;
00169
00170 #define MMSTHEMECLASS_GET_BASIC(x) \
00171 if (!this->id.is##x) return false; \
00172 x = this->id.x; \
00173 return true;
00174
00175
00176 #define MMSTHEMECLASS_UNSET(x) \
00177 this->id.is##x = false;
00178
00179 #define MMSTHEMECLASS_ISSET(x) \
00180 return this->id.is##x;
00181
00182
00183
00184
00185 #define startTAFFScan \
00186 { bool first=true; int attrid; char *attrval_str; int attrval_int; \
00187 while (1) { \
00188 if (first) { attrid=tafff->getFirstAttribute(&attrval_str, &attrval_int); first=false; } else \
00189 attrid=tafff->getNextAttribute(&attrval_str, &attrval_int); \
00190 if (attrid<0) break;
00191
00192 #define endTAFFScan } }
00193
00194
00195 #define startTAFFScan_WITHOUT_ID \
00196 { bool first=true; int attrid; char *attrval_str; int attrval_int; char *attrname; \
00197 while (1) { \
00198 if (first) { attrid=tafff->getFirstAttribute(&attrval_str, &attrval_int, &attrname); first=false; } else \
00199 attrid=tafff->getNextAttribute(&attrval_str, &attrval_int, &attrname); \
00200 while((attrid>=0)&&(attrid!=MMSTAFF_ATTR_WITHOUT_ID)) attrid=tafff->getNextAttribute(&attrval_str,&attrval_int,&attrname); \
00201 if (attrid<0) break;
00202
00203 #define endTAFFScan_WITHOUT_ID } }
00204
00205
00206
00207 #define ISATTRNAME(aname) ((strcmp(attrname, GETATTRNAME(aname))==0)?(tafff->convertString2TaffAttributeType(GETATTRTYPE(aname), attrval_str, &attrval_str_valid, &int_val_set, &byte_val_set, p_int_val, attrname, attrid, tafff->getCurrentTagName())):(0))
00208
00209
00210
00211
00212 namespace MMSGUI_MMSDIALOG_ATTR {
00213
00214 #define MMSGUI_MMSDIALOG_ATTR_ATTRDESC \
00215 { "name", TAFF_ATTRTYPE_STRING }
00216
00217 #define MMSGUI_MMSDIALOG_ATTR_IDS \
00218 MMSGUI_MMSDIALOG_ATTR_IDS_name
00219
00220 #define MMSGUI_MMSDIALOG_ATTR_INIT { \
00221 MMSGUI_MMSDIALOG_ATTR_ATTRDESC, \
00222 { NULL, TAFF_ATTRTYPE_NONE } \
00223 }
00224
00225 typedef enum {
00226 MMSGUI_MMSDIALOG_ATTR_IDS
00227 } ids;
00228 }
00229
00230
00231 namespace MMSGUI_BASE_ATTR {
00232
00233 #define MMSGUI_BASE_ATTR_ATTRDESC \
00234 { "name", TAFF_ATTRTYPE_NE_STRING }, \
00235 { "type", TAFF_ATTRTYPE_NE_STRING }, \
00236 { "class", TAFF_ATTRTYPE_NE_STRING }, \
00237 { "size", TAFF_ATTRTYPE_STRING }, \
00238 { "min_width", TAFF_ATTRTYPE_STRING }, \
00239 { "min_height", TAFF_ATTRTYPE_STRING }, \
00240 { "max_width", TAFF_ATTRTYPE_STRING }, \
00241 { "max_height", TAFF_ATTRTYPE_STRING }, \
00242 { "show", TAFF_ATTRTYPE_BOOL }
00243
00244 #define MMSGUI_BASE_ATTR_IDS \
00245 MMSGUI_BASE_ATTR_IDS_name, \
00246 MMSGUI_BASE_ATTR_IDS_type, \
00247 MMSGUI_BASE_ATTR_IDS_class, \
00248 MMSGUI_BASE_ATTR_IDS_size, \
00249 MMSGUI_BASE_ATTR_IDS_min_width, \
00250 MMSGUI_BASE_ATTR_IDS_min_height, \
00251 MMSGUI_BASE_ATTR_IDS_max_width, \
00252 MMSGUI_BASE_ATTR_IDS_max_height, \
00253 MMSGUI_BASE_ATTR_IDS_show
00254
00255 #define MMSGUI_BASE_ATTR_INIT { \
00256 MMSGUI_BASE_ATTR_ATTRDESC, \
00257 { NULL, TAFF_ATTRTYPE_NONE } \
00258 }
00259
00260 typedef enum {
00261 MMSGUI_BASE_ATTR_IDS
00262 } ids;
00263 }
00264
00265
00266
00267
00268
00269 #endif
00270
00271