home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h / Wimp < prev    next >
Text File  |  1996-10-16  |  18KB  |  780 lines

  1.  
  2. #ifndef __Desk_Wimp_h
  3. #define __Desk_Wimp_h
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifndef __Desk_Core_h
  8. #include "Desk.Core.h"
  9. #endif
  10. #define Desk_wimp_MAXNAME 12
  11. typedef struct
  12. {
  13. int x, y;
  14. } Desk_wimp_point;
  15. typedef Desk_wimp_point Desk_wimp_coord;
  16. typedef struct
  17. {
  18. Desk_wimp_point min;
  19. Desk_wimp_point max;
  20. } Desk_wimp_rect;
  21. typedef Desk_wimp_rect Desk_wimp_box;
  22. typedef int Desk_window_handle;
  23. typedef int Desk_icon_handle;
  24. typedef int Desk_task_handle;
  25. #define Desk_colour_WHITE 0
  26. #define Desk_colour_GREY0 0
  27. #define Desk_colour_GREY1 1
  28. #define Desk_colour_GREY2 2
  29. #define Desk_colour_GREY3 3
  30. #define Desk_colour_GREY4 4
  31. #define Desk_colour_GREY5 5
  32. #define Desk_colour_GREY6 6
  33. #define Desk_colour_GREY7 7
  34. #define Desk_colour_BLACK 7
  35. #define Desk_colour_DARK_BLUE 8
  36. #define Desk_colour_YELLOW 9
  37. #define Desk_colour_GREEN 10
  38. #define Desk_colour_RED 11
  39. #define Desk_colour_CREAM 12
  40. #define Desk_colour_ARMY_GREEN 13
  41. #define Desk_colour_ORANGE 14
  42. #define Desk_colour_LIGHT_BLUE 15
  43. #define Desk_colour_TRANSPARENT 255 
  44. typedef union
  45. {
  46. int value;
  47. struct
  48. {
  49. unsigned int wimpcolour : 4;
  50. unsigned int gcolaction : 3;
  51. unsigned int foreback : 1;
  52. unsigned int padding : 24;
  53. } data;
  54. } Desk_wimp_colour;
  55. typedef union
  56. {
  57. int value;
  58. struct
  59. {
  60. char gcol;
  61. char red;
  62. char green;
  63. char blue;
  64. } data;
  65. } Desk_palette_entry;
  66. typedef struct
  67. {
  68. Desk_palette_entry colour[16];
  69. Desk_palette_entry border;
  70. Desk_palette_entry mouse1;
  71. Desk_palette_entry mouse2;
  72. Desk_palette_entry mouse3;
  73. } Desk_palette_block;
  74. #define Desk_iconbtype_NEVER 0
  75. #define Desk_iconbtype_ALWAYS 1
  76. #define Desk_iconbtype_AUTOREPEAT 2
  77. #define Desk_iconbtype_CLICK 3
  78. #define Desk_iconbtype_RELEASE 4
  79. #define Desk_iconbtype_DOUBLECLICK 5
  80. #define Desk_iconbtype_CLICKDRAG 6
  81. #define Desk_iconbtype_RELEASEDRAG 7
  82. #define Desk_iconbtype_DOUBLEDRAG 8
  83. #define Desk_iconbtype_MENU 9
  84. #define Desk_iconbtype_DOUBLECLICKDRAG 10
  85. #define Desk_iconbtype_RADIO 11
  86. #define Desk_iconbtype_RESERVED1 12
  87. #define Desk_iconbtype_RESERVED2 13
  88. #define Desk_iconbtype_WRITECLICKDRAG 14
  89. #define Desk_iconbtype_WRITABLE 15
  90. #define Desk_iconbar_RIGHT -1
  91. #define Desk_iconbar_LEFT -2
  92. #define Desk_window_ICONBAR -2
  93. #define Desk_icon_TEXT 0x00000001 
  94. #define Desk_icon_SPRITE 0x00000002 
  95. #define Desk_icon_BORDER 0x00000004 
  96. #define Desk_icon_HCENTRE 0x00000008 
  97. #define Desk_icon_VCENTRE 0x00000010 
  98. #define Desk_icon_FILLED 0x00000020 
  99. #define Desk_icon_FONT 0x00000040 
  100. #define Desk_icon_NEEDSHELP 0x00000080 
  101. #define Desk_icon_INDIRECTED 0x00000100 
  102. #define Desk_icon_RJUSTIFY 0x00000200 
  103. #define Desk_icon_ALLOWADJUST 0x00000400 
  104. #define Desk_icon_HALVESPRITE 0x00000800 
  105. #define Desk_icon_BUTTONTYPE 0x00001000 
  106. #define Desk_icon_SELECTED 0x00200000 
  107. #define Desk_icon_SHADED 0x00400000 
  108. #define Desk_icon_DELETED 0x00800000 
  109. #define Desk_icon_FORECOLOUR 0x01000000 
  110. #define Desk_icon_BACKCOLOUR 0x10000000 
  111. #define Desk_iconvalid_ALLOW 'A'
  112. #define Desk_iconvalid_BORDERTYPE 'R'
  113. #define Desk_iconvalid_DISPLAY 'D'
  114. #define Desk_iconvalid_FONTCOLOURS 'F'
  115. #define Desk_iconvalid_LINESPACE 'L'
  116. #define Desk_iconvalid_SPRITENAME 'S'
  117. #define Desk_iconborder_PLINTH 0
  118. #define Desk_iconborder_SURROUND 1
  119. #define Desk_iconborder_OKBUTTON 2
  120. #define Desk_iconborder_INDENT 3
  121. typedef union
  122. {
  123. unsigned int value;
  124. struct
  125. {
  126. unsigned int garbage1 : 6; 
  127. unsigned int font : 1; 
  128. unsigned int garbage2 : 17; 
  129. unsigned int handle : 8; 
  130. } font;
  131. struct
  132. {
  133. unsigned int text : 1;
  134. unsigned int sprite : 1;
  135. unsigned int border : 1;
  136. unsigned int hcentre : 1;
  137. unsigned int vcentre : 1;
  138. unsigned int filled : 1;
  139. unsigned int font : 1;
  140. unsigned int needshelp : 1;
  141. unsigned int indirected : 1;
  142. unsigned int rightjustify : 1;
  143. unsigned int allowadjust : 1;
  144. unsigned int halfsize : 1;
  145. unsigned int buttontype : 4;
  146. unsigned int esg : 5;
  147. unsigned int selected : 1;
  148. unsigned int shaded : 1;
  149. unsigned int deleted : 1;
  150. unsigned int foreground : 4;
  151. unsigned int background : 4;
  152. } data;
  153. } Desk_icon_flags;
  154. typedef struct
  155. {
  156. char *buffer;
  157. char *validstring;
  158. unsigned int bufflen;
  159. } Desk_icon_indtext;
  160. typedef struct
  161. {
  162. const char *name;
  163. void *spritearea;
  164. unsigned int nameisname;
  165. } Desk_icon_indsprite;
  166. typedef union
  167. {
  168. char text[Desk_wimp_MAXNAME];
  169. Desk_icon_indtext indirecttext;
  170. char spritename[Desk_wimp_MAXNAME];
  171. Desk_icon_indsprite indirectsprite;
  172. } Desk_icon_data;
  173. typedef struct
  174. {
  175. Desk_wimp_box workarearect;
  176. Desk_icon_flags flags;
  177. Desk_icon_data data;
  178. } Desk_icon_block;
  179. typedef struct
  180. {
  181. Desk_window_handle window;
  182. Desk_icon_block icondata;
  183. } Desk_icon_createblock;
  184. typedef union
  185. {
  186. struct
  187. {
  188. unsigned int hastitle : 1; 
  189. unsigned int moveable : 1;
  190. unsigned int hasvscroll : 1; 
  191. unsigned int hashscroll : 1; 
  192. unsigned int autoredraw : 1;
  193. unsigned int pane : 1;
  194. unsigned int nobounds : 1;
  195. unsigned int nobackclose : 1; 
  196. unsigned int scrollrq : 1;
  197. unsigned int scrollrqdebounced : 1;
  198. unsigned int realcolours : 1;
  199. unsigned int backwindow : 1;
  200. unsigned int hotkeys : 1;
  201. unsigned int keeponscreen : 1;
  202. unsigned int ignoreright : 1;
  203. unsigned int ignorebottom : 1;
  204. unsigned int open : 1;
  205. unsigned int top : 1;
  206. unsigned int fullsize : 1;
  207. unsigned int istoggling : 1;
  208. unsigned int focus : 1;
  209. unsigned int forceonce : 1;
  210. unsigned int dummy22 : 1;
  211. unsigned int dummy23 : 1;
  212. unsigned int backicon : 1;
  213. unsigned int closeicon : 1;
  214. unsigned int titlebar : 1;
  215. unsigned int toggleicon : 1;
  216. unsigned int vscroll : 1;
  217. unsigned int adjusticon : 1;
  218. unsigned int hscroll : 1;
  219. unsigned int newflags : 1; 
  220. } data;
  221. int value;
  222. } Desk_window_flags;
  223. typedef struct 
  224. int x : 16; 
  225. int y : 16; 
  226. } Desk_window_minsize;
  227. typedef enum
  228. {
  229. Desk_windowcol_TITLEFORE = 0,
  230. Desk_windowcol_TITLEBACK,
  231. Desk_windowcol_WORKFORE,
  232. Desk_windowcol_WORKBACK,
  233. Desk_windowcol_SCROLLBACK,
  234. Desk_windowcol_SCROLLFORE,
  235. Desk_windowcol_TITLEHILITE
  236. } Desk_window_colourindices;
  237. typedef struct
  238. {
  239. Desk_wimp_box screenrect;
  240. Desk_wimp_point scroll;
  241. Desk_window_handle behind;
  242. Desk_window_flags flags;
  243. char colours[8];
  244. Desk_wimp_box workarearect;
  245. Desk_icon_flags titleflags;
  246. Desk_icon_flags workflags;
  247. void *spritearea;
  248. Desk_window_minsize minsize;
  249. Desk_icon_data title;
  250. unsigned int numicons;
  251. } Desk_window_block;
  252. typedef struct
  253. {
  254. Desk_window_handle window;
  255. Desk_wimp_box screenrect;
  256. Desk_wimp_point scroll;
  257. Desk_window_handle behind;
  258. } Desk_window_openblock;
  259. typedef struct
  260. {
  261. Desk_window_openblock openblock;
  262. Desk_window_flags flags;
  263. } Desk_window_state;
  264. typedef struct
  265. {
  266. Desk_window_handle window;
  267. Desk_window_block block;
  268. } Desk_window_info;
  269. typedef struct
  270. {
  271. Desk_window_handle window;
  272. Desk_wimp_box rect;
  273. Desk_wimp_point scroll;
  274. Desk_wimp_box cliprect;
  275. } Desk_window_redrawblock;
  276. typedef struct
  277. {
  278. Desk_window_handle window;
  279. Desk_wimp_box screenrect;
  280. } Desk_window_outline;
  281. #define Desk_button_ADJUST 0x00000001
  282. #define Desk_button_MENU 0x00000002
  283. #define Desk_button_SELECT 0x00000004
  284. #define Desk_button_DRAGADJUST 0x00000010
  285. #define Desk_button_DRAGSELECT 0x00000040
  286. #define Desk_button_CLICKADJUST 0x00000100
  287. #define Desk_button_CLICKSELECT 0x00000400
  288. #define Desk_button2_CLICKADJUST 0x00000001 
  289. #define Desk_button2_CLICKSELECT 0x00000004 
  290. #define Desk_button2_DRAGADJUST 0x00000010 
  291. #define Desk_button2_DRAGSELECT 0x00000040 
  292. #define Desk_button2_ADJUST 0x00000100 
  293. #define Desk_button2_MENU 0x00000200 
  294. #define Desk_button2_SELECT 0x00000400 
  295. typedef union
  296. {
  297. unsigned int value;
  298. struct
  299. {
  300. unsigned int adjust : 1;
  301. unsigned int menu : 1;
  302. unsigned int select : 1;
  303. unsigned int dummy3 : 1;
  304. unsigned int dragadjust : 1;
  305. unsigned int dummy5 : 1;
  306. unsigned int dragselect : 1;
  307. unsigned int dummy7 : 1;
  308. unsigned int clickadjust : 1;
  309. unsigned int dummy9 : 1;
  310. unsigned int clickselect : 1;
  311. } data;
  312. struct
  313. {
  314. unsigned int clickadjust : 1;
  315. unsigned int dummy1 : 1;
  316. unsigned int clickselect : 1;
  317. unsigned int dummy3 : 1;
  318. unsigned int dragadjust : 1;
  319. unsigned int dummy5 : 1;
  320. unsigned int dragselect : 1;
  321. unsigned int dummy7 : 1;
  322. unsigned int adjust : 1;
  323. unsigned int menu : 1;
  324. unsigned int select : 1;
  325. }
  326. data2; 
  327. } Desk_button_state;
  328. typedef struct
  329. {
  330. Desk_wimp_point pos;
  331. Desk_button_state button;
  332. Desk_window_handle window;
  333. Desk_icon_handle icon;
  334. } Desk_mouse_block;
  335. typedef struct
  336. {
  337. int shapenumber;
  338. char *shapedata;
  339. unsigned int width;
  340. unsigned int height;
  341. Desk_wimp_point active;
  342. } Desk_pointer_shapeblock;
  343. typedef enum
  344. {
  345. Desk_drag_MOVEWINDOW = 1,
  346. Desk_drag_RESIZEW