From: TimePath Date: Wed, 17 Feb 2016 06:16:02 +0000 (+1100) Subject: Wrap GtkPaned X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=092303259d8f503b2aff7ec77e6146a011fc9d5c;p=xonotic%2Fnetradiant.git Wrap GtkPaned --- diff --git a/libs/gtkutil/paned.cpp b/libs/gtkutil/paned.cpp index c5adc09c..ec83344d 100644 --- a/libs/gtkutil/paned.cpp +++ b/libs/gtkutil/paned.cpp @@ -23,6 +23,7 @@ #include #include +#include #include "frame.h" @@ -62,14 +63,14 @@ PanedState g_vpaned1 = { 0.5f, -1, }; PanedState g_vpaned2 = { 0.5f, -1, }; GtkHPaned* create_split_views( GtkWidget* topleft, GtkWidget* topright, GtkWidget* botleft, GtkWidget* botright ){ - GtkHPaned* hsplit = GTK_HPANED( gtk_hpaned_new() ); + GtkHPaned* hsplit = ui::HPaned(); gtk_widget_show( GTK_WIDGET( hsplit ) ); g_signal_connect( G_OBJECT( hsplit ), "size_allocate", G_CALLBACK( hpaned_allocate ), &g_hpaned ); g_signal_connect( G_OBJECT( hsplit ), "notify::position", G_CALLBACK( paned_position ), &g_hpaned ); { - GtkVPaned* vsplit = GTK_VPANED( gtk_vpaned_new() ); + GtkVPaned* vsplit = ui::VPaned(); gtk_paned_add1( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) ); gtk_widget_show( GTK_WIDGET( vsplit ) ); @@ -80,7 +81,7 @@ GtkHPaned* create_split_views( GtkWidget* topleft, GtkWidget* topright, GtkWidge gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topright ) ) ); } { - GtkVPaned* vsplit = GTK_VPANED( gtk_vpaned_new() ); + GtkVPaned* vsplit = ui::VPaned(); gtk_paned_add2( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) ); gtk_widget_show( GTK_WIDGET( vsplit ) ); diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index bfcca620..7b3fd6e5 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -136,6 +136,12 @@ namespace ui { GTK_MENU_ITEM((mnemonic ? gtk_menu_item_new_with_mnemonic : gtk_menu_item_new_with_label)(label))) { } + HPaned::HPaned() : HPaned(GTK_HPANED(gtk_hpaned_new())) + { } + + VPaned::VPaned() : VPaned(GTK_VPANED(gtk_vpaned_new())) + { } + ScrolledWindow::ScrolledWindow() : ScrolledWindow(GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(nullptr, nullptr))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 5a6e1a58..24d31450 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -16,11 +16,13 @@ using ui_entry = struct _GtkEntry; using ui_evkey = struct _GdkEventKey; using ui_frame = struct _GtkFrame; using ui_hbox = struct _GtkHBox; +using ui_hpaned = struct _GtkHPaned; using ui_label = struct _GtkLabel; using ui_menu = struct _GtkMenu; using ui_menuitem = struct _GtkMenuItem; using ui_modal = struct ModalDialog; using ui_object = struct _GtkObject; +using ui_paned = struct _GtkPaned; using ui_scrolledwindow = struct _GtkScrolledWindow; using ui_spinbutton = struct _GtkSpinButton; using ui_table = struct _GtkTable; @@ -30,6 +32,7 @@ using ui_treeview = struct _GtkTreeView; using ui_treeviewcolumn = struct _GtkTreeViewColumn; using ui_typeinst = struct _GTypeInstance; using ui_vbox = struct _GtkVBox; +using ui_vpaned = struct _GtkVPaned; using ui_widget = struct _GtkWidget; using ui_window = struct _GtkWindow; @@ -185,6 +188,16 @@ namespace ui { MenuItem(const char *label, bool mnemonic = false); ); + WRAP(Paned, Widget, ui_paned,); + + WRAP(HPaned, Paned, ui_hpaned, + HPaned(); + ); + + WRAP(VPaned, Paned, ui_vpaned, + VPaned(); + ); + WRAP(ScrolledWindow, Widget, ui_scrolledwindow, ScrolledWindow(); ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 8b194497..d5c83362 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1313,14 +1313,14 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ g_signal_connect( G_OBJECT( vbox ), "destroy", G_CALLBACK( EntityInspector_destroyWindow ), 0 ); { - ui::Widget split1 = ui::Widget(gtk_vpaned_new()); + ui::Widget split1 = ui::VPaned(); gtk_box_pack_start( GTK_BOX( vbox ), split1, TRUE, TRUE, 0 ); gtk_widget_show( split1 ); g_entity_split1 = split1; { - ui::Widget split2 = ui::Widget(gtk_vpaned_new()); + ui::Widget split2 = ui::VPaned(); gtk_paned_add1( GTK_PANED( split1 ), split2 ); gtk_widget_show( split2 ); @@ -1384,7 +1384,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ } { - ui::Widget split2 = ui::Widget(gtk_vpaned_new()); + ui::Widget split2 = ui::VPaned(); gtk_paned_add2( GTK_PANED( split1 ), split2 ); gtk_widget_show( split2 ); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 7f05f9ca..6b39e0f7 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -2788,7 +2788,7 @@ void MainFrame::Create(){ if ( CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft ) { { - ui::Widget vsplit = ui::Widget(gtk_vpaned_new()); + ui::Widget vsplit = ui::VPaned(); m_vSplit = vsplit; gtk_box_pack_start( GTK_BOX( vbox ), vsplit, TRUE, TRUE, 0 ); gtk_widget_show( vsplit ); @@ -2798,7 +2798,7 @@ void MainFrame::Create(){ gtk_paned_pack2( GTK_PANED( vsplit ), console_window, FALSE, TRUE ); { - ui::Widget hsplit = ui::Widget(gtk_hpaned_new()); + ui::Widget hsplit = ui::HPaned(); gtk_widget_show( hsplit ); m_hSplit = hsplit; gtk_paned_add1( GTK_PANED( vsplit ), hsplit ); @@ -2809,7 +2809,7 @@ void MainFrame::Create(){ ui::Widget xy_window = ui::Widget(GTK_WIDGET( create_framed_widget( m_pXYWnd->GetWidget() ) )); { - ui::Widget vsplit2 = ui::Widget(gtk_vpaned_new()); + ui::Widget vsplit2 = ui::VPaned(); gtk_widget_show( vsplit2 ); m_vSplit2 = vsplit2;