Add WINGs tutorial
[whome.git] / WINGs_tutorial / WINGLib.html
blob000bc9d0fbf322e3c58353fbee5ddee1486b2b38
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!-- saved from url=(0072)WINGLib.html -->
3 <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3 Steps to Make a WINGs User Interface</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="keywords" content="WINGs, wraster, widget library, GUI, Window Maker, Unix, Linux">
6 <meta name="description" content="WINGs/wraster library description">
7 <meta name="license" content="GNU Free Documentation License">
8 </head>
10 <body>
11 <table align="JUSTIFY" width="100%"><tbody><tr><td align="LEFT"><a href="WINGMenu.html">LAST: Programming Details 3</a></td><td align="RIGHT"><a href="WINGtoc.html">Contents</a></td></tr></tbody></table>
14 <h4><a name="WidgetList">Library description: List of Widgets and Sample Code</a></h4>
15 <p>This section lists the prototypes of all the WINGs and a few libwraster functions, some of them with a coding example.
17 </p><h5>General widgets</h5>
18 <ul>
19 <li><code> void WMDestroyWidget (WMWidget *widget) </code>
20 </li><li><code> void WMMapWidget (WMWidget *w) </code>
21 </li><li><code> void WMMoveWidget (WMWidget *w, int x, int y) </code>
22 </li><li><code> void WMRealizeWidget (WMWidget *w) </code>
23 </li><li><code> void WMRedisplayWidget (WMWidget *w) </code>
24 </li><li><code> void WMResizeWidget (WMWidget *w, unsigned int width, unsigned int height) </code>
25 </li><li><code> void WMSetWidgetBackgroundColor (WMWidget *w, WMColor *color) </code>
26 </li><li><code> void WMUnmapWidget (WMWidget *w) </code>
27 </li><li><code> void WMUnmapSubwidgets (WMWidget *w)</code>
28 </li><li><code> unsigned int WMWidgetHeight (WMWidget *w) </code>
29 </li><li><code> unsigned int WMWidgetWidth (WMWidget *w) </code>
30 </li><li><code> Bool WMWidgetIsMapped (WMWidget *w) </code>
31 </li><li><code> WMWidget * WMWidgetOfView (WMView *view) </code>
32 </li><li><code> WMScreen * WMWidgetScreen (WMWidget *w) </code>
33 </li></ul><ul>
34 <li><code> void WMLowerWidget (WMWidget *w) </code>
35 </li><li><code> void WMRaiseWidget (WMWidget *w) </code>
36 </li><li><code> void WMReparentWidget (WMWidget *w, WMWidget *newParent, int x, int y) </code>
37 </li><li><code> void WMSetFocusToWidget (WMWidget *widget) </code>
38 </li><li><code> void WMSetWidgetDefaultBoldFont (WMScreen *scr, WMFont *font) </code>
39 </li><li><code> void WMSetWidgetDefaultFont (WMScreen *scr, WMFont *font) </code>
40 </li><li><code> Window WMWidgetXID (WMWidget *w) </code>
41 </li><li><code> WMColor * WMGetWidgetBackgroundColor (WMWidget *w) </code>
42 </li></ul>
43 <h5><a name="Frames">Frames</a></h5>
44 A frame can be used to group widgets. When moving widgets, their position will be calculated with respect to the upper left corner of their parent frame. A frame has a WMView. Title position definitions are <a href="WINGLib.html#TitlePositions">here</a>. WMReliefType WMFlat will make the frame's border invisible.
45 <ul><li><code>WMFrame * WMCreateFrame (WMWidget *parent)</code>
46 </li><li><code>void WMSetFrameTitle (WMFrame *fPtr, char *title)</code>
47 </li><li><code> void WMSetFrameTitlePosition (WMFrame *fPtr,
48 WMTitlePosition position)</code>
49 </li><li><code> void WMSetFrameRelief (WMFrame *fPtr,
50 WMReliefType relief)</code>
51 </li></ul>
54 <h5>Panels</h5>
55 <ul>
56 <li><code> WMWindow * WMCreatePanelForWindow (WMWindow *owner, char *name) </code>
57 </li><li><code> WMWindow * WMCreatePanelWithStyleForWindow (WMWindow *owner, char *name, int style) </code>
58 </li><li><code> WMGenericPanel * WMCreateGenericPanel (WMScreen *scrPtr, WMWindow *owner, char *title, char *defaultButton, char *alternateButton) </code>
59 </li><li><code> void WMDestroyGenericPanel (WMGenericPanel *panel) </code>
60 </li><li><code> void WMChangePanelOwner (WMWindow *win, WMWindow *newOwner) </code>
61 </li></ul>
63 <h5>Windows</h5>
64 <ul>
66 <li><code> WMWindow * WMCreateWindow (WMScreen *screen, char *name) </code>
67 </li><li><code> WMWindow * WMCreateWindowWithStyle (WMScreen *screen, char *name, int style) </code>
68 </li><li><code> void WMCloseWindow (WMWindow *win) </code>
69 </li><li><code> void WMSetWindowCloseAction (WMWindow *win, WMAction *action, void *clientData) </code>
70 </li><li><code> void WMSetWindowAspectRatio (WMWindow *win, int minX, int minY, int maxX, int maxY) </code>
71 </li><li><code> void WMSetWindowBaseSize (WMWindow *win, unsigned width, unsigned height) </code>
72 </li><li><code> void WMSetWindowUserPosition (WMWindow *win, int x, int y) </code>
73 </li><li><code> void WMSetWindowInitialPosition (WMWindow *win, int x, int y) </code>
74 </li><li><code> void WMSetWindowMaxSize (WMWindow *win, unsigned width, unsigned height) </code>
75 </li><li><code> void WMSetWindowMinSize (WMWindow *win, unsigned width, unsigned height) </code>
76 </li><li><code> void WMSetWindowMiniwindowPixmap (WMWindow *win, WMPixmap *pixmap) </code>
77 </li><li><code> void WMSetWindowMiniwindowTitle (WMWindow *win, char *title) </code>
78 </li><li><code> void WMSetWindowLevel (WMWindow *win, int level) </code>
79 </li><li><code> void WMSetWindowResizeIncrements (WMWindow *win, unsigned wIncr, unsigned hIncr) </code>
80 </li><li><code> void WMSetWindowTitle (WMWindow *win, char *title) </code>
81 </li><li><code> void WMSetWindowDocumentEdited (WMWindow *win, Bool flag) </code>
82 </li></ul>
86 <h5><a name="Views">Views</a></h5>
87 <ul>
88 <li><code> WMPoint WMGetViewPosition (WMView *view) </code>
89 </li><li><code> WMPoint WMGetViewScreenPosition (WMView *view) </code>
90 </li><li><code> WMSize WMGetViewSize (WMView *view) </code>
91 </li><li><code> void WMSetViewExpandsToParent (WMView *view, int leftOffs, int topOffs, int rightOffs, int bottomOffs) </code>
92 </li><li><code> void WMSetViewNotifySizeChanges (WMView *view, Bool flag) </code>
93 <ul></ul>
94 </li><li><code> void WMSetViewDragDestinationProcs (WMView *view, WMDragDestinationProcs *procs) </code>
95 </li><li><code> void WMSetViewDragSourceProcs (WMView *view, WMDragSourceProcs *procs) </code>
96 </li><li><code> void WMSetViewNextResponder (WMView *view, WMView *responder) </code></li><li><code> Window WMViewXID (WMView *view)</code>
97 </li></ul>
100 <h5>Buttons<img src="./WINGLib_files/Buttons.jpeg" align="right"></h5>
101 <ul<li><code> WMButton * WMCreateButton (WMWidget *parent, WMButtonType type) </code>
102 <li><code> WMButton * WMCreateCustomButton (WMWidget *parent, int behaviourMask) </code>
103 </li><li><code> void WMGroupButtons (WMButton *bPtr, WMButton *newMember) </code>
104 </li><li><code> void WMSetButtonAction (WMButton *bPtr, WMAction *action, void *clientData) </code>
105 </li><li><code> void WMSetButtonImage (WMButton *bPtr, WMPixmap *image) </code>
106 </li><li><code> void WMSetButtonImageDefault (WMButton *bPtr) </code>
107 </li><li><code> void WMSetButtonImageDimsWhenDisabled (WMButton *bPtr, Bool flag) </code>
108 </li><li><code> void WMSetButtonImagePosition (WMButton *bPtr, WMImagePosition position) </code>
109 </li><li><code> void WMSetButtonText (WMButton *bPtr, char *text) </code>
110 </li><li><code> void WMSetButtonTextAlignment (WMButton *bPtr, WMAlignment alignment) </code>
111 </li><li><code> void WMSetButtonTextColor (WMButton *bPtr, WMColor *color) </code>
112 </li><li><code> void WMSetButtonAltImage (WMButton *bPtr, WMPixmap *image) </code>
113 </li><li><code> void WMSetButtonAltText (WMButton *bPtr, char *text) </code>
114 </li><li><code> void WMSetButtonAltTextColor (WMButton *bPtr, WMColor *color) </code>
115 </li><li><code> void WMSetButtonBordered (WMButton *bPtr, int isBordered) </code>
116 </li><li><code> void WMSetButtonContinuous (WMButton *bPtr, Bool flag) </code>
117 </li><li><code> void WMSetButtonDisabledTextColor (WMButton *bPtr, WMColor *color) </code>
118 </li><li><code> void WMSetButtonFont (WMButton *bPtr, WMFont *font) </code>
119 </li><li><code> void WMSetButtonPeriodicDelay (WMButton *bPtr, float delay, float interval) </code>
120 </li><li><code> void WMSetButtonEnabled (WMButton *bPtr, Bool flag) </code>
121 </li><li><code> void WMSetButtonSelected (WMButton *bPtr, int isSelected) </code>
122 </li><li><code> void WMSetButtonTag (WMButton *bPtr, int tag) </code>
123 </li><li><code> void WMPerformButtonClick (WMButton *bPtr) </code>
124 </li><li><code> int WMGetButtonEnabled (WMButton *bPtr) </code>
125 </li><li><code> int WMGetButtonSelected (WMButton *bPtr) </code>
127 <p> WMButtonType: <code> WBTMomentaryPush, WBTMomentaryChange,WBTMomentaryLight WBTPushOnPushOff, WBTOnOff, WBToggle, WBTSwitch, WBTRadio</code>
129 </p><h5>Button boxes</h5>
130 <ul>
131 <li><code> WMBox * WMCreateBox (WMWidget *parent) </code>
132 </li><li><code> void WMSetBoxBorderWidth (WMBox *box, unsigned width) </code>
133 </li><li><code> void WMSetBoxHorizontal (WMBox *box, Bool flag) </code>
134 </li><li><code> void WMAddBoxSubview (WMBox *bPtr, WMView *view, Bool expand, Bool fill, int minSize, int maxSize, int space) </code>
135 </li><li><code> void WMRemoveBoxSubview (WMBox *bPtr, WMView *view) </code>
136 </li><li><code> void WMAddBoxSubviewAtEnd (WMBox *bPtr, WMView *view, Bool expand, Bool fill, int minSize, int maxSize, int space) </code>
137 </li></ul>
138 <h5>Expanding and pull-down buttons<img src="./WINGLib_files/PullDown.jpeg" width="26%" align="right"></h5>
139 A pop-up button shows a list of buttons when it is clicked. Use the <code>WMSetPopUpButtonPullsDown</code> function with boolean true to make it pull down like a menu. When false, the list will shift, and the current item will be under the mouse pointer.<a href="WINGStep2.html#WMAction">WMAction</a> has been described above. To make the list, you create the first Button, and just use <code>WMAddPopUpButtonItem</code> for the next ones. The numbering starts at 0. You do not need to keep pointers to your labels, as there are functions to get the item number, and,with the item number, the label. The action called is the same for the whole menu list.
140 <ul>
141 <li><code> WMPopUpButton * WMCreatePopUpButton (WMWidget *parent) </code>
142 </li><li><code> WMMenuItem * WMAddPopUpButtonItem (WMPopUpButton *bPtr, char *title) </code>
143 </li><li><code> WMMenuItem * WMInsertPopUpButtonItem (WMPopUpButton *bPtr, int index, char *title) </code>
144 </li><li><code> void WMRemovePopUpButtonItem (WMPopUpButton *bPtr, int index) </code>
145 </li><li><code> void WMSetPopUpButtonAction (WMPopUpButton *bPtr, WMAction *action, void *clientData) </code>
146 </li><li><code> void WMSetPopUpButtonPullsDown (WMPopUpButton *bPtr, Bool flag) </code>
147 </li><li><code> void WMSetPopUpButtonText (WMPopUpButton *bPtr, char *text) </code>
149 </li><li><code> Bool WMGetPopUpButtonEnabled (WMPopUpButton *bPtr) </code>
150 </li><li><code> char * WMGetPopUpButtonItem (WMPopUpButton *bPtr, int index) </code>
151 </li><li><code> Bool WMGetPopUpButtonItemEnabled (WMPopUpButton *bPtr, int index) </code>
152 </li><li><code> WMMenuItem * WMGetPopUpButtonMenuItem (WMPopUpButton *bPtr, int index) </code>
153 </li><li><code> int WMGetPopUpButtonNumberOfItems (WMPopUpButton *bPtr) </code>
154 </li><li><code> int WMGetPopUpButtonSelectedItem (WMPopUpButton *bPtr) </code>
156 </li><li><code> void WMSetPopUpButtonEnabled (WMPopUpButton *bPtr, Bool flag) </code>
157 </li><li><code> void WMSetPopUpButtonItemEnabled (WMPopUpButton *bPtr, int index, Bool flag) </code>
158 </li><li><code> void WMSetPopUpButtonSelectedItem (WMPopUpButton *bPtr, int index) </code>
160 </li></ul>
162 <h5>Text Fields
163 <img src="./WINGLib_files/TextField.jpeg" width="26%" align="right"></h5>A text field is a widget in which the user can type text. Setting it to secure will show asterisks instead of the typed in characters.
164 <ul>
166 <li><code> WMTextField * WMCreateTextField (WMWidget *parent) </code>
167 </li><li><code> void WMDeleteTextFieldRange (WMTextField *tPtr, WMRange range) </code>
168 </li><li><code> void WMSetTextFieldSecure (WMTextField *tPtr, Bool flag) </code>
169 </li><li><code> void WMSetTextFieldText (WMTextField *tPtr, char *text) </code>
170 </li><li><code> char * WMGetTextFieldText (WMTextField *tPtr) </code>
171 </li><li><code> void WMSetTextFieldBordered (WMTextField *tPtr, Bool bordered) </code>
172 </li><li><code> void WMInsertTextFieldText (WMTextField *tPtr, char *text, int position) </code>
173 </li><li><code> void WMSelectTextFieldRange (WMTextField *tPtr, WMRange range) </code>
174 </li><li><code> void WMSetTextFieldAlignment (WMTextField *tPtr, WMAlignment alignment) </code>
175 </li><li><code> void WMSetTextFieldBeveled (WMTextField *tPtr, Bool flag) </code>
176 </li><li><code> void WMSetTextFieldCursorPosition (WMTextField *tPtr, unsigned int position) </code>
177 </li><li><code> void WMSetTextFieldEditable (WMTextField *tPtr, Bool flag) </code>
178 </li><li><code> Bool WMGetTextFieldEditable (WMTextField *tPtr) </code>
179 </li><li><code> void WMSetTextFieldFont (WMTextField *tPtr, WMFont *font) </code>
180 </li><li><code> WMFont * WMGetTextFieldFont (WMTextField *tPtr) </code>
181 </li><li><code> void WMSetTextFieldNextTextField (WMTextField *tPtr, WMTextField *next) </code>
182 </li><li><code> void WMSetTextFieldPrevTextField (WMTextField *tPtr, WMTextField *prev) </code>
183 </li><li><code> WMTextFieldDelegate * WMGetTextFieldDelegate (WMTextField *tPtr) </code>
184 </li><li><code> void WMSetTextFieldDelegate (WMTextField *tPtr, WMTextFieldDelegate *delegate) </code>
186 </li></ul>
188 <h5>Labels
189 <img src="./WINGLib_files/Labels.jpeg" width="26%" align="right"></h5>A label displays text in its parent. WRFlat is the relief type which shows the label without a border. WRSunken and WRSimple are other relief types.
190 <ul>
191 <li><code> WMLabel * WMCreateLabel (WMWidget *parent) </code>
192 </li><li><code> void WMSetLabelRelief (WMLabel *lPtr, WMReliefType relief) </code>
193 </li><li><code> void WMSetLabelText (WMLabel *lPtr, char *text) </code>
194 </li><li><code> void WMSetLabelTextAlignment (WMLabel *lPtr, WMAlignment alignment) </code>
195 </li><li><code> void WMSetLabelTextColor (WMLabel *lPtr, WMColor *color) </code>
196 </li><li><code> void WMSetLabelWraps (WMLabel *lPtr, Bool flag) </code>
197 </li><li><code> void WMSetLabelFont (WMLabel *lPtr, WMFont *font) </code>
198 </li><li><code> void WMSetLabelImage (WMLabel *lPtr, WMPixmap *image) </code>
199 </li><li><code> void WMSetLabelImagePosition (WMLabel *lPtr, WMImagePosition position) </code>
200 </li><li><code> int WMWidthOfString (WMFont *font, char *text,
201 int length)</code>
202 </li><li><code>int W_GetTextHeight (WMFont *font, char *text, int width,
203 int wrap)</code>
204 </li><li><code> WMFont * WMGetLabelFont (WMLabel *lPtr) </code>
205 </li><li><code> WMPixmap * WMGetLabelImage (WMLabel *lPtr) </code>
206 </li><li><code> char * WMGetLabelText (WMLabel *lPtr) </code>
207 </li><li><code> char * WMGetTabViewItemLabel (WMTabViewItem *item) </code>
208 </li></ul>
210 <h5>Sliders
211 <p><img src="./WINGLib_files/Slider.jpeg" width="20%" align="right"></p></h5>
212 The slider's orientation is set by <code>WMResizeWidget</code>ing it. A continuous slider will pass all the values along the way when it is being changed.
213 <ul>
214 <li><code>WMSlider * WMCreateSlider (WMWidget *parent)</code>
215 </li><li><code>int WMGetSlider[Max|Min[]Value (WMSlider *slider)</code>
216 </li><li><code>void WMSetSliderAction (WMSlider *slider,
217 WMAction *action, void *data)</code>
218 </li><li><code> void WMSetSliderContinuous (WMSlider *slider, Bool flag)</code>
220 </li><li><code>void WMSetSlider[Max|Min|]Value (WMSlider *slider, int value)</code>
222 </li><li><code> void WMSetSliderKnobThickness (WMSlider *sPtr,
223 int thickness)</code>
224 </li><li><code> void WMSetSliderImage (WMSlider *sPtr, WMPixmap *pixmap)</code>
225 </li></ul>
228 <h5><img src="./WINGLib_files/scrollview.jpeg" align="right" width="25%">Scrollable views</h5>
229 This widget can have two scrollbars to navigate the widget inside of it.
230 <ul>
231 <li><code> WMScrollView * WMCreateScrollView (WMWidget *parent) </code>
232 </li><li><code> void WMSetScrollViewContentView (WMScrollView *sPtr, WMView *view) </code>
233 </li><li><code> void WMSetScrollViewHasHorizontalScroller (WMScrollView *sPtr, Bool flag) </code>
234 </li><li><code> void WMSetScrollViewHasVerticalScroller (WMScrollView *sPtr, Bool flag) </code>
235 </li><li><code> void WMSetScrollViewLineScroll (WMScrollView *sPtr, int amount) </code>
236 </li><li><code> void WMSetScrollViewPageScroll (WMScrollView *sPtr, int amount) </code>
237 </li><li><code> void WMSetScrollViewRelief (WMScrollView *sPtr, WMReliefType type) </code>
238 </li><li><code> void WMResizeScrollViewContent (WMScrollView *sPtr, unsigned int width, unsigned int height) </code>
239 </li><li><code> void WMScrollViewScrollPoint (WMScrollView *sPtr, WMPoint point) </code>
240 </li><li><code> WMScroller * WMGetScrollViewHorizontalScroller (WMScrollView *sPtr) </code>
241 </li><li><code> WMScroller * WMGetScrollViewVerticalScroller (WMScrollView *sPtr) </code>
242 </li><li><code> WMRect WMGetScrollViewVisibleRect (WMScrollView *sPtr) </code>
244 </li></ul>
246 <h5>Message pop-up windows
247 <img src="./WINGLib_files/AlertPanel.jpeg" width="26%" align="right"></h5><p>A message pop-up window is shown by calling:
248 <code>int WMRunAlertPanel (WMScreen *scrPtr, WMWindow *owner, char *messagetophalf, char *messagebottomhalf, char *defaultButton, char *alternateButton, char *otherButton)</code>
249 The first argument should be the widget's screen, the second the window we are working in. The last three are labels for three buttons. The default button will return WAPRDefault (0) from the function, if clicked, and is the option selected if the user presses 'enter'. The middle and left button return 1 and -1. Only those buttons are shown whose labels are not <kbd>NULL</kbd>.
250 </p><ul>
251 <li><code> WMAlertPanel * WMCreateAlertPanel (WMScreen *scrPtr, WMWindow *owner, char *title, char *msg, char *defaultButton, char *alternateButton, char *otherButton) </code>
252 </li><li><code> void WMDestroyAlertPanel (WMAlertPanel *panel) </code>
253 </li></ul>
256 <h5>Input dialogs
257 <img src="./WINGLib_files/InputDialog.jpeg" width="26%" align="right"></h5>A pop up which asks for input, with a cancel and OK button, is provided through the self explanatory function:
258 <code>char * WMRunInputPanel (WMScreen *screen, WMWindow *owner, char *dialogtitle, char *message,char *defaultText, char *okButtontext, char *cancelButtontext)</code>. Cancel returns a null pointer. The <code>defaultText</code> is presented in the text field in the pop-up, and can be changed by the user.
259 <ul>
260 <li><code> void WMDestroyInputPanel (WMInputPanel *panel) </code>
261 </li><li><code> WMInputPanel * WMCreateInputPanel (WMScreen *scrPtr, WMWindow *owner, char *title, char *msg, char *defaultText, char *okButton, char *cancelButton) </code>
262 </li></ul>
264 <h5><a name="FileSelect">File selection</a> dialogs<img src="./WINGLib_files/OpenFileDialog.jpeg" width="30%" align="right"></h5>
265 File selector and file saving dialogs can be called from the WINGs library rightaway. The file selector window allows the user to browse the file system, open a file, and to delete or create a file or directory. To use it, there are three functions:
266 <ul><li><code> WMOpenPanel * WMGetOpenPanel (WMScreen *screen)</code>
267 </li><li><code>int WMRunModalFilePanelForDirectory (WMFilePanel *panel, WMWindow *owner,char *initialpath,char *title, char **fileTypes)</code>
268 </li><li><code>char * WMGetFilePanelFileName (WMFilePanel *panel)</code>
269 </li><li><code> WMSavePanel * WMGetSavePanel (WMScreen *screen)</code>
270 </li><li><code> void WMSetFilePanelAccessoryView (WMFilePanel *panel, WMView *view) </code>
271 </li><li><code> void WMSetFilePanelAutoCompletion (WMFilePanel *panel, Bool flag) </code>
272 </li><li><code> void WMSetFilePanelCanChooseDirectories (WMFilePanel *panel, Bool flag) </code>
273 </li><li><code> void WMSetFilePanelCanChooseFiles (WMFilePanel *panel, Bool flag) </code>
274 </li><li><code> void WMSetFilePanelDirectory (WMFilePanel *panel, char *path) </code></li><li><code> WMView * WMGetFilePanelAccessoryView (WMFilePanel *panel) </code>
275 </li><li><code> void WMFreeFilePanel (WMFilePanel *panel) </code>
276 </li></ul>
278 To open files there is a struct WMOpenPanel, to close them WMSavePanel. As for the WMView, we take the nature of the Panel as given for now. We just open a pointer to one on the screen we have opened. To open files, the WMOpenPanel pointer is passed to the function <code>WMRunModalFilePanelForDirectory</code>, which makes the file selector pop up. The owner can be set to NULL. initialpath is a string containing the starting directory name. The title is the dialog's title. The dialog has cancel and OK buttons, which make the function return False and True respectively. If True, the selected file name can be retrieved with <code>WMGetFilePanelFileName (WMFilePanel *panel)</code>. To save files, exactly the same functions are used, with the only difference that you pass a pointer to a WMSavePanel.
280 </p><h5><img src="./WINGLib_files/textarea.jpeg" align="right" width="25%"><a name="TextArea">Text Areas</a></h5>
281 FreezeText and thaw before and after appending will make the appended text appear immediately.
282 <ul><li><code>WMText *WMCreateText(WMWidget *parent)</code>
283 </li><li><code> WMText * WMCreateTextForDocumentType (WMWidget *parent, WMAction *parser, WMAction *writer) </code>
284 </li><li><code> void WMAppendTextBlock (WMText *tPtr, void *vtb) </code>
285 </li><li><code> void WMAppendTextStream (WMText *tPtr, char *text) </code>
286 </li><li><code> void WMFreezeText (WMText *tPtr) </code>
287 </li><li><code> void WMThawText (WMText *tPtr) </code>
288 </li><li><code> char * WMGetTextStream (WMText *tPtr) </code>
289 </li><li><code> void WMPrependTextBlock (WMText *tPtr, void *vtb) </code>
290 </li><li><code> void WMPrependTextStream (WMText *tPtr, char *text) </code>
291 </li><li><code> void * WMRemoveTextBlock (WMText *tPtr) </code>
292 </li><li><code> Bool WMReplaceTextSelection (WMText *tPtr, char *replacement) </code>
293 </li><li><code> Bool WMScrollText (WMText *tPtr, int amount) </code>
294 </li><li><code> void WMShowTextRuler (WMText *tPtr, Bool show) </code>
295 </li><li><code> Bool WMFindInTextStream (WMText *tPtr, char *needle, Bool direction, Bool caseSensitive) </code>
296 </li><li><code> Bool WMPageText (WMText *tPtr, Bool direction) </code>
299 </li><li><code> void WMSetTextHasHorizontalScroller (WMText *tPtr, Bool shouldhave) </code>
300 </li><li><code> void WMSetTextHasRuler (WMText *tPtr, Bool shouldhave) </code>
301 </li><li><code> void WMSetTextHasVerticalScroller (WMText *tPtr, Bool shouldhave) </code>
302 </li><li><code> void WMSetTextAlignment (WMText *tPtr, WMAlignment alignment) </code>
303 </li><li><code> void WMSetTextBackgroundColor (WMText *tPtr, WMColor *color) </code>
304 </li><li><code> void WMSetTextBackgroundPixmap (WMText *tPtr, WMPixmap *pixmap) </code>
305 </li><li><code> void WMSetTextBlockProperties (WMText *tPtr, void *vtb, unsigned int first, unsigned int kanji, unsigned int underlined, int script, WMRulerMargins *margins) </code>
306 </li><li><code> void WMSetTextDefaultColor (WMText *tPtr, WMColor *color) </code>
307 </li><li><code> void WMSetTextDefaultFont (WMText *tPtr, WMFont *font) </code>
308 </li><li><code> void WMSetTextDelegate (WMText *tPtr, WMTextDelegate *delegate) </code>
309 </li><li><code> void WMSetTextEditable (WMText *tPtr, Bool editable) </code>
310 </li><li><code> void WMSetTextForegroundColor (WMText *tPtr, WMColor *color) </code>
311 </li><li><code> void WMSetTextIgnoresNewline (WMText *tPtr, Bool ignore) </code>
312 </li><li><code> void WMSetTextIndentNewLines (WMText *tPtr, Bool indent) </code>
313 </li><li><code> void WMSetTextRelief (WMText *tPtr, WMReliefType relief) </code>
314 </li><li><code> void WMSetTextSelectionColor (WMText *tPtr, WMColor *color) </code>
315 </li><li><code> void WMSetTextSelectionFont (WMText *tPtr, WMFont *font) </code>
316 </li><li><code> void WMSetTextSelectionUnderlined (WMText *tPtr, int underlined) </code>
317 </li><li><code> void WMSetTextUsesMonoFont (WMText *tPtr, Bool mono) </code>
319 </li><li><code> WMColor * WMGetTextDefaultColor (WMText *tPtr) </code>
320 </li><li><code> WMFont * WMGetTextDefaultFont (WMText *tPtr) </code>
321 </li><li><code> int WMGetTextEditable (WMText *tPtr) </code>
322 </li><li><code> Bool WMGetTextIgnoresNewline (WMText *tPtr) </code>
323 </li><li><code> int WMGetTextInsertType (WMText *tPtr) </code>
324 </li><li><code> WMArray * WMGetTextObjects (WMText *tPtr) </code>
325 </li><li><code> Bool WMGetTextRulerShown (WMText *tPtr) </code>
326 </li><li><code> WMArray * WMGetTextSelectedObjects (WMText *tPtr) </code>
327 </li><li><code> char * WMGetTextSelectedStream (WMText *tPtr) </code>
328 </li><li><code> WMColor * WMGetTextSelectionColor (WMText *tPtr) </code>
329 </li><li><code> WMFont * WMGetTextSelectionFont (WMText *tPtr) </code>
330 </li><li><code> int WMGetTextSelectionUnderlined (WMText *tPtr) </code>
331 </li><li><code> Bool WMGetTextUsesMonoFont (WMText *tPtr) </code>
332 </li></ul>
333 <ul>
334 <li><code> void * WMCreateTextBlockWithObject (WMText *tPtr, WMWidget *w, char *description, WMColor *color, unsigned short first, unsigned short extraInfo) </code>
335 </li><li><code> void * WMCreateTextBlockWithPixmap (WMText *tPtr, WMPixmap *p, char *description, WMColor *color, unsigned short first, unsigned short extraInfo) </code>
336 </li><li><code> void * WMCreateTextBlockWithText (WMText *tPtr, char *text, WMFont *font, WMColor *color, unsigned short first, unsigned short len) </code>
337 </li><li><code> void WMDestroyTextBlock (WMText *tPtr, void *vtb) </code>
338 </li><li><code> void WMGetTextBlockProperties (WMText *tPtr, void *vtb, unsigned int *first, unsigned int *kanji, unsigned int *underlined, int *script, WMRulerMargins *margins) </code>
339 </li></ul>
341 <h5>Split windows/views</h5>
342 <ul>
343 <li><code> WMSplitView * WMCreateSplitView (WMWidget *parent) </code>
344 </li><li><code> void WMAddSplitViewSubview (WMSplitView *sPtr, WMView *subview) </code>
345 </li><li><code> void WMAdjustSplitViewSubviews (WMSplitView *sPtr) </code>
346 </li><li><code> void WMRemoveSplitViewSubview (WMSplitView *sPtr, WMView *view) </code>
347 </li><li><code> void WMRemoveSplitViewSubviewAt (WMSplitView *sPtr, int index) </code>
348 </li><li><code> void WMSetSplitViewConstrainProc (WMSplitView *sPtr, WMSplitViewConstrainProc *proc) </code>
349 </li><li><code> void WMSetSplitViewVertical (WMSplitView *sPtr, Bool flag) </code>
350 </li><li><code> int WMGetSplitViewDividerThickness (WMSplitView *sPtr) </code>
351 </li><li><code> WMView * WMGetSplitViewSubviewAt (WMSplitView *sPtr, int index) </code>
352 </li><li><code> int WMGetSplitViewSubviewsCount (WMSplitView *sPtr) </code>
353 </li><li><code> Bool WMGetSplitViewVertical (WMSplitView *sPtr) </code>
356 </li></ul>
359 <h5>lists and Property Lists<img src="./WINGLib_files/List.jpeg" width="20%" align="right"></h5>
360 <p> <code>WMListItem</code> has a member <code>.text</code>, which contains the string added to the list with <code>WMAddListItem</code>. When making a (multiple) selection in the view, the items are added in a WMArray in the order they have been clicked. The <code>WMArray</code> is a dynamic array with functions to retrieve its elements, or the number of elements. WMList provides a <code>WMListSelectionDidChangeNotification</code> event. Sample code using <code>WMAddNotificationObserver</code> to add a function which handles all the selection events:
362 </p><pre><code>/* global*/
363 static void listSelectionObserver(void *observer, WMNotification *notification){
364 WMList *lPtr = (WMList*)WMGetNotificationObject(notification);
365 WMListItem *item;
366 int i;
368 item = WMGetFromArray(WMGetListSelectedItems(lPtr),0); /* 1st selected item */
369 i= WMGetArrayItemCount(WMGetListSelectedItems(lPtr))); /* number of items */
371 /* do something */
374 /* in main : */
376 WMList *list;
377 int i;
378 char text[100];
380 list = WMCreateList(window);
381 WMSetListAllowMultipleSelection(list, True);
382 for (i=0; i&lt;20; i++) {
383 sprintf(text, "20 times same item");
384 WMAddListItem(list, text);
386 WMAddNotificationObserver(listSelectionObserver, NULL/*(observer)*/,
387 WMListSelectionDidChangeNotification, list);
388 WMMapSubwidgets(window);
390 </code></pre>
391 <code>WMSetList[Double]Action</code> specifies a WMAction to do, when a list item is [double]clicked, e.g.
392 <pre><code>static void doubleClick(WMWidget *self, void *data){
393 WMSelectAllListItems((WMList*)self);
394 }</code></pre>
397 <p>Functions:
399 </p><ul>
400 <li><code> WMList * WMCreateList (WMWidget *parent) </code>
401 </li><li><code> void WMClearList (WMList *lPtr) </code>
402 </li><li><code> WMListItem * WMInsertListItem (WMList *lPtr, int row, char *text) </code>
403 </li><li><code> void WMSelectAllListItems (WMList *lPtr) </code>
404 </li><li><code> void WMSelectListItem (WMList *lPtr, int row) </code>
405 </li><li><code> void WMSelectListItemsInRange (WMList *lPtr, WMRange range) </code>
406 </li><li><code> void WMRemoveListItem (WMList *lPtr, int row) </code>
407 </li><li><code> void WMSortListItems (WMList *lPtr) </code>
408 </li><li><code> void WMSortListItemsWithComparer (WMList *lPtr, WMCompareDataProc *func) </code>
409 </li><li><code> WMListItem * WMGetListItem (WMList *lPtr, int row) </code>
410 </li><li><code> int WMGetListItemHeight (WMList *lPtr) </code>
411 </li><li><code> WMArray * WMGetListItems (WMList *lPtr) </code>
412 </li><li><code> int WMGetListNumberOfRows (WMList *lPtr) </code>
413 </li><li><code> int WMGetListPosition (WMList *lPtr) </code>
414 </li><li><code> WMListItem * WMGetListSelectedItem (WMList *lPtr) </code>
415 </li><li><code> int WMGetListSelectedItemRow (WMList *lPtr) </code>
416 </li><li><code> WMArray * WMGetListSelectedItems (WMList *lPtr) </code>
418 </li><li><code> int WMFindRowOfListItemWithTitle (WMList *lPtr, char *title) </code>
419 </li><li><code> Bool WMListAllowsEmptySelection (WMList *lPtr) </code>
420 </li><li><code> Bool WMListAllowsMultipleSelection (WMList *lPtr) </code>
421 </li><li><code> void WMSetListAction (WMList *lPtr, WMAction *action, void *clientData) </code>
422 </li><li><code> void WMSetListAllowEmptySelection (WMList *lPtr, Bool flag) </code>
423 </li><li><code> void WMSetListAllowMultipleSelection (WMList *lPtr, Bool flag) </code>
424 </li><li><code> void WMSetListBottomPosition (WMList *lPtr, int row) </code>
425 </li><li><code> void WMSetListDoubleAction (WMList *lPtr, WMAction *action, void *clientData) </code>
426 </li><li><code> void WMSetListPosition (WMList *lPtr, int row) </code>
427 </li><li><code> void WMSetListSelectionToRange (WMList *lPtr, WMRange range) </code>
428 </li><li><code> void WMSetListUserDrawItemHeight (WMList *lPtr, unsigned short height) </code>
429 </li><li><code> void WMSetListUserDrawProc (WMList *lPtr, WMListDrawProc *proc) </code>
430 </li><li><code> void WMUnselectAllListItems (WMList *lPtr) </code>
431 </li><li><code> void WMUnselectListItem (WMList *lPtr, int row) </code>
433 </li></ul>
434 <ul>
435 <li><code> WMPropList * WMCreatePropListFromDescription (char *desc) </code>
436 </li><li><code> WMPropList * WMDeepCopyPropList (WMPropList *plist) </code>
437 </li><li><code> char * WMGetPropListDescription (WMPropList *plist, Bool indented) </code>
438 </li><li><code> int WMGetPropListItemCount (WMPropList *plist) </code>
439 </li><li><code> Bool WMIsPropListEqualTo (WMPropList *plist, WMPropList *other) </code>
440 </li><li><code> WMPropList * WMReadPropListFromFile (char *file) </code>
441 </li><li><code> void WMReleasePropList (WMPropList *plist) </code>
442 </li><li><code> WMPropList * WMRetainPropList (WMPropList *plist) </code>
443 </li><li><code> WMPropList * WMShallowCopyPropList (WMPropList *plist) </code>
444 </li><li><code> Bool WMWritePropListToFile (WMPropList *plist, char *path, Bool atomically)</code>
446 </li><li><code> void WMPLSetCaseSensitive (Bool caseSensitiveness) </code>
448 </li></ul>
451 <h5>Colour Panels<img src="./WINGLib_files/ColorPanel.jpeg" width="14%" align="right"><p></p></h5>
452 <ul>
453 <li><code> WMColorPanel * WMGetColorPanel (WMScreen *scrPtr) </code>
454 </li><li><code> void WMCloseColorPanel (WMColorPanel *panel) </code>
455 </li><li><code> void WMFreeColorPanel (WMColorPanel *panel) </code>
456 </li><li><code> WMColor * WMGetColorPanelColor (WMColorPanel *panel) </code>
457 </li><li><code> void WMSetColorPanelAction (WMColorPanel *panel, WMAction2 *action, void *data) </code>
458 </li><li><code> void WMSetColorPanelColor (WMColorPanel *panel, WMColor *color) </code>
459 </li><li><code> void WMSetColorPanelPickerMode (WMColorPanel *panel, WMColorPanelMode mode) </code>
460 </li><li><code> void WMShowColorPanel (WMColorPanel *panel) </code>
461 </li></ul>
463 <h5>Font Panel<img src="./WINGLib_files/FontPanel.jpeg" width="20%" align="right"><p></p></h5>
464 <ul>
466 <li><code> WMFontPanel * WMGetFontPanel (WMScreen *scr) </code>
467 </li><li><code> WMFont * WMGetFontPanelFont (WMFontPanel *panel) </code>
468 </li><li><code> char * WMGetFontPanelFontName (WMFontPanel *panel) </code>
469 </li><li><code> void WMHideFontPanel (WMFontPanel *panel) </code>
470 </li><li><code> void WMSetFontPanelAction (WMFontPanel *panel, WMAction2 *action, void *data) </code>
471 </li><li><code> void WMSetFontPanelFont (WMFontPanel *panel, WMFont *font) </code>
472 </li><li><code> Bool WMSetFontPanelFontName (WMFontPanel *panel, char *fontName) </code>
473 </li><li><code> void WMShowFontPanel (WMFontPanel *panel) </code>
474 </li><li><code> void WMFreeFontPanel (WMFontPanel *panel) </code>
476 </li></ul>
478 <h5>Tabbed views</h5><img src="./WINGLib_files/2tabs.jpeg" width="26%" align="right">
479 <p>The label on the tab itself should not be empty, or the tab won't be clickable. The view in the tab takes the view of the inserted widget. A frame expands to the tabbed view it is in. The widgets which go into the tabbed views should have the same parent as the whole TabView widget. Sample code for a TabView containing two tabs, the first with a frame, the second with a label:
480 </p><pre><code>
481 /* WMWindow *window created */
482 int x,y, Width, Height;
483 WMFrame *frame;
484 WMLabel *label;
485 WMTabView *tabview;
486 WMTabViewItem *tab;
488 tabview = WMCreateTabView(window);
489 WMMoveWidget(tabview, x, y);
490 WMResizeWidget(tabview, Width, Height);
492 frame = WMCreateFrame(window);
493 tab = WMCreateTabViewItemWithIdentifier(0);
494 WMSetTabViewItemView(tab, WMWidgetView(frame));
495 WMAddItemInTabView(tabview, tab);
496 WMSetTabViewItemLabel(tab, "1");
498 label = WMCreateLabel(window);
499 WMSetLabelText(label, "Text in View");
500 WMMapWidget(label);
501 tab = WMCreateTabViewItemWithIdentifier(0);
502 WMSetTabViewItemView(tab, WMWidgetView(label));
503 WMAddItemInTabView(tabview, tab);
504 WMSetTabViewItemLabel(tab, "tab 2");
506 WMMapSubwidgets(window);
507 </code></pre>
508 <img src="./WINGLib_files/TabView.jpeg" width="26%" align="right">
510 <ul>
511 <li><code> WMTabView * WMCreateTabView (WMWidget *parent) </code>
512 </li><li><code> WMTabViewItem * WMCreateTabViewItem (int identifier, char *label) </code>
513 </li><li><code> WMTabViewItem * WMCreateTabViewItemWithIdentifier (int identifier) </code>
514 </li><li><code> void WMDestroyTabViewItem (WMTabViewItem *item) </code>
515 </li><li><code> void WMAddItemInTabView (WMTabView *tPtr, WMTabViewItem *item) </code>
516 </li><li><code> WMTabViewItem * WMAddTabViewItemWithView (WMTabView *tPtr, WMView *view, int identifier, char *label) </code>
517 </li><li><code> void WMInsertItemInTabView (WMTabView *tPtr, int index, WMTabViewItem *item) </code>
518 </li><li><code> void WMRemoveTabViewItem (WMTabView *tPtr, WMTabViewItem *item) </code>
519 </li><li><code> void WMSetTabViewItemView (WMTabViewItem *item, WMView *view) </code></li><li><code> WMTabViewItem * WMGetSelectedTabViewItem (WMTabView *tPtr) </code>
520 </li><li><code> int WMGetTabViewItemIdentifier (WMTabViewItem *item) </code>
521 </li><li><code> char * WMGetTabViewItemLabel (WMTabViewItem *item) </code>
522 </li><li><code> WMView * WMGetTabViewItemView (WMTabViewItem *item) </code>
523 </li><li><code> void WMSelectFirstTabViewItem (WMTabView *tPtr) </code>
524 </li><li><code> void WMSelectLastTabViewItem (WMTabView *tPtr) </code>
525 </li><li><code> void WMSelectNextTabViewItem (WMTabView *tPtr) </code>
526 </li><li><code> void WMSelectPreviousTabViewItem (WMTabView *tPtr) </code>
527 </li><li><code> void WMSelectTabViewItem (WMTabView *tPtr, WMTabViewItem *item) </code>
528 </li><li><code> void WMSelectTabViewItemAtIndex (WMTabView *tPtr, int index) </code>
529 </li><li><code> void WMSetTabViewDelegate (WMTabView *tPtr, WMTabViewDelegate *delegate) </code>
530 </li><li><code> void WMSetTabViewEnabled (WMTabView *tPtr, Bool flag) </code>
531 </li><li><code> void WMSetTabViewFont (WMTabView *tPtr, WMFont *font) </code>
532 </li><li><code> void WMSetTabViewItemEnabled (WMTabViewItem *tPtr, Bool flag) </code>
533 </li><li><code> void WMSetTabViewItemLabel (WMTabViewItem *item, char *label) </code>
535 </li><li><code> void WMSetTabViewType (WMTabView *tPtr, WMTabViewType type) </code>
536 </li><li><code> WMTabViewItem * WMTabViewItemAtPoint (WMTabView *tPtr, int x, int y) </code>
538 </li></ul>
540 <h5>Progress Indicators<img src="./WINGLib_files/Progress.jpeg" width="20%" align="right"></h5>
541 <ul>
543 <li><code> WMProgressIndicator * WMCreateProgressIndicator (WMWidget *parent) </code>
544 </li><li><code> int WMGetProgressIndicatorMaxValue (WMProgressIndicator *progressindicator) </code>
545 </li><li><code> int WMGetProgressIndicatorMinValue (WMProgressIndicator *progressindicator) </code>
546 </li><li><code> int WMGetProgressIndicatorValue (WMProgressIndicator *progressindicator) </code>
547 </li><li><code> void WMSetProgressIndicatorMaxValue (WMProgressIndicator *progressindicator, int value) </code>
548 </li><li><code> void WMSetProgressIndicatorMinValue (WMProgressIndicator *progressindicator, int value) </code>
549 </li><li><code> void WMSetProgressIndicatorValue (WMProgressIndicator *progressindicator, int value) </code>
550 </li></ul>
552 <h5>Event handlers</h5>
553 <ul>
554 <li><code> void WMCreateEventHandler (WMView *view, unsigned long mask, WMEventProc *eventProc, void *clientData) </code>
555 </li><li><code> void WMDeleteEventHandler (WMView *view, unsigned long mask, WMEventProc *eventProc, void *clientData) </code>
556 </li><li><code> int WMHandleEvent (XEvent *event) </code>
557 </li><li><code> WMEventHook * WMHookEventHandler (WMEventHook *handler) </code>
558 </li><li><code> void WMMaskEvent (Display *dpy, long mask, XEvent *event) </code>
559 </li><li><code> void WMNextEvent (Display *dpy, XEvent *event) </code>
560 </li></ul>
561 <ul>
562 <li><code> int XPending(Display *display)</code>
563 </li></ul>
564 is a function in libXlib. It returns the number of events in the queue, if needed, after flushing the events buffer. If there are any, WMNextEvent can be called, and next WMHandleEvent.
566 <h5>Selections</h5>
567 <ul>
568 <li><code> Bool WMCreateSelectionHandler (WMView *view, Atom selection, Time timestamp, WMSelectionProcs *procs, void *cdata) </code>
569 </li><li><code> void WMDeleteSelectionCallback (WMView *view, Atom selection, Time timestamp) </code>
570 </li><li><code> void WMDeleteSelectionHandler (WMView *view, Atom selection, Time timestamp) </code>
571 </li><li><code> Bool WMRequestSelection (WMView *view, Atom selection, Atom target, Time timestamp, WMSelectionCallback *callback, void *cdata) </code>
573 </li></ul>
574 <h5>Screens</h5>
575 <ul>
577 <li><code> WMScreen * WMCreateScreen (Display *display, int screen) </code>
578 </li><li><code> WMScreen * WMCreateScreenWithRContext (Display *display, int screen, RContext *context) </code>
579 </li><li><code> WMScreen * WMCreateSimpleApplicationScreen (Display *display) </code>
580 </li><li><code> WMScreen * WMOpenScreen (const char *display) </code>
581 </li><li><code> WMPoint WMGetViewScreenPosition (WMView *view) </code>
582 </li><li><code> int WMScreenDepth (WMScreen *scr) </code>
583 </li><li><code> Display * WMScreenDisplay (WMScreen *scr) </code>
584 </li><li><code> unsigned int WMScreenHeight (WMScreen *scr) </code>
585 </li><li><code> RContext * WMScreenRContext (WMScreen *scr) </code>
586 </li><li><code> unsigned int WMScreenWidth (WMScreen *scr) </code>
587 </li><li><code> void WMScreenMainLoop (WMScreen *scr) </code>
588 </li><li><code> Bool WMScreenPending (WMScreen *scr) </code>
589 </li></ul>
592 <h5>Image functions</h5>
595 <ul>
596 <li><code> RImage * WMGetApplicationIconImage (WMScreen *scr)</code>
597 </li><li><code>WMColor * WMWhiteColor (WMScreen *scr)</code>
598 </li><li><code>WMColor * WMCreateNamedColor (WMScreen *scr, char *name,
599 Bool exact)</code>
600 </li><li><code>RImage * RCreateImageFromXImage (RContext *context,
601 XImage *image,
602 XImage *mask)
603 </code></li><li><code><code> RImage * RCreateImage (unsigned width, unsigned height,
604 int alpha)</code>
606 </code></li><li><code><code> RImage * RGetImageFromXPMData (RContext *context,
607 char **data)</code>
608 </code></li><li><code><code> RImage * RLoadXPM (RContext *context, char *file,
609 int index)</code>
611 </code></li><li><code><code>RContext * RCreateContext (Display *dpy,
612 int screen_number,
613 RContextAttributes *attribs)</code>
614 </code></li><li><code><code>RContext * WMScreenRContext (WMScreen *scr)</code>
615 </code></li><li><code><code> WMPixmap * WMCreateBlendedPixmapFromFile (WMScreen *scrPtr, char *fileName, RColor *color) </code>
616 </code></li><li><code><code> WMPixmap * WMCreateBlendedPixmapFromRImage (WMScreen *scrPtr, RImage *image, RColor *color) </code>
617 </code></li><li><code><code> WMPixmap * WMCreatePixmap (WMScreen *scrPtr, int width, int height, int depth, Bool masked) </code>
618 </code></li><li><code><code> WMPixmap * WMCreatePixmapFromFile (WMScreen *scrPtr, char *fileName) </code>
619 </code></li><li><code><code> WMPixmap * WMCreatePixmapFromRImage (WMScreen *scrPtr, RImage *image, int threshold) </code>
620 </code></li><li><code><code> WMPixmap * WMCreatePixmapFromXPMData (WMScreen *scrPtr, char **data) </code>
621 </code></li><li><code><code> WMPixmap * WMCreatePixmapFromXPixmaps (WMScreen *scrPtr, Pixmap pixmap, Pixmap mask, int width, int height, int depth) </code>
622 </code></li><li><code><code> void WMDrawPixmap (WMPixmap *pixmap, Drawable d, int x, int y) </code>
623 </code></li><li><code><code> Pixmap WMGetPixmapMaskXID (WMPixmap *pixmap) </code>
624 </code></li><li><code><code> WMSize WMGetPixmapSize (WMPixmap *pixmap) </code>
625 </code></li><li><code><code> Pixmap WMGetPixmapXID (WMPixmap *pixmap) </code>
626 </code></li><li><code><code> WMPixmap * WMGetSystemPixmap (WMScreen *scr, int image) </code>
627 </code></li><li><code><code> void WMReleasePixmap (WMPixmap *pixmap) </code>
628 </code></li><li><code><code> WMPixmap * WMRetainPixmap (WMPixmap *pixmap) </code>
630 </code></li></ul><code>
632 <h5>Application wide functions</h5>
634 <ul>
635 <li><code> void WMInitializeApplication (char *applicationName, int *argc, char **argv) </code>
636 </li><li><code> char * WMGetApplicationName () </code>
637 </li><li><code> void WMSetApplicationHasAppIcon (WMScreen *scr, Bool flag) </code>
638 </li><li><code> void WMSetApplicationIconImage (WMScreen *scr, RImage *image) </code>
639 </li><li><code> void WMSetApplicationIconPixmap (WMScreen *scr, WMPixmap *icon) </code>
640 </li></ul>
641 <ul>
642 <li><code> void WMSetApplicationIconWindow (WMScreen *scr, Window window) </code>
643 </li><li><code> WMPixmap * WMCreateApplicationIconBlendedPixmap (WMScreen *scr, RColor *color) </code>
644 </li><li><code> RImage * WMGetApplicationIconImage (WMScreen *scr) </code>
645 </li><li><code> WMPixmap * WMGetApplicationIconPixmap (WMScreen *scr) </code>
646 </li></ul>
647 <hr>
649 <h5><a name="Notification">Notifications</a></h5>
650 <p> A typical sequence to have a window handle messages which come from some widget, is:
651 <br>(global)
652 <code>const char *WMRequestName="AnyName";</code><br>
653 At the point (in some widget function) where another window (widget) should act on the notification, put:
654 <br><code>WMPostNotificationName(WMRequestName, self, NULL);</code><br>
655 This call will put the notification in a queue.
656 </p><p>In the <code>WMNotificationObserverAction(void *self,WMNotification notif)</code>, with name "notificationHandler", put
657 <br><code>if(!strcmp(WMRequestName,WMGetNotificationName(notif))){do something}</code><br>
658 This will do something if the incoming notification is one with the right name. To put it to work by a widget "window", do:
659 <br>
660 <code> WMAddNotificationObserver(notificationHandler, window, WMRequestName, object)</code><br>
661 Arguments "window" and "object", and also the notification name, can be NULL.
662 The last argument (object) to the WMAddNotification<wbr>Observer function selects an object where the notification is allowed to come from. To handle all incoming notifications with the right name, set this to NULL
663 </p><ul>
664 <li><code> void WMAddNotificationObserver (WMNotificationObserverAction *observerAction, void *observer, const char *name, void *object) </code>
665 </li><li><code> WMNotification * WMCreateNotification (const char *name, void *object, void *clientData) </code>
666 </li><li><code> WMNotificationQueue * WMCreateNotificationQueue (void ) </code>
667 </li><li><code> void WMPostNotification (WMNotification *notification) </code>
668 </li><li><code> void WMPostNotificationName (const char *name, void *object, void *clientData) </code>
669 </li><li><code> void * WMGetNotificationClientData (WMNotification *notification) </code>
670 </li><li><code> const char * WMGetNotificationName (WMNotification *notification) </code>
671 </li><li><code> void * WMGetNotificationObject (WMNotification *notification) </code>
672 </li><li><code> void WMEnqueueNotification (WMNotificationQueue *queue, WMNotification *notification, WMPostingStyle postingStyle) </code>
673 </li><li><code> void WMDequeueNotificationMatching (WMNotificationQueue *queue, WMNotification *notification, unsigned mask) </code>
674 </li><li><code> void WMEnqueueCoalesceNotification (WMNotificationQueue *queue, WMNotification *notification, WMPostingStyle postingStyle, unsigned coalesceMask) </code>
675 </li><li><code> WMNotificationQueue * WMGetDefaultNotificationQueue (void ) </code>
676 </li><li><code> void WMReleaseNotification (WMNotification *notification) </code>
677 </li><li><code> void WMRemoveNotificationObserver (void *observer) </code>
678 </li><li><code> void WMRemoveNotificationObserverWithName (void *observer, const char *name, void *object) </code>
679 </li><li><code> WMNotification * WMRetainNotification (WMNotification *notification) </code>
680 </li><li><code> void WMSetViewNotifySizeChanges (WMView *view, Bool flag) </code>
681 </li></ul>
683 <h5>Text balloons</h5>
684 <ul>
685 <li><code> void WMSetBalloonEnabled (WMScreen *scr, Bool flag) </code>
686 </li><li><code> void WMSetBalloonDelay (WMScreen *scr, int delay) </code>
687 </li><li><code> void WMSetBalloonFont (WMScreen *scr, WMFont *font) </code>
688 </li><li><code> void WMSetBalloonTextAlignment (WMScreen *scr, WMAlignment alignment) </code>
689 </li><li><code> void WMSetBalloonTextColor (WMScreen *scr, WMColor *color) </code>
690 </li><li><code> void WMSetBalloonTextForView (char *text, WMView *view) </code>
691 </li><li><code> W_Balloon * W_CreateBalloon (WMScreen *scr)</code>
692 </li><li><code> void W_BalloonHandle[Enter|Leave]View (WMView *view)</code>
693 </li></ul>
695 <h5>Drag/drop functions</h5>
697 </p><ul>
698 <li><code> void WMDragImageFromView (WMView *view, WMPixmap *image, char *dataTypes, WMPoint atLocation, WMSize mouseOffset, XEvent *event, Bool slideBack) </code>
699 </li><li><code> WMPoint WMGetDraggingInfoImageLocation (WMDraggingInfo *info) </code>
700 </li><li><code> void WMRegisterViewForDraggedTypes (WMView *view, char *acceptedTypes) </code>
701 </li><li><code> void WMSetViewDragDestinationProcs (WMView *view, WMDragDestinationProcs *procs) </code>
702 </li><li><code> void WMSetViewDragSourceProcs (WMView *view, WMDragSourceProcs *procs) </code>
703 </li><li><code> void WMUnregisterViewDraggedTypes (WMView *view) </code>
704 </li><li><code> Bool WMRequestDroppedData (WMView *view, WMDraggingInfo *info, char *type, WMDropDataCallback *callback) </code>
706 </li></ul>
708 <h5>Network connection</h5>
709 <ul>
711 <li><code> WMConnection * WMCreateConnectionAsServerAtAddress (char *host, char *service, char *protocol) </code>
712 </li><li><code> WMConnection * WMCreateConnectionToAddress (char *host, char *service, char *protocol) </code>
713 </li><li><code> WMConnection * WMCreateConnectionToAddressAndNotify (char *host, char *service, char *protocol) </code>
714 </li><li><code> WMConnection * WMAcceptConnection (WMConnection *listener) </code>
715 </li><li><code> void WMCloseConnection (WMConnection *cPtr) </code>
716 </li><li><code> void WMDestroyConnection (WMConnection *cPtr) </code>
717 </li><li><code> void WMSetConnectionClientData (WMConnection *cPtr, void *data) </code>
718 </li><li><code> Bool WMSetConnectionCloseOnExec (WMConnection *cPtr, Bool flag) </code>
719 </li><li><code> void WMSetConnectionDefaultTimeout (unsigned int timeout) </code>
720 </li><li><code> void WMSetConnectionDelegate (WMConnection *cPtr, ConnectionDelegate *delegate) </code>
721 </li><li><code> void WMSetConnectionFlags (WMConnection *cPtr, unsigned int flags) </code>
722 </li><li><code> Bool WMSetConnectionNonBlocking (WMConnection *cPtr, Bool flag) </code>
723 </li><li><code> void WMSetConnectionOpenTimeout (unsigned int timeout) </code>
724 </li><li><code> void WMSetConnectionSendTimeout (WMConnection *cPtr, unsigned int timeout) </code>
725 </li><li><code> void WMSetConnectionShutdownOnClose (WMConnection *cPtr, Bool flag) </code>
726 </li><li><code> Bool WMEnqueueConnectionData (WMConnection *cPtr, WMData *data) </code>
727 </li><li><code> char * WMGetConnectionAddress (WMConnection *cPtr) </code>
728 </li><li><code> WMData * WMGetConnectionAvailableData (WMConnection *cPtr) </code>
729 </li><li><code> void * WMGetConnectionClientData (WMConnection *cPtr) </code>
730 </li><li><code> unsigned int WMGetConnectionFlags (WMConnection *cPtr) </code>
731 </li><li><code> char * WMGetConnectionProtocol (WMConnection *cPtr) </code>
732 </li><li><code> char * WMGetConnectionService (WMConnection *cPtr) </code>
733 </li><li><code> int WMGetConnectionSocket (WMConnection *cPtr) </code>
734 </li><li><code> WMConnectionState WMGetConnectionState (WMConnection *cPtr) </code>
735 </li><li><code> WMConnectionTimeoutState WMGetConnectionTimeoutState (WMConnection *cPtr) </code>
736 </li><li><code> WMArray * WMGetConnectionUnsentData (WMConnection *cPtr) </code>
737 </li><li><code> int WMSendConnectionData (WMConnection *cPtr, WMData *data) </code>
738 </li></ul>
740 <h5><a name="DrawFunctions">Draw functions</a></h5>
741 <ul>
742 <li><code> RContext * RCreateContext (Display *dpy, int screen_number, RContextAttributes *attribs) </code>
743 </li><li><code> GC WMColorGC (WMColor *color) </code>
744 </li><li><code> RImage * RCreateImage (unsigned width, unsigned height, int alpha) </code>
745 </li><li><code> RImage * RCreateImageFromDrawable (RContext *context, Drawable drawable, Pixmap mask) </code>
746 </li><li><code> RImage * RCreateImageFromXImage (RContext *context, XImage *image, XImage *mask) </code>
747 </li><li><code> RXImage * RCreateXImage (RContext *context, int depth, unsigned width, unsigned height) </code>
748 </li><li><code> void RDestroyXImage (RContext *context, RXImage *rximage) </code>
749 </li><li><code> void RBevelImage (RImage *image, int bevel_type) </code>
750 </li><li><code> int RBlurImage (RImage *image) </code>
751 </li><li><code> void RClearImage (RImage *image, RColor *color) </code>
752 </li><li><code> RImage * RCloneImage (RImage *image) </code>
753 </li><li><code> int RDrawLine (RImage *image, int x0, int y0, int x1, int y1, RColor *color) </code>
754 </li><li><code> void RDrawLines (RImage *image, RPoint *points, int npoints, int mode, RColor *color) </code>
755 </li><li><code> void RDrawSegments (RImage *image, RSegment *segs, int nsegs, RColor *color) </code>
756 </li><li><code> void RFillImage (RImage *image, RColor *color) </code>
757 </li><li><code> void RCombineArea (RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy) </code>
758 </li><li><code> void RCombineAreaWithOpaqueness (RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy, int opaqueness) </code>
759 </li><li><code> void RCombineImageWithColor (RImage *image, RColor *color) </code>
760 </li><li><code> void RCombineImages (RImage *image, RImage *src) </code>
761 </li><li><code> void RCombineImagesWithOpaqueness (RImage *image, RImage *src, int opaqueness) </code>
762 </li><li><code> int RConvertImage (RContext *context, RImage *image, Pixmap *pixmap) </code>
763 </li><li><code> int RConvertImageMask (RContext *context, RImage *image, Pixmap *pixmap, Pixmap *mask, int threshold) </code>
764 </li><li><code> Bool RGetClosestXColor (RContext *context, RColor *color, XColor *retColor) </code>
765 </li><li><code> char * RGetImageFileFormat (char *file) </code>
766 </li><li><code> RImage * RGetImageFromXPMData (RContext *context, char **data) </code>
767 </li><li><code> Bool RGetPixel (RImage *image, int x, int y, RColor *color) </code>
768 </li><li><code> RImage * RGetSubImage (RImage *image, int x, int y, unsigned width, unsigned height) </code>
769 </li><li><code> RXImage * RGetXImage (RContext *context, Drawable d, int x, int y, unsigned width, unsigned height) </code>
770 </li><li><code> void RHSVtoRGB (RHSVColor *hsv, RColor *rgb) </code>
771 </li><li><code> RImage * RLoadImage (RContext *context, char *file, int index) </code>
772 </li><li><code> RImage * RLoadPPM (RContext *context, char *file_name, int index) </code>
773 </li><li><code> RImage * RLoadXPM (RContext *context, char *file, int index) </code>
774 </li><li><code> RImage * RMakeCenteredImage (RImage *image, unsigned width, unsigned height, RColor *color) </code>
775 </li><li><code> RImage * RMakeTiledImage (RImage *tile, unsigned width, unsigned height) </code>
776 </li><li><code> const char * RMessageForError (int errorCode) </code>
777 </li><li><code> int ROperateLine (RImage *image, int operation, int x0, int y0, int x1, int y1, RColor *color) </code>
778 </li><li><code> void ROperateLines (RImage *image, int operation, RPoint *points, int npoints, int mode, RColor *color) </code>
779 </li><li><code> void ROperatePixel (RImage *image, int operation, int x, int y, RColor *color) </code>
780 </li><li><code> void ROperatePixels (RImage *image, int operation, RPoint *points, int npoints, int mode, RColor *color) </code>
781 </li><li><code> void ROperateSegments (RImage *image, int operation, RSegment *segs, int nsegs, RColor *color) </code>
782 </li><li><code> void RPutPixel (RImage *image, int x, int y, RColor *color) </code>
783 </li><li><code> void RPutPixels (RImage *image, RPoint *points, int npoints, int mode, RColor *color) </code>
784 </li><li><code> void RPutXImage (RContext *context, Drawable d, GC gc, RXImage *ximage, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) </code>
785 </li><li><code> void RRGBtoHSV (RColor *rgb, RHSVColor *hsv) </code>
786 </li><li><code> void RReleaseImage (RImage *image) </code>
787 </li><li><code> RImage * RRenderGradient (unsigned width, unsigned height, RColor *from, RColor *to, int style) </code>
788 </li><li><code> RImage * RRenderInterwovenGradient (unsigned width, unsigned height, RColor colors1, int thickness1, RColor colors2, int thickness2) </code>
789 </li><li><code> RImage * RRenderMultiGradient (unsigned width, unsigned height, RColor **colors, int style) </code>
790 </li><li><code> RImage * RRetainImage (RImage *image) </code>
791 </li><li><code> RImage * RRotateImage (RImage *image, float angle) </code>
792 </li><li><code> Bool RSaveImage (RImage *image, char *filename, char *format) </code>
793 </li><li><code> Bool RSaveXPM (RImage *image, char *filename) </code>
794 </li><li><code> RImage * RScaleImage (RImage *image, unsigned new_width, unsigned new_height) </code>
795 </li><li><code> RImage * RSmoothScaleImage (RImage *src, unsigned new_width, unsigned new_height) </code>
796 </li><li><code> char ** RSupportedFileFormats (void ) </code></li><li><code> RColor ulongToRColor (WMScreen *scr, unsigned long value) </code>
797 </li><li><code>RColor WMGetRColorFromColor(WMColor *color)</code>
798 </li><li><code> RColor col = {0xae,0xaa,0xae,0xff}</code>
799 </li></ul>
801 <ul>Other used graphics functions which are not libWINGs/libwraster:
802 <li><code> Status XmuCreateColormap (dpy , colormap ) </code>
803 </li><li><code> void XmuDeleteStandardColormap (dpy , screen , property ) </code>
804 </li><li><code> Status XmuGetColormapAllocation (vinfo , property , red_max , green_max , blue_max ) </code>
805 </li><li><code> Status XmuLookupStandardColormap (dpy , screen , visualid , depth , property , replace , retain ) </code>
806 </li><li><code> XStandardColormap * XmuStandardColormap (dpy , screen , visualid , depth , property , cmap , red_max , green_max , blue_max ) </code>
807 </li><li><code> int XDrawRectangle(Display *display, Drawable d, GC gc,
808 int x, int y, unsigned int width, unsigned int
809 height)</code></li><li><code>
810 int XDrawLines(Display *display, Drawable d, GC gc, XPoint
811 *points, int npoints, int mode)</code></li><li><code>
813 int XDrawSegments(Display *display, Drawable d, GC gc,
814 XSegment *segments, int nsegments)</code></li><li><code>
816 int XDrawArc(Display *display, Drawable d, GC gc, int x,
817 int y, unsigned int width, unsigned int height, int
818 angle1, int angle2)</code></li><li><code>
819 int XDrawArcs(Display *display, Drawable d, GC gc, XArc
820 *arcs, int narcs)</code></li><li><code>
821 int XDrawPoint(Display *display, Drawable d, GC gc, int x,
822 int y)</code></li><li><code>
824 int XDrawPoints(Display *display, Drawable d, GC gc,
825 XPoint *points, int npoints, int mode)</code></li><li><code>
827 GC XCreateGC(Display *display, Drawable d, unsigned long
828 valuemask, XGCValues *values)</code></li><li><code>
829 int XFillArc(Display *display, Drawable d, GC gc, int x,
830 int y, unsigned int width, unsigned int height, int
831 angle1, int angle2)</code></li><li><code>
832 int XFillPolygon(Display *display, Drawable d, GC gc,
833 XPoint *points, int npoints, int shape, int mode)</code></li><li><code>
836 typedef struct {
837 short x1, y1, x2, y2;
838 } XSegment</code></li><li><code>
840 typedef struct {
841 short x, y;
842 } XPoint</code></li><li><code>
845 typedef struct {
846 short x, y;
847 unsigned short width, height;
848 short angle1, angle2; /* Degrees * 64 */
849 } XArc</code>
852 </li></ul>
854 <h5>Browser functions</h5>
855 <ul>
856 <li><code> WMBrowser * WMCreateBrowser (WMWidget *parent) </code>
857 </li><li><code> int WMAddBrowserColumn (WMBrowser *bPtr) </code>
858 </li><li><code> Bool WMBrowserAllowsEmptySelection (WMBrowser *bPtr) </code>
859 </li><li><code> Bool WMBrowserAllowsMultipleSelection (WMBrowser *bPtr) </code>
860 </li><li><code> void WMSetBrowserAction (WMBrowser *bPtr, WMAction *action, void *clientData) </code>
861 </li><li><code> void WMSetBrowserAllowEmptySelection (WMBrowser *bPtr, Bool flag) </code>
862 </li><li><code> void WMSetBrowserAllowMultipleSelection (WMBrowser *bPtr, Bool flag) </code>
863 </li><li><code> void WMSetBrowserColumnTitle (WMBrowser *bPtr, int column, char *title) </code>
864 </li><li><code> void WMSetBrowserDelegate (WMBrowser *bPtr, WMBrowserDelegate *delegate) </code>
865 </li><li><code> void WMSetBrowserDoubleAction (WMBrowser *bPtr, WMAction *action, void *clientData) </code>
866 </li><li><code> void WMSetBrowserHasScroller (WMBrowser *bPtr, int hasScroller) </code>
867 </li><li><code> void WMSetBrowserMaxVisibleColumns (WMBrowser *bPtr, int columns) </code>
868 </li><li><code> char * WMSetBrowserPath (WMBrowser *bPtr, char *path) </code>
869 </li><li><code> void WMSetBrowserPathSeparator (WMBrowser *bPtr, char *separator) </code>
870 </li><li><code> void WMSetBrowserTitled (WMBrowser *bPtr, Bool flag) </code>
871 </li><li><code> void WMSortBrowserColumn (WMBrowser *bPtr, int column) </code>
872 </li><li><code> void WMSortBrowserColumnWithComparer (WMBrowser *bPtr, int column, WMCompareDataProc *func) </code>
873 </li><li><code> int WMGetBrowserFirstVisibleColumn (WMBrowser *bPtr) </code>
874 </li><li><code> WMList * WMGetBrowserListInColumn (WMBrowser *bPtr, int column) </code>
875 </li><li><code> int WMGetBrowserMaxVisibleColumns (WMBrowser *bPtr) </code>
876 </li><li><code> int WMGetBrowserNumberOfColumns (WMBrowser *bPtr) </code>
877 </li><li><code> char * WMGetBrowserPath (WMBrowser *bPtr) </code>
878 </li><li><code> char * WMGetBrowserPathToColumn (WMBrowser *bPtr, int column) </code>
879 </li><li><code> WMArray * WMGetBrowserPaths (WMBrowser *bPtr) </code>
880 </li><li><code> int WMGetBrowserSelectedColumn (WMBrowser *bPtr) </code>
881 </li><li><code> WMListItem * WMGetBrowserSelectedItemInColumn (WMBrowser *bPtr, int column) </code>
882 </li><li><code> int WMGetBrowserSelectedRowInColumn (WMBrowser *bPtr, int column) </code>
883 </li><li><code> WMListItem * WMInsertBrowserItem (WMBrowser *bPtr, int column, int row, char *text, Bool isBranch) </code>
884 </li><li><code> void WMLoadBrowserColumnZero (WMBrowser *bPtr) </code>
885 </li><li><code> void WMRemoveBrowserItem (WMBrowser *bPtr, int column, int row) </code>
886 </li></ul>
888 <h5>Menu items</h5>
889 <ul>
890 <li><code> WMMenuItem * WMCreateMenuItem (void ) </code>
891 </li><li><code> void WMDestroyMenuItem (WMMenuItem *item) </code>
892 </li><li><code> void WMSetMenuItemAction (WMMenuItem *item, WMAction *action, void *data) </code>
893 </li><li><code> void WMSetMenuItemEnabled (WMMenuItem *item, Bool flag) </code>
894 </li><li><code> void WMSetMenuItemMixedStatePixmap (WMMenuItem *item, WMPixmap *pixmap) </code>
895 </li><li><code> void WMSetMenuItemOffStatePixmap (WMMenuItem *item, WMPixmap *pixmap) </code>
896 </li><li><code> void WMSetMenuItemOnStatePixmap (WMMenuItem *item, WMPixmap *pixmap) </code>
897 </li><li><code> void WMSetMenuItemPixmap (WMMenuItem *item, WMPixmap *pixmap) </code>
898 </li><li><code> void WMSetMenuItemRepresentedObject (WMMenuItem *item, void *object) </code>
899 </li><li><code> void WMSetMenuItemShortcut (WMMenuItem *item, char *shortcut) </code>
900 </li><li><code> void WMSetMenuItemShortcutModifierMask (WMMenuItem *item, unsigned mask) </code>
901 </li><li><code> void WMSetMenuItemState (WMMenuItem *item, int state) </code>
902 </li><li><code> void WMSetMenuItemTitle (WMMenuItem *item, char *title) </code>
903 </li><li><code> Bool WMMenuItemIsSeparator (WMMenuItem *item) </code>
904 </li><li><code> WMAction * WMGetMenuItemAction (WMMenuItem *item) </code>
905 </li><li><code> void * WMGetMenuItemData (WMMenuItem *item) </code>
906 </li><li><code> Bool WMGetMenuItemEnabled (WMMenuItem *item) </code>
907 </li><li><code> WMPixmap * WMGetMenuItemMixedStatePixmap (WMMenuItem *item) </code>
908 </li><li><code> WMPixmap * WMGetMenuItemOffStatePixmap (WMMenuItem *item) </code>
909 </li><li><code> WMPixmap * WMGetMenuItemOnStatePixmap (WMMenuItem *item) </code>
910 </li><li><code> WMPixmap * WMGetMenuItemPixmap (WMMenuItem *item) </code>
911 </li><li><code> void * WMGetMenuItemRepresentedObject (WMMenuItem *item) </code>
912 </li><li><code> char * WMGetMenuItemShortcut (WMMenuItem *item) </code>
913 </li><li><code> unsigned WMGetMenuItemShortcutModifierMask (WMMenuItem *item) </code>
914 </li><li><code> int WMGetMenuItemState (WMMenuItem *item) </code>
915 </li><li><code> char * WMGetMenuItemTitle (WMMenuItem *item) </code>
916 </li><li><code> WMMenuItem * WMGetSeparatorMenuItem (void ) </code>
917 </li></ul>
920 <h5>Utility/redefined functions</h5>
921 <ul>
923 <li><code> char * wdefaultspathfordomain (char *domain) </code>
924 </li><li><code> char * wexpandpath (char *path) </code>
925 </li><li><code> void wfatal (const char *msg, ... ) </code>
926 </li><li><code> char * wfindfile (char *paths, char *file) </code>
927 </li><li><code> char * wfindfileinarray (WMPropList *array, char *file) </code>
928 </li><li><code> char * wfindfileinlist (char **path_list, char *file) </code>
929 </li><li><code> void wfree (void *ptr) </code>
930 </li><li><code> char * wgethomedir () </code>
931 </li><li><code> void * wmalloc (size_t size) </code>
932 </li><li><code> void wmessage (const char *msg, ... ) </code>
933 </li><li><code> WMPoint wmkpoint (int x, int y) </code>
934 </li><li><code> WMRange wmkrange (int start, int count) </code>
935 </li><li><code> WMSize wmksize (unsigned int width, unsigned int height) </code>
936 </li><li><code> void * wrealloc (void *ptr, size_t newsize) </code>
937 </li><li><code> void wrelease (void *ptr) </code>
938 </li><li><code> void * wretain (void *ptr) </code>
939 </li><li><code> waborthandler * wsetabort (waborthandler *handler) </code>
940 </li><li><code> char * wstrappend (char *dst, char *src) </code>
941 </li><li><code> char * wstrconcat (char *str1, char *str2) </code>
942 </li><li><code> char * wstrdup (char *str) </code>
943 </li><li><code> char * wstrerror (int errnum) </code>
944 </li><li><code> char * wstrndup (char *str, size_t len) </code>
945 </li><li><code> void wsyserror (const char *msg, ... ) </code>
946 </li><li><code> void wsyserrorwithcode (int error, const char *msg, ... ) </code>
947 </li><li><code> void wtokenfree (char **tokens, int count) </code>
948 </li><li><code> char * wtokenjoin (char **list, int count) </code>
949 </li><li><code> char * wtokennext (char *word, char **next) </code>
950 </li><li><code> void wtokensplit (char *command, char ***argv, int *argc) </code>
951 </li><li><code> char * wtrimspace (char *s) </code>
952 </li><li><code> char * wusergnusteppath () </code>
953 </li><li><code> void wwarning (const char *msg, ... ) </code>
954 </li></ul><small>
955 Other used functions:<ul>
956 <li><code> int calculateCombineArea (RImage *des, RImage *src, int *sx, int *sy, int *swidth, int *sheight, int *dx, int *dy) </code>
957 </li><li><code> void convertCPColor (CPColor *color) </code>
958 </li><li><code> void destroyNode (void *data) </code>
959 </li><li><code> void drawClip () </code>
960 </li><li><code> char * generateNewFilename (char *curName) </code>
961 </li><li><code> unsigned char getShift (unsigned char value) </code>
962 </li><li><code> char * getStream (WMText *tPtr, int sel, int array) </code>
963 </li><li><code> WMArray * getStreamObjects (WMText *tPtr, int sel) </code>
964 </li><li><code> Pixmap makeMenuPixmap (PopUpButton *bPtr) </code>
965 </li><li><code> Bool requestDroppedData (WMView *view, WMDraggingInfo *info, char *type) </code>
966 </li><li><code> WMData * requestHandler (WMView *view, Atom selection, Atom target, void *cdata, Atom *type) </code>
967 </li><li><code> RColor ulongToRColor (WMScreen *scr, unsigned long value) </code>
968 </li></ul></small>
969 <h4>Data types</h4>
971 <h5>WMColor</h5>
972 <ul>
974 <li><code> WMColor * WMCreateNamedColor (WMScreen *scr, char *name, Bool exact) </code>
975 </li><li><code> WMColor * WMCreateRGBAColor (WMScreen *scr, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha, Bool exact) </code>
976 </li><li><code> WMColor * WMCreateRGBColor (WMScreen *scr, unsigned short red, unsigned short green, unsigned short blue, Bool exact) </code>
977 </li><li><code> void WMReleaseColor (WMColor *color) </code>
978 </li><li><code> WMColor * WMRetainColor (WMColor *color) </code>
979 </li><li><code> char * WMGetColorRGBDescription (WMColor *color) </code>
981 </li><li><code> WMColor * WMBlackColor (WMScreen *scr) </code>
982 </li><li><code> WMColor * WMWhiteColor (WMScreen *scr) </code>
983 </li><li><code> WMColor * WMGrayColor (WMScreen *scr) </code>
984 </li><li><code> WMColor * WMDarkGrayColor (WMScreen *scr) </code>
985 </li><li><code> unsigned short WMBlueComponentOfColor (WMColor *color) </code>
986 </li><li><code> unsigned short WMRedComponentOfColor (WMColor *color) </code>
987 </li><li><code> unsigned short WMGreenComponentOfColor (WMColor *color) </code>
988 </li><li><code> void WMSetColorInGC (WMColor *color, GC gc) </code>
989 </li><li><code> WMPixel WMColorPixel (WMColor *color) </code>
990 </li><li><code> void WMSetColorAlpha (WMColor *color, unsigned short alpha) </code>
991 </li><li><code> unsigned short WMGetColorAlpha (WMColor *color) </code>
992 </li></ul><ul>
993 <li><code> void WMPaintColorSwatch (WMColor *color, Drawable d, int x, int y, unsigned int width, unsigned int height) </code>
994 </li><li><code> void WMSetColorWellColor (WMColorWell *cPtr, WMColor *color) </code>
995 </li><li><code> WMColorWell * WMCreateColorWell (WMWidget *parent) </code>
996 </li><li><code> WMColor * WMGetColorWellColor (WMColorWell *cPtr) </code>
997 </li></ul>
1000 <h5>WMFont</h5>
1001 <ul>
1002 <li><code> WMFont * WMCreateFont (WMScreen *scrPtr, char *fontName) </code>
1003 </li><li><code> WMFont * WMCreateFontSet (WMScreen *scrPtr, char *fontName) </code>
1004 </li><li><code> WMFont * WMCreateFontWithFlags (WMScreen *scrPtr, char *fontName, WMFontFlags flags) </code>
1005 </li><li><code> WMFont * WMCreateNormalFont (WMScreen *scrPtr, char *fontName) </code>
1006 </li><li><code> WMFont * WMCreateAntialiasedFont (WMScreen *scrPtr, char *fontName) </code>
1007 </li><li><code> WMFont * WMCreateAntialiasedFontSet (WMScreen *scrPtr, char *fontName) </code>
1008 </li><li><code> WMFont * WMCopyFontWithChanges (WMScreen *scrPtr, WMFont *font, const WMFontAttributes *changes) </code>
1009 </li><li><code> void WMReleaseFont (WMFont *font) </code>
1010 </li><li><code> WMFont * WMRetainFont (WMFont *font) </code>
1011 </li><li><code> WMFont * WMDefaultBoldSystemFont (WMScreen *scrPtr) </code>
1012 </li><li><code> WMFont * WMDefaultSystemFont (WMScreen *scrPtr) </code>
1013 </li><li><code> WMFont * WMSystemFontOfSize (WMScreen *scrPtr, int size) </code>
1014 </li><li><code> WMFont * WMBoldSystemFontOfSize (WMScreen *scrPtr, int size) </code>
1015 </li><li><code> unsigned int WMFontHeight (WMFont *font) </code>
1016 </li><li><code> XFontSet WMGetFontFontSet (WMFont *font) </code>
1017 </li><li><code> char * WMGetFontName (WMFont *font) </code>
1018 </li><li><code> Bool WMIsAntialiasedFont (WMFont *font) </code>
1019 </li><li><code> void WMSetWidgetDefaultBoldFont (WMScreen *scr, WMFont *font) </code>
1020 </li><li><code> void WMSetWidgetDefaultFont (WMScreen *scr, WMFont *font) </code>
1021 </li></ul>
1024 <h5>WMArray</h5>
1025 <ul>
1026 <li><code> WMArray * WMCreateArray (int initialSize) </code>
1027 </li><li><code> WMArray * WMCreateArrayWithArray (WMArray *array) </code>
1028 </li><li><code> WMArray * WMCreateArrayWithDestructor (int initialSize, WMFreeDataProc *destructor) </code>
1030 </li><li><code> void WMAddToArray (WMArray *array, void *item) </code>
1031 </li><li><code> void WMAppendArray (WMArray *array, WMArray *other) </code>
1032 </li><li><code> void * WMArrayFirst (WMArray *array, WMArrayIterator *iter) </code>
1033 </li><li><code> void * WMArrayLast (WMArray *array, WMArrayIterator *iter) </code>
1034 </li><li><code> void * WMArrayNext (WMArray *array, WMArrayIterator *iter) </code>
1035 </li><li><code> void * WMArrayPrevious (WMArray *array, WMArrayIterator *iter) </code>
1036 </li><li><code> int WMCountInArray (WMArray *array, void *item) </code>
1037 </li><li><code> int WMDeleteFromArray (WMArray *array, int index) </code>
1038 </li><li><code> void WMEmptyArray (WMArray *array) </code>
1039 </li><li><code> int WMFindInArray (WMArray *array, WMMatchDataProc *match, void *cdata) </code>
1040 </li><li><code> void WMFreeArray (WMArray *array) </code>
1041 </li><li><code> int WMGetArrayItemCount (WMArray *array) </code>
1042 </li><li><code> void * WMGetFromArray (WMArray *array, int index) </code>
1043 </li><li><code> void WMInsertInArray (WMArray *array, int index, void *item) </code>
1044 </li><li><code> void WMMapArray (WMArray *array, void (*function)(void *, void *), void *data) </code>
1045 </li><li><code> void * WMPopFromArray (WMArray *array) </code>
1046 </li><li><code> int WMRemoveFromArrayMatching (WMArray *array, WMMatchDataProc *match, void *cdata) </code>
1047 </li><li><code> void * WMReplaceInArray (WMArray *array, int index, void *item) </code>
1048 </li><li><code> void WMSortArray (WMArray *array, WMCompareDataProc *comparer) </code>
1049 </li></ul><ul>
1051 <li><code> WMPropList * WMCreatePLArray (WMPropList *elem, ... ) </code>
1052 </li><li><code> void WMAddToPLArray (WMPropList *plist, WMPropList *item) </code>
1053 </li><li><code> void WMDeleteFromPLArray (WMPropList *plist, int index) </code>
1054 </li><li><code> WMPropList * WMGetFromPLArray (WMPropList *plist, int index) </code>
1055 </li><li><code> void WMInsertInPLArray (WMPropList *plist, int index, WMPropList *item) </code>
1056 </li><li><code> Bool WMIsPLArray (WMPropList *plist) </code>
1057 </li><li><code> void WMRemoveFromPLArray (WMPropList *plist, WMPropList *item) </code>
1058 </li><li><code>WM_ITERATE_ARRAY(WMArray *,itemtype *,WMArrayIterator *iter)</code>
1059 </li></ul>
1062 <h5>Trees</h5>
1063 <ul>
1065 <li><code> WMTreeNode * WMCreateTreeNode (void *data) </code>
1066 </li><li><code> WMTreeNode * WMCreateTreeNodeWithDestructor (void *data, WMFreeDataProc *destructor) </code>
1067 </li><li><code> void WMDeleteLeafForTreeNode (WMTreeNode *aNode, int index) </code>
1068 </li><li><code> void WMDestroyTreeNode (WMTreeNode *aNode) </code>
1069 </li><li><code> void * WMGetDataForTreeNode (WMTreeNode *aNode) </code>
1070 </li><li><code> void * WMReplaceDataForTreeNode (WMTreeNode *aNode, void *newData) </code>
1071 </li><li><code> WMTreeNode * WMGetParentForTreeNode (WMTreeNode *aNode) </code>
1072 </li><li><code> int WMGetTreeNodeDepth (WMTreeNode *aNode) </code>
1073 </li><li><code> WMTreeNode * WMFindInTree (WMTreeNode *aTree, WMMatchDataProc *match, void *cdata) </code>
1074 </li><li><code> WMTreeNode * WMInsertItemInTree (WMTreeNode *parent, int index, void *item) </code>
1075 </li><li><code> WMTreeNode * WMInsertNodeInTree (WMTreeNode *parent, int index, WMTreeNode *aNode) </code>
1076 </li><li><code> void WMRemoveLeafForTreeNode (WMTreeNode *aNode, void *leaf) </code>
1077 </li><li><code> void WMSortLeavesForTreeNode (WMTreeNode *aNode, WMCompareDataProc *comparer) </code>
1078 </li><li><code> void WMSortTree (WMTreeNode *aNode, WMCompareDataProc *comparer) </code>
1080 </li></ul>
1083 <h3>ENUMS and #defines</h3>
1085 <h5><a name="EventsList">List</a> of event masks and corresponding events</h5>
1088 <table><tbody><tr><th>Event mask</th><th>Event</th>
1089 </tr><tr><td><code>KeyPressMask </code></td><td><code> KeyPress </code></td>
1090 </tr><tr><td><code>KeyReleaseMask </code></td><td><code> KeyRelease </code></td>
1091 </tr><tr><td><code>ButtonPressMask </code></td><td><code> ButtonPress </code></td>
1092 </tr><tr><td><code>ButtonReleaseMask </code></td><td><code> ButtonRelease </code></td>
1093 </tr><tr><td><code>EnterWindowMask </code></td><td><code> EnterNotify </code></td>
1094 </tr><tr><td><code>LeaveWindowMask </code></td><td><code> LeaveNotify </code></td>
1095 </tr><tr><td><code>FocusChangeMask </code></td><td><code> FocusIn </code></td>
1096 </tr><tr><td><code>FocusChangeMask </code></td><td><code> FocusOut </code></td>
1097 </tr><tr><td><code>KeymapStateMask </code></td><td><code> KeymapNotify </code></td>
1098 </tr><tr><td><code>ExposureMask </code></td><td><code> Expose </code></td>
1099 </tr><tr><td><code>ExposureMask </code></td><td><code> GraphicsExpose </code></td>
1100 </tr><tr><td><code>ExposureMask </code></td><td><code> NoExpose </code></td>
1101 </tr><tr><td><code>VisibilityChangeMask </code></td><td><code> VisibilityNotify </code></td>
1102 </tr><tr><td><code>SubstructureNotifyMask </code></td><td><code> CreateNotify </code></td>
1103 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> DestroyNotify </code></td>
1104 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> UnmapNotify </code></td>
1105 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> MapNotify </code></td>
1106 </tr><tr><td><code>SubstructureRedirectMask </code></td><td><code> MapRequest </code></td>
1107 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> ReparentNotify </code></td>
1108 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> ConfigureNotify </code></td>
1109 </tr><tr><td><code>SubstructureRedirectMask </code></td><td><code> ConfigureRequest </code></td>
1110 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> GravityNotify </code></td>
1111 </tr><tr><td><code>ResizeRedirectMask </code></td><td><code> ResizeRequest </code></td>
1112 </tr><tr><td><code>StructureNotifyMask </code></td><td><code> CirculateNotify </code></td>
1113 </tr><tr><td><code>SubstructureRedirectMask </code></td><td><code> CirculateRequest </code></td>
1114 </tr><tr><td><code>PropertyChangeMask </code></td><td><code> PropertyNotify </code></td>
1115 </tr><tr><td><code>ColormapChangeMask </code></td><td><code> ColormapNotify </code></td>
1116 </tr><tr><td><code>ClientMessageMask</code></td><td><code> ClientMessage </code></td>
1117 </tr><tr><td><code>PointerMotionMask|PointerMotionHintMask|<br>
1118 ButtonMotionMask|Button1MotionMask|<br>
1119 Button2MotionMask|Button3MotionMask|<br>
1120 Button4MotionMask|Button5MotionMask</code></td><td><code> MotionNotify </code></td>
1122 </tr></tbody></table>
1125 <h5><a name="TitlePositions"> Frame Title Positions</a> </h5>
1126 <ul>
1127 <li><code> WTPAboveTop<code>
1128 </code></code></li><li><code><code><code> WTPAtTop</code>
1129 </code></code></li><li><code><code><code> WTPBelowTop</code>
1130 </code></code></li><li><code><code><code> WTPAboveBottom</code>
1131 </code></code></li><li><code><code><code> WTPAtBottom</code>
1132 </code></code></li><li><code><code><code> WTPBelowBottom</code>
1133 </code></code></li></ul><code><code>
1134 <h5><a name="ImagePositions"> WM Image Positions</a> <code>WMImagePosition</code> </h5>
1135 <ul>
1136 <li><code> WIPNoImage,
1137 </code></li><li><code><code>WIPImageOnly,
1138 </code></code></li><li><code><code><code>WIPLeft,
1139 </code></code></code></li><li><code><code><code><code>WIPRight,
1140 </code></code></code></code></li><li><code><code><code><code><code>WIPBelow,
1141 </code></code></code></code></code></li><li><code><code><code><code><code><code>WIPAbove,
1142 </code></code></code></code></code></code></li><li><code><code><code><code><code><code><code>WIPOverlaps
1143 </code></code></code></code></code></code></code></li></ul><code><code><code><code><code><code><code>
1144 <h5><a name="Alignment"> WMAlignment</a> </h5>
1145 <ul>
1146 <li><code> WALeft
1147 </code></li><li><code><code> WACenter
1148 </code></code></li><li><code><code><code> WARight
1149 </code></code></code></li><li><code><code><code><code> WAJustified</code>
1150 </code></code></code></li></ul><code><code><code>
1152 <h5><a name="relief">Reliefs <code>WMReliefType</code></a></h5><a name="relief">
1153 <ul>
1154 <li><code> WRFlat</code>
1155 </li><li><code> WRSimple</code>
1156 </li><li><code> WRRaised</code>
1157 </li><li><code> WRSunken</code>
1158 </li><li><code> WRGroove</code>
1159 </li><li><code> WRRidge</code>
1160 </li><li><code> WRPushed</code>
1161 </li></ul>
1162 <h5>Colours</h5>
1163 <p><code>
1164 typedef struct RColor {
1165 unsigned char red;
1166 unsigned char green;
1167 unsigned char blue;
1168 unsigned char alpha;
1169 } RColor;
1170 </code>
1172 </p><p><code>
1173 typedef struct RSegment {
1174 int x1, y1, x2, y2;
1175 } RSegment;
1176 </code>
1179 <br>
1180 <br>
1181 </p><p>
1182 </p><table align="JUSTIFY" width="100%"><tbody><tr><td align="LEFT"><a href="WINGMenu.html">LAST: Programming Details 3</a></td><td align="RIGHT"><a href="WINGtoc.html">Contents</a></td></tr></tbody></table>
1186 <!-- W_VIEW_REALIZED W_VIEW_DISPLAY W_VIEW_DRAWABLE resp. flag, display, window of type Window -->
1187 <!-- view->childrenList, view->parent view->pos.x view->screen -->
1188 </a></code></code></code></code></code></code></code></code></code></code></code></code></code></li></ul<li></body><style type="text/css">embed[type*="application/x-shockwave-flash"],embed[src*=".swf"],object[type*="application/x-shockwave-flash"],object[codetype*="application/x-shockwave-flash"],object[src*=".swf"],object[codebase*="swflash.cab"],object[classid*="D27CDB6E-AE6D-11cf-96B8-444553540000"],object[classid*="d27cdb6e-ae6d-11cf-96b8-444553540000"],object[classid*="D27CDB6E-AE6D-11cf-96B8-444553540000"]{ display: none !important;}</style></html>