psppire-window: Fix use-after-free error in read_spv_file().
[pspp] / src / ui / gui / psppire-buttonbox.h
index d4b53787b34e79489e3fc7b3f682af0b11ca489b..3cc25e945013f236cf23877648d7aa4114a7951d 100644 (file)
@@ -15,8 +15,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 
-#ifndef __PSPPIRE_BUTTONBOX_H__
-#define __PSPPIRE_BUTTONBOX_H__
+#ifndef __PSPPIRE_BUTTON_BOX_H__
+#define __PSPPIRE_BUTTON_BOX_H__
 
 
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-#define PSPPIRE_BUTTONBOX_TYPE            (psppire_buttonbox_get_type ())
-#define PSPPIRE_BUTTONBOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_BUTTONBOX_TYPE, PsppireButtonbox))
-#define PSPPIRE_BUTTONBOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_BUTTONBOX_TYPE, PsppireButtonboxClass))
-#define PSPPIRE_IS_BUTTONBOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_BUTTONBOX_TYPE))
-#define PSPPIRE_IS_BUTTONBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_BUTTONBOX_TYPE))
+#define PSPPIRE_BUTTON_BOX_TYPE            (psppire_button_box_get_type ())
+#define PSPPIRE_BUTTON_BOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_BUTTON_BOX_TYPE, PsppireButtonBox))
+#define PSPPIRE_BUTTON_BOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_BUTTON_BOX_TYPE, PsppireButtonBoxClass))
+#define PSPPIRE_IS_BUTTON_BOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_BUTTON_BOX_TYPE))
+#define PSPPIRE_IS_BUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_BUTTON_BOX_TYPE))
 
 
-typedef struct _PsppireButtonbox       PsppireButtonbox;
-typedef struct _PsppireButtonboxClass  PsppireButtonboxClass;
+typedef struct _PsppireButtonBox       PsppireButtonBox;
+typedef struct _PsppireButtonBoxClass  PsppireButtonBoxClass;
 
 
 enum
@@ -46,30 +46,42 @@ enum
     PSPPIRE_BUTTON_HELP,
     PSPPIRE_BUTTON_RESET,
     PSPPIRE_BUTTON_PASTE,
-    n_PsppireButtonboxButtons
+    n_PsppireButtonBoxButtons
   };
 
-
-struct _PsppireButtonbox
+typedef enum
+  {
+    PSPPIRE_BUTTON_OK_MASK     = (1 << PSPPIRE_BUTTON_OK),
+    PSPPIRE_BUTTON_GOTO_MASK   = (1 << PSPPIRE_BUTTON_GOTO),
+    PSPPIRE_BUTTON_CONTINUE_MASK = (1 << PSPPIRE_BUTTON_CONTINUE),
+    PSPPIRE_BUTTON_CANCEL_MASK = (1 << PSPPIRE_BUTTON_CANCEL),
+    PSPPIRE_BUTTON_CLOSE_MASK  = (1 << PSPPIRE_BUTTON_CLOSE),
+    PSPPIRE_BUTTON_HELP_MASK   = (1 << PSPPIRE_BUTTON_HELP),
+    PSPPIRE_BUTTON_RESET_MASK  = (1 << PSPPIRE_BUTTON_RESET),
+    PSPPIRE_BUTTON_PASTE_MASK  = (1 << PSPPIRE_BUTTON_PASTE)
+  } PsppireButtonMask;
+
+struct _PsppireButtonBox
 {
   GtkButtonBox parent;
 
   /* <private> */
-  GtkWidget *button[n_PsppireButtonboxButtons];
+  GtkWidget *button[n_PsppireButtonBoxButtons];
   guint def;
 };
 
-struct _PsppireButtonboxClass
+struct _PsppireButtonBoxClass
 {
   GtkButtonBoxClass parent_class;
 };
 
-GType          psppire_buttonbox_get_type        (void);
+GType          psppire_button_box_get_type        (void);
+GtkWidget*     psppire_button_box_new (void);
 
 
 #define PSPPIRE_TYPE_BUTTON_MASK psppire_button_flags_get_type()
 
 G_END_DECLS
 
-#endif /* __PSPPIRE_BUTTONBOX_H__ */
+#endif /* __PSPPIRE_BUTTON_BOX_H__ */