]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkPaned
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 06:16:02 +0000 (17:16 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 06:16:02 +0000 (17:16 +1100)
libs/gtkutil/paned.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/entityinspector.cpp
radiant/mainframe.cpp

index c5adc09cd7ce71b1e28932d1790fb007af0bf740..ec83344d3605fe33d63d4bf854f3a91a60128408 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <gtk/gtkhpaned.h>
 #include <gtk/gtkvpaned.h>
+#include <uilib/uilib.h>
 
 #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 ) );
 
index bfcca620b690fa3763962864a661a30acf1c3dde..7b3fd6e5df7627f3bfac0f9960a8e0872091059d 100644 (file)
@@ -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)))
     { }
 
index 5a6e1a58657a4bf1762a479496b68e2a7fa8498d..24d3145025107fbaf91605a87902eca34d0977e3 100644 (file)
@@ -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();
     );
index 8b1944977ab4b2da8ecceb2d6648a5f5b348a2df..d5c833626bc7cc02efb9a2ffe55451fffed50f91 100644 (file)
@@ -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 );
 
index 7f05f9cad0411ad51a6b8fcf1e3e3e2114249b70..6b39e0f79af3f8821dfefbbb6ac74bafcabfdb2f 100644 (file)
@@ -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;