-void DrawVideoDisplay(unsigned long, unsigned long);
-void DrawCompleteVideoDisplay(void);
-void DrawSoundDisplay(unsigned long);
-void DrawGameButton(unsigned long);
-void DrawYesNoButton(unsigned long, int);
-void DrawConfirmButton(unsigned long, int);
-void DrawPlayerButton(unsigned long, int);
-void DrawEditButton(unsigned long state);
-void DrawCtrlButton(unsigned long state);
-void DrawElemButton(int, int);
-void DrawCountButton(int, int);
-int CheckVideoButtons(int, int, int);
-int CheckSoundButtons(int, int, int);
-int CheckGameButtons(int, int, int);
-int CheckYesNoButtons(int, int, int);
-int CheckConfirmButton(int, int, int);
-int CheckPlayerButtons(int, int, int);
-int CheckEditButtons(int, int, int);
-int CheckCtrlButtons(int, int, int);
-int CheckElemButtons(int, int, int);
-int CheckCountButtons(int, int, int);
+struct GadgetDrawingArea
+{
+ int area_xsize, area_ysize; /* size of drawing area (in items) */
+ int item_xsize, item_ysize; /* size of each item in drawing area */
+};
+
+struct GadgetTextInput
+{
+ char value[MAX_GADGET_TEXTSIZE]; /* text string in input field */
+ int number_value; /* integer value, if numeric */
+ int number_min; /* minimal allowed numeric value */
+ int number_max; /* maximal allowed numeric value */
+ int size; /* maximal size of input text */
+ int cursor_position; /* actual cursor position */
+};
+
+struct GadgetScrollbar
+{
+ int items_max; /* number of items to access */
+ int items_visible; /* number of visible items */
+ int item_position; /* actual item position */
+ int size_max; /* this is either width or height */
+ int size; /* scrollbar size on screen */
+ int position; /* scrollbar position on screen */
+ int position_max; /* bottom/right scrollbar position */
+ int drag_position; /* drag position on scrollbar */
+};
+
+struct GadgetInfo
+{
+ int id; /* internal gadget identifier */
+ int custom_id; /* custom gadget identifier */
+ char info_text[MAX_INFO_TEXTSIZE]; /* short popup info text */
+ int x, y; /* gadget position */
+ int width, height; /* gadget size */
+ unsigned long type; /* type (button, text input, ...) */
+ unsigned long state; /* state (pressed, released, ...) */
+ boolean checked; /* check/radio button state */
+ int radio_nr; /* number of radio button series */
+ boolean mapped; /* gadget is active */
+ struct GadgetDesign design[2]; /* 0: normal; 1: pressed */
+ struct GadgetDesign alt_design[2]; /* alternative design */
+ struct GadgetDecoration deco; /* decoration on top of gadget */
+ int design_border; /* border size of gadget decoration */
+ unsigned long event_mask; /* possible events for this gadget */
+ struct GadgetEvent event; /* actual gadget event */
+ gadget_function callback_info; /* function for pop-up info text */
+ gadget_function callback_action; /* function for gadget action */
+ struct GadgetDrawingArea drawing; /* fields for drawing area gadget */
+ struct GadgetTextInput text; /* fields for text input gadget */
+ struct GadgetScrollbar scrollbar; /* fields for scrollbar gadget */
+ struct GadgetInfo *next; /* next list entry */
+};
+
+struct GadgetInfo *CreateGadget(int, ...);
+void FreeGadget(struct GadgetInfo *);
+
+void ModifyGadget(struct GadgetInfo *, int, ...);
+void RedrawGadget(struct GadgetInfo *);
+
+void MapGadget(struct GadgetInfo *);
+void UnmapGadget(struct GadgetInfo *);
+void UnmapAllGadgets();
+void RemapAllGadgets();
+
+boolean anyTextGadgetActive();
+void ClickOnGadget(struct GadgetInfo *, int);
+
+void HandleGadgets(int, int, int);
+void HandleGadgetsKeyInput(KeySym);