X11 Work Bench Toolkit  1.0
dialog_support.h
1 
2 // _ _ _ _ _ //
3 // __| |(_) __ _ | | ___ __ _ ___ _ _ _ __ _ __ ___ _ __ | |_ | |__ //
4 // / _` || | / _` || | / _ \ / _` | / __|| | | || '_ \ | '_ \ / _ \ | '__|| __| | '_ \ //
5 // | (_| || || (_| || || (_) || (_| | \__ \| |_| || |_) || |_) || (_) || | | |_ _ | | | | //
6 // \__,_||_| \__,_||_| \___/ \__, |_____|___/ \__,_|| .__/ | .__/ \___/ |_| \__|(_)|_| |_| //
7 // |___/|_____| |_| |_| //
8 // //
9 // //
10 // additional dialog control support //
11 // This file contains semi-private definitions that are needed to generically support dialog controls //
12 // //
14 
15 /*****************************************************************************
16 
17  X11workbench - X11 programmer's 'work bench' application and toolkit
18  Copyright (c) 2010-2016 by Bob Frazier (aka 'Big Bad Bombastic Bob')
19  all rights reserved
20 
21  DISCLAIMER: The X11workbench application and toolkit software are supplied
22  'as-is', with no warranties, either implied or explicit.
23  Any claims to alleged functionality or features should be
24  considered 'preliminary', and might not function as advertised.
25 
26  BSD-like license:
27 
28  There is no restriction as to what you can do with this software, so long
29  as you include the above copyright notice and DISCLAIMER for any distributed
30  work that is equal to or derived from this one, along with this paragraph
31  that explains the terms of the license if the source is also being made
32  available. A "derived work" describes a work that uses a significant portion
33  of the source files or algorithms that are included with this one.
34  Specifically excluded from this are files that were generated by the software,
35  or anything that is included with the software that is part of another package
36  (such as files that were created or added during the 'configure' process).
37  Specifically included is the use of part or all of any of the X11 workbench
38  toolkit source or header files in your distributed application. If you do not
39  ship the source, the above copyright statement is still required to be placed
40  in a reasonably prominent place, such as documentation, splash screens, and/or
41  'about the application' dialog boxes.
42 
43  Use and distribution are in accordance with GPL, LGPL, and/or the above
44  BSD-like license. See COPYING and README files for more information.
45 
46 
47  Additional information at http://sourceforge.net/projects/X11workbench
48 
49 ******************************************************************************/
50 
51 
52 
53 // INTERNAL USE ONLY for dialog controls, etc.
54 
55 #ifndef _DIALOG_SUPPORT_H_INCLUDED_
56 #define _DIALOG_SUPPORT_H_INCLUDED_
57 
58 #include "dialog_controls.h" // make sure this is included first
59 #include "text_object.h" // needed for _WB_EDIT_CONTROL_
60 
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif // __cplusplus
65 
66 
109 typedef struct __LISTINFO__
110 {
111  int nItems,
112  nMaxItems;
113  int nPos,
114  nTop;
115  int nHeight,
116  nItemHeight;
117  int nFlags;
118  Window wOwner;
119 
124  void *(*pfnAllocator)(const void *, int);
129  void (*pfnDestructor)(void *);
137  void (*pfnDisplay)(WBDialogControl *pControl, void *pData, int iSelected, GC gcPaint, WB_GEOM *pGeom, XFontSet fontSet);
138 
140  int (*pfnSort)(const void *, const void *); // sort proc (NULL implies strcmp)
141 
143  void *aItems[1]; // array of item data (remainder of struct)
144 } LISTINFO;
145 
146 
147 
148 // specialized structures 'derived' from WBDialogControl (internal only)
170 typedef struct _WB_IMAGE_CONTROL_
171 {
173  Pixmap pixmap;
174  Pixmap pixmap2;
176 
199 {
201  Pixmap pixmap;
202  Pixmap pixmap2;
204 
225 typedef struct _WB_EDIT_CONTROL_
226 {
229 } WBEditControl;
230 
231 
257 typedef struct _WB_LIST_CURSEL_
258 {
259  int iCurSel;
260  int iTopIndex;
261  int iHeight;
263 } WBListCurSel;
264 
265 
289 typedef struct _WB_LIST_CONTROL_
290 {
293  int *pSelBitmap;
294  int cbBitmap;
295  XFontSet fsBold;
296 } WBListControl;
297 
298 
320 typedef struct _WB_COMBO_CONTROL_
321 {
326 
327 
349 typedef struct _WB_TREE_CONTROL_
350 {
353  XFontSet fsBold;
354 } WBTreeControl;
355 
356 
357 
368 void DLGCDestroyProperties(WBDialogPropList *pPropList);
369 
388 LISTINFO *DLGCListInfoConstructor(Window wOwner, int nMax, int nFlags,
389  void *(*pfnAllocator)(const void *,int), void (*pfnDestructor)(void *),
390  void (*pfnDisplay)(WBDialogControl *, void *, int, GC, WB_GEOM *, XFontSet),
391  int (*pfnSort)(const void *, const void *));
392 
403 void DLGCListInfoDestructor(LISTINFO *pListInfo);
404 
405 
422 void DLGCDefaultListControlDisplayProc(WBDialogControl *pList, void *pData, int iSelected, GC gc, WB_GEOM *pGeom, XFontSet fontSet);
423 
424 
425 
426 #ifndef DIALOG_SUPPORT_C
427 
428 extern const Atom aDLGC_TEXT;
429 extern const Atom aDLGC_CAPTION;
430 extern const Atom aDLGC_FONT;
431 extern const Atom aDLGC_SCROLLINFO;
432 extern const Atom aDLGC_LISTINFO;
433 
434 #endif // DIALOG_SUPPORT_C
435 
436 
437 #ifdef NO_DEBUG
438 #define DEBUG_DUMP_LIST(X)
439 #else // !NO_DEBUG
440 void DEBUG_DUMP_LIST(WBDialogControl *pCtrl);
441 #endif // NO_DEBUG
442 
443 
444 #ifdef __cplusplus
445 };
446 #endif // __cplusplus
447 
448 #endif // _DIALOG_SUPPORT_H_INCLUDED_
449 
450