From 34e7980b3d67014bb32b4f67ce94c08cb5dd25e7 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 30 Jul 2017 15:12:53 +1000 Subject: [PATCH] Remove the final gtk headers in headers --- contrib/bobtoolz/bobToolz-GTK.cpp | 4 ++-- contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 14 ++++++-------- contrib/bobtoolz/dialogs/dialogs-gtk.h | 5 ++--- contrib/brushexport/support.h | 1 - contrib/camera/camera.h | 1 - contrib/gtkgensurf/gensurf.h | 2 -- contrib/hydratoolz/plugin.h | 1 - contrib/ufoaiplug/ufoai_gtk.h | 1 - libs/uilib/uilib.h | 1 + 9 files changed, 11 insertions(+), 19 deletions(-) diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp index 4eecfd92..6cf91a0b 100644 --- a/contrib/bobtoolz/bobToolz-GTK.cpp +++ b/contrib/bobtoolz/bobToolz-GTK.cpp @@ -63,7 +63,7 @@ char* PLUGIN_NAME = "bobToolz"; static char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Split patches cols,Split patches rows,Turn edge"; // globals -GtkWidget *g_pRadiantWnd = NULL; +ui::Widget g_pRadiantWnd; static const char *PLUGIN_ABOUT = "bobToolz for SDRadiant\n" "by digibob (digibob@splashdamage.com)\n" @@ -72,7 +72,7 @@ static const char *PLUGIN_ABOUT = "bobToolz for SDRadiant\n" "MarsMattel, RR2DO2\n"; extern "C" const char* QERPlug_Init( void* hApp, void* pMainWidget ) { - g_pRadiantWnd = (GtkWidget*)pMainWidget; + g_pRadiantWnd = ui::Widget::from(pMainWidget); return "bobToolz for GTKradiant"; } diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 183d163a..41e4d410 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -832,9 +832,7 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ GtkWidget *hbox; - GtkWidget *textFrontBackTex, *textTrimTex; GtkWidget *checkScaleMainH, *checkScaleMainV, *checkScaleTrimH, *checkScaleTrimV; - GtkWidget *comboMain, *comboTrim; GtkWidget *radioNS, *radioEW; GSList *radioOrientation; TwinWidget tw1, tw2; @@ -871,7 +869,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - textFrontBackTex = ui::Entry( 512 ); + auto textFrontBackTex = ui::Entry( 512 ); gtk_entry_set_text( GTK_ENTRY( textFrontBackTex ), rs->mainTexture ); gtk_box_pack_start( GTK_BOX( hbox ), textFrontBackTex, FALSE, FALSE, 0 ); gtk_widget_show( textFrontBackTex ); @@ -886,7 +884,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - textTrimTex = ui::Entry( 512 ); + auto textTrimTex = ui::Entry( 512 ); gtk_box_pack_start( GTK_BOX( hbox ), textTrimTex, FALSE, FALSE, 0 ); gtk_widget_show( textTrimTex ); @@ -935,13 +933,13 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ // djbob: lists added - comboMain = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures)); + auto comboMain = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures)))); gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0); gtk_box_pack_start( GTK_BOX( hbox ), comboMain, FALSE, FALSE, 0 ); gtk_widget_show( comboMain ); tw1.one = textFrontBackTex; - tw1.two = GTK_COMBO_BOX(comboMain); + tw1.two = comboMain; auto buttonSetMain = ui::Button( "Set As Main Texture" ); buttonSetMain.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 ); @@ -954,13 +952,13 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - comboTrim = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures)); + auto comboTrim = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures)))); gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0); gtk_box_pack_start( GTK_BOX( hbox ), comboTrim, FALSE, FALSE, 0 ); gtk_widget_show( comboTrim ); tw2.one = textTrimTex; - tw2.two = GTK_COMBO_BOX(comboTrim); + tw2.two = comboTrim; auto buttonSetTrim = ui::Button( "Set As Trim Texture" ); buttonSetTrim.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 ); diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.h b/contrib/bobtoolz/dialogs/dialogs-gtk.h index fe374309..a8490459 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.h +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.h @@ -20,7 +20,6 @@ #if !defined( INCLUDED_DIALOGS_GTK_H ) #define INCLUDED_DIALOGS_GTK_H -#include #include "qerplugin.h" struct BuildStairsRS { @@ -92,8 +91,8 @@ struct MakeChainRS { }; struct TwinWidget { - GtkWidget* one; - GtkComboBox* two; + ui::Widget one{ui::null}; + ui::ComboBox two{ui::null}; }; EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMessageBoxType type ); diff --git a/contrib/brushexport/support.h b/contrib/brushexport/support.h index 8a64631d..a5bd9655 100644 --- a/contrib/brushexport/support.h +++ b/contrib/brushexport/support.h @@ -6,7 +6,6 @@ # include #endif -#include #include /* diff --git a/contrib/camera/camera.h b/contrib/camera/camera.h index 896ca1be..8f2091c5 100644 --- a/contrib/camera/camera.h +++ b/contrib/camera/camera.h @@ -48,7 +48,6 @@ extern _QERQglTable __QGLTABLENAME; #include "bytebool.h" class CCamera; -#include #include "str.h" diff --git a/contrib/gtkgensurf/gensurf.h b/contrib/gtkgensurf/gensurf.h index 521e4ab4..cb4a2d55 100644 --- a/contrib/gtkgensurf/gensurf.h +++ b/contrib/gtkgensurf/gensurf.h @@ -48,8 +48,6 @@ extern _QERBrushTable __BRUSHTABLENAME; #include "igl.h" #include "ientity.h" -#include - #include "iui_gtk.h" #include "gendlgs.h" diff --git a/contrib/hydratoolz/plugin.h b/contrib/hydratoolz/plugin.h index 7e9e9771..40d8a4f5 100644 --- a/contrib/hydratoolz/plugin.h +++ b/contrib/hydratoolz/plugin.h @@ -35,7 +35,6 @@ #define USE_ENTITYTABLE_DEFINE #include "ientity.h" -#include #include #include diff --git a/contrib/ufoaiplug/ufoai_gtk.h b/contrib/ufoaiplug/ufoai_gtk.h index 0254f7d6..939c1f6f 100644 --- a/contrib/ufoaiplug/ufoai_gtk.h +++ b/contrib/ufoaiplug/ufoai_gtk.h @@ -20,7 +20,6 @@ #define INCLUDED_UFOAI_GTK_H #include "itoolbar.h" -#include const IToolbarButton* GetToolbarButton( std::size_t index ); const IToolbarButton* GetToolbarNoButton( std::size_t index ); diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 511a40c3..c6483515 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -208,6 +208,7 @@ namespace ui { using native = T *; \ explicit name(native h) : super(reinterpret_cast(h)) {} \ explicit name(Null n) : name((native) nullptr) {} \ + static name from(void *ptr) { return name((native) ptr); } \ ctors \ }; \ inline bool operator<(name self, name other) { return self._handle < other._handle; } \ -- 2.39.2