]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkScrolledWindow
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 03:14:34 +0000 (14:14 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 03:14:34 +0000 (14:14 +1100)
contrib/brushexport/interface.cpp
contrib/camera/dialogs.cpp
libs/gtkutil/window.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/console.cpp
radiant/entityinspector.cpp
radiant/feedback.cpp
radiant/gtkdlgs.cpp
radiant/preferences.cpp
radiant/texwindow.cpp

index 4cd532c098675da995d8d1732f628cc890901b4d..28254c79ef494ac2d4ac326e4d9e42613dd96d6f 100644 (file)
@@ -116,7 +116,7 @@ create_w_plugplug2( void ){
        gtk_widget_show( label1 );
        gtk_box_pack_start( GTK_BOX( vbox2 ), label1, FALSE, FALSE, 0 );
 
-       scrolledwindow1 = gtk_scrolled_window_new( NULL, NULL );
+       scrolledwindow1 = ui::ScrolledWindow();
        gtk_widget_set_name( scrolledwindow1, "scrolledwindow1" );
        gtk_widget_show( scrolledwindow1 );
        gtk_box_pack_start( GTK_BOX( vbox2 ), scrolledwindow1, TRUE, TRUE, 0 );
index 6831c3af74b885a862dcff44c6d84bd1e2920794..0e6a1a682e410b2ee14fd42788af74c7f4314197 100644 (file)
@@ -1252,7 +1252,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_scrolled_window_new( NULL, NULL );
+       w = ui::ScrolledWindow();
        gtk_widget_set_usize( w, 0, 150 );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( w ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
index 48b174b37a6c24baf7b9e17f313cb6987d248aca..ce40028746c542e529b929dccee914182b1bb16f 100644 (file)
@@ -22,6 +22,7 @@
 #include "window.h"
 
 #include <gtk/gtkscrolledwindow.h>
+#include <uilib/uilib.h>
 
 #include "pointer.h"
 #include "accelerator.h"
@@ -137,7 +138,7 @@ void window_remove_minmax( GtkWindow* window ){
 
 
 GtkScrolledWindow* create_scrolled_window( GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, int border ){
-       GtkScrolledWindow* scr = GTK_SCROLLED_WINDOW( gtk_scrolled_window_new( 0, 0 ) );
+       GtkScrolledWindow* scr = ui::ScrolledWindow();
        gtk_widget_show( GTK_WIDGET( scr ) );
        gtk_scrolled_window_set_policy( scr, hscrollbar_policy, vscrollbar_policy );
        gtk_scrolled_window_set_shadow_type( scr, GTK_SHADOW_IN );
index f6b4d22254247d09900bab88e97c4390b7dd415a..54b4a3a35c46612914b6a0313c2ce6b7dfa82d6c 100644 (file)
@@ -94,6 +94,9 @@ namespace ui {
     CheckButton::CheckButton(const char *label) : CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_label(label)))
     { }
 
+    ScrolledWindow::ScrolledWindow() : ScrolledWindow(GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(nullptr, nullptr)))
+    { }
+
     Label::Label(const char *label) : Label(GTK_LABEL(gtk_label_new(label)))
     { }
 
index c201b4addbf163a9ce6952ea705b6d4d879f095d..4d9d252a2b907139b9b8ffd8e3218ae14e520235 100644 (file)
@@ -10,6 +10,7 @@ using ui_evkey = struct _GdkEventKey;
 using ui_label = struct _GtkLabel;
 using ui_menuitem = struct _GtkMenuItem;
 using ui_modal = struct ModalDialog;
+using ui_scrolledwindow = struct _GtkScrolledWindow;
 using ui_treemodel = struct _GtkTreeModel;
 using ui_treeview = struct _GtkTreeView;
 using ui_typeinst = struct _GTypeInstance;
@@ -95,7 +96,7 @@ namespace ui {
 #define WRAP(name, impl, methods) \
     class name : public Widget, public Convertible<name, impl> { \
         public: \
-            explicit name(impl *h = nullptr) : Widget(reinterpret_cast<ui_widget *>(h)) {} \
+            explicit name(impl *h) : Widget(reinterpret_cast<ui_widget *>(h)) {} \
         methods \
     }; \
     static_assert(sizeof(name) == sizeof(Widget), "object slicing")
@@ -118,6 +119,10 @@ namespace ui {
 
     WRAP(MenuItem, ui_menuitem,);
 
+    WRAP(ScrolledWindow, ui_scrolledwindow,
+         ScrolledWindow();
+    );
+
     WRAP(SpinButton, ui_widget,);
 
     WRAP(TreeModel, ui_treemodel,);
@@ -131,6 +136,8 @@ namespace ui {
     );
 
     WRAP(Window, ui_window,
+         Window() : Window(nullptr) {};
+
          Window create_dialog_window(const char *title, void func(), void *data, int default_w = -1,
                                      int default_h = -1);
 
index c075152f57fc89c9930b8b49af892ae5dc2e4ee5..bbf99fc899f3b78df10e0f6216aa5d4ce8e95855 100644 (file)
@@ -110,7 +110,7 @@ gboolean destroy_set_null( ui::Window widget, ui::Widget* p ){
 WidgetFocusPrinter g_consoleWidgetFocusPrinter( "console" );
 
 ui::Widget Console_constructWindow( ui::Window toplevel ){
-       ui::Widget scr = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+       ui::Widget scr = ui::ScrolledWindow();
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
        gtk_widget_show( scr );
index 8fa0a439138d1822e9abac66dd1f85113bb333e0..f1b9b4346249e8d9c386a2f9cf1a154314fb1b72 100644 (file)
@@ -1326,7 +1326,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                        {
                                // class list
-                               ui::Widget scr = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+                               ui::Widget scr = ui::ScrolledWindow();
                                gtk_widget_show( scr );
                                gtk_paned_add1( GTK_PANED( split2 ), scr );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
@@ -1363,7 +1363,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                        }
 
                        {
-                               ui::Widget scr = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+                               ui::Widget scr = ui::ScrolledWindow();
                                gtk_widget_show( scr );
                                gtk_paned_add2( GTK_PANED( split2 ), scr );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
@@ -1410,7 +1410,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                                {
                                        // key/value list
-                                       ui::Widget scr = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+                                       ui::Widget scr = ui::ScrolledWindow();
                                        gtk_widget_show( scr );
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), scr, TRUE, TRUE, 0 );
                                        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
@@ -1520,7 +1520,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                        }
 
                        {
-                               ui::Widget scr = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+                               ui::Widget scr = ui::ScrolledWindow();
                                gtk_widget_show( scr );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
 
index e823341b149e20737043436568ee67eff99d0e6c..a6e6cd658675d0a48745718706a97a7bd04a21f3 100644 (file)
@@ -298,7 +298,7 @@ void CDbgDlg::Push( ISAXHandler *pHandler ){
 ui::Window CDbgDlg::BuildDialog(){
        ui::Window window = MainFrame_getWindow().create_floating_window("Q3Map debug window" );
 
-       ui::Widget scr = ui::Widget(gtk_scrolled_window_new( NULL, NULL ));
+       ui::Widget scr = ui::ScrolledWindow();
        gtk_widget_show( scr );
        gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( scr ) );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
index e51934392f2c113cf275ef05bd9460e104d21597..c1682e5e7f1c1306b81c182fd4d0d50d0d8792c3 100644 (file)
@@ -760,7 +760,7 @@ static void CreateGtkTextEditor(){
        gtk_container_add( GTK_CONTAINER( dlg ), GTK_WIDGET( vbox ) );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
-       scr = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+       scr = ui::ScrolledWindow();
        gtk_widget_show( scr );
        gtk_box_pack_start( GTK_BOX( vbox ), scr, TRUE, TRUE, 0 );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
index 1c02b1408ed9a1368db0dbf579d5ecfed4dd7728..5a3298a6eca2aadaebd3ee05d5d740d3b9199c41 100644 (file)
@@ -734,7 +734,7 @@ ui::Window PrefsDlg::BuildDialog(){
                        gtk_widget_show( hbox );
 
                        {
-                               ui::Widget sc_win = ui::Widget(gtk_scrolled_window_new( 0, 0 ));
+                               ui::Widget sc_win = ui::ScrolledWindow();
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_win ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
                                gtk_box_pack_start( GTK_BOX( hbox ), sc_win, FALSE, FALSE, 0 );
                                gtk_widget_show( sc_win );
index 65587fd49ce415c8e73b0f580c1e58c2db1f4837..fc3ab0b2a94edec0378c08a83c010870394991c1 100644 (file)
@@ -1973,7 +1973,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                gtk_widget_show( menu_bar );
        }
        { // Texture TreeView
-               g_TextureBrowser.m_scr_win_tree = ui::Widget(gtk_scrolled_window_new( NULL, NULL ));
+               g_TextureBrowser.m_scr_win_tree = ui::ScrolledWindow();
                gtk_container_set_border_width( GTK_CONTAINER( g_TextureBrowser.m_scr_win_tree ), 0 );
 
                // vertical only scrolling for treeview
@@ -2033,7 +2033,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tags_item );
                }
                { // Tag TreeView
-                       g_TextureBrowser.m_scr_win_tags = ui::Widget(gtk_scrolled_window_new( NULL, NULL ));
+                       g_TextureBrowser.m_scr_win_tags = ui::ScrolledWindow();
                        gtk_container_set_border_width( GTK_CONTAINER( g_TextureBrowser.m_scr_win_tags ), 0 );
 
                        // vertical only scrolling for treeview
@@ -2069,7 +2069,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        gtk_container_add( GTK_CONTAINER( g_TextureBrowser.m_tag_frame ), frame_table );
                }
                { // assigned tag list
-                       ui::Widget scrolled_win = ui::Widget(gtk_scrolled_window_new( NULL, NULL ));
+                       ui::Widget scrolled_win = ui::ScrolledWindow();
                        gtk_container_set_border_width( GTK_CONTAINER( scrolled_win ), 0 );
                        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
 
@@ -2098,7 +2098,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
                }
                { // available tag list
-                       ui::Widget scrolled_win = ui::Widget(gtk_scrolled_window_new( NULL, NULL ));
+                       ui::Widget scrolled_win = ui::ScrolledWindow();
                        gtk_container_set_border_width( GTK_CONTAINER( scrolled_win ), 0 );
                        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );