widget_be.h File Reference
`#include <gwenhywfar/tree.h>`
`#include <gwenhywfar/inherit.h>`
`#include <gwenhywfar/dialog.h>`

Go to the source code of this file.

## Macros

#define | GWEN_WIDGET_IMPLDATACOUNT 4
#define | GWEN_WIDGET_TEXTCOUNT 4

## Typedefs

typedef struct GWEN_WIDGET | GWEN_WIDGET
typedef int GWENHYWFAR_CB(* | GWEN_WIDGET_ADDCHILDGUIWIDGET_FN) (GWEN_WIDGET *w, GWEN_WIDGET *wChild)
typedef const char *GWENHYWFAR_CB(* | GWEN_WIDGET_GETCHARPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
typedef int GWENHYWFAR_CB(* | GWEN_WIDGET_GETINTPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
typedef int GWENHYWFAR_CB(* | GWEN_WIDGET_SETCHARPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
typedef int GWENHYWFAR_CB(* | GWEN_WIDGET_SETINTPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)

## Enumerations

enum

GWEN_WIDGET_TYPE {
GWEN_Widget_TypeUnknown =-1 , GWEN_Widget_TypeNone =0 , GWEN_Widget_TypeLabel =1 , GWEN_Widget_TypePushButton ,
GWEN_Widget_TypeLineEdit , GWEN_Widget_TypeTextEdit , GWEN_Widget_TypeComboBox , GWEN_Widget_TypeRadioButton ,
GWEN_Widget_TypeProgressBar , GWEN_Widget_TypeGroupBox , GWEN_Widget_TypeHSpacer , GWEN_Widget_TypeVSpacer ,
GWEN_Widget_TypeHLayout , GWEN_Widget_TypeVLayout , GWEN_Widget_TypeGridLayout , GWEN_Widget_TypeListBox ,
GWEN_Widget_TypeDialog , GWEN_Widget_TypeTabBook , GWEN_Widget_TypeTabPage , GWEN_Widget_TypeCheckBox ,
GWEN_Widget_TypeWidgetStack , GWEN_Widget_TypeScrollArea , GWEN_Widget_TypeHLine , GWEN_Widget_TypeVLine ,
GWEN_Widget_TypeTextBrowser , GWEN_Widget_TypeSpinBox , GWEN_Widget_TypeHSplitter , GWEN_Widget_TypeVSplitter
}

## Functions

GWENHYWFAR_API int | GWEN_Widget_AddChildGuiWidget (GWEN_WIDGET *w, GWEN_WIDGET *wChild)
GWENHYWFAR_API void | GWEN_Widget_AddFlags (GWEN_WIDGET *w, uint32_t fl)
GWENHYWFAR_API uint32_t | GWEN_Widget_Flags_fromString (const char *s)
GWENHYWFAR_API const char * | GWEN_Widget_GetCharProperty (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
GWENHYWFAR_API int | GWEN_Widget_GetColumns (const GWEN_WIDGET *w)
GWENHYWFAR_API GWEN_DIALOG * | GWEN_Widget_GetDialog (const GWEN_WIDGET *w)
GWENHYWFAR_API uint32_t | GWEN_Widget_GetFlags (const GWEN_WIDGET *w)
GWENHYWFAR_API int | GWEN_Widget_GetGroupId (const GWEN_WIDGET *w)
GWENHYWFAR_API int | GWEN_Widget_GetHeight (const GWEN_WIDGET *w)
GWENHYWFAR_API const char * | GWEN_Widget_GetIconFileName (const GWEN_WIDGET *w)
GWENHYWFAR_API const char * | GWEN_Widget_GetImageFileName (const GWEN_WIDGET *w)
GWENHYWFAR_API void * | GWEN_Widget_GetImplData (const GWEN_WIDGET *w, int index)
GWENHYWFAR_API int | GWEN_Widget_GetIntProperty (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
GWENHYWFAR_API const char * | GWEN_Widget_GetName (const GWEN_WIDGET *w)
GWENHYWFAR_API int | GWEN_Widget_GetRows (const GWEN_WIDGET *w)
GWENHYWFAR_API const char * | GWEN_Widget_GetText (const GWEN_WIDGET *w, int idx)
GWENHYWFAR_API GWEN_DIALOG * | GWEN_Widget_GetTopDialog (const GWEN_WIDGET *w)
GWENHYWFAR_API GWEN_WIDGET_TYPE | GWEN_Widget_GetType (const GWEN_WIDGET *w)
GWENHYWFAR_API int | GWEN_Widget_GetWidth (const GWEN_WIDGET *w)
GWENHYWFAR_API GWEN_WIDGET_ADDCHILDGUIWIDGET_FN | GWEN_Widget_SetAddChildGuiWidgetFn (GWEN_WIDGET *w, GWEN_WIDGET_ADDCHILDGUIWIDGET_FN fn)
GWENHYWFAR_API int | GWEN_Widget_SetCharProperty (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
GWENHYWFAR_API void | GWEN_Widget_SetColumns (GWEN_WIDGET *w, int i)
GWENHYWFAR_API void | GWEN_Widget_SetFlags (GWEN_WIDGET *w, uint32_t fl)
GWENHYWFAR_API GWEN_WIDGET_GETCHARPROPERTY_FN | GWEN_Widget_SetGetCharPropertyFn (GWEN_WIDGET *w, GWEN_WIDGET_GETCHARPROPERTY_FN fn)
GWENHYWFAR_API GWEN_WIDGET_GETINTPROPERTY_FN | GWEN_Widget_SetGetIntPropertyFn (GWEN_WIDGET *w, GWEN_WIDGET_GETINTPROPERTY_FN fn)
GWENHYWFAR_API void | GWEN_Widget_SetGroupId (GWEN_WIDGET *w, int i)
GWENHYWFAR_API void | GWEN_Widget_SetHeight (GWEN_WIDGET *w, int i)
GWENHYWFAR_API void | GWEN_Widget_SetIconFileName (GWEN_WIDGET *w, const char *s)
GWENHYWFAR_API void | GWEN_Widget_SetImageFileName (GWEN_WIDGET *w, const char *s)
GWENHYWFAR_API void | GWEN_Widget_SetImplData (GWEN_WIDGET *w, int index, void *ptr)
| Store a pointer with the widget.
GWENHYWFAR_API int | GWEN_Widget_SetIntProperty (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
GWENHYWFAR_API void | GWEN_Widget_SetName (GWEN_WIDGET *w, const char *s)
GWENHYWFAR_API void | GWEN_Widget_SetRows (GWEN_WIDGET *w, int i)
GWENHYWFAR_API GWEN_WIDGET_SETCHARPROPERTY_FN | GWEN_Widget_SetSetCharPropertyFn (GWEN_WIDGET *w, GWEN_WIDGET_SETCHARPROPERTY_FN fn)
GWENHYWFAR_API GWEN_WIDGET_SETINTPROPERTY_FN | GWEN_Widget_SetSetIntPropertyFn (GWEN_WIDGET *w, GWEN_WIDGET_SETINTPROPERTY_FN fn)
GWENHYWFAR_API void | GWEN_Widget_SetText (GWEN_WIDGET *w, int idx, const char *s)
GWENHYWFAR_API void | GWEN_Widget_SetType (GWEN_WIDGET *w, GWEN_WIDGET_TYPE t)
GWENHYWFAR_API void | GWEN_Widget_SetWidth (GWEN_WIDGET *w, int i)
GWENHYWFAR_API void | GWEN_Widget_SubFlags (GWEN_WIDGET *w, uint32_t fl)
GWENHYWFAR_API GWEN_WIDGET_TYPE | GWEN_Widget_Type_fromString (const char *s)
GWENHYWFAR_API const char * | GWEN_Widget_Type_toString (GWEN_WIDGET_TYPE t)

## Macro Definition Documentation

## GWEN_WIDGET_IMPLDATACOUNT

#define GWEN_WIDGET_IMPLDATACOUNT 4

Definition at line 46 of file widget_be.h.

## GWEN_WIDGET_TEXTCOUNT

#define GWEN_WIDGET_TEXTCOUNT 4

Definition at line 45 of file widget_be.h.

## Typedef Documentation

## GWEN_WIDGET

typedef struct GWEN_WIDGET GWEN_WIDGET

Definition at line 34 of file widget_be.h.

## GWEN_WIDGET_ADDCHILDGUIWIDGET_FN

typedef int GWENHYWFAR_CB(* GWEN_WIDGET_ADDCHILDGUIWIDGET_FN) (GWEN_WIDGET *w, GWEN_WIDGET *wChild)

Definition at line 121 of file widget_be.h.

## GWEN_WIDGET_GETCHARPROPERTY_FN

typedef const char *GWENHYWFAR_CB(* GWEN_WIDGET_GETCHARPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)

Definition at line 116 of file widget_be.h.

## GWEN_WIDGET_GETINTPROPERTY_FN

typedef int GWENHYWFAR_CB(* GWEN_WIDGET_GETINTPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)

Definition at line 105 of file widget_be.h.

## GWEN_WIDGET_SETCHARPROPERTY_FN

typedef int GWENHYWFAR_CB(* GWEN_WIDGET_SETCHARPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)

Definition at line 110 of file widget_be.h.

## GWEN_WIDGET_SETINTPROPERTY_FN

typedef int GWENHYWFAR_CB(* GWEN_WIDGET_SETINTPROPERTY_FN) (GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)

Definition at line 99 of file widget_be.h.

## Enumeration Type Documentation

## GWEN_WIDGET_TYPE

enum GWEN_WIDGET_TYPE

Enumerator
GWEN_Widget_TypeUnknown |
GWEN_Widget_TypeNone |
GWEN_Widget_TypeLabel |
GWEN_Widget_TypePushButton |
GWEN_Widget_TypeLineEdit |
GWEN_Widget_TypeTextEdit |
GWEN_Widget_TypeComboBox |
GWEN_Widget_TypeRadioButton |
GWEN_Widget_TypeProgressBar |
GWEN_Widget_TypeGroupBox |
GWEN_Widget_TypeHSpacer |
GWEN_Widget_TypeVSpacer |
GWEN_Widget_TypeHLayout |
GWEN_Widget_TypeVLayout |
GWEN_Widget_TypeGridLayout |
GWEN_Widget_TypeListBox |
GWEN_Widget_TypeDialog |
GWEN_Widget_TypeTabBook |
GWEN_Widget_TypeTabPage |
GWEN_Widget_TypeCheckBox |
GWEN_Widget_TypeWidgetStack |
GWEN_Widget_TypeScrollArea |
GWEN_Widget_TypeHLine |
GWEN_Widget_TypeVLine |
GWEN_Widget_TypeTextBrowser |
GWEN_Widget_TypeSpinBox |
GWEN_Widget_TypeHSplitter |
GWEN_Widget_TypeVSplitter |

Definition at line 49 of file widget_be.h.

## Function Documentation

## GWEN_Widget_AddChildGuiWidget()

GWENHYWFAR_API int GWEN_Widget_AddChildGuiWidget | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET * | wChild )

## GWEN_Widget_AddFlags()

GWENHYWFAR_API void GWEN_Widget_AddFlags | ( | GWEN_WIDGET * | w,
|  | uint32_t | fl )

References GWENHYWFAR_API.

## GWEN_Widget_Flags_fromString()

GWENHYWFAR_API uint32_t GWEN_Widget_Flags_fromString | ( | const char * | s | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetCharProperty()

GWENHYWFAR_API const char * GWEN_Widget_GetCharProperty | ( | GWEN_WIDGET * | w,
|  | GWEN_DIALOG_PROPERTY | prop,
|  | int | index,
|  | const char * | defaultValue )

References GWENHYWFAR_API.

## GWEN_Widget_GetColumns()

GWENHYWFAR_API int GWEN_Widget_GetColumns | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetDialog()

GWENHYWFAR_API GWEN_DIALOG * GWEN_Widget_GetDialog | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetFlags()

GWENHYWFAR_API uint32_t GWEN_Widget_GetFlags | ( | const GWEN_WIDGET * | w | ) |

Returns the flags of the given widget (see GWEN_WIDGET_FLAGS_FILLX and following).

References GWENHYWFAR_API.

## GWEN_Widget_GetGroupId()

GWENHYWFAR_API int GWEN_Widget_GetGroupId | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetHeight()

GWENHYWFAR_API int GWEN_Widget_GetHeight | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetIconFileName()

GWENHYWFAR_API const char * GWEN_Widget_GetIconFileName | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetImageFileName()

GWENHYWFAR_API const char * GWEN_Widget_GetImageFileName | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetImplData()

GWENHYWFAR_API void * GWEN_Widget_GetImplData | ( | const GWEN_WIDGET * | w,
|  | int | index )

References GWENHYWFAR_API.

## GWEN_Widget_GetIntProperty()

GWENHYWFAR_API int GWEN_Widget_GetIntProperty | ( | GWEN_WIDGET * | w,
|  | GWEN_DIALOG_PROPERTY | prop,
|  | int | index,
|  | int | defaultValue )

References GWENHYWFAR_API.

## GWEN_Widget_GetName()

GWENHYWFAR_API const char * GWEN_Widget_GetName | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetRows()

GWENHYWFAR_API int GWEN_Widget_GetRows | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetText()

GWENHYWFAR_API const char * GWEN_Widget_GetText | ( | const GWEN_WIDGET * | w,
|  | int | idx )

References GWENHYWFAR_API.

## GWEN_Widget_GetTopDialog()

GWENHYWFAR_API GWEN_DIALOG * GWEN_Widget_GetTopDialog | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_GetType()

GWENHYWFAR_API GWEN_WIDGET_TYPE GWEN_Widget_GetType | ( | const GWEN_WIDGET * | w | ) |

Returns the type of the widget (see GWEN_Widget_TypeLabel and following).

References GWENHYWFAR_API.

## GWEN_Widget_GetWidth()

GWENHYWFAR_API int GWEN_Widget_GetWidth | ( | const GWEN_WIDGET * | w | ) |

References GWENHYWFAR_API.

## GWEN_Widget_SetAddChildGuiWidgetFn()

GWENHYWFAR_API GWEN_WIDGET_ADDCHILDGUIWIDGET_FN GWEN_Widget_SetAddChildGuiWidgetFn | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET_ADDCHILDGUIWIDGET_FN | fn )

Sets the handler for the AddChildGuiWidget function (see GWEN_WIDGET_ADDCHILDGUIWIDGET_FN).

References GWENHYWFAR_API.

## GWEN_Widget_SetCharProperty()

GWENHYWFAR_API int GWEN_Widget_SetCharProperty | ( | GWEN_WIDGET * | w,
|  | GWEN_DIALOG_PROPERTY | prop,
|  | int | index,
|  | const char * | value,
|  | int | doSignal )

References GWENHYWFAR_API.

## GWEN_Widget_SetColumns()

GWENHYWFAR_API void GWEN_Widget_SetColumns | ( | GWEN_WIDGET * | w,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_Widget_SetFlags()

GWENHYWFAR_API void GWEN_Widget_SetFlags | ( | GWEN_WIDGET * | w,
|  | uint32_t | fl )

References GWENHYWFAR_API.

## GWEN_Widget_SetGetCharPropertyFn()

GWENHYWFAR_API GWEN_WIDGET_GETCHARPROPERTY_FN GWEN_Widget_SetGetCharPropertyFn | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET_GETCHARPROPERTY_FN | fn )

Set the handler for the GetCharProperty function (see GWEN_WIDGET_GETCHARPROPERTY_FN, GWEN_Widget_GetCharProperty and GWEN_Dialog_GetCharProperty).

References GWENHYWFAR_API.

## GWEN_Widget_SetGetIntPropertyFn()

GWENHYWFAR_API GWEN_WIDGET_GETINTPROPERTY_FN GWEN_Widget_SetGetIntPropertyFn | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET_GETINTPROPERTY_FN | fn )

Set the handler for the GetIntProperty function (see GWEN_WIDGET_GETINTPROPERTY_FN, GWEN_Widget_GetIntProperty and GWEN_Dialog_GetIntProperty).

References GWENHYWFAR_API.

## GWEN_Widget_SetGroupId()

GWENHYWFAR_API void GWEN_Widget_SetGroupId | ( | GWEN_WIDGET * | w,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_Widget_SetHeight()

GWENHYWFAR_API void GWEN_Widget_SetHeight | ( | GWEN_WIDGET * | w,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_Widget_SetIconFileName()

GWENHYWFAR_API void GWEN_Widget_SetIconFileName | ( | GWEN_WIDGET * | w,
|  | const char * | s )

References GWENHYWFAR_API.

## GWEN_Widget_SetImageFileName()

GWENHYWFAR_API void GWEN_Widget_SetImageFileName | ( | GWEN_WIDGET * | w,
|  | const char * | s )

References GWENHYWFAR_API.

## GWEN_Widget_SetImplData()

GWENHYWFAR_API void GWEN_Widget_SetImplData | ( | GWEN_WIDGET * | w,
|  | int | index,
|  | void * | ptr )

Store a pointer with the widget.

A widget can store up to 4 pointers. It is up to the actual dialog framework implementation to decide what the pointers really point to. Gwenhywfar will never access this pointer, but the implementation might want to store pointers to the generated GUI objects.

The GTK2 implementation for example stores at index 0 a pointer to the actually created GUI object (e.g. the result of gtk_label_new() for labels).

For container widgets (like groupbox etc) the GTK2 stores a pointer to the content widget at index 1. But as written above: It is completely up to the implementation.

Parameters

  w | pointer to the widget with which the pointer is to be stored
  index | position of the pointer (there can be up to 4 pointers with index ranging from 0 to 3)
  ptr | void* pointer to be stored. Please note that the implementation still remains the owern of the pointer since the type is void* Gwenhywfar wouldn't know how to free it anyway. However, most graphical toolkits (like GTK, QT) take over created widget objects so with those toolkits you normally don't have to care about freeing the pointers stored here.

Example from the GTK2 implementation:

#define GTK2_DIALOG_WIDGET_REAL 0
#define GTK2_DIALOG_WIDGET_CONTENT 1
GtkWidget *g;
g=gtk_label_new("Label");
GWEN_Widget_SetImplData(w, GTK2_DIALOG_WIDGET_REAL, (void*) g);
GWEN_Widget_SetImplData(w, GTK2_DIALOG_WIDGET_CONTENT, (void*) g);
GWEN_Widget_SetImplData
GWENHYWFAR_API void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
Store a pointer with the widget.

References GWENHYWFAR_API.

## GWEN_Widget_SetIntProperty()

GWENHYWFAR_API int GWEN_Widget_SetIntProperty | ( | GWEN_WIDGET * | w,
|  | GWEN_DIALOG_PROPERTY | prop,
|  | int | index,
|  | int | value,
|  | int | doSignal )

References GWENHYWFAR_API.

## GWEN_Widget_SetName()

GWENHYWFAR_API void GWEN_Widget_SetName | ( | GWEN_WIDGET * | w,
|  | const char * | s )

References GWENHYWFAR_API.

## GWEN_Widget_SetRows()

GWENHYWFAR_API void GWEN_Widget_SetRows | ( | GWEN_WIDGET * | w,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_Widget_SetSetCharPropertyFn()

GWENHYWFAR_API GWEN_WIDGET_SETCHARPROPERTY_FN GWEN_Widget_SetSetCharPropertyFn | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET_SETCHARPROPERTY_FN | fn )

Set the handler for the SetCharProperty function (see GWEN_WIDGET_SETCHARPROPERTY_FN, GWEN_Widget_SetCharProperty and GWEN_Dialog_SetCharProperty).

References GWENHYWFAR_API.

## GWEN_Widget_SetSetIntPropertyFn()

GWENHYWFAR_API GWEN_WIDGET_SETINTPROPERTY_FN GWEN_Widget_SetSetIntPropertyFn | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET_SETINTPROPERTY_FN | fn )

Set the handler for the SetIntProperty function (see GWEN_WIDGET_SETINTPROPERTY_FN, GWEN_Widget_SetIntProperty and GWEN_Dialog_SetIntProperty).

References GWENHYWFAR_API.

## GWEN_Widget_SetText()

GWENHYWFAR_API void GWEN_Widget_SetText | ( | GWEN_WIDGET * | w,
|  | int | idx,
|  | const char * | s )

References GWENHYWFAR_API.

## GWEN_Widget_SetType()

GWENHYWFAR_API void GWEN_Widget_SetType | ( | GWEN_WIDGET * | w,
|  | GWEN_WIDGET_TYPE | t )

References GWENHYWFAR_API.

## GWEN_Widget_SetWidth()

GWENHYWFAR_API void GWEN_Widget_SetWidth | ( | GWEN_WIDGET * | w,
|  | int | i )

References GWENHYWFAR_API.

## GWEN_Widget_SubFlags()

GWENHYWFAR_API void GWEN_Widget_SubFlags | ( | GWEN_WIDGET * | w,
|  | uint32_t | fl )

References GWENHYWFAR_API.

## GWEN_Widget_Type_fromString()

GWENHYWFAR_API GWEN_WIDGET_TYPE GWEN_Widget_Type_fromString | ( | const char * | s | ) |

References GWENHYWFAR_API.

## GWEN_Widget_Type_toString()

GWENHYWFAR_API const char * GWEN_Widget_Type_toString | ( | GWEN_WIDGET_TYPE | t | ) |

References GWENHYWFAR_API.