rnd-20000718-1-src
[rocksndiamonds.git] / src / buttons.h
index 3740bfc9352a4cc958a6ed9afc020b27047f3ed9..f3d93c89e94584437d936ecd9d9379a20e779273 100644 (file)
@@ -83,15 +83,6 @@ void DrawCompleteVideoDisplay(void);
 
 /* NEW GADGET STUFF -------------------------------------------------------- */
 
-/* some values for gadget graphics (also used by editor.c) */
-#define ED_BUTTON_COUNT_YPOS   60
-#define ED_BUTTON_COUNT_XSIZE  20
-#define ED_BUTTON_COUNT_YSIZE  20
-#define ED_WIN_COUNT_XPOS      (2 + ED_BUTTON_COUNT_XSIZE + 2)
-#define ED_WIN_COUNT_YPOS      ED_BUTTON_COUNT_YPOS
-#define ED_WIN_COUNT_XSIZE     52
-#define ED_WIN_COUNT_YSIZE     ED_BUTTON_COUNT_YSIZE
-
 /* gadget types */
 #define GD_TYPE_NORMAL_BUTTON          (1 << 0)
 #define GD_TYPE_CHECK_BUTTON           (1 << 1)
@@ -130,41 +121,50 @@ void DrawCompleteVideoDisplay(void);
 /* gadget creation tags */
 #define GDI_END                                0
 #define GDI_CUSTOM_ID                  1
-#define GDI_X                          2
-#define GDI_Y                          3
-#define GDI_WIDTH                      4
-#define GDI_HEIGHT                     5
-#define GDI_TYPE                       6
-#define GDI_STATE                      7
-#define GDI_CHECKED                    8
-#define GDI_RADIO_NR                   9
-#define GDI_NUMBER_VALUE               10
-#define GDI_NUMBER_MIN                 11
-#define GDI_NUMBER_MAX                 12
-#define GDI_TEXT_VALUE                 13
-#define GDI_TEXT_SIZE                  14
-#define GDI_DESIGN_UNPRESSED           15
-#define GDI_DESIGN_PRESSED             16
-#define GDI_ALT_DESIGN_UNPRESSED       17
-#define GDI_ALT_DESIGN_PRESSED         18
-#define GDI_DESIGN_BORDER              19
-#define GDI_DECORATION_DESIGN          20
-#define GDI_DECORATION_POSITION                22
-#define GDI_DECORATION_SIZE            21
-#define GDI_DECORATION_SHIFTING                23
-#define GDI_EVENT_MASK                 24
-#define GDI_EVENT                      25
-#define GDI_CALLBACK_INFO              26
-#define GDI_CALLBACK_ACTION            27
-#define GDI_AREA_SIZE                  28
-#define GDI_ITEM_SIZE                  29
-#define GDI_SCROLLBAR_ITEMS_MAX                30
-#define GDI_SCROLLBAR_ITEMS_VISIBLE    31
-#define GDI_SCROLLBAR_ITEM_POSITION    32
-#define GDI_INFO_TEXT                  33
+#define GDI_CUSTOM_TYPE_ID             2
+#define GDI_X                          3
+#define GDI_Y                          4
+#define GDI_WIDTH                      5
+#define GDI_HEIGHT                     6
+#define GDI_TYPE                       7
+#define GDI_STATE                      8
+#define GDI_CHECKED                    9
+#define GDI_RADIO_NR                   10
+#define GDI_NUMBER_VALUE               11
+#define GDI_NUMBER_MIN                 12
+#define GDI_NUMBER_MAX                 13
+#define GDI_TEXT_VALUE                 14
+#define GDI_TEXT_SIZE                  15
+#define GDI_TEXT_FONT                  16
+#define GDI_DESIGN_UNPRESSED           17
+#define GDI_DESIGN_PRESSED             18
+#define GDI_ALT_DESIGN_UNPRESSED       19
+#define GDI_ALT_DESIGN_PRESSED         20
+#define GDI_BORDER_SIZE                        21
+#define GDI_TEXTINPUT_DESIGN_WIDTH     22
+#define GDI_DECORATION_DESIGN          23
+#define GDI_DECORATION_POSITION                24
+#define GDI_DECORATION_SIZE            25
+#define GDI_DECORATION_SHIFTING                26
+#define GDI_EVENT_MASK                 27
+#define GDI_EVENT                      28
+#define GDI_CALLBACK_INFO              29
+#define GDI_CALLBACK_ACTION            30
+#define GDI_AREA_SIZE                  31
+#define GDI_ITEM_SIZE                  32
+#define GDI_SCROLLBAR_ITEMS_MAX                33
+#define GDI_SCROLLBAR_ITEMS_VISIBLE    34
+#define GDI_SCROLLBAR_ITEM_POSITION    35
+#define GDI_INFO_TEXT                  36
 
 typedef void (*gadget_function)(void *);
 
+struct GadgetBorder
+{
+  int size;                            /* size of gadget border */
+  int width;                           /* for text input gadgets */
+};
+
 struct GadgetDesign
 {
   Pixmap pixmap;                       /* Pixmap with gadget surface */
@@ -202,6 +202,7 @@ struct GadgetTextInput
   int number_max;                      /* maximal allowed numeric value */
   int size;                            /* maximal size of input text */
   int cursor_position;                 /* actual cursor position */
+  int font_type;                       /* font to use for text input */
 };
 
 struct GadgetScrollbar
@@ -214,12 +215,14 @@ struct GadgetScrollbar
   int position;                                /* scrollbar position on screen */
   int position_max;                    /* bottom/right scrollbar position */
   int drag_position;                   /* drag position on scrollbar */
+  int correction;                      /* scrollbar position correction */
 };
 
 struct GadgetInfo
 {
   int id;                              /* internal gadget identifier */
   int custom_id;                       /* custom gadget identifier */
+  int custom_type_id;                  /* custom gadget type identifier */
   char info_text[MAX_INFO_TEXTSIZE];   /* short popup info text */
   int x, y;                            /* gadget position */
   int width, height;                   /* gadget size */
@@ -228,10 +231,10 @@ struct GadgetInfo
   boolean checked;                     /* check/radio button state */
   int radio_nr;                                /* number of radio button series */
   boolean mapped;                      /* gadget is active */
+  struct GadgetBorder border;          /* gadget border design */
   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 */