gwenhywfar  5.8.2
dialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Wed Jan 20 2010
3  copyright : (C) 2019 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 
26 #ifndef GWENHYWFAR_GUI_DIALOG_H
27 #define GWENHYWFAR_GUI_DIALOG_H
28 
29 
30 #include <gwenhywfar/inherit.h>
31 #include <gwenhywfar/list1.h>
32 #include <gwenhywfar/list2.h>
33 #include <gwenhywfar/xml.h>
34 #include <gwenhywfar/db.h>
35 
36 
37 
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 
54 typedef struct GWEN_DIALOG GWEN_DIALOG;
58 
59 
60 #define GWEN_WIDGET_FLAGS_NONE 0x00000000L
61 #define GWEN_WIDGET_FLAGS_FILLX 0x80000000L
62 #define GWEN_WIDGET_FLAGS_FILLY 0x40000000L
63 #define GWEN_WIDGET_FLAGS_READONLY 0x20000000L
64 #define GWEN_WIDGET_FLAGS_PASSWORD 0x10000000L
65 #define GWEN_WIDGET_FLAGS_DEFAULT_WIDGET 0x08000000L
66 
67 #define GWEN_WIDGET_FLAGS_DECOR_SHRINKABLE 0x04000000L
68 #define GWEN_WIDGET_FLAGS_DECOR_STRETCHABLE 0x02000000L
69 #define GWEN_WIDGET_FLAGS_DECOR_MINIMIZE 0x01000000L
70 #define GWEN_WIDGET_FLAGS_DECOR_MAXIMIZE 0x00800000L
71 #define GWEN_WIDGET_FLAGS_DECOR_CLOSE 0x00400000L
72 #define GWEN_WIDGET_FLAGS_DECOR_MENU 0x00200000L
73 
74 #define GWEN_WIDGET_FLAGS_FIXED_WIDTH 0x00100000L
75 #define GWEN_WIDGET_FLAGS_FIXED_HEIGHT 0x00080000L
76 #define GWEN_WIDGET_FLAGS_EQUAL_WIDTH 0x00040000L
77 #define GWEN_WIDGET_FLAGS_EQUAL_HEIGHT 0x00020000L
78 
79 #define GWEN_WIDGET_FLAGS_JUSTIFY_LEFT 0x00010000L
80 #define GWEN_WIDGET_FLAGS_JUSTIFY_RIGHT 0x00008000L
81 #define GWEN_WIDGET_FLAGS_JUSTIFY_TOP 0x00004000L
82 #define GWEN_WIDGET_FLAGS_JUSTIFY_BOTTOM 0x00002000L
83 #define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERX 0x00001000L
84 #define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERY 0x00000800L
85 
86 #define GWEN_WIDGET_FLAGS_NO_WORDWRAP 0x00000400L
87 
88 #define GWEN_WIDGET_FLAGS_HANDLE_KEYS 0x00000200L
89 
90 #define GWEN_WIDGET_FLAGS_FRAME_SUNKEN 0x00000100L
91 #define GWEN_WIDGET_FLAGS_FRAME_RAISED 0x00000080L
92 #define GWEN_WIDGET_FLAGS_FRAME_THICK 0x00000040L
93 #define GWEN_WIDGET_FLAGS_FRAME_GROOVE 0x00000020L
94 
95 
96 
97 
98 typedef enum {
108 
111 
112 
113 
119 enum {
124 };
125 
126 
134  const char *sender);
135 
142  const char *sender,
143  int intArg,
144  const char *stringArg);
145 
146 
147 
149 GWEN_DIALOG *GWEN_Dialog_new(const char *dialogId);
150 
151 
162 GWEN_DIALOG *GWEN_Dialog_CreateAndLoadWithPath(const char *dialogId,
163  const char *pmLibName,
164  const char *pmDataDir,
165  const char *fileName);
166 
167 
169 void GWEN_Dialog_free(GWEN_DIALOG *dlg);
170 
176 
177 
182 int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname);
183 
190 const char *GWEN_Dialog_GetId(const GWEN_DIALOG *dlg);
191 
192 
194 uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg);
195 
196 
202 void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s);
203 
204 
218  const char *destlib,
219  const char *pathName,
220  const char *relPath);
221 
222 
233  const char *parentWidgetName,
234  GWEN_DIALOG *subdlg);
235 
237 int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name);
238 
239 
247 
248 
255 
256 
257 
258 
259 
260 typedef enum {
262 
282 
284 
287 
288 
289 typedef enum {
294 
295 
296 typedef enum {
301 
302 
311 
332  const char *name,
334  int index,
335  int value,
336  int doSignal);
337 
349  const char *name,
351  int index,
352  int defaultValue);
353 
362  const char *name,
364  int index,
365  const char *value,
366  int doSignal);
367 
392  const char *name,
394  int index,
395  const char *defaultValue);
408 uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name);
409 
411 void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
412 
414 void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
415 
417 void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
418 
428 int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name);
429 
430 
431 
436 void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i);
437 
438 
439 
447 int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name);
448 
449 
454 void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i);
455 
456 
458 const char *GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name);
459 
461 void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t);
462 
463 
478 
487 
492 void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s);
493 
504 const char *GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg);
505 
510 const char *GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s);
514 #ifdef __cplusplus
515 }
516 #endif
517 
518 
519 
523 #endif
GWEN_DialogEvent_ResultReject
@ GWEN_DialogEvent_ResultReject
Definition: dialog.h:123
GWEN_DialogProperty_ClearValues
@ GWEN_DialogProperty_ClearValues
Definition: dialog.h:269
GWEN_DialogSortDirection_Down
@ GWEN_DialogSortDirection_Down
Definition: dialog.h:299
GWEN_DialogProperty_SelectionMode
@ GWEN_DialogProperty_SelectionMode
Definition: dialog.h:274
GWEN_Dialog_SetSignalHandler2
GWENHYWFAR_API GWEN_DIALOG_SIGNALHANDLER2 GWEN_Dialog_SetSignalHandler2(GWEN_DIALOG *dlg, GWEN_DIALOG_SIGNALHANDLER2 fn)
GWEN_DialogEvent_TypeActivated
@ GWEN_DialogEvent_TypeActivated
Definition: dialog.h:102
GWEN_Dialog_new
GWENHYWFAR_API GWEN_DIALOG * GWEN_Dialog_new(const char *dialogId)
GWEN_Dialog_AddMediaPathsFromPathManager
GWENHYWFAR_API void GWEN_Dialog_AddMediaPathsFromPathManager(GWEN_DIALOG *dlg, const char *destlib, const char *pathName, const char *relPath)
GWEN_DialogProperty_MaxValue
@ GWEN_DialogProperty_MaxValue
Definition: dialog.h:266
GWEN_DialogProperty_Focus
@ GWEN_DialogProperty_Focus
Definition: dialog.h:276
GWEN_Dialog_CreateAndLoadWithPath
GWENHYWFAR_API GWEN_DIALOG * GWEN_Dialog_CreateAndLoadWithPath(const char *dialogId, const char *pmLibName, const char *pmDataDir, const char *fileName)
GWEN_INHERIT_FUNCTION_LIB_DEFS
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition: inherit.h:125
GWEN_DialogProperty_SelectionState
@ GWEN_DialogProperty_SelectionState
Definition: dialog.h:275
GWEN_DialogProperty_AddValue
@ GWEN_DialogProperty_AddValue
Definition: dialog.h:268
GWEN_Dialog_AddMediaPath
GWENHYWFAR_API void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s)
GWEN_DialogEvent_TypeClose
@ GWEN_DialogEvent_TypeClose
Definition: dialog.h:105
GWEN_DialogProperty_ValueCount
@ GWEN_DialogProperty_ValueCount
Definition: dialog.h:270
GWEN_DialogProperty_ToolTip
@ GWEN_DialogProperty_ToolTip
Definition: dialog.h:281
GWEN_DialogProperty_Title
@ GWEN_DialogProperty_Title
Definition: dialog.h:263
GWEN_Dialog_SetIntProperty
GWENHYWFAR_API int GWEN_Dialog_SetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
GWEN_Dialog_SelectionMode_Single
@ GWEN_Dialog_SelectionMode_Single
Definition: dialog.h:291
db.h
GWEN_Dialog_SetWidgetRows
GWENHYWFAR_API void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i)
xml.h
GWEN_Dialog_GetGuiId
GWENHYWFAR_API uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg)
GWEN_DIALOG_EVENTTYPE
GWEN_DIALOG_EVENTTYPE
Definition: dialog.h:98
GWEN_DialogEvent_TypeDisabled
@ GWEN_DialogEvent_TypeDisabled
Definition: dialog.h:104
GWEN_Dialog_AddSubDialog
GWENHYWFAR_API int GWEN_Dialog_AddSubDialog(GWEN_DIALOG *dlg, const char *parentWidgetName, GWEN_DIALOG *subdlg)
GWEN_Dialog_ReadXmlFile
GWENHYWFAR_API int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname)
GWEN_Dialog_GetI18nDomain
const GWENHYWFAR_API char * GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg)
GWEN_Dialog_TranslateString
const GWENHYWFAR_API char * GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s)
GWEN_DIALOG_SIGNALHANDLER
int GWENHYWFAR_CB(* GWEN_DIALOG_SIGNALHANDLER)(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
Definition: dialog.h:132
GWEN_Dialog_SetSignalHandler
GWENHYWFAR_API GWEN_DIALOG_SIGNALHANDLER GWEN_Dialog_SetSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_SIGNALHANDLER fn)
GWEN_DialogProperty_Value
@ GWEN_DialogProperty_Value
Definition: dialog.h:264
GWEN_Dialog_SetWidgetText
GWENHYWFAR_API void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t)
GWEN_Dialog_SelectionMode_Multi
@ GWEN_Dialog_SelectionMode_Multi
Definition: dialog.h:292
GWEN_Dialog_GetCharProperty
const GWENHYWFAR_API char * GWEN_Dialog_GetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
GWEN_DialogEvent_TypeEnabled
@ GWEN_DialogEvent_TypeEnabled
Definition: dialog.h:103
GWEN_LIST_FUNCTION_LIB_DEFS
#define GWEN_LIST_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list1.h:348
GWEN_Dialog_SetWidgetFlags
GWENHYWFAR_API void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_Dialog_SubWidgetFlags
GWENHYWFAR_API void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_DialogEvent_TypeValueChanged
@ GWEN_DialogEvent_TypeValueChanged
Definition: dialog.h:101
GWEN_DialogProperty_SortDirection
@ GWEN_DialogProperty_SortDirection
Definition: dialog.h:278
GWEN_Dialog_GetWidgetRows
GWENHYWFAR_API int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name)
GWEN_Dialog_GetWidgetText
const GWENHYWFAR_API char * GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name)
GWENHYWFAR_CB
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
GWEN_DialogEvent_TypeInit
@ GWEN_DialogEvent_TypeInit
Definition: dialog.h:99
GWEN_LIST2_FUNCTION_LIB_DEFS
#define GWEN_LIST2_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list2.h:56
GWEN_XMLNODE
struct GWEN__XMLNODE GWEN_XMLNODE
Definition: xml.h:156
GWEN_DialogProperty_Visibility
@ GWEN_DialogProperty_Visibility
Definition: dialog.h:280
GWEN_DialogProperty_ColumnWidth
@ GWEN_DialogProperty_ColumnWidth
Definition: dialog.h:271
GWEN_Dialog_SetCharProperty
GWENHYWFAR_API int GWEN_Dialog_SetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
GWEN_DIALOG_PROPERTY
GWEN_DIALOG_PROPERTY
Definition: dialog.h:260
GWEN_DialogProperty_None
@ GWEN_DialogProperty_None
Definition: dialog.h:261
GWEN_Dialog_GetPreferences
GWENHYWFAR_API GWEN_DB_NODE * GWEN_Dialog_GetPreferences(const GWEN_DIALOG *dlg)
GWEN_DIALOG
struct GWEN_DIALOG GWEN_DIALOG
Definition: dialog.h:54
GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultAccept
Definition: dialog.h:122
GWEN_DialogSortDirection_Up
@ GWEN_DialogSortDirection_Up
Definition: dialog.h:298
GWEN_DialogProperty_Enabled
@ GWEN_DialogProperty_Enabled
Definition: dialog.h:267
GWEN_DialogProperty_Height
@ GWEN_DialogProperty_Height
Definition: dialog.h:273
GWEN_Dialog_GetWidgetFlags
GWENHYWFAR_API uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name)
GWEN_Dialog_GetIntProperty
GWENHYWFAR_API int GWEN_Dialog_GetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
GWEN_DialogProperty_Sort
@ GWEN_DialogProperty_Sort
Definition: dialog.h:279
GWEN_DIALOG_SORT_DIRECTION
GWEN_DIALOG_SORT_DIRECTION
Definition: dialog.h:296
GWEN_Dialog_ReadXml
GWENHYWFAR_API int GWEN_Dialog_ReadXml(GWEN_DIALOG *dlg, GWEN_XMLNODE *node)
GWEN_Dialog_SetI18nDomain
GWENHYWFAR_API void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s)
GWEN_DialogSortDirection_None
@ GWEN_DialogSortDirection_None
Definition: dialog.h:297
GWEN_DialogProperty_Width
@ GWEN_DialogProperty_Width
Definition: dialog.h:272
GWEN_Dialog_SetWidgetColumns
GWENHYWFAR_API void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i)
GWEN_DIALOG_SELECTION_MODE
GWEN_DIALOG_SELECTION_MODE
Definition: dialog.h:289
GWEN_Dialog_AddWidgetFlags
GWENHYWFAR_API void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_DB_NODE
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
GWEN_DialogEvent_ResultNotHandled
@ GWEN_DialogEvent_ResultNotHandled
Definition: dialog.h:121
GWEN_DialogEvent_ResultHandled
@ GWEN_DialogEvent_ResultHandled
Definition: dialog.h:120
GWEN_DialogProperty_MinValue
@ GWEN_DialogProperty_MinValue
Definition: dialog.h:265
list2.h
This file contains some macros concerning lists.
GWEN_DIALOG_SIGNALHANDLER2
int GWENHYWFAR_CB(* GWEN_DIALOG_SIGNALHANDLER2)(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender, int intArg, const char *stringArg)
Definition: dialog.h:140
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWEN_Dialog_free
GWENHYWFAR_API void GWEN_Dialog_free(GWEN_DIALOG *dlg)
GWEN_DialogEvent_TypeLast
@ GWEN_DialogEvent_TypeLast
Definition: dialog.h:109
GWEN_Dialog_GetId
const GWENHYWFAR_API char * GWEN_Dialog_GetId(const GWEN_DIALOG *dlg)
GWEN_Dialog_RemoveWidget
GWENHYWFAR_API int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name)
GWEN_Dialog_GetWidgetColumns
GWENHYWFAR_API int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name)
list1.h
GWEN_DialogProperty_WindowId
@ GWEN_DialogProperty_WindowId
Definition: dialog.h:283
inherit.h
GWEN_DialogProperty_Unknown
@ GWEN_DialogProperty_Unknown
Definition: dialog.h:285
GWEN_DialogEvent_TypeFini
@ GWEN_DialogEvent_TypeFini
Definition: dialog.h:100
GWEN_Dialog_SelectionMode_None
@ GWEN_Dialog_SelectionMode_None
Definition: dialog.h:290
GWEN_DialogEvent_TypeKeyReleased
@ GWEN_DialogEvent_TypeKeyReleased
Definition: dialog.h:107
GWEN_DialogEvent_TypeKeyPressed
@ GWEN_DialogEvent_TypeKeyPressed
Definition: dialog.h:106