DataBaseLoad.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*****************************************************************************
  24. *
  25. * File: DataBaseLoad.h
  26. *
  27. * Project: DT
  28. *
  29. * Description: This file contains the external defines and function
  30. * declarations for DataBaseLoad.c
  31. *
  32. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  33. * (c) Copyright 1993, 1994 International Business Machines Corp.
  34. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  35. * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
  36. *
  37. ****************************************************************************/
  38. #include <Xm/ColorObjP.h>
  39. #include <Dt/Message.h>
  40. #include <Dt/ActionP.h>
  41. #ifndef _databaseload_h
  42. #define _databaseload_h
  43. /************************************************************************
  44. *
  45. * Suffix definition for the front panel file type.
  46. *
  47. ************************************************************************/
  48. #define FILE_TYPE_SUFFIX ".fp"
  49. /************************************************************************
  50. *
  51. * Defines for the total number of entry types and an array which
  52. * holds the string defining the entrys.
  53. *
  54. ************************************************************************/
  55. #define TOTAL_ENTRY_COUNT 5
  56. #define PANEL 0
  57. #define BOX 1
  58. #define SUBPANEL 2
  59. #define SWITCH 3
  60. #define CONTROL 4
  61. extern char * entry_types[];
  62. extern char * control_types[];
  63. extern char * resolution_types[];
  64. extern char * monitor_types[];
  65. #define HIGH 0
  66. #define MEDIUM 1
  67. #define LOW 2
  68. #define MATCH_DISPLAY 3
  69. #define DOUBLE_CLICK 0
  70. #define SINGLE_CLICK 1
  71. #define CONTROL_BLANK 0
  72. #define CONTROL_BUSY 1
  73. #define CONTROL_ICON 2
  74. #define CONTROL_CLIENT 3
  75. #define CONTROL_CLOCK 4
  76. #define CONTROL_DATE 5
  77. #define CONTROL_FILE 6
  78. #define POSITION_FIRST 0
  79. #define POSITION_LAST 100
  80. #define MONITOR_NONE 0
  81. #define MONITOR_MAIL 1
  82. #define MONITOR_FILE 2
  83. #define FP_HELP_VOLUME "FPanel"
  84. #define PANEL_HANDLE "FPOnItemPanelHandle"
  85. #define PANEL_MENU "FPOnItemPanelMenu"
  86. #define PANEL_ICONIFY "FPOnItemPanelIconify"
  87. #define SUBPANEL_ACCESS_AREA "FPOnItemAccessArea"
  88. #define MONITOR_INDICATOR "FPOnItemMonitorIndicator"
  89. #define SWITCH_BUTTON "FPOnItemSwitchButton"
  90. #define INSTALL_ZONE "FPOnItemInstallZone"
  91. /************************************************************************
  92. *
  93. * Main structure definitions for the data of each type of front panel
  94. * record.
  95. *
  96. ************************************************************************/
  97. typedef struct
  98. {
  99. char * record_keyword;
  100. char ** field_keywords;
  101. int num_field_keywords;
  102. } ComponentType;
  103. typedef struct
  104. {
  105. Boolean use_default;
  106. char * string_value;
  107. void * parsed_value;
  108. } ElementValue;
  109. typedef struct
  110. {
  111. ElementValue * element_values;
  112. } RecordData;
  113. typedef struct
  114. {
  115. int flags;
  116. int x;
  117. int y;
  118. int width;
  119. int height;
  120. } GeometryData;
  121. typedef struct
  122. {
  123. char * action_name;
  124. char * action_label;
  125. DtActionArg * aap;
  126. int count;
  127. } PanelActionData;
  128. typedef struct
  129. {
  130. char * file_name;
  131. char * component_name;
  132. int component_type;
  133. char * parent_name;
  134. int parent_type;
  135. Boolean delete;
  136. } DynamicComponent;
  137. /************************************************************************
  138. *
  139. * Main structure definitions for each type of Front Panel record.
  140. * Each start with the set of element values. This is required inorder
  141. * to cast to a generic structure which can then be used to process the
  142. * lists of data.
  143. *
  144. ************************************************************************/
  145. typedef struct _PanelData PanelData;
  146. typedef struct _BoxData BoxData;
  147. typedef struct _SubpanelData SubpanelData;
  148. typedef struct _SwitchData SwitchData;
  149. typedef struct _ControlData ControlData;
  150. typedef struct _PopupData PopupData;
  151. typedef struct _AnimationData AnimationData;
  152. typedef struct _AnimationItem AnimationItem;
  153. /* Panel record defines and structure declarations */
  154. #define PANEL_KEYWORD_COUNT 13
  155. #define PANEL_NAME 0
  156. #define PANEL_GEOMETRY 1
  157. #define PANEL_DISPLAY_HANDLES 2
  158. #define PANEL_DISPLAY_MENU 3
  159. #define PANEL_DISPLAY_MINIMIZE 4
  160. #define PANEL_RESOLUTION 5
  161. #define PANEL_CONTROL_BEHAVIOR 6
  162. #define PANEL_DISPLAY_CONTROL_LABELS 7
  163. #define PANEL_SUBPANEL_UNPOST 8
  164. #define PANEL_LOCKED 9
  165. #define PANEL_HELP_STRING 10
  166. #define PANEL_HELP_VOLUME 11
  167. #define PANEL_HELP_TOPIC 12
  168. struct _PanelData
  169. {
  170. ElementValue * element_values;
  171. BoxData ** box_data;
  172. int box_data_count;
  173. Widget shell;
  174. Widget form;
  175. Widget left_handle;
  176. Widget right_handle;
  177. Widget menu;
  178. Widget iconify;
  179. int resolution;
  180. unsigned int main_icon_size;
  181. unsigned int sub_icon_size;
  182. unsigned int switch_icon_size;
  183. XmFontList font_list;
  184. XmFontList date_font_list;
  185. int color_use;
  186. XmPixelSet * pixel_set;
  187. XmPixelSet * active_pixel_set;
  188. XmPixelSet * inactive_pixel_set;
  189. XmPixelSet * primary_pixel_set;
  190. XmPixelSet * secondary_pixel_set;
  191. int pixel_set_count;
  192. Cursor busy_cursor;
  193. ControlData * busy_light_data;
  194. XtPointer global_data;
  195. XtPointer screen_data;
  196. PopupData * popup_data;
  197. XtPointer push_recall_list;
  198. int push_recall_count;
  199. int max_push_recall_count;
  200. XtPointer embedded_client_list;
  201. int embedded_client_count;
  202. int max_embedded_client_count;
  203. AnimationData * animation_data;
  204. int animation_count;
  205. DynamicComponent ** dynamic_data_list;
  206. int dynamic_data_count;
  207. int max_dynamic_data_count;
  208. Boolean use_color_icons;
  209. int switch_row_count;
  210. char * app_name;
  211. };
  212. /************************************************************************
  213. *
  214. * panel -- This global contains the top of the frontpanel data, widgets,
  215. * and any other data defining the layout/content/processing.
  216. *
  217. ************************************************************************/
  218. extern PanelData panel;
  219. #define O_Shell(o) (panel.shell)
  220. /* Box record defines and structure declarations */
  221. #define BOX_KEYWORD_COUNT 8
  222. #define BOX_NAME 0
  223. #define BOX_CONTAINER_NAME 1
  224. #define BOX_POSITION_HINTS 2
  225. #define BOX_LOCKED 3
  226. #define BOX_DELETE 4
  227. #define BOX_HELP_STRING 4
  228. #define BOX_HELP_VOLUME 6
  229. #define BOX_HELP_TOPIC 7
  230. struct _BoxData
  231. {
  232. ElementValue * element_values;
  233. ControlData ** control_data;
  234. int control_data_count;
  235. Widget form;
  236. Widget left_arrow_form;
  237. Widget left_control_form;
  238. Widget right_arrow_form;
  239. Widget right_control_form;
  240. SwitchData * switch_data;
  241. Widget switch_form;
  242. Widget switch_edit;
  243. int subpanel_count;
  244. };
  245. /* Subpanel record defines and structure declarations */
  246. #define SUBPANEL_KEYWORD_COUNT 9
  247. #define SUBPANEL_NAME 0
  248. #define SUBPANEL_CONTAINER_NAME 1
  249. #define SUBPANEL_CONTROL_INSTALL 2
  250. #define SUBPANEL_TITLE 3
  251. #define SUBPANEL_LOCKED 4
  252. #define SUBPANEL_DELETE 5
  253. #define SUBPANEL_HELP_STRING 6
  254. #define SUBPANEL_HELP_VOLUME 7
  255. #define SUBPANEL_HELP_TOPIC 8
  256. struct _SubpanelData
  257. {
  258. ElementValue * element_values;
  259. ControlData ** control_data;
  260. int control_data_count;
  261. ControlData * parent_control_data;
  262. ControlData * default_control;
  263. Widget shell;
  264. Widget form;
  265. Widget dropzone;
  266. Widget separator;
  267. Widget main_panel_icon_copy;
  268. Boolean torn;
  269. Position posted_x;
  270. };
  271. /* Switch record defines and structure declarations */
  272. #define SWITCH_KEYWORD_COUNT 9
  273. #define SWITCH_NAME 0
  274. #define SWITCH_CONTAINER_NAME 1
  275. #define SWITCH_POSITION_HINTS 2
  276. #define SWITCH_NUMBER_OF_ROWS 3
  277. #define SWITCH_LOCKED 4
  278. #define SWITCH_DELETE 5
  279. #define SWITCH_HELP_STRING 6
  280. #define SWITCH_HELP_VOLUME 7
  281. #define SWITCH_HELP_TOPIC 8
  282. struct _SwitchData
  283. {
  284. ElementValue * element_values;
  285. ControlData ** control_data;
  286. int control_data_count;
  287. BoxData * box_data;
  288. Widget rc;
  289. Widget * buttons;
  290. Atom * atom_names;
  291. char ** switch_names;
  292. int switch_count;
  293. int active_switch;
  294. PopupData * popup_data;
  295. Time time_stamp;
  296. };
  297. /* Control record defines and structure declarations */
  298. #define CONTROL_KEYWORD_COUNT 23
  299. #define CONTROL_NAME 0
  300. #define CONTROL_TYPE 1
  301. #define CONTROL_CONTAINER_TYPE 2
  302. #define CONTROL_CONTAINER_NAME 3
  303. #define CONTROL_POSITION_HINTS 4
  304. #define CONTROL_NORMAL_ICON 5
  305. #define CONTROL_ALTERNATE_ICON 6
  306. #define CONTROL_LABEL 7
  307. #define CONTROL_PUSH_ACTION 8
  308. #define CONTROL_PUSH_ANIMATION 9
  309. #define CONTROL_DROP_ACTION 10
  310. #define CONTROL_DROP_ANIMATION 11
  311. #define CONTROL_PUSH_RECALL 12
  312. #define CONTROL_MONITOR_TYPE 13
  313. #define CONTROL_CLIENT_NAME 14
  314. #define CONTROL_CLIENT_GEOMETRY 15
  315. #define CONTROL_FILE_NAME 16
  316. #define CONTROL_DATE_FORMAT 17
  317. #define CONTROL_LOCKED 18
  318. #define CONTROL_DELETE 19
  319. #define CONTROL_HELP_STRING 20
  320. #define CONTROL_HELP_VOLUME 21
  321. #define CONTROL_HELP_TOPIC 22
  322. struct _ControlData
  323. {
  324. ElementValue * element_values;
  325. XtPointer parent_data;
  326. char parent_type;
  327. SubpanelData * subpanel_data;
  328. Widget icon;
  329. Widget arrow;
  330. Widget arrow_separator;
  331. Widget indicator;
  332. PanelActionData ** actions;
  333. Boolean is_action;
  334. char * move_action;
  335. char * copy_action;
  336. char * link_action;
  337. unsigned char operation;
  338. };
  339. /* Popup structure declarations */
  340. struct _PopupData
  341. {
  342. Widget popup;
  343. Widget popup_title;
  344. Widget separator1;
  345. Widget separator2;
  346. Widget deinstall_item;
  347. Widget toggle_item;
  348. Widget modify_subpanel_item;
  349. Widget add_ws_item;
  350. Widget help_item;
  351. Widget delete_ws_item;
  352. Widget rename_ws_item;
  353. Widget * action_item;
  354. long action_count;
  355. Boolean subpanel_add_state;
  356. };
  357. /* Animation structure declarations */
  358. struct _AnimationData
  359. {
  360. String name;
  361. int item_count;
  362. AnimationItem * items;
  363. };
  364. struct _AnimationItem
  365. {
  366. String image_name;
  367. int delay;
  368. };
  369. /************************************************************************
  370. *
  371. * External function declarations.
  372. *
  373. ************************************************************************/
  374. extern Boolean FrontPanelReadDatabases (void);
  375. extern void InitParse(char *, ElementValue **);
  376. extern void InitializeControlFields( ElementValue *element_values, char *);
  377. extern void InitializeSubpanelFields (ElementValue * element_values);
  378. extern void _WriteControlElementValues(ElementValue *);
  379. extern void WriteControlComponentFile(ControlData *);
  380. extern void WriteSubpanelComponentFile(SubpanelData *);
  381. extern void RemoveEntry (RecordData * record_data, int record_type);
  382. extern void RemoveControlComponentFile(ControlData *);
  383. extern void RemoveSubpanelComponentFile(SubpanelData *);
  384. extern void SessionAddFileData (char *, char *, int, char *, int, Boolean);
  385. extern void SessionDeleteFileData (char *);
  386. extern void SessionDeleteAll (void);
  387. extern char * SessionFileNameLookup (char *, int, char *, int);
  388. extern void PanelTopicHelpCB(Widget, XtPointer, XtPointer);
  389. extern void BoxTopicHelpCB(Widget, XtPointer, XtPointer);
  390. extern void SubpanelTopicHelpCB(Widget, XtPointer, XtPointer);
  391. extern void SwitchTopicHelpCB(Widget, XtPointer, XtPointer);
  392. extern void ControlTopicHelpCB(Widget, XtPointer, XtPointer);
  393. extern void GeneralTopicHelpCB(Widget, XtPointer, XtPointer);
  394. /*
  395. * macro to get message catalog strings
  396. */
  397. extern char *_DtGetMessage(char *filename, int set, int n, char *s);
  398. #ifndef NO_MESSAGE_CATALOG
  399. # define _FP_CLIENT_CAT_NAME "fp"
  400. # define FPGETMESSAGE(set, number, string)\
  401. _DtGetMessage(_FP_CLIENT_CAT_NAME, set, number, string)
  402. #else
  403. # define FPGETMESSAGE(set, number, string)\
  404. string
  405. #endif
  406. #endif /* _databaseload_h */
  407. /* DON"T ADD ANYTHING AFTER THIS #endif */