add_definitions(-DRADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}")
-add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE)
+add_definitions(
+ -DGTK_DISABLE_SINGLE_INCLUDES
+ -DGSEAL_ENABLE
+ #-DGDK_DISABLE_DEPRECATED
+ #-DGTK_DISABLE_DEPRECATED
+)
if(NOT WIN32)
add_definitions(
// GTK_STOCK_CLOSE,
// GTK_RESPONSE_CLOSE,
NULL );
- 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 );
+ g_signal_connect( GTK_OBJECT( pDialogWnd ), "delete_event",
+ G_CALLBACK( close_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( pDialogWnd ), "response",
+ G_CALLBACK( response_callback ), NULL );
+// g_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", G_CALLBACK( ci_expose ), NULL );
pTooltips = gtk_tooltips_new();
gboolean check;
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexNew ), check );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexOld ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexNew ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexOld ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleHor ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleHor ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleVert ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleVert ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftHor ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftHor ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftVert ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftVert ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) );
- gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editRotation ), check );
+ gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editRotation ), check );
}
static void dialog_button_callback( GtkWidget *widget, gpointer data ){
TwinWidget* tw = (TwinWidget*)data;
GtkEntry* entry = GTK_ENTRY( tw->one );
- GtkCombo* combo = GTK_COMBO( tw->two );
-
- const gchar* tex = gtk_entry_get_text( GTK_ENTRY( combo->entry ) );
+ auto* combo = tw->two;
+ const gchar* tex = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo));
gtk_entry_set_text( entry, tex );
}
int loop = 1;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
if ( type == eMB_OK ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default(w, true);
gtk_widget_grab_default( w );
gtk_widget_show( w );
else if ( type == eMB_OKCANCEL ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
}
else if ( type == eMB_YESNOCANCEL ) {
w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
}
{
w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
gtk_widget_show( w );
ret = eIDNO;
}
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Intersect" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" );
gtk_box_pack_start( GTK_BOX( hbox ), radioNorth, FALSE, FALSE, 3 );
gtk_widget_show( radioNorth );
- radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNorth ) );
+ radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNorth ) );
radioSouth = gtk_radio_button_new_with_label( radioDirection, "South" );
gtk_box_pack_start( GTK_BOX( hbox ), radioSouth, FALSE, FALSE, 2 );
gtk_widget_show( radioSouth );
- radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioSouth ) );
+ radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioSouth ) );
radioEast = gtk_radio_button_new_with_label( radioDirection, "East" );
gtk_box_pack_start( GTK_BOX( hbox ), radioEast, FALSE, FALSE, 1 );
gtk_widget_show( radioEast );
- radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioEast ) );
+ radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioEast ) );
radioWest = gtk_radio_button_new_with_label( radioDirection, "West" );
gtk_box_pack_start( GTK_BOX( hbox ), radioWest, FALSE, FALSE, 0 );
gtk_box_pack_start( GTK_BOX( hbox ), radioOldStyle, FALSE, FALSE, 0 );
gtk_widget_show( radioOldStyle );
- radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioOldStyle ) );
+ radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioOldStyle ) );
radioBobStyle = gtk_radio_button_new_with_label( radioStyle, "Bob's Style" );
gtk_box_pack_start( GTK_BOX( hbox ), radioBobStyle, FALSE, FALSE, 0 );
gtk_widget_show( radioBobStyle );
- radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioBobStyle ) );
+ radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioBobStyle ) );
radioCornerStyle = gtk_radio_button_new_with_label( radioStyle, "Corner Style" );
gtk_box_pack_start( GTK_BOX( hbox ), radioCornerStyle, FALSE, FALSE, 0 );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" );
gtk_widget_realize( window );
char buffer[256];
- GList *listMainTextures = NULL;
- GList *listTrimTextures = NULL;
- LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), &listMainTextures );
- LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), &listTrimTextures );
+ GtkListStore *listMainTextures = gtk_list_store_new( 1, G_TYPE_STRING );
+ GtkListStore *listTrimTextures = gtk_list_store_new( 1, G_TYPE_STRING );
+ LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), listMainTextures );
+ LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), listTrimTextures );
vbox = ui::VBox( FALSE, 10 );
gtk_container_add( GTK_CONTAINER( window ), vbox );
// djbob: lists added
- comboMain = gtk_combo_new();
+ comboMain = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures));
+ gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0);
gtk_box_pack_start( GTK_BOX( hbox ), comboMain, FALSE, FALSE, 0 );
- gtk_combo_set_popdown_strings( GTK_COMBO( comboMain ), listMainTextures );
- gtk_combo_set_use_arrows( GTK_COMBO( comboMain ), 1 );
gtk_widget_show( comboMain );
tw1.one = textFrontBackTex;
- tw1.two = comboMain;
+ tw1.two = GTK_COMBO_BOX(comboMain);
buttonSetMain = ui::Button( "Set As Main Texture" );
- gtk_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw1 );
+ g_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetMain );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- comboTrim = gtk_combo_new();
+ comboTrim = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures));
+ gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0);
gtk_box_pack_start( GTK_BOX( hbox ), comboTrim, FALSE, FALSE, 0 );
- gtk_combo_set_popdown_strings( GTK_COMBO( comboTrim ), listTrimTextures );
- gtk_combo_set_use_arrows( GTK_COMBO( comboMain ), 1 );
gtk_widget_show( comboTrim );
tw2.one = textTrimTex;
- tw2.two = comboTrim;
+ tw2.two = GTK_COMBO_BOX(comboTrim);
buttonSetTrim = ui::Button( "Set As Trim Texture" );
- gtk_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw2 );
+ g_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetTrim );
gtk_box_pack_start( GTK_BOX( hbox ), radioNS, FALSE, FALSE, 0 );
gtk_widget_show( radioNS );
- radioOrientation = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNS ) );
+ radioOrientation = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNS ) );
radioEW = gtk_radio_button_new_with_label( radioOrientation, "East - West" );
gtk_box_pack_start( GTK_BOX( hbox ), radioEW, FALSE, FALSE, 0 );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Enable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
gtk_widget_set_can_default( w, true );
w = ui::Button( "Disable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Red->Blue" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Blue->Red" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
// ---- frame ----
dlgTexReset.cbTexChange = ui::CheckButton( "Enabled" );
- gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+ g_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbTexChange );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
// ---- frame ----
dlgTexReset.cbScaleHor = ui::CheckButton( "Enabled" );
- gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+ g_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbScaleHor );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
dlgTexReset.cbScaleVert = ui::CheckButton( "Enabled" );
- gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+ g_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbScaleVert );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
// ---- frame ----
dlgTexReset.cbShiftHor = ui::CheckButton( "Enabled" );
- gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+ g_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbShiftHor );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
dlgTexReset.cbShiftVert = ui::CheckButton( "Enabled" );
- gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+ g_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbShiftVert );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
w = ui::Button( "Use Selected Brushes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Use All Brushes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Make Chain" );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
#if !defined( INCLUDED_DIALOGS_GTK_H )
#define INCLUDED_DIALOGS_GTK_H
+#include <gtk/gtk.h>
#include "qerplugin.h"
struct BuildStairsRS {
struct TwinWidget {
GtkWidget* one;
- GtkWidget* two;
+ GtkComboBox* two;
};
EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMessageBoxType type );
#endif
#include <glib.h>
+#include <gtk/gtk.h>
#include "misc.h"
return FALSE;
}
-bool LoadGList( char* filename, GList** loadlist ){
+bool LoadGList( char* filename, GtkListStore* loadlist ){
FILE* eFile = fopen( filename, "r" );
if ( eFile ) {
char buffer[256];
if ( strlen( buffer ) > 0 ) {
char* buffer2 = new char[strlen( buffer ) + 1];
strcpy( buffer2, buffer );
- *loadlist = g_list_append( *loadlist, buffer2 );
+ GtkTreeIter iter;
+ gtk_list_store_append(loadlist, &iter);
+ gtk_list_store_set(loadlist, &iter, 0, buffer2, -1);
}
else{
cnt++;
*/
#include <list>
+#include <gtk/gtk.h>
#include "str.h"
typedef struct _GList GList;
bool LoadExclusionList( char* filename, std::list<Str>* exclusionList );
-bool LoadGList( char* filename, GList** loadlist );
+bool LoadGList( char* filename, GtkListStore* loadlist );
#define GLADE_HOOKUP_OBJECT( component,widget,name ) \
g_object_set_data_full( G_OBJECT( component ), name, \
- gtk_widget_ref( widget ), (GDestroyNotify) gtk_widget_unref )
+ g_object_ref( widget ), (GDestroyNotify) g_object_unref )
#define GLADE_HOOKUP_OBJECT_NO_REF( component,widget,name ) \
g_object_set_data( G_OBJECT( component ), name, widget )
// create the window
window = ui::Window( ui::window_type::TOP );
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 ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
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 ) );
// -------------------------- //
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
gtk_widget_set_can_default( w, true );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
window = ui::Window( ui::window_type::TOP );
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 ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
gtk_widget_set_can_default( w, true );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
window = ui::Window( ui::window_type::TOP );
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 ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
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 ) );
// -------------------------- //
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
gtk_widget_set_can_default( w, true );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
window = ui::Window( ui::window_type::TOP );
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 ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
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 );
}
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
gtk_widget_set_can_default( w, true );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
window = ui::Window( ui::window_type::TOP );
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), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( ci_close ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "expose_event", G_CALLBACK( ci_expose ), NULL );
+ // g_signal_connect( GTK_OBJECT (window), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
// don't use show, as you don't want to have it displayed on startup ;-)
RefreshCamListCombo();
- gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pCamListCombo )->entry ), FALSE );
- gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_camlist_changed ), NULL );
+ gtk_editable_set_editable( GTK_EDITABLE( GTK_COMBO( g_pCamListCombo )->entry ), FALSE );
+ g_signal_connect( GTK_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", G_CALLBACK( ci_camlist_changed ), NULL );
// -------------------------- //
RefreshPathListCombo();
- gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pPathListCombo )->entry ), FALSE );
- gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_pathlist_changed ), NULL );
+ gtk_editable_set_editable( GTK_EDITABLE( GTK_COMBO( g_pPathListCombo )->entry ), FALSE );
+ g_signal_connect( GTK_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", G_CALLBACK( ci_pathlist_changed ), NULL );
// -------------------------- //
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_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", G_CALLBACK( 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 );
+ g_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", G_CALLBACK( ci_editmode_add ), NULL );
// see if we should use a different default
if ( g_iEditMode == 1 ) {
w = ui::Button( "Rename..." );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_rename ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_rename ), NULL );
gtk_widget_show( w );
w = ui::Button( "Add Target..." );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add_target ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_add_target ), NULL );
gtk_widget_show( w );
// not available in splines library
/*w = gtk_button_new_with_label( "Delete Selected" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0);
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_delete_selected ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_delete_selected ), NULL );
gtk_widget_show( w );
w = gtk_button_new_with_label( "Select All" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0);
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_select_all ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_select_all ), NULL );
gtk_widget_show( w );*/
// -------------------------- //
gtk_widget_show( hbox );
g_pTimeLine = ui::Adjustment( 0, 0, 30000, 100, 250, 0 );
- gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", G_CALLBACK( ci_timeline_changed ), NULL );
w = ui::HScale( g_pTimeLine );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_widget_show( w );
gtk_widget_show( hbox );
w = ui::ScrolledWindow();
- gtk_widget_set_usize( w, 0, 150 );
+ gtk_widget_set_size_request( w, 0, 150 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( w ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_widget_show( w );
g_pEventsList = gtk_clist_new( 3 );
gtk_container_add( GTK_CONTAINER( w ), g_pEventsList );
- //gtk_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", GTK_SIGNAL_FUNC (proplist_select_row), NULL);
+ //g_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", G_CALLBACK (proplist_select_row), NULL);
gtk_clist_set_selection_mode( GTK_CLIST( g_pEventsList ), GTK_SELECTION_BROWSE );
gtk_clist_column_titles_hide( GTK_CLIST( g_pEventsList ) );
gtk_clist_set_column_auto_resize( GTK_CLIST( g_pEventsList ), 0, TRUE );
w = ui::Button( "Add..." );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_add ), NULL );
gtk_widget_show( w );
w = ui::Button( "Del" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_del ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_del ), NULL );
gtk_widget_show( w );
// -------------------------- //
w = gtk_button_new_with_label( "New..." );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_new ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_new ), NULL );
gtk_widget_show( w );
w = gtk_button_new_with_label( "Load..." );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_load ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_load ), NULL );
gtk_widget_show( w );
// -------------------------- //
w = gtk_button_new_with_label( "Save..." );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_save ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_save ), NULL );
gtk_widget_show( w );
w = gtk_button_new_with_label( "Unload" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_unload ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_unload ), NULL );
gtk_widget_show( w );
hbox = gtk_hbox_new( FALSE, 5 );
w = gtk_button_new_with_label( "Apply" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_apply ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_apply ), NULL );
gtk_widget_show( w );
w = gtk_button_new_with_label( "Preview" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_preview ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_preview ), NULL );
gtk_widget_show( w );
// -------------------------- //
w = gtk_button_new_with_label( "Close" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_close ), NULL );
+ g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_close ), NULL );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
radio = gtk_radio_button_new_with_label( group, games[i] );
gtk_widget_show( radio );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
game_radios[i] = radio;
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) );
}
radio = gtk_radio_button_new_with_label( group, waveforms[i] );
gtk_widget_show( radio );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
wave_radios[i] = radio;
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) );
}
radio = gtk_radio_button_new_with_label( group, orientations[i] );
gtk_widget_show( radio );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
plane_radios[i] = radio;
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) );
}
gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "wavelength", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength );
gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "amplitude", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude );
gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "roughness", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness );
gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "random", spin );
vbox = ui::VBox( FALSE, 5 );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "hmin", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "hmax", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "vmin", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "vmax", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "nh", spin );
adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "nv", spin );
check = ui::CheckButton( "Use Bezier patches" );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "sp", spin );
// ^Fishman - End of Snap to grid code.
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "z01", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "z00", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "z11", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
g_object_set_data( G_OBJECT( dlg ), "z10", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 );
button = ui::Button( "Browse..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_browse ), NULL );
button = ui::Button( "Reload" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "bmp_reload", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_reload ), NULL );
entry = ui::Entry();
gtk_widget_show( entry );
gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
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 );
entry = ui::Entry();
gtk_widget_show( entry );
gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
- gtk_widget_set_usize( entry, 50, -2 );
+ gtk_widget_set_size_request( entry, 50, -1 );
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 );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND ),
(GtkAttachOptions) ( GTK_EXPAND ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
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 );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
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 );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
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 );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "fix_free", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_free ), NULL );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "fix_freeall", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_freeall ), NULL );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
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 ) );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
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 ) );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "texture3", entry );
hbox2 = ui::HBox( FALSE, 5 );
gtk_table_attach( GTK_TABLE( table ), entry, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "texoffsetx", entry );
entry = ui::Entry();
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "texoffsety", entry );
entry = ui::Entry();
gtk_table_attach( GTK_TABLE( table ), entry, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "texscalex", entry );
entry = ui::Entry();
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
- gtk_widget_set_usize( entry, 60, -2 );
+ gtk_widget_set_size_request( entry, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "texscaley", entry );
button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
g_object_set_data( G_OBJECT( dlg ), "go", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_go ), NULL );
g_pWndPreview = dlg = ui::Window( ui::window_type::TOP );
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 ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+ g_signal_connect( GTK_OBJECT( dlg ), "delete_event", G_CALLBACK( preview_close ), NULL );
+ g_signal_connect( GTK_OBJECT( dlg ), "destroy", G_CALLBACK( 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 );
gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 );
adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 );
- gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation );
+ g_signal_connect( adj, "value_changed", G_CALLBACK( preview_spin ), &elevation );
spin = ui::SpinButton( 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 );
adj = ui::Adjustment( 30, 0, 359, 1, 10, 0 );
- gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth );
+ g_signal_connect( adj, "value_changed", G_CALLBACK( preview_spin ), &azimuth );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE );
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_FUNC( button_press ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "expose_event", G_CALLBACK( expose ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "motion_notify_event", G_CALLBACK( motion ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "button_press_event",
+ G_CALLBACK( button_press ), NULL );
gtk_widget_show( g_pPreviewWidget );
gtk_container_add( GTK_CONTAINER( frame ), g_pPreviewWidget );
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
gtk_object_set_data( GTK_OBJECT( window ), "loop", &loop );
if ( mode == MB_OK ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
else if ( mode == MB_OKCANCEL ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w );
ret = IDCANCEL;
}
else if ( mode == MB_YESNOCANCEL ) {
w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w );
ret = IDCANCEL;
}
{
w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
ret = IDNO;
}
dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" );
- 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 );
+ g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
button = ui::Button( "OK" );
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( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
- gtk_widget_set_usize( button, 60, -2 );
+ g_signal_connect( GTK_OBJECT( button ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ gtk_widget_set_size_request( button, 60, -1 );
gtk_grab_add( dlg );
gtk_widget_show( dlg );
dlg = gtk_color_selection_dialog_new( "Choose Color" );
gtk_color_selection_set_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), clr );
- 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 );
+ g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
GtkWidget *ok_button, *cancel_button;
g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr);
- gtk_signal_connect( GTK_OBJECT(ok_button), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
- gtk_signal_connect( GTK_OBJECT(cancel_button), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ g_signal_connect( GTK_OBJECT(ok_button), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ g_signal_connect( GTK_OBJECT(cancel_button), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "Portal Viewer Configuration" );
- 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 );
+ g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
lw3label = ui::Label( "" );
gtk_widget_show( lw3label );
gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label );
+ g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScroll3d ), lw3label );
table = ui::Table( 2, 4, FALSE );
gtk_widget_show( table );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor3d ), NULL );
+ g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColor3d ), NULL );
button = ui::Button( "Depth Color" );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColorFog ), NULL );
+ g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColorFog ), NULL );
aa3check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" );
gtk_widget_show( aa3check );
gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_signal_connect( GTK_OBJECT( aa3check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias3d ), NULL );
+ g_signal_connect( GTK_OBJECT( aa3check ), "toggled", G_CALLBACK( OnAntiAlias3d ), NULL );
depthcheck = ui::CheckButton( "Depth Cue" );
gtk_widget_show( depthcheck );
gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_signal_connect( GTK_OBJECT( depthcheck ), "toggled", GTK_SIGNAL_FUNC( OnFog ), NULL );
+ g_signal_connect( GTK_OBJECT( depthcheck ), "toggled", G_CALLBACK( OnFog ), NULL );
linescheck = ui::CheckButton( "Lines" );
gtk_widget_show( linescheck );
gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_signal_connect( GTK_OBJECT( linescheck ), "toggled", GTK_SIGNAL_FUNC( OnLines ), NULL );
+ g_signal_connect( GTK_OBJECT( linescheck ), "toggled", G_CALLBACK( OnLines ), NULL );
polyscheck = ui::CheckButton( "Polygons" );
gtk_widget_show( polyscheck );
gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_signal_connect( GTK_OBJECT( polyscheck ), "toggled", GTK_SIGNAL_FUNC( OnPoly ), NULL );
+ g_signal_connect( GTK_OBJECT( polyscheck ), "toggled", G_CALLBACK( OnPoly ), NULL );
zlist = gtk_option_menu_new();
gtk_widget_show( zlist );
item = ui::MenuItem( "Z-Buffer Test and Write (recommended for solid or no polygons)" );
gtk_widget_show( item );
- gtk_signal_connect( GTK_OBJECT( item ), "activate",
- GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) );
+ g_signal_connect( GTK_OBJECT( item ), "activate",
+ G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Z-Buffer Test Only (recommended for transparent polygons)" );
gtk_widget_show( item );
- gtk_signal_connect( GTK_OBJECT( item ), "activate",
- GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) );
+ g_signal_connect( GTK_OBJECT( item ), "activate",
+ G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Z-Buffer Off" );
gtk_widget_show( item );
- gtk_signal_connect( GTK_OBJECT( item ), "activate",
- GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) );
+ g_signal_connect( GTK_OBJECT( item ), "activate",
+ G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) );
gtk_menu_append( GTK_MENU( menu ), item );
table = ui::Table( 2, 2, FALSE );
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 );
- gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel );
+ g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScrollTrans ), translabel );
adj = ui::Adjustment( portals.clip_range, 1, 128, 1, 1, 0 );
clipslider = ui::HScale( adj );
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 );
- gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel );
+ g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScrollClip ), cliplabel );
hbox = ui::HBox( TRUE, 5 );
gtk_widget_show( hbox );
show3check = ui::CheckButton( "Show" );
gtk_widget_show( show3check );
gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( show3check ), "toggled", GTK_SIGNAL_FUNC( OnConfig3d ), NULL );
+ g_signal_connect( GTK_OBJECT( show3check ), "toggled", G_CALLBACK( OnConfig3d ), NULL );
portalcheck = ui::CheckButton( "Portal cubic clipper" );
gtk_widget_show( portalcheck );
gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( portalcheck ), "toggled", GTK_SIGNAL_FUNC( OnClip ), NULL );
+ g_signal_connect( GTK_OBJECT( portalcheck ), "toggled", G_CALLBACK( OnClip ), NULL );
frame = ui::Frame( "2D View" );
gtk_widget_show( frame );
lw2label = ui::Label( "" );
gtk_widget_show( lw2label );
gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label );
+ g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScroll2d ), lw2label );
hbox = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox );
button = ui::Button( "Color" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL );
- gtk_widget_set_usize( button, 60, -2 );
+ g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColor2d ), NULL );
+ gtk_widget_set_size_request( button, 60, -1 );
aa2check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" );
gtk_widget_show( aa2check );
gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( aa2check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias2d ), NULL );
+ g_signal_connect( GTK_OBJECT( aa2check ), "toggled", G_CALLBACK( OnAntiAlias2d ), NULL );
hbox = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox );
show2check = ui::CheckButton( "Show" );
gtk_widget_show( show2check );
gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( show2check ), "toggled", GTK_SIGNAL_FUNC( OnConfig2d ), NULL );
+ g_signal_connect( GTK_OBJECT( show2check ), "toggled", G_CALLBACK( OnConfig2d ), NULL );
hbox = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox );
button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
- gtk_widget_set_usize( button, 60, -2 );
+ g_signal_connect( GTK_OBJECT( button ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ gtk_widget_set_size_request( button, 60, -1 );
// initialize dialog
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( show2check ), portals.show_2d );
int loop = 1;
file_sel = gtk_file_selection_new( "Locate portal (.prt) file" );
- gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked",
- 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_FUNC( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked",
+ G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDOK ) );
+ g_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked",
+ G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( file_sel ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) );
g_object_set_data( G_OBJECT( file_sel ), "loop", &loop );
dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" );
- 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 );
+ g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
entry = ui::Entry();
gtk_widget_show( entry );
- gtk_entry_set_editable( GTK_ENTRY( entry ), FALSE );
+ gtk_editable_set_editable( GTK_EDITABLE( entry ), FALSE );
gtk_box_pack_start( GTK_BOX( vbox ), entry, FALSE, FALSE, 0 );
hbox = ui::HBox( FALSE, 5 );
button = ui::Button( "Change" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( change_clicked ), entry );
- gtk_widget_set_usize( button, 60, -2 );
+ g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( change_clicked ), entry );
+ gtk_widget_set_size_request( button, 60, -1 );
hbox = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox );
button = ui::Button( "Cancel" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
- gtk_widget_set_usize( button, 60, -2 );
+ g_signal_connect( GTK_OBJECT( button ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ gtk_widget_set_size_request( button, 60, -1 );
button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
- gtk_widget_set_usize( button, 60, -2 );
+ g_signal_connect( GTK_OBJECT( button ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ gtk_widget_set_size_request( button, 60, -1 );
strcpy( portals.fn, GlobalRadiant().getMapName() );
char* fn = strrchr( portals.fn, '.' );
eSpace,
eButton,
eToggleButton,
- eRadioButton,
};
virtual const char* getImage() const = 0;
#endif
}
+void button_connect_callback( GtkToolButton* button, const Callback& callback ){
+#if 1
+ g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
+#else
+ g_signal_connect_closure( G_OBJECT( button ), "clicked", create_cclosure( G_CALLBACK( clicked_closure_callback ), callback ), FALSE );
+#endif
+}
+
guint toggle_button_connect_callback( GtkToggleButton* button, const Callback& callback ){
#if 1
guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
return handler;
}
+guint toggle_button_connect_callback( GtkToggleToolButton* button, const Callback& callback ){
+#if 1
+ guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
+#else
+ guint handler = g_signal_connect_closure( G_OBJECT( button ), "toggled", create_cclosure( G_CALLBACK( clicked_closure_callback ), callback ), TRUE );
+#endif
+ g_object_set_data( G_OBJECT( button ), "handler", gint_to_pointer( handler ) );
+ return handler;
+}
+
void button_set_icon( GtkButton* button, const char* icon ){
GtkImage* image = new_local_image( icon );
gtk_widget_show( GTK_WIDGET( image ) );
g_signal_handler_unblock( G_OBJECT( button ), handler_id );
}
+void toggle_button_set_active_no_signal( GtkToggleToolButton* button, gboolean active ){
+ guint handler_id = gpointer_to_int( g_object_get_data( G_OBJECT( button ), "handler" ) );
+ g_signal_handler_block( G_OBJECT( button ), handler_id );
+ gtk_toggle_tool_button_set_active( button, active );
+ g_signal_handler_unblock( G_OBJECT( button ), handler_id );
+}
+
void radio_button_print_state( GtkRadioButton* button ){
globalOutputStream() << "toggle button: ";
- for ( GSList* radio = gtk_radio_button_group( button ); radio != 0; radio = g_slist_next( radio ) )
+ for ( GSList* radio = gtk_radio_button_get_group( button ); radio != 0; radio = g_slist_next( radio ) )
{
globalOutputStream() << gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio->data ) );
}
}
GtkToggleButton* radio_button_get_nth( GtkRadioButton* radio, int index ){
- GSList *group = gtk_radio_button_group( radio );
+ GSList *group = gtk_radio_button_get_group( radio );
return GTK_TOGGLE_BUTTON( g_slist_nth_data( group, g_slist_length( group ) - index - 1 ) );
}
int radio_button_get_active( GtkRadioButton* radio ){
//radio_button_print_state(radio);
- GSList *group = gtk_radio_button_group( radio );
+ GSList *group = gtk_radio_button_get_group( radio );
int index = g_slist_length( group ) - 1;
for (; group != 0; group = g_slist_next( group ) )
{
#if !defined( INCLUDED_GTKUTIL_BUTTON_H )
#define INCLUDED_GTKUTIL_BUTTON_H
+#include <gtk/gtk.h>
#include "generic/callbackfwd.h"
typedef struct _GtkButton GtkButton;
typedef unsigned int guint;
void button_connect_callback( GtkButton* button, const Callback& callback );
+void button_connect_callback( GtkToolButton* button, const Callback& callback );
guint toggle_button_connect_callback( GtkToggleButton* button, const Callback& callback );
+guint toggle_button_connect_callback( GtkToggleToolButton* button, const Callback& callback );
void button_set_icon( GtkButton* button, const char* icon );
void toggle_button_set_active_no_signal( GtkToggleButton* item, gboolean active );
+void toggle_button_set_active_no_signal( GtkToggleToolButton* item, gboolean active );
void radio_button_set_active( GtkRadioButton* radio, int index );
void radio_button_set_active_no_signal( GtkRadioButton* radio, int index );
gint glwidget_context_created( GtkWidget* widget, gpointer data ){
if ( ++g_context_count == 1 ) {
g_shared = widget;
- gtk_widget_ref( g_shared );
+ g_object_ref( g_shared );
glwidget_make_current( g_shared );
GlobalOpenGL().contextValid = true;
GLWidget_sharedContextDestroyed();
- gtk_widget_unref( g_shared );
+ g_object_unref( g_shared );
g_shared = 0;
}
return FALSE;
GtkImage* new_image( const char* filename ){
{
- GtkImage* image = image_new_from_file_with_mask( filename );
- if ( image != 0 ) {
- return image;
- }
+ if ( auto image = image_new_from_file_with_mask( filename ) ) return image;
}
return image_new_missing();
GtkRadioMenuItem* new_radio_menu_item_with_mnemonic( GSList** group, const char* mnemonic, const Callback& callback ){
GtkRadioMenuItem* item = GTK_RADIO_MENU_ITEM( gtk_radio_menu_item_new_with_mnemonic( *group, mnemonic ) );
if ( *group == 0 ) {
- gtk_check_menu_item_set_state( GTK_CHECK_MENU_ITEM( item ), TRUE );
+ gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), TRUE );
}
- *group = gtk_radio_menu_item_group( item );
+ *group = gtk_radio_menu_item_get_group( item );
gtk_widget_show( GTK_WIDGET( item ) );
check_menu_item_connect_callback( GTK_CHECK_MENU_ITEM( item ), callback );
return item;
NonModalRadio( const Callback& changed ) : m_changed( changed ){
}
void connect( GtkRadioButton* radio ){
- GSList* group = gtk_radio_button_group( radio );
+ GSList* group = gtk_radio_button_get_group( radio );
for (; group != 0; group = g_slist_next( group ) )
{
toggle_button_connect_callback( GTK_TOGGLE_BUTTON( group->data ), m_changed );
#include "toolbar.h"
-#include <gtk/gtk.h>
#include <uilib/uilib.h>
#include "generic/callback.h"
#include "accelerator.h"
#include "button.h"
-#include "closure.h"
-#include "pointer.h"
+#include "image.h"
-void toolbar_append( GtkToolbar* toolbar, GtkButton* button, const char* description ){
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_button_set_relief( button, GTK_RELIEF_NONE );
- gtk_widget_set_can_focus(GTK_WIDGET( button ), false);
- gtk_widget_set_can_default(GTK_WIDGET( button ), false);
- gtk_toolbar_append_element( toolbar, GTK_TOOLBAR_CHILD_WIDGET, GTK_WIDGET( button ), "", description, "", 0, 0, 0 );
+void toolbar_append( GtkToolbar* toolbar, GtkToolItem* button, const char* description ){
+ gtk_widget_show_all(GTK_WIDGET(button));
+ gtk_widget_set_tooltip_text(GTK_WIDGET(button), description);
+ gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button));
}
-GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
- GtkButton* button = ui::Button();
- button_set_icon( button, icon );
- button_connect_callback( button, callback );
- toolbar_append( toolbar, button, description );
+GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
+ auto button = GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_local_image(icon)), nullptr));
+ button_connect_callback(button, callback);
+ toolbar_append(toolbar, GTK_TOOL_ITEM(button), description);
return button;
}
-GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
- GtkToggleButton* button = GTK_TOGGLE_BUTTON( gtk_toggle_button_new() );
- button_set_icon( GTK_BUTTON( button ), icon );
- toggle_button_connect_callback( button, callback );
- toolbar_append( toolbar, GTK_BUTTON( button ), description );
+GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
+ auto button = GTK_TOGGLE_TOOL_BUTTON(gtk_toggle_tool_button_new());
+ toggle_button_connect_callback(button, callback);
+ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), GTK_WIDGET(new_local_image(icon)));
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), description);
+ toolbar_append(toolbar, GTK_TOOL_ITEM(button), description);
return button;
}
-GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ){
+GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ){
return toolbar_append_button( toolbar, description, icon, command.m_callback );
}
-void toggle_button_set_active_callback( GtkToggleButton& button, bool active ){
+void toggle_button_set_active_callback( GtkToggleToolButton& button, bool active ){
toggle_button_set_active_no_signal( &button, active );
}
-typedef ReferenceCaller1<GtkToggleButton, bool, toggle_button_set_active_callback> ToggleButtonSetActiveCaller;
+using ToggleButtonSetActiveCaller = ReferenceCaller1<GtkToggleToolButton, bool, toggle_button_set_active_callback>;
-GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ){
- GtkToggleButton* button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback );
+GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ){
+ auto button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback );
toggle.m_exportCallback( ToggleButtonSetActiveCaller( *button ) );
return button;
}
#if !defined( INCLUDED_GTKUTIL_TOOLBAR_H )
#define INCLUDED_GTKUTIL_TOOLBAR_H
+#include <gtk/gtk.h>
#include "generic/callbackfwd.h"
typedef struct _GtkButton GtkButton;
class Command;
class Toggle;
-GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback );
-GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command );
-GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback );
-GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle );
+GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback );
+GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command );
+GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback );
+GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle );
#endif
CellRendererText::CellRendererText() : CellRendererText(GTK_CELL_RENDERER_TEXT(gtk_cell_renderer_text_new()))
{ }
- ComboBox ComboBoxText()
- { return ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_text())); }
+ ComboBoxText::ComboBoxText() : ComboBoxText(GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new()))
+ { }
CheckButton::CheckButton(const char *label) : CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_label(label)))
{ }
Entry::Entry() : Entry(GTK_ENTRY(gtk_entry_new()))
{ }
- Entry::Entry(std::size_t max_length) : Entry(GTK_ENTRY(gtk_entry_new_with_max_length(max_length)))
- { }
+ Entry::Entry(std::size_t max_length) : Entry()
+ {
+ gtk_entry_set_max_length(*this, static_cast<gint>(max_length));
+ }
Frame::Frame(const char *label) : Frame(GTK_FRAME(gtk_frame_new(label)))
{ }
using ui_button = struct _GtkButton;
using ui_checkbutton = struct _GtkCheckButton;
using ui_combobox = struct _GtkComboBox;
+using ui_comboboxtext = struct _GtkComboBoxText;
using ui_cellrenderer = struct _GtkCellRenderer;
using ui_cellrenderertext = struct _GtkCellRendererText;
using ui_entry = struct _GtkEntry;
WRAP(ComboBox, Widget, ui_combobox,);
- ComboBox ComboBoxText();
+ WRAP(ComboBoxText, ComboBox, ui_comboboxtext,
+ ComboBoxText();
+ );
WRAP(Entry, Widget, ui_entry,
Entry();
menu = ui::Menu();
item = ui::MenuItem( "Validate (RETURN)" );
- gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Validate ), NULL );
+ g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( Textool_Validate ), NULL );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Zoom in (INSERT)" );
- gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( view_ZoomIn ), this );
+ g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( view_ZoomIn ), this );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Zoom out (DELETE)" );
- gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( view_ZoomOut ), this );
+ g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( view_ZoomOut ), this );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Cancel (ESC)" );
- gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Cancel ), NULL );
+ g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( Textool_Cancel ), NULL );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
window = ui::Window( ui::window_type::TOP );
- 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 );
+ g_signal_connect( GTK_OBJECT( window ), "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ g_signal_connect( GTK_OBJECT( window ), "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
if ( mode == MB_OK ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
else if ( mode == MB_OKCANCEL ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w );
ret = IDCANCEL;
}
else if ( mode == MB_YESNOCANCEL ) {
w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w );
ret = IDCANCEL;
}
{
w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- gtk_signal_connect( GTK_OBJECT( w ), "clicked",
- GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
+ g_signal_connect( GTK_OBJECT( w ), "clicked",
+ G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
ret = IDNO;
}
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_FUNC( motion ), NULL );
- 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_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_FUNC( keypress ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose_event", G_CALLBACK( expose ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion_notify_event",
+ G_CALLBACK( motion ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_press_event",
+ G_CALLBACK( button_press ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_release_event",
+ G_CALLBACK( button_release ), NULL );
+
+ g_signal_connect( GTK_OBJECT( g_pToolWnd ), "delete_event", G_CALLBACK( close ), NULL );
+ g_signal_connect( GTK_OBJECT( g_pToolWnd ), "key_press_event",
+ G_CALLBACK( keypress ), NULL );
return g_pToolWidget;
}
m_window_observer->setRectangleDrawCallback( ReferenceCaller1<CamWnd, rect_t, camwnd_update_xor_rectangle>( *this ) );
m_window_observer->setView( m_view );
- gtk_widget_ref( m_gl_widget );
+ g_object_ref( m_gl_widget );
gtk_widget_set_events( m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
gtk_widget_set_can_focus( m_gl_widget, true );
g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_sizeHandler );
g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_exposeHandler );
- gtk_widget_unref( m_gl_widget );
+ g_object_unref( m_gl_widget );
m_window_observer->release();
}
gtk_spin_button_set_value( &widget, value );
}
void FloatSpinnerExport( GtkSpinButton& widget, const FloatImportCallback& importCallback ){
- importCallback( float(gtk_spin_button_get_value_as_float( &widget ) ) );
+ importCallback( float(gtk_spin_button_get_value( &widget ) ) );
}
typedef ImportExport<GtkSpinButton, float, FloatSpinnerImport, FloatSpinnerExport> FloatSpinnerImportExport;
for ( StringArrayRange::Iterator i = values.first; i != values.last; ++i )
{
- gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), *i );
+ gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), *i );
}
AddIntComboData( *GTK_COMBO_BOX( combo ), importViewer, exportViewer );
for ( ListAttributeType::const_iterator i = type.begin(); i != type.end(); ++i )
{
- gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), ( *i ).first.c_str() );
+ gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), ( *i ).first.c_str() );
}
gtk_widget_show( GTK_WIDGET( combo ) );
ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] ));
gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), " " );
gtk_widget_hide( widget );
- gtk_widget_ref( widget );
+ g_object_ref( widget );
gtk_container_remove( GTK_CONTAINER( g_spawnflagsTable ), widget );
}
}
gtk_table_attach( g_spawnflagsTable, widget, i % 4, i % 4 + 1, i / 4, i / 4 + 1,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( GTK_FILL ), 0, 0 );
- gtk_widget_unref( widget );
+ g_object_unref( widget );
gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), str.c_str() );
}
for ( int i = 0; i < MAX_FLAGS; i++ )
{
GtkCheckButton* check = ui::CheckButton( "" );
- gtk_widget_ref( GTK_WIDGET( check ) );
+ g_object_ref( GTK_WIDGET( check ) );
g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) );
g_entitySpawnflagsCheck[i] = check;
}
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnApply ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
button = ui::Button( "Close" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnClose ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
return dlg;
}
}
}
-static gboolean switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){
+static gboolean switch_page( GtkNotebook *notebook, gpointer page, guint page_num, gpointer data ){
GroupDialog_updatePageTitle( ui::Window(GTK_WINDOW( data )), page_num );
g_current_page = page_num;
struct GameCombo
{
- GtkComboBox* game_select;
+ ui::ComboBoxText game_select;
GtkEntry* fsgame_entry;
};
{
dialog.game_combo.game_select = ui::ComboBoxText();
- gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().basegame );
+ gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().basegame );
if ( globalGameComboConfiguration().known[0] != '\0' ) {
- gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().known );
+ gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().known );
}
- gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom );
+ gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom );
gtk_widget_show( GTK_WIDGET( dialog.game_combo.game_select ) );
gtk_table_attach( table2, GTK_WIDGET( dialog.game_combo.game_select ), 1, 2, 0, 1,
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
- GtkComboBox* combo = ui::ComboBoxText();
- gtk_combo_box_append_text( combo, globalMappingMode().sp_mapping_mode );
- gtk_combo_box_append_text( combo, globalMappingMode().mp_mapping_mode );
+ auto combo = ui::ComboBoxText();
+ gtk_combo_box_text_append_text( combo, globalMappingMode().sp_mapping_mode );
+ gtk_combo_box_text_append_text( combo, globalMappingMode().mp_mapping_mode );
gtk_widget_show( GTK_WIDGET( combo ) );
gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 3, 4,
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( editor_close ), dlg );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
button = ui::Button( "Save" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( editor_save ), dlg );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
text_editor = dlg;
text_widget = text;
return create_menu_item_with_mnemonic( menu, mnemonic, command );
}
-GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){
+GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){
return toolbar_append_button( toolbar, description, icon, GlobalCommands_find( commandName ) );
}
-GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){
+GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){
return toolbar_append_toggle_button( toolbar, description, icon, GlobalToggles_find( commandName ) );
}
bool color_dialog( ui::Widget parent, Vector3& color, const char* title ){
ui::Widget dlg;
- double clr[3];
+ GdkColor clr = { 0, guint16(color[0] * 65535), guint16(color[1] * 65535), guint16(color[2] * 65535) };
ModalDialog dialog;
- clr[0] = color[0];
- clr[1] = color[1];
- clr[2] = color[2];
-
dlg = ui::Widget(gtk_color_selection_dialog_new( title ));
- gtk_color_selection_set_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), clr );
+ gtk_color_selection_set_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), &clr );
g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( dialog_delete_callback ), &dialog );
GtkWidget *ok_button, *cancel_button;
g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr);
bool ok = modal_dialog_show( GTK_WINDOW( dlg ), dialog ) == eIDOK;
if ( ok ) {
- GdkColor gdkcolor;
- gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), &gdkcolor );
- clr[0] = gdkcolor.red / 65535.0;
- clr[1] = gdkcolor.green / 65535.0;
- clr[2] = gdkcolor.blue / 65535.0;
-
- color[0] = (float)clr[0];
- color[1] = (float)clr[1];
- color[2] = (float)clr[2];
+ gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), &clr );
+ color[0] = clr.red / 65535.0f;
+ color[1] = clr.green / 65535.0f;
+ color[2] = clr.blue / 65535.0f;
}
gtk_widget_destroy( dlg );
typedef struct _GtkToolbar GtkToolbar;
// this DOES NOT set up the shortcut using command_connect_accelerator
-GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName );
+GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName );
// this DOES NOT set up the shortcut using command_connect_accelerator
-GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName );
+GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName );
template<typename Element> class BasicVector3;
G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION ), error_redirect, 0 );
g_log_set_handler( "GLib", (GLogLevelFlags)( G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION ), error_redirect, 0 );
- g_log_set_handler( 0, (GLogLevelFlags)( G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING |
+ g_log_set_handler( nullptr, (GLogLevelFlags)( G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION ), error_redirect, 0 );
GlobalDebugMessageHandler::instance().setHandler( GlobalPopupDebugMessageHandler::instance() );
void EverySecondTimer_enable(){
if ( s_qe_every_second_id == 0 ) {
- s_qe_every_second_id = gtk_timeout_add( 1000, qe_every_second, 0 );
+ s_qe_every_second_id = g_timeout_add( 1000, qe_every_second, 0 );
}
}
void EverySecondTimer_disable(){
if ( s_qe_every_second_id != 0 ) {
- gtk_timeout_remove( s_qe_every_second_id );
+ g_source_remove( s_qe_every_second_id );
s_qe_every_second_id = 0;
}
}
GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){
GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
- gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL );
+ gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL );
gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
gtk_widget_show( GTK_WIDGET( toolbar ) );
+ auto space = [&]() {
+ auto btn = gtk_separator_tool_item_new();
+ gtk_widget_show(GTK_WIDGET(btn));
+ gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(btn));
+ };
+
File_constructToolbar( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
UndoRedo_constructToolbar( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
RotateFlip_constructToolbar( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
Select_constructToolbar( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
CSG_constructToolbar( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
ComponentModes_constructToolbar( toolbar );
if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating ) {
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
XYWnd_constructToolbar( toolbar );
}
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
CamWnd_constructToolbar( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
Manipulators_constructToolbar( toolbar );
if ( g_Layout_enablePatchToolbar.m_value ) {
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
Patch_constructToolbar( toolbar );
}
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT +T)", "texture_lock.png", "TogTexLock" );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
/*GtkButton* g_view_entities_button =*/ toolbar_append_button( toolbar, "Entities (N)", "entities.png", "ToggleEntityInspector" );
- GtkButton* g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" );
- GtkButton* g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" );
+ auto g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" );
+ auto g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" );
// TODO: call light inspector
//GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.png", "ToggleLightInspector");
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ space();
/*GtkButton* g_refresh_models_button =*/ toolbar_append_button( toolbar, "Refresh Models", "refresh_models.png", "RefreshReferences" );
gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_entry_set_editable( entry, FALSE );
+ gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
brushes_entry = entry;
}
gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_entry_set_editable( entry, FALSE );
+ gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
entities_entry = entry;
}
float m_fVShift; */
int m_nCol;
int m_nRow;
-GtkComboBox *m_pRowCombo;
-GtkComboBox *m_pColCombo;
+ui::ComboBoxText m_pRowCombo{nullptr};
+ui::ComboBoxText m_pColCombo{nullptr};
std::size_t m_countRows;
std::size_t m_countCols;
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
- GtkComboBox* combo = ui::ComboBoxText();
+ auto combo = ui::ComboBoxText();
g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
- AddDialogData( *combo, m_nRow );
+ AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
gtk_widget_show( GTK_WIDGET( combo ) );
gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( combo ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
m_pRowCombo = combo;
}
{
- GtkComboBox* combo = ui::ComboBoxText();
+ auto combo = ui::ComboBoxText();
g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
- AddDialogData( *combo, m_nCol );
+ AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
gtk_widget_show( GTK_WIDGET( combo ) );
gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( combo ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
m_pColCombo = combo;
}
}
}
{
GtkEntry* entry = ui::Entry();
- // gtk_entry_set_editable (GTK_ENTRY (entry), false);
+ // gtk_editable_set_editable (GTK_ENTRY (entry), false);
gtk_widget_show( GTK_WIDGET( entry ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
AddDialogData( *entry, m_strName );
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
GtkLabel* label = GTK_LABEL( ui::Label( "Vertical Stretch Step" ) );
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
GtkLabel* label = GTK_LABEL( ui::Label( "Rotate Step" ) );
gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 0, 1,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
g_object_set_data( G_OBJECT( window ), "hshift_entry", entry );
// we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised
// so we need to have at least one initialisation somewhere
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
entry_set_float( entry, g_pi_globals.shift[1] );
auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 2, 3,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
entry_set_float( entry, g_pi_globals.scale[0] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 3, 4,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
entry_set_float( entry, g_pi_globals.scale[1] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 4, 5,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
entry_set_float( entry, g_pi_globals.rotate );
auto adj = ui::Adjustment( 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_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
}
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
GtkButton* button = ui::Button( "CAP" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
GtkButton* button = ui::Button( "Set..." );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
GtkButton* button = ui::Button( "Natural" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
GtkButton* button = ui::Button( "Fit" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
- gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
}
}
for ( std::size_t i = 0; i < m_countRows; ++i )
{
- gtk_combo_box_remove_text( m_pRowCombo, gint( m_countRows - i - 1 ) );
+ gtk_combo_box_text_remove( m_pRowCombo, gint( m_countRows - i - 1 ) );
}
m_countRows = m_Patch->getHeight();
{
char buffer[16];
sprintf( buffer, "%u", Unsigned( i ) );
- gtk_combo_box_append_text( m_pRowCombo, buffer );
+ gtk_combo_box_text_append_text( m_pRowCombo, buffer );
}
gtk_combo_box_set_active( m_pRowCombo, 0 );
for ( std::size_t i = 0; i < m_countCols; ++i )
{
- gtk_combo_box_remove_text( m_pColCombo, gint( m_countCols - i - 1 ) );
+ gtk_combo_box_text_remove( m_pColCombo, gint( m_countCols - i - 1 ) );
}
m_countCols = m_Patch->getWidth();
{
char buffer[16];
sprintf( buffer, "%u", Unsigned( i ) );
- gtk_combo_box_append_text( m_pColCombo, buffer );
+ gtk_combo_box_text_append_text( m_pColCombo, buffer );
}
gtk_combo_box_set_active( m_pColCombo, 0 );
}
{
- GtkComboBox* combo = ui::ComboBoxText();
-#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_append_text( combo, # x )
+ auto combo = ui::ComboBoxText();
+#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_text_append_text( combo, # x )
D_ITEM( 3 );
D_ITEM( 5 );
D_ITEM( 7 );
width = combo;
}
{
- GtkComboBox* combo = ui::ComboBoxText();
-#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_append_text( combo, # x )
+ auto combo = ui::ComboBoxText();
+#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_text_append_text( combo, # x )
D_ITEM( 3 );
D_ITEM( 5 );
D_ITEM( 7 );
gtk_table_attach( table, button, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
bevel = button;
}
gtk_table_attach( table, button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
endcap = button;
}
gtk_table_attach( table, button, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
ibevel = button;
}
gtk_table_attach( table, button, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
iendcap = button;
}
gtk_table_attach( table, button, 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) );
+ group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
cylinder = button;
}
void PluginsMenu_clear(){
m_nNextPlugInID = 0;
- GList* lst = g_list_find( gtk_container_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) );
+ GList* lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) );
while ( lst->next )
{
gtk_container_remove( GTK_CONTAINER( g_plugins_menu ), GTK_WIDGET( lst->next->data ) );
- lst = g_list_find( gtk_container_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) );
+ lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) );
}
}
{
StringOutputStream fullpath( 256 );
fullpath << GameToolsPath_get() << g_pluginsDir << "bitmaps/" << filename;
- GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() );
- if ( image != 0 ) {
- return image;
- }
+ char *s = fullpath.c_str();
+ if ( auto image = image_new_from_file_with_mask(s) ) return image;
}
{
StringOutputStream fullpath( 256 );
fullpath << AppPath_get() << g_pluginsDir << "bitmaps/" << filename;
- GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() );
- if ( image != 0 ) {
- return image;
- }
+ char *s = fullpath.c_str();
+ if ( auto image = image_new_from_file_with_mask(s) ) return image;
}
{
StringOutputStream fullpath( 256 );
fullpath << AppPath_get() << g_modulesDir << "bitmaps/" << filename;
- GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() );
- if ( image != 0 ) {
- return image;
- }
+ char *s = fullpath.c_str();
+ if ( auto image = image_new_from_file_with_mask(s) ) return image;
}
return image_new_missing();
}
-inline GtkToolbarChildType gtktoolbarchildtype_for_toolbarbuttontype( IToolbarButton::EType type ){
- switch ( type )
- {
- case IToolbarButton::eSpace:
- return GTK_TOOLBAR_CHILD_SPACE;
- case IToolbarButton::eButton:
- return GTK_TOOLBAR_CHILD_BUTTON;
- case IToolbarButton::eToggleButton:
- return GTK_TOOLBAR_CHILD_TOGGLEBUTTON;
- case IToolbarButton::eRadioButton:
- return GTK_TOOLBAR_CHILD_RADIOBUTTON;
+void toolbar_insert( GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GCallback handler, gpointer data ){
+ if (type == IToolbarButton::eSpace) {
+ auto it = gtk_separator_tool_item_new();
+ gtk_widget_show(GTK_WIDGET(it));
+ gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(it));
+ return;
+ }
+ if (type == IToolbarButton::eButton) {
+ auto button = gtk_tool_button_new(GTK_WIDGET(new_plugin_image(icon)), text);
+ gtk_widget_set_tooltip_text(GTK_WIDGET(button), tooltip);
+ gtk_widget_show_all(GTK_WIDGET(button));
+ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(handler), data);
+ gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button));
+ return;
+ }
+ if (type == IToolbarButton::eToggleButton) {
+ auto button = gtk_toggle_tool_button_new();
+ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), GTK_WIDGET(new_plugin_image(icon)));
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), text);
+ gtk_widget_set_tooltip_text(GTK_WIDGET(button), tooltip);
+ gtk_widget_show_all(GTK_WIDGET(button));
+ g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(handler), data);
+ gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button));
+ return;
}
ERROR_MESSAGE( "invalid toolbar button type" );
- return (GtkToolbarChildType)0;
-}
-
-void toolbar_insert( GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GtkSignalFunc handler, gpointer data ){
- gtk_toolbar_append_element( toolbar, gtktoolbarchildtype_for_toolbarbuttontype( type ), 0, text, tooltip, "", GTK_WIDGET( new_plugin_image( icon ) ), handler, data );
}
-void ActivateToolbarButton( ui::Widget widget, gpointer data ){
- const_cast<const IToolbarButton*>( reinterpret_cast<IToolbarButton*>( data ) )->activate();
+void ActivateToolbarButton( GtkToolButton *widget, gpointer data ){
+ (const_cast<const IToolbarButton *>( reinterpret_cast<IToolbarButton *>( data )))->activate();
}
void PlugInToolbar_AddButton( GtkToolbar* toolbar, const IToolbarButton* button ){
- toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), GTK_SIGNAL_FUNC( ActivateToolbarButton ), reinterpret_cast<gpointer>( const_cast<IToolbarButton*>( button ) ) );
+ toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), G_CALLBACK( ActivateToolbarButton ), reinterpret_cast<gpointer>( const_cast<IToolbarButton*>( button ) ) );
}
GtkToolbar* g_plugin_toolbar = 0;
GtkToolbar *toolbar;
toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
- gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL );
+ gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL );
gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
gtk_widget_show( GTK_WIDGET( toolbar ) );
}
}
- gtk_notebook_set_page( GTK_NOTEBOOK( m_notebook ), 0 );
+ gtk_notebook_set_current_page( GTK_NOTEBOOK( m_notebook ), 0 );
return dialog;
}
// increment * scale = gridsize
static void OnBtnMatchGrid( ui::Widget widget, gpointer data ){
float hscale, vscale;
- hscale = static_cast<float>( gtk_spin_button_get_value_as_float( getSurfaceInspector().m_hscaleIncrement.m_spin ) );
- vscale = static_cast<float>( gtk_spin_button_get_value_as_float( getSurfaceInspector().m_vscaleIncrement.m_spin ) );
+ hscale = static_cast<float>( gtk_spin_button_get_value( getSurfaceInspector().m_hscaleIncrement.m_spin ) );
+ vscale = static_cast<float>( gtk_spin_button_get_value( getSurfaceInspector().m_vscaleIncrement.m_spin ) );
if ( hscale == 0.0f || vscale == 0.0f ) {
globalOutputStream() << "ERROR: unexpected scale == 0.0f\n";
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
m_hshiftIncrement.m_entry = entry;
m_hshiftEntry.connect( entry );
}
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
m_vshiftIncrement.m_entry = entry;
m_vshiftEntry.connect( entry );
}
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 2, 3 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
m_hscaleIncrement.m_entry = entry;
m_hscaleEntry.connect( entry );
}
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
m_vscaleIncrement.m_entry = entry;
m_vscaleEntry.connect( entry );
}
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
gtk_spin_button_set_wrap( spin, TRUE );
}
{
gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
+ gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
m_rotateIncrement.m_entry = entry;
m_rotateEntry.connect( entry );
}
(GtkAttachOptions) ( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnBtnAxial ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
}
{
ui::Widget button = ui::Button( "Fit" );
(GtkAttachOptions) ( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnBtnFaceFit ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
}
{
ui::Widget button = ui::Button( "CAP" );
(GtkAttachOptions) ( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnBtnPatchdetails ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
}
{
ui::Widget button = ui::Button( "Set..." );
(GtkAttachOptions) ( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnBtnPatchreset ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
}
{
ui::Widget button = ui::Button( "Natural" );
(GtkAttachOptions) ( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnBtnPatchnatural ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
}
{
ui::Widget button = ui::Button( "Fit" );
(GtkAttachOptions) ( 0 ), 0, 0 );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK( OnBtnPatchFit ), 0 );
- gtk_widget_set_usize( button, 60, -2 );
+ gtk_widget_set_size_request( button, 60, -1 );
}
{
ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal );
}
{
gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
+ gtk_widget_set_size_request( spin, 60, -1 );
AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitVertical );
}
}
//Prolly should make this a member or global var, so the SI can draw on it...
TexTool::g_textoolWin = glwidget_new( FALSE );
// --> Dunno, but this stuff may be necessary... (Looks like it!)
- gtk_widget_ref( TexTool::g_textoolWin );
+ g_object_ref( TexTool::g_textoolWin );
gtk_widget_set_events( TexTool::g_textoolWin, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK );
gtk_widget_set_can_focus( TexTool::g_textoolWin, true );
// <-- end stuff...
gtk_widget_show( TexTool::g_textoolWin );
- gtk_widget_set_usize( TexTool::g_textoolWin, -1, 240 ); //Yeah!
+ gtk_widget_set_size_request( TexTool::g_textoolWin, -1, 240 ); //Yeah!
gtk_container_add( GTK_CONTAINER( frame ), TexTool::g_textoolWin );
g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL );
void SurfaceInspector::ApplyTexdef(){
texdef_t shiftScaleRotate;
- shiftScaleRotate.shift[0] = static_cast<float>( gtk_spin_button_get_value_as_float( m_hshiftIncrement.m_spin ) );
- shiftScaleRotate.shift[1] = static_cast<float>( gtk_spin_button_get_value_as_float( m_vshiftIncrement.m_spin ) );
- shiftScaleRotate.scale[0] = static_cast<float>( gtk_spin_button_get_value_as_float( m_hscaleIncrement.m_spin ) );
- shiftScaleRotate.scale[1] = static_cast<float>( gtk_spin_button_get_value_as_float( m_vscaleIncrement.m_spin ) );
- shiftScaleRotate.rotate = static_cast<float>( gtk_spin_button_get_value_as_float( m_rotateIncrement.m_spin ) );
+ shiftScaleRotate.shift[0] = static_cast<float>( gtk_spin_button_get_value( m_hshiftIncrement.m_spin ) );
+ shiftScaleRotate.shift[1] = static_cast<float>( gtk_spin_button_get_value( m_vshiftIncrement.m_spin ) );
+ shiftScaleRotate.scale[0] = static_cast<float>( gtk_spin_button_get_value( m_hscaleIncrement.m_spin ) );
+ shiftScaleRotate.scale[1] = static_cast<float>( gtk_spin_button_get_value( m_vscaleIncrement.m_spin ) );
+ shiftScaleRotate.rotate = static_cast<float>( gtk_spin_button_get_value( m_rotateIncrement.m_spin ) );
TextureProjection projection;
//Shamus: This is the other place that screws up, it seems, since it doesn't seem to do the
gtk_widget_show_all( g_TextureBrowser.m_search_button );
}
else {
- gtk_widget_hide_all( g_TextureBrowser.m_search_button );
+ gtk_widget_hide( g_TextureBrowser.m_search_button );
}
}
}
void TextureBrowser_constructSearchButton(){
- GtkTooltips* tooltips = gtk_tooltips_new();
-
ui::Widget image = ui::Widget(gtk_image_new_from_stock( GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR ));
g_TextureBrowser.m_search_button = ui::Button();
g_signal_connect( G_OBJECT( g_TextureBrowser.m_search_button ), "clicked", G_CALLBACK( TextureBrowser_searchTags ), NULL );
- gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), g_TextureBrowser.m_search_button, "Search with selected tags", "Search with selected tags" );
+ gtk_widget_set_tooltip_text(g_TextureBrowser.m_search_button, "Search with selected tags");
gtk_container_add( GTK_CONTAINER( g_TextureBrowser.m_search_button ), image );
}
ui::Widget menu_view = ui::Menu();
auto view_item = TextureBrowser_constructViewMenu( GTK_MENU( menu_view ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( view_item ), menu_view );
- gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), view_item );
+ gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), view_item );
ui::Widget menu_tools = ui::Menu();
auto tools_item = TextureBrowser_constructToolsMenu( GTK_MENU( menu_tools ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( tools_item ), menu_tools );
- gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tools_item );
+ gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tools_item );
gtk_table_attach( GTK_TABLE( table ), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0 );
gtk_widget_show( menu_bar );
}
{ // gl_widget
g_TextureBrowser.m_gl_widget = ui::Widget(glwidget_new( FALSE ));
- gtk_widget_ref( g_TextureBrowser.m_gl_widget );
+ g_object_ref( g_TextureBrowser.m_gl_widget );
gtk_widget_set_events( g_TextureBrowser.m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
gtk_widget_set_can_focus( g_TextureBrowser.m_gl_widget, true );
ui::Widget menu_tags = ui::Menu();
auto tags_item = TextureBrowser_constructTagsMenu( GTK_MENU( menu_tags ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags );
- gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tags_item );
+ gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tags_item );
}
{ // Tag TreeView
g_TextureBrowser.m_scr_win_tags = ui::ScrolledWindow();
g_signal_handler_disconnect( G_OBJECT( g_TextureBrowser.m_gl_widget ), g_TextureBrowser.m_sizeHandler );
g_signal_handler_disconnect( G_OBJECT( g_TextureBrowser.m_gl_widget ), g_TextureBrowser.m_exposeHandler );
- gtk_widget_unref( g_TextureBrowser.m_gl_widget );
+ g_object_unref( g_TextureBrowser.m_gl_widget );
}
const Vector3& TextureBrowser_getBackgroundColour( TextureBrowser& textureBrowser ){
}
m_eState = EIdle;
if ( s_routine_id ) {
- gtk_timeout_remove( s_routine_id );
+ g_source_remove( s_routine_id );
s_routine_id = 0;
}
}
}
}
m_eState = EBeginStep;
- s_routine_id = gtk_timeout_add( 25, watchbsp_routine, this );
+ s_routine_id = g_timeout_add( 25, watchbsp_routine, this );
}
m_window_observer->setRectangleDrawCallback( ReferenceCaller1<XYWnd, rect_t, xy_update_xor_rectangle>( *this ) );
m_window_observer->setView( m_view );
- gtk_widget_ref( m_gl_widget );
+ g_object_ref( m_gl_widget );
gtk_widget_set_events( m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
gtk_widget_set_can_focus( m_gl_widget, true );
g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_sizeHandler );
g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_exposeHandler );
- gtk_widget_unref( m_gl_widget );
+ g_object_unref( m_gl_widget );
m_window_observer->release();
}