From: TimePath Date: Sat, 22 Jul 2017 04:40:59 +0000 (+1000) Subject: Remove implicit Window constructor X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8505e24b7f9831e0c01860ed50b835aae4e856a2;p=xonotic%2Fnetradiant.git Remove implicit Window constructor --- diff --git a/contrib/brushexport/plugin.cpp b/contrib/brushexport/plugin.cpp index 8e498987..a2d0d621 100644 --- a/contrib/brushexport/plugin.cpp +++ b/contrib/brushexport/plugin.cpp @@ -49,7 +49,7 @@ bool IsWindowOpen( void ); namespace BrushExport { -ui::Window g_mainwnd; +ui::Window g_mainwnd{ui::null}; const char* init( void* hApp, void* pMainWidget ){ g_mainwnd = ui::Window(GTK_WINDOW(pMainWidget)); diff --git a/contrib/shaderplug/shaderplug.cpp b/contrib/shaderplug/shaderplug.cpp index ebe2e6c6..e8f4f5fc 100644 --- a/contrib/shaderplug/shaderplug.cpp +++ b/contrib/shaderplug/shaderplug.cpp @@ -57,7 +57,7 @@ ShaderPlugPluginDependencies() : namespace Shaderplug { -ui::Window g_window; +ui::Window g_window{ui::null}; std::vector archives; std::set shaders; diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp index 3ace8f02..974429df 100644 --- a/contrib/sunplug/sunplug.cpp +++ b/contrib/sunplug/sunplug.cpp @@ -184,7 +184,7 @@ SunPlugPluginDependencies() : // ************************* namespace SunPlug { -ui::Window main_window; +ui::Window main_window{ui::null}; char MenuList[100] = ""; const char* init( void* hApp, void* pMainWidget ){ diff --git a/contrib/ufoaiplug/ufoai.cpp b/contrib/ufoaiplug/ufoai.cpp index 9bfb46ec..d654edc7 100644 --- a/contrib/ufoaiplug/ufoai.cpp +++ b/contrib/ufoaiplug/ufoai.cpp @@ -59,7 +59,7 @@ UFOAIPluginDependencies( void ) : namespace UFOAI { - ui::Window g_mainwnd; + ui::Window g_mainwnd{ui::null}; const char* init( void* hApp, void* pMainWidget ){ g_mainwnd = ui::Window(GTK_WINDOW( pMainWidget )); diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index 85ee46df..a6ff998d 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -158,7 +158,7 @@ gboolean dialog_delete_callback( ui::Widget widget, GdkEventAny* event, ModalDia } ui::Window create_simple_modal_dialog_window( const char* title, ModalDialog& dialog, ui::Widget contents ){ - ui::Window window = create_fixedsize_modal_dialog_window(ui::Window(), title, dialog ); + ui::Window window = create_fixedsize_modal_dialog_window(ui::Window{ui::null}, title, dialog ); auto vbox1 = create_dialog_vbox( 8, 4 ); window.add(vbox1); diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index a27d2d84..b064da65 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -29,7 +29,7 @@ namespace ui { } } - Widget root{nullptr}; + Widget root; #define IMPL(T, F) template<> _IMPL(T, F) #define _IMPL(T, F) struct verify { using self = T; static self test(self it) { return self(F(it)); } } @@ -101,9 +101,6 @@ namespace ui { IMPL(Window, GTK_WINDOW); - Window::Window() : Window(nullptr) - {} - Window::Window(window_type type) : Window(GTK_WINDOW(gtk_window_new( type == window_type::TOP ? GTK_WINDOW_TOPLEVEL : type == window_type::POPUP ? GTK_WINDOW_POPUP : diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 4dbdd791..945f762e 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -231,7 +231,6 @@ namespace ui { class AccelGroup; WRAP(Window, Bin, _GtkWindow, (), - Window(); Window(window_type type); , Window create_dialog_window( diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 86a0b139..ae523fa1 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -671,7 +671,7 @@ FreezePointer m_freezePointer; public: ui::Widget m_gl_widget; -ui::Window m_parent; +ui::Window m_parent{ui::null}; SelectionSystemWindowObserver* m_window_observer; XORRectangle m_XORRectangle; diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index a77ddedd..b5d7052c 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -337,7 +337,7 @@ void Dialog::Destroy(){ ASSERT_MESSAGE( m_window, "dialog cannot be destroyed" ); gtk_widget_destroy( GTK_WIDGET( m_window ) ); - m_window = ui::Window(); + m_window = ui::Window{ui::null}; } diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 6559da19..2158f59a 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -147,7 +147,7 @@ void GroupDialog_constructWindow( ui::Window main_window ){ void GroupDialog_destroyWindow(){ ASSERT_TRUE( g_GroupDlg.m_window ); destroy_floating_window( g_GroupDlg.m_window ); - g_GroupDlg.m_window = ui::Window(); + g_GroupDlg.m_window = ui::Window{ui::null}; } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 7b1b80ef..7c9fc3c8 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1607,7 +1607,7 @@ gint window_realize_remove_decoration( ui::Widget widget, gpointer data ){ class WaitDialog { public: -ui::Window m_window; +ui::Window m_window{ui::null}; ui::Label m_label{(GtkLabel *) nullptr}; }; @@ -1710,7 +1710,7 @@ void ScreenUpdates_Enable(){ gtk_grab_remove( GTK_WIDGET( g_wait.m_window ) ); destroy_floating_window( g_wait.m_window ); - g_wait.m_window = ui::Window(); + g_wait.m_window = ui::Window{ui::null}; //gtk_window_present(MainFrame_getWindow()); } @@ -2502,7 +2502,7 @@ MainFrame* g_pParentWnd = 0; ui::Window MainFrame_getWindow() { - return g_pParentWnd ? g_pParentWnd->m_window : ui::Window(); + return g_pParentWnd ? g_pParentWnd->m_window : ui::Window{ui::null}; } std::vector g_floating_windows; @@ -2676,7 +2676,7 @@ ui::Window create_splash(){ return window; } -static ui::Window splash_screen; +static ui::Window splash_screen{ui::null}; void show_splash(){ splash_screen = create_splash(); diff --git a/radiant/select.cpp b/radiant/select.cpp index f88cf1aa..0ac4467d 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -866,7 +866,7 @@ struct RotateDialog GtkSpinButton* x; GtkSpinButton* y; GtkSpinButton* z; - ui::Window window; + ui::Window window{ui::null}; }; static gboolean rotatedlg_apply( ui::Widget widget, RotateDialog* rotateDialog ){ @@ -1017,7 +1017,7 @@ struct ScaleDialog ui::Widget x; ui::Widget y; ui::Widget z; - ui::Window window; + ui::Window window{ui::null}; }; static gboolean scaledlg_apply( ui::Widget widget, ScaleDialog* scaleDialog ){ diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 3cf2939c..08f55508 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -254,7 +254,7 @@ int m_nTotalHeight; CopiedString shader; -ui::Window m_parent; +ui::Window m_parent{ui::null}; ui::Widget m_gl_widget; ui::Widget m_texture_scroll; ui::Widget m_treeViewTree;