]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Remove the final gtk headers in headers
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 30 Jul 2017 05:12:53 +0000 (15:12 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 31 Jul 2017 12:35:48 +0000 (22:35 +1000)
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.h
contrib/brushexport/support.h
contrib/camera/camera.h
contrib/gtkgensurf/gensurf.h
contrib/hydratoolz/plugin.h
contrib/ufoaiplug/ufoai_gtk.h
libs/uilib/uilib.h

index 4eecfd92d5b210538188b3e91190826babe90f39..6cf91a0be9947d868d0ab628105e0fa95f2a38e8 100644 (file)
@@ -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";
 }
index 183d163ac4c5d8eb0c3088539e0dc53581d10fde..41e4d410622904bed2625cdfaeb4b645cff2793d 100644 (file)
@@ -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 );
index fe37430979955d93aec91b99be62599af561e406..a8490459fac9e7922c7386a48a2a3186bac84c0e 100644 (file)
@@ -20,7 +20,6 @@
 #if !defined( INCLUDED_DIALOGS_GTK_H )
 #define INCLUDED_DIALOGS_GTK_H
 
-#include <gtk/gtk.h>
 #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 );
index 8a64631dc9d6fd2ef995c91edec3b63310987f4c..a5bd9655c8ba18947d45e993a3c4bf4a992ff3bb 100644 (file)
@@ -6,7 +6,6 @@
 #  include <config.h>
 #endif
 
-#include <gtk/gtk.h>
 #include <uilib/uilib.h>
 
 /*
index 896ca1be704687b94a6aee7453471df4ef530927..8f2091c555b464a005f0326eaf58a572e914e98c 100644 (file)
@@ -48,7 +48,6 @@ extern _QERQglTable __QGLTABLENAME;
 #include "bytebool.h"
 
 class CCamera;
-#include <gtk/gtk.h>
 
 #include "str.h"
 
index 521e4ab46d58f196a2a68c415b98a35f95114a8d..cb4a2d55bbda84b8d4931ca91651e84759a347e7 100644 (file)
@@ -48,8 +48,6 @@ extern _QERBrushTable __BRUSHTABLENAME;
 #include "igl.h"
 #include "ientity.h"
 
-#include <gtk/gtk.h>
-
 #include "iui_gtk.h"
 
 #include "gendlgs.h"
index 7e9e97712d59a78ce507185e71a3aa66dcb93858..40d8a4f558774b7af0849fc8013891d79a31e0a4 100644 (file)
@@ -35,7 +35,6 @@
 #define USE_ENTITYTABLE_DEFINE
 #include "ientity.h"
 
-#include <gtk/gtk.h>
 #include <stdio.h>
 #include <stdlib.h>
 
index 0254f7d6de5dc14407e325a279f0ad6864457ec7..939c1f6f56cc8a1650ad25eba929a014d3b6ac7d 100644 (file)
@@ -20,7 +20,6 @@
 #define INCLUDED_UFOAI_GTK_H
 
 #include "itoolbar.h"
-#include <gtk/gtk.h>
 
 const IToolbarButton* GetToolbarButton( std::size_t index );
 const IToolbarButton* GetToolbarNoButton( std::size_t index );
index 511a40c31e731cdd20a4a00df9de6ae0f7ac7044..c64835154b818bb21d5a04e2a3775c33ce3a9bf4 100644 (file)
@@ -208,6 +208,7 @@ namespace ui {
         using native = T *; \
         explicit name(native h) : super(reinterpret_cast<super::native>(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; } \