added optional button to restart game (door, panel and touch variants)
[rocksndiamonds.git] / src / libgame / gadgets.h
index 9f2d6e2408aa36cb5e0d204ac98bd24a30b01454..6a27f988f7c8f6b3101708ba0abdaf21d5a2475f 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // gadgets.h
 // ============================================================================
 #define GD_TYPE_NORMAL_BUTTON          (1 << 0)
 #define GD_TYPE_TEXT_BUTTON            (1 << 1)
 #define GD_TYPE_CHECK_BUTTON           (1 << 2)
-#define GD_TYPE_RADIO_BUTTON           (1 << 3)
-#define GD_TYPE_DRAWING_AREA           (1 << 4)
-#define GD_TYPE_TEXT_INPUT_ALPHANUMERIC        (1 << 5)
-#define GD_TYPE_TEXT_INPUT_NUMERIC     (1 << 6)
-#define GD_TYPE_TEXT_AREA              (1 << 7)
-#define GD_TYPE_SELECTBOX              (1 << 8)
-#define GD_TYPE_SCROLLBAR_VERTICAL     (1 << 9)
-#define GD_TYPE_SCROLLBAR_HORIZONTAL   (1 << 10)
+#define GD_TYPE_CHECK_BUTTON_2         (1 << 3)
+#define GD_TYPE_RADIO_BUTTON           (1 << 4)
+#define GD_TYPE_DRAWING_AREA           (1 << 5)
+#define GD_TYPE_TEXT_INPUT_ALPHANUMERIC        (1 << 6)
+#define GD_TYPE_TEXT_INPUT_NUMERIC     (1 << 7)
+#define GD_TYPE_TEXT_AREA              (1 << 8)
+#define GD_TYPE_SELECTBOX              (1 << 9)
+#define GD_TYPE_SCROLLBAR_VERTICAL     (1 << 10)
+#define GD_TYPE_SCROLLBAR_HORIZONTAL   (1 << 11)
 
 #define GD_TYPE_BUTTON                 (GD_TYPE_NORMAL_BUTTON | \
                                         GD_TYPE_TEXT_BUTTON | \
                                         GD_TYPE_CHECK_BUTTON | \
+                                        GD_TYPE_CHECK_BUTTON_2 | \
                                         GD_TYPE_RADIO_BUTTON)
 #define GD_TYPE_SCROLLBAR              (GD_TYPE_SCROLLBAR_VERTICAL | \
                                         GD_TYPE_SCROLLBAR_HORIZONTAL)
@@ -186,6 +188,15 @@ struct GadgetTextArea
   int cursor_x_preferred;              // "preferred" x cursor position
   int size;                            // maximal size of input text
   int xsize, ysize;                    // size of text area (in chars)
+
+  // automatically determined values
+  boolean cropped;                     // text area cropped to fit viewport
+  int full_x, full_y;                  // text area position when not cropped
+  int crop_width, crop_height;         // size of text area when cropped
+  int crop_xsize, crop_ysize;          // size of text area when cropped
+
+  // runtime values
+  boolean full_open;                   // opening state of text area
 };
 
 struct GadgetSelectbox
@@ -274,6 +285,7 @@ struct GadgetInfo
 
 void InitGadgetsSoundCallback(void (*activating_function)(void),
                              void (*selecting_function)(void));
+void InitGadgetScreenBorders(int, int);
 
 struct GadgetInfo *CreateGadget(int, ...);
 void FreeGadget(struct GadgetInfo *);