From 9d9a0581e9852350a5cf430e2e70d106f9da9044 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Mon, 27 Feb 2017 03:49:49 +0100 Subject: [PATCH 01/15] Feature: Make Hollow Touch/Overlap --- include/qerplugin.h | 3 +++ radiant/csg.cpp | 15 ++++++++++++--- radiant/mainframe.cpp | 21 +++++++++++++++++++-- radiant/mainframe.h | 2 ++ radiant/pluginmanager.cpp | 1 + radiant/qe3.h | 3 +++ 6 files changed, 40 insertions(+), 5 deletions(-) diff --git a/include/qerplugin.h b/include/qerplugin.h index ce40f3ff..99c802f4 100644 --- a/include/qerplugin.h +++ b/include/qerplugin.h @@ -445,6 +445,7 @@ typedef void ( *PFN_QERAPP_POINTFILECLEAR )(); typedef void ( *PFN_QERAPP_SYSSETTITLE )( const char *text ); typedef void ( *PFN_QERAPP_CSGMAKEHOLLOW )(); +typedef void ( *PFN_QERAPP_CSGMAKEHOLLOWMODE )( int mode ); typedef void ( *PFN_QERAPP_REGIONSPAWNPOINT )( FILE *f ); @@ -621,6 +622,7 @@ struct _QERFuncTable_1 // FIXME TTimo prolly want to move that somewhere else PFN_QERAPP_CSGMAKEHOLLOW m_pfnCSG_MakeHollow; + PFN_QERAPP_CSGMAKEHOLLOWMODE m_pfnCSG_MakeHollowMode; PFN_QERAPP_REGIONSPAWNPOINT m_pfnRegionSpawnPoint; PFN_QERAPP_GETTICKCOUNT m_pfnQGetTickCount; @@ -642,6 +644,7 @@ struct _QERFuncTable_1 #define __QERTABLENAME g_FuncTable #endif #define CSG_MakeHollow __QERTABLENAME.m_pfnCSG_MakeHollow +#define CSG_MakeHollowMode __QERTABLENAME.m_pfnCSG_MakeHollowMode #define Sys_Beep __QERTABLENAME.m_pfnSysBeep #define Sys_Printf __QERTABLENAME.m_pfnSysPrintf #define Sys_FPrintf __QERTABLENAME.m_pfnSysFPrintf diff --git a/radiant/csg.cpp b/radiant/csg.cpp index 5f50e709..4977161a 100644 --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@ -39,7 +39,10 @@ void Brush_Scale( brush_t* b ){ } } -void CSG_MakeHollow( void ){ +void CSG_MakeHollow(){ + CSG_MakeHollowMode( CSG_HOLLOW_MODE_OVERLAP ); +} +void CSG_MakeHollowMode( int mode ){ brush_t *b, *front, *back, *next; face_t *f; face_t split; @@ -59,8 +62,11 @@ void CSG_MakeHollow( void ){ split = *f; VectorScale( f->plane.normal, g_qeglobals.d_gridsize, move ); for ( i = 0 ; i < 3 ; i++ ) - VectorSubtract( split.planepts[i], move, split.planepts[i] ); - + if( mode == CSG_HOLLOW_MODE_TOUCH ) { + VectorAdd( f->planepts[i], move, f->planepts[i] ); + } else { + VectorSubtract( split.planepts[i], move, split.planepts[i] ); + } Brush_SplitBrushByFace( b, &split, &front, &back ); if ( back ) { Brush_Free( back ); @@ -68,6 +74,9 @@ void CSG_MakeHollow( void ){ if ( front ) { Brush_AddToList( front, &selected_brushes ); } + if( mode == CSG_HOLLOW_MODE_TOUCH ) { + *f = split; + } } Brush_Free( b ); } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9dcaced5..a2b4c758 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -509,6 +509,7 @@ gint HandleCommand( GtkWidget *widget, gpointer data ){ case ID_SELECTION_ARBITRARYROTATION: g_pParentWnd->OnSelectionArbitraryrotation(); break; case ID_SELECT_SCALE: g_pParentWnd->OnSelectScale(); break; case ID_SELECTION_MAKEHOLLOW: g_pParentWnd->OnSelectionMakehollow(); break; + case ID_SELECTION_MAKEHOLLOW_TOUCH: g_pParentWnd->OnSelectionMakehollowTouch(); break; case ID_SELECTION_CSGSUBTRACT: g_pParentWnd->OnSelectionCsgsubtract(); break; case ID_SELECTION_CSGMERGE: g_pParentWnd->OnSelectionCsgmerge(); break; case ID_SELECTION_NOOUTLINE: g_pParentWnd->OnSelectionNoOutline(); break; @@ -1209,8 +1210,10 @@ void MainFrame::create_main_menu( GtkWidget *window, GtkWidget *vbox ){ menu_separator( menu ); create_menu_item_with_mnemonic( menu, _( "Scale..." ), GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECT_SCALE ); menu_in_menu = create_menu_in_menu_with_mnemonic( menu, _( "CSG" ) ); - create_menu_item_with_mnemonic( menu_in_menu, _( "Make _Hollow" ), + create_menu_item_with_mnemonic( menu_in_menu, _( "Make _Hollow Overlap" ), GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_MAKEHOLLOW ); + create_menu_item_with_mnemonic( menu_in_menu, _( "Make _Hollow Touch" ), + G_CALLBACK( HandleCommand ), ID_SELECTION_MAKEHOLLOW_TOUCH ); create_menu_item_with_mnemonic( menu_in_menu, _( "CSG _Subtract" ), GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_CSGSUBTRACT ); create_menu_item_with_mnemonic( menu_in_menu, _( "CSG _Merge" ), @@ -1768,10 +1771,14 @@ void MainFrame::create_main_toolbar( GtkWidget *window, GtkWidget *vbox ){ g_object_set_data( G_OBJECT( window ), "tb_selection_csgmerge", w ); } - w = gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "", _( "Hollow" ), "", + w = gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "", _( "Hollow Overlap" ), "", new_image_icon("selection_makehollow.png"), GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SELECTION_MAKEHOLLOW ) ); g_object_set_data( G_OBJECT( window ), "tb_selection_makehollow", w ); + w = gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "", _( "Hollow Touch" ), "", + new_image_icon("selection_makehollow.png"), + G_CALLBACK( HandleCommand ), GINT_TO_POINTER( ID_SELECTION_MAKEHOLLOW_TOUCH ) ); + g_object_set_data( G_OBJECT( window ), "tb_selection_makehollow_touch", w ); if ( g_PrefsDlg.m_bWideToolbar ) { w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, @@ -5381,6 +5388,16 @@ void MainFrame::OnSelectionMakehollow(){ Undo_End(); } +void MainFrame::OnSelectionMakehollowTouch(){ + //if (ActiveXY()) + // ActiveXY()->UndoCopy(); + Undo_Start( "hollow" ); + Undo_AddBrushList( &selected_brushes ); + CSG_MakeHollowMode( CSG_HOLLOW_MODE_TOUCH ); + Undo_EndBrushList( &selected_brushes ); + Undo_End(); +} + void MainFrame::OnSelectionCsgsubtract(){ Undo_Start( "CSG subtract" ); CSG_Subtract(); diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 5c3b65bd..a55f1fb5 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -263,6 +263,7 @@ struct SKeyInfo #define ID_REGION_SETXY 40044 #define ID_REGION_SETBRUSH 40045 #define ID_SELECTION_MAKEHOLLOW 40046 +#define ID_SELECTION_MAKEHOLLOW_TOUCH 40051 #define ID_SELECTION_SELECTPARTIALTALL 40047 #define ID_SELECTION_SELECTCOMPLETETALL 40048 #define ID_SELECTION_CSGSUBTRACT 40049 @@ -682,6 +683,7 @@ void OnSelectionDragvertecies(); void OnSelectionMakeDetail(); void OnSelectionMakeStructural(); void OnSelectionMakehollow(); +void OnSelectionMakehollowTouch(); void OnSelectionSelectcompletetall(); void OnSelectionSelectinside(); void OnSelectionSelectpartialtall(); diff --git a/radiant/pluginmanager.cpp b/radiant/pluginmanager.cpp index 3a9929c8..f25eb1f4 100644 --- a/radiant/pluginmanager.cpp +++ b/radiant/pluginmanager.cpp @@ -2063,6 +2063,7 @@ bool CSynapseClientRadiant::RequestAPI( APIDescriptor_t *pAPI ){ pTable->m_pfnSetBuildWindingsNoTexBuild = &Brush_SetBuildWindingsNoTexBuild; pTable->m_pfnPointFileClear = &Pointfile_Clear; pTable->m_pfnCSG_MakeHollow = &CSG_MakeHollow; + pTable->m_pfnCSG_MakeHollowMode = &CSG_MakeHollowMode; pTable->m_pfnRegionSpawnPoint = &Region_SpawnPoint; pTable->m_pfnQGetTickCount = &QERApp_GetTickCount; pTable->m_pfnGetModelCache = &GetModelCache; diff --git a/radiant/qe3.h b/radiant/qe3.h index 20f22278..5a9ec542 100644 --- a/radiant/qe3.h +++ b/radiant/qe3.h @@ -222,7 +222,10 @@ void Drag_MouseUp( int nButtons = 0 ); // // csg.c // +#define CSG_HOLLOW_MODE_OVERLAP (0) +#define CSG_HOLLOW_MODE_TOUCH (1) void CSG_MakeHollow( void ); +void CSG_MakeHollowMode( int mode ); void CSG_Subtract( void ); void CSG_Merge( void ); From ec310f779cb36040e47dbf5b30d1d4550fc0e1d7 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Thu, 2 Mar 2017 16:54:38 +0100 Subject: [PATCH 02/15] Fix (3d view) mouse problem with using gdk --- radiant/qe3.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 9b33d069..60b7687f 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -1294,27 +1294,12 @@ void WINAPI Sys_EndWait( void ){ } void Sys_GetCursorPos( int *x, int *y ){ -#ifdef _WIN32 - POINT p; - if ( !GetCursorPos( &p ) ) { - Sys_Printf( "GetCursorPos failed: GetLastError()=0x%08x", GetLastError() ); - return; - } - *x = p.x; - *y = p.y; -#else - gdk_window_get_pointer( NULL, x, y, NULL ); -#endif + gdk_display_get_pointer( gdk_display_get_default(), 0, x, y, 0 ); } void Sys_SetCursorPos( int x, int y ){ -#ifdef _WIN32 - if ( !SetCursorPos( x, y ) ) { - Sys_Printf( "SetCursorPos failed: GetLastError()=0x%08x", GetLastError() ); - } -#else - XWarpPointer( GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0, 0, 0, 0, x, y ); -#endif + GdkDisplay *display = gdk_display_get_default(); + gdk_display_warp_pointer( display, gdk_display_get_default_screen( display ), x, y ); } void Sys_Beep( void ){ From 3799e10d00407a789eb423861a264478a146bb63 Mon Sep 17 00:00:00 2001 From: Timothee Besset Date: Thu, 2 Mar 2017 21:39:49 -0600 Subject: [PATCH 03/15] remove the bspc submodule - it is meant to get pulled by scons target=setup --- .gitmodules | 3 --- bspc | 1 - 2 files changed, 4 deletions(-) delete mode 160000 bspc diff --git a/.gitmodules b/.gitmodules index 04728f9d..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "bspc"] - path = bspc - url = git@github.com:TTimo/bspc.git diff --git a/bspc b/bspc deleted file mode 160000 index 2c840783..00000000 --- a/bspc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2c8407838398608cb9c52abae046987bb7a39c08 From f716de2a5b812204f8cc3810f4915fcca183fb1d Mon Sep 17 00:00:00 2001 From: Timothee Besset Date: Thu, 2 Mar 2017 22:04:15 -0600 Subject: [PATCH 04/15] reword the game config and selection dialog for clarity. exit without opting into the preferences since that would crash --- radiant/preferences.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 31432b3e..60489de1 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -1008,12 +1008,14 @@ void CGameDialog::DoGameInstall() { void CGameDialog::DoGameDialog() { // allow looping the game selection dialog with calls to the game configure dialog in between + // NOTE: This is *very early* in the process lifetime, we can't call Error() for instance while ( m_bDoGameInstall ) { m_bDoGameInstall = false; if ( DoModal() == IDCANCEL ) { - Error( "game selection dialog canceled, cannot continue" ); + gtk_MessageBox( NULL, _( "Run again once you have decided which game you are interested in :-)" ), _( "Message" ), MB_OK ); + exit( 0 ); return; } @@ -1065,7 +1067,7 @@ GtkWidget* CGameDialog::GetGlobalFrame(){ gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); AddDialogData( check, &m_bAutoLoadGame, DLG_CHECK_BOOL ); - text = gtk_label_new( _( "(this frame is available in the prefs menu if you set auto-select)" ) ); + text = gtk_label_new( _( "(use preferences to undo this)" ) ); gtk_widget_show( text ); gtk_box_pack_start( GTK_BOX( vbox ), text, FALSE, FALSE, 0 ); @@ -1140,18 +1142,18 @@ void CGameDialog::BuildDialog() { gtk_container_add( GTK_CONTAINER( vbox1 ), GetGlobalFrame() ); mTopBox = vbox1; - setup_button = gtk_button_new_with_label( _( "Configure more games" ) ); + setup_button = gtk_button_new_with_label( _( "Configure editor for another game" ) ); gtk_widget_show( setup_button ); gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( setup_button ), "clicked", GTK_SIGNAL_FUNC( SInstallCallback ), this ); - button = gtk_button_new_with_label( _( "OK" ) ); + button = gtk_button_new_with_label( _( "Start editor on selected game" ) ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); AddModalButton( button, IDOK ); - button = gtk_button_new_with_label( _( "Cancel" ) ); + button = gtk_button_new_with_label( _( "Exit" ) ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); AddModalButton( button, IDCANCEL ); From 1c83f98625a0f1da284a981523830c2a1b53533c Mon Sep 17 00:00:00 2001 From: Timothee Besset Date: Thu, 2 Mar 2017 22:11:29 -0600 Subject: [PATCH 05/15] another UI tweak --- radiant/preferences.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 60489de1..aee63e3b 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -1142,17 +1142,17 @@ void CGameDialog::BuildDialog() { gtk_container_add( GTK_CONTAINER( vbox1 ), GetGlobalFrame() ); mTopBox = vbox1; - setup_button = gtk_button_new_with_label( _( "Configure editor for another game" ) ); - gtk_widget_show( setup_button ); - gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( setup_button ), "clicked", - GTK_SIGNAL_FUNC( SInstallCallback ), this ); - button = gtk_button_new_with_label( _( "Start editor on selected game" ) ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); AddModalButton( button, IDOK ); + setup_button = gtk_button_new_with_label( _( "Configure editor for another game" ) ); + gtk_widget_show( setup_button ); + gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( setup_button ), "clicked", + GTK_SIGNAL_FUNC( SInstallCallback ), this ); + button = gtk_button_new_with_label( _( "Exit" ) ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); From c6ecd1ec01cac27e4f68aa5daa7340f90450c5b2 Mon Sep 17 00:00:00 2001 From: Timothee Besset Date: Thu, 2 Mar 2017 22:21:00 -0600 Subject: [PATCH 06/15] cleanup --- include/qerplugin.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/include/qerplugin.h b/include/qerplugin.h index 99c802f4..d9bdee3a 100644 --- a/include/qerplugin.h +++ b/include/qerplugin.h @@ -491,13 +491,6 @@ typedef bfilter_t* ( *PFN_QERPLUG_FILTERADD )( int type, int bmask, const char * typedef void ( *PFN_QERPLUG_FILTERACTIVATE )( void ); -// FIXME: -// add map format extensions -// add texture format handlers -// add surface dialog handler -// add model handler/displayer - -// v1 func table // Plugins need to declare one of these and implement the getfunctable as described above struct _QERFuncTable_1 { @@ -531,7 +524,6 @@ struct _QERFuncTable_1 PFN_QERAPP_RELEASEACTIVEBRUSHHANDLES m_pfnReleaseActiveBrushHandles; PFN_QERAPP_GETACTIVEBRUSHHANDLE m_pfnGetActiveBrushHandle; - //++timo this would need to be removed and replaced by the IShaders interface PFN_QERAPP_TEXTURECOUNT m_pfnTextureCount; PFN_QERAPP_GETTEXTURE m_pfnGetTexture; PFN_QERAPP_GETCURRENTTEXTURE m_pfnGetCurrentTexture; @@ -617,10 +609,8 @@ struct _QERFuncTable_1 PFN_QERAPP_MAPSTARTPOSITION m_pfnMapStartPosition; PFN_QERAPP_MAPREGIONOFF m_pfnMapRegionOff; PFN_QERAPP_SETBUILDWINDINGSNOTEXBUILD m_pfnSetBuildWindingsNoTexBuild; -// PFN_QERAPP_SAVEASDIALOG m_pfnSaveAsDialog; PFN_QERAPP_POINTFILECLEAR m_pfnPointFileClear; - // FIXME TTimo prolly want to move that somewhere else PFN_QERAPP_CSGMAKEHOLLOW m_pfnCSG_MakeHollow; PFN_QERAPP_CSGMAKEHOLLOWMODE m_pfnCSG_MakeHollowMode; From 4f0c07282fa8fc98494c491bf57e6b6d0cd34268 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Fri, 3 Mar 2017 16:35:26 +0100 Subject: [PATCH 07/15] Adjusting Project Settings dialog for games --- radiant/gtkdlgs.cpp | 873 ++++++++++++++------------------------------ 1 file changed, 270 insertions(+), 603 deletions(-) diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 44778059..d682ec72 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -332,138 +332,143 @@ static const char* sSOF2ModComboItem = "Custom Sof2 modification"; static const char* sSOF2SPCombo = "Single Player mapping mode"; static const char* sSOF2MPCombo = "Multiplayer mapping mode"; -static GtkWidget* game_select; // GTK_COMBO -static GtkEntry* fsgame_entry; +struct gamemode_s { + const char *gameFile; + const char *name; + const char *mode; + qboolean base; //default mode +}; +typedef struct gamemode_s gamemode_t; -gint OnSelchangeComboWhatgame( GtkWidget *widget, GdkEvent* event, gpointer data ){ - const char *dir = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ) ); - // HACK: Wolf - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - if ( !strcmp( dir,sWolfComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } +gamemode_t gameModeList[] = { + { "wolf.game", sWolfSPCombo, "sp", qtrue }, + { "wolf.game", sWolfMPCombo, "mp", qfalse }, - } - // HACK: ET - else if ( g_pGameDescription->mGameFile == "et.game" ) { - if ( !strcmp( dir,sETComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } + { "jk2.game", sJK2SPCombo, "sp", qtrue }, + { "jk2.game", sJK2MPCombo, "mp", qfalse }, - } - else if ( g_pGameDescription->mGameFile == "hl.game" ) { - if ( !strcmp( dir,sHLComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } + { "ja.game", sJASPCombo, "sp", qtrue }, + { "ja.game", sJAMPCombo, "mp", qfalse }, - } - // RIANT - // HACK: JK2 - else if ( g_pGameDescription->mGameFile == "jk2.game" ) { - if ( !strcmp( dir,sJK2ComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } - } - // TTimo - // HACK: JA - else if ( g_pGameDescription->mGameFile == "ja.game" ) { - if ( !strcmp( dir,sJAComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } - } - // RIANT - // HACK: STVEF - else if ( g_pGameDescription->mGameFile == "stvef.game" ) { - if ( !strcmp( dir,sSTVEFComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } - } - // RIANT - // HACK: SOF2 - else if ( g_pGameDescription->mGameFile == "sof2.game" ) { - if ( !strcmp( dir,sSOF2ComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); - } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); - } - } - // QUAKE 3 - else + { "stvef.game", sSTVEFSPCombo, "sp", qtrue }, + { "stvef.game", sSTVEFMPCombo, "mp", qfalse }, + + { "sof2.game", sSOF2SPCombo, "sp", qtrue }, + { "sof2.game", sSOF2MPCombo, "mp", qfalse }, + +}; + +struct game_s { + const char *gameFile; + const char *name; + const char *fs_game; //filesystem gamename + qboolean base; //default basegame, ie baseq3 + qboolean custom; //ie Custom Quake III modification +}; +typedef struct game_s game_t; + +game_t gameList[] = { + { "q3.game", sQ3ComboItem, "baseq3", qtrue, qfalse }, + { "q3.game", sTAComboItem, "missionpack", qfalse, qfalse }, + { "q3.game", "Defrag", "defrag", qfalse, qfalse }, + { "q3.game", sModComboItem, "", qfalse, qtrue }, + + { "wolf.game", sWolfComboItem, "main", qtrue, qfalse }, + { "wolf.game", sWolfModComboItem, "", qfalse, qfalse }, + + { "hl.game", sHLComboItem, "valve", qtrue, qfalse }, + { "hl.game", sHLModComboItem, "", qfalse, qtrue }, + + { "et.game", sETComboItem, "etmain", qtrue, qfalse }, + { "et.game", sETModComboItem, "", qfalse, qtrue }, + + { "jk2.game", sJK2ComboItem, "base", qtrue, qfalse }, + { "jk2.game", sJK2ModComboItem, "", qfalse, qtrue }, + + { "ja.game", sJAComboItem, "base", qtrue, qfalse }, + { "ja.game", sJAModComboItem, "", qfalse, qtrue }, + + { "stvef.game", sSTVEFComboItem, "baseEf", qtrue, qfalse }, + { "stvef.game", sSTVEFModComboItem, "", qfalse, qtrue }, + + { "sof2.game", sSOF2ComboItem, "base", qtrue, qfalse }, + { "sof2.game", sSOF2ModComboItem, "", qfalse, qtrue }, + +}; + +GList *newMappingModesListForGameFile( Str & mGameFile ){ + GList *mode_list; + size_t x; + + mode_list = NULL; + for( x = 0; x < G_N_ELEMENTS( gameModeList ); x++ ) { - if ( !strcmp( dir,sQ3ComboItem ) ) { - // disable the fs_game text entry - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); + if( strcmp( mGameFile.GetBuffer(), gameModeList[x].gameFile ) == 0 ) { + mode_list = g_list_append( mode_list, &gameModeList[x] ); } - else if ( !strcmp( dir,sTAComboItem ) ) { - gtk_entry_set_text( fsgame_entry, "missionpack" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), false ); + } + return mode_list; +} + +GList *newModListForGameFile( Str & mGameFile ){ + GList *mod_list; + size_t x; + + mod_list = NULL; + for( x = 0; x < G_N_ELEMENTS( gameList ); x++ ) + { + if( strcmp( mGameFile.GetBuffer(), gameList[x].gameFile ) == 0 ) { + mod_list = g_list_append( mod_list, &gameList[x] ); } - else - { - gtk_entry_set_text( fsgame_entry, "" ); - gtk_widget_set_sensitive( GTK_WIDGET( fsgame_entry ), true ); + } + return mod_list; +} + +void OnSelchangeComboWhatgame( GtkWidget *widget, gpointer data ){ + GtkWidget *fs_game_entry; + GtkWidget* game_select; + size_t x; + const gchar *name; + + game_select = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "game_select" ) ); + name = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ) ); + + if( !name ) { + return; + } + fs_game_entry = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "fs_game_entry" ) ); + + for( x = 0; x < G_N_ELEMENTS( gameList ); x++ ) + { + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), gameList[x].gameFile ) == 0 + && strcmp( name, gameList[x].name ) == 0 ) { + + if( gameList[x].custom ) { + gtk_entry_set_text( GTK_ENTRY( fs_game_entry ), gameList[x].fs_game ); + gtk_widget_set_sensitive( GTK_WIDGET( fs_game_entry ), true ); + gtk_widget_grab_focus( GTK_WIDGET( fs_game_entry ) ); + } else { + gtk_entry_set_text( GTK_ENTRY( fs_game_entry ), gameList[x].fs_game ); + gtk_widget_set_sensitive( GTK_WIDGET( fs_game_entry ), false ); + } + break; } } - return TRUE; } void DoProjectSettings(){ GtkWidget *project; GtkWidget *frame, *label, *vbox, *table1, *table2, *button; GtkWidget *brush; - GtkWidget *scr; - GtkWidget *base, *game; - GtkWidget *gamemode_combo; + GtkWidget *scr, *entry; + GtkWidget *base, *game_select; + GtkWidget *gamemode_combo, *fs_game_entry; + GList *mod_list, *gamemode_list; + GList *lst; GList *combo_list = (GList*)NULL; + const char *fs_game; + qboolean isBasegame; int loop = 1, ret = IDCANCEL; @@ -585,150 +590,95 @@ void DoProjectSettings(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - // HACK: hardcoded game stuff - if ( g_pGameDescription->mGameFile == "wolf.game" || - g_pGameDescription->mGameFile == "et.game" || - g_pGameDescription->mGameFile == "jk2.game" || - g_pGameDescription->mGameFile == "stvef.game" || - g_pGameDescription->mGameFile == "sof2.game" || - g_pGameDescription->mGameFile == "ja.game" ) { - table2 = gtk_table_new( 9, 2, FALSE ); - } - else - { - table2 = gtk_table_new( 8, 2, FALSE ); - } + table2 = gtk_table_new( 9, 2, FALSE ); gtk_widget_show( table2 ); gtk_container_add( GTK_CONTAINER( frame ), table2 ); gtk_container_set_border_width( GTK_CONTAINER( table2 ), 5 ); gtk_table_set_row_spacings( GTK_TABLE( table2 ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table2 ), 5 ); - /* - fill in the game selection combo - HACK: hardcoded Q3/Wolf/HL switch - \todo that stuff would be faster to write with implementation of property bags and associated code to edit - */ - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - combo_list = g_list_append( combo_list, (void *)sWolfComboItem ); - combo_list = g_list_append( combo_list, (void *)sWolfModComboItem ); - } - else if ( g_pGameDescription->mGameFile == "et.game" ) { - combo_list = g_list_append( combo_list, (void *)sETComboItem ); - combo_list = g_list_append( combo_list, (void *)sETModComboItem ); - } - else if ( g_pGameDescription->mGameFile == "hl.game" ) { - combo_list = g_list_append( combo_list, (void *)sHLComboItem ); - combo_list = g_list_append( combo_list, (void *)sHLModComboItem ); - } - // RIANT - // JK2 HACK - else if ( g_pGameDescription->mGameFile == "jk2.game" ) { - combo_list = g_list_append( combo_list, (void *)sJK2ComboItem ); - combo_list = g_list_append( combo_list, (void *)sJK2ModComboItem ); - } - // TTimo - // JA HACK - else if ( g_pGameDescription->mGameFile == "ja.game" ) { - combo_list = g_list_append( combo_list, (void *)sJAComboItem ); - combo_list = g_list_append( combo_list, (void *)sJAModComboItem ); - } - // RIANT - // STVEF HACK - else if ( g_pGameDescription->mGameFile == "stvef.game" ) { - combo_list = g_list_append( combo_list, (void *)sSTVEFComboItem ); - combo_list = g_list_append( combo_list, (void *)sSTVEFModComboItem ); - } - // RIANT - // SOF2 HACK A LA JK2 A LA WOLF - else if ( g_pGameDescription->mGameFile == "sof2.game" ) { - combo_list = g_list_append( combo_list, (void *)sSOF2ComboItem ); - combo_list = g_list_append( combo_list, (void *)sSOF2ModComboItem ); - } - else - { - // Q3 or default - combo_list = g_list_append( combo_list, (void *)sQ3ComboItem ); - combo_list = g_list_append( combo_list, (void *)sTAComboItem ); - combo_list = g_list_append( combo_list, (void *)sModComboItem ); - } - + mod_list = newModListForGameFile( g_pGameDescription->mGameFile ); game_select = gtk_combo_new(); + for( lst = mod_list; lst != NULL; lst = g_list_next( lst ) ) + { + const game_t *game_x = (const game_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), game_x->gameFile ) == 0 ) { + combo_list = g_list_append( combo_list, (void *)game_x->name ); + } + } gtk_combo_set_popdown_strings( GTK_COMBO( game_select ), combo_list ); + g_list_free( combo_list ); + gtk_widget_show( game_select ); gtk_table_attach( GTK_TABLE( table2 ), game_select, 1, 2, 6, 7, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_signal_connect( GTK_OBJECT( GTK_COMBO( game_select )->entry ), "changed", - GTK_SIGNAL_FUNC( OnSelchangeComboWhatgame ), NULL ); - - g_list_free( combo_list ); + GTK_SIGNAL_FUNC( OnSelchangeComboWhatgame ), project ); + g_object_set_data( G_OBJECT( project ), "game_select", game_select ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( game_select )->entry ), FALSE ); - game = gtk_entry_new(); - fsgame_entry = GTK_ENTRY( game ); - gtk_widget_show( game ); - gtk_table_attach( GTK_TABLE( table2 ), game, 1, 2, 7, 8, + fs_game_entry = entry = gtk_entry_new(); + gtk_widget_set_sensitive( GTK_WIDGET( fs_game_entry ), false ); + gtk_widget_show( entry ); + gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 7, 8, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + g_object_set_data( G_OBJECT( project ), "fs_game_entry", entry ); - /* - wolf specific: select MP or SP mode - */ - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - combo_list = NULL; - combo_list = g_list_append( combo_list, (void *)sWolfSPCombo ); - combo_list = g_list_append( combo_list, (void *)sWolfMPCombo ); - - gamemode_combo = gtk_combo_new(); - gtk_combo_set_popdown_strings( GTK_COMBO( gamemode_combo ), combo_list ); - gtk_widget_show( gamemode_combo ); - gtk_table_attach( GTK_TABLE( table2 ), gamemode_combo, 1, 2, 8, 9, - (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - - g_list_free( combo_list ); - combo_list = NULL; - - label = gtk_label_new( _( "Mapping mode" ) ); - gtk_widget_show( label ); - gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 8, 9, - (GtkAttachOptions) ( GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); + fs_game = ValueForKey( g_qeglobals.d_project_entity, "gamename" ); + isBasegame = qtrue; + if( fs_game && strlen( fs_game ) > 0 ) { + for( lst = mod_list; lst != NULL; lst = g_list_next( lst ) ) + { + const game_t *game_x = (const game_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), game_x->gameFile ) == 0 && strcmp( game_x->fs_game, fs_game ) == 0 ) { + gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), game_x->name ); + isBasegame = qfalse; + break; + } + } + if( isBasegame ) { + for( lst = mod_list; lst != NULL; lst = g_list_next( lst ) ) + { + const game_t *game_x = (const game_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), game_x->gameFile ) == 0 && game_x->custom ) { + gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), game_x->name ); + gtk_widget_set_sensitive( GTK_WIDGET( fs_game_entry ), true ); + isBasegame = qfalse; + break; + } + } + } } - - // RIANT - // JK2 HACK - if ( g_pGameDescription->mGameFile == "jk2.game" ) { - combo_list = NULL; - combo_list = g_list_append( combo_list, (void *)sJK2SPCombo ); - combo_list = g_list_append( combo_list, (void *)sJK2MPCombo ); - - gamemode_combo = gtk_combo_new(); - gtk_combo_set_popdown_strings( GTK_COMBO( gamemode_combo ), combo_list ); - gtk_widget_show( gamemode_combo ); - gtk_table_attach( GTK_TABLE( table2 ), gamemode_combo, 1, 2, 8, 9, - (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - - g_list_free( combo_list ); - combo_list = NULL; - - label = gtk_label_new( _( "Mapping mode" ) ); - gtk_widget_show( label ); - gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 8, 9, - (GtkAttachOptions) ( GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); + if( isBasegame ) { + for( lst = mod_list; lst != NULL; lst = g_list_next( lst ) ) + { + const game_t *game_x = (const game_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), game_x->gameFile ) == 0 && game_x->base ) { + gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), game_x->name ); + fs_game = game_x->fs_game; + break; + } + } } - // TTimo - // JA HACK - if ( g_pGameDescription->mGameFile == "ja.game" ) { + gtk_entry_set_text( GTK_ENTRY( fs_game_entry ), fs_game ); + + gamemode_list = newMappingModesListForGameFile( g_pGameDescription->mGameFile ); + if( gamemode_list ) { + const char *gamemode; + qboolean isBasemode; + combo_list = NULL; - combo_list = g_list_append( combo_list, (void *)sJASPCombo ); - combo_list = g_list_append( combo_list, (void *)sJAMPCombo ); + + for( lst = gamemode_list; lst != NULL; lst = g_list_next( lst ) ) + { + const gamemode_t *gamemode_x = (const gamemode_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), gamemode_x->gameFile ) == 0 ) { + combo_list = g_list_append( combo_list, (void *)gamemode_x->name ); + } + } gamemode_combo = gtk_combo_new(); gtk_combo_set_popdown_strings( GTK_COMBO( gamemode_combo ), combo_list ); @@ -746,54 +696,28 @@ void DoProjectSettings(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); - } - // RIANT - // STVEF HACK - if ( g_pGameDescription->mGameFile == "stvef.game" ) { - combo_list = NULL; - combo_list = g_list_append( combo_list, (void *)sSTVEFSPCombo ); - combo_list = g_list_append( combo_list, (void *)sSTVEFMPCombo ); - gamemode_combo = gtk_combo_new(); - gtk_combo_set_popdown_strings( GTK_COMBO( gamemode_combo ), combo_list ); - gtk_widget_show( gamemode_combo ); - gtk_table_attach( GTK_TABLE( table2 ), gamemode_combo, 1, 2, 8, 9, - (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - - g_list_free( combo_list ); - combo_list = NULL; - - label = gtk_label_new( _( "Mapping mode" ) ); - gtk_widget_show( label ); - gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 8, 9, - (GtkAttachOptions) ( GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); - } - // RIANT - // SOF2 HACK - if ( g_pGameDescription->mGameFile == "sof2.game" ) { - combo_list = NULL; - combo_list = g_list_append( combo_list, (void *)sSOF2SPCombo ); - combo_list = g_list_append( combo_list, (void *)sSOF2MPCombo ); - - gamemode_combo = gtk_combo_new(); - gtk_combo_set_popdown_strings( GTK_COMBO( gamemode_combo ), combo_list ); - gtk_widget_show( gamemode_combo ); - gtk_table_attach( GTK_TABLE( table2 ), gamemode_combo, 1, 2, 8, 9, - (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - - g_list_free( combo_list ); - combo_list = NULL; - - label = gtk_label_new( _( "Mapping mode" ) ); - gtk_widget_show( label ); - gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 8, 9, - (GtkAttachOptions) ( GTK_FILL ), - (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); + gamemode = ValueForKey( g_qeglobals.d_project_entity, "gamemode" ); + isBasemode = qtrue; + for( lst = gamemode_list; lst != NULL; lst = g_list_next( lst ) ) + { + const gamemode_t *gamemode_x = (const gamemode_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), gamemode_x->gameFile ) == 0 && strcmp( gamemode_x->mode, gamemode ) == 0 ) { + gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), gamemode_x->name ); + isBasemode = qfalse; + break; + } + } + if( isBasemode ) { + for( lst = gamemode_list; lst != NULL; lst = g_list_next( lst ) ) + { + const gamemode_t *gamemode_x = (const gamemode_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), gamemode_x->gameFile ) == 0 && gamemode_x->base ) { + gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), gamemode_x->name ); + break; + } + } + } } /* @@ -835,207 +759,6 @@ void DoProjectSettings(){ UpdateBSPCommandList( project ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( brush ), ( g_qeglobals.m_bBrushPrimitMode ) ? TRUE : FALSE ); - // initialise the fs_game selection from the project settings into the dialog - const char *dir = ValueForKey( g_qeglobals.d_project_entity, "gamename" ); - // HACK: hardcoded wolf stuff - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"main" ) ) { - // no fs_game set, we are running stock Quake III Arena editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sWolfComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sWolfModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - // HACK: hardcoded et stuff - if ( g_pGameDescription->mGameFile == "et.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"etmain" ) ) { - // no fs_game set, we are running stock Quake III Arena editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sETComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sETModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - // HACK: hardcoded half-life stuff - else if ( g_pGameDescription->mGameFile == "hl.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"valve" ) ) { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sHLComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sHLModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - // RIANT - // JK2 HACK - else if ( g_pGameDescription->mGameFile == "jk2.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"base" ) ) { - // no fs_game set, we are running stock Quake III Arena editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sJK2ComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sJK2ModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - // TTimo - // JA HACK - else if ( g_pGameDescription->mGameFile == "ja.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"base" ) ) { - // no fs_game set, we are running stock editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sJAComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sJAModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - // RIANT - // STVEF2 HACK - else if ( g_pGameDescription->mGameFile == "stvef.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"baseEf" ) ) { - // no fs_game set, we are running stock Quake III Arena editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sSTVEFComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sSTVEFModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - // RIANT - // SOF2 HACK - else if ( g_pGameDescription->mGameFile == "sof2.game" ) { - if ( ( strlen( dir ) == 0 ) || !stricmp( dir,"base" ) ) { - // no fs_game set, we are running stock Quake III Arena editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sSOF2ComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sSOF2ModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - else - { - if ( ( strlen( dir ) == 0 ) || !strcmp( dir,"baseq3" ) ) { - // no fs_game set, we are running stock Quake III Arena editing - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sQ3ComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "" ); - gtk_widget_set_sensitive( game, false ); - } - else if ( !strcmp( dir,"missionpack" ) ) { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sTAComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), "missionpack" ); - gtk_widget_set_sensitive( game, false ); - } - else - { - // this is a custom mod - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ), sModComboItem ); - gtk_entry_set_text( GTK_ENTRY( game ), dir ); - gtk_widget_set_sensitive( game, true ); - } - } - - // HACK: hardcoded wolf stuff - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - const char *gamemode = ValueForKey( g_qeglobals.d_project_entity, "gamemode" ); - if ( ( strlen( gamemode ) == 0 ) || !strcmp( gamemode,"sp" ) ) { - // nothing set yet, or single player - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sWolfSPCombo ); - } - else - { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sWolfMPCombo ); - } - } - - // JK2 HACK - else if ( g_pGameDescription->mGameFile == "jk2.game" ) { - const char *gamemode = ValueForKey( g_qeglobals.d_project_entity, "gamemode" ); - if ( ( strlen( gamemode ) == 0 ) || !strcmp( gamemode,"sp" ) ) { - // nothing set yet, or single player - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sJK2SPCombo ); - } - else - { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sJK2MPCombo ); - } - } - // JA HACK - else if ( g_pGameDescription->mGameFile == "ja.game" ) { - const char *gamemode = ValueForKey( g_qeglobals.d_project_entity, "gamemode" ); - if ( ( strlen( gamemode ) == 0 ) || !strcmp( gamemode,"sp" ) ) { - // nothing set yet, or single player - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sJASPCombo ); - } - else - { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sJAMPCombo ); - } - } - // STVEF HACK - else if ( g_pGameDescription->mGameFile == "stvef.game" ) { - const char *gamemode = ValueForKey( g_qeglobals.d_project_entity, "gamemode" ); - if ( ( strlen( gamemode ) == 0 ) || !strcmp( gamemode,"sp" ) ) { - // nothing set yet, or single player - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sSTVEFSPCombo ); - } - else - { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sSTVEFMPCombo ); - } - } - // SOF2 HACK - else if ( g_pGameDescription->mGameFile == "sof2.game" ) { - const char *gamemode = ValueForKey( g_qeglobals.d_project_entity, "gamemode" ); - if ( ( strlen( gamemode ) == 0 ) || !strcmp( gamemode,"sp" ) ) { - // nothing set yet, or single player - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sSOF2SPCombo ); - } - else - { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ), sSOF2MPCombo ); - } - } - gtk_grab_add( project ); gtk_widget_show( project ); @@ -1048,6 +771,7 @@ void DoProjectSettings(){ char buf[1024]; const char *r; char *w; + const char *custom_fs_game, *selected_game, *new_fs_game; // convert path to unix format for ( r = gtk_entry_get_text( GTK_ENTRY( base ) ), w = buf; *r != '\0'; r++, w++ ) @@ -1060,119 +784,73 @@ void DoProjectSettings(){ *w = '\0'; SetKeyValue( g_qeglobals.d_project_entity, "basepath", buf ); - dir = gtk_entry_get_text( GTK_ENTRY( game ) ); - // Hack: hard coded wolf stuff - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - if ( !strlen( dir ) || !stricmp( dir,"main" ) ) { - DeleteKey( g_qeglobals.d_project_entity, "gamename" ); - } - else + selected_game = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( game_select )->entry ) ); + custom_fs_game = gtk_entry_get_text( GTK_ENTRY( fs_game_entry ) ); + + isBasegame = qfalse; + new_fs_game = NULL; + + if( !selected_game ) { + isBasegame = qtrue; //should never happen that none is selected + } else { + for( lst = mod_list; lst != NULL; lst = g_list_next( lst ) ) { - SetKeyValue( g_qeglobals.d_project_entity, "gamename", dir ); + const game_t *game_x = (const game_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), game_x->gameFile ) == 0 && strcmp( game_x->name, selected_game ) == 0 ) { + if( game_x->base ) { + isBasegame = qtrue; + } else if( game_x->custom ) { + if( !custom_fs_game || strlen( custom_fs_game ) == 0 ) { + isBasegame = qtrue; + } else { + new_fs_game = custom_fs_game; + } + } else { + new_fs_game = game_x->fs_game; + } + } } } - // Hack: hard coded ET stuff - else if ( g_pGameDescription->mGameFile == "et.game" ) { - if ( !strlen( dir ) || !stricmp( dir,"etmain" ) ) { - DeleteKey( g_qeglobals.d_project_entity, "gamename" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamename", dir ); - } + if( new_fs_game == NULL ) { + isBasegame = qtrue; } - // Hack: hard coded Half-life stuff - else if ( g_pGameDescription->mGameFile == "hl.game" ) { - if ( !strlen( dir ) || !stricmp( dir,"valve" ) ) { - DeleteKey( g_qeglobals.d_project_entity, "gamename" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamename", dir ); - } - } - else if ( g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game" ) { - if ( !strlen( dir ) || !stricmp( dir,"base" ) ) { - DeleteKey( g_qeglobals.d_project_entity, "gamename" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamename", dir ); - } - } - // RIANT - // STVEF HACK - else if ( g_pGameDescription->mGameFile == "stvef.game" ) { - if ( !strlen( dir ) || !stricmp( dir,"baseEf" ) ) { - DeleteKey( g_qeglobals.d_project_entity, "gamename" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamename", dir ); - } - } - else - { - if ( !strlen( dir ) || !strcmp( dir,"baseq3" ) ) { - DeleteKey( g_qeglobals.d_project_entity, "gamename" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamename", dir ); - } + if( isBasegame ) { + DeleteKey( g_qeglobals.d_project_entity, "gamename" ); + } else { + SetKeyValue( g_qeglobals.d_project_entity, "gamename", new_fs_game ); } - // HACK: hardcoded wolf stuff - if ( g_pGameDescription->mGameFile == "wolf.game" ) { - // read from gamemode_combo - const char *gamemode = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ) ); - if ( !strlen( gamemode ) || !strcmp( gamemode, sWolfSPCombo ) ) { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "sp" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "mp" ); - } - } + if( gamemode_list ) { + const char *selected_mode; + const char *new_mode; + + selected_mode = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ) ); + new_mode = NULL; - // RIANT - // JK2 HACK - if ( g_pGameDescription->mGameFile == "jk2.game" ) { - // read from gamemode_combo - const char *gamemode = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ) ); - if ( !strlen( gamemode ) || !strcmp( gamemode, sJK2SPCombo ) ) { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "sp" ); + if( !selected_mode ) { + new_mode = NULL; + } else { + for( lst = gamemode_list; lst != NULL; lst = g_list_next( lst ) ) + { + const gamemode_t *gamemode_x = (const gamemode_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), gamemode_x->gameFile ) == 0 && strcmp( gamemode_x->mode, selected_mode ) == 0 ) { + new_mode = selected_mode; + break; + } + } } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "mp" ); + if( !new_mode ) { + for( lst = gamemode_list; lst != NULL; lst = g_list_next( lst ) ) + { + const gamemode_t *gamemode_x = (const gamemode_t *)lst->data; + if( strcmp( g_pGameDescription->mGameFile.GetBuffer(), gamemode_x->gameFile ) == 0 ) { + new_mode = gamemode_x->mode; + break; + } + } } - } - // TTimo - // JA HACK - if ( g_pGameDescription->mGameFile == "ja.game" ) { - // read from gamemode_combo - const char *gamemode = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ) ); - if ( !strlen( gamemode ) || !strcmp( gamemode, sJASPCombo ) ) { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "sp" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "mp" ); - } - } - - // RIANT - // STVEF HACK - if ( g_pGameDescription->mGameFile == "stvef.game" ) { - // read from gamemode_combo - const char *gamemode = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ) ); - if ( !strlen( gamemode ) || !strcmp( gamemode, sSTVEFSPCombo ) ) { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "sp" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "mp" ); + if( new_mode ) { + SetKeyValue( g_qeglobals.d_project_entity, "gamemode", new_mode ); } } @@ -1184,20 +862,6 @@ void DoProjectSettings(){ g_qeglobals.m_strHomeMaps += str; g_qeglobals.m_strHomeMaps += G_DIR_SEPARATOR; - // RIANT - // SOF2 HACK - if ( g_pGameDescription->mGameFile == "sof2.game" ) { - // read from gamemode_combo - const char *gamemode = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( gamemode_combo )->entry ) ); - if ( !strlen( gamemode ) || !strcmp( gamemode, sSOF2SPCombo ) ) { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "sp" ); - } - else - { - SetKeyValue( g_qeglobals.d_project_entity, "gamemode", "mp" ); - } - } - if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( brush ) ) ) { g_qeglobals.m_bBrushPrimitMode = TRUE; } @@ -1210,6 +874,9 @@ void DoProjectSettings(){ QE_SaveProject( g_PrefsDlg.m_strLastProject.GetBuffer() ); } + g_list_free( mod_list ); + g_list_free( gamemode_list ); + gtk_grab_remove( project ); gtk_widget_destroy( project ); } From afca61523aeed3171496a5c876963e1ace03b026 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sat, 4 Mar 2017 18:36:21 +0100 Subject: [PATCH 08/15] Use GTK2 events --- contrib/bkgrnd2d/dialog.cpp | 4 +- contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 18 ++++---- contrib/camera/dialogs.cpp | 14 +++--- contrib/gtkgensurf/gendlgs.cpp | 54 +++++++++++------------ contrib/gtkgensurf/view.cpp | 16 +++---- contrib/prtview/AboutDialog.cpp | 2 +- contrib/prtview/ConfigDialog.cpp | 12 ++--- contrib/prtview/LoadPortalFileDialog.cpp | 4 +- contrib/prtview/gtkdlgs.cpp | 18 ++++---- plugins/surface/surfacedialog.cpp | 32 +++++++------- plugins/surface_idtech2/surfacedialog.cpp | 32 +++++++------- plugins/surface_idtech2/surfaceflags.cpp | 4 +- plugins/textool/TexTool.cpp | 14 +++--- radiant/bp_dlg.cpp | 2 +- radiant/camwindow.cpp | 2 +- radiant/dialog.cpp | 2 +- radiant/dialoginfo.cpp | 2 +- radiant/findtexturedialog.cpp | 4 +- radiant/glwindow.cpp | 12 ++--- radiant/groupdialog.cpp | 14 +++--- radiant/gtkdlgs.cpp | 46 +++++++++---------- radiant/gtkfilesel-darwin.c | 8 ++-- radiant/gtkfilesel-linux.c | 16 +++---- radiant/gtkfilesel.c | 8 ++-- radiant/gtkmisc.cpp | 6 +-- radiant/mainframe.cpp | 26 +++++------ radiant/patchdialog.cpp | 14 +++--- radiant/patchdialog.h | 2 +- radiant/surfacedialog.cpp | 18 ++++---- radiant/texwindow.cpp | 2 +- radiant/ui.cpp | 14 +++--- 31 files changed, 211 insertions(+), 211 deletions(-) diff --git a/contrib/bkgrnd2d/dialog.cpp b/contrib/bkgrnd2d/dialog.cpp index ae6eef27..a8a3d79f 100644 --- a/contrib/bkgrnd2d/dialog.cpp +++ b/contrib/bkgrnd2d/dialog.cpp @@ -325,11 +325,11 @@ void InitBackgroundDialog(){ // GTK_STOCK_CLOSE, // GTK_RESPONSE_CLOSE, NULL ); - gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "delete_event", + gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "delete-event", GTK_SIGNAL_FUNC( close_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "response", GTK_SIGNAL_FUNC( response_callback ), NULL ); -// gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); +// gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose-event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); pTooltips = gtk_tooltips_new(); diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 768190ec..426bbb8b 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -207,7 +207,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -321,7 +321,7 @@ int DoIntersectBox( IntersectRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Intersect" ); @@ -417,7 +417,7 @@ int DoPolygonBox( PolygonRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" ); @@ -592,7 +592,7 @@ int DoBuildStairsBox( BuildStairsRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" ); @@ -849,7 +849,7 @@ int DoDoorsBox( DoorRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" ); @@ -1063,7 +1063,7 @@ int DoPathPlotterBox( PathPlotterRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" ); @@ -1233,7 +1233,7 @@ int DoCTFColourChangeBox(){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" ); @@ -1303,7 +1303,7 @@ int DoResetTextureBox( ResetTextureRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" ); @@ -1640,7 +1640,7 @@ int DoTrainThingBox( TrainThingRS* rs ){ window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" ); diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 7d75bf76..c8be4fff 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -73,7 +73,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ // create the window window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( window ), "New Camera" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); @@ -365,7 +365,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ // create the window window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); @@ -483,7 +483,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ // create the window window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( window ), "Add Target" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); @@ -830,7 +830,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ // create the window window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( window ), _( "Add Event" ) ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); @@ -996,8 +996,8 @@ GtkWidget *CreateCameraInspectorDialog( void ){ // create the window window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( window ), _( "Camera Inspector" ) ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( ci_close ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( ci_close ), NULL ); + gtk_signal_connect( GTK_OBJECT( window ), "expose-event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); // gtk_signal_connect( GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); @@ -1219,7 +1219,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){ gtk_widget_show( hbox ); g_pTimeLine = GTK_ADJUSTMENT( gtk_adjustment_new( 0, 0, 30000, 100, 250, 0 ) ); - gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL ); + gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value-changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL ); w = gtk_hscale_new( g_pTimeLine ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_widget_show( w ); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index b4151a24..526516cc 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -1361,7 +1361,7 @@ GtkWidget* create_main_dialog(){ g_pWnd = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), gszCaption ); - g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( main_close ), NULL ); + g_signal_connect( G_OBJECT( dlg ), "delete-event", G_CALLBACK( main_close ), NULL ); // g_signal_connect (G_OBJECT (dlg), "destroy", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) ); @@ -1373,7 +1373,7 @@ GtkWidget* create_main_dialog(){ notebook = gtk_notebook_new(); gtk_widget_show( notebook ); gtk_box_pack_start( GTK_BOX( hbox ), notebook, TRUE, TRUE, 0 ); - g_signal_connect( G_OBJECT( notebook ), "switch_page", + g_signal_connect( G_OBJECT( notebook ), "switch-page", G_CALLBACK( switch_page ), NULL ); gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_TOP ); g_object_set_data( G_OBJECT( dlg ), "notebook", notebook ); @@ -1498,7 +1498,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "wavelength", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1507,7 +1507,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "amplitude", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1516,10 +1516,10 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "roughness", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness ); adj = gtk_adjustment_new( 1, 1, 32767, 1, 10, 0 ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( general_random ), NULL ); + g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( general_random ), NULL ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4, @@ -1598,7 +1598,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "hmin", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Hll ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1607,7 +1607,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "hmax", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Hur ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1616,7 +1616,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "vmin", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Vll ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1625,7 +1625,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "vmax", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Vur ); frame = gtk_frame_new( _( "Divisions" ) ); gtk_widget_show( frame ); @@ -1653,7 +1653,7 @@ GtkWidget* create_main_dialog(){ g_object_set_data( G_OBJECT( dlg ), "nv_text", label ); adj = gtk_adjustment_new( 8, 1, MAX_ROWS, 1, 10, 0 ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH ); + g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( extents_nhnv_spin ), &NH ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, @@ -1663,7 +1663,7 @@ GtkWidget* create_main_dialog(){ g_object_set_data( G_OBJECT( dlg ), "nh", spin ); adj = gtk_adjustment_new( 8, 1, MAX_ROWS, 1, 10, 0 ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV ); + g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( extents_nhnv_spin ), &NV ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, @@ -1685,7 +1685,7 @@ GtkWidget* create_main_dialog(){ gtk_object_set_data( GTK_OBJECT( dlg ), "snap_text", label ); adj = gtk_adjustment_new( 8, 0, 256, 1, 10, 0 ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP ); + g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( extents_snaptogrid_spin ), &SP ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 ); @@ -1702,7 +1702,7 @@ GtkWidget* create_main_dialog(){ gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 ); adj = gtk_adjustment_new( 0, 0, 110, 1, 10, 0 ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_decimate ), NULL ); + g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( extents_decimate ), NULL ); g_object_set_data( G_OBJECT( dlg ), "decimate_adj", adj ); scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) ); gtk_widget_show( scale ); @@ -1753,7 +1753,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "z01", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1762,7 +1762,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "z00", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1771,7 +1771,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "z11", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1780,7 +1780,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "z10", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 ); check = gtk_check_button_new_with_label( "Linear borders" ); gtk_widget_show( check ); @@ -1823,7 +1823,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); g_object_set_data( G_OBJECT( dlg ), "bmp_file", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( bitmap_file_entryfocusout ), NULL ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( bitmap_file_entryfocusout ), NULL ); hbox2 = gtk_hbox_new( TRUE, 5 ); gtk_widget_show( hbox2 ); @@ -1881,7 +1881,7 @@ GtkWidget* create_main_dialog(){ gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "bmp_black", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value ); hbox2 = gtk_hbox_new( FALSE, 5 ); gtk_widget_show( hbox2 ); @@ -1894,7 +1894,7 @@ GtkWidget* create_main_dialog(){ gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); gtk_widget_set_usize( entry, 50, -2 ); g_object_set_data( G_OBJECT( dlg ), "bmp_white", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value ); vbox = gtk_vbox_new( FALSE, 10 ); gtk_widget_show( vbox ); @@ -1945,7 +1945,7 @@ GtkWidget* create_main_dialog(){ g_object_set_data( G_OBJECT( dlg ), "fix_rate_text", label ); adj = gtk_adjustment_new( 0, -65536, 65536, 1, 16, 0 ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( fix_value_changed ), NULL ); + g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( fix_value_changed ), NULL ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, @@ -1953,7 +1953,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_EXPAND ), 0, 0 ); gtk_widget_set_usize( spin, 60, -2 ); g_object_set_data( G_OBJECT( dlg ), "fix_value", spin ); - g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( fix_value_entryfocusout ), NULL ); + g_signal_connect( G_OBJECT( spin ), "focus-out-event", G_CALLBACK( fix_value_entryfocusout ), NULL ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1962,7 +1962,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 60, -2 ); g_object_set_data( G_OBJECT( dlg ), "fix_range", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_range_entryfocusout ), NULL ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( fix_range_entryfocusout ), NULL ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -1971,7 +1971,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 60, -2 ); g_object_set_data( G_OBJECT( dlg ), "fix_rate", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( fix_rate_entryfocusout ), NULL ); button = gtk_button_new_with_label( _( "Free" ) ); gtk_widget_show( button ); @@ -2034,7 +2034,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 60, -2 ); g_object_set_data( G_OBJECT( dlg ), "texture1", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) ); entry = gtk_entry_new(); gtk_widget_show( entry ); @@ -2043,7 +2043,7 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); gtk_widget_set_usize( entry, 60, -2 ); g_object_set_data( G_OBJECT( dlg ), "texture2", entry ); - g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) ); + g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) ); entry = gtk_entry_new(); gtk_widget_show( entry ); diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index c48f664a..30682948 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -373,7 +373,7 @@ void CreateViewWindow(){ g_pWndPreview = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), "GtkGenSurf Preview" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( preview_close ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( preview_close ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pWnd ) ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 300, 400 ); @@ -394,14 +394,14 @@ void CreateViewWindow(){ gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 ); adj = gtk_adjustment_new( 30, -90, 90, 1, 10, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); - g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &elevation ); + g_signal_connect( G_OBJECT( spin ), "focus-out-event", G_CALLBACK( doublevariable_spinfocusout ), &elevation ); adj = gtk_adjustment_new( 30, 0, 359, 1, 10, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_widget_show( spin ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); @@ -411,7 +411,7 @@ void CreateViewWindow(){ gtk_widget_show( label ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); gtk_box_pack_end( GTK_BOX( hbox ), label, FALSE, TRUE, 0 ); - g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth ); + g_signal_connect( G_OBJECT( spin ), "focus-out-event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth ); #endif frame = gtk_frame_new( NULL ); @@ -422,9 +422,9 @@ void CreateViewWindow(){ g_pPreviewWidget = g_UIGtkTable.m_pfn_glwidget_new( FALSE, NULL ); gtk_widget_set_events( g_pPreviewWidget, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK ); - gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "expose_event", GTK_SIGNAL_FUNC( expose ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "motion_notify_event", GTK_SIGNAL_FUNC( motion ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "button_press_event", + gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), NULL ); + gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "motion-notify-event", GTK_SIGNAL_FUNC( motion ), NULL ); + gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "button-press-event", GTK_SIGNAL_FUNC( button_press ), NULL ); gtk_widget_show( g_pPreviewWidget ); diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index fcf30580..0fa05a67 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -59,7 +59,7 @@ void DoAboutDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 2f315190..43f20261 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -69,7 +69,7 @@ static int DoColor( COLORREF *c ){ dlg = gtk_color_selection_dialog_new( "Choose Color" ); gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -280,7 +280,7 @@ void DoConfigDialog(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Portal Viewer Configuration" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -314,7 +314,7 @@ void DoConfigDialog(){ lw3label = gtk_label_new( "" ); gtk_widget_show( lw3label ); gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); table = gtk_table_new( 2, 4, FALSE ); gtk_widget_show( table ); @@ -410,7 +410,7 @@ void DoConfigDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 1 ); clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) ); @@ -426,7 +426,7 @@ void DoConfigDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); hbox = gtk_hbox_new( TRUE, 5 ); gtk_widget_show( hbox ); @@ -464,7 +464,7 @@ void DoConfigDialog(){ lw2label = gtk_label_new( "" ); gtk_widget_show( lw2label ); gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); hbox = gtk_hbox_new( FALSE, 5 ); gtk_widget_show( hbox ); diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index 4b25ce50..9586a247 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -75,7 +75,7 @@ static void change_clicked( GtkWidget *widget, gpointer data ){ GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDOK ) ); gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked", GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) ); - gtk_signal_connect( GTK_OBJECT( file_sel ), "delete_event", + gtk_signal_connect( GTK_OBJECT( file_sel ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) ); @@ -105,7 +105,7 @@ int DoLoadPortalFileDialog(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/contrib/prtview/gtkdlgs.cpp b/contrib/prtview/gtkdlgs.cpp index afe1615b..21c6f450 100644 --- a/contrib/prtview/gtkdlgs.cpp +++ b/contrib/prtview/gtkdlgs.cpp @@ -74,7 +74,7 @@ static void change_clicked( GtkWidget *widget, gpointer data ){ GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDOK ) ); gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked", GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) ); - gtk_signal_connect( GTK_OBJECT( file_sel ), "delete_event", + gtk_signal_connect( GTK_OBJECT( file_sel ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) ); @@ -107,7 +107,7 @@ int DoLoadPortalFileDialog(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -200,7 +200,7 @@ void DoAboutDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -254,7 +254,7 @@ static int DoColor( COLORREF *c ){ dlg = gtk_color_selection_dialog_new( "Choose Color" ); gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -465,7 +465,7 @@ void DoConfigDialog(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Portal Viewer Configuration" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -499,7 +499,7 @@ void DoConfigDialog(){ lw3label = gtk_label_new( "" ); gtk_widget_show( lw3label ); gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); table = gtk_table_new( 2, 4, FALSE ); gtk_widget_show( table ); @@ -595,7 +595,7 @@ void DoConfigDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 1 ); clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) ); @@ -611,7 +611,7 @@ void DoConfigDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); hbox = gtk_hbox_new( TRUE, 5 ); gtk_widget_show( hbox ); @@ -649,7 +649,7 @@ void DoConfigDialog(){ lw2label = gtk_label_new( "" ); gtk_widget_show( lw2label ); gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); hbox = gtk_hbox_new( FALSE, 5 ); gtk_widget_show( hbox ); diff --git a/plugins/surface/surfacedialog.cpp b/plugins/surface/surfacedialog.cpp index 857db380..0b418263 100644 --- a/plugins/surface/surfacedialog.cpp +++ b/plugins/surface/surfacedialog.cpp @@ -95,7 +95,7 @@ texdef_t g_old_texdef; // when TRUE, this thing means the surface inspector is currently being displayed bool g_surfwin = FALSE; -// turn on/off processing of the "changed" "value_changed" messages +// turn on/off processing of the "changed" "value-changed" messages // (need to turn off when we are feeding data in) bool g_bListenChanged = true; // turn on/off listening of the update messages @@ -1140,7 +1140,7 @@ GtkWidget* create_SurfaceInspector( void ){ // closing the window (upper right window manager click) g_signal_connect( (gpointer) SurfaceInspector, - "delete_event", + "delete-event", G_CALLBACK( apply_and_hide ), NULL ); @@ -1148,11 +1148,11 @@ GtkWidget* create_SurfaceInspector( void ){ G_CALLBACK( gtk_widget_destroy ), NULL ); - g_signal_connect( (gpointer) texture_combo_entry, "key_press_event", + g_signal_connect( (gpointer) texture_combo_entry, "key-press-event", G_CALLBACK( on_texture_combo_entry_key_press_event ), NULL ); - g_signal_connect( (gpointer) SurfaceInspector, "key_press_event", + g_signal_connect( (gpointer) SurfaceInspector, "key-press-event", G_CALLBACK( surface_dialog_key_press ), NULL ); @@ -1160,35 +1160,35 @@ GtkWidget* create_SurfaceInspector( void ){ G_CALLBACK( on_texture_combo_entry_activate ), NULL ); - g_signal_connect( (gpointer) hshift_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) hshift_value_spinbutton, "value-changed", G_CALLBACK( on_hshift_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vshift_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) vshift_value_spinbutton, "value-changed", G_CALLBACK( on_vshift_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) hscale_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) hscale_value_spinbutton, "value-changed", G_CALLBACK( on_hscale_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vscale_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) vscale_value_spinbutton, "value-changed", G_CALLBACK( on_vscale_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) rotate_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) rotate_value_spinbutton, "value-changed", G_CALLBACK( on_rotate_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) hshift_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) hshift_step_spinbutton, "value-changed", G_CALLBACK( on_hshift_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vshift_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) vshift_step_spinbutton, "value-changed", G_CALLBACK( on_vshift_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) hscale_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) hscale_step_spinbutton, "value-changed", G_CALLBACK( on_hscale_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vscale_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) vscale_step_spinbutton, "value-changed", G_CALLBACK( on_vscale_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) rotate_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) rotate_step_spinbutton, "value-changed", G_CALLBACK( on_rotate_step_spinbutton_value_changed ), NULL ); @@ -1196,10 +1196,10 @@ GtkWidget* create_SurfaceInspector( void ){ G_CALLBACK( on_match_grid_button_clicked ), NULL ); - g_signal_connect( (gpointer) fit_width_spinbutton, "value_changed", + g_signal_connect( (gpointer) fit_width_spinbutton, "value-changed", G_CALLBACK( on_fit_width_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) fit_height_spinbutton, "value_changed", + g_signal_connect( (gpointer) fit_height_spinbutton, "value-changed", G_CALLBACK( on_fit_height_spinbutton_value_changed ), NULL ); g_signal_connect( (gpointer) fit_button, "clicked", diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index e2fa7a89..1d4a98f2 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -73,7 +73,7 @@ char old_texture_entry[128]; // when TRUE, this thing means the surface inspector is currently being displayed bool g_surfwin = FALSE; -// turn on/off processing of the "changed" "value_changed" messages +// turn on/off processing of the "changed" "value-changed" messages // (need to turn off when we are feeding data in) bool g_bListenChanged = TRUE; // turn on/off listening of the update messages @@ -789,52 +789,52 @@ GtkWidget* create_SurfaceInspector( void ){ create_SurfaceFlagsFrame( vbox1 ); g_signal_connect( (gpointer) SurfaceInspector, - "delete_event", + "delete-event", G_CALLBACK( delete_event_callback ), NULL ); g_signal_connect( (gpointer) SurfaceInspector, "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); - g_signal_connect( (gpointer) SurfaceInspector, "key_press_event", + g_signal_connect( (gpointer) SurfaceInspector, "key-press-event", G_CALLBACK( surface_inspector_key_press_event ), NULL ); - g_signal_connect( (gpointer) texture_combo_entry, "key_press_event", + g_signal_connect( (gpointer) texture_combo_entry, "key-press-event", G_CALLBACK( on_texture_combo_entry_key_press_event ), NULL ); g_signal_connect( (gpointer) texture_combo_entry, "activate", G_CALLBACK( on_texture_combo_entry_activate ), NULL ); - g_signal_connect( (gpointer) hshift_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) hshift_value_spinbutton, "value-changed", G_CALLBACK( on_hshift_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vshift_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) vshift_value_spinbutton, "value-changed", G_CALLBACK( on_vshift_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) hscale_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) hscale_value_spinbutton, "value-changed", G_CALLBACK( on_hscale_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vscale_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) vscale_value_spinbutton, "value-changed", G_CALLBACK( on_vscale_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) rotate_value_spinbutton, "value_changed", + g_signal_connect( (gpointer) rotate_value_spinbutton, "value-changed", G_CALLBACK( on_rotate_value_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) hshift_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) hshift_step_spinbutton, "value-changed", G_CALLBACK( on_hshift_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vshift_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) vshift_step_spinbutton, "value-changed", G_CALLBACK( on_vshift_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) hscale_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) hscale_step_spinbutton, "value-changed", G_CALLBACK( on_hscale_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) vscale_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) vscale_step_spinbutton, "value-changed", G_CALLBACK( on_vscale_step_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) rotate_step_spinbutton, "value_changed", + g_signal_connect( (gpointer) rotate_step_spinbutton, "value-changed", G_CALLBACK( on_rotate_step_spinbutton_value_changed ), NULL ); @@ -842,10 +842,10 @@ GtkWidget* create_SurfaceInspector( void ){ G_CALLBACK( on_match_grid_button_clicked ), NULL ); - g_signal_connect( (gpointer) fit_width_spinbutton, "value_changed", + g_signal_connect( (gpointer) fit_width_spinbutton, "value-changed", G_CALLBACK( on_fit_width_spinbutton_value_changed ), NULL ); - g_signal_connect( (gpointer) fit_height_spinbutton, "value_changed", + g_signal_connect( (gpointer) fit_height_spinbutton, "value-changed", G_CALLBACK( on_fit_height_spinbutton_value_changed ), NULL ); g_signal_connect( (gpointer) fit_button, "clicked", diff --git a/plugins/surface_idtech2/surfaceflags.cpp b/plugins/surface_idtech2/surfaceflags.cpp index e8ec68cf..d8d7864c 100644 --- a/plugins/surface_idtech2/surfaceflags.cpp +++ b/plugins/surface_idtech2/surfaceflags.cpp @@ -272,7 +272,7 @@ void on_value_entry_insert_text( GtkEditable *editable, gchar *new_text, gint ne GTK_SIGNAL_FUNC( on_value_entry_insert_text ), user_data ); } - gtk_signal_emit_stop_by_name( GTK_OBJECT( editable ), "insert_text" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( editable ), "insert-text" ); g_free( result ); } @@ -365,7 +365,7 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){ gtk_signal_connect( GTK_OBJECT( value_entry ), "changed", GTK_SIGNAL_FUNC( on_value_entry_changed ), NULL ); - gtk_signal_connect( GTK_OBJECT( value_entry ), "insert_text", + gtk_signal_connect( GTK_OBJECT( value_entry ), "insert-text", GTK_SIGNAL_FUNC( on_value_entry_insert_text ), NULL ); gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 ); diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index ed478628..fa1edc5f 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -55,7 +55,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -641,16 +641,16 @@ static GtkWidget* CreateOpenGLWidget(){ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ); // Connect signal handlers - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose_event", GTK_SIGNAL_FUNC( expose ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion_notify_event", + gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), NULL ); + gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion-notify-event", GTK_SIGNAL_FUNC( motion ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_press_event", + gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button-press-event", GTK_SIGNAL_FUNC( button_press ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_release_event", + gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button-release-event", GTK_SIGNAL_FUNC( button_release ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "delete_event", GTK_SIGNAL_FUNC( close ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "delete-event", GTK_SIGNAL_FUNC( close ), NULL ); + gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "key-press-event", GTK_SIGNAL_FUNC( keypress ), NULL ); return g_pToolWidget; diff --git a/radiant/bp_dlg.cpp b/radiant/bp_dlg.cpp index 13ef1620..e7300802 100644 --- a/radiant/bp_dlg.cpp +++ b/radiant/bp_dlg.cpp @@ -59,7 +59,7 @@ int BP_MessageBox( int status ){ int ret, loop = 1; window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( BP_dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 87df69c1..b7cc9604 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -514,7 +514,7 @@ void CamWnd::ToggleFreeMove(){ // RR2DO2: FIXME why does this only work the 2nd and // further times the event is called? (floating windows // mode seems to work fine though...) - m_FocusOutHandler_id = gtk_signal_connect( GTK_OBJECT( widget ), "focus_out_event", + m_FocusOutHandler_id = gtk_signal_connect( GTK_OBJECT( widget ), "focus-out-event", GTK_SIGNAL_FUNC( camwindow_focusout ), g_pParentWnd ); { diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index e95f5b67..70eb512d 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -81,7 +81,7 @@ static gint delete_event_callback( GtkWidget *widget, GdkEvent* event, gpointer void Dialog::Create(){ if ( m_bNeedBuild ) { m_pWidget = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "delete_event", + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "delete-event", GTK_SIGNAL_FUNC( delete_event_callback ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/radiant/dialoginfo.cpp b/radiant/dialoginfo.cpp index c017cb0f..546815f0 100644 --- a/radiant/dialoginfo.cpp +++ b/radiant/dialoginfo.cpp @@ -41,7 +41,7 @@ void ShowInfoDialog( const char* pText ){ g_dlgInfo = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), "Information" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( gtk_widget_hide ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index b09ce4a7..2145979f 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -146,7 +146,7 @@ void FindTextureDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( entry ), "focus_in_event", + gtk_signal_connect( GTK_OBJECT( entry ), "focus-in-event", GTK_SIGNAL_FUNC( find_focus_in ), NULL ); AddDialogData( entry, &m_strFind, DLG_ENTRY_TEXT ); @@ -167,7 +167,7 @@ void FindTextureDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( entry ), "focus_in_event", + gtk_signal_connect( GTK_OBJECT( entry ), "focus-in-event", GTK_SIGNAL_FUNC( replace_focus_in ), NULL ); AddDialogData( entry, &m_strReplace, DLG_ENTRY_TEXT ); diff --git a/radiant/glwindow.cpp b/radiant/glwindow.cpp index 92679836..3ad6a03b 100644 --- a/radiant/glwindow.cpp +++ b/radiant/glwindow.cpp @@ -215,13 +215,13 @@ GLWindow::GLWindow( bool zbuffer ) { // Connect signal handlers gtk_signal_connect( GTK_OBJECT( m_pWidget ), "realize", GTK_SIGNAL_FUNC( realize ), this ); - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "expose_event", GTK_SIGNAL_FUNC( expose ), this ); - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "motion_notify_event", GTK_SIGNAL_FUNC( motion ), this ); - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_press_event", GTK_SIGNAL_FUNC( button_press ), this ); - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_release_event",GTK_SIGNAL_FUNC( button_release ), this ); - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size_allocate", GTK_SIGNAL_FUNC( resize ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "motion-notify-event", GTK_SIGNAL_FUNC( motion ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button-press-event", GTK_SIGNAL_FUNC( button_press ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button-release-event",GTK_SIGNAL_FUNC( button_release ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size-allocate", GTK_SIGNAL_FUNC( resize ), this ); #if GTK_CHECK_VERSION( 1,3,0 ) - gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll_event", GTK_SIGNAL_FUNC( scroll_event ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll-event", GTK_SIGNAL_FUNC( scroll_event ), this ); #endif } diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index e0f797f7..7816a910 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -1228,9 +1228,9 @@ void GroupDlg::Create(){ load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityWnd ); gtk_window_set_title( GTK_WINDOW( dlg ), "Entities" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( OnDeleteHide ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( OnDeleteHide ), NULL ); // catch 'Esc' - gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "key-press-event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); g_qeglobals_gui.d_entity = dlg; @@ -1283,8 +1283,8 @@ void GroupDlg::Create(){ GtkWidget* view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) ); gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE ); - g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( eclasslist_button_press ), NULL ); - g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( eclasslist_keypress ), this ); + g_signal_connect( G_OBJECT( view ), "button-press-event", G_CALLBACK( eclasslist_button_press ), NULL ); + g_signal_connect( G_OBJECT( view ), "key-press-event", G_CALLBACK( eclasslist_keypress ), this ); { GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); @@ -1411,7 +1411,7 @@ void GroupDlg::Create(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_widget_set_events( entry, GDK_KEY_PRESS_MASK ); - gtk_signal_connect( GTK_OBJECT( entry ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( entry ), "key-press-event", GTK_SIGNAL_FUNC( entityentry_keypress ), this ); EntWidgets[EntKeyField] = entry; } @@ -1423,7 +1423,7 @@ void GroupDlg::Create(){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_widget_set_events( entry, GDK_KEY_PRESS_MASK ); - gtk_signal_connect( GTK_OBJECT( entry ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( entry ), "key-press-event", GTK_SIGNAL_FUNC( entityentry_keypress ), this ); EntWidgets[EntValueField] = entry; } @@ -1628,6 +1628,6 @@ void GroupDlg::Create(){ inspector_mode = W_ENTITY; m_pWidget = dlg; - g_signal_connect( G_OBJECT( notebook ), "switch_page", G_CALLBACK( switch_page ), dlg ); + g_signal_connect( G_OBJECT( notebook ), "switch-page", G_CALLBACK( switch_page ), dlg ); } } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 44778059..501f108d 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -120,7 +120,7 @@ static void DoProjectAddEdit( bool edit, GtkWidget *parent ){ else{ gtk_window_set_title( GTK_WINDOW( dlg ), _( "Add Command" ) ); } - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -469,7 +469,7 @@ void DoProjectSettings(){ project = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( project ), _( "Project Settings" ) ); - gtk_signal_connect( GTK_OBJECT( project ), "delete_event", + gtk_signal_connect( GTK_OBJECT( project ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( project ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -1232,7 +1232,7 @@ void DoMapInfo(){ load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posMapInfoWnd ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Map Info" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -1494,7 +1494,7 @@ void DoEntityList(){ load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityInfoWnd ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Entities" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -1516,7 +1516,7 @@ void DoEntityList(){ GtkTreeStore* store = gtk_tree_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ); GtkWidget* view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) ); - g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( entitylist_click ), dlg ); + g_signal_connect( G_OBJECT( view ), "button-press-event", G_CALLBACK( entitylist_click ), dlg ); gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE ); { @@ -1695,7 +1695,7 @@ void DoRotateDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Arbitrary rotation" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -1806,7 +1806,7 @@ void DoGamma(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Gamma" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2017,7 +2017,7 @@ void DoFind(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Find Brush" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2111,7 +2111,7 @@ void DoSides( bool bCone, bool bSphere, bool bTorus ){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Arbitrary sides" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2183,7 +2183,7 @@ void DoNewPatchDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch density" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2291,7 +2291,7 @@ void DoScaleDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Scale" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2406,7 +2406,7 @@ void DoThickenDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Thicken Patch" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2524,7 +2524,7 @@ void DoAbout(){ gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "About GtkRadiant" ) ); gtk_window_set_resizable( GTK_WINDOW( dlg ), FALSE ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2692,7 +2692,7 @@ void DoCommandListDlg(){ gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Shortcut List" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2831,7 +2831,7 @@ void DoTextureListDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Textures" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -2941,7 +2941,7 @@ int DoCapDlg( int *type, bool *b_GroupResult ){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Cap" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -3084,7 +3084,7 @@ void DoScriptsDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Available Scripts - Not Implemented Yet" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -3231,7 +3231,7 @@ int DoBSInputDlg( const char *fields[5], float values[5] ){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "BrushScript Input" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -3318,7 +3318,7 @@ int DoTextureLayout( float *fx, float *fy ){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch texture layout" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -3423,7 +3423,7 @@ char* DoNameDlg( const char* title ){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), title ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -3501,7 +3501,7 @@ char* DoNewProjectDlg(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "New Project" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -3685,7 +3685,7 @@ static void CreateGtkTextEditor(){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( editor_delete ), NULL ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 600, 300 ); @@ -3899,7 +3899,7 @@ int DoLightIntensityDlg( int *intensity ){ dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Light intensity" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/radiant/gtkfilesel-darwin.c b/radiant/gtkfilesel-darwin.c index 3b588660..7577a389 100644 --- a/radiant/gtkfilesel-darwin.c +++ b/radiant/gtkfilesel-darwin.c @@ -758,9 +758,9 @@ gtk_file_selection_init( GtkFileSelection *filesel ){ gtk_widget_show( label ); filesel->selection_entry = gtk_entry_new(); - gtk_signal_connect( GTK_OBJECT( filesel->selection_entry ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( filesel->selection_entry ), "key-press-event", (GtkSignalFunc) gtk_file_selection_key_press, filesel ); - gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "focus_in_event", + gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "focus-in-event", (GtkSignalFunc) gtk_widget_grab_default, GTK_OBJECT( filesel->ok_button ) ); gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "activate", @@ -1396,7 +1396,7 @@ gtk_file_selection_key_press( GtkWidget *widget, g_free( text ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return TRUE; } @@ -1606,7 +1606,7 @@ gtk_file_selection_history_combo_callback( GtkWidget *widget, GdkEventKey *event strcat( path,"/" ); gtk_file_selection_populate( fs,path,TRUE ); g_free( path ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return TRUE; } else diff --git a/radiant/gtkfilesel-linux.c b/radiant/gtkfilesel-linux.c index da5cbea2..51481100 100644 --- a/radiant/gtkfilesel-linux.c +++ b/radiant/gtkfilesel-linux.c @@ -1362,7 +1362,7 @@ gtk_file_selection_init( GtkFileSelection *filesel ){ gtk_signal_connect( GTK_OBJECT( filesel->dir_list ), "unselect_row", (GtkSignalFunc) gtk_file_selection_undir_button, (gpointer) filesel ); - gtk_signal_connect( GTK_OBJECT( filesel->dir_list ), "button_press_event", + gtk_signal_connect( GTK_OBJECT( filesel->dir_list ), "button-press-event", GTK_SIGNAL_FUNC( gtk_file_selection_show_fileop_menu ), (gpointer) filesel ); @@ -1432,7 +1432,7 @@ gtk_file_selection_init( GtkFileSelection *filesel ){ (GtkSignalFunc) gtk_file_selection_files_list_key_callback, (gpointer) filesel ); - gtk_signal_connect( GTK_OBJECT( filesel->file_list ), "button_press_event", + gtk_signal_connect( GTK_OBJECT( filesel->file_list ), "button-press-event", GTK_SIGNAL_FUNC( gtk_file_selection_show_fileop_menu ), (gpointer) filesel ); @@ -1479,7 +1479,7 @@ gtk_file_selection_init( GtkFileSelection *filesel ){ filesel->selection_entry = gtk_entry_new(); - gtk_signal_connect( GTK_OBJECT( filesel->selection_entry ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( filesel->selection_entry ), "key-press-event", (GtkSignalFunc) gtk_file_selection_key_press, filesel ); gtk_table_attach( GTK_TABLE( table ), filesel->selection_entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), @@ -1527,7 +1527,7 @@ gtk_file_selection_init( GtkFileSelection *filesel ){ filesel->ok_button = gtk_button_new_with_label( _( "OK" ) ); GTK_WIDGET_SET_FLAGS( filesel->ok_button, GTK_CAN_DEFAULT ); gtk_box_pack_start( GTK_BOX( confirm_area ), filesel->ok_button, TRUE, TRUE, 0 ); - gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "focus_in_event", + gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "focus-in-event", (GtkSignalFunc) gtk_widget_grab_default, GTK_OBJECT( filesel->ok_button ) ); gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "activate", @@ -2854,7 +2854,7 @@ gtk_file_selection_key_press( GtkWidget *widget, g_free( text ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return TRUE; } @@ -3064,7 +3064,7 @@ static gint gtk_file_selection_files_list_key_callback( GtkWidget *widget, GdkEv g_print( "complete: %s\n",fs->saved_entry1 ); /* gtk_label_set_text(GTK_LABEL(fs->completion_label),fs->saved_entry1);*/ - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); } else { if ( fs->saved_entry1 ) { @@ -3095,7 +3095,7 @@ static gint gtk_file_selection_mask_entry_key_callback( GtkWidget *widget, GdkEv gtk_file_selection_refresh_button( widget,fs ); if ( event->keyval == GDK_Return ) { - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); } return TRUE; } @@ -3181,7 +3181,7 @@ gtk_file_selection_history_combo_callback( GtkWidget *widget, GdkEventKey *event strcat( path,"/" ); gtk_file_selection_populate( fs,path,TRUE ); g_free( path ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return TRUE; } else diff --git a/radiant/gtkfilesel.c b/radiant/gtkfilesel.c index a75a95b6..06a79f7b 100644 --- a/radiant/gtkfilesel.c +++ b/radiant/gtkfilesel.c @@ -737,9 +737,9 @@ gtk_file_selection_init( GtkFileSelection *filesel ){ gtk_widget_show( label ); filesel->selection_entry = gtk_entry_new(); - gtk_signal_connect( GTK_OBJECT( filesel->selection_entry ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( filesel->selection_entry ), "key-press-event", (GtkSignalFunc) gtk_file_selection_key_press, filesel ); - gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "focus_in_event", + gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "focus-in-event", (GtkSignalFunc) gtk_widget_grab_default, GTK_OBJECT( filesel->ok_button ) ); gtk_signal_connect_object( GTK_OBJECT( filesel->selection_entry ), "activate", @@ -1375,7 +1375,7 @@ gtk_file_selection_key_press( GtkWidget *widget, g_free( text ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return TRUE; } @@ -1585,7 +1585,7 @@ gtk_file_selection_history_combo_callback( GtkWidget *widget, GdkEventKey *event strcat( path,"/" ); gtk_file_selection_populate( fs,path,TRUE ); g_free( path ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return TRUE; } else diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index 215fcd96..53b97f6f 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -889,7 +889,7 @@ int WINAPI gtk_MessageBoxNew( void *parent, const char *message, // create dialog window GtkWidget *dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -1046,7 +1046,7 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); @@ -1668,7 +1668,7 @@ bool WINAPI color_dialog( void *parent, float *color, const char* title ){ dlg = gtk_color_selection_dialog_new( title ); gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9dcaced5..6087570c 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -806,7 +806,7 @@ static gint mainframe_keypress( GtkWidget* widget, GdkEventKey* event, gpointer } if ( ( g_Commands[i].m_nModifiers & 0x7 ) == nState ) { HandleCommand( NULL, GINT_TO_POINTER( g_Commands[i].m_nCommand ) ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); return FALSE; } } @@ -837,7 +837,7 @@ static gint mainframe_keyrelease( GtkWidget* widget, GdkEventKey* event, gpointe case ID_CAMERA_STRAFERIGHT: { HandleKeyUp( NULL, GINT_TO_POINTER( g_Commands[i].m_nCommand ) ); - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_release_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-release-event" ); } } @@ -2060,13 +2060,13 @@ static GtkWidget* create_floating( MainFrame* mainframe ){ if (mainframe->CurrentStyle() != MainFrame::eFloating) gtk_window_set_transient_for( GTK_WINDOW( wnd ), GTK_WINDOW( mainframe->m_pWidget ) ); gtk_widget_set_events( wnd, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK ); - gtk_signal_connect( GTK_OBJECT( wnd ), "delete_event", GTK_SIGNAL_FUNC( widget_delete_hide ), NULL ); + gtk_signal_connect( GTK_OBJECT( wnd ), "delete-event", GTK_SIGNAL_FUNC( widget_delete_hide ), NULL ); gtk_signal_connect( GTK_OBJECT( wnd ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); - gtk_signal_connect( GTK_OBJECT( wnd ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( wnd ), "key-press-event", GTK_SIGNAL_FUNC( mainframe_keypress ), mainframe ); - gtk_signal_connect( GTK_OBJECT( wnd ), "key_release_event", + gtk_signal_connect( GTK_OBJECT( wnd ), "key-release-event", GTK_SIGNAL_FUNC( mainframe_keyrelease ), mainframe ); - gtk_signal_connect( GTK_OBJECT( wnd ), "map_event", + gtk_signal_connect( GTK_OBJECT( wnd ), "map-event", GTK_SIGNAL_FUNC( mainframe_map ), mainframe ); gtk_window_set_default_size( GTK_WINDOW( wnd ), 100, 100 ); @@ -2370,8 +2370,8 @@ GtkWidget* create_framed_texwnd( TexWnd* texwnd ){ w = gtk_entry_new(); gtk_box_pack_start( GTK_BOX( texbox ), w, FALSE, FALSE, 0 ); texwnd->m_pFilter = w; - g_signal_connect( G_OBJECT( w ), "focus_in_event", G_CALLBACK( entry_focus_in ), NULL ); - g_signal_connect( G_OBJECT( w ), "focus_out_event", G_CALLBACK( entry_focus_out ), NULL ); + g_signal_connect( G_OBJECT( w ), "focus-in-event", G_CALLBACK( entry_focus_in ), NULL ); + g_signal_connect( G_OBJECT( w ), "focus-out-event", G_CALLBACK( entry_focus_out ), NULL ); w = texwnd->GetWidget(); gtk_box_pack_start( GTK_BOX( texbox ), w, TRUE, TRUE, 0 ); @@ -2429,17 +2429,17 @@ void MainFrame::Create(){ GtkWidget* window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); m_pWidget = window; gtk_widget_set_events( window, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", + gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( mainframe_delete ), this ); gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( mainframe_destroy ), this ); - gtk_signal_connect( GTK_OBJECT( window ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( window ), "key-press-event", GTK_SIGNAL_FUNC( mainframe_keypress ), this ); - gtk_signal_connect( GTK_OBJECT( window ), "key_release_event", + gtk_signal_connect( GTK_OBJECT( window ), "key-release-event", GTK_SIGNAL_FUNC( mainframe_keyrelease ), this ); - gtk_signal_connect( GTK_OBJECT( window ), "map_event", + gtk_signal_connect( GTK_OBJECT( window ), "map-event", GTK_SIGNAL_FUNC( mainframe_map ), this ); - gtk_signal_connect( GTK_OBJECT( window ), "unmap_event", + gtk_signal_connect( GTK_OBJECT( window ), "unmap-event", GTK_SIGNAL_FUNC( mainframe_unmap ), this ); g_qeglobals_gui.d_main_window = window; diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 7707afbb..044c7484 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -298,9 +298,9 @@ void PatchDialog::BuildDialog(){ load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posPatchWnd ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch Properties" ) ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( OnDone ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( OnDone ), NULL ); // catch 'Esc' and 'Enter' - gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "key-press-event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); @@ -510,7 +510,7 @@ void PatchDialog::BuildDialog(){ gtk_entry_set_text( GTK_ENTRY( entry ), buf ); adj = gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_object_set_data( G_OBJECT( m_pWidget ), "hshift_adj", adj ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); @@ -530,7 +530,7 @@ void PatchDialog::BuildDialog(){ gtk_entry_set_text( GTK_ENTRY( entry ), buf ); adj = gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_object_set_data( G_OBJECT( m_pWidget ), "vshift_adj", adj ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); @@ -550,7 +550,7 @@ void PatchDialog::BuildDialog(){ gtk_entry_set_text( GTK_ENTRY( entry ), buf ); adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_object_set_data( G_OBJECT( m_pWidget ), "hscale_adj", adj ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); @@ -570,7 +570,7 @@ void PatchDialog::BuildDialog(){ gtk_entry_set_text( GTK_ENTRY( entry ), buf ); adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_object_set_data( G_OBJECT( m_pWidget ), "vscale_adj", adj ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); @@ -590,7 +590,7 @@ void PatchDialog::BuildDialog(){ gtk_entry_set_text( GTK_ENTRY( entry ), buf ); adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); + gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_object_set_data( G_OBJECT( m_pWidget ), "rotate_adj", adj ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); diff --git a/radiant/patchdialog.h b/radiant/patchdialog.h index feb70f81..575da7f6 100644 --- a/radiant/patchdialog.h +++ b/radiant/patchdialog.h @@ -69,7 +69,7 @@ GtkWidget *GetWidget() { return m_pWidget; } // 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for // int m_nUndoId; -// turn on/off processing of the "changed" "value_changed" messages +// turn on/off processing of the "changed" "value-changed" messages // (need to turn off when we are feeding data in) // NOTE: much more simple than blocking signals bool m_bListenChanged; diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 08f106fe..b6ec0726 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -51,7 +51,7 @@ texdef_t g_old_texdef; // when != NULL, this thing means the surface inspector is currently being displayed // NOTE a boolean flag would have been more explicit, this is totally so ugly GtkWidget* g_surfwin = NULL; -// turn on/off processing of the "changed" "value_changed" messages +// turn on/off processing of the "changed" "value-changed" messages // (need to turn off when we are feeding data in) bool g_bListenChanged = true; // the struct used to store the increments (saved in registry) @@ -509,9 +509,9 @@ void SurfaceDlg::BuildDialog() { load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posSurfaceWnd ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Surface inspector" ) ); - //g_signal_connect (G_OBJECT (dlg), "delete_event", G_CALLBACK (OnCancel), NULL); + //g_signal_connect (G_OBJECT (dlg), "delete-event", G_CALLBACK (OnCancel), NULL); // we catch 'Enter' and interpret is as OnDone - gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "key-press-event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); // replaced by only the vbox: @@ -529,7 +529,7 @@ void SurfaceDlg::BuildDialog() { gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 ); entry = gtk_entry_new(); - gtk_signal_connect( GTK_OBJECT( entry ), "key_press_event", GTK_SIGNAL_FUNC( OnTextureKey ), NULL ); + gtk_signal_connect( GTK_OBJECT( entry ), "key-press-event", GTK_SIGNAL_FUNC( OnTextureKey ), NULL ); gtk_widget_show( entry ); gtk_box_pack_start( GTK_BOX( hbox2 ), entry, TRUE, TRUE, 0 ); g_object_set_data( G_OBJECT( m_pWidget ), "texture", entry ); @@ -550,7 +550,7 @@ void SurfaceDlg::BuildDialog() { spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 ); g_object_set_data( G_OBJECT( dlg ), "hshift", spin ); - gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value_changed", + gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", GTK_SIGNAL_FUNC( OnUpdate ), NULL ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, @@ -584,7 +584,7 @@ void SurfaceDlg::BuildDialog() { spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 ); g_object_set_data( G_OBJECT( dlg ), "vshift", spin ); - gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value_changed", + gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", GTK_SIGNAL_FUNC( OnUpdate ), NULL ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, @@ -618,7 +618,7 @@ void SurfaceDlg::BuildDialog() { spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 ); g_object_set_data( G_OBJECT( dlg ), "hscale", spin ); - gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value_changed", + gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", GTK_SIGNAL_FUNC( OnUpdate ), NULL ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3, @@ -652,7 +652,7 @@ void SurfaceDlg::BuildDialog() { spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 ); g_object_set_data( G_OBJECT( dlg ), "vscale", spin ); - gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value_changed", + gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", GTK_SIGNAL_FUNC( OnUpdate ), NULL ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4, @@ -686,7 +686,7 @@ void SurfaceDlg::BuildDialog() { spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -360, 360, 1, 10, 0 ) ), 1, 0 ); g_object_set_data( G_OBJECT( dlg ), "rotate", spin ); - gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value_changed", + gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", GTK_SIGNAL_FUNC( OnUpdate ), NULL ); gtk_widget_show( spin ); gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5, diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 87275870..8eb36694 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1662,7 +1662,7 @@ void TexWnd::OnCreate(){ g_nTextureOffset = 0; GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) ); - gtk_signal_connect( GTK_OBJECT( vadjustment ), "value_changed", GTK_SIGNAL_FUNC( vertical_scroll ), this ); + gtk_signal_connect( GTK_OBJECT( vadjustment ), "value-changed", GTK_SIGNAL_FUNC( vertical_scroll ), this ); if ( g_PrefsDlg.m_bTextureScrollbar ) { gtk_widget_show( g_qeglobals_gui.d_texture_scroll ); diff --git a/radiant/ui.cpp b/radiant/ui.cpp index 973f15b7..62446d97 100644 --- a/radiant/ui.cpp +++ b/radiant/ui.cpp @@ -78,7 +78,7 @@ static gint keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){ IWindowListener *pListen = static_cast( data ); ret = pListen->OnKeyPressed( gdk_keyval_name( event->keyval ) ); if ( ret ) { - gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key_press_event" ); + gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); } return ret; } @@ -133,16 +133,16 @@ bool CGtkWindow::Show(){ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ); // Connect signal handlers - gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "expose_event", GTK_SIGNAL_FUNC( expose ), this ); - gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "motion_notify_event", + gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), this ); + gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "motion-notify-event", GTK_SIGNAL_FUNC( motion ), m_pListen ); - gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "button_press_event", + gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "button-press-event", GTK_SIGNAL_FUNC( button_press ), m_pListen ); - gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "button_release_event", + gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "button-release-event", GTK_SIGNAL_FUNC( button_release ), m_pListen ); - gtk_signal_connect( GTK_OBJECT( m_pWnd ), "delete_event", GTK_SIGNAL_FUNC( close_widget ), this ); - gtk_signal_connect( GTK_OBJECT( m_pWnd ), "key_press_event", + gtk_signal_connect( GTK_OBJECT( m_pWnd ), "delete-event", GTK_SIGNAL_FUNC( close_widget ), this ); + gtk_signal_connect( GTK_OBJECT( m_pWnd ), "key-press-event", GTK_SIGNAL_FUNC( keypress ), m_pListen ); gtk_widget_show( m_pGLWidget ); From 22c6fbe2d69e6e5a5461e1812726eebfa8647a3a Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 5 Mar 2017 21:30:35 +0100 Subject: [PATCH 09/15] Fix sleep function --- radiant/mainframe.cpp | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9dcaced5..5a46925e 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -2052,6 +2052,13 @@ static void mainframe_unmap( GtkWidget *widget ){ CHECK_MINIMIZE( g_pGroupDlg->m_pWidget ); } } +static gboolean mainframe_state( GtkWidget *widget, GdkEventWindowState *e, gpointer user_data ){ + + if( e->changed_mask & GDK_WINDOW_STATE_ICONIFIED && !( e->new_window_state & GDK_WINDOW_STATE_ICONIFIED ) ) { + mainframe_map( widget ); + } + return FALSE; +} static GtkWidget* create_floating( MainFrame* mainframe ){ GtkWidget *wnd = gtk_window_new( GTK_WINDOW_TOPLEVEL ); @@ -2441,6 +2448,8 @@ void MainFrame::Create(){ GTK_SIGNAL_FUNC( mainframe_map ), this ); gtk_signal_connect( GTK_OBJECT( window ), "unmap_event", GTK_SIGNAL_FUNC( mainframe_unmap ), this ); + gtk_signal_connect( GTK_OBJECT( window ), "window-state-event", + GTK_SIGNAL_FUNC( mainframe_state ), this ); g_qeglobals_gui.d_main_window = window; @@ -3024,31 +3033,7 @@ static void Sys_Iconify( GtkWidget *w ){ return; } -#if defined ( __linux__ ) || defined ( __APPLE__ ) - Sys_FPrintf( SYS_WRN, "FIXME: Sys_Iconify\n" ); -#if 0 - XWindowAttributes xattr; - GdkWindowPrivate *Private; - - Private = (GdkWindowPrivate*)w->window; - g_object_set_data( G_OBJECT( w ), "was_mapped", GINT_TO_POINTER( 0 ) ); - - if ( !Private->destroyed ) { - xattr.map_state = IsUnmapped; - XGetWindowAttributes( Private->xdisplay, Private->xwindow, &xattr ); - - if ( xattr.map_state != IsUnmapped ) { - g_object_set_data( G_OBJECT( w ), "was_mapped", GINT_TO_POINTER( 1 ) ); - } - - XIconifyWindow( Private->xdisplay, Private->xwindow, 0 ); - } -#endif -#endif - -#ifdef _WIN32 - ShowWindow( (HWND)GDK_WINDOW_HWND( w->window ), SW_MINIMIZE ); -#endif + gtk_window_iconify( GTK_WINDOW( w ) ); } static void Sys_Restore( GtkWidget *w ){ From 287a48d77bc377dbe0fe890d7b5b76df9bef8f7d Mon Sep 17 00:00:00 2001 From: Pan7 Date: Mon, 6 Mar 2017 14:02:48 +0100 Subject: [PATCH 10/15] No Minidump for debug builds --- radiant/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radiant/main.cpp b/radiant/main.cpp index 31b3801a..02eadcb6 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -924,7 +924,7 @@ int mainRadiant( int argc, char* argv[] ) { } -#if defined( _WIN32 ) && defined( _MSC_VER ) +#if defined( _WIN32 ) && defined( _MSC_VER ) && !defined( _DEBUG ) #include #include #include @@ -967,7 +967,7 @@ int GenerateDump( EXCEPTION_POINTERS* pExceptionPointers ) { int main( int argc, char* argv[] ) { -#if defined( _WIN32 ) && defined( _MSC_VER ) +#if defined( _WIN32 ) && defined( _MSC_VER ) && !defined( _DEBUG ) __try { return mainRadiant( argc, argv ); } __except( GenerateDump( GetExceptionInformation() ) ) { From 0ba407b1b15c95ce4962a023407af624996e6bcc Mon Sep 17 00:00:00 2001 From: Pan7 Date: Tue, 7 Mar 2017 08:40:41 +0100 Subject: [PATCH 11/15] Scale dialog, apply on enter key press --- radiant/gtkdlgs.cpp | 77 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 44778059..babdd88c 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -2284,9 +2284,40 @@ void DoNewPatchDlg(){ // ============================================================================= // New Patch dialog +static void scaledlg_apply( GtkWidget *widget, gpointer data ){ + float sx, sy, sz; + GtkWidget *x, *y, *z; + + x = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "x" ) ); + y = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "y" ) ); + z = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "z" ) ); + + sx = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( x ) ); + sy = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( y ) ); + sz = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( z ) ); + + gtk_spin_button_set_value( GTK_SPIN_BUTTON( x ), 1.0f ); + gtk_spin_button_set_value( GTK_SPIN_BUTTON( y ), 1.0f ); + gtk_spin_button_set_value( GTK_SPIN_BUTTON( z ), 1.0f ); + + if ( sx > 0 && sy > 0 && sz > 0 ) { + Select_Scale( sx, sy, sz ); + Sys_UpdateWindows( W_ALL ); + } + else{ + Sys_Printf( _( "Warning.. Tried to scale by a zero value.\n" ) ); + } +} + +static void scaledlg_activate( GtkWidget *widget, gpointer data ){ + GtkWidget *dialog = (GtkWidget *)data; + scaledlg_apply( dialog, dialog ); +} + void DoScaleDlg(){ GtkWidget *dlg, *hbox, *table, *vbox, *label, *button; GtkWidget *x, *y, *z; + GtkObject *adj; int loop = 1, ret = IDCANCEL; dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); @@ -2330,23 +2361,41 @@ void DoScaleDlg(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); - x = gtk_entry_new(); + adj = gtk_adjustment_new( 1.0, 0, 100, 0.1, 1, 0 ); + x = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 0.1, 1 ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( x ), TRUE ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( x ), TRUE ); gtk_widget_show( x ); gtk_table_attach( GTK_TABLE( table ), x, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + g_object_set_data( G_OBJECT( dlg ), "x", x ); + g_signal_connect_after( x, "activate", G_CALLBACK( scaledlg_activate ), dlg ); + g_object_set( x, "xalign", 1.0, NULL ); //right align numbers - y = gtk_entry_new(); + adj = gtk_adjustment_new( 1.0, 0, 100, 0.1, 1, 0 ); + y = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 0.1, 1 ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( y ), TRUE ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( y ), TRUE ); gtk_widget_show( y ); gtk_table_attach( GTK_TABLE( table ), y, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + g_object_set_data( G_OBJECT( dlg ), "y", y ); + g_signal_connect_after( y, "activate", G_CALLBACK( scaledlg_activate ), dlg ); + g_object_set( y, "xalign", 1.0, NULL ); //right align numbers - z = gtk_entry_new(); + adj = gtk_adjustment_new( 1.0, 0, 100, 0.1, 1, 0 ); + z = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 0.1, 1 ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( z ), TRUE ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( z ), TRUE ); gtk_widget_show( z ); gtk_table_attach( GTK_TABLE( table ), z, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + g_object_set_data( G_OBJECT( dlg ), "z", z ); + g_signal_connect_after( z, "activate", G_CALLBACK( scaledlg_activate ), dlg ); + g_object_set( z, "xalign", 1.0, NULL ); //right align numbers vbox = gtk_vbox_new( FALSE, 5 ); gtk_widget_show( vbox ); @@ -2365,10 +2414,11 @@ void DoScaleDlg(){ gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); - // Initialize dialog - gtk_entry_set_text( GTK_ENTRY( x ), _( "1.0" ) ); - gtk_entry_set_text( GTK_ENTRY( y ), _( "1.0" ) ); - gtk_entry_set_text( GTK_ENTRY( z ), _( "1.0" ) ); + button = gtk_button_new_with_label( _( "Apply" ) ); + gtk_widget_show( button ); + gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( button ), "clicked", + GTK_SIGNAL_FUNC( scaledlg_apply ), dlg ); gtk_grab_add( dlg ); gtk_widget_show( dlg ); @@ -2377,18 +2427,7 @@ void DoScaleDlg(){ gtk_main_iteration(); if ( ret == IDOK ) { - float sx, sy, sz; - sx = atof( gtk_entry_get_text( GTK_ENTRY( x ) ) ); - sy = atof( gtk_entry_get_text( GTK_ENTRY( y ) ) ); - sz = atof( gtk_entry_get_text( GTK_ENTRY( z ) ) ); - - if ( sx > 0 && sy > 0 && sz > 0 ) { - Select_Scale( sx, sy, sz ); - Sys_UpdateWindows( W_ALL ); - } - else{ - Sys_Printf( "Warning.. Tried to scale by a zero value." ); - } + scaledlg_apply( dlg, dlg ); } gtk_grab_remove( dlg ); From 30286e10a1d68d607a8ef69012e5223c8f15857a Mon Sep 17 00:00:00 2001 From: Pan7 Date: Tue, 7 Mar 2017 08:51:12 +0100 Subject: [PATCH 12/15] Arbitrary rotation, apply on enter key press --- radiant/gtkdlgs.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 44778059..d31ee529 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -1687,6 +1687,11 @@ static void rotatedlg_apply( GtkWidget *widget, gpointer data ){ gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), 0.0f ); } +static void rotatedialog_activate( GtkWidget *widget, gpointer data ){ + GtkWidget *dialog = (GtkWidget *)data; + rotatedlg_apply( dialog, dialog ); +} + void DoRotateDlg(){ GtkWidget *dlg, *hbox, *vbox, *table, *label, *button; GtkWidget *x, *y, *z; @@ -1734,6 +1739,7 @@ void DoRotateDlg(){ adj = gtk_adjustment_new( 0, -359, 359, 1, 10, 0 ); x = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( x ), TRUE ); g_object_set_data( G_OBJECT( dlg ), "x", x ); gtk_widget_show( x ); gtk_table_attach( GTK_TABLE( table ), x, 1, 2, 0, 1, @@ -1741,24 +1747,32 @@ void DoRotateDlg(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_widget_set_usize( x, 60, -2 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( x ), TRUE ); + g_signal_connect_after( x, "activate", G_CALLBACK( rotatedialog_activate ), dlg ); + g_object_set( x, "xalign", 1.0, NULL ); //right align numbers adj = gtk_adjustment_new( 0, -359, 359, 1, 10, 0 ); y = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( y ), TRUE ); g_object_set_data( G_OBJECT( dlg ), "y", y ); gtk_widget_show( y ); gtk_table_attach( GTK_TABLE( table ), y, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( y ), TRUE ); + g_signal_connect_after( y, "activate", G_CALLBACK( rotatedialog_activate ), dlg ); + g_object_set( y, "xalign", 1.0, NULL ); //right align numbers adj = gtk_adjustment_new( 0, -359, 359, 1, 10, 0 ); z = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( z ), TRUE ); g_object_set_data( G_OBJECT( dlg ), "z", z ); gtk_widget_show( z ); gtk_table_attach( GTK_TABLE( table ), z, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( z ), TRUE ); + g_signal_connect_after( z, "activate", G_CALLBACK( rotatedialog_activate ), dlg ); + g_object_set( z, "xalign", 1.0, NULL ); //right align numbers vbox = gtk_vbox_new( FALSE, 5 ); gtk_widget_show( vbox ); From 5414eba3e98cb3bfa82ea74e94e81b0d0aafceae Mon Sep 17 00:00:00 2001 From: Pan7 Date: Wed, 8 Mar 2017 21:52:06 +0100 Subject: [PATCH 13/15] F1 key binding for help --- radiant/mainframe.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9dcaced5..5a59feda 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -297,6 +297,7 @@ SCommandInfo g_Commands[] = {"LoadPointfile", 'L', RAD_SHIFT, ID_FILE_POINTFILE, "menu_load_pointfile"}, {"TextureWindowScaledown", GDK_Insert, RAD_ALT, ID_TEXTUREWINDOW_SCALEDOWN, "menu_texturewindow_scaledown"}, {"TextureWindowScaleup", GDK_Delete, RAD_ALT, ID_TEXTUREWINDOW_SCALEUP, "menu_texturewindow_scaleup"}, + {"Help", GDK_KEY_F1, 0, ID_HELP, "menu_help"}, }; int g_nCommandCount = sizeof( g_Commands ) / sizeof( SCommandInfo ); @@ -1595,7 +1596,8 @@ void MainFrame::create_main_menu( GtkWidget *window, GtkWidget *vbox ){ item = create_menu_item_with_mnemonic( menu, _( "GtkRadiant Manual" ), GTK_SIGNAL_FUNC( HandleCommand ), ID_HELP ); - gtk_widget_add_accelerator( item, "activate", accel, GDK_F1, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + // does not work, using g_Commands for the key binding + //gtk_widget_add_accelerator( item, "activate", accel, GDK_F1, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); // this creates all the per-game drop downs for the game pack helps // it will take care of hooking the Sys_OpenURL calls etc. From 3ebb7df7a5102e5a987f4e1d46d4c6b47068ee65 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Thu, 9 Mar 2017 08:50:45 +0100 Subject: [PATCH 14/15] Beep save option --- radiant/map.cpp | 5 +++-- radiant/preferences.cpp | 8 ++++++++ radiant/preferences.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/radiant/map.cpp b/radiant/map.cpp index ce91b89d..865e3de3 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -814,8 +814,9 @@ void Map_SaveFile( const char *filename, qboolean use_region ){ time( &timer ); - Sys_Beep(); - + if( g_PrefsDlg.m_bSaveBeep ) { + Sys_Beep(); + } Sys_Status( "Saved.", 0 ); } } diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 31432b3e..d6e85e41 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -64,6 +64,7 @@ #define VERTEX_KEY "NewVertex" #define AUTOSAVE_KEY "Autosave" #define AUTOSAVETIME_KEY "AutosaveMinutes" +#define SAVEBEEP_KEY "SaveBeep" #define PAK_KEY "UsePAK" #define NEWAPPLY_KEY "ApplyDismissesSurface" #define HACK_KEY "Gatewayescapehack" @@ -587,6 +588,7 @@ PrefsDlg::PrefsDlg (){ m_bSetGame = FALSE; m_bAutoSave = TRUE; m_nAutoSave = 5; + m_bSaveBeep = TRUE; m_bLoadLastMap = FALSE; m_bTextureWindow = FALSE; m_bSnapShots = FALSE; @@ -2462,6 +2464,11 @@ void PrefsDlg::BuildDialog(){ gtk_widget_show( label ); gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 ); + check = gtk_check_button_new_with_label( _( "Beep on save" ) ); + gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); + gtk_widget_show( check ); + AddDialogData( check, &m_bSaveBeep, DLG_CHECK_BOOL ); + // Add the page to the notebook gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel ); @@ -2949,6 +2956,7 @@ void PrefsDlg::LoadPrefs(){ mLocalPrefs.GetPref( TINYBRUSH_KEY, &m_bCleanTiny, FALSE ); mLocalPrefs.GetPref( TINYSIZE_KEY, &m_fTinySize, 0.5f ); mLocalPrefs.GetPref( AUTOSAVETIME_KEY, &m_nAutoSave, 5 ); + mLocalPrefs.GetPref( SAVEBEEP_KEY, &m_bSaveBeep, TRUE ); mLocalPrefs.GetPref( SNAPSHOT_KEY, &m_bSnapShots, FALSE ); mLocalPrefs.GetPref( MOVESPEED_KEY, &m_nMoveSpeed, 100 ); mLocalPrefs.GetPref( ANGLESPEED_KEY, &m_nAngleSpeed, 3 ); diff --git a/radiant/preferences.h b/radiant/preferences.h index 2e7dd05f..5785c68f 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -589,6 +589,7 @@ bool m_bInternalBSP; bool m_bRightClick; bool m_bSetGame; bool m_bAutoSave; +bool m_bSaveBeep; bool m_bLoadLastMap; bool m_bTextureWindow; bool m_bSnapShots; From 9f22a81a64262b5c165cd2b79fdafd834e74237b Mon Sep 17 00:00:00 2001 From: Pan7 Date: Fri, 10 Mar 2017 22:44:05 +0100 Subject: [PATCH 15/15] gtk improvements --- contrib/camera/dialogs.cpp | 33 ++++++++++--------- plugins/surface/surfacedialog.cpp | 32 ++++++++++++------ plugins/surface_idtech2/surfacedialog.cpp | 22 ++++++++++--- plugins/surface_idtech2/surfaceflags.cpp | 8 ++--- radiant/camwindow.cpp | 2 +- radiant/dialog.cpp | 12 +++---- radiant/findtexturedialog.cpp | 4 +-- radiant/glwindow.cpp | 2 +- radiant/groupdialog.cpp | 4 +-- radiant/gtkmisc.cpp | 6 ++-- radiant/mainframe.cpp | 16 ++++----- radiant/pluginentities.cpp | 2 +- radiant/preferences.cpp | 2 +- radiant/surfacedialog.cpp | 40 +++++++++++------------ radiant/texwindow.cpp | 14 ++++---- radiant/xywindow.cpp | 2 +- 16 files changed, 113 insertions(+), 88 deletions(-) diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 7d75bf76..2b7b2a28 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -107,17 +107,17 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" ); gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 ); gtk_widget_show( fixed ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) ); interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" ); gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 ); gtk_widget_show( interpolated ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) ); spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" ); gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 ); gtk_widget_show( spline ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) ); // -------------------------- // @@ -228,7 +228,7 @@ static gint ci_apply( GtkWidget *widget, gpointer data ){ gtk_label_set_text( g_pTotalTime, buf ); gtk_adjustment_set_value( g_pTimeLine, 0.f ); - g_pTimeLine->upper = GetCurrentCam()->GetCam()->getTotalTime() * 1000; + gtk_adjustment_set_upper( g_pTimeLine, GetCurrentCam()->GetCam()->getTotalTime() * 1000 ); GetCurrentCam()->HasBeenModified(); } @@ -348,7 +348,7 @@ static void RefreshEventList( void ){ gtk_label_set_text( g_pTotalTime, buf ); gtk_adjustment_set_value( g_pTimeLine, 0.f ); - g_pTimeLine->upper = ( GetCurrentCam()->GetCam()->getTotalTime() * 1000 ); + gtk_adjustment_set_upper( g_pTimeLine, ( GetCurrentCam()->GetCam()->getTotalTime() * 1000 ) ); } gtk_clist_thaw( GTK_CLIST( g_pEventsList ) ); @@ -534,17 +534,17 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ fixed = gtk_radio_button_new_with_label( targetTypeRadio, _( "Fixed" ) ); gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 ); gtk_widget_show( fixed ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) ); interpolated = gtk_radio_button_new_with_label( targetTypeRadio, _( "Interpolated" ) ); gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 ); gtk_widget_show( interpolated ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) ); spline = gtk_radio_button_new_with_label( targetTypeRadio, _( "Spline" ) ); gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 ); gtk_widget_show( spline ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) ); // -------------------------- // @@ -729,7 +729,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){ gtk_label_set_text( g_pTotalTime, buf ); gtk_adjustment_set_value( g_pTimeLine, 0.f ); - g_pTimeLine->upper = GetCurrentCam()->GetCam()->getTotalTime() * 1000; + gtk_adjustment_set_upper( g_pTimeLine, GetCurrentCam()->GetCam()->getTotalTime() * 1000 ); } else { // Set Name @@ -745,7 +745,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){ gtk_label_set_text( g_pTotalTime, "30.00" ); gtk_adjustment_set_value( g_pTimeLine, 0.f ); - g_pTimeLine->upper = 30000; + gtk_adjustment_set_upper( g_pTimeLine, 30000 ); } // Refresh event list @@ -865,7 +865,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ eventWidget[i] = gtk_radio_button_new_with_label( eventTypeRadio, camEventStr[i] ); gtk_box_pack_start( GTK_BOX( vbox2 ), eventWidget[i], FALSE, FALSE, 3 ); gtk_widget_show( eventWidget[i] ); - eventTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( eventWidget[i] ) ); + eventTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( eventWidget[i] ) ); if ( camEventFlags[i][1] == false ) { gtk_widget_set_sensitive( eventWidget[i], FALSE ); } @@ -939,7 +939,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ } // Add the event - GetCurrentCam()->GetCam()->addEvent( static_cast( type ), str, (long)( g_pTimeLine->value ) ); + GetCurrentCam()->GetCam()->addEvent( static_cast( type ), str, (long)( gtk_adjustment_get_value( g_pTimeLine ) ) ); // Refresh event list RefreshEventList(); @@ -970,7 +970,7 @@ static gint ci_del( GtkWidget *widget, gpointer data ){ static gint ci_timeline_changed( GtkAdjustment *adjustment ){ char buf[128]; - sprintf( buf, "%.2f", adjustment->value / 1000.f ); + sprintf( buf, "%.2f", gtk_adjustment_get_value( adjustment ) / 1000.f ); gtk_label_set_text( g_pCurrentTime, buf ); // FIXME: this will never work completely perfect. Startcamera calls buildcamera, which sets all events to 'nottriggered'. @@ -982,7 +982,7 @@ static gint ci_timeline_changed( GtkAdjustment *adjustment ){ GetCurrentCam()->GetCam()->startCamera( 0 ); - GetCurrentCam()->GetCam()->getCameraInfo( (long)( adjustment->value ), &origin[0], &dir[0], &fov ); + GetCurrentCam()->GetCam()->getCameraInfo( (long)( gtk_adjustment_get_value( adjustment ) ), &origin[0], &dir[0], &fov ); VectorSet( angles, asin( dir[2] ) * 180 / 3.14159, atan2( dir[1], dir[0] ) * 180 / 3.14159, 0 ); g_CameraTable.m_pfnSetCamera( origin, angles ); } @@ -1108,14 +1108,14 @@ GtkWidget *CreateCameraInspectorDialog( void ){ g_pEditModeEditRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, _( "Edit Points" ) ); gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeEditRadioButton, FALSE, FALSE, 3 ); gtk_widget_show( g_pEditModeEditRadioButton ); - g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) ); + g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) ); gtk_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_edit ), NULL ); g_pEditModeAddRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, _( "Add Points" ) ); gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeAddRadioButton, FALSE, FALSE, 3 ); gtk_widget_show( g_pEditModeAddRadioButton ); - g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) ); + g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) ); gtk_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_add ), NULL ); @@ -1186,6 +1186,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){ g_pSecondsEntry = gtk_entry_new(); gtk_box_pack_start( GTK_BOX( hbox ), g_pSecondsEntry, FALSE, FALSE, 0 ); + g_object_set( g_pSecondsEntry, "xalign", 1.0, NULL ); gtk_widget_show( g_pSecondsEntry ); // -------------------------- // diff --git a/plugins/surface/surfacedialog.cpp b/plugins/surface/surfacedialog.cpp index 857db380..761841d4 100644 --- a/plugins/surface/surfacedialog.cpp +++ b/plugins/surface/surfacedialog.cpp @@ -548,31 +548,31 @@ void SetTexMods(){ spin = GTK_SPIN_BUTTON( hshift_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->shift[0]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] ); spin = GTK_SPIN_BUTTON( hshift_step_spinbutton ); gtk_spin_button_set_value( spin, l_pIncrement->shift[0] ); spin = GTK_SPIN_BUTTON( vshift_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->shift[1]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] ); spin = GTK_SPIN_BUTTON( vshift_step_spinbutton ); gtk_spin_button_set_value( spin, l_pIncrement->shift[1] ); spin = GTK_SPIN_BUTTON( hscale_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->scale[0]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] ); spin = GTK_SPIN_BUTTON( hscale_step_spinbutton ); gtk_spin_button_set_value( spin, l_pIncrement->scale[0] ); spin = GTK_SPIN_BUTTON( vscale_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->scale[1]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] ); spin = GTK_SPIN_BUTTON( vscale_step_spinbutton ); gtk_spin_button_set_value( spin, l_pIncrement->scale[1] ); spin = GTK_SPIN_BUTTON( rotate_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->rotate; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate ); spin = GTK_SPIN_BUTTON( rotate_step_spinbutton ); gtk_spin_button_set_value( spin, l_pIncrement->rotate ); @@ -936,6 +936,7 @@ GtkWidget* create_SurfaceInspector( void ){ gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), TRUE ); + g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL ); vshift_value_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ); vshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vshift_value_spinbutton_adj ), 1, 2 ); @@ -946,6 +947,7 @@ GtkWidget* create_SurfaceInspector( void ){ gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), TRUE ); + g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL ); hscale_value_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); hscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( hscale_value_spinbutton_adj ), 1, 4 ); @@ -956,6 +958,7 @@ GtkWidget* create_SurfaceInspector( void ){ gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), TRUE ); + g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL ); vscale_value_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); vscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vscale_value_spinbutton_adj ), 1, 4 ); @@ -966,6 +969,7 @@ GtkWidget* create_SurfaceInspector( void ){ gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vscale_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), TRUE ); + g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL ); rotate_value_spinbutton_adj = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 ); rotate_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( rotate_value_spinbutton_adj ), 1, 4 ); @@ -976,6 +980,7 @@ GtkWidget* create_SurfaceInspector( void ){ gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), TRUE ); + g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL ); // Step Spins hshift_step_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ); @@ -985,6 +990,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL ); vshift_step_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ); vshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vshift_step_spinbutton_adj ), 1, 2 ); @@ -993,6 +999,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL ); hscale_step_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); hscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( hscale_step_spinbutton_adj ), 1, 4 ); @@ -1001,6 +1008,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL ); vscale_step_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); vscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vscale_step_spinbutton_adj ), 1, 4 ); @@ -1009,6 +1017,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL ); rotate_step_spinbutton_adj = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 ); rotate_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( rotate_step_spinbutton_adj ), 1, 4 ); @@ -1017,6 +1026,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL ); eventbox = gtk_event_box_new(); gtk_widget_show( eventbox ); @@ -1084,6 +1094,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_width_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_width_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL ); fit_height_spinbutton_adj = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ); fit_height_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( fit_height_spinbutton_adj ), 1, 0 ); @@ -1093,6 +1104,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_FILL ), 3, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_height_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_height_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL ); eventbox = gtk_event_box_new(); gtk_widget_show( eventbox ); @@ -1385,7 +1397,7 @@ static void on_hshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hshift_step_spinbutton ) ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hshift_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->shift[0] = val; } @@ -1405,7 +1417,7 @@ static void on_vshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vshift_step_spinbutton ) ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vshift_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->shift[1] = val; } @@ -1425,7 +1437,7 @@ static void on_hscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hscale_step_spinbutton ) ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hscale_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->scale[0] = val; } @@ -1445,7 +1457,7 @@ static void on_vscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vscale_step_spinbutton ) ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vscale_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->scale[1] = val; } @@ -1465,7 +1477,7 @@ static void on_rotate_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( rotate_step_spinbutton ) ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( rotate_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->rotate = val; } diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index e2fa7a89..8ea8e9a9 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -643,6 +643,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE ); + g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ); vshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 ); @@ -652,6 +653,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE ); + g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); hscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 ); @@ -661,6 +663,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE ); + g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); vscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 ); @@ -669,6 +672,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 ); rotate_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 ); @@ -678,6 +682,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE ); + g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL ); // Step Spins adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ); @@ -687,6 +692,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ); vshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 ); @@ -695,6 +701,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); hscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 ); @@ -703,6 +710,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ); vscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 ); @@ -711,6 +719,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 ); rotate_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 ); @@ -719,6 +728,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL ); match_grid_button = gtk_button_new_with_mnemonic( "Match Grid" ); gtk_widget_show( match_grid_button ); @@ -763,6 +773,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_height_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_height_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL ); adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ); fit_width_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 0 ); @@ -772,6 +783,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_width_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_width_spinbutton ), GTK_UPDATE_IF_VALID ); + g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL ); fit_button = gtk_button_new_with_mnemonic( "Fit" ); gtk_widget_show( fit_button ); @@ -1035,7 +1047,7 @@ static void on_hshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hshift_step_spinbutton ) ) ; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hshift_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->shift[0] = val; } @@ -1055,7 +1067,7 @@ static void on_vshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vshift_step_spinbutton ) ) ; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vshift_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->shift[1] = val; } @@ -1075,7 +1087,7 @@ static void on_hscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hscale_step_spinbutton ) ) ; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hscale_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->scale[0] = val; } @@ -1095,7 +1107,7 @@ static void on_vscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vscale_step_spinbutton ) ) ; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vscale_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->scale[1] = val; } @@ -1115,7 +1127,7 @@ static void on_rotate_step_spinbutton_value_changed( GtkSpinButton *spinbutton, val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( rotate_step_spinbutton ) ) ; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( rotate_value_spinbutton ) ); - adjust->step_increment = val; + gtk_adjustment_set_step_increment( adjust, val ); l_pIncrement->rotate = val; } diff --git a/plugins/surface_idtech2/surfaceflags.cpp b/plugins/surface_idtech2/surfaceflags.cpp index e8ec68cf..3b68cd72 100644 --- a/plugins/surface_idtech2/surfaceflags.cpp +++ b/plugins/surface_idtech2/surfaceflags.cpp @@ -231,13 +231,13 @@ inline void change_contentflag( GtkWidget *togglebutton, int content_flag, gbool // Surface Flags Callbacks void on_surface_button_toggled( GtkToggleButton *togglebutton, gpointer user_data ){ int flag = GPOINTER_TO_INT( user_data ); - change_surfaceflag( GTK_WIDGET( togglebutton ), flag, ( GTK_TOGGLE_BUTTON( togglebutton )->active ) ); + change_surfaceflag( GTK_WIDGET( togglebutton ), flag, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( togglebutton ) ) ); } // Content Flags Callbacks void on_content_button_toggled( GtkToggleButton *togglebutton, gpointer user_data ){ int flag = GPOINTER_TO_INT( user_data ); - change_contentflag( GTK_WIDGET( togglebutton ), flag, ( GTK_TOGGLE_BUTTON( togglebutton )->active ) ); + change_contentflag( GTK_WIDGET( togglebutton ), flag, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( togglebutton ) ) ); } // Value Entry Callback @@ -278,11 +278,11 @@ void on_value_entry_insert_text( GtkEditable *editable, gchar *new_text, gint ne } void on_surfacebutton_clicked( GtkButton *button, gpointer user_data ){ - gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 0 ); + gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook1 ), 0 ); } void on_contentbutton_clicked( GtkButton *button, gpointer user_data ){ - gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 1 ); + gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook1 ), 1 ); } #define IDTECH2_FLAG_BUTTON_BORDER 3 diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 87df69c1..06ff96f5 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -57,7 +57,7 @@ CamWnd::~CamWnd (){ void CamWnd::OnCreate(){ if ( !MakeCurrent() ) { - Error( "glMakeCurrent failed" ); + Error( "camwindow: glMakeCurrent failed" ); } // report OpenGL information diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index e95f5b67..b9bfea9a 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -133,7 +133,7 @@ void Dialog::UpdateData( bool retrieve ){ break; case DLG_RADIO_INT: { - GSList *radio = gtk_radio_button_group( GTK_RADIO_BUTTON( data->object ) ); + GSList *radio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( data->object ) ); *(int*)data->buffer = g_slist_length( radio ) - 1; for (; radio; radio = g_slist_next( radio ) ) if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio->data ) ) ) { @@ -158,13 +158,13 @@ void Dialog::UpdateData( bool retrieve ){ *(int*)data->buffer = atoi( gtk_entry_get_text( GTK_ENTRY( data->object ) ) ); break; case DLG_SPIN_FLOAT: - *(float*)data->buffer = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( data->object ) ); + *(float*)data->buffer = gtk_spin_button_get_value( GTK_SPIN_BUTTON( data->object ) ); break; case DLG_SPIN_INT: *(int*)data->buffer = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( data->object ) ); break; case DLG_ADJ_INT: - *(int*)data->buffer = (int) GTK_ADJUSTMENT( data->object )->value; + *(int*)data->buffer = (int) gtk_adjustment_get_value( GTK_ADJUSTMENT( data->object ) ); break; case DLG_COMBO_INT: { @@ -178,7 +178,7 @@ void Dialog::UpdateData( bool retrieve ){ for ( i = 0; lst != NULL; lst = g_list_next( lst ) ) { - gtk_label_get( GTK_LABEL( GTK_BIN( lst->data )->child ), &label ); + label = gtk_label_get_text( GTK_LABEL( lst->data ) ); if ( strcmp( label, entry ) == 0 ) { *(int*)data->buffer = i; @@ -209,7 +209,7 @@ void Dialog::UpdateData( bool retrieve ){ break; case DLG_RADIO_INT: { - GSList *radio = gtk_radio_button_group( GTK_RADIO_BUTTON( data->object ) ); + GSList *radio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( data->object ) ); gpointer btn = g_slist_nth_data( radio, g_slist_length( radio ) - ( *(int*)data->buffer ) - 1 ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( btn ), TRUE ); } break; @@ -244,7 +244,7 @@ void Dialog::UpdateData( bool retrieve ){ if ( *(int*)data->buffer != -1 ) { lst = g_list_nth( lst, *(int*)data->buffer ); if ( lst != NULL ) { - gtk_label_get( GTK_LABEL( GTK_BIN( lst->data )->child ), &entry ); + entry = gtk_label_get_text( GTK_LABEL( lst->data ) ); } } if ( entry ) { diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index b09ce4a7..c0b30a39 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -57,9 +57,9 @@ static void OnClose( GtkWidget *widget, gpointer data ){ } static void popup_selected( GtkWidget *widget, gpointer data ){ - gchar *str; + const gchar *str; - gtk_label_get( GTK_LABEL( GTK_BIN( widget )->child ), &str ); + str = gtk_label_get_text( GTK_LABEL( widget ) ); gtk_entry_set_text( GTK_ENTRY( data ), str ); } diff --git a/radiant/glwindow.cpp b/radiant/glwindow.cpp index 92679836..213f40e8 100644 --- a/radiant/glwindow.cpp +++ b/radiant/glwindow.cpp @@ -195,7 +195,7 @@ GLWindow::GLWindow( bool zbuffer ) { m_pParent = NULL; m_pWidget = gtk_glwidget_new( zbuffer, g_qeglobals_gui.d_glBase ); - GTK_WIDGET_SET_FLAGS( m_pWidget, GTK_CAN_FOCUS ); + gtk_widget_set_can_focus( m_pWidget, TRUE ); #ifdef DBG_GLWINDOW Sys_Printf( "GLWindow::GLWindow m_pWidget = %p\n", m_pWidget ); diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index e0f797f7..f604b1e3 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -1116,8 +1116,8 @@ static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointe } static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){ - char *text; - gtk_label_get( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ), &text ); + const gchar *text; + text = gtk_label_get_text( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ) ); gtk_window_set_title( GTK_WINDOW( data ), text ); gpointer item = g_object_get_data( G_OBJECT( g_pParentWnd->m_pWidget ), "menu_misc_selectentitycolor" ); diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index 215fcd96..f11d667c 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -801,10 +801,10 @@ GtkWidget* create_radio_menu_item_with_mnemonic( GtkWidget *menu, GtkWidget *las GSList *group = (GSList*)NULL; if ( last != NULL ) { - group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( last ) ); + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM( last ) ); } item = gtk_radio_menu_item_new_with_mnemonic( group, mnemonic ); - gtk_check_menu_item_set_state( GTK_CHECK_MENU_ITEM( item ), state ); + gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), state ); gtk_widget_show( item ); gtk_container_add( GTK_CONTAINER( menu ), item ); @@ -865,7 +865,7 @@ static GtkWidget * gtk_AddDlgButton( GtkWidget *container, const char *label, gtk_box_pack_start( GTK_BOX( container ), btn, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( btn ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( clickSignal ) ); - GTK_WIDGET_SET_FLAGS( btn, GTK_CAN_DEFAULT ); + gtk_widget_set_can_default( btn, TRUE ); if( setGrabDefault ) gtk_widget_grab_default( btn ); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9dcaced5..1ce34698 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3274,7 +3274,7 @@ void MainFrame::OnDelete(){ save_window_pos( m_pZWnd->m_pParent, g_PrefsDlg.mWindowInfo.posZWnd ); } else{ - g_PrefsDlg.mWindowInfo.nZFloatWidth = GTK_PANED( m_pSplits[0] )->child1_size; + g_PrefsDlg.mWindowInfo.nZFloatWidth = gtk_paned_get_position( GTK_PANED( m_pSplits[0] ) ); } if ( CurrentStyle() == eFloating ) { @@ -3311,9 +3311,9 @@ void MainFrame::OnDestroy(){ gpointer w; w = g_object_get_data( G_OBJECT( g_pGroupDlg->m_pWidget ), "split1" ); - g_PrefsDlg.mWindowInfo.nEntitySplit1 = GTK_PANED( w )->child1_size; + g_PrefsDlg.mWindowInfo.nEntitySplit1 = gtk_paned_get_position( GTK_PANED( w ) ); w = g_object_get_data( G_OBJECT( g_pGroupDlg->m_pWidget ), "split2" ); - g_PrefsDlg.mWindowInfo.nEntitySplit2 = GTK_PANED( w )->child1_size; + g_PrefsDlg.mWindowInfo.nEntitySplit2 = gtk_paned_get_position( GTK_PANED( w ) ); if ( !FloatingGroupDialog() ) { GtkWidget *vsplit, *hsplit, *vsplit2, *hsplit2; @@ -3323,17 +3323,17 @@ void MainFrame::OnDestroy(){ hsplit = m_pSplits[2]; hsplit2 = m_pSplits[3]; - g_PrefsDlg.mWindowInfo.nXYHeight = GTK_PANED( vsplit )->child1_size; - g_PrefsDlg.mWindowInfo.nXYWidth = GTK_PANED( hsplit2 )->child1_size; + g_PrefsDlg.mWindowInfo.nXYHeight = gtk_paned_get_position( GTK_PANED( vsplit ) ); + g_PrefsDlg.mWindowInfo.nXYWidth = gtk_paned_get_position( GTK_PANED( hsplit2 ) ); if ( CurrentStyle() == eRegular ) { - g_PrefsDlg.mWindowInfo.nZWidth = GTK_PANED( hsplit )->child1_size; + g_PrefsDlg.mWindowInfo.nZWidth = gtk_paned_get_position( GTK_PANED( hsplit ) ); } else{ - g_PrefsDlg.mWindowInfo.nCamWidth = GTK_PANED( hsplit )->child1_size; + g_PrefsDlg.mWindowInfo.nCamWidth = gtk_paned_get_position( GTK_PANED( hsplit ) ); } - g_PrefsDlg.mWindowInfo.nCamHeight = GTK_PANED( vsplit2 )->child1_size; + g_PrefsDlg.mWindowInfo.nCamHeight = gtk_paned_get_position( GTK_PANED( vsplit2 ) ); } else { diff --git a/radiant/pluginentities.cpp b/radiant/pluginentities.cpp index 1f0ad082..5fc32c87 100644 --- a/radiant/pluginentities.cpp +++ b/radiant/pluginentities.cpp @@ -33,7 +33,7 @@ #endif //#include "qe3.h" -int QERApp_EClassScanDir( char *path, void* hPlug ){ +int QERApp_EClassScanDir( const char *path, void* hPlug ){ char temp[NAME_MAX]; char filebase[NAME_MAX]; char filename[NAME_MAX]; diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 31432b3e..a7a2b20e 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -2753,7 +2753,7 @@ void PrefsDlg::BuildDialog(){ // Add the page to the notebook gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel ); - gtk_notebook_set_page( GTK_NOTEBOOK( notebook ), PTAB_FRONT ); + gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook ), PTAB_FRONT ); } // end new prefs dialog diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 08f106fe..c6693137 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -313,27 +313,27 @@ static void OnIncrementChanged( GtkWidget *widget, gpointer data ){ if ( widget == g_dlgSurface.GetDlgWidget( "hshift_inc" ) ) { l_pIncrement->shift[0] = val; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "hshift" ) ) ); - adjust->step_increment = l_pIncrement->shift[0]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] ); } else if ( widget == g_dlgSurface.GetDlgWidget( "vshift_inc" ) ) { l_pIncrement->shift[1] = val; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "vshift" ) ) ); - adjust->step_increment = l_pIncrement->shift[1]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] ); } else if ( widget == g_dlgSurface.GetDlgWidget( "hscale_inc" ) ) { l_pIncrement->scale[0] = val; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "hscale" ) ) ); - adjust->step_increment = l_pIncrement->scale[0]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] ); } else if ( widget == g_dlgSurface.GetDlgWidget( "vscale_inc" ) ) { l_pIncrement->scale[1] = val; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "vscale" ) ) ); - adjust->step_increment = l_pIncrement->scale[1]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] ); } else if ( widget == g_dlgSurface.GetDlgWidget( "rotate_inc" ) ) { l_pIncrement->rotate = val; adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "rotate" ) ) ); - adjust->step_increment = l_pIncrement->rotate; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate ); } } @@ -928,13 +928,13 @@ void SurfaceDlg::SetTexMods(){ gtk_spin_button_set_value( spin, pt->shift[0] ); } GtkAdjustment *adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->shift[0]; + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] ); char buf[10]; // got into snprintf paranoia after BoundChecker detected a stack overrun #ifdef _WIN32 // TTimo: THIS IS UGLY #define snprintf _snprintf #endif - snprintf( buf, 10, "%g", l_pIncrement->shift[0] ); + snprintf( buf, sizeof( buf ), "%g", l_pIncrement->shift[0] ); gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "hshift_inc" ) ), buf ); spin = GTK_SPIN_BUTTON( GetDlgWidget( "vshift" ) ); @@ -946,8 +946,8 @@ void SurfaceDlg::SetTexMods(){ gtk_spin_button_set_value( spin, pt->shift[1] ); } adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->shift[1]; - snprintf( buf, 10, "%g", l_pIncrement->shift[1] ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] ); + snprintf( buf, sizeof( buf ), "%g", l_pIncrement->shift[1] ); gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "vshift_inc" ) ), buf ); spin = GTK_SPIN_BUTTON( GetDlgWidget( "hscale" ) ); @@ -955,8 +955,8 @@ void SurfaceDlg::SetTexMods(){ gtk_spin_button_set_value( spin, g_qeglobals.m_bBrushPrimitMode ? m_scale[0] : pt->scale[0] ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->scale[0]; - snprintf( buf, 10, "%g", l_pIncrement->scale[0] ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] ); + snprintf( buf, sizeof( buf ), "%g", l_pIncrement->scale[0] ); gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "hscale_inc" ) ), buf ); spin = GTK_SPIN_BUTTON( GetDlgWidget( "vscale" ) ); @@ -964,8 +964,8 @@ void SurfaceDlg::SetTexMods(){ gtk_spin_button_set_value( spin, g_qeglobals.m_bBrushPrimitMode ? m_scale[1] : pt->scale[1] ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->scale[1]; - snprintf( buf, 10, "%g", l_pIncrement->scale[1] ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] ); + snprintf( buf, sizeof( buf ), "%g", l_pIncrement->scale[1] ); gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "vscale_inc" ) ), buf ); //++timo compute BProtate as int .. @@ -974,8 +974,8 @@ void SurfaceDlg::SetTexMods(){ gtk_spin_button_set_value( spin, g_qeglobals.m_bBrushPrimitMode ? m_rotate : pt->rotate ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); - adjust->step_increment = l_pIncrement->rotate; - snprintf( buf, 10, "%g", l_pIncrement->rotate ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate ); + snprintf( buf, sizeof( buf ), "%g", l_pIncrement->rotate ); gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "rotate_inc" ) ), buf ); g_bListenChanged = true; @@ -1042,15 +1042,15 @@ void SurfaceDlg::GetTexMods(){ ( g_qeglobals.m_bBrushPrimitMode ? m_shift[0] : pt->shift[0] ) = - gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "hshift" ) ) ); + gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "hshift" ) ) ); ( g_qeglobals.m_bBrushPrimitMode ? m_shift[1] : pt->shift[1] ) = - gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "vshift" ) ) ); + gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "vshift" ) ) ); ( g_qeglobals.m_bBrushPrimitMode ? m_scale[0] : pt->scale[0] ) = - gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "hscale" ) ) ); + gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "hscale" ) ) ); ( g_qeglobals.m_bBrushPrimitMode ? m_scale[1] : pt->scale[1] ) = - gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "vscale" ) ) ); + gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "vscale" ) ) ); ( g_qeglobals.m_bBrushPrimitMode ? m_rotate : pt->rotate ) = - gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "rotate" ) ) ); + gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "rotate" ) ) ); // a local copy of the texture matrix, given for a qtexture_t with width=2 height=2 brushprimit_texdef_t local_bp; diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 87275870..6f23e759 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1709,12 +1709,12 @@ void TexWnd::OnExpose() { if ( g_PrefsDlg.m_bTextureScrollbar && ( m_bNeedRange || g_qeglobals.d_texturewin.m_nTotalHeight != nOld ) ) { GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) ); - vadjustment->value = -g_qeglobals.d_texturewin.originy; - vadjustment->page_size = m_pWidget->allocation.height; - vadjustment->page_increment = m_pWidget->allocation.height / 2; - vadjustment->step_increment = 20; - vadjustment->lower = 0; - vadjustment->upper = g_qeglobals.d_texturewin.m_nTotalHeight; + gtk_adjustment_set_value( vadjustment, -g_qeglobals.d_texturewin.originy ); + gtk_adjustment_set_page_size( vadjustment, m_pWidget->allocation.height ); + gtk_adjustment_set_page_increment( vadjustment, m_pWidget->allocation.height / 2 ); + gtk_adjustment_set_step_increment( vadjustment, 20 ); + gtk_adjustment_set_lower( vadjustment, 0 ); + gtk_adjustment_set_upper( vadjustment, g_qeglobals.d_texturewin.m_nTotalHeight ); gtk_signal_emit_by_name( GTK_OBJECT( vadjustment ), "changed" ); @@ -1761,7 +1761,7 @@ void TexWnd::OnMouseMove( guint32 flags, int pointx, int pointy ){ void TexWnd::OnVScroll(){ GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) ); - g_qeglobals.d_texturewin.originy = -(int)vadjustment->value; + g_qeglobals.d_texturewin.originy = -(int)gtk_adjustment_get_value( vadjustment ); RedrawWindow(); } diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 53c58ffe..211cb915 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -3185,7 +3185,7 @@ bool XYWnd::AreaSelectOK(){ void XYWnd::OnCreate(){ if ( !MakeCurrent() ) { - Error( "glXMakeCurrent failed" ); + Error( "xywindow: glXMakeCurrent failed" ); } qglPolygonStipple( (unsigned char *)s_stipple );