X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=libs%2Fgtkutil%2Fdialog.h;h=79330143679b85a05e49fdfb3574294c3a1a9990;hb=cd6613e5171544b68d4ae70546c90a15c99b22a5;hp=b5a43194897f1a651f42f00e045c787de1324d29;hpb=2c07c3a2aaa0b9b16a8fcd50259ebbf28d9f9dc9;p=xonotic%2Fnetradiant.git diff --git a/libs/gtkutil/dialog.h b/libs/gtkutil/dialog.h index b5a43194..79330143 100644 --- a/libs/gtkutil/dialog.h +++ b/libs/gtkutil/dialog.h @@ -25,20 +25,10 @@ #include "generic/callback.h" #include "generic/arrayrange.h" #include "qerplugin.h" -#include typedef int gint; typedef gint gboolean; typedef struct _GdkEventAny GdkEventAny; -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkHBox GtkHBox; -typedef struct _GtkVBox GtkVBox; -typedef struct _GtkRadioButton GtkRadioButton; -typedef struct _GtkFrame GtkFrame; -typedef struct _GtkEntry GtkEntry; -typedef struct _GtkButton GtkButton; -typedef struct _GtkLabel GtkLabel; -typedef struct _GtkTable GtkTable; struct ModalDialog @@ -61,41 +51,36 @@ struct ModalDialogButton typedef void ( *GCallback )( void ); typedef void* gpointer; -typedef struct _GtkTable GtkTable; -typedef struct _GtkButton GtkButton; -typedef struct _GtkVBox GtkVBox; -typedef struct _GtkHBox GtkHBox; -typedef struct _GtkFrame GtkFrame; ui::Window create_fixedsize_modal_window( ui::Window parent, const char* title, int width, int height ); ui::Window create_dialog_window( ui::Window parent, const char* title, GCallback func, gpointer data, int default_w = -1, int default_h = -1 ); -GtkTable* create_dialog_table( unsigned int rows, unsigned int columns, unsigned int row_spacing, unsigned int col_spacing, int border = 0 ); -GtkButton* create_dialog_button( const char* label, GCallback func, gpointer data ); -GtkVBox* create_dialog_vbox( int spacing, int border = 0 ); -GtkHBox* create_dialog_hbox( int spacing, int border = 0 ); -GtkFrame* create_dialog_frame( const char* label, GtkShadowType shadow = GTK_SHADOW_ETCHED_IN ); +ui::Table create_dialog_table( unsigned int rows, unsigned int columns, unsigned int row_spacing, unsigned int col_spacing, int border = 0 ); +ui::Button create_dialog_button( const char* label, GCallback func, gpointer data ); +ui::VBox create_dialog_vbox( int spacing, int border = 0 ); +ui::HBox create_dialog_hbox( int spacing, int border = 0 ); +ui::Frame create_dialog_frame( const char* label, ui::Shadow shadow = ui::Shadow::ETCHED_IN ); -GtkButton* create_modal_dialog_button( const char* label, ModalDialogButton& button ); +ui::Button create_modal_dialog_button( const char* label, ModalDialogButton& button ); ui::Window create_modal_dialog_window( ui::Window parent, const char* title, ModalDialog& dialog, int default_w = -1, int default_h = -1 ); ui::Window create_fixedsize_modal_dialog_window( ui::Window parent, const char* title, ModalDialog& dialog, int width = -1, int height = -1 ); EMessageBoxReturn modal_dialog_show( ui::Window window, ModalDialog& dialog ); -gboolean dialog_button_ok( GtkWidget *widget, ModalDialog* data ); -gboolean dialog_button_cancel( GtkWidget *widget, ModalDialog* data ); -gboolean dialog_button_yes( GtkWidget *widget, ModalDialog* data ); -gboolean dialog_button_no( GtkWidget *widget, ModalDialog* data ); -gboolean dialog_delete_callback( GtkWidget *widget, GdkEventAny* event, ModalDialog* data ); +gboolean dialog_button_ok( ui::Widget widget, ModalDialog* data ); +gboolean dialog_button_cancel( ui::Widget widget, ModalDialog* data ); +gboolean dialog_button_yes( ui::Widget widget, ModalDialog* data ); +gboolean dialog_button_no( ui::Widget widget, ModalDialog* data ); +gboolean dialog_delete_callback( ui::Widget widget, GdkEventAny* event, ModalDialog* data ); -ui::Window create_simple_modal_dialog_window( const char* title, ModalDialog& dialog, GtkWidget* contents ); +ui::Window create_simple_modal_dialog_window( const char* title, ModalDialog& dialog, ui::Widget contents ); class RadioHBox { public: -GtkHBox* m_hbox; -GtkRadioButton* m_radio; -RadioHBox( GtkHBox* hbox, GtkRadioButton* radio ) : +ui::HBox m_hbox; +ui::RadioButton m_radio; +RadioHBox( ui::HBox hbox, ui::RadioButton radio ) : m_hbox( hbox ), m_radio( radio ){ } @@ -107,10 +92,10 @@ RadioHBox RadioHBox_new( StringArrayRange names ); class PathEntry { public: -GtkFrame* m_frame; -GtkEntry* m_entry; -GtkButton* m_button; -PathEntry( GtkFrame* frame, GtkEntry* entry, GtkButton* button ) : +ui::Frame m_frame; +ui::Entry m_entry; +ui::Button m_button; +PathEntry( ui::Frame frame, ui::Entry entry, ui::Button button ) : m_frame( frame ), m_entry( entry ), m_button( button ){ @@ -122,8 +107,8 @@ PathEntry PathEntry_new(); class BrowsedPathEntry { public: -typedef Callback1 SetPathCallback; -typedef Callback1 BrowseCallback; +typedef Callback SetPathCallback; +typedef Callback BrowseCallback; PathEntry m_entry; BrowseCallback m_browse; @@ -131,10 +116,9 @@ BrowseCallback m_browse; BrowsedPathEntry( const BrowseCallback& browse ); }; -GtkLabel* DialogLabel_new( const char* name ); -GtkTable* DialogRow_new( const char* name, GtkWidget* widget ); -typedef struct _GtkVBox GtkVBox; -void DialogVBox_packRow( GtkVBox* vbox, GtkWidget* row ); +ui::Label DialogLabel_new( const char* name ); +ui::Table DialogRow_new( const char* name, ui::Widget widget ); +void DialogVBox_packRow( ui::Box vbox, ui::Widget row ); #endif