gtk_widget_show( m_pFileLabel );
w = ui::Button( "Browse..." );
- g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( browse_callback ),
- ( gpointer ) this );
+ w.connect( "clicked", G_CALLBACK( browse_callback ), ( gpointer ) this );
gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
gtk_tooltips_set_tip( pTooltips, w, "Select a file", NULL );
gtk_widget_show( w );
w = ui::Button( "Reload" );
- g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( reload_callback ),
- ( gpointer ) this );
+ w.connect( "clicked", G_CALLBACK( reload_callback ), ( gpointer ) this );
// TODO disable until we have file
// gtk_widget_set_sensitive(w,FALSE);
gtk_tooltips_set_tip( pTooltips, w, "Reload current file", NULL );
w = ui::HScale( 0.0, 1.0, 0.01 );
gtk_range_set_value( GTK_RANGE( w ),0.5 );
gtk_scale_set_value_pos( GTK_SCALE( w ),GTK_POS_LEFT );
- g_signal_connect( G_OBJECT( w ), "value-changed",
- G_CALLBACK( alpha_adjust_callback ), ( gpointer ) this );
+ w.connect( "value-changed", G_CALLBACK( alpha_adjust_callback ), ( gpointer ) this );
gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, TRUE, 5 );
gtk_tooltips_set_tip( pTooltips, w, "Set image transparancy", NULL );
gtk_widget_show( w );
w = ui::Button( "from selection" );
gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 5 );
- g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_sel_callback ),
- ( gpointer ) this );
+ w.connect( "clicked", G_CALLBACK( size_sel_callback ), ( gpointer ) this );
gtk_tooltips_set_tip( pTooltips, w, "Set the size of the image to the bounding rectangle of all selected brushes and entities", NULL );
gtk_widget_show( w );
if ( m_vt == XY ) {
w = ui::Button( "from map mins/maxs" );
gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 2 );
- g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_mm_callback ),
- ( gpointer ) this );
+ w.connect( "clicked", G_CALLBACK( size_mm_callback ), ( gpointer ) this );
gtk_tooltips_set_tip( pTooltips, w, "Set the size of the image using the mapcoordsmins and mapcoordsmaxs keys of the worldspawn entity", NULL );
gtk_widget_show( w );
}
// GTK_STOCK_CLOSE,
// GTK_RESPONSE_CLOSE,
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 );
+ pDialogWnd.connect( "delete_event", G_CALLBACK( close_callback ), NULL );
+ pDialogWnd.connect( "response", G_CALLBACK( response_callback ), NULL );
+// pDialogWnd.connect( "expose_event", G_CALLBACK( ci_expose ), NULL );
pTooltips = gtk_tooltips_new();
---------------------------------*/
typedef struct {
- GtkWidget *cbTexChange;
- GtkWidget *editTexOld, *editTexNew;
+ ui::Widget cbTexChange;
+ ui::Widget editTexOld, editTexNew;
- GtkWidget *cbScaleHor, *cbScaleVert;
- GtkWidget *editScaleHor, *editScaleVert;
+ ui::Widget cbScaleHor, cbScaleVert;
+ ui::Widget editScaleHor, editScaleVert;
- GtkWidget *cbShiftHor, *cbShiftVert;
- GtkWidget *editShiftHor, *editShiftVert;
+ ui::Widget cbShiftHor, cbShiftVert;
+ ui::Widget editShiftHor, editShiftVert;
- GtkWidget *cbRotation;
- GtkWidget *editRotation;
+ ui::Widget cbRotation;
+ ui::Widget editRotation;
}dlg_texReset_t;
dlg_texReset_t dlgTexReset;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_set_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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
- G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
gtk_widget_show( w );
ret = eIDNO;
}
}
EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
- GtkWidget *w, *hbox;
+ GtkWidget *hbox;
GtkWidget *check1, *check2;
EMessageBoxReturn ret;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Intersect" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
gtk_box_pack_start( GTK_BOX( vbox ), radio2, FALSE, FALSE, 2 );
gtk_widget_show( radio2 );
- w = gtk_hseparator_new();
- gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 );
- gtk_widget_show( w );
+ auto hsep = ui::Widget(gtk_hseparator_new());
+ gtk_box_pack_start( GTK_BOX( vbox ), hsep, FALSE, FALSE, 2 );
+ hsep.show();
check1 = ui::CheckButton( "Include Detail Brushes" );
gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 );
// ---- hbox ---- ok/cancel buttons
- w = ui::Button( "Ok" );
+ auto w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
}
EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
- GtkWidget *w, *hbox, *vbox2, *hbox2;
+ GtkWidget *hbox, *vbox2, *hbox2;
GtkWidget *check1, *check2, *check3;
GtkWidget *text1, *text2;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
gtk_box_pack_start( GTK_BOX( hbox2 ), text1, FALSE, FALSE, 2 );
gtk_widget_show( text1 );
- w = ui::Label( "Number Of Sides" );
- gtk_box_pack_start( GTK_BOX( hbox2 ), w, FALSE, FALSE, 2 );
- gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
- gtk_widget_show( w );
+ auto l = ui::Label( "Number Of Sides" );
+ gtk_box_pack_start( GTK_BOX( hbox2 ), l, FALSE, FALSE, 2 );
+ gtk_label_set_justify( GTK_LABEL( l ), GTK_JUSTIFY_LEFT );
+ gtk_widget_show( l );
// ---- /hbox2 ----
gtk_box_pack_start( GTK_BOX( hbox2 ), text2, FALSE, FALSE, 2 );
gtk_widget_show( text2 );
- w = ui::Label( "Border Width" );
- gtk_box_pack_start( GTK_BOX( hbox2 ), w, FALSE, FALSE, 2 );
- gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
- gtk_widget_show( w );
+ l = ui::Label( "Border Width" );
+ gtk_box_pack_start( GTK_BOX( hbox2 ), l, FALSE, FALSE, 2 );
+ gtk_label_set_justify( GTK_LABEL( l ), GTK_JUSTIFY_LEFT );
+ gtk_widget_show( l );
// ---- /hbox2 ----
// ---- hbox ----
- w = ui::Button( "Ok" );
+ auto w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// for stair builder stuck as close as i could to the MFC version
// obviously feel free to change it at will :)
EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
- GtkWidget *w;
GtkWidget *textStairHeight, *textRiserTex, *textMainTex;
GtkWidget *radioNorth, *radioSouth, *radioEast, *radioWest; // i'm guessing we can't just abuse 'w' for these if we're getting a value
GtkWidget *radioOldStyle, *radioBobStyle, *radioCornerStyle;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" );
gtk_widget_show( hbox );
// dunno if you want this text or not ...
- w = ui::Label( text );
+ ui::Widget w = ui::Label( text );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); // not entirely sure on all the parameters / what they do ...
gtk_widget_show( w );
- w = gtk_hseparator_new();
+ w = ui::Widget(gtk_hseparator_new());
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
gtk_widget_show( w );
// -------------------------- //
- w = gtk_hseparator_new();
+ w = ui::Widget(gtk_hseparator_new());
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
}
EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
- GtkWidget *hbox, *w;
+ GtkWidget *hbox;
GtkWidget *textFrontBackTex, *textTrimTex;
GtkWidget *checkScaleMainH, *checkScaleMainV, *checkScaleTrimH, *checkScaleTrimV;
GtkWidget *comboMain, *comboTrim;
- GtkWidget *buttonSetMain, *buttonSetTrim;
GtkWidget *radioNS, *radioEW;
GSList *radioOrientation;
TwinWidget tw1, tw2;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" );
gtk_box_pack_start( GTK_BOX( hbox ), textFrontBackTex, FALSE, FALSE, 0 );
gtk_widget_show( textFrontBackTex );
- w = ui::Label( "Door Front/Back Texture" );
+ ui::Widget w = ui::Label( "Door Front/Back Texture" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
tw1.one = textFrontBackTex;
tw1.two = GTK_COMBO_BOX(comboMain);
- buttonSetMain = ui::Button( "Set As Main Texture" );
- g_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 );
+ auto buttonSetMain = ui::Button( "Set As Main Texture" );
+ buttonSetMain.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetMain );
tw2.one = textTrimTex;
tw2.two = GTK_COMBO_BOX(comboTrim);
- buttonSetTrim = ui::Button( "Set As Trim Texture" );
- g_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 );
+ auto buttonSetTrim = ui::Button( "Set As Trim Texture" );
+ buttonSetTrim.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetTrim );
// ----------------- //
- w = gtk_hseparator_new();
+ w = ui::Widget(gtk_hseparator_new());
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
}
EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
- GtkWidget *w, *hbox;
+ ui::Widget w, hbox;
- GtkWidget *text1, *text2, *text3;
- GtkWidget *check1, *check2;
+ ui::Entry text1, text2, text3;
+ ui::Widget check1, check2;
EMessageBoxReturn ret;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
// ---- hbox ----
text1 = ui::Entry( 256 );
- gtk_entry_set_text( (GtkEntry*)text1, "25" );
+ gtk_entry_set_text( text1, "25" );
gtk_box_pack_start( GTK_BOX( hbox ), text1, FALSE, FALSE, 2 );
gtk_widget_show( text1 );
// ---- hbox ----
text2 = ui::Entry( 256 );
- gtk_entry_set_text( (GtkEntry*)text2, "3" );
+ gtk_entry_set_text( text2, "3" );
gtk_box_pack_start( GTK_BOX( hbox ), text2, FALSE, FALSE, 2 );
gtk_widget_show( text2 );
// ---- hbox ----
text3 = ui::Entry( 256 );
- gtk_entry_set_text( (GtkEntry*)text3, "-800" );
+ gtk_entry_set_text( text3, "-800" );
gtk_box_pack_start( GTK_BOX( hbox ), text3, FALSE, FALSE, 2 );
gtk_widget_show( text3 );
// ---- /hbox ----
- w = gtk_hseparator_new();
+ w = ui::Widget(gtk_hseparator_new());
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
// ----------------- //
- w = gtk_hseparator_new();
+ w = ui::Widget(gtk_hseparator_new());
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
w = ui::Button( "Enable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
}
EMessageBoxReturn DoCTFColourChangeBox(){
- GtkWidget *w, *hbox;
+ ui::Widget w, hbox;
EMessageBoxReturn ret;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Red->Blue" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
Str texSelected;
- GtkWidget *w, *hbox;
+ ui::Widget w, hbox;
EMessageBoxReturn ret;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
// ---- frame ----
dlgTexReset.cbTexChange = ui::CheckButton( "Enabled" );
- g_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
+ dlgTexReset.cbTexChange.connect( "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" );
- g_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
+ dlgTexReset.cbScaleHor.connect( "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" );
- g_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
+ dlgTexReset.cbScaleVert.connect( "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" );
- g_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
+ dlgTexReset.cbShiftHor.connect( "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" );
- g_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
+ dlgTexReset.cbShiftVert.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
Str texSelected;
- GtkWidget *w, *hbox;
+ ui::Widget w, hbox;
- GtkWidget *radiusX, *radiusY;
- GtkWidget *angleStart, *angleEnd;
- GtkWidget *heightStart, *heightEnd;
- GtkWidget *numPoints;
+ ui::Widget radiusX, radiusY;
+ ui::Widget angleStart, angleEnd;
+ ui::Widget heightStart, heightEnd;
+ ui::Widget numPoints;
EMessageBoxReturn ret;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// ailmanki
// add a simple input for the MakeChain thing..
EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
- GtkWidget *w;
- GtkWidget *textlinkNum, *textlinkName;
+ ui::Widget w;
+ ui::Entry textlinkNum, textlinkName;
EMessageBoxReturn ret;
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Make Chain" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
- w = gtk_hseparator_new();
+ w = ui::Widget(gtk_hseparator_new());
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
dialogError = FALSE;
if ( ret == eIDOK ) {
- strcpy( rs->linkName, gtk_entry_get_text( (GtkEntry*)textlinkName ) );
- if ( !ValidateTextInt( gtk_entry_get_text( (GtkEntry*)textlinkNum ), "Elements", &rs->linkNum ) ) {
+ strcpy( rs->linkName, gtk_entry_get_text( textlinkName ) );
+ if ( !ValidateTextInt( gtk_entry_get_text( textlinkNum ), "Elements", &rs->linkNum ) ) {
dialogError = TRUE;
}
}
GtkWidget *r_collapsebymaterial;
GtkWidget *r_nocollapse;
GtkWidget *vbox3;
- GtkWidget *b_export;
- GtkWidget *b_close;
GtkWidget *vbox2;
GtkWidget *label1;
GtkWidget *ed_materialname;
GtkWidget *hbox1;
- GtkWidget *b_addmaterial;
- GtkWidget *b_removematerial;
- GtkWidget *t_exportmaterials;
GtkWidget *t_limitmatnames;
GtkWidget *t_objects;
gtk_widget_show( vbox3 );
gtk_box_pack_start( GTK_BOX( hbox2 ), vbox3, FALSE, FALSE, 0 );
- b_export = gtk_button_new_from_stock( "gtk-save" );
+ auto b_export = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-save" )));
gtk_widget_set_name( b_export, "b_export" );
gtk_widget_show( b_export );
gtk_box_pack_start( GTK_BOX( vbox3 ), b_export, TRUE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( b_export ), 5 );
- b_close = gtk_button_new_from_stock( "gtk-cancel" );
+ auto b_close = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-cancel" )));
gtk_widget_set_name( b_close, "b_close" );
gtk_widget_show( b_close );
gtk_box_pack_start( GTK_BOX( vbox3 ), b_close, TRUE, FALSE, 0 );
gtk_widget_show( hbox1 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox1, FALSE, FALSE, 0 );
- b_addmaterial = gtk_button_new_from_stock( "gtk-add" );
+ auto b_addmaterial = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-add" )));
gtk_widget_set_name( b_addmaterial, "b_addmaterial" );
gtk_widget_show( b_addmaterial );
gtk_box_pack_start( GTK_BOX( hbox1 ), b_addmaterial, FALSE, FALSE, 0 );
- b_removematerial = gtk_button_new_from_stock( "gtk-remove" );
+ auto b_removematerial = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-remove" )));
gtk_widget_set_name( b_removematerial, "b_removematerial" );
gtk_widget_show( b_removematerial );
gtk_box_pack_start( GTK_BOX( hbox1 ), b_removematerial, FALSE, FALSE, 0 );
gtk_widget_show( t_objects );
gtk_box_pack_end( GTK_BOX( vbox2 ), t_objects, FALSE, FALSE, 0 );
- t_exportmaterials = gtk_check_button_new_with_mnemonic( "Create material information (.mtl file)" );
+ auto t_exportmaterials = ui::CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_mnemonic( "Create material information (.mtl file)" )));
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( t_exportmaterials ), true );
gtk_widget_set_name( t_exportmaterials, "t_exportmaterials" );
gtk_widget_show( t_exportmaterials );
gtk_box_pack_end( GTK_BOX( vbox2 ), t_exportmaterials, FALSE, FALSE, 10 );
using namespace callbacks;
- g_signal_connect( G_OBJECT( w_plugplug2 ), "destroy", G_CALLBACK( OnDestroy ), NULL );
+ w_plugplug2.connect( "destroy", G_CALLBACK( OnDestroy ), NULL );
g_signal_connect_swapped( G_OBJECT( b_close ), "clicked", G_CALLBACK( OnDestroy ), NULL );
- g_signal_connect( ( gpointer )b_export, "clicked", G_CALLBACK( OnExportClicked ), NULL );
- g_signal_connect( ( gpointer )b_addmaterial, "clicked", G_CALLBACK( OnAddMaterial ), NULL );
- g_signal_connect( ( gpointer )b_removematerial, "clicked", G_CALLBACK( OnRemoveMaterial ), NULL );
- g_signal_connect( ( gpointer )t_exportmaterials, "clicked", G_CALLBACK( OnExportMatClicked ), NULL );
+ b_export.connect( "clicked", G_CALLBACK( OnExportClicked ), NULL );
+ b_addmaterial.connect( "clicked", G_CALLBACK( OnAddMaterial ), NULL );
+ b_removematerial.connect( "clicked", G_CALLBACK( OnRemoveMaterial ), NULL );
+ t_exportmaterials.connect( "clicked", G_CALLBACK( OnExportMatClicked ), NULL );
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF( w_plugplug2, w_plugplug2, "w_plugplug2" );
// create the window
auto window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "New Camera" );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
auto window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
auto window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Add Target" );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
auto window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Add Event" );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+ w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
// create the window
auto window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Camera Inspector" );
- 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 );
+ window.connect( "delete_event", G_CALLBACK( ci_close ), NULL );
+ window.connect( "expose_event", G_CALLBACK( ci_expose ), NULL );
+ // window.connect( "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_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 );
+ ( GTK_COMBO( g_pCamListCombo )->entry ).connect( "changed", G_CALLBACK( ci_camlist_changed ), NULL );
// -------------------------- //
RefreshPathListCombo();
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 );
+ ( GTK_COMBO( g_pPathListCombo )->entry ).connect( "changed", G_CALLBACK( ci_pathlist_changed ), NULL );
// -------------------------- //
gtk_widget_show( g_pEditModeEditRadioButton );
g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) );
- g_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", G_CALLBACK( ci_editmode_edit ), NULL );
+ g_pEditModeEditRadioButton.connect( "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_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) );
- g_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", G_CALLBACK( ci_editmode_add ), NULL );
+ g_pEditModeAddRadioButton.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_rename ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_add_target ), NULL );
+ w.connect( "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);
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_delete_selected ), NULL );
+ w.connect( "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);
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_select_all ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", G_CALLBACK( ci_timeline_changed ), NULL );
+ g_pTimeLine.connect( "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 );
g_pEventsList = gtk_clist_new( 3 );
scr.add(g_pEventsList);
- //g_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", G_CALLBACK (proplist_select_row), NULL);
+ //g_pEventsList.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_add ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_del ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_new ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_load ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_save ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_unload ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_apply ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_preview ), NULL );
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_close ), NULL );
+ w.connect( "clicked", G_CALLBACK( ci_close ), NULL );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
auto dlg = g_pWnd = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), gszCaption );
- g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( main_close ), NULL );
- // g_signal_connect (G_OBJECT (dlg), "destroy", G_CALLBACK (gtk_widget_destroy), NULL);
+ dlg.connect( "delete_event", G_CALLBACK( main_close ), NULL );
+ // dlg.connect( "destroy", G_CALLBACK (gtk_widget_destroy), NULL);
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) );
auto hbox = ui::HBox( FALSE, 5 );
notebook = gtk_notebook_new();
gtk_widget_show( notebook );
gtk_box_pack_start( GTK_BOX( hbox ), notebook, TRUE, TRUE, 0 );
- g_signal_connect( G_OBJECT( notebook ), "switch_page",
+ notebook.connect( "switch_page",
G_CALLBACK( switch_page ), NULL );
gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_TOP );
g_object_set_data( G_OBJECT( dlg ), "notebook", notebook );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
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.connect( "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) );
}
frame = ui::Frame( "Waveform" );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
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.connect( "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) );
}
frame = ui::Frame( "Orientation" );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
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 ) );
+ radio.connect( "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) );
}
table2 = ui::Table( 4, 2, FALSE );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness );
adj = ui::Adjustment( 1, 1, 32767, 1, 10, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( general_random ), NULL );
+ adj.connect( "value_changed", G_CALLBACK( general_random ), NULL );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur );
frame = ui::Frame( "Divisions" );
gtk_widget_show( frame );
g_object_set_data( G_OBJECT( dlg ), "nv_text", label );
adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH );
+ adj.connect( "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
g_object_set_data( G_OBJECT( dlg ), "nh", spin );
adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV );
+ adj.connect( "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "use_patches", check );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( extents_use_patches ), NULL );
+ check.connect( "toggled", G_CALLBACK( extents_use_patches ), NULL );
// ^Fishman - Snap to grid, replaced scroll bar with a texbox.
label = ui::Label( "Snap to grid:" );
gtk_object_set_data( GTK_OBJECT( dlg ), "snap_text", label );
adj = ui::Adjustment( 8, 0, 256, 1, 10, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );
+ adj.connect( "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
adj = ui::Adjustment( 0, 0, 110, 1, 10, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_decimate ), NULL );
+ adj.connect( "value_changed", G_CALLBACK( extents_decimate ), NULL );
g_object_set_data( G_OBJECT( dlg ), "decimate_adj", adj );
scale = ui::HScale( adj );
gtk_widget_show( scale );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 );
check = ui::CheckButton( "Linear borders" );
gtk_widget_show( check );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "linearborder", check );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( extents_linearborder ), NULL );
+ check.connect( "toggled", G_CALLBACK( extents_linearborder ), NULL );
vbox = ui::VBox( FALSE, 10 );
gtk_widget_show( vbox );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "bmp_file", entry );
- g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( bitmap_file_entryfocusout ), NULL );
+ entry.connect( "focus_out_event", G_CALLBACK( bitmap_file_entryfocusout ), NULL );
hbox2 = ui::HBox( TRUE, 5 );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
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.connect( "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_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 );
+ button.connect( "clicked", G_CALLBACK( bitmap_reload ), NULL );
table = ui::Table( 2, 2, TRUE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
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.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value );
hbox2 = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value );
vbox = ui::VBox( FALSE, 10 );
gtk_widget_show( vbox );
g_object_set_data( G_OBJECT( dlg ), "fix_rate_text", label );
adj = ui::Adjustment( 0, -65536, 65536, 1, 16, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( fix_value_changed ), NULL );
+ adj.connect( "value_changed", G_CALLBACK( fix_value_changed ), NULL );
spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND ), 0, 0 );
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 );
+ spin.connect( "focus_out_event", G_CALLBACK( fix_value_entryfocusout ), NULL );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( fix_range_entryfocusout ), NULL );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
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 );
+ entry.connect( "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL );
button = ui::Button( "Free" );
gtk_widget_show( button );
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
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 );
+ button.connect( "clicked", G_CALLBACK( fix_free ), NULL );
button = ui::Button( "Free All" );
gtk_widget_show( button );
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
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 );
+ button.connect( "clicked", G_CALLBACK( fix_freeall ), NULL );
vbox = ui::VBox( FALSE, 10 );
gtk_widget_show( vbox );
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
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 ) );
+ entry.connect( "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) );
entry = ui::Entry();
gtk_widget_show( entry );
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
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 ) );
+ entry.connect( "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) );
entry = ui::Entry();
gtk_widget_show( entry );
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "detail", check );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_detail ), NULL );
+ check.connect( "toggled", G_CALLBACK( texture_detail ), NULL );
check = ui::CheckButton( "Detail hint brushes" );
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "hint", check );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_hint ), NULL );
+ check.connect( "toggled", G_CALLBACK( texture_hint ), NULL );
// ^Fishman - Add terrain key to func_group.
check = ui::CheckButton( "Add terrain key" );
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "terrain_ent", check );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_terrainent ), NULL );
+ check.connect( "toggled", G_CALLBACK( texture_terrainent ), NULL );
vbox = ui::VBox( FALSE, 5 );
gtk_widget_show( vbox );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
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 );
+ button.connect( "clicked", G_CALLBACK( main_go ), NULL );
label = ui::Label( "Settings:" );
gtk_widget_show( label );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "open", button );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_open ), NULL );
+ button.connect( "clicked", G_CALLBACK( main_open ), NULL );
button = ui::Button( "Save as..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "save", button );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_save ), NULL );
+ button.connect( "clicked", G_CALLBACK( main_save ), NULL );
button = ui::Button( "Defaults" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "defaults", button );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_defaults ), NULL );
+ button.connect( "clicked", G_CALLBACK( main_defaults ), NULL );
button = ui::Button( "About..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_about ), NULL );
+ button.connect( "clicked", G_CALLBACK( main_about ), NULL );
check = ui::CheckButton( "Preview" );
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( main_preview ), NULL );
+ check.connect( "toggled", G_CALLBACK( main_preview ), NULL );
g_object_set_data( G_OBJECT( dlg ), "main_preview", check );
// ^Fishman - Antializing for the preview window.
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "main_antialiasing", check );
- g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( main_antialiasing ), NULL );
+ check.connect( "toggled", G_CALLBACK( main_antialiasing ), NULL );
for ( i = 0; i < 5; i++ )
SetDlgValues( i );
void CreateViewWindow(){
GtkWidget *hbox, *label, *spin;
- GtkObject *adj;
#ifndef ISOMETRIC
elevation = PI / 6.;
auto dlg = g_pWndPreview = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "GtkGenSurf Preview" );
- 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 );
+ dlg.connect( "delete_event", G_CALLBACK( preview_close ), NULL );
+ dlg.connect( "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_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 );
- adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 );
- g_signal_connect( adj, "value_changed", G_CALLBACK( preview_spin ), &elevation );
+ auto adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 );
+ adj.connect( "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 );
+ spin.connect( "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &elevation );
adj = ui::Adjustment( 30, 0, 359, 1, 10, 0 );
- g_signal_connect( adj, "value_changed", G_CALLBACK( preview_spin ), &azimuth );
+ adj.connect( "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 );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
gtk_box_pack_end( GTK_BOX( hbox ), label, FALSE, TRUE, 0 );
- g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth );
+ spin.connect( "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth );
#endif
auto frame = ui::Frame( nullptr );
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 );
- 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_pPreviewWidget.connect( "expose_event", G_CALLBACK( expose ), NULL );
+ g_pPreviewWidget.connect( "motion_notify_event", G_CALLBACK( motion ), NULL );
+ g_pPreviewWidget.connect( "button_press_event",
G_CALLBACK( button_press ), NULL );
gtk_widget_show( g_pPreviewWidget );
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- g_signal_connect( GTK_OBJECT( window ), "delete_event",
+ window.connect( "delete_event",
G_CALLBACK( dialog_delete_callback ), NULL );
- g_signal_connect( GTK_OBJECT( window ), "destroy",
+ window.connect( "destroy",
G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
if ( mode == MB_OK ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
else if ( mode == MB_OKCANCEL ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
ret = IDNO;
}
void DoAboutDlg(){
- GtkWidget *vbox, *button, *label;
+ GtkWidget *vbox, *label;
int loop = 1, ret = IDCANCEL;
auto dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" );
- g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ dlg.connect( "delete_event",
G_CALLBACK( dialog_delete_callback ), NULL );
- g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ dlg.connect( "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 );
gtk_widget_show( vbox );
gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 );
- button = ui::Button( "OK" );
+ auto button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( GTK_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_size_request( button, 60, -1 );
// Color selection dialog
static int DoColor( PackedColour *c ){
- GtkWidget* dlg;
GdkColor clr;
int loop = 1, ret = IDCANCEL;
clr.blue = (guint16) (GetGValue(*c) * (65535 / 255));
clr.green = (guint16) (GetBValue(*c) * (65535 / 255));
- dlg = gtk_color_selection_dialog_new( "Choose Color" );
+ auto dlg = ui::Widget(gtk_color_selection_dialog_new( "Choose Color" ));
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( GTK_OBJECT( dlg ), "delete_event",
- G_CALLBACK( dialog_delete_callback ), NULL );
- g_signal_connect( GTK_OBJECT( dlg ), "destroy",
- G_CALLBACK( gtk_widget_destroy ), NULL );
+ dlg.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ dlg.connect( "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);
- 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 ) );
+ ui::Widget(ok_button).connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+ ui::Widget(cancel_button).connect( "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 );
}
void DoConfigDialog(){
- GtkWidget *hbox, *button, *table;
+ GtkWidget *hbox, *table;
GtkWidget *lw3slider, *lw3label, *lw2slider, *lw2label, *item;
- GtkWidget *aa2check, *aa3check, *depthcheck, *linescheck, *polyscheck;
GtkWidget *transslider, *translabel, *clipslider, *cliplabel;
- GtkWidget *show2check, *show3check, *portalcheck;
int loop = 1, ret = IDCANCEL;
auto dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "Portal Viewer Configuration" );
- g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ dlg.connect( "delete_event",
G_CALLBACK( dialog_delete_callback ), NULL );
- g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ dlg.connect( "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 );
- g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScroll3d ), lw3label );
+ adj.connect( "value_changed", G_CALLBACK( OnScroll3d ), lw3label );
table = ui::Table( 2, 4, FALSE );
gtk_widget_show( table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
- button = ui::Button( "Color" );
+ auto button = ui::Button( "Color" );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColor3d ), NULL );
+ button.connect( "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 );
- g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColorFog ), NULL );
+ button.connect( "clicked", G_CALLBACK( OnColorFog ), NULL );
- aa3check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" );
+ auto 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 );
- g_signal_connect( GTK_OBJECT( aa3check ), "toggled", G_CALLBACK( OnAntiAlias3d ), NULL );
+ aa3check.connect( "toggled", G_CALLBACK( OnAntiAlias3d ), NULL );
- depthcheck = ui::CheckButton( "Depth Cue" );
+ auto 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 );
- g_signal_connect( GTK_OBJECT( depthcheck ), "toggled", G_CALLBACK( OnFog ), NULL );
+ depthcheck.connect( "toggled", G_CALLBACK( OnFog ), NULL );
- linescheck = ui::CheckButton( "Lines" );
+ auto 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 );
- g_signal_connect( GTK_OBJECT( linescheck ), "toggled", G_CALLBACK( OnLines ), NULL );
+ linescheck.connect( "toggled", G_CALLBACK( OnLines ), NULL );
- polyscheck = ui::CheckButton( "Polygons" );
+ auto 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 );
- g_signal_connect( GTK_OBJECT( polyscheck ), "toggled", G_CALLBACK( OnPoly ), NULL );
+ polyscheck.connect( "toggled", G_CALLBACK( OnPoly ), NULL );
auto zlist = ui::ComboBoxText();
gtk_widget_show( zlist );
gtk_combo_box_text_append_text(zlist, "Z-Buffer Test Only (recommended for transparent polygons)");
gtk_combo_box_text_append_text(zlist, "Z-Buffer Off");
- g_signal_connect(G_OBJECT(zlist), "changed", G_CALLBACK(+[](GtkComboBox *self, void *) {
+ zlist.connect("changed", G_CALLBACK(+[](GtkComboBox *self, void *) {
OnSelchangeZbuffer(GTK_WIDGET(self), GINT_TO_POINTER(gtk_combo_box_get_active(self)));
}), nullptr);
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 );
- g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScrollTrans ), translabel );
+ adj.connect( "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 );
- g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScrollClip ), cliplabel );
+ adj.connect( "value_changed", G_CALLBACK( OnScrollClip ), cliplabel );
hbox = ui::HBox( TRUE, 5 );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
- show3check = ui::CheckButton( "Show" );
+ auto show3check = ui::CheckButton( "Show" );
gtk_widget_show( show3check );
gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( show3check ), "toggled", G_CALLBACK( OnConfig3d ), NULL );
+ show3check.connect( "toggled", G_CALLBACK( OnConfig3d ), NULL );
- portalcheck = ui::CheckButton( "Portal cubic clipper" );
+ auto portalcheck = ui::CheckButton( "Portal cubic clipper" );
gtk_widget_show( portalcheck );
gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( portalcheck ), "toggled", G_CALLBACK( OnClip ), NULL );
+ portalcheck.connect( "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 );
- g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScroll2d ), lw2label );
+ adj.connect( "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 );
- g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColor2d ), NULL );
+ button.connect( "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)" );
+ auto 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 );
- g_signal_connect( GTK_OBJECT( aa2check ), "toggled", G_CALLBACK( OnAntiAlias2d ), NULL );
+ aa2check.connect( "toggled", G_CALLBACK( OnAntiAlias2d ), NULL );
hbox = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
- show2check = ui::CheckButton( "Show" );
+ auto show2check = ui::CheckButton( "Show" );
gtk_widget_show( show2check );
gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 );
- g_signal_connect( GTK_OBJECT( show2check ), "toggled", G_CALLBACK( OnConfig2d ), NULL );
+ show2check.connect( "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 );
- g_signal_connect( GTK_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_size_request( button, 60, -1 );
}
int DoLoadPortalFileDialog(){
- GtkWidget *hbox, *button, *entry, *check2d, *check3d;
+ GtkWidget *hbox, *entry, *check2d, *check3d;
int loop = 1, ret = IDCANCEL;
auto dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" );
- g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+ dlg.connect( "delete_event",
G_CALLBACK( dialog_delete_callback ), NULL );
- g_signal_connect( GTK_OBJECT( dlg ), "destroy",
+ dlg.connect( "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 );
gtk_widget_show( check2d );
gtk_box_pack_start( GTK_BOX( hbox ), check2d, FALSE, FALSE, 0 );
- button = ui::Button( "Change" );
+ auto button = ui::Button( "Change" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( change_clicked ), entry );
+ button.connect( "clicked", G_CALLBACK( change_clicked ), entry );
gtk_widget_set_size_request( button, 60, -1 );
hbox = ui::HBox( FALSE, 5 );
button = ui::Button( "Cancel" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( GTK_OBJECT( button ), "clicked",
+ button.connect( "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 );
- g_signal_connect( GTK_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_size_request( button, 60, -1 );
auto window = ui::Window( ui::window_type::TOP ); // create a window
gtk_window_set_transient_for( GTK_WINDOW( window ), SunPlug::main_window ); // make the window to stay in front of the main window
- g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event
- g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy ), NULL ); // connect the destroy event for the window
+ window.connect( "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event
+ window.connect( "destroy", G_CALLBACK( destroy ), NULL ); // connect the destroy event for the window
gtk_window_set_title( GTK_WINDOW( window ), "About SunPlug" ); // set the title of the window for the window
gtk_window_set_resizable( GTK_WINDOW( window ), FALSE ); // don't let the user resize the window
gtk_window_set_modal( GTK_WINDOW( window ), TRUE ); // force the user not to do something with the other windows
// MapCoordinator dialog window
void MapCoordinator(){
- GtkWidget *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button;
+ GtkWidget *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY;
Entity *theWorldspawn = NULL;
const char *buffer;
char line[20];
// in any case we need a window to show the user what to do
auto window = ui::Window( ui::window_type::TOP ); // create the window
gtk_window_set_transient_for( GTK_WINDOW( window ), SunPlug::main_window ); // make the window to stay in front of the main window
- g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event for the window
- g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy ), NULL ); // connect the destroy event for the window
+ window.connect( "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event for the window
+ window.connect( "destroy", G_CALLBACK( destroy ), NULL ); // connect the destroy event for the window
gtk_window_set_title( GTK_WINDOW( window ), "ET-MapCoordinator" ); // set the title of the window for the window
gtk_window_set_resizable( GTK_WINDOW( window ), FALSE ); // don't let the user resize the window
gtk_window_set_modal( GTK_WINDOW( window ), TRUE ); // force the user not to do something with the other windows
auto spinner_adj_MaxX = ui::Adjustment( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value
auto spinner_adj_MaxY = ui::Adjustment( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value
- button = ui::Button( "Get optimal mapcoords" ); // create button with text
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( input_optimal ), NULL ); // connect button with callback function
+ auto button = ui::Button( "Get optimal mapcoords" ); // create button with text
+ button.connect( "clicked", G_CALLBACK( input_optimal ), NULL ); // connect button with callback function
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert button into vbox
gtk_box_pack_start( GTK_BOX( vbox ), gtk_hseparator_new(), FALSE, FALSE, 2 ); // insert separator into vbox
msp.worldspawn = theWorldspawn;
button = ui::Button( "Set" ); // create button with text
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( set_coordinates ), NULL ); // connect button with callback function
+ button.connect( "clicked", G_CALLBACK( set_coordinates ), NULL ); // connect button with callback function
gtk_table_attach_defaults( GTK_TABLE( table ), button, 1, 2, 3, 4 ); // insert button into table
button = ui::Button( "Cancel" ); // create button with text
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( close_window ), NULL ); // connect button with callback function
+ button.connect( "clicked", G_CALLBACK( close_window ), NULL ); // connect button with callback function
gtk_table_attach_defaults( GTK_TABLE( table ), button, 2, 3, 3, 4 ); // insert button into table
}
else {
gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // text align left
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 2 ); // insert the label in the box
- button = ui::Button( "OK" ); // create a button with text
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( close_window ), NULL ); // connect the click event to close the window
+ auto button = ui::Button( "OK" ); // create a button with text
+ button.connect( "clicked", G_CALLBACK( close_window ), NULL ); // connect the click event to close the window
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert the button in the box
}
}
void PressedButtons_connect( PressedButtons& pressedButtons, ui::Widget widget ){
- g_signal_connect( G_OBJECT( widget ), "button_press_event", G_CALLBACK( PressedButtons_button_press ), &pressedButtons );
- g_signal_connect( G_OBJECT( widget ), "button_release_event", G_CALLBACK( PressedButtons_button_release ), &pressedButtons );
- g_signal_connect( G_OBJECT( widget ), "focus_out_event", G_CALLBACK( PressedButtons_focus_out ), &pressedButtons );
+ widget.connect( "button_press_event", G_CALLBACK( PressedButtons_button_press ), &pressedButtons );
+ widget.connect( "button_release_event", G_CALLBACK( PressedButtons_button_release ), &pressedButtons );
+ widget.connect( "focus_out_event", G_CALLBACK( PressedButtons_focus_out ), &pressedButtons );
}
PressedButtons g_pressedButtons;
}
void GlobalPressedKeys_connect( ui::Window window ){
- unsigned int key_press_handler = g_signal_connect( G_OBJECT( window ), "key_press_event", G_CALLBACK( PressedKeys_key_press ), &g_pressedKeys );
- unsigned int key_release_handler = g_signal_connect( G_OBJECT( window ), "key_release_event", G_CALLBACK( PressedKeys_key_release ), &g_pressedKeys );
+ unsigned int key_press_handler = window.connect( "key_press_event", G_CALLBACK( PressedKeys_key_press ), &g_pressedKeys );
+ unsigned int key_release_handler = window.connect( "key_release_event", G_CALLBACK( PressedKeys_key_release ), &g_pressedKeys );
g_object_set_data( G_OBJECT( window ), "key_press_handler", gint_to_pointer( key_press_handler ) );
g_object_set_data( G_OBJECT( window ), "key_release_handler", gint_to_pointer( key_release_handler ) );
- unsigned int focus_in_handler = g_signal_connect( G_OBJECT( window ), "focus_in_event", G_CALLBACK( PressedKeys_focus_in ), &g_pressedKeys );
- unsigned int focus_out_handler = g_signal_connect( G_OBJECT( window ), "focus_out_event", G_CALLBACK( PressedKeys_focus_out ), &g_pressedKeys );
+ unsigned int focus_in_handler = window.connect( "focus_in_event", G_CALLBACK( PressedKeys_focus_in ), &g_pressedKeys );
+ unsigned int focus_out_handler = window.connect( "focus_out_event", G_CALLBACK( PressedKeys_focus_out ), &g_pressedKeys );
g_object_set_data( G_OBJECT( window ), "focus_in_handler", gint_to_pointer( focus_in_handler ) );
g_object_set_data( G_OBJECT( window ), "focus_out_handler", gint_to_pointer( focus_out_handler ) );
}
void global_accel_connect_window( ui::Window window ){
#if 1
- unsigned int override_handler = g_signal_connect( G_OBJECT( window ), "key_press_event", G_CALLBACK( override_global_accelerators ), 0 );
+ unsigned int override_handler = window.connect( "key_press_event", G_CALLBACK( override_global_accelerators ), 0 );
g_object_set_data( G_OBJECT( window ), "override_handler", gint_to_pointer( override_handler ) );
- unsigned int special_key_press_handler = g_signal_connect( G_OBJECT( window ), "key_press_event", G_CALLBACK( accelerator_key_event ), &g_special_accelerators );
+ unsigned int special_key_press_handler = window.connect( "key_press_event", G_CALLBACK( accelerator_key_event ), &g_special_accelerators );
g_object_set_data( G_OBJECT( window ), "special_key_press_handler", gint_to_pointer( special_key_press_handler ) );
GlobalPressedKeys_connect( window );
#else
- unsigned int key_press_handler = g_signal_connect( G_OBJECT( window ), "key_press_event", G_CALLBACK( accelerator_key_event ), &g_keydown_accelerators );
- unsigned int key_release_handler = g_signal_connect( G_OBJECT( window ), "key_release_event", G_CALLBACK( accelerator_key_event ), &g_keyup_accelerators );
+ unsigned int key_press_handler = window.connect( "key_press_event", G_CALLBACK( accelerator_key_event ), &g_keydown_accelerators );
+ unsigned int key_release_handler = window.connect( "key_release_event", G_CALLBACK( accelerator_key_event ), &g_keyup_accelerators );
g_object_set_data( G_OBJECT( window ), "key_press_handler", gint_to_pointer( key_press_handler ) );
g_object_set_data( G_OBJECT( window ), "key_release_handler", gint_to_pointer( key_release_handler ) );
#endif
m_function = function;
m_data = data;
- handle_motion = g_signal_connect( G_OBJECT( window ), "motion_notify_event", G_CALLBACK( motion_delta ), this );
+ handle_motion = window.connect( "motion_notify_event", G_CALLBACK( motion_delta ), this );
}
void FreezePointer::unfreeze_pointer(ui::Window window)
auto button = ui::Button( label );
gtk_widget_set_size_request( GTK_WIDGET( button ), 64, -1 );
button.show();
- g_signal_connect( G_OBJECT( button ), "clicked", func, data );
+ button.connect( "clicked", func, data );
return button;
}
ui::Window window = create_floating_window( title, parent );
gtk_window_set_default_size( window, default_w, default_h );
gtk_window_set_position( window, GTK_WIN_POS_CENTER_ON_PARENT );
- g_signal_connect( G_OBJECT( window ), "delete_event", func, data );
+ window.connect( "delete_event", func, data );
return window;
}
BrowsedPathEntry::BrowsedPathEntry( const BrowseCallback& browse ) :
m_entry( PathEntry_new() ),
m_browse( browse ){
- g_signal_connect( G_OBJECT( m_entry.m_button ), "clicked", G_CALLBACK( BrowsedPathEntry_clicked ), this );
+ m_entry.m_button.connect( "clicked", G_CALLBACK( BrowsedPathEntry_clicked ), this );
}
g_object_set_data( G_OBJECT( widget ), "zbuffer", gint_to_pointer( zbuffer ) );
- g_signal_connect( G_OBJECT( widget ), "hierarchy-changed", G_CALLBACK( glwidget_enable_gl ), 0 );
+ widget.connect( "hierarchy-changed", G_CALLBACK( glwidget_enable_gl ), 0 );
- g_signal_connect( G_OBJECT( widget ), "realize", G_CALLBACK( glwidget_context_created ), 0 );
- g_signal_connect( G_OBJECT( widget ), "unrealize", G_CALLBACK( glwidget_context_destroyed ), 0 );
+ widget.connect( "realize", G_CALLBACK( glwidget_context_created ), 0 );
+ widget.connect( "unrealize", G_CALLBACK( glwidget_context_destroyed ), 0 );
return widget;
}
ui::Window window = create_fixedsize_modal_dialog_window( parentWindow, title, dialog, 400, 100 );
if ( parentWindow ) {
- //g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(floating_window_delete_present), parent);
+ //window.connect( "delete_event", G_CALLBACK(floating_window_delete_present), parent);
gtk_window_deiconify( parentWindow );
}
void widget_connect_escape_clear_focus_widget(ui::Widget widget)
{
- g_signal_connect(G_OBJECT(widget), "key_press_event", G_CALLBACK(escape_clear_focus_widget), 0);
+ widget.connect("key_press_event", G_CALLBACK(escape_clear_focus_widget), 0);
}
gboolean NonModalEntry::focus_in(ui::Entry entry, GdkEventFocus *event, NonModalEntry *self)
void NonModalEntry::connect(ui::Entry entry)
{
- g_signal_connect(G_OBJECT(entry), "focus_in_event", G_CALLBACK(focus_in), this);
- g_signal_connect(G_OBJECT(entry), "focus_out_event", G_CALLBACK(focus_out), this);
- g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(enter), this);
- g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(escape), this);
- g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(changed), this);
+ entry.connect("focus_in_event", G_CALLBACK(focus_in), this);
+ entry.connect("focus_out_event", G_CALLBACK(focus_out), this);
+ entry.connect("key_press_event", G_CALLBACK(enter), this);
+ entry.connect("key_press_event", G_CALLBACK(escape), this);
+ entry.connect("changed", G_CALLBACK(changed), this);
}
gboolean NonModalSpinner::changed(ui::SpinButton spin, NonModalSpinner *self)
void NonModalSpinner::connect(ui::SpinButton spin)
{
- guint handler = g_signal_connect(G_OBJECT(gtk_spin_button_get_adjustment(spin)), "value_changed",
- G_CALLBACK(changed), this);
+ auto adj = ui::Adjustment(gtk_spin_button_get_adjustment(spin));
+ guint handler = adj.connect("value_changed", G_CALLBACK(changed), this);
g_object_set_data(G_OBJECT(spin), "handler", gint_to_pointer(handler));
- g_signal_connect(G_OBJECT(spin), "key_press_event", G_CALLBACK(enter), this);
- g_signal_connect(G_OBJECT(spin), "key_press_event", G_CALLBACK(escape), this);
+ spin.connect("key_press_event", G_CALLBACK(enter), this);
+ spin.connect("key_press_event", G_CALLBACK(escape), this);
}
void NonModalRadio::connect(ui::RadioButton radio)
auto hsplit = ui::HPaned();
hsplit.show();
- g_signal_connect( G_OBJECT( hsplit ), "size_allocate", G_CALLBACK( hpaned_allocate ), &g_hpaned );
- g_signal_connect( G_OBJECT( hsplit ), "notify::position", G_CALLBACK( paned_position ), &g_hpaned );
+ hsplit.connect( "size_allocate", G_CALLBACK( hpaned_allocate ), &g_hpaned );
+ hsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_hpaned );
{
- GtkVPaned* vsplit = ui::VPaned();
+ auto vsplit = ui::VPaned();
gtk_paned_add1( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) );
gtk_widget_show( GTK_WIDGET( vsplit ) );
- g_signal_connect( G_OBJECT( vsplit ), "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned1 );
- g_signal_connect( G_OBJECT( vsplit ), "notify::position", G_CALLBACK( paned_position ), &g_vpaned1 );
+ vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned1 );
+ vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned1 );
gtk_paned_add1( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topleft ) ) );
gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topright ) ) );
}
{
- GtkVPaned* vsplit = ui::VPaned();
+ auto vsplit = ui::VPaned();
gtk_paned_add2( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) );
gtk_widget_show( GTK_WIDGET( vsplit ) );
- g_signal_connect( G_OBJECT( vsplit ), "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned2 );
- g_signal_connect( G_OBJECT( vsplit ), "notify::position", G_CALLBACK( paned_position ), &g_vpaned2 );
+ vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned2 );
+ vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned2 );
gtk_paned_add1( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( botleft ) ) );
gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( botright ) ) );
{
m_widget = widget;
widget_set_visible(m_widget, m_shownDeferred);
- g_signal_connect(G_OBJECT(m_widget), "notify::visible", G_CALLBACK(notify_visible), this);
- g_signal_connect(G_OBJECT(m_widget), "destroy", G_CALLBACK(destroy), this);
+ m_widget.connect("notify::visible", G_CALLBACK(notify_visible), this);
+ m_widget.connect("destroy", G_CALLBACK(destroy), this);
update();
}
void WidgetFocusPrinter::connect(ui::Widget widget)
{
- g_signal_connect(G_OBJECT(widget), "focus_in_event", G_CALLBACK(focus_in), this);
- g_signal_connect(G_OBJECT(widget), "focus_out_event", G_CALLBACK(focus_out), this);
+ widget.connect("focus_in_event", G_CALLBACK(focus_in), this);
+ widget.connect("focus_out_event", G_CALLBACK(focus_out), this);
}
}
unsigned int connect_floating( ui::Window main_window, ui::Window floating ){
- return g_signal_connect( G_OBJECT( main_window ), "window_state_event", G_CALLBACK( main_window_iconified ), floating );
+ return main_window.connect( "window_state_event", G_CALLBACK( main_window_iconified ), floating );
}
gboolean destroy_disconnect_floating( ui::Window widget, gpointer data ){
}
guint connect_floating_window_delete_present( ui::Window floating, ui::Window main_window ){
- return g_signal_connect( G_OBJECT( floating ), "delete_event", G_CALLBACK( floating_window_delete_present ), main_window );
+ return floating.connect( "delete_event", G_CALLBACK( floating_window_delete_present ), main_window );
}
gboolean floating_window_destroy_present( ui::Window floating, ui::Window main_window ){
}
guint connect_floating_window_destroy_present( ui::Window floating, ui::Window main_window ){
- return g_signal_connect( G_OBJECT( floating ), "destroy", G_CALLBACK( floating_window_destroy_present ), main_window );
+ return floating.connect( "destroy", G_CALLBACK( floating_window_destroy_present ), main_window );
}
ui::Window create_floating_window( const char* title, ui::Window parent ){
gtk_window_set_transient_for( window, parent );
connect_floating_window_destroy_present( window, parent );
g_object_set_data( G_OBJECT( window ), "floating_handler", gint_to_pointer( connect_floating( parent, window ) ) );
- g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_disconnect_floating ), parent );
+ window.connect( "destroy", G_CALLBACK( destroy_disconnect_floating ), parent );
}
return window;
gtk_widget_set_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK );
connect_floating_window_delete_present( window, main_window );
- g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
+ window.connect( "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
#if 0
if ( g_multimon_globals.m_bStartOnPrimMon && g_multimon_globals.m_bNoSysMenuPopups ) {
- g_signal_connect( G_OBJECT( window ), "realize", G_CALLBACK( window_realize_remove_sysmenu ), 0 );
+ window.connect( "realize", G_CALLBACK( window_realize_remove_sysmenu ), 0 );
}
#endif
}
void window_remove_minmax( ui::Window window ){
- g_signal_connect( G_OBJECT( window ), "realize", G_CALLBACK( window_realize_remove_minmax ), 0 );
+ window.connect( "realize", G_CALLBACK( window_realize_remove_minmax ), 0 );
}
guint window_connect_focus_in_clear_focus_widget(ui::Window window)
{
- return g_signal_connect( G_OBJECT( window ), "focus_in_event", G_CALLBACK( window_focus_in_clear_focus_widget ), NULL );
+ return window.connect( "focus_in_event", G_CALLBACK( window_focus_in_clear_focus_widget ), NULL );
}
void window_get_position(ui::Window window, WindowPosition &position)
void WindowPositionTracker::connect(ui::Window window)
{
sync( window );
- g_signal_connect( G_OBJECT( window ), "configure_event", G_CALLBACK( configure ), this );
+ window.connect( "configure_event", G_CALLBACK( configure ), this );
}
const WindowPosition &WindowPositionTracker::getPosition() const
target_include_directories(uilib PUBLIC gtkutil)
target_link_libraries(uilib PUBLIC gtkutil)
+
+find_package(GLIB REQUIRED)
+target_include_directories(uilib PUBLIC ${GLIB_INCLUDE_DIRS})
+target_link_libraries(uilib PUBLIC ${GLIB_LIBRARIES})
#define INCLUDED_UILIB_H
#include <string>
+#include <glib-object.h>
struct _GdkEventKey;
struct _GtkAccelGroup;
struct _GtkToolItem;
struct _GtkTreeModel;
struct _GtkTreePath;
+struct _GtkTreeSelection;
struct _GtkTreeView;
struct _GtkTreeViewColumn;
struct _GtkVBox;
public details::Convertible<Object, _GtkObject *, details::Convert::Explicit>,
public details::Convertible<Object, _GTypeInstance *, details::Convert::Explicit> {
public:
+ using self = Object *;
using native = _GtkObject *;
native _handle;
explicit operator void *() const
{ return _handle; }
+
+ template<class Lambda>
+ gulong connect(char const *detailed_signal, Lambda &&c_handler, void *data);
};
static_assert(sizeof(Object) == sizeof(Object::native), "object slicing");
void clear();
);
+ WRAP(TreeSelection, Object, _GtkTreeSelection, (),
+ ,
+ );
+
// GBoxed
WRAP(TreePath, Object, _GtkTreePath, (),
#define this (*static_cast<self>(this))
+ template<class Lambda>
+ gulong Object::connect(char const *detailed_signal, Lambda &&c_handler, void *data)
+ {
+ return g_signal_connect(G_OBJECT(this), detailed_signal, c_handler, data);
+ }
+
template<class Lambda>
void IContainer::foreach(Lambda &&lambda)
{
skincache.cpp skincache.h
targetable.cpp targetable.h
)
+
+target_include_directories(entity
+ PRIVATE $<TARGET_PROPERTY:uilib,INTERFACE_INCLUDE_DIRECTORIES>
+)
plugin.cpp
write.cpp write.h
)
+
+target_include_directories(mapq3
+ PRIVATE $<TARGET_PROPERTY:uilib,INTERFACE_INCLUDE_DIRECTORIES>
+)
menu = ui::Menu();
item = ui::MenuItem( "Validate (RETURN)" );
- g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( Textool_Validate ), NULL );
+ item.connect( "activate", G_CALLBACK( Textool_Validate ), NULL );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Zoom in (INSERT)" );
- g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( view_ZoomIn ), this );
+ item.connect( "activate", G_CALLBACK( view_ZoomIn ), this );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Zoom out (DELETE)" );
- g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( view_ZoomOut ), this );
+ item.connect( "activate", G_CALLBACK( view_ZoomOut ), this );
gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item );
item = ui::MenuItem( "Cancel (ESC)" );
- g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( Textool_Cancel ), NULL );
+ item.connect( "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;
auto window = ui::Window( ui::window_type::TOP );
- g_signal_connect( GTK_OBJECT( window ), "delete_event",
+ window.connect( "delete_event",
G_CALLBACK( dialog_delete_callback ), NULL );
- g_signal_connect( GTK_OBJECT( window ), "destroy",
+ window.connect( "destroy",
G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
if ( mode == MB_OK ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
else if ( mode == MB_OKCANCEL ) {
w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "clicked",
G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
- g_signal_connect( GTK_OBJECT( w ), "clicked",
+ w.connect( "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
- g_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose_event", G_CALLBACK( expose ), NULL );
- g_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion_notify_event",
+ g_pToolWidget.connect( "expose_event", G_CALLBACK( expose ), NULL );
+ g_pToolWidget.connect( "motion_notify_event",
G_CALLBACK( motion ), NULL );
- g_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_press_event",
+ g_pToolWidget.connect( "button_press_event",
G_CALLBACK( button_press ), NULL );
- g_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_release_event",
+ g_pToolWidget.connect( "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_pToolWnd.connect( "delete_event", G_CALLBACK( close ), NULL );
+ g_pToolWnd.connect( "key_press_event",
G_CALLBACK( keypress ), NULL );
return g_pToolWidget;
auto renderer = ui::CellRendererText();
object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
- g_signal_connect( G_OBJECT(renderer), "edited", G_CALLBACK( project_cell_edited ), &projectList );
+ renderer.connect("edited", G_CALLBACK( project_cell_edited ), &projectList );
GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
projectList.m_store = store;
scr.add(view);
- g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( project_key_press ), &projectList );
+ view.connect( "key_press_event", G_CALLBACK( project_key_press ), &projectList );
g_object_unref( G_OBJECT( store ) );
}
auto renderer = ui::CellRendererText();
object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
- g_signal_connect( G_OBJECT(renderer), "edited", G_CALLBACK( commands_cell_edited ), store );
+ renderer.connect( "edited", G_CALLBACK( commands_cell_edited ), store );
GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
g_object_unref( G_OBJECT( store ) );
- g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( commands_key_press ), store );
+ view.connect( "key_press_event", G_CALLBACK( commands_key_press ), store );
- g_signal_connect( G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( buildView ) ) ), "changed", G_CALLBACK( project_selection_changed ), store );
+ auto sel = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( buildView ) ));
+ sel.connect( "changed", G_CALLBACK( project_selection_changed ), store );
}
}
}
void CamWnd_Add_Handlers_Move( CamWnd& camwnd ){
- camwnd.m_selection_button_press_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "button_press_event", G_CALLBACK( selection_button_press ), camwnd.m_window_observer );
- camwnd.m_selection_button_release_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "button_release_event", G_CALLBACK( selection_button_release ), camwnd.m_window_observer );
- camwnd.m_selection_motion_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "motion_notify_event", G_CALLBACK( DeferredMotion::gtk_motion ), &camwnd.m_deferred_motion );
+ camwnd.m_selection_button_press_handler = camwnd.m_gl_widget.connect( "button_press_event", G_CALLBACK( selection_button_press ), camwnd.m_window_observer );
+ camwnd.m_selection_button_release_handler = camwnd.m_gl_widget.connect( "button_release_event", G_CALLBACK( selection_button_release ), camwnd.m_window_observer );
+ camwnd.m_selection_motion_handler = camwnd.m_gl_widget.connect( "motion_notify_event", G_CALLBACK( DeferredMotion::gtk_motion ), &camwnd.m_deferred_motion );
- camwnd.m_freelook_button_press_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "button_press_event", G_CALLBACK( enable_freelook_button_press ), &camwnd );
+ camwnd.m_freelook_button_press_handler = camwnd.m_gl_widget.connect( "button_press_event", G_CALLBACK( enable_freelook_button_press ), &camwnd );
if ( g_camwindow_globals_private.m_bCamDiscrete ) {
CamWnd_Move_Discrete_Enable( camwnd );
}
void CamWnd_Add_Handlers_FreeMove( CamWnd& camwnd ){
- camwnd.m_selection_button_press_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "button_press_event", G_CALLBACK( selection_button_press_freemove ), camwnd.m_window_observer );
- camwnd.m_selection_button_release_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "button_release_event", G_CALLBACK( selection_button_release_freemove ), camwnd.m_window_observer );
- camwnd.m_selection_motion_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "motion_notify_event", G_CALLBACK( selection_motion_freemove ), camwnd.m_window_observer );
+ camwnd.m_selection_button_press_handler = camwnd.m_gl_widget.connect( "button_press_event", G_CALLBACK( selection_button_press_freemove ), camwnd.m_window_observer );
+ camwnd.m_selection_button_release_handler = camwnd.m_gl_widget.connect( "button_release_event", G_CALLBACK( selection_button_release_freemove ), camwnd.m_window_observer );
+ camwnd.m_selection_motion_handler = camwnd.m_gl_widget.connect( "motion_notify_event", G_CALLBACK( selection_motion_freemove ), camwnd.m_window_observer );
- camwnd.m_freelook_button_press_handler = g_signal_connect( G_OBJECT( camwnd.m_gl_widget ), "button_press_event", G_CALLBACK( disable_freelook_button_press ), &camwnd );
+ camwnd.m_freelook_button_press_handler = camwnd.m_gl_widget.connect( "button_press_event", G_CALLBACK( disable_freelook_button_press ), &camwnd );
KeyEvent_connect( "CameraFreeMoveForward" );
KeyEvent_connect( "CameraFreeMoveBack" );
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 );
- m_sizeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "size_allocate", G_CALLBACK( camera_size_allocate ), this );
- m_exposeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "expose_event", G_CALLBACK( camera_expose ), this );
+ m_sizeHandler = m_gl_widget.connect( "size_allocate", G_CALLBACK( camera_size_allocate ), this );
+ m_exposeHandler = m_gl_widget.connect( "expose_event", G_CALLBACK( camera_expose ), this );
Map_addValidCallback( g_map, DeferredDrawOnMapValidChangedCaller( m_deferredDraw ) );
CamWnd_Add_Handlers_Move( *this );
- g_signal_connect( G_OBJECT( m_gl_widget ), "scroll_event", G_CALLBACK( wheelmove_scroll ), this );
+ m_gl_widget.connect( "scroll_event", G_CALLBACK( wheelmove_scroll ), this );
AddSceneChangeCallback( ReferenceCaller<CamWnd, CamWnd_Update>( *this ) );
CamWnd_Add_Handlers_FreeMove( *this );
gtk_window_set_focus( m_parent, m_gl_widget );
- m_freemove_handle_focusout = g_signal_connect( G_OBJECT( m_gl_widget ), "focus_out_event", G_CALLBACK( camwindow_freemove_focusout ), this );
+ m_freemove_handle_focusout = m_gl_widget.connect( "focus_out_event", G_CALLBACK( camwindow_freemove_focusout ), this );
m_freezePointer.freeze_pointer( m_parent, Camera_motionDelta, &m_Camera );
CamWnd_Update( *this );
menu_separator( menu );
ui::Widget item(ui::MenuItem( "Clear" ));
- g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( console_clear ), 0 );
+ item.connect( "activate", G_CALLBACK( console_clear ), 0 );
item.show();
menu.add(item);
}
//g_consoleWidgetFocusPrinter.connect(g_console);
- g_signal_connect( G_OBJECT( g_console ), "populate-popup", G_CALLBACK( console_populate_popup ), 0 );
- g_signal_connect( G_OBJECT( g_console ), "destroy", G_CALLBACK( destroy_set_null ), &g_console );
+ g_console.connect( "populate-popup", G_CALLBACK( console_populate_popup ), 0 );
+ g_console.connect( "destroy", G_CALLBACK( destroy_set_null ), &g_console );
}
gtk_container_set_focus_chain( GTK_CONTAINER( scr ), NULL );
ASSERT_MESSAGE( !m_window, "dialog cannot be constructed" );
m_window = BuildDialog();
- g_signal_connect( G_OBJECT( m_window ), "delete_event", G_CALLBACK( delete_event_callback ), this );
+ m_window.connect( "delete_event", G_CALLBACK( delete_event_callback ), this );
}
void Dialog::Destroy(){
ui::Widget Dialog::addPathEntry( ui::Widget vbox, const char* name, bool browse_directory, const StringImportCallback& importViewer, const StringExportCallback& exportViewer ){
PathEntry pathEntry = PathEntry_new();
- g_signal_connect( G_OBJECT( pathEntry.m_button ), "clicked", G_CALLBACK( browse_directory ? button_clicked_entry_browse_directory : button_clicked_entry_browse_file ), pathEntry.m_entry );
+ pathEntry.m_button.connect( "clicked", G_CALLBACK( browse_directory ? button_clicked_entry_browse_directory : button_clicked_entry_browse_file ), pathEntry.m_entry );
AddTextEntryData( *GTK_ENTRY(pathEntry.m_entry), importViewer, exportViewer );
m_check = check;
- guint handler = g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( toggled ), this );
+ guint handler = check.connect( "toggled", G_CALLBACK( toggled ), this );
g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( handler ) );
update();
public:
NonModalComboBox( const Callback& changed ) : m_changed( changed ), m_changedHandler( 0 ){
}
-void connect( GtkComboBox* combo ){
- m_changedHandler = g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( changed ), this );
+void connect( ui::ComboBox combo ){
+ m_changedHandler = combo.connect( "changed", G_CALLBACK( changed ), this );
}
-void setActive( GtkComboBox* combo, int value ){
+void setActive( ui::ComboBox combo, int value ){
g_signal_handler_disconnect( G_OBJECT( combo ), m_changedHandler );
gtk_combo_box_set_active( combo, value );
connect( combo );
class ListAttribute : public EntityAttribute
{
CopiedString m_key;
-GtkComboBox* m_combo;
+ui::ComboBox m_combo;
NonModalComboBox m_nonModal;
const ListAttributeType& m_type;
public:
vbox.show();
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 2 );
- g_signal_connect( G_OBJECT( vbox ), "destroy", G_CALLBACK( EntityInspector_destroyWindow ), 0 );
+ vbox.connect( "destroy", G_CALLBACK( EntityInspector_destroyWindow ), 0 );
{
ui::Widget split1 = ui::VPaned();
auto view = ui::TreeView( ui::TreeModel( GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
gtk_tree_view_set_headers_visible( view, FALSE );
- g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
- g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );
+ view.connect( "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
+ view.connect( "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );
{
auto renderer = ui::CellRendererText();
}
{
- GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
- g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( EntityClassList_selection_changed ), 0 );
+ auto selection = ui::TreeSelection(gtk_tree_view_get_selection( view ));
+ selection.connect( "changed", G_CALLBACK( EntityClassList_selection_changed ), 0 );
}
view.show();
for ( int i = 0; i < MAX_FLAGS; i++ )
{
- GtkCheckButton* check = ui::CheckButton( "" );
+ auto check = ui::CheckButton( "" );
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_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( check.connect( "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) );
g_entitySpawnflagsCheck[i] = check;
}
}
}
{
- GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
- g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( EntityProperties_selection_changed ), 0 );
+ auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
+ selection.connect( "changed", G_CALLBACK( EntityProperties_selection_changed ), 0 );
}
view.show();
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_events( GTK_WIDGET( entry ), GDK_KEY_PRESS_MASK );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
g_entityKeyEntry = entry;
}
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_events( GTK_WIDGET( entry ), GDK_KEY_PRESS_MASK );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
g_entityValueEntry = entry;
}
{
auto button = ui::Button( "Clear All" );
button.show();
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearAllKeyValues ), 0 );
+ button.connect( "clicked", G_CALLBACK( EntityInspector_clearAllKeyValues ), 0 );
gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 );
}
{
auto button = ui::Button( "Delete Key" );
button.show();
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearKeyValue ), 0 );
+ button.connect( "clicked", G_CALLBACK( EntityInspector_clearKeyValue ), 0 );
gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 );
}
}
GtkTreeSelection* select = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
gtk_tree_selection_set_mode( select, GTK_SELECTION_MULTIPLE );
- g_signal_connect( G_OBJECT( view ), "row_expanded", G_CALLBACK( entitylist_treeview_row_expanded ), 0 );
- g_signal_connect( G_OBJECT( view ), "row_collapsed", G_CALLBACK( entitylist_treeview_rowcollapsed ), 0 );
+ view.connect( "row_expanded", G_CALLBACK( entitylist_treeview_row_expanded ), 0 );
+ view.connect( "row_collapsed", G_CALLBACK( entitylist_treeview_rowcollapsed ), 0 );
gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
}
{
- GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
+ auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
- g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( feedback_selection_changed ), NULL );
+ selection.connect( "changed", G_CALLBACK( feedback_selection_changed ), NULL );
}
view.show();
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( entry ), "focus_in_event",
+ entry.connect( "focus_in_event",
G_CALLBACK( find_focus_in ), 0 );
AddDialogData( *GTK_ENTRY(entry), m_strFind );
GlobalTextureEntryCompletion::instance().connect( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( entry ), "focus_in_event",
+ entry.connect( "focus_in_event",
G_CALLBACK( replace_focus_in ), 0 );
AddDialogData( *GTK_ENTRY(entry), m_strReplace );
GlobalTextureEntryCompletion::instance().connect( entry );
button = ui::Button( "Apply" );
button.show();
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnApply ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
button = ui::Button( "Close" );
button.show();
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnClose ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_BOTTOM );
m_pNotebook = notebook;
- g_signal_connect( G_OBJECT(notebook), "switch_page", G_CALLBACK( switch_page ), (gpointer) window );
+ notebook.connect( "switch_page", G_CALLBACK( switch_page ), (gpointer) window );
}
}
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( dialog.game_combo.game_select ), "changed", G_CALLBACK( OnSelchangeComboWhatgame ), &dialog.game_combo );
+ dialog.game_combo.game_select.connect( "changed", G_CALLBACK( OnSelchangeComboWhatgame ), &dialog.game_combo );
}
{
auto dlg = ui::Window( ui::window_type::TOP );
- g_signal_connect( G_OBJECT( dlg ), "delete_event",
+ dlg.connect( "delete_event",
G_CALLBACK( editor_delete ), 0 );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 600, 300 );
button = ui::Button( "Close" );
button.show();
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( editor_close ), dlg );
gtk_widget_set_size_request( button, 60, -1 );
button = ui::Button( "Save" );
button.show();
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( editor_save ), dlg );
gtk_widget_set_size_request( button, 60, -1 );
dlg = ui::Widget(gtk_color_selection_dialog_new( title ));
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 );
+ dlg.connect( "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);
- g_signal_connect( ok_button, "clicked", G_CALLBACK( dialog_button_ok ), &dialog );
- g_signal_connect( cancel_button, "clicked", G_CALLBACK( dialog_button_cancel ), &dialog );
+ ui::Widget(ok_button).connect( "clicked", G_CALLBACK( dialog_button_ok ), &dialog );
+ ui::Widget(cancel_button).connect( "clicked", G_CALLBACK( dialog_button_cancel ), &dialog );
if ( parent ) {
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( parent ) );
gtk_container_set_border_width( GTK_CONTAINER( dialog.m_window ), 0 );
gtk_window_set_position( dialog.m_window, GTK_WIN_POS_CENTER_ON_PARENT );
- g_signal_connect( G_OBJECT( dialog.m_window ), "realize", G_CALLBACK( window_realize_remove_decoration ), 0 );
+ dialog.m_window.connect( "realize", G_CALLBACK( window_realize_remove_decoration ), 0 );
{
dialog.m_label = ui::Label( text );
WindowFocusPrinter( const char* name ) : m_name( name ){
}
void connect( ui::Window toplevel_window ){
- g_signal_connect( G_OBJECT( toplevel_window ), "notify::has_toplevel_focus", G_CALLBACK( notify ), this );
- g_signal_connect( G_OBJECT( toplevel_window ), "notify::is_active", G_CALLBACK( notify ), this );
- g_signal_connect( G_OBJECT( toplevel_window ), "keys_changed", G_CALLBACK( keys_changed ), this );
- g_signal_connect( G_OBJECT( toplevel_window ), "frame_event", G_CALLBACK( frame_event ), this );
+ toplevel_window.connect( "notify::has_toplevel_focus", G_CALLBACK( notify ), this );
+ toplevel_window.connect( "notify::is_active", G_CALLBACK( notify ), this );
+ toplevel_window.connect( "keys_changed", G_CALLBACK( keys_changed ), this );
+ toplevel_window.connect( "frame_event", G_CALLBACK( frame_event ), this );
}
};
}
public:
void connect( ui::Window toplevel_window ){
- g_signal_connect( G_OBJECT( toplevel_window ), "notify::is-active", G_CALLBACK( notify ), this );
+ toplevel_window.connect( "notify::is-active", G_CALLBACK( notify ), this );
}
};
#endif
gtk_widget_add_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK );
- g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( mainframe_delete ), this );
+ window.connect( "delete_event", G_CALLBACK( mainframe_delete ), this );
m_position_tracker.connect( window );
}
{
auto combo = ui::ComboBoxText();
- g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
+ combo.connect( "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
combo.show();
{
auto combo = ui::ComboBoxText();
- g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
+ combo.connect( "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
combo.show();
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fX );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
auto entry = ui::Entry();
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fY );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
auto entry = ui::Entry();
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fZ );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
auto entry = ui::Entry();
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fS );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
auto entry = ui::Entry();
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fT );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
}
}
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
m_subdivisions.m_enabled = check;
- guint handler_id = g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( &Subdivisions::applyGtk ), &m_subdivisions );
+ guint handler_id = check.connect( "toggled", G_CALLBACK( &Subdivisions::applyGtk ), &m_subdivisions );
g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( handler_id ) );
}
{
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
AddDialogData( *GTK_ENTRY(entry), m_strName );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
auto table = ui::Table( 5, 4, FALSE );
gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
entry_set_float( entry, g_pi_globals.shift[0] );
auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), (gpointer) entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), (gpointer) entry );
g_object_set_data( G_OBJECT( window ), "hshift_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
entry_set_float( entry, g_pi_globals.shift[1] );
auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vshift_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
entry_set_float( entry, g_pi_globals.scale[0] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "hscale_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
entry_set_float( entry, g_pi_globals.scale[1] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vscale_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
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
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "rotate_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
auto button = ui::Button( "Auto Cap" );
button.show();
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
auto button = ui::Button( "CAP" );
button.show();
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
auto button = ui::Button( "Set..." );
button.show();
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
auto button = ui::Button( "Natural" );
button.show();
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
{
auto button = ui::Button( "Fit" );
button.show();
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
}
}
{
item = ui::MenuItem( menuText );
g_object_set_data( G_OBJECT( item ),"command", const_cast<gpointer>( static_cast<const void*>( menuCommand ) ) );
- g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( plugin_activated ), gint_to_pointer( m_nNextPlugInID ) );
+ item.connect( "activate", G_CALLBACK( plugin_activated ), gint_to_pointer( m_nNextPlugInID ) );
}
item.show();
menu.add(item);
auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_plugin_image(icon)), text)));
gtk_widget_set_tooltip_text(button, tooltip);
gtk_widget_show_all(button);
- g_signal_connect(button, "clicked", G_CALLBACK(handler), data);
+ button.connect("clicked", G_CALLBACK(handler), data);
toolbar.add(button);
return;
}
gtk_tool_button_set_label(button, text);
gtk_widget_set_tooltip_text(button, tooltip);
gtk_widget_show_all(button);
- g_signal_connect(button, "toggled", G_CALLBACK(handler), data);
+ button.connect("toggled", G_CALLBACK(handler), data);
toolbar.add(button);
return;
}
}
void Widget_connectToggleDependency( ui::Widget self, ui::Widget toggleButton ){
- g_signal_connect( G_OBJECT( toggleButton ), "state_changed", G_CALLBACK( ToggleButton_state_changed_Widget_updateDependency ), self );
- g_signal_connect( G_OBJECT( toggleButton ), "toggled", G_CALLBACK( ToggleButton_toggled_Widget_updateDependency ), self );
+ toggleButton.connect( "state_changed", G_CALLBACK( ToggleButton_state_changed_Widget_updateDependency ), self );
+ toggleButton.connect( "toggled", G_CALLBACK( ToggleButton_toggled_Widget_updateDependency ), self );
Widget_updateDependency( self, toggleButton );
}
}
{
- GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
- g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( treeSelection ), this );
+ auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
+ selection.connect( "changed", G_CALLBACK( treeSelection ), this );
}
view.show();
gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnMatchGrid ), 0 );
+ button.connect( "clicked", G_CALLBACK( OnBtnMatchGrid ), 0 );
}
}
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnBtnAxial ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
}
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnBtnFaceFit ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
}
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnBtnPatchdetails ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
}
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnBtnPatchreset ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
}
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnBtnPatchnatural ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
}
gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked",
+ button.connect( "clicked",
G_CALLBACK( OnBtnPatchFit ), 0 );
gtk_widget_set_size_request( button, 60, -1 );
}
gtk_widget_set_size_request( TexTool::g_textoolWin, -1, 240 ); //Yeah!
frame.add(TexTool::g_textoolWin);
- g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL );
- g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "expose_event", G_CALLBACK( TexTool::expose ), NULL );
- g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "button_press_event", G_CALLBACK( TexTool::button_press ), NULL );
- g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "button_release_event", G_CALLBACK( TexTool::button_release ), NULL );
- g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "motion_notify_event", G_CALLBACK( TexTool::motion ), NULL );
+ TexTool::g_textoolWin.connect( "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL );
+ TexTool::g_textoolWin.connect( "expose_event", G_CALLBACK( TexTool::expose ), NULL );
+ TexTool::g_textoolWin.connect( "button_press_event", G_CALLBACK( TexTool::button_press ), NULL );
+ TexTool::g_textoolWin.connect( "button_release_event", G_CALLBACK( TexTool::button_release ), NULL );
+ TexTool::g_textoolWin.connect( "motion_notify_event", G_CALLBACK( TexTool::motion ), NULL );
}
{
ui::Widget hbox = ui::HBox( FALSE, 5 );
// frame.add(hbox);
//Hmm. Do we really need g_object_set_data? Mebbe not... And we don't! :-)
-// g_object_set_data(G_OBJECT(flipX), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(flipX), "toggled", G_CALLBACK(TexTool::flipX), 0)));
-// g_object_set_data(G_OBJECT(flipY), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(flipY), "toggled", G_CALLBACK(TexTool::flipY), 0)));
+// g_object_set_data(G_OBJECT(flipX), "handler", gint_to_pointer(flipX.connect("toggled", G_CALLBACK(TexTool::flipX), 0)));
+// g_object_set_data(G_OBJECT(flipY), "handler", gint_to_pointer(flipY.connect("toggled", G_CALLBACK(TexTool::flipY), 0)));
//Instead, just do:
- g_signal_connect( G_OBJECT( flipX ), "toggled", G_CALLBACK( TexTool::flipX ), NULL );
- g_signal_connect( G_OBJECT( flipY ), "toggled", G_CALLBACK( TexTool::flipY ), NULL );
+ flipX.connect( "toggled", G_CALLBACK( TexTool::flipX ), NULL );
+ flipY.connect( "toggled", G_CALLBACK( TexTool::flipY ), NULL );
}
}
#endif
gtk_tree_view_set_enable_search( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
- g_signal_connect( g_TextureBrowser.m_treeViewTree, "row-activated", (GCallback) TreeView_onRowActivated, NULL );
+ g_TextureBrowser.m_treeViewTree.connect( "row-activated", (GCallback) TreeView_onRowActivated, NULL );
auto renderer = ui::CellRendererText();
gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), -1, "", renderer, "text", 0, NULL );
ui::Widget menu = ui::Menu();
ui::Widget menuitem = ui::MenuItem( "Add tag" );
- g_signal_connect( menuitem, "activate", (GCallback)TextureBrowser_addTag, treeview );
+ menuitem.connect( "activate", (GCallback)TextureBrowser_addTag, treeview );
gtk_menu_shell_append( GTK_MENU_SHELL( menu ), menuitem );
menuitem = ui::MenuItem( "Rename tag" );
- g_signal_connect( menuitem, "activate", (GCallback)TextureBrowser_renameTag, treeview );
+ menuitem.connect( "activate", (GCallback)TextureBrowser_renameTag, treeview );
gtk_menu_shell_append( GTK_MENU_SHELL( menu ), menuitem );
menuitem = ui::MenuItem( "Delete tag" );
- g_signal_connect( menuitem, "activate", (GCallback)TextureBrowser_deleteTag, treeview );
+ menuitem.connect( "activate", (GCallback)TextureBrowser_deleteTag, treeview );
gtk_menu_shell_append( GTK_MENU_SHELL( menu ), menuitem );
gtk_widget_show_all( menu );
g_TextureBrowser.m_treeViewTags = ui::TreeView();
gtk_tree_view_set_enable_search( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), FALSE );
- g_signal_connect( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), "button-press-event", (GCallback)TreeViewTags_onButtonPressed, NULL );
+ g_TextureBrowser.m_treeViewTags.connect( "button-press-event", (GCallback)TreeViewTags_onButtonPressed, NULL );
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), FALSE );
gtk_notebook_append_page( GTK_NOTEBOOK( g_TextureBrowser.m_tag_notebook ), g_TextureBrowser.m_scr_win_tree, labelTextures );
gtk_notebook_append_page( GTK_NOTEBOOK( g_TextureBrowser.m_tag_notebook ), g_TextureBrowser.m_scr_win_tags, labelTags );
- g_signal_connect( G_OBJECT( g_TextureBrowser.m_tag_notebook ), "switch-page", G_CALLBACK( TextureBrowser_toggleSearchButton ), NULL );
+ g_TextureBrowser.m_tag_notebook.connect( "switch-page", G_CALLBACK( TextureBrowser_toggleSearchButton ), NULL );
gtk_widget_show_all( g_TextureBrowser.m_tag_notebook );
}
void TextureBrowser_constructSearchButton(){
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 );
+ g_TextureBrowser.m_search_button.connect( "clicked", G_CALLBACK( TextureBrowser_searchTags ), NULL );
gtk_widget_set_tooltip_text(g_TextureBrowser.m_search_button, "Search with selected tags");
g_TextureBrowser.m_search_button.add(image);
}
w.show();
g_TextureBrowser.m_texture_scroll = w;
- GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_TextureBrowser.m_texture_scroll ) );
- g_signal_connect( G_OBJECT( vadjustment ), "value_changed", G_CALLBACK( TextureBrowser_verticalScroll ), &g_TextureBrowser );
+ auto vadjustment = ui::Adjustment(gtk_range_get_adjustment( GTK_RANGE( g_TextureBrowser.m_texture_scroll ) ));
+ vadjustment.connect( "value_changed", G_CALLBACK( TextureBrowser_verticalScroll ), &g_TextureBrowser );
widget_set_visible( g_TextureBrowser.m_texture_scroll, g_TextureBrowser.m_showTextureScrollbar );
}
gtk_table_attach_defaults( GTK_TABLE( table ), g_TextureBrowser.m_gl_widget, 1, 2, 1, 2 );
g_TextureBrowser.m_gl_widget.show();
- g_TextureBrowser.m_sizeHandler = g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "size_allocate", G_CALLBACK( TextureBrowser_size_allocate ), &g_TextureBrowser );
- g_TextureBrowser.m_exposeHandler = g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "expose_event", G_CALLBACK( TextureBrowser_expose ), &g_TextureBrowser );
+ g_TextureBrowser.m_sizeHandler = g_TextureBrowser.m_gl_widget.connect( "size_allocate", G_CALLBACK( TextureBrowser_size_allocate ), &g_TextureBrowser );
+ g_TextureBrowser.m_exposeHandler = g_TextureBrowser.m_gl_widget.connect( "expose_event", G_CALLBACK( TextureBrowser_expose ), &g_TextureBrowser );
- g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "button_press_event", G_CALLBACK( TextureBrowser_button_press ), &g_TextureBrowser );
- g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "button_release_event", G_CALLBACK( TextureBrowser_button_release ), &g_TextureBrowser );
- g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "motion_notify_event", G_CALLBACK( TextureBrowser_motion ), &g_TextureBrowser );
- g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "scroll_event", G_CALLBACK( TextureBrowser_scroll ), &g_TextureBrowser );
+ g_TextureBrowser.m_gl_widget.connect( "button_press_event", G_CALLBACK( TextureBrowser_button_press ), &g_TextureBrowser );
+ g_TextureBrowser.m_gl_widget.connect( "button_release_event", G_CALLBACK( TextureBrowser_button_release ), &g_TextureBrowser );
+ g_TextureBrowser.m_gl_widget.connect( "motion_notify_event", G_CALLBACK( TextureBrowser_motion ), &g_TextureBrowser );
+ g_TextureBrowser.m_gl_widget.connect( "scroll_event", G_CALLBACK( TextureBrowser_scroll ), &g_TextureBrowser );
}
// tag stuff
g_TextureBrowser.m_assigned_tree = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( g_TextureBrowser.m_assigned_store ) ));
g_object_unref( G_OBJECT( g_TextureBrowser.m_assigned_store ) );
- g_signal_connect( g_TextureBrowser.m_assigned_tree, "row-activated", (GCallback) TextureBrowser_removeTags, NULL );
+ g_TextureBrowser.m_assigned_tree.connect( "row-activated", (GCallback) TextureBrowser_removeTags, NULL );
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ), FALSE );
GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ) );
g_TextureBrowser.m_available_tree = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( g_TextureBrowser.m_available_store ) ));
g_object_unref( G_OBJECT( g_TextureBrowser.m_available_store ) );
- g_signal_connect( g_TextureBrowser.m_available_tree, "row-activated", (GCallback) TextureBrowser_assignTags, NULL );
+ g_TextureBrowser.m_available_tree.connect( "row-activated", (GCallback) TextureBrowser_assignTags, NULL );
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ), FALSE );
GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ) );
gtk_table_attach( GTK_TABLE( frame_table ), m_btn_left, 1, 2, 1, 2, GTK_SHRINK, GTK_EXPAND, 0, 0 );
gtk_table_attach( GTK_TABLE( frame_table ), m_btn_right, 1, 2, 2, 3, GTK_SHRINK, GTK_EXPAND, 0, 0 );
- g_signal_connect( G_OBJECT( m_btn_left ), "clicked", G_CALLBACK( TextureBrowser_assignTags ), NULL );
- g_signal_connect( G_OBJECT( m_btn_right ), "clicked", G_CALLBACK( TextureBrowser_removeTags ), NULL );
+ m_btn_left.connect( "clicked", G_CALLBACK( TextureBrowser_assignTags ), NULL );
+ m_btn_right.connect( "clicked", G_CALLBACK( TextureBrowser_removeTags ), NULL );
m_btn_left.show();
m_btn_right.show();
}
void GlobalWindowObservers_connectTopLevel( ui::Window window ){
- g_signal_connect( G_OBJECT( window ), "key_press_event", G_CALLBACK( selection_modifier_key_press ), &g_window_observers );
- g_signal_connect( G_OBJECT( window ), "key_release_event", G_CALLBACK( selection_modifier_key_release ), &g_window_observers );
+ window.connect( "key_press_event", G_CALLBACK( selection_modifier_key_press ), &g_window_observers );
+ window.connect( "key_release_event", G_CALLBACK( selection_modifier_key_release ), &g_window_observers );
}
void GlobalWindowObservers_connectWidget( ui::Widget widget ){
- g_signal_connect( G_OBJECT( widget ), "button_press_event", G_CALLBACK( modifiers_button_press ), &g_window_observers );
- g_signal_connect( G_OBJECT( widget ), "button_release_event", G_CALLBACK( modifiers_button_release ), &g_window_observers );
- g_signal_connect( G_OBJECT( widget ), "motion_notify_event", G_CALLBACK( modifiers_motion ), &g_window_observers );
+ widget.connect( "button_press_event", G_CALLBACK( modifiers_button_press ), &g_window_observers );
+ widget.connect( "button_release_event", G_CALLBACK( modifiers_button_release ), &g_window_observers );
+ widget.connect( "motion_notify_event", G_CALLBACK( modifiers_motion ), &g_window_observers );
}
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 );
- m_sizeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "size_allocate", G_CALLBACK( xywnd_size_allocate ), this );
- m_exposeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "expose_event", G_CALLBACK( xywnd_expose ), this );
+ m_sizeHandler = m_gl_widget.connect( "size_allocate", G_CALLBACK( xywnd_size_allocate ), this );
+ m_exposeHandler = m_gl_widget.connect( "expose_event", G_CALLBACK( xywnd_expose ), this );
- g_signal_connect( G_OBJECT( m_gl_widget ), "button_press_event", G_CALLBACK( xywnd_button_press ), this );
- g_signal_connect( G_OBJECT( m_gl_widget ), "button_release_event", G_CALLBACK( xywnd_button_release ), this );
- g_signal_connect( G_OBJECT( m_gl_widget ), "focus_in_event", G_CALLBACK( xywnd_focus_in ), this );
- g_signal_connect( G_OBJECT( m_gl_widget ), "motion_notify_event", G_CALLBACK( DeferredMotion::gtk_motion ), &m_deferred_motion );
+ m_gl_widget.connect( "button_press_event", G_CALLBACK( xywnd_button_press ), this );
+ m_gl_widget.connect( "button_release_event", G_CALLBACK( xywnd_button_release ), this );
+ m_gl_widget.connect( "focus_in_event", G_CALLBACK( xywnd_focus_in ), this );
+ m_gl_widget.connect( "motion_notify_event", G_CALLBACK( DeferredMotion::gtk_motion ), &m_deferred_motion );
- g_signal_connect( G_OBJECT( m_gl_widget ), "scroll_event", G_CALLBACK( xywnd_wheel_scroll ), this );
+ m_gl_widget.connect( "scroll_event", G_CALLBACK( xywnd_wheel_scroll ), this );
Map_addValidCallback( g_map, DeferredDrawOnMapValidChangedCaller( m_deferredDraw ) );
void EntityClassMenu_addItem( ui::Menu menu, const char* name ){
auto item = ui::MenuItem( name );
- g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( entitycreate_activated ), item );
+ item.connect( "activate", G_CALLBACK( entitycreate_activated ), item );
item.show();
menu_add_item( menu, item );
}
}
m_move_started = true;
g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), XYWnd_moveDelta, this );
- m_move_focusOut = g_signal_connect( G_OBJECT( m_gl_widget ), "focus_out_event", G_CALLBACK( XYWnd_Move_focusOut ), this );
+ m_move_focusOut = m_gl_widget.connect( "focus_out_event", G_CALLBACK( XYWnd_Move_focusOut ), this );
}
void XYWnd::Move_End(){
m_zoom_started = true;
g_dragZoom = 0;
g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), XYWnd_zoomDelta, this );
- m_zoom_focusOut = g_signal_connect( G_OBJECT( m_gl_widget ), "focus_out_event", G_CALLBACK( XYWnd_Zoom_focusOut ), this );
+ m_zoom_focusOut = m_gl_widget.connect( "focus_out_event", G_CALLBACK( XYWnd_Zoom_focusOut ), this );
}
void XYWnd::Zoom_End(){