ROVLib2
RISCOSC++applicationdevelopmentlibrary
wimp_icons.h
1 #pragma once
2 
3 #include "wimp_basics.h"
4 
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9 
10  typedef union
11  {
12  struct
13  {
14  unsigned ifContainsText : 1; // 0
15  unsigned ifIsSprite : 1; // 1
16  unsigned ifHasBorder : 1; // 2
17  unsigned ifContentsCentredHorzontally : 1; // 3
18  unsigned ifContentsCentredVertically : 1; // 4
19  unsigned ifFilledBackground : 1; // 5
20  unsigned ifAntialisedFont : 1; // 6
21  unsigned ifNeedsHelp : 1; // 7
22  unsigned ifDataIndirected : 1; // 8
23  unsigned ifRightJustified : 1; // 9
24  unsigned ifDontCancelESG : 1; // 10
25  unsigned ifHalfSizeSprite : 1; // 11
26  unsigned ifIconButtonType : 4; // 12 .. 15
27  unsigned ifESGMask : 5; // 16 .. 20
28  unsigned ifInverted : 1; // 21
29  unsigned ifShaded : 1; // 22
30  unsigned ifDelted : 1; // 23
31  unsigned ifForegroundColour : 4; // 24 .. 27
32  unsigned ifBackgroundColour : 4; // 28..31
33  };
34  unsigned int ifFlags;
35  } sIconFlags; // if
36 
37  typedef struct
38  {
39  unsigned : 24;
40  unsigned ifFontHandle : 8;
42 
43  typedef union
44  {
45  unsigned int uiaIconData[3];
46  byte baIconData[12];
47  char caIconData[12];
48  struct
49  {
50  char* pcaTextbuffer;
51  const char* kpcaValidationString;
52  int iBufferLength;
53  } indirectedText;
54  struct
55  {
56  union
57  {
58  const char* kpcaSpriteName;
59  const byte* kpbaSprite;
60  };
61  const byte* kpbaSpriteBlock;
62  int iSpriteNameLength;
63  } indirectedSpriteOnly;
64  } uIconData; // id
65 
66  typedef struct
67  {
68  tWindowHandle whWindow;
69  tLocation lMinimum;
70  tLocation lMaximum;
71  union
72  {
73  sIconFlags ifFlags;
74  sIconFontFlags ifFontFlags;
75  unsigned int uiFlags;
76  };
77  uIconData idData;
78  } tIconCreateBlock; // icb
79 
80 #define WIMP_SPRITEAREA ((byte*)-1)
81 
82  typedef enum
83  {
84  ibtIgnoreClicks = 0,
85  ibtNotifyContinuously = 1,
86  ibtClickNotifiesAutoRepeat = 2,
87  ibtClickNotifiedOnce = 3,
88  ibtClickSelectsReleaseNotifies = 4,
89  ibtClickSelectsDoubleClickNotifies = 5,
90  ibtClickNotifiesOnceAndDrag = 6,
91  ibtClickSelectsReleaseNotifiesAndDrag = 7,
92  ibtClickSelectsDoubleClickNotifiesAndDrag = 8,
93  ibtClickDragDoubleClick = 9,
94  ibtClickSelectsReturnsAndDrag = 10,
95  ibtClickGainCaretAndDrag = 14,
96  ibtClickGainCaret = 15
97  } eIconButtonTypes; // ibt
98 
99  const tIconHandle wimp_createicon(const tIconCreateBlock* kpicbIcon);
100  void wimp_deleteicon(const tWindowHandle kwhWindow, const tIconHandle kihIcon);
101 
102 #ifdef __cplusplus
103 }
104 #endif