Merge pull request #435 from Pan7/gtkdepre

Replacing deprecated GTK functions
This commit is contained in:
Timothee "TTimo" Besset 2017-03-15 06:40:59 -05:00 committed by GitHub
commit 491aee4b19
32 changed files with 1490 additions and 1461 deletions

View file

@ -325,11 +325,11 @@ void InitBackgroundDialog(){
// GTK_STOCK_CLOSE, // GTK_STOCK_CLOSE,
// GTK_RESPONSE_CLOSE, // GTK_RESPONSE_CLOSE,
NULL ); NULL );
gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "delete-event", g_signal_connect( G_OBJECT( pDialogWnd ), "delete-event",
GTK_SIGNAL_FUNC( close_callback ), NULL ); G_CALLBACK( close_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "response", g_signal_connect( G_OBJECT( pDialogWnd ), "response",
GTK_SIGNAL_FUNC( response_callback ), NULL ); G_CALLBACK( response_callback ), NULL );
// gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose-event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); // g_signal_connect( G_OBJECT (pDialogWnd), "expose-event", G_CALLBACK( ci_expose ), NULL );
pTooltips = gtk_tooltips_new(); pTooltips = gtk_tooltips_new();

View file

@ -54,23 +54,23 @@ void Update_TextureReseter(){
gboolean check; gboolean check;
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexNew ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexNew ), check );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexOld ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexOld ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleHor ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleHor ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleVert ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleVert ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftHor ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftHor ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftVert ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftVert ), check );
check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) );
gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editRotation ), check ); gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editRotation ), check );
} }
static void dialog_button_callback( GtkWidget *widget, gpointer data ){ static void dialog_button_callback( GtkWidget *widget, gpointer data ){
@ -207,12 +207,12 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", g_signal_connect( G_OBJECT( window ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", g_signal_connect( G_OBJECT( window ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption ); gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
gtk_widget_realize( window ); gtk_widget_realize( window );
@ -237,9 +237,9 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
if ( mode == MB_OK ) { if ( mode == MB_OK ) {
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDOK; ret = IDOK;
@ -247,38 +247,38 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
else if ( mode == MB_OKCANCEL ) { else if ( mode == MB_OKCANCEL ) {
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
} }
else if ( mode == MB_YESNOCANCEL ) { else if ( mode == MB_YESNOCANCEL ) {
w = gtk_button_new_with_label( "Yes" ); w = gtk_button_new_with_label( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "No" ); w = gtk_button_new_with_label( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
} }
@ -286,16 +286,16 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
{ {
w = gtk_button_new_with_label( "Yes" ); w = gtk_button_new_with_label( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "No" ); w = gtk_button_new_with_label( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDNO; ret = IDNO;
} }
@ -321,11 +321,11 @@ int DoIntersectBox( IntersectRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Intersect" ); gtk_window_set_title( GTK_WINDOW( window ), "Intersect" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -344,7 +344,7 @@ int DoIntersectBox( IntersectRS* rs ){
gtk_box_pack_start( GTK_BOX( vbox ), radio1, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( vbox ), radio1, FALSE, FALSE, 2 );
gtk_widget_show( radio1 ); gtk_widget_show( radio1 );
radio2 = gtk_radio_button_new_with_label( ( (GtkRadioButton*)radio1 )->group, "Use Selected Brushes" ); radio2 = gtk_radio_button_new_with_label( gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio1 ) ), "Use Selected Brushes" );
gtk_box_pack_start( GTK_BOX( vbox ), radio2, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( vbox ), radio2, FALSE, FALSE, 2 );
gtk_widget_show( radio2 ); gtk_widget_show( radio2 );
@ -368,15 +368,15 @@ int DoIntersectBox( IntersectRS* rs ){
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -417,11 +417,11 @@ int DoPolygonBox( PolygonRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" ); gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -455,8 +455,10 @@ int DoPolygonBox( PolygonRS* rs ){
// ---- hbox2 ---- // ---- hbox2 ----
text1 = gtk_entry_new_with_max_length( 256 ); text1 = gtk_entry_new();
gtk_entry_set_text( (GtkEntry*)text1, "3" ); g_object_set( text1, "xalign", 1.0, NULL );
gtk_entry_set_max_length( GTK_ENTRY( text1 ), 256 );
gtk_entry_set_text( GTK_ENTRY( text1 ), "3" );
gtk_box_pack_start( GTK_BOX( hbox2 ), text1, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( hbox2 ), text1, FALSE, FALSE, 2 );
gtk_widget_show( text1 ); gtk_widget_show( text1 );
@ -473,8 +475,10 @@ int DoPolygonBox( PolygonRS* rs ){
// ---- hbox2 ---- // ---- hbox2 ----
text2 = gtk_entry_new_with_max_length( 256 ); text2 = gtk_entry_new();
gtk_entry_set_text( (GtkEntry*)text2, "8" ); g_object_set( text2, "xalign", 1.0, NULL );
gtk_entry_set_max_length( GTK_ENTRY( text2 ), 256 );
gtk_entry_set_text( GTK_ENTRY( text2 ), "8" );
gtk_box_pack_start( GTK_BOX( hbox2 ), text2, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( hbox2 ), text2, FALSE, FALSE, 2 );
gtk_widget_show( text2 ); gtk_widget_show( text2 );
@ -521,15 +525,15 @@ int DoPolygonBox( PolygonRS* rs ){
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -555,12 +559,12 @@ int DoPolygonBox( PolygonRS* rs ){
rs->bInverse = gtk_toggle_button_get_active( (GtkToggleButton*)check2 ) ? true : false; rs->bInverse = gtk_toggle_button_get_active( (GtkToggleButton*)check2 ) ? true : false;
rs->bAlignTop = gtk_toggle_button_get_active( (GtkToggleButton*)check3 ) ? true : false; rs->bAlignTop = gtk_toggle_button_get_active( (GtkToggleButton*)check3 ) ? true : false;
if ( !ValidateTextIntRange( gtk_entry_get_text( (GtkEntry*)text1 ), 3, 32, "Number Of Sides", &rs->nSides ) ) { if ( !ValidateTextIntRange( gtk_entry_get_text( GTK_ENTRY( text1 ) ), 3, 32, "Number Of Sides", &rs->nSides ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
if ( rs->bUseBorder ) { if ( rs->bUseBorder ) {
if ( !ValidateTextIntRange( gtk_entry_get_text( (GtkEntry*)text2 ), 8, 256, "Border Width", &rs->nBorderWidth ) ) { if ( !ValidateTextIntRange( gtk_entry_get_text( GTK_ENTRY( text2 ) ), 8, 256, "Border Width", &rs->nBorderWidth ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
} }
@ -592,12 +596,12 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" ); gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -629,7 +633,8 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
textStairHeight = gtk_entry_new_with_max_length( 256 ); textStairHeight = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( textStairHeight ), 256 );
gtk_box_pack_start( GTK_BOX( hbox ), textStairHeight, FALSE, FALSE, 1 ); gtk_box_pack_start( GTK_BOX( hbox ), textStairHeight, FALSE, FALSE, 1 );
gtk_widget_show( textStairHeight ); gtk_widget_show( textStairHeight );
@ -663,19 +668,19 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
gtk_box_pack_start( GTK_BOX( hbox ), radioNorth, FALSE, FALSE, 3 ); gtk_box_pack_start( GTK_BOX( hbox ), radioNorth, FALSE, FALSE, 3 );
gtk_widget_show( radioNorth ); gtk_widget_show( radioNorth );
radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNorth ) ); radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNorth ) );
radioSouth = gtk_radio_button_new_with_label( radioDirection, "South" ); radioSouth = gtk_radio_button_new_with_label( radioDirection, "South" );
gtk_box_pack_start( GTK_BOX( hbox ), radioSouth, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( hbox ), radioSouth, FALSE, FALSE, 2 );
gtk_widget_show( radioSouth ); gtk_widget_show( radioSouth );
radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioSouth ) ); radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioSouth ) );
radioEast = gtk_radio_button_new_with_label( radioDirection, "East" ); radioEast = gtk_radio_button_new_with_label( radioDirection, "East" );
gtk_box_pack_start( GTK_BOX( hbox ), radioEast, FALSE, FALSE, 1 ); gtk_box_pack_start( GTK_BOX( hbox ), radioEast, FALSE, FALSE, 1 );
gtk_widget_show( radioEast ); gtk_widget_show( radioEast );
radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioEast ) ); radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioEast ) );
radioWest = gtk_radio_button_new_with_label( radioDirection, "West" ); radioWest = gtk_radio_button_new_with_label( radioDirection, "West" );
gtk_box_pack_start( GTK_BOX( hbox ), radioWest, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), radioWest, FALSE, FALSE, 0 );
@ -701,13 +706,13 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
gtk_box_pack_start( GTK_BOX( hbox ), radioOldStyle, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), radioOldStyle, FALSE, FALSE, 0 );
gtk_widget_show( radioOldStyle ); gtk_widget_show( radioOldStyle );
radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioOldStyle ) ); radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioOldStyle ) );
radioBobStyle = gtk_radio_button_new_with_label( radioStyle, "Bob's Style" ); radioBobStyle = gtk_radio_button_new_with_label( radioStyle, "Bob's Style" );
gtk_box_pack_start( GTK_BOX( hbox ), radioBobStyle, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), radioBobStyle, FALSE, FALSE, 0 );
gtk_widget_show( radioBobStyle ); gtk_widget_show( radioBobStyle );
radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioBobStyle ) ); radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioBobStyle ) );
radioCornerStyle = gtk_radio_button_new_with_label( radioStyle, "Corner Style" ); radioCornerStyle = gtk_radio_button_new_with_label( radioStyle, "Corner Style" );
gtk_box_pack_start( GTK_BOX( hbox ), radioCornerStyle, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), radioCornerStyle, FALSE, FALSE, 0 );
@ -730,7 +735,8 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
textMainTex = gtk_entry_new_with_max_length( 512 ); textMainTex = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( textMainTex ), 512 );
gtk_entry_set_text( GTK_ENTRY( textMainTex ), rs->mainTexture ); gtk_entry_set_text( GTK_ENTRY( textMainTex ), rs->mainTexture );
gtk_box_pack_start( GTK_BOX( hbox ), textMainTex, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), textMainTex, FALSE, FALSE, 0 );
gtk_widget_show( textMainTex ); gtk_widget_show( textMainTex );
@ -745,7 +751,8 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
textRiserTex = gtk_entry_new_with_max_length( 512 ); textRiserTex = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( textRiserTex ), 512 );
gtk_box_pack_start( GTK_BOX( hbox ), textRiserTex, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), textRiserTex, FALSE, FALSE, 0 );
gtk_widget_show( textRiserTex ); gtk_widget_show( textRiserTex );
@ -764,14 +771,14 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
w = gtk_button_new_with_label( "OK" ); w = gtk_button_new_with_label( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -793,8 +800,8 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
if ( ret == IDOK ) { if ( ret == IDOK ) {
rs->bUseDetail = gtk_toggle_button_get_active( (GtkToggleButton*)checkUseDetail ) ? true : false; rs->bUseDetail = gtk_toggle_button_get_active( (GtkToggleButton*)checkUseDetail ) ? true : false;
strcpy( rs->riserTexture, gtk_entry_get_text( (GtkEntry*)textRiserTex ) ); strcpy( rs->riserTexture, gtk_entry_get_text( GTK_ENTRY( textRiserTex ) ) );
strcpy( rs->mainTexture, gtk_entry_get_text( (GtkEntry*)textMainTex ) ); strcpy( rs->mainTexture, gtk_entry_get_text( GTK_ENTRY( textMainTex ) ) );
if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioNorth ) ) { if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioNorth ) ) {
rs->direction = MOVE_NORTH; rs->direction = MOVE_NORTH;
@ -809,7 +816,7 @@ int DoBuildStairsBox( BuildStairsRS* rs ){
rs->direction = MOVE_WEST; rs->direction = MOVE_WEST;
} }
if ( !ValidateTextInt( gtk_entry_get_text( (GtkEntry*)textStairHeight ), "Stair Height", &rs->stairHeight ) ) { if ( !ValidateTextInt( gtk_entry_get_text( GTK_ENTRY( textStairHeight ) ), "Stair Height", &rs->stairHeight ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
@ -849,12 +856,12 @@ int DoDoorsBox( DoorRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" ); gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -877,7 +884,8 @@ int DoDoorsBox( DoorRS* rs ){
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
textFrontBackTex = gtk_entry_new_with_max_length( 512 ); textFrontBackTex = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( textFrontBackTex ), 512 );
gtk_entry_set_text( GTK_ENTRY( textFrontBackTex ), rs->mainTexture ); gtk_entry_set_text( GTK_ENTRY( textFrontBackTex ), rs->mainTexture );
gtk_box_pack_start( GTK_BOX( hbox ), textFrontBackTex, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), textFrontBackTex, FALSE, FALSE, 0 );
gtk_widget_show( textFrontBackTex ); gtk_widget_show( textFrontBackTex );
@ -892,7 +900,8 @@ int DoDoorsBox( DoorRS* rs ){
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
textTrimTex = gtk_entry_new_with_max_length( 512 ); textTrimTex = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( textTrimTex ), 512 );
gtk_box_pack_start( GTK_BOX( hbox ), textTrimTex, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), textTrimTex, FALSE, FALSE, 0 );
gtk_widget_show( textTrimTex ); gtk_widget_show( textTrimTex );
@ -951,7 +960,7 @@ int DoDoorsBox( DoorRS* rs ){
tw1.two = comboMain; tw1.two = comboMain;
buttonSetMain = gtk_button_new_with_label( "Set As Main Texture" ); buttonSetMain = gtk_button_new_with_label( "Set As Main Texture" );
gtk_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw1 ); g_signal_connect( G_OBJECT( buttonSetMain ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetMain ); gtk_widget_show( buttonSetMain );
@ -971,7 +980,7 @@ int DoDoorsBox( DoorRS* rs ){
tw2.two = comboTrim; tw2.two = comboTrim;
buttonSetTrim = gtk_button_new_with_label( "Set As Trim Texture" ); buttonSetTrim = gtk_button_new_with_label( "Set As Trim Texture" );
gtk_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw2 ); g_signal_connect( G_OBJECT( buttonSetTrim ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetTrim ); gtk_widget_show( buttonSetTrim );
@ -990,7 +999,7 @@ int DoDoorsBox( DoorRS* rs ){
gtk_box_pack_start( GTK_BOX( hbox ), radioNS, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), radioNS, FALSE, FALSE, 0 );
gtk_widget_show( radioNS ); gtk_widget_show( radioNS );
radioOrientation = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNS ) ); radioOrientation = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNS ) );
radioEW = gtk_radio_button_new_with_label( radioOrientation, "East - West" ); radioEW = gtk_radio_button_new_with_label( radioOrientation, "East - West" );
gtk_box_pack_start( GTK_BOX( hbox ), radioEW, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), radioEW, FALSE, FALSE, 0 );
@ -1010,14 +1019,14 @@ int DoDoorsBox( DoorRS* rs ){
w = gtk_button_new_with_label( "OK" ); w = gtk_button_new_with_label( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -1063,11 +1072,11 @@ int DoPathPlotterBox( PathPlotterRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" ); gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -1088,8 +1097,9 @@ int DoPathPlotterBox( PathPlotterRS* rs ){
// ---- hbox ---- // ---- hbox ----
text1 = gtk_entry_new_with_max_length( 256 ); text1 = gtk_entry_new();
gtk_entry_set_text( (GtkEntry*)text1, "25" ); gtk_entry_set_max_length( GTK_ENTRY( text1 ), 256 );
gtk_entry_set_text( GTK_ENTRY( text1 ), "25" );
gtk_box_pack_start( GTK_BOX( hbox ), text1, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( hbox ), text1, FALSE, FALSE, 2 );
gtk_widget_show( text1 ); gtk_widget_show( text1 );
@ -1106,8 +1116,9 @@ int DoPathPlotterBox( PathPlotterRS* rs ){
// ---- hbox ---- // ---- hbox ----
text2 = gtk_entry_new_with_max_length( 256 ); text2 = gtk_entry_new();
gtk_entry_set_text( (GtkEntry*)text2, "3" ); gtk_entry_set_max_length( GTK_ENTRY( text2 ), 256 );
gtk_entry_set_text( GTK_ENTRY( text2 ), "3" );
gtk_box_pack_start( GTK_BOX( hbox ), text2, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( hbox ), text2, FALSE, FALSE, 2 );
gtk_widget_show( text2 ); gtk_widget_show( text2 );
@ -1129,8 +1140,9 @@ int DoPathPlotterBox( PathPlotterRS* rs ){
// ---- hbox ---- // ---- hbox ----
text3 = gtk_entry_new_with_max_length( 256 ); text3 = gtk_entry_new();
gtk_entry_set_text( (GtkEntry*)text3, "-800" ); gtk_entry_set_max_length( GTK_ENTRY( text3 ), 256 );
gtk_entry_set_text( GTK_ENTRY( text3 ), "-800" );
gtk_box_pack_start( GTK_BOX( hbox ), text3, FALSE, FALSE, 2 ); gtk_box_pack_start( GTK_BOX( hbox ), text3, FALSE, FALSE, 2 );
gtk_widget_show( text3 ); gtk_widget_show( text3 );
@ -1170,20 +1182,20 @@ int DoPathPlotterBox( PathPlotterRS* rs ){
w = gtk_button_new_with_label( "Enable" ); w = gtk_button_new_with_label( "Enable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_show( w ); gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
w = gtk_button_new_with_label( "Disable" ); w = gtk_button_new_with_label( "Disable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -1233,11 +1245,11 @@ int DoCTFColourChangeBox(){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" ); gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -1260,20 +1272,20 @@ int DoCTFColourChangeBox(){
w = gtk_button_new_with_label( "Red->Blue" ); w = gtk_button_new_with_label( "Red->Blue" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Blue->Red" ); w = gtk_button_new_with_label( "Blue->Red" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -1303,11 +1315,11 @@ int DoResetTextureBox( ResetTextureRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" ); gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
@ -1352,7 +1364,7 @@ int DoResetTextureBox( ResetTextureRS* rs ){
// ---- frame ---- // ---- frame ----
dlgTexReset.cbTexChange = gtk_check_button_new_with_label( "Enabled" ); dlgTexReset.cbTexChange = gtk_check_button_new_with_label( "Enabled" );
gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); g_signal_connect( G_OBJECT( dlgTexReset.cbTexChange ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbTexChange ); gtk_widget_show( dlgTexReset.cbTexChange );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1364,7 +1376,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editTexOld = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editTexOld = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editTexOld ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexOld ), rs->textureName ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexOld ), rs->textureName );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexOld, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexOld, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1377,7 +1390,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editTexNew = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editTexNew = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editTexNew ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexNew ), rs->textureName ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexNew ), rs->textureName );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexNew, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexNew, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1400,7 +1414,7 @@ int DoResetTextureBox( ResetTextureRS* rs ){
// ---- frame ---- // ---- frame ----
dlgTexReset.cbScaleHor = gtk_check_button_new_with_label( "Enabled" ); dlgTexReset.cbScaleHor = gtk_check_button_new_with_label( "Enabled" );
gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); g_signal_connect( G_OBJECT( dlgTexReset.cbScaleHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbScaleHor ); gtk_widget_show( dlgTexReset.cbScaleHor );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1412,7 +1426,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editScaleHor = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editScaleHor = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editScaleHor ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleHor ), "0.5" ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleHor ), "0.5" );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleHor, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleHor, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1421,7 +1436,7 @@ int DoResetTextureBox( ResetTextureRS* rs ){
dlgTexReset.cbScaleVert = gtk_check_button_new_with_label( "Enabled" ); dlgTexReset.cbScaleVert = gtk_check_button_new_with_label( "Enabled" );
gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); g_signal_connect( G_OBJECT( dlgTexReset.cbScaleVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbScaleVert ); gtk_widget_show( dlgTexReset.cbScaleVert );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1433,7 +1448,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editScaleVert = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editScaleVert = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editScaleVert ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleVert ), "0.5" ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleVert ), "0.5" );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleVert, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleVert, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1456,7 +1472,7 @@ int DoResetTextureBox( ResetTextureRS* rs ){
// ---- frame ---- // ---- frame ----
dlgTexReset.cbShiftHor = gtk_check_button_new_with_label( "Enabled" ); dlgTexReset.cbShiftHor = gtk_check_button_new_with_label( "Enabled" );
gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); g_signal_connect( G_OBJECT( dlgTexReset.cbShiftHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbShiftHor ); gtk_widget_show( dlgTexReset.cbShiftHor );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1468,7 +1484,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editShiftHor = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editShiftHor = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editShiftHor ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftHor ), "0" ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftHor ), "0" );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftHor, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftHor, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1477,7 +1494,7 @@ int DoResetTextureBox( ResetTextureRS* rs ){
dlgTexReset.cbShiftVert = gtk_check_button_new_with_label( "Enabled" ); dlgTexReset.cbShiftVert = gtk_check_button_new_with_label( "Enabled" );
gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); g_signal_connect( G_OBJECT( dlgTexReset.cbShiftVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
gtk_widget_show( dlgTexReset.cbShiftVert ); gtk_widget_show( dlgTexReset.cbShiftVert );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1489,7 +1506,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editShiftVert = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editShiftVert = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editShiftVert ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftVert ), "0" ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftVert ), "0" );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftVert, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftVert, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1523,7 +1541,8 @@ int DoResetTextureBox( ResetTextureRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
dlgTexReset.editRotation = gtk_entry_new_with_max_length( 256 ); dlgTexReset.editRotation = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( dlgTexReset.editRotation ), 256 );
gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editRotation ), "0" ); gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editRotation ), "0" );
gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editRotation, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editRotation, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1540,20 +1559,20 @@ int DoResetTextureBox( ResetTextureRS* rs ){
w = gtk_button_new_with_label( "Use Selected Brushes" ); w = gtk_button_new_with_label( "Use Selected Brushes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Use All Brushes" ); w = gtk_button_new_with_label( "Use All Brushes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -1577,42 +1596,42 @@ int DoResetTextureBox( ResetTextureRS* rs ){
dialogError = FALSE; dialogError = FALSE;
if ( ret != IDCANCEL ) { if ( ret != IDCANCEL ) {
rs->bResetRotation = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) ); rs->bResetRotation = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) );
if ( rs->bResetRotation ) { if ( rs->bResetRotation ) {
if ( !ValidateTextInt( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editRotation ) ), "Rotation", &rs->rotation ) ) { if ( !ValidateTextInt( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editRotation ) ), "Rotation", &rs->rotation ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
} }
rs->bResetScale[0] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) ); rs->bResetScale[0] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) );
if ( rs->bResetScale[0] ) { if ( rs->bResetScale[0] ) {
if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editScaleHor ) ), "Horizontal Scale", &rs->fScale[0] ) ) { if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editScaleHor ) ), "Horizontal Scale", &rs->fScale[0] ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
} }
rs->bResetScale[1] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) ); rs->bResetScale[1] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) );
if ( rs->bResetScale[1] ) { if ( rs->bResetScale[1] ) {
if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editScaleVert ) ), "Vertical Scale", &rs->fScale[1] ) ) { if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editScaleVert ) ), "Vertical Scale", &rs->fScale[1] ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
} }
rs->bResetShift[0] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) ); rs->bResetShift[0] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) );
if ( rs->bResetShift[0] ) { if ( rs->bResetShift[0] ) {
if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editShiftHor ) ), "Horizontal Shift", &rs->fShift[0] ) ) { if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editShiftHor ) ), "Horizontal Shift", &rs->fShift[0] ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
} }
rs->bResetShift[1] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) ); rs->bResetShift[1] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) );
if ( rs->bResetShift[1] ) { if ( rs->bResetShift[1] ) {
if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editShiftVert ) ), "Vertical Shift", &rs->fShift[1] ) ) { if ( !ValidateTextFloat( gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editShiftVert ) ), "Vertical Shift", &rs->fShift[1] ) ) {
dialogError = TRUE; dialogError = TRUE;
} }
} }
rs->bResetTextureName = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) ); rs->bResetTextureName = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) );
if ( rs->bResetTextureName ) { if ( rs->bResetTextureName ) {
strcpy( rs->textureName, gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editTexOld ) ) ); strcpy( rs->textureName, gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editTexOld ) ) );
strcpy( rs->newTextureName, gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editTexNew ) ) ); strcpy( rs->newTextureName, gtk_entry_get_text( GTK_ENTRY( dlgTexReset.editTexNew ) ) );
@ -1640,14 +1659,14 @@ int DoTrainThingBox( TrainThingRS* rs ){
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" ); gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
gtk_object_set_data( GTK_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
gtk_object_set_data( GTK_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
gtk_widget_realize( window ); gtk_widget_realize( window );
@ -1682,7 +1701,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
radiusX = gtk_entry_new_with_max_length( 256 ); radiusX = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( radiusX ), 256 );
gtk_entry_set_text( GTK_ENTRY( radiusX ), "100" ); gtk_entry_set_text( GTK_ENTRY( radiusX ), "100" );
gtk_table_attach( GTK_TABLE( table ), radiusX, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), radiusX, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1697,7 +1717,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
radiusY = gtk_entry_new_with_max_length( 256 ); radiusY = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( radiusY ), 256 );
gtk_entry_set_text( GTK_ENTRY( radiusY ), "100" ); gtk_entry_set_text( GTK_ENTRY( radiusY ), "100" );
gtk_table_attach( GTK_TABLE( table ), radiusY, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), radiusY, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1725,7 +1746,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
angleStart = gtk_entry_new_with_max_length( 256 ); angleStart = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( angleStart ), 256 );
gtk_entry_set_text( GTK_ENTRY( angleStart ), "0" ); gtk_entry_set_text( GTK_ENTRY( angleStart ), "0" );
gtk_table_attach( GTK_TABLE( table ), angleStart, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), angleStart, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1740,7 +1762,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
angleEnd = gtk_entry_new_with_max_length( 256 ); angleEnd = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( angleEnd ), 256 );
gtk_entry_set_text( GTK_ENTRY( angleEnd ), "90" ); gtk_entry_set_text( GTK_ENTRY( angleEnd ), "90" );
gtk_table_attach( GTK_TABLE( table ), angleEnd, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), angleEnd, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1767,7 +1790,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
heightStart = gtk_entry_new_with_max_length( 256 ); heightStart = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( heightStart ), 256 );
gtk_entry_set_text( GTK_ENTRY( heightStart ), "0" ); gtk_entry_set_text( GTK_ENTRY( heightStart ), "0" );
gtk_table_attach( GTK_TABLE( table ), heightStart, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), heightStart, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1782,7 +1806,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
heightEnd = gtk_entry_new_with_max_length( 256 ); heightEnd = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( heightEnd ), 256 );
gtk_entry_set_text( GTK_ENTRY( heightEnd ), "0" ); gtk_entry_set_text( GTK_ENTRY( heightEnd ), "0" );
gtk_table_attach( GTK_TABLE( table ), heightEnd, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), heightEnd, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1810,7 +1835,8 @@ int DoTrainThingBox( TrainThingRS* rs ){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
numPoints = gtk_entry_new_with_max_length( 256 ); numPoints = gtk_entry_new();
gtk_entry_set_max_length( GTK_ENTRY( numPoints ), 256 );
gtk_entry_set_text( GTK_ENTRY( numPoints ), "0" ); gtk_entry_set_text( GTK_ENTRY( numPoints ), "0" );
gtk_table_attach( GTK_TABLE( table ), numPoints, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), numPoints, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -1826,15 +1852,15 @@ int DoTrainThingBox( TrainThingRS* rs ){
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;

View file

@ -73,8 +73,8 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
// create the window // create the window
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( window ), "New Camera" ); gtk_window_set_title( GTK_WINDOW( window ), "New Camera" );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
@ -133,15 +133,15 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
w = gtk_button_new_with_label( _( "Ok" ) ); w = gtk_button_new_with_label( _( "Ok" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_show( w ); gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
w = gtk_button_new_with_label( _( "Cancel" ) ); w = gtk_button_new_with_label( _( "Cancel" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -316,7 +316,7 @@ static gint ci_pathlist_changed( GtkWidget *widget, gpointer data ){
} }
// start edit mode // start edit mode
if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) { if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) {
DoStartEdit( GetCurrentCam() ); DoStartEdit( GetCurrentCam() );
} }
@ -365,8 +365,8 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
// create the window // create the window
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" ); gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
@ -414,15 +414,15 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
w = gtk_button_new_with_label( _( "Ok" ) ); w = gtk_button_new_with_label( _( "Ok" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_show( w ); gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
w = gtk_button_new_with_label( _( "Cancel" ) ); w = gtk_button_new_with_label( _( "Cancel" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -483,8 +483,8 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
// create the window // create the window
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( window ), "Add Target" ); gtk_window_set_title( GTK_WINDOW( window ), "Add Target" );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
@ -560,15 +560,15 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
w = gtk_button_new_with_label( _( "Ok" ) ); w = gtk_button_new_with_label( _( "Ok" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_show( w ); gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
w = gtk_button_new_with_label( _( "Cancel" ) ); w = gtk_button_new_with_label( _( "Cancel" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -756,7 +756,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){
// start edit mode // start edit mode
g_iActiveTarget = -1; g_iActiveTarget = -1;
if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) { if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) {
DoStartEdit( GetCurrentCam() ); DoStartEdit( GetCurrentCam() );
} }
@ -830,8 +830,8 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
// create the window // create the window
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( window ), _( "Add Event" ) ); gtk_window_set_title( GTK_WINDOW( window ), _( "Add Event" ) );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
@ -899,15 +899,15 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
w = gtk_button_new_with_label( _( "Ok" ) ); w = gtk_button_new_with_label( _( "Ok" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_show( w ); gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
w = gtk_button_new_with_label( _( "Cancel" ) ); w = gtk_button_new_with_label( _( "Cancel" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -996,9 +996,9 @@ GtkWidget *CreateCameraInspectorDialog( void ){
// create the window // create the window
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( window ), _( "Camera Inspector" ) ); gtk_window_set_title( GTK_WINDOW( window ), _( "Camera Inspector" ) );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", GTK_SIGNAL_FUNC( ci_close ), NULL ); g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( ci_close ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "expose-event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); g_signal_connect( G_OBJECT( window ), "expose-event", G_CALLBACK( ci_expose ), NULL );
// gtk_signal_connect( GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); // g_signal_connect( G_OBJECT (window), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); 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 ;-) // don't use show, as you don't want to have it displayed on startup ;-)
@ -1065,7 +1065,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
RefreshCamListCombo(); RefreshCamListCombo();
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pCamListCombo )->entry ), FALSE ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pCamListCombo )->entry ), FALSE );
gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_camlist_changed ), NULL ); g_signal_connect( G_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", G_CALLBACK( ci_camlist_changed ), NULL );
// -------------------------- // // -------------------------- //
@ -1097,7 +1097,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
RefreshPathListCombo(); RefreshPathListCombo();
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pPathListCombo )->entry ), FALSE ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pPathListCombo )->entry ), FALSE );
gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_pathlist_changed ), NULL ); g_signal_connect( G_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", G_CALLBACK( ci_pathlist_changed ), NULL );
// -------------------------- // // -------------------------- //
@ -1110,14 +1110,14 @@ GtkWidget *CreateCameraInspectorDialog( void ){
gtk_widget_show( g_pEditModeEditRadioButton ); gtk_widget_show( g_pEditModeEditRadioButton );
g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) ); g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) );
gtk_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_edit ), NULL ); g_signal_connect( G_OBJECT( g_pEditModeEditRadioButton ), "clicked", G_CALLBACK( ci_editmode_edit ), NULL );
g_pEditModeAddRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, _( "Add Points" ) ); 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_box_pack_start( GTK_BOX( hbox ), g_pEditModeAddRadioButton, FALSE, FALSE, 3 );
gtk_widget_show( g_pEditModeAddRadioButton ); gtk_widget_show( g_pEditModeAddRadioButton );
g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) ); g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) );
gtk_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_add ), NULL ); g_signal_connect( G_OBJECT( g_pEditModeAddRadioButton ), "clicked", G_CALLBACK( ci_editmode_add ), NULL );
// see if we should use a different default // see if we should use a different default
if ( g_iEditMode == 1 ) { if ( g_iEditMode == 1 ) {
@ -1142,23 +1142,23 @@ GtkWidget *CreateCameraInspectorDialog( void ){
w = gtk_button_new_with_label( _( "Rename..." ) ); w = gtk_button_new_with_label( _( "Rename..." ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_rename ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_rename ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Add Target..." ) ); w = gtk_button_new_with_label( _( "Add Target..." ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add_target ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_add_target ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
// not available in splines library // not available in splines library
/*w = gtk_button_new_with_label( "Delete Selected" ); /*w = gtk_button_new_with_label( "Delete Selected" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0);
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_delete_selected ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_delete_selected ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Select All" ); w = gtk_button_new_with_label( "Select All" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0);
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_select_all ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_select_all ), NULL );
gtk_widget_show( w );*/ gtk_widget_show( w );*/
// -------------------------- // // -------------------------- //
@ -1220,7 +1220,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
gtk_widget_show( hbox ); gtk_widget_show( hbox );
g_pTimeLine = GTK_ADJUSTMENT( gtk_adjustment_new( 0, 0, 30000, 100, 250, 0 ) ); g_pTimeLine = GTK_ADJUSTMENT( gtk_adjustment_new( 0, 0, 30000, 100, 250, 0 ) );
gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value-changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL ); g_signal_connect( G_OBJECT( g_pTimeLine ), "value-changed", G_CALLBACK( ci_timeline_changed ), NULL );
w = gtk_hscale_new( g_pTimeLine ); w = gtk_hscale_new( g_pTimeLine );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_widget_show( w ); gtk_widget_show( w );
@ -1260,7 +1260,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
g_pEventsList = gtk_clist_new( 3 ); g_pEventsList = gtk_clist_new( 3 );
gtk_container_add( GTK_CONTAINER( w ), g_pEventsList ); gtk_container_add( GTK_CONTAINER( w ), g_pEventsList );
//gtk_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", GTK_SIGNAL_FUNC (proplist_select_row), NULL); //g_signal_connect( G_OBJECT(g_pEventsList), "select_row", G_CALLBACK (proplist_select_row), NULL);
gtk_clist_set_selection_mode( GTK_CLIST( g_pEventsList ), GTK_SELECTION_BROWSE ); gtk_clist_set_selection_mode( GTK_CLIST( g_pEventsList ), GTK_SELECTION_BROWSE );
gtk_clist_column_titles_hide( GTK_CLIST( g_pEventsList ) ); gtk_clist_column_titles_hide( GTK_CLIST( g_pEventsList ) );
gtk_clist_set_column_auto_resize( GTK_CLIST( g_pEventsList ), 0, TRUE ); gtk_clist_set_column_auto_resize( GTK_CLIST( g_pEventsList ), 0, TRUE );
@ -1274,12 +1274,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
w = gtk_button_new_with_label( _( "Add..." ) ); w = gtk_button_new_with_label( _( "Add..." ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_add ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Del" ) ); w = gtk_button_new_with_label( _( "Del" ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_del ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_del ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
// -------------------------- // // -------------------------- //
@ -1294,12 +1294,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
w = gtk_button_new_with_label( _( "New..." ) ); w = gtk_button_new_with_label( _( "New..." ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_new ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_new ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Load..." ) ); w = gtk_button_new_with_label( _( "Load..." ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_load ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_load ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
// -------------------------- // // -------------------------- //
@ -1312,12 +1312,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
w = gtk_button_new_with_label( _( "Save..." ) ); w = gtk_button_new_with_label( _( "Save..." ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_save ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_save ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Unload" ) ); w = gtk_button_new_with_label( _( "Unload" ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_unload ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_unload ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
@ -1326,12 +1326,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
w = gtk_button_new_with_label( _( "Apply" ) ); w = gtk_button_new_with_label( _( "Apply" ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_apply ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_apply ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Preview" ) ); w = gtk_button_new_with_label( _( "Preview" ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_preview ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_preview ), NULL );
gtk_widget_show( w ); gtk_widget_show( w );
// -------------------------- // // -------------------------- //
@ -1348,8 +1348,8 @@ GtkWidget *CreateCameraInspectorDialog( void ){
w = gtk_button_new_with_label( _( "Close" ) ); w = gtk_button_new_with_label( _( "Close" ) );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_close ), NULL ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( ci_close ), NULL );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );

View file

@ -1404,7 +1404,7 @@ GtkWidget* create_main_dialog(){
radio = gtk_radio_button_new_with_label( group, games[i] ); radio = gtk_radio_button_new_with_label( group, games[i] );
gtk_widget_show( radio ); gtk_widget_show( radio );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
game_radios[i] = radio; game_radios[i] = radio;
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) ); g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) );
} }
@ -1425,7 +1425,7 @@ GtkWidget* create_main_dialog(){
radio = gtk_radio_button_new_with_label( group, waveforms[i] ); radio = gtk_radio_button_new_with_label( group, waveforms[i] );
gtk_widget_show( radio ); gtk_widget_show( radio );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
wave_radios[i] = radio; wave_radios[i] = radio;
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) ); g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) );
} }
@ -1446,7 +1446,7 @@ GtkWidget* create_main_dialog(){
radio = gtk_radio_button_new_with_label( group, orientations[i] ); radio = gtk_radio_button_new_with_label( group, orientations[i] );
gtk_widget_show( radio ); gtk_widget_show( radio );
gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
plane_radios[i] = radio; plane_radios[i] = radio;
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) ); g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) );
} }
@ -1682,7 +1682,7 @@ GtkWidget* create_main_dialog(){
label = gtk_label_new( _( "Snap to grid:" ) ); label = gtk_label_new( _( "Snap to grid:" ) );
gtk_widget_show( label ); gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
gtk_object_set_data( GTK_OBJECT( dlg ), "snap_text", label ); g_object_set_data( G_OBJECT( dlg ), "snap_text", label );
adj = gtk_adjustment_new( 8, 0, 256, 1, 10, 0 ); adj = gtk_adjustment_new( 8, 0, 256, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( extents_snaptogrid_spin ), &SP ); g_signal_connect( G_OBJECT( adj ), "value-changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );

View file

@ -409,7 +409,7 @@ void WriteIniFile( const char *file ){
} }
void UpdatePreview( bool DataChange ){ void UpdatePreview( bool DataChange ){
if ( g_pWndPreview && GTK_WIDGET_VISIBLE( g_pWndPreview ) ) { if ( g_pWndPreview && gtk_widget_get_visible( g_pWndPreview ) ) {
if ( DataChange ) { if ( DataChange ) {
GenerateXYZ(); GenerateXYZ();
} }

View file

@ -308,7 +308,7 @@ static void motion( GtkWidget *widget, GdkEventMotion *event, gpointer data ){
if ( PtInRect( &rcGrid,pt ) ) { if ( PtInRect( &rcGrid,pt ) ) {
GdkCursor *cursor = gdk_cursor_new( GDK_CROSS ); GdkCursor *cursor = gdk_cursor_new( GDK_CROSS );
gdk_window_set_cursor( g_pWndPreview->window, cursor ); gdk_window_set_cursor( gtk_widget_get_window( g_pWndPreview ), cursor );
gdk_cursor_unref( cursor ); gdk_cursor_unref( cursor );
char Text[32]; char Text[32];
@ -334,7 +334,7 @@ static void motion( GtkWidget *widget, GdkEventMotion *event, gpointer data ){
} }
else else
{ {
gdk_window_set_cursor( g_pWndPreview->window, NULL ); gdk_window_set_cursor( gtk_widget_get_window( g_pWndPreview ), NULL );
} }
g_UIGtkTable.m_pfn_glwidget_swap_buffers( g_pPreviewWidget ); g_UIGtkTable.m_pfn_glwidget_swap_buffers( g_pPreviewWidget );
@ -358,7 +358,7 @@ static gint doublevariable_spinfocusout( GtkWidget* widget, GdkEventFocus* event
} }
static void preview_spin( GtkAdjustment *adj, double *data ){ static void preview_spin( GtkAdjustment *adj, double *data ){
*data = DegreesToRadians( adj->value ); *data = DegreesToRadians( gtk_adjustment_get_value( adj ) );
UpdatePreview( false ); UpdatePreview( false );
} }
@ -373,8 +373,8 @@ void CreateViewWindow(){
g_pWndPreview = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); g_pWndPreview = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), "GtkGenSurf Preview" ); gtk_window_set_title( GTK_WINDOW( dlg ), "GtkGenSurf Preview" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( preview_close ), NULL ); g_signal_connect( G_OBJECT( dlg ), "delete-event", G_CALLBACK( preview_close ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); g_signal_connect( G_OBJECT( dlg ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pWnd ) ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pWnd ) );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 300, 400 ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 300, 400 );
@ -394,14 +394,14 @@ void CreateViewWindow(){
gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 );
adj = gtk_adjustment_new( 30, -90, 90, 1, 10, 0 ); adj = gtk_adjustment_new( 30, -90, 90, 1, 10, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation ); g_signal_connect( adj, "value-changed", G_CALLBACK( preview_spin ), &elevation );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 );
g_signal_connect( G_OBJECT( spin ), "focus-out-event", G_CALLBACK( doublevariable_spinfocusout ), &elevation ); g_signal_connect( G_OBJECT( spin ), "focus-out-event", G_CALLBACK( doublevariable_spinfocusout ), &elevation );
adj = gtk_adjustment_new( 30, 0, 359, 1, 10, 0 ); adj = gtk_adjustment_new( 30, 0, 359, 1, 10, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth ); g_signal_connect( adj, "value-changed", G_CALLBACK( preview_spin ), &azimuth );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE );
@ -422,10 +422,10 @@ void CreateViewWindow(){
g_pPreviewWidget = g_UIGtkTable.m_pfn_glwidget_new( FALSE, NULL ); g_pPreviewWidget = g_UIGtkTable.m_pfn_glwidget_new( FALSE, NULL );
gtk_widget_set_events( g_pPreviewWidget, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK ); gtk_widget_set_events( g_pPreviewWidget, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK );
gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), NULL ); g_signal_connect( G_OBJECT( g_pPreviewWidget ), "expose-event", G_CALLBACK( expose ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "motion-notify-event", GTK_SIGNAL_FUNC( motion ), NULL ); g_signal_connect( G_OBJECT( g_pPreviewWidget ), "motion-notify-event", G_CALLBACK( motion ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "button-press-event", g_signal_connect( G_OBJECT( g_pPreviewWidget ), "button-press-event",
GTK_SIGNAL_FUNC( button_press ), NULL ); G_CALLBACK( button_press ), NULL );
gtk_widget_show( g_pPreviewWidget ); gtk_widget_show( g_pPreviewWidget );
gtk_container_add( GTK_CONTAINER( frame ), g_pPreviewWidget ); gtk_container_add( GTK_CONTAINER( frame ), g_pPreviewWidget );

View file

@ -59,10 +59,10 @@ void DoAboutDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" ); gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -88,8 +88,8 @@ void DoAboutDlg(){
button = gtk_button_new_with_label( "OK" ); button = gtk_button_new_with_label( "OK" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );

View file

@ -69,14 +69,14 @@ static int DoColor( COLORREF *c ){
dlg = gtk_color_selection_dialog_new( "Choose Color" ); dlg = gtk_color_selection_dialog_new( "Choose Color" );
gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr ); gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked", g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked", g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); 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 ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -131,7 +131,7 @@ static void SetClipText( GtkWidget* label ){
} }
static void OnScroll2d( GtkAdjustment *adj, gpointer data ){ static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
portals.width_2d = adj->value; portals.width_2d = gtk_adjustment_get_value( adj );
Set2DText( GTK_WIDGET( data ) ); Set2DText( GTK_WIDGET( data ) );
if ( interfaces_started ) { if ( interfaces_started ) {
@ -140,7 +140,7 @@ static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
} }
static void OnScroll3d( GtkAdjustment *adj, gpointer data ){ static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
portals.width_3d = adj->value; portals.width_3d = gtk_adjustment_get_value( adj );
Set3DText( GTK_WIDGET( data ) ); Set3DText( GTK_WIDGET( data ) );
if ( interfaces_started ) { if ( interfaces_started ) {
@ -149,7 +149,7 @@ static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
} }
static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){ static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
portals.trans_3d = adj->value; portals.trans_3d = gtk_adjustment_get_value( adj );
Set3DTransText( GTK_WIDGET( data ) ); Set3DTransText( GTK_WIDGET( data ) );
if ( interfaces_started ) { if ( interfaces_started ) {
@ -158,7 +158,7 @@ static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
} }
static void OnScrollClip( GtkAdjustment *adj, gpointer data ){ static void OnScrollClip( GtkAdjustment *adj, gpointer data ){
portals.clip_range = adj->value; portals.clip_range = gtk_adjustment_get_value( adj );
SetClipText( GTK_WIDGET( data ) ); SetClipText( GTK_WIDGET( data ) );
if ( interfaces_started ) { if ( interfaces_started ) {
@ -280,10 +280,10 @@ void DoConfigDialog(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Portal Viewer Configuration" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Portal Viewer Configuration" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -314,7 +314,7 @@ void DoConfigDialog(){
lw3label = gtk_label_new( "" ); lw3label = gtk_label_new( "" );
gtk_widget_show( lw3label ); gtk_widget_show( lw3label );
gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScroll3d ), lw3label );
table = gtk_table_new( 2, 4, FALSE ); table = gtk_table_new( 2, 4, FALSE );
gtk_widget_show( table ); gtk_widget_show( table );
@ -327,42 +327,42 @@ void DoConfigDialog(){
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor3d ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnColor3d ), NULL );
button = gtk_button_new_with_label( _( "Depth Color" ) ); button = gtk_button_new_with_label( _( "Depth Color" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColorFog ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnColorFog ), NULL );
aa3check = gtk_check_button_new_with_label( "Anti-Alias (May not work on some video cards)" ); aa3check = gtk_check_button_new_with_label( "Anti-Alias (May not work on some video cards)" );
gtk_widget_show( aa3check ); gtk_widget_show( aa3check );
gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1, gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( aa3check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias3d ), NULL ); g_signal_connect( G_OBJECT( aa3check ), "toggled", G_CALLBACK( OnAntiAlias3d ), NULL );
depthcheck = gtk_check_button_new_with_label( _( "Depth Cue" ) ); depthcheck = gtk_check_button_new_with_label( _( "Depth Cue" ) );
gtk_widget_show( depthcheck ); gtk_widget_show( depthcheck );
gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( depthcheck ), "toggled", GTK_SIGNAL_FUNC( OnFog ), NULL ); g_signal_connect( G_OBJECT( depthcheck ), "toggled", G_CALLBACK( OnFog ), NULL );
linescheck = gtk_check_button_new_with_label( _( "Lines" ) ); linescheck = gtk_check_button_new_with_label( _( "Lines" ) );
gtk_widget_show( linescheck ); gtk_widget_show( linescheck );
gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( linescheck ), "toggled", GTK_SIGNAL_FUNC( OnLines ), NULL ); g_signal_connect( G_OBJECT( linescheck ), "toggled", G_CALLBACK( OnLines ), NULL );
polyscheck = gtk_check_button_new_with_label( _( "Polygons" ) ); polyscheck = gtk_check_button_new_with_label( _( "Polygons" ) );
gtk_widget_show( polyscheck ); gtk_widget_show( polyscheck );
gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2, gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( polyscheck ), "toggled", GTK_SIGNAL_FUNC( OnPoly ), NULL ); g_signal_connect( G_OBJECT( polyscheck ), "toggled", G_CALLBACK( OnPoly ), NULL );
zlist = gtk_option_menu_new(); zlist = gtk_option_menu_new();
gtk_widget_show( zlist ); gtk_widget_show( zlist );
@ -374,20 +374,20 @@ void DoConfigDialog(){
item = gtk_menu_item_new_with_label( _( "Z-Buffer Test and Write (recommended for solid or no polygons)" ) ); item = gtk_menu_item_new_with_label( _( "Z-Buffer Test and Write (recommended for solid or no polygons)" ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) ); G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( _( "Z-Buffer Test Only (recommended for transparent polygons)" ) ); item = gtk_menu_item_new_with_label( _( "Z-Buffer Test Only (recommended for transparent polygons)" ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) ); G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( _( "Z-Buffer Off" ) ); item = gtk_menu_item_new_with_label( _( "Z-Buffer Off" ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) ); G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
table = gtk_table_new( 2, 2, FALSE ); table = gtk_table_new( 2, 2, FALSE );
@ -410,7 +410,7 @@ void DoConfigDialog(){
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 ); gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScrollTrans ), translabel );
adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 1 ); adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 1 );
clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) ); clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
@ -426,7 +426,7 @@ void DoConfigDialog(){
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 ); gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScrollClip ), cliplabel );
hbox = gtk_hbox_new( TRUE, 5 ); hbox = gtk_hbox_new( TRUE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -435,12 +435,12 @@ void DoConfigDialog(){
show3check = gtk_check_button_new_with_label( _( "Show" ) ); show3check = gtk_check_button_new_with_label( _( "Show" ) );
gtk_widget_show( show3check ); gtk_widget_show( show3check );
gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( show3check ), "toggled", GTK_SIGNAL_FUNC( OnConfig3d ), NULL ); g_signal_connect( G_OBJECT( show3check ), "toggled", G_CALLBACK( OnConfig3d ), NULL );
portalcheck = gtk_check_button_new_with_label( _( "Portal cubic clipper" ) ); portalcheck = gtk_check_button_new_with_label( _( "Portal cubic clipper" ) );
gtk_widget_show( portalcheck ); gtk_widget_show( portalcheck );
gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( portalcheck ), "toggled", GTK_SIGNAL_FUNC( OnClip ), NULL ); g_signal_connect( G_OBJECT( portalcheck ), "toggled", G_CALLBACK( OnClip ), NULL );
frame = gtk_frame_new( _( "2D View" ) ); frame = gtk_frame_new( _( "2D View" ) );
gtk_widget_show( frame ); gtk_widget_show( frame );
@ -464,7 +464,7 @@ void DoConfigDialog(){
lw2label = gtk_label_new( "" ); lw2label = gtk_label_new( "" );
gtk_widget_show( lw2label ); gtk_widget_show( lw2label );
gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScroll2d ), lw2label );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -473,13 +473,13 @@ void DoConfigDialog(){
button = gtk_button_new_with_label( _( "Color" ) ); button = gtk_button_new_with_label( _( "Color" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnColor2d ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
aa2check = gtk_check_button_new_with_label( _( "Anti-Alias (May not work on some video cards)" ) ); aa2check = gtk_check_button_new_with_label( _( "Anti-Alias (May not work on some video cards)" ) );
gtk_widget_show( aa2check ); gtk_widget_show( aa2check );
gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( aa2check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias2d ), NULL ); g_signal_connect( G_OBJECT( aa2check ), "toggled", G_CALLBACK( OnAntiAlias2d ), NULL );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -488,7 +488,7 @@ void DoConfigDialog(){
show2check = gtk_check_button_new_with_label( _( "Show" ) ); show2check = gtk_check_button_new_with_label( _( "Show" ) );
gtk_widget_show( show2check ); gtk_widget_show( show2check );
gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( show2check ), "toggled", GTK_SIGNAL_FUNC( OnConfig2d ), NULL ); g_signal_connect( G_OBJECT( show2check ), "toggled", G_CALLBACK( OnConfig2d ), NULL );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -497,8 +497,8 @@ void DoConfigDialog(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
// initialize dialog // initialize dialog

View file

@ -71,12 +71,12 @@ static void change_clicked( GtkWidget *widget, gpointer data ){
int loop = 1; int loop = 1;
file_sel = gtk_file_selection_new( "Locate portal (.prt) file" ); file_sel = gtk_file_selection_new( "Locate portal (.prt) file" );
gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked", g_signal_connect( G_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked",
GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDOK ) );
gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked", g_signal_connect( G_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked",
GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_signal_connect( GTK_OBJECT( file_sel ), "delete-event", g_signal_connect( G_OBJECT( file_sel ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) ); gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) );
g_object_set_data( G_OBJECT( file_sel ), "loop", &loop ); g_object_set_data( G_OBJECT( file_sel ), "loop", &loop );
@ -105,10 +105,10 @@ int DoLoadPortalFileDialog(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" ); gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -137,7 +137,7 @@ int DoLoadPortalFileDialog(){
button = gtk_button_new_with_label( "Change" ); button = gtk_button_new_with_label( "Change" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( change_clicked ), entry ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( change_clicked ), entry );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
@ -147,15 +147,15 @@ int DoLoadPortalFileDialog(){
button = gtk_button_new_with_label( "Cancel" ); button = gtk_button_new_with_label( "Cancel" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( "OK" ); button = gtk_button_new_with_label( "OK" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
char *fn = g_FuncTable.m_pfnGetMapName(); char *fn = g_FuncTable.m_pfnGetMapName();

View file

@ -70,12 +70,12 @@ static void change_clicked( GtkWidget *widget, gpointer data ){
int loop = 1; int loop = 1;
file_sel = gtk_file_selection_new( "Locate portal (.prt) file" ); file_sel = gtk_file_selection_new( "Locate portal (.prt) file" );
gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked", g_signal_connect( G_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked",
GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDOK ) );
gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked", g_signal_connect( G_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked",
GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_signal_connect( GTK_OBJECT( file_sel ), "delete-event", g_signal_connect( G_OBJECT( file_sel ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) ); gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) );
g_object_set_data( G_OBJECT( file_sel ), "loop", &loop ); g_object_set_data( G_OBJECT( file_sel ), "loop", &loop );
@ -107,10 +107,10 @@ int DoLoadPortalFileDialog(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" ); gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -139,7 +139,7 @@ int DoLoadPortalFileDialog(){
button = gtk_button_new_with_label( "Change" ); button = gtk_button_new_with_label( "Change" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( change_clicked ), entry ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( change_clicked ), entry );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
@ -149,15 +149,15 @@ int DoLoadPortalFileDialog(){
button = gtk_button_new_with_label( "Cancel" ); button = gtk_button_new_with_label( "Cancel" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( "OK" ); button = gtk_button_new_with_label( "OK" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
char *fn = g_IBSPTable.m_pfnGetMapName(); char *fn = g_IBSPTable.m_pfnGetMapName();
@ -200,10 +200,10 @@ void DoAboutDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" ); gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -226,8 +226,8 @@ void DoAboutDlg(){
button = gtk_button_new_with_label( "OK" ); button = gtk_button_new_with_label( "OK" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -254,14 +254,14 @@ static int DoColor( COLORREF *c ){
dlg = gtk_color_selection_dialog_new( "Choose Color" ); dlg = gtk_color_selection_dialog_new( "Choose Color" );
gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr ); gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked", g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked", g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); 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 ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -465,10 +465,10 @@ void DoConfigDialog(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Portal Viewer Configuration" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Portal Viewer Configuration" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -499,7 +499,7 @@ void DoConfigDialog(){
lw3label = gtk_label_new( "" ); lw3label = gtk_label_new( "" );
gtk_widget_show( lw3label ); gtk_widget_show( lw3label );
gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScroll3d ), lw3label );
table = gtk_table_new( 2, 4, FALSE ); table = gtk_table_new( 2, 4, FALSE );
gtk_widget_show( table ); gtk_widget_show( table );
@ -512,42 +512,42 @@ void DoConfigDialog(){
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor3d ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnColor3d ), NULL );
button = gtk_button_new_with_label( _( "Depth Color" ) ); button = gtk_button_new_with_label( _( "Depth Color" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColorFog ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnColorFog ), NULL );
aa3check = gtk_check_button_new_with_label( _( "Anti-Alias (May not work on some video cards)" ) ); aa3check = gtk_check_button_new_with_label( _( "Anti-Alias (May not work on some video cards)" ) );
gtk_widget_show( aa3check ); gtk_widget_show( aa3check );
gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1, gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( aa3check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias3d ), NULL ); g_signal_connect( G_OBJECT( aa3check ), "toggled", G_CALLBACK( OnAntiAlias3d ), NULL );
depthcheck = gtk_check_button_new_with_label( _( "Depth Cue" ) ); depthcheck = gtk_check_button_new_with_label( _( "Depth Cue" ) );
gtk_widget_show( depthcheck ); gtk_widget_show( depthcheck );
gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( depthcheck ), "toggled", GTK_SIGNAL_FUNC( OnFog ), NULL ); g_signal_connect( G_OBJECT( depthcheck ), "toggled", G_CALLBACK( OnFog ), NULL );
linescheck = gtk_check_button_new_with_label( _( "Lines" ) ); linescheck = gtk_check_button_new_with_label( _( "Lines" ) );
gtk_widget_show( linescheck ); gtk_widget_show( linescheck );
gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( linescheck ), "toggled", GTK_SIGNAL_FUNC( OnLines ), NULL ); g_signal_connect( G_OBJECT( linescheck ), "toggled", G_CALLBACK( OnLines ), NULL );
polyscheck = gtk_check_button_new_with_label( _( "Polygons" ) ); polyscheck = gtk_check_button_new_with_label( _( "Polygons" ) );
gtk_widget_show( polyscheck ); gtk_widget_show( polyscheck );
gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2, gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( polyscheck ), "toggled", GTK_SIGNAL_FUNC( OnPoly ), NULL ); g_signal_connect( G_OBJECT( polyscheck ), "toggled", G_CALLBACK( OnPoly ), NULL );
zlist = gtk_option_menu_new(); zlist = gtk_option_menu_new();
gtk_widget_show( zlist ); gtk_widget_show( zlist );
@ -559,20 +559,20 @@ void DoConfigDialog(){
item = gtk_menu_item_new_with_label( _( "Z-Buffer Test and Write (recommended for solid or no polygons)" ) ); item = gtk_menu_item_new_with_label( _( "Z-Buffer Test and Write (recommended for solid or no polygons)" ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) ); G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( _( "Z-Buffer Test Only (recommended for transparent polygons)" ) ); item = gtk_menu_item_new_with_label( _( "Z-Buffer Test Only (recommended for transparent polygons)" ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) ); G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( _( "Z-Buffer Off" ) ); item = gtk_menu_item_new_with_label( _( "Z-Buffer Off" ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) ); G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
table = gtk_table_new( 2, 2, FALSE ); table = gtk_table_new( 2, 2, FALSE );
@ -595,7 +595,7 @@ void DoConfigDialog(){
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 ); gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScrollTrans ), translabel );
adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 1 ); adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 1 );
clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) ); clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
@ -611,7 +611,7 @@ void DoConfigDialog(){
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 ); gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScrollClip ), cliplabel );
hbox = gtk_hbox_new( TRUE, 5 ); hbox = gtk_hbox_new( TRUE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -620,12 +620,12 @@ void DoConfigDialog(){
show3check = gtk_check_button_new_with_label( _( "Show" ) ); show3check = gtk_check_button_new_with_label( _( "Show" ) );
gtk_widget_show( show3check ); gtk_widget_show( show3check );
gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( show3check ), "toggled", GTK_SIGNAL_FUNC( OnConfig3d ), NULL ); g_signal_connect( G_OBJECT( show3check ), "toggled", G_CALLBACK( OnConfig3d ), NULL );
portalcheck = gtk_check_button_new_with_label( _( "Portal cubic clipper" ) ); portalcheck = gtk_check_button_new_with_label( _( "Portal cubic clipper" ) );
gtk_widget_show( portalcheck ); gtk_widget_show( portalcheck );
gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( portalcheck ), "toggled", GTK_SIGNAL_FUNC( OnClip ), NULL ); g_signal_connect( G_OBJECT( portalcheck ), "toggled", G_CALLBACK( OnClip ), NULL );
frame = gtk_frame_new( _( "2D View" ) ); frame = gtk_frame_new( _( "2D View" ) );
gtk_widget_show( frame ); gtk_widget_show( frame );
@ -649,7 +649,7 @@ void DoConfigDialog(){
lw2label = gtk_label_new( "" ); lw2label = gtk_label_new( "" );
gtk_widget_show( lw2label ); gtk_widget_show( lw2label );
gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnScroll2d ), lw2label );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -658,13 +658,13 @@ void DoConfigDialog(){
button = gtk_button_new_with_label( "Color" ); button = gtk_button_new_with_label( "Color" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnColor2d ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
aa2check = gtk_check_button_new_with_label( "Anti-Alias (May not work on some video cards)" ); aa2check = gtk_check_button_new_with_label( "Anti-Alias (May not work on some video cards)" );
gtk_widget_show( aa2check ); gtk_widget_show( aa2check );
gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( aa2check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias2d ), NULL ); g_signal_connect( G_OBJECT( aa2check ), "toggled", G_CALLBACK( OnAntiAlias2d ), NULL );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -673,7 +673,7 @@ void DoConfigDialog(){
show2check = gtk_check_button_new_with_label( "Show" ); show2check = gtk_check_button_new_with_label( "Show" );
gtk_widget_show( show2check ); gtk_widget_show( show2check );
gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( show2check ), "toggled", GTK_SIGNAL_FUNC( OnConfig2d ), NULL ); g_signal_connect( G_OBJECT( show2check ), "toggled", G_CALLBACK( OnConfig2d ), NULL );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -682,8 +682,8 @@ void DoConfigDialog(){
button = gtk_button_new_with_label( "OK" ); button = gtk_button_new_with_label( "OK" );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
// initialize dialog // initialize dialog

View file

@ -243,7 +243,7 @@ void on_content_button_toggled( GtkToggleButton *togglebutton, gpointer user_dat
// Value Entry Callback // Value Entry Callback
void on_value_entry_changed( GtkEditable *editable, gpointer user_data ){ void on_value_entry_changed( GtkEditable *editable, gpointer user_data ){
if ( ( !setup_buttons ) ) { // If we're setting up the buttons, don't change value if ( ( !setup_buttons ) ) { // If we're setting up the buttons, don't change value
working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable ) ); working_value = atoi( gtk_entry_get_text( GTK_ENTRY( editable ) ) );
GetTexMods( false ); GetTexMods( false );
} }
} }
@ -264,15 +264,15 @@ void on_value_entry_insert_text( GtkEditable *editable, gchar *new_text, gint ne
} }
if ( count > 0 ) { if ( count > 0 ) {
gtk_signal_handler_block_by_func( GTK_OBJECT( editable ), g_signal_handlers_block_by_func( G_OBJECT( editable ),
GTK_SIGNAL_FUNC( on_value_entry_insert_text ), (gpointer)G_CALLBACK( on_value_entry_insert_text ),
user_data ); user_data );
gtk_editable_insert_text( editable, result, count, position ); gtk_editable_insert_text( editable, result, count, position );
gtk_signal_handler_unblock_by_func( GTK_OBJECT( editable ), g_signal_handlers_unblock_by_func( G_OBJECT( editable ),
GTK_SIGNAL_FUNC( on_value_entry_insert_text ), (gpointer)G_CALLBACK( on_value_entry_insert_text ),
user_data ); user_data );
} }
gtk_signal_emit_stop_by_name( GTK_OBJECT( editable ), "insert-text" ); g_signal_stop_emission_by_name( G_OBJECT( editable ), "insert-text" );
g_free( result ); g_free( result );
} }
@ -338,7 +338,7 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer ); buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer );
//Sys_Printf( "%s: %s\n", buffer, buttonLabel ); //Sys_Printf( "%s: %s\n", buffer, buttonLabel );
surface_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel ); surface_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
gtk_signal_connect( GTK_OBJECT( surface_buttons[i] ), "toggled", GTK_SIGNAL_FUNC( on_surface_button_toggled ), GINT_TO_POINTER( 1 << i ) ); g_signal_connect( G_OBJECT( surface_buttons[i] ), "toggled", G_CALLBACK( on_surface_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_widget_show( surface_buttons[i] ); gtk_widget_show( surface_buttons[i] );
gtk_table_attach( GTK_TABLE( table4 ), surface_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ), gtk_table_attach( GTK_TABLE( table4 ), surface_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@ -362,11 +362,11 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
gtk_box_pack_start( GTK_BOX( hbox3 ), value_label, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox3 ), value_label, FALSE, FALSE, 0 );
value_entry = gtk_entry_new(); value_entry = gtk_entry_new();
gtk_signal_connect( GTK_OBJECT( value_entry ), "changed", g_signal_connect( G_OBJECT( value_entry ), "changed",
GTK_SIGNAL_FUNC( on_value_entry_changed ), G_CALLBACK( on_value_entry_changed ),
NULL ); NULL );
gtk_signal_connect( GTK_OBJECT( value_entry ), "insert-text", g_signal_connect( G_OBJECT( value_entry ), "insert-text",
GTK_SIGNAL_FUNC( on_value_entry_insert_text ), G_CALLBACK( on_value_entry_insert_text ),
NULL ); NULL );
gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 ); gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 );
gtk_widget_show( value_entry ); gtk_widget_show( value_entry );
@ -395,7 +395,7 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
snprintf( buffer, sizeof( buffer ) - 1, "cont%i", i + 1 ); snprintf( buffer, sizeof( buffer ) - 1, "cont%i", i + 1 );
buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer ); buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer );
content_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel ); content_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
gtk_signal_connect( GTK_OBJECT( content_buttons[i] ), "toggled", GTK_SIGNAL_FUNC( on_content_button_toggled ), GINT_TO_POINTER( 1 << i ) ); g_signal_connect( G_OBJECT( content_buttons[i] ), "toggled", G_CALLBACK( on_content_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_widget_show( content_buttons[i] ); gtk_widget_show( content_buttons[i] );
gtk_table_attach( GTK_TABLE( table3 ), content_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ), gtk_table_attach( GTK_TABLE( table3 ), content_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),

View file

@ -117,22 +117,22 @@ bool C2DView::OnRButtonUp( int x, int y ){
menu = gtk_menu_new(); menu = gtk_menu_new();
item = gtk_menu_item_new_with_label( "Validate (RETURN)" ); item = gtk_menu_item_new_with_label( "Validate (RETURN)" );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Validate ), NULL ); g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( Textool_Validate ), NULL );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( "Zoom in (INSERT)" ); item = gtk_menu_item_new_with_label( "Zoom in (INSERT)" );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( view_ZoomIn ), this ); g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( view_ZoomIn ), this );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( "Zoom out (DELETE)" ); item = gtk_menu_item_new_with_label( "Zoom out (DELETE)" );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( view_ZoomOut ), this ); g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( view_ZoomOut ), this );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
item = gtk_menu_item_new_with_label( "Cancel (ESC)" ); item = gtk_menu_item_new_with_label( "Cancel (ESC)" );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Cancel ), NULL ); g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( Textool_Cancel ), NULL );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );

View file

@ -55,12 +55,12 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", g_signal_connect( G_OBJECT( window ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", g_signal_connect( G_OBJECT( window ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption ); gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
gtk_widget_realize( window ); gtk_widget_realize( window );
@ -85,9 +85,9 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
if ( mode == MB_OK ) { if ( mode == MB_OK ) {
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDOK; ret = IDOK;
@ -95,38 +95,38 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
else if ( mode == MB_OKCANCEL ) { else if ( mode == MB_OKCANCEL ) {
w = gtk_button_new_with_label( "Ok" ); w = gtk_button_new_with_label( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
} }
else if ( mode == MB_YESNOCANCEL ) { else if ( mode == MB_YESNOCANCEL ) {
w = gtk_button_new_with_label( "Yes" ); w = gtk_button_new_with_label( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "No" ); w = gtk_button_new_with_label( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" ); w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
} }
@ -134,16 +134,16 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
{ {
w = gtk_button_new_with_label( "Yes" ); w = gtk_button_new_with_label( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( "No" ); w = gtk_button_new_with_label( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDNO; ret = IDNO;
} }
@ -607,7 +607,7 @@ static gint expose( GtkWidget *widget, GdkEventExpose *event, gpointer data ){
static gint keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){ static gint keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
unsigned int code = gdk_keyval_to_upper( event->keyval ); unsigned int code = gdk_keyval_to_upper( event->keyval );
if ( code == GDK_Escape ) { if ( code == GDK_KEY_Escape ) {
gtk_widget_destroy( g_pToolWnd ); gtk_widget_destroy( g_pToolWnd );
g_pToolWnd = NULL; g_pToolWnd = NULL;
return TRUE; return TRUE;
@ -618,7 +618,7 @@ static gint keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
return FALSE; return FALSE;
} }
if ( code == GDK_Return ) { if ( code == GDK_KEY_Return ) {
Textool_Validate(); Textool_Validate();
return FALSE; return FALSE;
} }
@ -641,17 +641,17 @@ static GtkWidget* CreateOpenGLWidget(){
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ); GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK );
// Connect signal handlers // Connect signal handlers
gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), NULL ); g_signal_connect( G_OBJECT( g_pToolWidget ), "expose-event", G_CALLBACK( expose ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion-notify-event", g_signal_connect( G_OBJECT( g_pToolWidget ), "motion-notify-event",
GTK_SIGNAL_FUNC( motion ), NULL ); G_CALLBACK( motion ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button-press-event", g_signal_connect( G_OBJECT( g_pToolWidget ), "button-press-event",
GTK_SIGNAL_FUNC( button_press ), NULL ); G_CALLBACK( button_press ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button-release-event", g_signal_connect( G_OBJECT( g_pToolWidget ), "button-release-event",
GTK_SIGNAL_FUNC( button_release ), NULL ); G_CALLBACK( button_release ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "delete-event", GTK_SIGNAL_FUNC( close ), NULL ); g_signal_connect( G_OBJECT( g_pToolWnd ), "delete-event", G_CALLBACK( close ), NULL );
gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "key-press-event", g_signal_connect( G_OBJECT( g_pToolWnd ), "key-press-event",
GTK_SIGNAL_FUNC( keypress ), NULL ); G_CALLBACK( keypress ), NULL );
return g_pToolWidget; return g_pToolWidget;
} }

View file

@ -59,14 +59,14 @@ int BP_MessageBox( int status ){
int ret, loop = 1; int ret, loop = 1;
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", g_signal_connect( G_OBJECT( window ), "delete-event",
GTK_SIGNAL_FUNC( BP_dialog_delete_callback ), NULL ); G_CALLBACK( BP_dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", g_signal_connect( G_OBJECT( window ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), _( "Current map format is incompatible" ) ); gtk_window_set_title( GTK_WINDOW( window ), _( "Current map format is incompatible" ) );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
gtk_widget_realize( window ); gtk_widget_realize( window );
@ -109,22 +109,22 @@ int BP_MessageBox( int status ){
w = gtk_button_new_with_label( _( "Convert" ) ); w = gtk_button_new_with_label( _( "Convert" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( BP_dialog_button_callback ), GINT_TO_POINTER( 1 ) ); G_CALLBACK( BP_dialog_button_callback ), GINT_TO_POINTER( 1 ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Change default" ) ); w = gtk_button_new_with_label( _( "Change default" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( BP_dialog_button_callback ), GINT_TO_POINTER( 2 ) ); G_CALLBACK( BP_dialog_button_callback ), GINT_TO_POINTER( 2 ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Abort load" ) ); w = gtk_button_new_with_label( _( "Abort load" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( BP_dialog_button_callback ), GINT_TO_POINTER( 0 ) ); G_CALLBACK( BP_dialog_button_callback ), GINT_TO_POINTER( 0 ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = 0; // abort ret = 0; // abort

View file

@ -339,7 +339,7 @@ void CamWnd::Cam_MouseControl( float dtime ){
dx = m_ptLastCamCursorX - m_ptCursorX; dx = m_ptLastCamCursorX - m_ptCursorX;
dy = m_ptLastCamCursorY - m_ptCursorY; dy = m_ptLastCamCursorY - m_ptCursorY;
gdk_window_get_origin( m_pWidget->window, &x, &y ); gdk_window_get_origin( gtk_widget_get_window( m_pWidget ), &x, &y );
m_ptLastCamCursorX = x + ( m_Camera.width / 2 ); m_ptLastCamCursorX = x + ( m_Camera.width / 2 );
m_ptLastCamCursorY = y + ( m_Camera.height / 2 ); m_ptLastCamCursorY = y + ( m_Camera.height / 2 );
@ -481,12 +481,12 @@ void CamWnd::ToggleFreeMove(){
if ( g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) { if ( g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) {
widget = g_pParentWnd->GetCamWnd()->m_pParent; widget = g_pParentWnd->GetCamWnd()->m_pParent;
window = widget->window; window = gtk_widget_get_window( widget );
} }
else else
{ {
widget = g_pParentWnd->m_pWidget; widget = g_pParentWnd->m_pWidget;
window = widget->window; window = gtk_widget_get_window( widget );
} }
if ( m_bFreeMove ) { if ( m_bFreeMove ) {
@ -514,8 +514,8 @@ void CamWnd::ToggleFreeMove(){
// RR2DO2: FIXME why does this only work the 2nd and // RR2DO2: FIXME why does this only work the 2nd and
// further times the event is called? (floating windows // further times the event is called? (floating windows
// mode seems to work fine though...) // mode seems to work fine though...)
m_FocusOutHandler_id = gtk_signal_connect( GTK_OBJECT( widget ), "focus-out-event", m_FocusOutHandler_id = g_signal_connect( G_OBJECT( widget ), "focus-out-event",
GTK_SIGNAL_FUNC( camwindow_focusout ), g_pParentWnd ); G_CALLBACK( camwindow_focusout ), g_pParentWnd );
{ {
GdkEventMask mask = (GdkEventMask)( GDK_POINTER_MOTION_MASK GdkEventMask mask = (GdkEventMask)( GDK_POINTER_MOTION_MASK
@ -527,14 +527,14 @@ void CamWnd::ToggleFreeMove(){
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK ); | GDK_BUTTON_RELEASE_MASK );
gdk_pointer_grab( widget->window, TRUE, mask, widget->window, NULL, GDK_CURRENT_TIME ); gdk_pointer_grab( gtk_widget_get_window( widget ), TRUE, mask, gtk_widget_get_window( widget ), NULL, GDK_CURRENT_TIME );
} }
} }
else else
{ {
gdk_pointer_ungrab( GDK_CURRENT_TIME ); gdk_pointer_ungrab( GDK_CURRENT_TIME );
gtk_signal_disconnect( GTK_OBJECT( widget ), m_FocusOutHandler_id ); g_signal_handler_disconnect( G_OBJECT( widget ), m_FocusOutHandler_id );
GdkCursor *cursor = gdk_cursor_new( GDK_LEFT_PTR ); GdkCursor *cursor = gdk_cursor_new( GDK_LEFT_PTR );
gdk_window_set_cursor( window, cursor ); gdk_window_set_cursor( window, cursor );

View file

@ -81,10 +81,10 @@ static gint delete_event_callback( GtkWidget *widget, GdkEvent* event, gpointer
void Dialog::Create(){ void Dialog::Create(){
if ( m_bNeedBuild ) { if ( m_bNeedBuild ) {
m_pWidget = gtk_window_new( GTK_WINDOW_TOPLEVEL ); m_pWidget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "delete-event", g_signal_connect( G_OBJECT( m_pWidget ), "delete-event",
GTK_SIGNAL_FUNC( delete_event_callback ), this ); G_CALLBACK( delete_event_callback ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "destroy", g_signal_connect( G_OBJECT( m_pWidget ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( m_pWidget ), "loop", &m_nLoop ); g_object_set_data( G_OBJECT( m_pWidget ), "loop", &m_nLoop );
g_object_set_data( G_OBJECT( m_pWidget ), "ret", &m_nReturn ); g_object_set_data( G_OBJECT( m_pWidget ), "ret", &m_nReturn );
@ -112,8 +112,8 @@ void Dialog::AddDialogData( GtkObject *object, void *buf, DLG_DATA_TYPE type ){
} }
void Dialog::AddModalButton( GtkWidget *widget, int ret ) { void Dialog::AddModalButton( GtkWidget *widget, int ret ) {
gtk_signal_connect( GTK_OBJECT( widget ), "clicked", g_signal_connect( G_OBJECT( widget ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( ret ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( ret ) );
} }
void Dialog::UpdateData( bool retrieve ){ void Dialog::UpdateData( bool retrieve ){

View file

@ -42,10 +42,10 @@ void ShowInfoDialog( const char* pText ){
g_dlgInfo = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); g_dlgInfo = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Information" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Information" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( gtk_widget_hide ), NULL ); G_CALLBACK( gtk_widget_hide ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 300, 150 ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 300, 150 );
scr = gtk_scrolled_window_new( NULL, NULL ); scr = gtk_scrolled_window_new( NULL, NULL );

View file

@ -72,7 +72,7 @@ static void find_clicked( GtkWidget *widget, gpointer data ){
IShader *pShader = QERApp_ActiveShader_ForIndex( i ); IShader *pShader = QERApp_ActiveShader_ForIndex( i );
item = gtk_menu_item_new_with_label( pShader->getName() ); item = gtk_menu_item_new_with_label( pShader->getName() );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( popup_selected ), data ); g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( popup_selected ), data );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
} }
@ -146,8 +146,8 @@ void FindTextureDialog::BuildDialog(){
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( entry ), "focus-in-event", g_signal_connect( G_OBJECT( entry ), "focus-in-event",
GTK_SIGNAL_FUNC( find_focus_in ), NULL ); G_CALLBACK( find_focus_in ), NULL );
AddDialogData( entry, &m_strFind, DLG_ENTRY_TEXT ); AddDialogData( entry, &m_strFind, DLG_ENTRY_TEXT );
button = gtk_button_new(); button = gtk_button_new();
@ -155,8 +155,8 @@ void FindTextureDialog::BuildDialog(){
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( find_clicked ), entry ); G_CALLBACK( find_clicked ), entry );
arrow = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT ); arrow = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT );
gtk_widget_show( arrow ); gtk_widget_show( arrow );
@ -167,8 +167,8 @@ void FindTextureDialog::BuildDialog(){
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( entry ), "focus-in-event", g_signal_connect( G_OBJECT( entry ), "focus-in-event",
GTK_SIGNAL_FUNC( replace_focus_in ), NULL ); G_CALLBACK( replace_focus_in ), NULL );
AddDialogData( entry, &m_strReplace, DLG_ENTRY_TEXT ); AddDialogData( entry, &m_strReplace, DLG_ENTRY_TEXT );
button = gtk_button_new(); button = gtk_button_new();
@ -176,8 +176,8 @@ void FindTextureDialog::BuildDialog(){
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( find_clicked ), entry ); G_CALLBACK( find_clicked ), entry );
arrow = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT ); arrow = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT );
gtk_widget_show( arrow ); gtk_widget_show( arrow );
@ -205,29 +205,29 @@ void FindTextureDialog::BuildDialog(){
button = gtk_button_new_with_label( _( "Find" ) ); button = gtk_button_new_with_label( _( "Find" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnFind ), NULL ); G_CALLBACK( OnFind ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnOK ), NULL ); G_CALLBACK( OnOK ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Apply" ) ); button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnApply ), NULL ); G_CALLBACK( OnApply ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Close" ) ); button = gtk_button_new_with_label( _( "Close" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnClose ), NULL ); G_CALLBACK( OnClose ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_widget_show( dlg ); gtk_widget_show( dlg );
@ -246,7 +246,7 @@ void FindTextureDialog::updateTextures( const char *p ){
} }
bool FindTextureDialog::isOpen(){ bool FindTextureDialog::isOpen(){
return ( g_dlgFind.m_pWidget == NULL || GTK_WIDGET_VISIBLE( g_dlgFind.m_pWidget ) == FALSE ) ? false : true; return ( g_dlgFind.m_pWidget == NULL || gtk_widget_get_visible( g_dlgFind.m_pWidget ) == FALSE ) ? false : true;
} }
void FindTextureDialog::setFindStr( const char * p ){ void FindTextureDialog::setFindStr( const char * p ){

View file

@ -177,9 +177,12 @@ GtkWidget* WINAPI gtk_glwidget_new( gboolean zbuffer, GtkWidget* share ){
GtkWidget* drawing_area = gtk_drawing_area_new(); GtkWidget* drawing_area = gtk_drawing_area_new();
GdkGLConfig* glconfig = ( zbuffer ) ? glconfig_new_with_depth() : glconfig_new(); GdkGLConfig* glconfig = ( zbuffer ) ? glconfig_new_with_depth() : glconfig_new();
GdkGLContext* shared_context = ( share ) ? gtk_widget_get_gl_context( share ) : NULL; GdkGLContext* shared_context = ( share ) ? gtk_widget_get_gl_context( share ) : NULL;
gboolean result;
gtk_widget_set_gl_capability( drawing_area, glconfig, shared_context, TRUE, GDK_GL_RGBA_TYPE ); result = gtk_widget_set_gl_capability( drawing_area, glconfig, shared_context, TRUE, GDK_GL_RGBA_TYPE );
if( !result ){
Sys_Printf( "gtk_widget_set_gl_capability failed.\n" );
}
return drawing_area; return drawing_area;
} }

View file

@ -67,7 +67,7 @@ static void button_press( GtkWidget *widget, GdkEventButton *event, gpointer dat
GLWindow *wnd = (GLWindow*)data; GLWindow *wnd = (GLWindow*)data;
guint32 flags = 0; guint32 flags = 0;
gdk_pointer_grab( widget->window, FALSE, gdk_pointer_grab( gtk_widget_get_window( widget ), FALSE,
(GdkEventMask)( GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ), (GdkEventMask)( GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ),
NULL, NULL, GDK_CURRENT_TIME ); NULL, NULL, GDK_CURRENT_TIME );
@ -214,14 +214,14 @@ GLWindow::GLWindow( bool zbuffer ) {
#endif #endif
// Connect signal handlers // Connect signal handlers
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "realize", GTK_SIGNAL_FUNC( realize ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "realize", G_CALLBACK( realize ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "expose-event", G_CALLBACK( expose ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "motion-notify-event", GTK_SIGNAL_FUNC( motion ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "motion-notify-event", G_CALLBACK( motion ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button-press-event", GTK_SIGNAL_FUNC( button_press ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "button-press-event", G_CALLBACK( button_press ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button-release-event",GTK_SIGNAL_FUNC( button_release ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "button-release-event",G_CALLBACK( button_release ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size-allocate", GTK_SIGNAL_FUNC( resize ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "size-allocate", G_CALLBACK( resize ), this );
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll-event", GTK_SIGNAL_FUNC( scroll_event ), this ); g_signal_connect( G_OBJECT( m_pWidget ), "scroll-event", G_CALLBACK( scroll_event ), this );
#endif #endif
} }
@ -244,11 +244,11 @@ void GLWindow::CreateContext(){
} }
void GLWindow::SetTimer( guint millisec ){ void GLWindow::SetTimer( guint millisec ){
m_nTimer = gtk_timeout_add( millisec, timer, this ); m_nTimer = g_timeout_add( millisec, timer, this );
} }
void GLWindow::KillTimer(){ void GLWindow::KillTimer(){
gtk_timeout_remove( m_nTimer ); g_source_remove( m_nTimer );
m_nTimer = 0; m_nTimer = 0;
} }

View file

@ -541,10 +541,10 @@ void ResetEntity(){
// refresh the dialog // refresh the dialog
SetKeyValuePairs(); SetKeyValuePairs();
for ( i = EntCheck1; i <= EntCheck16; i++ ) for ( i = EntCheck1; i <= EntCheck16; i++ )
gtk_signal_handler_block_by_func( GTK_OBJECT( EntWidgets[i] ), GTK_SIGNAL_FUNC( entity_check ), NULL ); g_signal_handlers_block_by_func( G_OBJECT( EntWidgets[i] ), (gpointer)G_CALLBACK( entity_check ), NULL );
SetSpawnFlags(); SetSpawnFlags();
for ( i = EntCheck1; i <= EntCheck16; i++ ) for ( i = EntCheck1; i <= EntCheck16; i++ )
gtk_signal_handler_unblock_by_func( GTK_OBJECT( EntWidgets[i] ), GTK_SIGNAL_FUNC( entity_check ), NULL ); g_signal_handlers_unblock_by_func( G_OBJECT( EntWidgets[i] ), (gpointer)G_CALLBACK( entity_check ), NULL );
} }
bool GetSelectAllCriteria( CString &strKey, CString &strVal ){ bool GetSelectAllCriteria( CString &strKey, CString &strVal ){
@ -552,7 +552,7 @@ bool GetSelectAllCriteria( CString &strKey, CString &strVal ){
GtkTreeIter iter; GtkTreeIter iter;
if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( GTK_TREE_VIEW( EntWidgets[EntProps] ) ), &model, &iter ) if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( GTK_TREE_VIEW( EntWidgets[EntProps] ) ), &model, &iter )
&& ( inspector_mode == W_ENTITY ) && ( inspector_mode == W_ENTITY )
&& GTK_WIDGET_VISIBLE( g_pGroupDlg->m_pWidget ) ) { && gtk_widget_get_visible( g_pGroupDlg->m_pWidget ) ) {
strKey = gtk_entry_get_text( GTK_ENTRY( EntWidgets[EntKeyField] ) ); strKey = gtk_entry_get_text( GTK_ENTRY( EntWidgets[EntKeyField] ) );
strVal = gtk_entry_get_text( GTK_ENTRY( EntWidgets[EntValueField] ) ); strVal = gtk_entry_get_text( GTK_ENTRY( EntWidgets[EntValueField] ) );
return TRUE; return TRUE;
@ -1017,7 +1017,7 @@ static gint eclasslist_button_press( GtkWidget *widget, GdkEventButton *event, g
static gint eclasslist_keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){ static gint eclasslist_keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
unsigned int code = gdk_keyval_to_upper( event->keyval ); unsigned int code = gdk_keyval_to_upper( event->keyval );
if ( event->keyval == GDK_Return ) { if ( event->keyval == GDK_KEY_Return ) {
CreateEntity(); CreateEntity();
return TRUE; return TRUE;
} }
@ -1089,7 +1089,7 @@ static void entitylist_angle( GtkWidget *widget, gpointer data ){
} }
static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){ static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
if ( event->keyval == GDK_Tab ) { if ( event->keyval == GDK_KEY_Tab ) {
if ( widget == EntWidgets[EntKeyField] ) { if ( widget == EntWidgets[EntKeyField] ) {
//gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), ""); //gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), "");
gtk_window_set_focus( GTK_WINDOW( g_pGroupDlg->m_pWidget ), EntWidgets[EntValueField] ); gtk_window_set_focus( GTK_WINDOW( g_pGroupDlg->m_pWidget ), EntWidgets[EntValueField] );
@ -1100,7 +1100,7 @@ static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointe
return TRUE; return TRUE;
} }
else if ( event->keyval == GDK_Return ) { else if ( event->keyval == GDK_KEY_Return ) {
if ( widget == EntWidgets[EntKeyField] ) { if ( widget == EntWidgets[EntKeyField] ) {
gtk_entry_set_text( GTK_ENTRY( EntWidgets[EntValueField] ), "" ); gtk_entry_set_text( GTK_ENTRY( EntWidgets[EntValueField] ), "" );
gtk_window_set_focus( GTK_WINDOW( g_pGroupDlg->m_pWidget ), EntWidgets[EntValueField] ); gtk_window_set_focus( GTK_WINDOW( g_pGroupDlg->m_pWidget ), EntWidgets[EntValueField] );
@ -1115,7 +1115,7 @@ static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointe
return FALSE; return FALSE;
} }
static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){ static void switch_page( GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer data ){
const gchar *text; const gchar *text;
text = gtk_label_get_text( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ) ); text = gtk_label_get_text( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ) );
gtk_window_set_title( GTK_WINDOW( data ), text ); gtk_window_set_title( GTK_WINDOW( data ), text );
@ -1191,7 +1191,7 @@ static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data )
} }
} }
#endif #endif
if ( g_pParentWnd->CurrentStyle() != MainFrame::eFloating && ( hide || event->keyval == GDK_Escape ) ) { if ( g_pParentWnd->CurrentStyle() != MainFrame::eFloating && ( hide || event->keyval == GDK_KEY_Escape ) ) {
// toggle off the group view (whatever part of it is currently displayed) // toggle off the group view (whatever part of it is currently displayed)
// this used to be done with a g_pParentWnd->OnViewEntity(); but it had bad consequences // this used to be done with a g_pParentWnd->OnViewEntity(); but it had bad consequences
gtk_widget_hide( widget ); gtk_widget_hide( widget );
@ -1228,9 +1228,9 @@ void GroupDlg::Create(){
load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityWnd ); load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityWnd );
gtk_window_set_title( GTK_WINDOW( dlg ), "Entities" ); gtk_window_set_title( GTK_WINDOW( dlg ), "Entities" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( OnDeleteHide ), NULL ); g_signal_connect( G_OBJECT( dlg ), "delete-event", G_CALLBACK( OnDeleteHide ), NULL );
// catch 'Esc' // catch 'Esc'
gtk_signal_connect( GTK_OBJECT( dlg ), "key-press-event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); g_signal_connect( G_OBJECT( dlg ), "key-press-event", G_CALLBACK( OnDialogKey ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
g_qeglobals_gui.d_entity = dlg; g_qeglobals_gui.d_entity = dlg;
@ -1335,7 +1335,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* check = gtk_check_button_new_with_label( "" ); GtkWidget* check = gtk_check_button_new_with_label( "" );
gtk_widget_ref( check ); gtk_widget_ref( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL ); g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( entity_check ), NULL );
EntWidgets[EntCheck1 + i] = check; EntWidgets[EntCheck1 + i] = check;
} }
@ -1411,8 +1411,8 @@ void GroupDlg::Create(){
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_events( entry, GDK_KEY_PRESS_MASK ); gtk_widget_set_events( entry, GDK_KEY_PRESS_MASK );
gtk_signal_connect( GTK_OBJECT( entry ), "key-press-event", g_signal_connect( G_OBJECT( entry ), "key-press-event",
GTK_SIGNAL_FUNC( entityentry_keypress ), this ); G_CALLBACK( entityentry_keypress ), this );
EntWidgets[EntKeyField] = entry; EntWidgets[EntKeyField] = entry;
} }
@ -1423,8 +1423,8 @@ void GroupDlg::Create(){
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_events( entry, GDK_KEY_PRESS_MASK ); gtk_widget_set_events( entry, GDK_KEY_PRESS_MASK );
gtk_signal_connect( GTK_OBJECT( entry ), "key-press-event", g_signal_connect( G_OBJECT( entry ), "key-press-event",
GTK_SIGNAL_FUNC( entityentry_keypress ), this ); G_CALLBACK( entityentry_keypress ), this );
EntWidgets[EntValueField] = entry; EntWidgets[EntValueField] = entry;
} }
@ -1460,7 +1460,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "360" ) ); GtkWidget* button = gtk_button_new_with_label( _( "360" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"360" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"360" );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1469,7 +1469,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "45" ) ); GtkWidget* button = gtk_button_new_with_label( _( "45" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"45" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"45" );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1478,7 +1478,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "90" ) ); GtkWidget* button = gtk_button_new_with_label( _( "90" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"90" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"90" );
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1488,7 +1488,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "135" ) ); GtkWidget* button = gtk_button_new_with_label( _( "135" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"135" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"135" );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1497,7 +1497,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "180" ) ); GtkWidget* button = gtk_button_new_with_label( _( "180" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"180" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"180" );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1506,7 +1506,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "225" ) ); GtkWidget* button = gtk_button_new_with_label( _( "225" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"225" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"225" );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 2, 3, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1515,7 +1515,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "270" ) ); GtkWidget* button = gtk_button_new_with_label( _( "270" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"270" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"270" );
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 2, 3, gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1524,7 +1524,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "315" ) ); GtkWidget* button = gtk_button_new_with_label( _( "315" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"315" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"315" );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 2, 3, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 2, 3,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
@ -1539,21 +1539,21 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Reset" ) ); GtkWidget* button = gtk_button_new_with_label( _( "Reset" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( ResetEntity ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( ResetEntity ), NULL );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Up" ) ); GtkWidget* button = gtk_button_new_with_label( _( "Up" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"-1" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"-1" );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Dn" ) ); GtkWidget* button = gtk_button_new_with_label( _( "Dn" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( entitylist_angle ), (void *)"-2" ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( entitylist_angle ), (void *)"-2" );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
} }
@ -1566,21 +1566,21 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Del Key/Pair" ) ); GtkWidget* button = gtk_button_new_with_label( _( "Del Key/Pair" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( DelProp ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( DelProp ), NULL );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Sound..." ) ); GtkWidget* button = gtk_button_new_with_label( _( "Sound..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( AssignSound ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( AssignSound ), NULL );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Model..." ) ); GtkWidget* button = gtk_button_new_with_label( _( "Model..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( AssignModel ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( AssignModel ), NULL );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
} }
@ -1593,7 +1593,7 @@ void GroupDlg::Create(){
{ {
GtkWidget* button = gtk_button_new_with_label( _( "Cam to angles" ) ); GtkWidget* button = gtk_button_new_with_label( _( "Cam to angles" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( cam2angles ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( cam2angles ), NULL );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
} }
} }

View file

@ -120,10 +120,10 @@ static void DoProjectAddEdit( bool edit, GtkWidget *parent ){
else{ else{
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Add Command" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Add Command" ) );
} }
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -175,15 +175,15 @@ static void DoProjectAddEdit( bool edit, GtkWidget *parent ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
if ( edit ) { if ( edit ) {
@ -474,10 +474,10 @@ void DoProjectSettings(){
project = gtk_window_new( GTK_WINDOW_TOPLEVEL ); project = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( project ), _( "Project Settings" ) ); gtk_window_set_title( GTK_WINDOW( project ), _( "Project Settings" ) );
gtk_signal_connect( GTK_OBJECT( project ), "delete-event", g_signal_connect( G_OBJECT( project ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( project ), "destroy", g_signal_connect( G_OBJECT( project ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( project ), "loop", &loop ); g_object_set_data( G_OBJECT( project ), "loop", &loop );
g_object_set_data( G_OBJECT( project ), "ret", &ret ); g_object_set_data( G_OBJECT( project ), "ret", &ret );
gtk_window_set_default_size( GTK_WINDOW( project ), 550, 400 ); gtk_window_set_default_size( GTK_WINDOW( project ), 550, 400 );
@ -498,15 +498,15 @@ void DoProjectSettings(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
vbox = gtk_vbox_new( FALSE, 5 ); vbox = gtk_vbox_new( FALSE, 5 );
@ -518,22 +518,22 @@ void DoProjectSettings(){
button = gtk_button_new_with_label( _( "Add..." ) ); button = gtk_button_new_with_label( _( "Add..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( project_add ), project ); G_CALLBACK( project_add ), project );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Change..." ) ); button = gtk_button_new_with_label( _( "Change..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( project_change ), project ); G_CALLBACK( project_change ), project );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Remove" ) ); button = gtk_button_new_with_label( _( "Remove" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( project_remove ), project ); G_CALLBACK( project_remove ), project );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
frame = gtk_frame_new( _( "Misc settings" ) ); frame = gtk_frame_new( _( "Misc settings" ) );
@ -614,8 +614,8 @@ void DoProjectSettings(){
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( GTK_COMBO( game_select )->entry ), "changed", g_signal_connect( G_OBJECT( GTK_COMBO( game_select )->entry ), "changed",
GTK_SIGNAL_FUNC( OnSelchangeComboWhatgame ), project ); G_CALLBACK( OnSelchangeComboWhatgame ), project );
g_object_set_data( G_OBJECT( project ), "game_select", game_select ); g_object_set_data( G_OBJECT( project ), "game_select", game_select );
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( game_select )->entry ), FALSE ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( game_select )->entry ), FALSE );
@ -899,10 +899,10 @@ void DoMapInfo(){
load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posMapInfoWnd ); load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posMapInfoWnd );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Map Info" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Map Info" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -970,8 +970,8 @@ void DoMapInfo(){
button = gtk_button_new_with_label( _( "Close" ) );; button = gtk_button_new_with_label( _( "Close" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
label = gtk_label_new( _( "Entity breakdown" ) ); label = gtk_label_new( _( "Entity breakdown" ) );
@ -1161,10 +1161,10 @@ void DoEntityList(){
load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityInfoWnd ); load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityInfoWnd );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Entities" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Entities" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1300,15 +1300,15 @@ void DoEntityList(){
button = gtk_button_new_with_label( _( "Select" ) ); button = gtk_button_new_with_label( _( "Select" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( entitylist_select ), dlg ); G_CALLBACK( entitylist_select ), dlg );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Close" ) );; button = gtk_button_new_with_label( _( "Close" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -1333,21 +1333,21 @@ static void rotatedlg_apply( GtkWidget *widget, gpointer data ){
float f; float f;
spin = GTK_SPIN_BUTTON( g_object_get_data( G_OBJECT( data ), "x" ) ); spin = GTK_SPIN_BUTTON( g_object_get_data( G_OBJECT( data ), "x" ) );
f = gtk_spin_button_get_value_as_float( spin ); f = gtk_spin_button_get_value( spin );
if ( f != 0.0 ) { if ( f != 0.0 ) {
Select_RotateAxis( 0,f ); Select_RotateAxis( 0,f );
} }
gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), 0.0f ); // reset to 0 on Apply gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), 0.0f ); // reset to 0 on Apply
spin = GTK_SPIN_BUTTON( g_object_get_data( G_OBJECT( data ), "y" ) ); spin = GTK_SPIN_BUTTON( g_object_get_data( G_OBJECT( data ), "y" ) );
f = gtk_spin_button_get_value_as_float( spin ); f = gtk_spin_button_get_value( spin );
if ( f != 0.0 ) { if ( f != 0.0 ) {
Select_RotateAxis( 1,f ); Select_RotateAxis( 1,f );
} }
gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), 0.0f ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), 0.0f );
spin = GTK_SPIN_BUTTON( g_object_get_data( G_OBJECT( data ), "z" ) ); spin = GTK_SPIN_BUTTON( g_object_get_data( G_OBJECT( data ), "z" ) );
f = gtk_spin_button_get_value_as_float( spin ); f = gtk_spin_button_get_value( spin );
if ( f != 0.0 ) { if ( f != 0.0 ) {
Select_RotateAxis( 2,f ); Select_RotateAxis( 2,f );
} }
@ -1367,10 +1367,10 @@ void DoRotateDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Arbitrary rotation" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Arbitrary rotation" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1385,19 +1385,19 @@ void DoRotateDlg(){
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
label = gtk_label_new( _( " X " ) ); label = gtk_label_new( _( "X" ) );
gtk_widget_show( label ); gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1, gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
(GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
label = gtk_label_new( _( " Y " ) ); label = gtk_label_new( _( "Y" ) );
gtk_widget_show( label ); gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
label = gtk_label_new( _( " Z " ) ); label = gtk_label_new( _( "Z" ) );
gtk_widget_show( label ); gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3, gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
@ -1448,21 +1448,21 @@ void DoRotateDlg(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
button = gtk_button_new_with_label( _( "Apply" ) ); button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( rotatedlg_apply ), dlg ); G_CALLBACK( rotatedlg_apply ), dlg );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
gtk_widget_show( dlg ); gtk_widget_show( dlg );
@ -1487,10 +1487,10 @@ void DoGamma(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Gamma" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Gamma" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1522,15 +1522,15 @@ void DoGamma(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
// Initialize dialog // Initialize dialog
char buf[16]; char buf[16];
@ -1698,10 +1698,10 @@ void DoFind(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Find Brush" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Find Brush" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1747,15 +1747,15 @@ void DoFind(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
// Initialize dialog // Initialize dialog
char buf[16]; char buf[16];
@ -1792,10 +1792,10 @@ void DoSides( bool bCone, bool bSphere, bool bTorus ){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Arbitrary sides" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Arbitrary sides" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1819,15 +1819,15 @@ void DoSides( bool bCone, bool bSphere, bool bTorus ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
gtk_widget_show( dlg ); gtk_widget_show( dlg );
@ -1864,10 +1864,10 @@ void DoNewPatchDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch density" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch density" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1927,15 +1927,15 @@ void DoNewPatchDlg(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
// Initialize dialog // Initialize dialog
g_list_free( combo_list ); g_list_free( combo_list );
@ -1973,9 +1973,9 @@ static void scaledlg_apply( GtkWidget *widget, gpointer data ){
y = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "y" ) ); y = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "y" ) );
z = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "z" ) ); z = GTK_WIDGET( g_object_get_data( G_OBJECT( data ), "z" ) );
sx = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( x ) ); sx = gtk_spin_button_get_value( GTK_SPIN_BUTTON( x ) );
sy = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( y ) ); sy = gtk_spin_button_get_value( GTK_SPIN_BUTTON( y ) );
sz = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( z ) ); sz = gtk_spin_button_get_value( GTK_SPIN_BUTTON( z ) );
gtk_spin_button_set_value( GTK_SPIN_BUTTON( x ), 1.0f ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( x ), 1.0f );
gtk_spin_button_set_value( GTK_SPIN_BUTTON( y ), 1.0f ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( y ), 1.0f );
@ -1986,7 +1986,7 @@ static void scaledlg_apply( GtkWidget *widget, gpointer data ){
Sys_UpdateWindows( W_ALL ); Sys_UpdateWindows( W_ALL );
} }
else{ else{
Sys_Printf( _( "Warning.. Tried to scale by a zero value.\n" ) ); Sys_FPrintf( SYS_WRN, _( "Warning.. Tried to scale by a zero value." ) );
} }
} }
@ -2003,10 +2003,10 @@ void DoScaleDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Scale" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Scale" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -2085,21 +2085,21 @@ void DoScaleDlg(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
button = gtk_button_new_with_label( _( "Apply" ) ); button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( scaledlg_apply ), dlg ); G_CALLBACK( scaledlg_apply ), dlg );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
gtk_widget_show( dlg ); gtk_widget_show( dlg );
@ -2126,10 +2126,10 @@ void DoThickenDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Thicken Patch" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Thicken Patch" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -2155,15 +2155,15 @@ void DoThickenDlg(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );; button = gtk_button_new_with_label( _( "Cancel" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox ); gtk_widget_show( hbox );
@ -2244,10 +2244,10 @@ void DoAbout(){
gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT ); gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "About GtkRadiant" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "About GtkRadiant" ) );
gtk_window_set_resizable( GTK_WINDOW( dlg ), FALSE ); gtk_window_set_resizable( GTK_WINDOW( dlg ), FALSE );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -2373,21 +2373,21 @@ void DoAbout(){
GtkWidget *ok_button = gtk_button_new_with_label( _( "OK" ) ); GtkWidget *ok_button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( ok_button ); gtk_widget_show( ok_button );
gtk_box_pack_end( GTK_BOX( button_hbox ), ok_button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( button_hbox ), ok_button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( ok_button ), "clicked", g_signal_connect( G_OBJECT( ok_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
/* /*
button = gtk_button_new_with_label( _( "Credits" ) ); button = gtk_button_new_with_label( _( "Credits" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( about_button_credits ), NULL ); G_CALLBACK( about_button_credits ), NULL );
button = gtk_button_new_with_label( _( "Changelog" ) ); button = gtk_button_new_with_label( _( "Changelog" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( about_button_changelog ), NULL ); G_CALLBACK( about_button_changelog ), NULL );
*/ */
// show it // show it
@ -2412,10 +2412,10 @@ void DoCommandListDlg(){
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT ); gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Shortcut List" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Shortcut List" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 400, 400 ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 400, 400 );
@ -2528,8 +2528,8 @@ void DoCommandListDlg(){
button = gtk_button_new_with_label( _( "Close" ) );; button = gtk_button_new_with_label( _( "Close" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -2551,10 +2551,10 @@ void DoTextureListDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Textures" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Textures" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 400, 400 ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 400, 400 );
@ -2615,15 +2615,15 @@ void DoTextureListDlg(){
button = gtk_button_new_with_label( _( "Load" ) );; button = gtk_button_new_with_label( _( "Load" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Close" ) );; button = gtk_button_new_with_label( _( "Close" ) );;
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -2661,10 +2661,10 @@ int DoCapDlg( int *type, bool *b_GroupResult ){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Cap" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Cap" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -2713,28 +2713,28 @@ int DoCapDlg( int *type, bool *b_GroupResult ){
gtk_table_attach( GTK_TABLE( table ), bevel, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), bevel, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( bevel ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( bevel ) );
endcap = gtk_radio_button_new_with_label( group, _( "Endcap" ) ); endcap = gtk_radio_button_new_with_label( group, _( "Endcap" ) );
gtk_widget_show( endcap ); gtk_widget_show( endcap );
gtk_table_attach( GTK_TABLE( table ), endcap, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), endcap, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( endcap ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( endcap ) );
ibevel = gtk_radio_button_new_with_label( group, _( "Inverted Bevel" ) ); ibevel = gtk_radio_button_new_with_label( group, _( "Inverted Bevel" ) );
gtk_widget_show( ibevel ); gtk_widget_show( ibevel );
gtk_table_attach( GTK_TABLE( table ), ibevel, 1, 2, 2, 3, gtk_table_attach( GTK_TABLE( table ), ibevel, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( ibevel ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( ibevel ) );
iendcap = gtk_radio_button_new_with_label( group, _( "Inverted Endcap" ) ); iendcap = gtk_radio_button_new_with_label( group, _( "Inverted Endcap" ) );
gtk_widget_show( iendcap ); gtk_widget_show( iendcap );
gtk_table_attach( GTK_TABLE( table ), iendcap, 1, 2, 3, 4, gtk_table_attach( GTK_TABLE( table ), iendcap, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
group = gtk_radio_button_group( GTK_RADIO_BUTTON( iendcap ) ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( iendcap ) );
// Gef: added radio toggle for func_grouping capped patches // Gef: added radio toggle for func_grouping capped patches
group_toggle = gtk_check_button_new_with_label( _( "Result to func_group" ) ); group_toggle = gtk_check_button_new_with_label( _( "Result to func_group" ) );
@ -2748,15 +2748,15 @@ int DoCapDlg( int *type, bool *b_GroupResult ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
// Gef: Set the state of the func_group toggle // Gef: Set the state of the func_group toggle
@ -2804,10 +2804,10 @@ void DoScriptsDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Available Scripts - Not Implemented Yet" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Available Scripts - Not Implemented Yet" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -2895,8 +2895,8 @@ void DoScriptsDlg(){
button = gtk_button_new_with_label( _( "Run" ) ); button = gtk_button_new_with_label( _( "Run" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "New..." ) ); button = gtk_button_new_with_label( _( "New..." ) );
@ -2914,8 +2914,8 @@ void DoScriptsDlg(){
button = gtk_button_new_with_label( _( "Close" ) ); button = gtk_button_new_with_label( _( "Close" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -2951,10 +2951,10 @@ int DoBSInputDlg( const char *fields[5], float values[5] ){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "BrushScript Input" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "BrushScript Input" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -2996,15 +2996,15 @@ int DoBSInputDlg( const char *fields[5], float values[5] ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -3038,10 +3038,10 @@ int DoTextureLayout( float *fx, float *fy ){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch texture layout" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch texture layout" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -3101,15 +3101,15 @@ int DoTextureLayout( float *fx, float *fy ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
// Initialize // Initialize
@ -3143,10 +3143,10 @@ char* DoNameDlg( const char* title ){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), title ); gtk_window_set_title( GTK_WINDOW( dlg ), title );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -3170,15 +3170,15 @@ char* DoNameDlg( const char* title ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -3221,10 +3221,10 @@ char* DoNewProjectDlg(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "New Project" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "New Project" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -3265,15 +3265,15 @@ char* DoNewProjectDlg(){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
@ -3405,8 +3405,8 @@ static void CreateGtkTextEditor(){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( editor_delete ), NULL ); G_CALLBACK( editor_delete ), NULL );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 600, 300 ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 600, 300 );
vbox = gtk_vbox_new( FALSE, 5 ); vbox = gtk_vbox_new( FALSE, 5 );
@ -3433,15 +3433,15 @@ static void CreateGtkTextEditor(){
button = gtk_button_new_with_label( _( "Close" ) ); button = gtk_button_new_with_label( _( "Close" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( editor_close ), dlg ); G_CALLBACK( editor_close ), dlg );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Save" ) ); button = gtk_button_new_with_label( _( "Save" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( editor_save ), dlg ); G_CALLBACK( editor_save ), dlg );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
text_editor = dlg; text_editor = dlg;
@ -3515,7 +3515,7 @@ void DoTextEditor( const char* filename, int cursorpos ){
if ( g_PrefsDlg.m_bUseWin32Editor ) { if ( g_PrefsDlg.m_bUseWin32Editor ) {
HINSTANCE result; HINSTANCE result;
Sys_Printf( "Opening file '%s'.\n", filename ); Sys_Printf( "Opening file '%s'.\n", filename );
result = ShellExecute( (HWND)GDK_WINDOW_HWND( g_pParentWnd->m_pWidget->window ), "open", filename, NULL, NULL, SW_SHOW ); result = ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( g_pParentWnd->m_pWidget ) ), "open", filename, NULL, NULL, SW_SHOW );
if( (int)result <= 32 ) { if( (int)result <= 32 ) {
const char *errstr; const char *errstr;
switch( (int)result ) { switch( (int)result ) {
@ -3619,10 +3619,10 @@ int DoLightIntensityDlg( int *intensity ){
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Light intensity" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Light intensity" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -3653,8 +3653,8 @@ int DoLightIntensityDlg( int *intensity ){
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_add_accelerator( button, "clicked", accel_group, gtk_widget_add_accelerator( button, "clicked", accel_group,
GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
@ -3662,8 +3662,8 @@ int DoLightIntensityDlg( int *intensity ){
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_add_accelerator( button, "clicked", accel_group, gtk_widget_add_accelerator( button, "clicked", accel_group,
GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );

View file

@ -64,7 +64,7 @@
// it's also very poorly done, the save calls are a bit randomly disctributed in the OnDestroy // it's also very poorly done, the save calls are a bit randomly disctributed in the OnDestroy
void save_window_pos( GtkWidget *wnd, window_position_t& pos ){ void save_window_pos( GtkWidget *wnd, window_position_t& pos ){
if ( ( wnd == NULL ) || ( wnd->window == NULL ) ) { if ( ( wnd == NULL ) || ( gtk_widget_get_window( wnd ) == NULL ) ) {
return; return;
} }
@ -83,7 +83,7 @@ void win32_get_window_pos( GtkWidget *widget, gint *x, gint *y ){
if ( g_PrefsDlg.m_bStartOnPrimMon ) { if ( g_PrefsDlg.m_bStartOnPrimMon ) {
RECT rc; RECT rc;
POINT point; POINT point;
HWND xwnd = (HWND)GDK_WINDOW_HWND( widget->window ); HWND xwnd = (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( widget ) );
const GdkRectangle primaryMonitorRect = g_pParentWnd->GetPrimaryMonitorRect(); const GdkRectangle primaryMonitorRect = g_pParentWnd->GetPrimaryMonitorRect();
GetClientRect( xwnd,&rc ); GetClientRect( xwnd,&rc );
@ -101,7 +101,7 @@ void win32_get_window_pos( GtkWidget *widget, gint *x, gint *y ){
} }
else { else {
// this is the same as the unix version of get_window_pos // this is the same as the unix version of get_window_pos
gdk_window_get_root_origin( widget->window, x, y ); gdk_window_get_root_origin( gtk_widget_get_window( widget ), x, y );
} }
#ifdef DBG_WINDOWPOS #ifdef DBG_WINDOWPOS
Sys_Printf( "win32_get_window_pos %p %d,%d\n",widget,*x,*y ); Sys_Printf( "win32_get_window_pos %p %d,%d\n",widget,*x,*y );
@ -744,13 +744,13 @@ GtkWidget* create_menu_item_with_mnemonic( GtkWidget *menu, const gchar *mnemoni
gtk_widget_show( item ); gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item ); gtk_container_add( GTK_CONTAINER( menu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( func ), GINT_TO_POINTER( id ) ); g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( func ), GINT_TO_POINTER( id ) );
AddMenuItem( item, id ); AddMenuItem( item, id );
return item; return item;
} }
GtkWidget* create_check_menu_item_with_mnemonic( GtkWidget *menu, const gchar *mnemonic, GtkSignalFunc func, int id, gboolean active ){ GtkWidget* create_check_menu_item_with_mnemonic( GtkWidget *menu, const gchar *mnemonic, GCallback func, int id, gboolean active ){
GtkWidget *item; GtkWidget *item;
item = gtk_check_menu_item_new_with_mnemonic( mnemonic ); item = gtk_check_menu_item_new_with_mnemonic( mnemonic );
@ -758,13 +758,13 @@ GtkWidget* create_check_menu_item_with_mnemonic( GtkWidget *menu, const gchar *m
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), active ); gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), active );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item ); gtk_container_add( GTK_CONTAINER( menu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( func ), GINT_TO_POINTER( id ) ); g_signal_connect( G_OBJECT( item ), "activate", func, GINT_TO_POINTER( id ) );
AddMenuItem( item, id ); AddMenuItem( item, id );
return item; return item;
} }
GtkWidget* create_radio_menu_item_with_mnemonic( GtkWidget *menu, GtkWidget *last, const gchar *mnemonic, GtkSignalFunc func, int id, gboolean state ){ GtkWidget* create_radio_menu_item_with_mnemonic( GtkWidget *menu, GtkWidget *last, const gchar *mnemonic, GCallback func, int id, gboolean state ){
GtkWidget *item; GtkWidget *item;
GSList *group = (GSList*)NULL; GSList *group = (GSList*)NULL;
@ -776,7 +776,7 @@ GtkWidget* create_radio_menu_item_with_mnemonic( GtkWidget *menu, GtkWidget *las
gtk_widget_show( item ); gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item ); gtk_container_add( GTK_CONTAINER( menu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( func ), GINT_TO_POINTER( id ) ); g_signal_connect( G_OBJECT( item ), "activate", func, GINT_TO_POINTER( id ) );
AddMenuItem( item, id ); AddMenuItem( item, id );
return item; return item;
@ -831,8 +831,8 @@ static GtkWidget * gtk_AddDlgButton( GtkWidget *container, const char *label,
const int clickSignal, qboolean setGrabDefault ) { const int clickSignal, qboolean setGrabDefault ) {
GtkWidget *btn = gtk_button_new_with_label( _( label ) ); GtkWidget *btn = gtk_button_new_with_label( _( label ) );
gtk_box_pack_start( GTK_BOX( container ), btn, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( container ), btn, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( btn ), "clicked", g_signal_connect( G_OBJECT( btn ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( clickSignal ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( clickSignal ) );
gtk_widget_set_can_default( btn, TRUE ); gtk_widget_set_can_default( btn, TRUE );
if( setGrabDefault ) if( setGrabDefault )
@ -857,13 +857,13 @@ int WINAPI gtk_MessageBoxNew( void *parent, const char *message,
// create dialog window // create dialog window
GtkWidget *dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); GtkWidget *dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( dlg ), caption ); gtk_window_set_title( GTK_WINDOW( dlg ), caption );
gtk_window_set_policy( GTK_WINDOW( dlg ), FALSE, FALSE, TRUE ); gtk_window_set_policy( GTK_WINDOW( dlg ), FALSE, FALSE, TRUE );
gtk_container_border_width( GTK_CONTAINER( dlg ), MSGBOX_PAD_MAJOR ); gtk_container_set_border_width( GTK_CONTAINER( dlg ), MSGBOX_PAD_MAJOR );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
gtk_widget_realize( dlg ); gtk_widget_realize( dlg );
@ -937,17 +937,17 @@ int WINAPI gtk_MessageBoxNew( void *parent, const char *message,
switch( flags & MB_TYPEMASK ) { switch( flags & MB_TYPEMASK ) {
case MB_OK: case MB_OK:
default: { default: {
GtkWidget *btn_ok = gtk_AddDlgButton( buttons_hbox, "Ok", IDOK, TRUE ); GtkWidget *btn_ok = gtk_AddDlgButton( buttons_hbox, _( "Ok" ), IDOK, TRUE );
gtk_widget_add_accelerator( btn_ok, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( btn_ok, "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
gtk_widget_add_accelerator( btn_ok, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( btn_ok, "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
ret = IDOK; ret = IDOK;
break; break;
} }
case MB_OKCANCEL: { case MB_OKCANCEL: {
GtkWidget *btn_ok = gtk_AddDlgButton( buttons_hbox, "Ok", IDOK, TRUE ); GtkWidget *btn_ok = gtk_AddDlgButton( buttons_hbox, _( "Ok" ), IDOK, TRUE );
gtk_widget_add_accelerator( btn_ok, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( btn_ok, "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
GtkWidget *btn_cancel = gtk_AddDlgButton( buttons_hbox, "Cancel", IDCANCEL, FALSE ); GtkWidget *btn_cancel = gtk_AddDlgButton( buttons_hbox, _( "Cancel" ), IDCANCEL, FALSE );
gtk_widget_add_accelerator( btn_cancel, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( btn_cancel, "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
ret = IDCANCEL; ret = IDCANCEL;
break; break;
} }
@ -957,16 +957,16 @@ int WINAPI gtk_MessageBoxNew( void *parent, const char *message,
} }
case MB_YESNOCANCEL: { case MB_YESNOCANCEL: {
//! @todo accelerators? //! @todo accelerators?
gtk_AddDlgButton( buttons_hbox, "Yes", IDYES, TRUE ); gtk_AddDlgButton( buttons_hbox, _( "Yes" ), IDYES, TRUE );
gtk_AddDlgButton( buttons_hbox, "No", IDNO, FALSE ); gtk_AddDlgButton( buttons_hbox, _( "No" ), IDNO, FALSE );
gtk_AddDlgButton( buttons_hbox, "Cancel", IDCANCEL, FALSE ); gtk_AddDlgButton( buttons_hbox, _( "Cancel" ), IDCANCEL, FALSE );
ret = IDCANCEL; ret = IDCANCEL;
break; break;
} }
case MB_YESNO: { case MB_YESNO: {
//! @todo accelerators? //! @todo accelerators?
gtk_AddDlgButton( buttons_hbox, "Yes", IDYES, TRUE ); gtk_AddDlgButton( buttons_hbox, _( "Yes" ), IDYES, TRUE );
gtk_AddDlgButton( buttons_hbox, "No", IDNO, FALSE ); gtk_AddDlgButton( buttons_hbox, _( "No" ), IDNO, FALSE );
ret = IDNO; ret = IDNO;
break; break;
} }
@ -986,10 +986,10 @@ int WINAPI gtk_MessageBoxNew( void *parent, const char *message,
if( URL ) { if( URL ) {
GtkWidget *btn_url = gtk_button_new_with_label( _( "Go to URL" ) ); GtkWidget *btn_url = gtk_button_new_with_label( _( "Go to URL" ) );
gtk_box_pack_start( GTK_BOX( buttons_hbox ), btn_url, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( buttons_hbox ), btn_url, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( btn_url ), "clicked", g_signal_connect( G_OBJECT( btn_url ), "clicked",
GTK_SIGNAL_FUNC( dialog_url_callback ), NULL ); G_CALLBACK( dialog_url_callback ), NULL );
g_object_set_data( G_OBJECT( btn_url ), "URL", (void *)URL ); g_object_set_data( G_OBJECT( btn_url ), "URL", (void *)URL );
GTK_WIDGET_SET_FLAGS( btn_url, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( btn_url, TRUE );
gtk_widget_grab_default( btn_url ); gtk_widget_grab_default( btn_url );
gtk_widget_show( btn_url ); gtk_widget_show( btn_url );
} }
@ -1014,12 +1014,12 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect( GTK_OBJECT( window ), "delete-event", g_signal_connect( G_OBJECT( window ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", g_signal_connect( G_OBJECT( window ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( GTK_WINDOW( window ), lpCaption ); gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop ); g_object_set_data( G_OBJECT( window ), "loop", &loop );
g_object_set_data( G_OBJECT( window ), "ret", &ret ); g_object_set_data( G_OBJECT( window ), "ret", &ret );
gtk_widget_realize( window ); gtk_widget_realize( window );
@ -1053,11 +1053,11 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti
if ( mode == MB_OK ) { if ( mode == MB_OK ) {
w = gtk_button_new_with_label( _( "Ok" ) ); w = gtk_button_new_with_label( _( "Ok" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_add_accelerator( w, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( w, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
gtk_widget_add_accelerator( w, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( w, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDOK; ret = IDOK;
@ -1065,17 +1065,17 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti
else if ( mode == MB_OKCANCEL ) { else if ( mode == MB_OKCANCEL ) {
w = gtk_button_new_with_label( _( "Ok" ) ); w = gtk_button_new_with_label( _( "Ok" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_add_accelerator( w, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( w, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Cancel" ) ); w = gtk_button_new_with_label( _( "Cancel" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_add_accelerator( w, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( w, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
@ -1083,22 +1083,22 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti
else if ( mode == MB_YESNOCANCEL ) { else if ( mode == MB_YESNOCANCEL ) {
w = gtk_button_new_with_label( _( "Yes" ) ); w = gtk_button_new_with_label( _( "Yes" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "No" ) ); w = gtk_button_new_with_label( _( "No" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "Cancel" ) ); w = gtk_button_new_with_label( _( "Cancel" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDCANCEL; ret = IDCANCEL;
} }
@ -1106,16 +1106,16 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti
{ {
w = gtk_button_new_with_label( _( "Yes" ) ); w = gtk_button_new_with_label( _( "Yes" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
w = gtk_button_new_with_label( _( "No" ) ); w = gtk_button_new_with_label( _( "No" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w ); gtk_widget_show( w );
ret = IDNO; ret = IDNO;
} }
@ -1123,10 +1123,10 @@ int WINAPI gtk_MessageBox( void *parent, const char* lpText, const char* lpCapti
if ( URL ) { if ( URL ) {
w = gtk_button_new_with_label( _( "Go to URL" ) ); w = gtk_button_new_with_label( _( "Go to URL" ) );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", g_signal_connect( G_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_url_callback ), NULL ); G_CALLBACK( dialog_url_callback ), NULL );
g_object_set_data( G_OBJECT( w ), "URL", (void *)URL ); g_object_set_data( G_OBJECT( w ), "URL", (void *)URL );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_set_can_default( w, TRUE );
gtk_widget_grab_default( w ); gtk_widget_grab_default( w );
gtk_widget_show( w ); gtk_widget_show( w );
} }
@ -1372,7 +1372,7 @@ const char* file_dialog( void *parent, gboolean open, const char* title, const c
// See http://msdn.microsoft.com/en-us/library/ms646839%28v=vs.85%29.aspx . // See http://msdn.microsoft.com/en-us/library/ms646839%28v=vs.85%29.aspx .
memset( &ofn, 0, sizeof( ofn ) ); memset( &ofn, 0, sizeof( ofn ) );
ofn.lStructSize = sizeof( ofn ); ofn.lStructSize = sizeof( ofn );
ofn.hwndOwner = (HWND)GDK_WINDOW_HWND( g_pParentWnd->m_pWidget->window ); ofn.hwndOwner = (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( g_pParentWnd->m_pWidget ) );
ofn.nFilterIndex = 1; // The index is 1-based, not 0-based. This basically says, ofn.nFilterIndex = 1; // The index is 1-based, not 0-based. This basically says,
// "select the first filter as default". // "select the first filter as default".
if ( pattern ) { if ( pattern ) {
@ -1636,14 +1636,14 @@ bool WINAPI color_dialog( void *parent, float *color, const char* title ){
dlg = gtk_color_selection_dialog_new( title ); dlg = gtk_color_selection_dialog_new( title );
gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr ); gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", g_signal_connect( G_OBJECT( dlg ), "delete-event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); G_CALLBACK( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", g_signal_connect( G_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked", g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked", g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); 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 ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@ -1684,7 +1684,7 @@ void OpenURL( const char *url ){
Sys_Printf( "OpenURL: %s\n", url ); Sys_Printf( "OpenURL: %s\n", url );
#ifdef _WIN32 #ifdef _WIN32
ShellExecute( (HWND)GDK_WINDOW_HWND( g_pParentWnd->m_pWidget->window ), "open", url, NULL, NULL, SW_SHOW ); ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( g_pParentWnd->m_pWidget ) ), "open", url, NULL, NULL, SW_SHOW );
#else #else
# ifdef __APPLE__ # ifdef __APPLE__
snprintf(command, sizeof(command), "open '%s' &", url); snprintf(command, sizeof(command), "open '%s' &", url);
@ -1712,7 +1712,7 @@ void CheckMenuSplitting( GtkWidget *&menu ){
// move the last 2 items to a submenu (3 because of win32) // move the last 2 items to a submenu (3 because of win32)
for ( int i = 0; i < 3; i++ ) for ( int i = 0; i < 3; i++ )
{ {
item = GTK_WIDGET( g_list_last( gtk_container_children( GTK_CONTAINER( menu ) ) )->data ); item = GTK_WIDGET( g_list_last( gtk_container_get_children( GTK_CONTAINER( menu ) ) )->data );
gtk_widget_ref( item ); gtk_widget_ref( item );
gtk_container_remove( GTK_CONTAINER( menu ), item ); gtk_container_remove( GTK_CONTAINER( menu ), item );
gtk_menu_append( GTK_MENU( menu2 ), item ); gtk_menu_append( GTK_MENU( menu2 ), item );

View file

@ -896,9 +896,9 @@ int mainRadiant( int argc, char* argv[] ) {
Texture_ShowStartupShaders(); Texture_ShowStartupShaders();
#ifndef SKIP_SPLASH #ifndef SKIP_SPLASH
gdk_window_raise( splash_screen->window ); gdk_window_raise( gtk_widget_get_window( splash_screen ) );
gtk_window_set_transient_for( GTK_WINDOW( splash_screen ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_transient_for( GTK_WINDOW( splash_screen ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
gtk_timeout_add( 1000, try_destroy_splash, NULL ); g_timeout_add( 1000, try_destroy_splash, NULL );
#endif #endif
g_pParentWnd->GetSynapseServer().DumpActiveClients(); g_pParentWnd->GetSynapseServer().DumpActiveClients();

File diff suppressed because it is too large Load diff

View file

@ -117,14 +117,14 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
td.flags = 0; td.flags = 0;
td.value = 0; td.value = 0;
if ( adj->value == 0 ) { if ( gtk_adjustment_get_value( adj ) == 0 ) {
return; return;
} }
if ( adj == g_object_get_data( G_OBJECT( g_PatchDialog.GetWidget() ), "hshift_adj" ) ) { if ( adj == g_object_get_data( G_OBJECT( g_PatchDialog.GetWidget() ), "hshift_adj" ) ) {
l_pPIIncrement->shift[0] = atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ); l_pPIIncrement->shift[0] = atof( gtk_entry_get_text( GTK_ENTRY( data ) ) );
if ( adj->value > 0 ) { if ( gtk_adjustment_get_value( adj ) > 0 ) {
td.shift[0] = l_pPIIncrement->shift[0]; td.shift[0] = l_pPIIncrement->shift[0];
} }
else{ else{
@ -134,7 +134,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
else if ( adj == g_object_get_data( G_OBJECT( g_PatchDialog.GetWidget() ), "vshift_adj" ) ) { else if ( adj == g_object_get_data( G_OBJECT( g_PatchDialog.GetWidget() ), "vshift_adj" ) ) {
l_pPIIncrement->shift[1] = atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ); l_pPIIncrement->shift[1] = atof( gtk_entry_get_text( GTK_ENTRY( data ) ) );
if ( adj->value > 0 ) { if ( gtk_adjustment_get_value( adj ) > 0 ) {
td.shift[1] = l_pPIIncrement->shift[1]; td.shift[1] = l_pPIIncrement->shift[1];
} }
else{ else{
@ -147,7 +147,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
return; return;
} }
// make sure scale factor is always >1 for increases and <1 for decreases // make sure scale factor is always >1 for increases and <1 for decreases
if ( adj->value > 0 ) { if ( gtk_adjustment_get_value( adj ) > 0 ) {
if ( l_pPIIncrement->scale[0] < 1 ) { if ( l_pPIIncrement->scale[0] < 1 ) {
td.scale[0] = l_pPIIncrement->scale[0]; td.scale[0] = l_pPIIncrement->scale[0];
} }
@ -171,7 +171,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
return; return;
} }
// make sure scale factor is always >1 for increases and <1 for decreases // make sure scale factor is always >1 for increases and <1 for decreases
if ( adj->value > 0 ) { if ( gtk_adjustment_get_value( adj ) > 0 ) {
if ( l_pPIIncrement->scale[1] < 1 ) { if ( l_pPIIncrement->scale[1] < 1 ) {
td.scale[1] = l_pPIIncrement->scale[1]; td.scale[1] = l_pPIIncrement->scale[1];
} }
@ -192,7 +192,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
else if ( adj == g_object_get_data( G_OBJECT( g_PatchDialog.GetWidget() ), "rotate_adj" ) ) { else if ( adj == g_object_get_data( G_OBJECT( g_PatchDialog.GetWidget() ), "rotate_adj" ) ) {
l_pPIIncrement->rotate = atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ); l_pPIIncrement->rotate = atof( gtk_entry_get_text( GTK_ENTRY( data ) ) );
if ( adj->value > 0 ) { if ( gtk_adjustment_get_value( adj ) > 0 ) {
td.rotate = l_pPIIncrement->rotate; td.rotate = l_pPIIncrement->rotate;
} }
else{ else{
@ -200,7 +200,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
} }
} }
adj->value = 0; gtk_adjustment_set_value( adj, 0 );
// will scale shift rotate the patch accordingly // will scale shift rotate the patch accordingly
Patch_SetTextureInfo( &td ); Patch_SetTextureInfo( &td );
@ -210,11 +210,11 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
} }
static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ){ static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ){
if ( event->keyval == GDK_Return ) { if ( event->keyval == GDK_KEY_Return ) {
OnApply( NULL, NULL ); OnApply( NULL, NULL );
return TRUE; return TRUE;
} }
else if ( event->keyval == GDK_Escape ) { else if ( event->keyval == GDK_KEY_Escape ) {
OnDone( NULL, NULL ); OnDone( NULL, NULL );
return TRUE; return TRUE;
} }
@ -298,9 +298,9 @@ void PatchDialog::BuildDialog(){
load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posPatchWnd ); load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posPatchWnd );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch Properties" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Patch Properties" ) );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete-event", GTK_SIGNAL_FUNC( OnDone ), NULL ); g_signal_connect( G_OBJECT( dlg ), "delete-event", G_CALLBACK( OnDone ), NULL );
// catch 'Esc' and 'Enter' // catch 'Esc' and 'Enter'
gtk_signal_connect( GTK_OBJECT( dlg ), "key-press-event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); g_signal_connect( G_OBJECT( dlg ), "key-press-event", G_CALLBACK( OnDialogKey ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
@ -347,8 +347,8 @@ void PatchDialog::BuildDialog(){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_usize( combo, 60, -1 ); gtk_widget_set_usize( combo, 60, -1 );
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE );
gtk_signal_connect( GTK_OBJECT( GTK_COMBO( combo )->entry ), "changed", g_signal_connect( G_OBJECT( GTK_COMBO( combo )->entry ), "changed",
GTK_SIGNAL_FUNC( OnSelchangeComboColRow ), this ); G_CALLBACK( OnSelchangeComboColRow ), this );
AddDialogData( combo, &m_nRow, DLG_COMBO_INT ); AddDialogData( combo, &m_nRow, DLG_COMBO_INT );
m_pRowCombo = combo; m_pRowCombo = combo;
@ -359,8 +359,8 @@ void PatchDialog::BuildDialog(){
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_usize( combo, 60, -1 ); gtk_widget_set_usize( combo, 60, -1 );
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE );
gtk_signal_connect( GTK_OBJECT( GTK_COMBO( combo )->entry ), "changed", g_signal_connect( G_OBJECT( GTK_COMBO( combo )->entry ), "changed",
GTK_SIGNAL_FUNC( OnSelchangeComboColRow ), this ); G_CALLBACK( OnSelchangeComboColRow ), this );
AddDialogData( combo, &m_nCol, DLG_COMBO_INT ); AddDialogData( combo, &m_nCol, DLG_COMBO_INT );
m_pColCombo = combo; m_pColCombo = combo;
@ -510,7 +510,7 @@ void PatchDialog::BuildDialog(){
gtk_entry_set_text( GTK_ENTRY( entry ), buf ); gtk_entry_set_text( GTK_ENTRY( entry ), buf );
adj = gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ); adj = gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( m_pWidget ), "hshift_adj", adj ); g_object_set_data( G_OBJECT( m_pWidget ), "hshift_adj", adj );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
@ -530,7 +530,7 @@ void PatchDialog::BuildDialog(){
gtk_entry_set_text( GTK_ENTRY( entry ), buf ); gtk_entry_set_text( GTK_ENTRY( entry ), buf );
adj = gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ); adj = gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( m_pWidget ), "vshift_adj", adj ); g_object_set_data( G_OBJECT( m_pWidget ), "vshift_adj", adj );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
@ -550,7 +550,7 @@ void PatchDialog::BuildDialog(){
gtk_entry_set_text( GTK_ENTRY( entry ), buf ); gtk_entry_set_text( GTK_ENTRY( entry ), buf );
adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( m_pWidget ), "hscale_adj", adj ); g_object_set_data( G_OBJECT( m_pWidget ), "hscale_adj", adj );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
@ -570,7 +570,7 @@ void PatchDialog::BuildDialog(){
gtk_entry_set_text( GTK_ENTRY( entry ), buf ); gtk_entry_set_text( GTK_ENTRY( entry ), buf );
adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 );
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( m_pWidget ), "vscale_adj", adj ); g_object_set_data( G_OBJECT( m_pWidget ), "vscale_adj", adj );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
@ -590,7 +590,7 @@ void PatchDialog::BuildDialog(){
gtk_entry_set_text( GTK_ENTRY( entry ), buf ); gtk_entry_set_text( GTK_ENTRY( entry ), buf );
adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps adj = gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
gtk_signal_connect( adj, "value-changed", GTK_SIGNAL_FUNC( OnSpinChanged ), entry ); g_signal_connect( adj, "value-changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( m_pWidget ), "rotate_adj", adj ); g_object_set_data( G_OBJECT( m_pWidget ), "rotate_adj", adj );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
@ -607,25 +607,25 @@ void PatchDialog::BuildDialog(){
button = gtk_button_new_with_label( _( "CAP" ) ); button = gtk_button_new_with_label( _( "CAP" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnPatchdetails ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), NULL );
gtk_widget_set_usize( button, 60, -1 ); gtk_widget_set_usize( button, 60, -1 );
button = gtk_button_new_with_label( _( "Set..." ) ); button = gtk_button_new_with_label( _( "Set..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnPatchreset ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), NULL );
gtk_widget_set_usize( button, 60, -1 ); gtk_widget_set_usize( button, 60, -1 );
button = gtk_button_new_with_label( _( "Natural" ) ); button = gtk_button_new_with_label( _( "Natural" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnPatchnatural ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), NULL );
gtk_widget_set_usize( button, 60, -1 ); gtk_widget_set_usize( button, 60, -1 );
button = gtk_button_new_with_label( _( "Fit" ) ); button = gtk_button_new_with_label( _( "Fit" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnPatchfit ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), NULL );
gtk_widget_set_usize( button, 60, -1 ); gtk_widget_set_usize( button, 60, -1 );
hbox = gtk_hbox_new( FALSE, 5 ); hbox = gtk_hbox_new( FALSE, 5 );
@ -635,13 +635,13 @@ void PatchDialog::BuildDialog(){
button = gtk_button_new_with_label( _( "Done" ) ); button = gtk_button_new_with_label( _( "Done" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnDone ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnDone ), NULL );
gtk_widget_set_usize( button, 60, -1 ); gtk_widget_set_usize( button, 60, -1 );
button = gtk_button_new_with_label( _( "Apply" ) ); button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnApply ), NULL ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnApply ), NULL );
gtk_widget_set_usize( button, 60, -1 ); gtk_widget_set_usize( button, 60, -1 );
} }

View file

@ -1043,7 +1043,7 @@ GtkWidget* CGameDialog::GetGlobalFrame(){
return mFrame; return mFrame;
} }
mFrame = gtk_frame_new( "Select a game" ); mFrame = gtk_frame_new( _( "Select a game" ) );
gtk_container_set_border_width( GTK_CONTAINER( mFrame ), 5 ); gtk_container_set_border_width( GTK_CONTAINER( mFrame ), 5 );
gtk_widget_show( mFrame ); gtk_widget_show( mFrame );
@ -1152,8 +1152,8 @@ void CGameDialog::BuildDialog() {
setup_button = gtk_button_new_with_label( _( "Configure editor for another game" ) ); setup_button = gtk_button_new_with_label( _( "Configure editor for another game" ) );
gtk_widget_show( setup_button ); gtk_widget_show( setup_button );
gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( setup_button ), "clicked", g_signal_connect( G_OBJECT( setup_button ), "clicked",
GTK_SIGNAL_FUNC( SInstallCallback ), this ); G_CALLBACK( SInstallCallback ), this );
button = gtk_button_new_with_label( _( "Exit" ) ); button = gtk_button_new_with_label( _( "Exit" ) );
gtk_widget_show( button ); gtk_widget_show( button );
@ -1590,7 +1590,7 @@ void PrefsDlg::BuildDialog(){
button = gtk_button_new_with_label( _( "Clean" ) ); button = gtk_button_new_with_label( _( "Clean" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnButtonClean ), this ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnButtonClean ), this );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
@ -2224,7 +2224,7 @@ void PrefsDlg::BuildDialog(){
gtk_widget_show( check ); gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
g_object_set_data( G_OBJECT( dialog ), "check_startonprimary", check ); g_object_set_data( G_OBJECT( dialog ), "check_startonprimary", check );
gtk_signal_connect( GTK_OBJECT( check ), "clicked", GTK_SIGNAL_FUNC( UpdateSensitivity ), this ); g_signal_connect( G_OBJECT( check ), "clicked", G_CALLBACK( UpdateSensitivity ), this );
AddDialogData( check, &m_bStartOnPrimMon, DLG_CHECK_BOOL ); AddDialogData( check, &m_bStartOnPrimMon, DLG_CHECK_BOOL );
#endif #endif
@ -2514,7 +2514,7 @@ void PrefsDlg::BuildDialog(){
// browse button // browse button
button = gtk_button_new_with_label( "..." ); button = gtk_button_new_with_label( "..." );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseprefab ), this ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnBrowseprefab ), this );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
(GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
@ -2540,7 +2540,7 @@ void PrefsDlg::BuildDialog(){
// user ini browse button // user ini browse button
button = gtk_button_new_with_label( _( "..." ) ); button = gtk_button_new_with_label( _( "..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseuserini ), this ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnBrowseuserini ), this );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
(GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
@ -2653,7 +2653,7 @@ void PrefsDlg::BuildDialog(){
check = gtk_check_button_new_with_label( _( "Use Custom Shader Editor" ) ); check = gtk_check_button_new_with_label( _( "Use Custom Shader Editor" ) );
gtk_widget_show( check ); gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( check ), "clicked", GTK_SIGNAL_FUNC( UpdateEditorSensitivity ), this ); g_signal_connect( G_OBJECT( check ), "clicked", G_CALLBACK( UpdateEditorSensitivity ), this );
g_object_set_data( G_OBJECT( dialog ), "check_customeditor", check ); g_object_set_data( G_OBJECT( dialog ), "check_customeditor", check );
AddDialogData( check, &g_PrefsDlg.m_bUseCustomEditor, DLG_CHECK_BOOL ); AddDialogData( check, &g_PrefsDlg.m_bUseCustomEditor, DLG_CHECK_BOOL );
@ -2689,7 +2689,7 @@ void PrefsDlg::BuildDialog(){
// browse button // browse button
button = gtk_button_new_with_label( _( "..." ) ); button = gtk_button_new_with_label( _( "..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseEditor ), this ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnBrowseEditor ), this );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
(GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
@ -2717,7 +2717,7 @@ void PrefsDlg::BuildDialog(){
gtk_widget_show( check ); gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
g_object_set_data( G_OBJECT( dialog ), "check_monitorbsp", check ); g_object_set_data( G_OBJECT( dialog ), "check_monitorbsp", check );
gtk_signal_connect( GTK_OBJECT( check ), "clicked", GTK_SIGNAL_FUNC( UpdateSensitivity ), this ); g_signal_connect( G_OBJECT( check ), "clicked", G_CALLBACK( UpdateSensitivity ), this );
AddDialogData( check, &g_PrefsDlg.m_bWatchBSP, DLG_CHECK_BOOL ); AddDialogData( check, &g_PrefsDlg.m_bWatchBSP, DLG_CHECK_BOOL );
// Stop on leak // Stop on leak
@ -2732,7 +2732,7 @@ void PrefsDlg::BuildDialog(){
gtk_widget_show( check ); gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
g_object_set_data( G_OBJECT( dialog ), "check_runengine", check ); g_object_set_data( G_OBJECT( dialog ), "check_runengine", check );
gtk_signal_connect( GTK_OBJECT( check ), "clicked", GTK_SIGNAL_FUNC( UpdateSensitivity ), this ); g_signal_connect( G_OBJECT( check ), "clicked", G_CALLBACK( UpdateSensitivity ), this );
AddDialogData( check, &g_PrefsDlg.m_bRunQuake, DLG_CHECK_BOOL ); AddDialogData( check, &g_PrefsDlg.m_bRunQuake, DLG_CHECK_BOOL );
// sleep mode when running engine // sleep mode when running engine
@ -2756,7 +2756,7 @@ void PrefsDlg::BuildDialog(){
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
g_object_set_data( G_OBJECT( dialog ), "check_x64_q3map2", check ); g_object_set_data( G_OBJECT( dialog ), "check_x64_q3map2", check );
AddDialogData( check, &g_PrefsDlg.m_bx64q3map2, DLG_CHECK_BOOL ); AddDialogData( check, &g_PrefsDlg.m_bx64q3map2, DLG_CHECK_BOOL );
g_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( OnX64Toggle ), this ); g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( OnX64Toggle ), this );
#endif #endif
// Add the page to the notebook // Add the page to the notebook
@ -3443,7 +3443,7 @@ void CGameInstall::BuildDialog() {
iGame++; iGame++;
} }
AddDialogData( game_select_combo, &m_nComboSelect, DLG_COMBO_BOX_INT ); AddDialogData( game_select_combo, &m_nComboSelect, DLG_COMBO_BOX_INT );
gtk_signal_connect( GTK_OBJECT( game_select_combo ), "changed", G_CALLBACK( OnGameSelectChanged ), this ); g_signal_connect( G_OBJECT( game_select_combo ), "changed", G_CALLBACK( OnGameSelectChanged ), this );
text = gtk_label_new( _( "Name:" ) ); text = gtk_label_new( _( "Name:" ) );
gtk_widget_show( text ); gtk_widget_show( text );
@ -3469,7 +3469,7 @@ void CGameInstall::BuildDialog() {
button = gtk_button_new_with_label( _( "..." ) ); button = gtk_button_new_with_label( _( "..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseEngine ), this ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnBrowseEngine ), this );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
m_executablesVBox = gtk_vbox_new( TRUE, 0 ); m_executablesVBox = gtk_vbox_new( TRUE, 0 );
@ -3491,7 +3491,7 @@ void CGameInstall::BuildDialog() {
button = gtk_button_new_with_label( _( "..." ) ); button = gtk_button_new_with_label( _( "..." ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseExecutables ), this ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnBrowseExecutables ), this );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
button = gtk_button_new_with_label( _( "OK" ) ); button = gtk_button_new_with_label( _( "OK" ) );

View file

@ -1281,14 +1281,14 @@ bool g_bWaitCursor = false;
void WINAPI Sys_BeginWait( void ){ void WINAPI Sys_BeginWait( void ){
GdkCursor *cursor = gdk_cursor_new( GDK_WATCH ); GdkCursor *cursor = gdk_cursor_new( GDK_WATCH );
gdk_window_set_cursor( g_pParentWnd->m_pWidget->window, cursor ); gdk_window_set_cursor( gtk_widget_get_window( g_pParentWnd->m_pWidget ), cursor );
gdk_cursor_unref( cursor ); gdk_cursor_unref( cursor );
g_bWaitCursor = true; g_bWaitCursor = true;
} }
void WINAPI Sys_EndWait( void ){ void WINAPI Sys_EndWait( void ){
GdkCursor *cursor = gdk_cursor_new( GDK_LEFT_PTR ); GdkCursor *cursor = gdk_cursor_new( GDK_LEFT_PTR );
gdk_window_set_cursor( g_pParentWnd->m_pWidget->window, cursor ); gdk_window_set_cursor( gtk_widget_get_window( g_pParentWnd->m_pWidget ), cursor );
gdk_cursor_unref( cursor ); gdk_cursor_unref( cursor );
g_bWaitCursor = false; g_bWaitCursor = false;
} }
@ -1578,8 +1578,8 @@ void FillBSPMenu(){
item = gtk_menu_item_new_with_label( token ); item = gtk_menu_item_new_with_label( token );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item ); gtk_container_add( GTK_CONTAINER( menu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( CMD_BSPCOMMAND + i ) ); G_CALLBACK( HandleCommand ), GINT_TO_POINTER( CMD_BSPCOMMAND + i ) );
token = strtok( NULL, ",;" ); token = strtok( NULL, ",;" );
i++; i++;
} }
@ -1594,8 +1594,8 @@ void FillBSPMenu(){
item = gtk_menu_item_new_with_label( ep->key + 4 ); item = gtk_menu_item_new_with_label( ep->key + 4 );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item ); gtk_container_add( GTK_CONTAINER( menu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", g_signal_connect( G_OBJECT( item ), "activate",
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( CMD_BSPCOMMAND + i ) ); G_CALLBACK( HandleCommand ), GINT_TO_POINTER( CMD_BSPCOMMAND + i ) );
i++; i++;
} }
} }
@ -1763,7 +1763,7 @@ extern "C" void Sys_FPrintf_VA( int level, const char *text, va_list args ) {
gtk_text_view_scroll_mark_onscreen( GTK_TEXT_VIEW( g_qeglobals_gui.d_edit ), end ); gtk_text_view_scroll_mark_onscreen( GTK_TEXT_VIEW( g_qeglobals_gui.d_edit ), end );
// update console widget immediately if we're doing something time-consuming // update console widget immediately if we're doing something time-consuming
if ( !g_bScreenUpdates && GTK_WIDGET_REALIZED( g_qeglobals_gui.d_edit ) ) { if ( !g_bScreenUpdates && gtk_widget_get_realized( g_qeglobals_gui.d_edit ) ) {
gtk_grab_add( g_qeglobals_gui.d_edit ); gtk_grab_add( g_qeglobals_gui.d_edit );
while ( gtk_events_pending() ) while ( gtk_events_pending() )

View file

@ -255,7 +255,7 @@ static gint OnTextureKey( GtkWidget* widget, GdkEventKey* event, gpointer data )
#ifdef DBG_SI #ifdef DBG_SI
Sys_Printf( "OnTextureKey\n" ); Sys_Printf( "OnTextureKey\n" );
#endif #endif
if ( event->keyval != GDK_Return ) { if ( event->keyval != GDK_KEY_Return ) {
g_dlgSurface.m_bEditingTextureWidget = true; g_dlgSurface.m_bEditingTextureWidget = true;
} }
return FALSE; return FALSE;
@ -278,7 +278,7 @@ static void OnCancel( GtkWidget *widget, gpointer data ){
static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) { static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) {
if ( g_surfwin ) { if ( g_surfwin ) {
if ( event->keyval == GDK_Return ) { if ( event->keyval == GDK_KEY_Return ) {
if ( g_dlgSurface.m_bEditingTextureWidget ) { if ( g_dlgSurface.m_bEditingTextureWidget ) {
OnApply( NULL, NULL ); OnApply( NULL, NULL );
g_dlgSurface.m_bEditingTextureWidget = false; g_dlgSurface.m_bEditingTextureWidget = false;
@ -287,7 +287,7 @@ static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data )
} }
return TRUE; return TRUE;
} }
if ( event->keyval == GDK_Escape ) { if ( event->keyval == GDK_KEY_Escape ) {
OnCancel( NULL, NULL ); OnCancel( NULL, NULL );
return TRUE; return TRUE;
} }
@ -372,8 +372,8 @@ void DoSnapTToGrid( float hscale, float vscale ){
// increment * scale = gridsize // increment * scale = gridsize
static void OnBtnMatchGrid( GtkWidget *widget, gpointer data ){ static void OnBtnMatchGrid( GtkWidget *widget, gpointer data ){
float hscale, vscale; float hscale, vscale;
hscale = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "hscale" ) ) ); hscale = gtk_spin_button_get_value( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "hscale" ) ) );
vscale = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "vscale" ) ) ); vscale = gtk_spin_button_get_value( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "vscale" ) ) );
if ( hscale == 0.0f || vscale == 0.0f ) { if ( hscale == 0.0f || vscale == 0.0f ) {
Sys_FPrintf( SYS_ERR, "ERROR: unexpected scale == 0.0f\n" ); Sys_FPrintf( SYS_ERR, "ERROR: unexpected scale == 0.0f\n" );
return; return;
@ -511,7 +511,7 @@ void SurfaceDlg::BuildDialog() {
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Surface inspector" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "Surface inspector" ) );
//g_signal_connect (G_OBJECT (dlg), "delete-event", G_CALLBACK (OnCancel), NULL); //g_signal_connect (G_OBJECT (dlg), "delete-event", G_CALLBACK (OnCancel), NULL);
// we catch 'Enter' and interpret is as OnDone // we catch 'Enter' and interpret is as OnDone
gtk_signal_connect( GTK_OBJECT( dlg ), "key-press-event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); g_signal_connect( G_OBJECT( dlg ), "key-press-event", G_CALLBACK( OnDialogKey ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
// replaced by only the vbox: // replaced by only the vbox:
@ -529,7 +529,7 @@ void SurfaceDlg::BuildDialog() {
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
entry = gtk_entry_new(); entry = gtk_entry_new();
gtk_signal_connect( GTK_OBJECT( entry ), "key-press-event", GTK_SIGNAL_FUNC( OnTextureKey ), NULL ); g_signal_connect( G_OBJECT( entry ), "key-press-event", G_CALLBACK( OnTextureKey ), NULL );
gtk_widget_show( entry ); gtk_widget_show( entry );
gtk_box_pack_start( GTK_BOX( hbox2 ), entry, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), entry, TRUE, TRUE, 0 );
g_object_set_data( G_OBJECT( m_pWidget ), "texture", entry ); g_object_set_data( G_OBJECT( m_pWidget ), "texture", entry );
@ -550,8 +550,8 @@ void SurfaceDlg::BuildDialog() {
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "hshift", spin ); g_object_set_data( G_OBJECT( dlg ), "hshift", spin );
gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", g_signal_connect( G_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed",
GTK_SIGNAL_FUNC( OnUpdate ), NULL ); G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@ -567,8 +567,8 @@ void SurfaceDlg::BuildDialog() {
entry = gtk_entry_new(); entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "hshift_inc", entry ); g_object_set_data( G_OBJECT( dlg ), "hshift_inc", entry );
gtk_signal_connect( GTK_OBJECT( entry ), "changed", g_signal_connect( G_OBJECT( entry ), "changed",
GTK_SIGNAL_FUNC( OnIncrementChanged ), NULL ); G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry ); gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1, gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@ -584,8 +584,8 @@ void SurfaceDlg::BuildDialog() {
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "vshift", spin ); g_object_set_data( G_OBJECT( dlg ), "vshift", spin );
gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", g_signal_connect( G_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed",
GTK_SIGNAL_FUNC( OnUpdate ), NULL ); G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -601,8 +601,8 @@ void SurfaceDlg::BuildDialog() {
entry = gtk_entry_new(); entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "vshift_inc", entry ); g_object_set_data( G_OBJECT( dlg ), "vshift_inc", entry );
gtk_signal_connect( GTK_OBJECT( entry ), "changed", g_signal_connect( G_OBJECT( entry ), "changed",
GTK_SIGNAL_FUNC( OnIncrementChanged ), NULL ); G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry ); gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -618,8 +618,8 @@ void SurfaceDlg::BuildDialog() {
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "hscale", spin ); g_object_set_data( G_OBJECT( dlg ), "hscale", spin );
gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", g_signal_connect( G_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed",
GTK_SIGNAL_FUNC( OnUpdate ), NULL ); G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3, gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -635,8 +635,8 @@ void SurfaceDlg::BuildDialog() {
entry = gtk_entry_new(); entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "hscale_inc", entry ); g_object_set_data( G_OBJECT( dlg ), "hscale_inc", entry );
gtk_signal_connect( GTK_OBJECT( entry ), "changed", g_signal_connect( G_OBJECT( entry ), "changed",
GTK_SIGNAL_FUNC( OnIncrementChanged ), NULL ); G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry ); gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3, gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -652,8 +652,8 @@ void SurfaceDlg::BuildDialog() {
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "vscale", spin ); g_object_set_data( G_OBJECT( dlg ), "vscale", spin );
gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", g_signal_connect( G_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed",
GTK_SIGNAL_FUNC( OnUpdate ), NULL ); G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4, gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -669,8 +669,8 @@ void SurfaceDlg::BuildDialog() {
entry = gtk_entry_new(); entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "vscale_inc", entry ); g_object_set_data( G_OBJECT( dlg ), "vscale_inc", entry );
gtk_signal_connect( GTK_OBJECT( entry ), "changed", g_signal_connect( G_OBJECT( entry ), "changed",
GTK_SIGNAL_FUNC( OnIncrementChanged ), NULL ); G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry ); gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 3, 4, gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -686,8 +686,8 @@ void SurfaceDlg::BuildDialog() {
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -360, 360, 1, 10, 0 ) ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -360, 360, 1, 10, 0 ) ), 1, 0 );
g_object_set_data( G_OBJECT( dlg ), "rotate", spin ); g_object_set_data( G_OBJECT( dlg ), "rotate", spin );
gtk_signal_connect( GTK_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed", g_signal_connect( G_OBJECT( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ) ), "value-changed",
GTK_SIGNAL_FUNC( OnUpdate ), NULL ); G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin ); gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5, gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -704,8 +704,8 @@ void SurfaceDlg::BuildDialog() {
entry = gtk_entry_new(); entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "rotate_inc", entry ); g_object_set_data( G_OBJECT( dlg ), "rotate_inc", entry );
gtk_signal_connect( GTK_OBJECT( entry ), "changed", g_signal_connect( G_OBJECT( entry ), "changed",
GTK_SIGNAL_FUNC( OnIncrementChanged ), NULL ); G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry ); gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 4, 5, gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 4, 5,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
@ -718,8 +718,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6, gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnMatchGrid ), NULL ); G_CALLBACK( OnBtnMatchGrid ), NULL );
frame = gtk_frame_new( _( "Texturing" ) ); frame = gtk_frame_new( _( "Texturing" ) );
gtk_widget_show( frame ); gtk_widget_show( frame );
@ -761,8 +761,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnAxial ), NULL ); G_CALLBACK( OnBtnAxial ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Fit" ) ); button = gtk_button_new_with_label( _( "Fit" ) );
@ -770,8 +770,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2, gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnFaceFit ), NULL ); G_CALLBACK( OnBtnFaceFit ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "CAP" ) ); button = gtk_button_new_with_label( _( "CAP" ) );
@ -779,8 +779,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4, gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnPatchdetails ), NULL ); G_CALLBACK( OnBtnPatchdetails ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Set..." ) ); button = gtk_button_new_with_label( _( "Set..." ) );
@ -788,8 +788,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4, gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnPatchreset ), NULL ); G_CALLBACK( OnBtnPatchreset ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Natural" ) ); button = gtk_button_new_with_label( _( "Natural" ) );
@ -797,8 +797,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4, gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnPatchnatural ), NULL ); G_CALLBACK( OnBtnPatchnatural ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Fit" ) ); button = gtk_button_new_with_label( _( "Fit" ) );
@ -806,8 +806,8 @@ void SurfaceDlg::BuildDialog() {
gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4, gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnBtnPatchFit ), NULL ); G_CALLBACK( OnBtnPatchFit ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ), 1, 0 ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ), 1, 0 );
@ -833,22 +833,22 @@ void SurfaceDlg::BuildDialog() {
button = gtk_button_new_with_label( _( "Done" ) ); button = gtk_button_new_with_label( _( "Done" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnDone ), NULL ); G_CALLBACK( OnDone ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Apply" ) ); button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnApply ), NULL ); G_CALLBACK( OnApply ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) ); button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnCancel ), NULL ); G_CALLBACK( OnCancel ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
// that's a bit of trashy stuff from Textool-v2 branch // that's a bit of trashy stuff from Textool-v2 branch
@ -857,8 +857,8 @@ void SurfaceDlg::BuildDialog() {
button = gtk_button_new_with_label( _( "Test" ) ); button = gtk_button_new_with_label( _( "Test" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", g_signal_connect( G_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( OnTest ), NULL ); G_CALLBACK( OnTest ), NULL );
gtk_widget_set_usize( button, 60, -2 ); gtk_widget_set_usize( button, 60, -2 );
#endif #endif

View file

@ -637,7 +637,7 @@ void FillTextureMenu( GSList** pArray ){
gtk_widget_show( item ); gtk_widget_show( item );
CheckMenuSplitting( pSubMenu ); CheckMenuSplitting( pSubMenu );
gtk_container_add( GTK_CONTAINER( pSubMenu ), item ); gtk_container_add( GTK_CONTAINER( pSubMenu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( HandleCommand ), g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( HandleCommand ),
GINT_TO_POINTER( CMD_TEXTUREWAD + texture_nummenus ) ); GINT_TO_POINTER( CMD_TEXTUREWAD + texture_nummenus ) );
strcpy( texture_menunames[texture_nummenus], (char*)temp->data ); strcpy( texture_menunames[texture_nummenus], (char*)temp->data );
@ -674,7 +674,7 @@ void FillTextureMenu( GSList** pArray ){
gtk_widget_show( item ); gtk_widget_show( item );
CheckMenuSplitting( menu ); CheckMenuSplitting( menu );
gtk_container_add( GTK_CONTAINER( menu ), item ); gtk_container_add( GTK_CONTAINER( menu ), item );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( HandleCommand ), g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( HandleCommand ),
GINT_TO_POINTER( CMD_TEXTUREWAD + texture_nummenus ) ); GINT_TO_POINTER( CMD_TEXTUREWAD + texture_nummenus ) );
strcpy( texture_menunames[texture_nummenus], (char*)temp->data ); strcpy( texture_menunames[texture_nummenus], (char*)temp->data );
@ -1662,7 +1662,7 @@ void TexWnd::OnCreate(){
g_nTextureOffset = 0; g_nTextureOffset = 0;
GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) ); GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) );
gtk_signal_connect( GTK_OBJECT( vadjustment ), "value-changed", GTK_SIGNAL_FUNC( vertical_scroll ), this ); g_signal_connect( G_OBJECT( vadjustment ), "value-changed", G_CALLBACK( vertical_scroll ), this );
if ( g_PrefsDlg.m_bTextureScrollbar ) { if ( g_PrefsDlg.m_bTextureScrollbar ) {
gtk_widget_show( g_qeglobals_gui.d_texture_scroll ); gtk_widget_show( g_qeglobals_gui.d_texture_scroll );
@ -1671,7 +1671,7 @@ void TexWnd::OnCreate(){
} }
m_bNeedRange = true; m_bNeedRange = true;
gtk_signal_connect( GTK_OBJECT( m_pFilter ), "changed", GTK_SIGNAL_FUNC( filter_changed ), this ); g_signal_connect( G_OBJECT( m_pFilter ), "changed", G_CALLBACK( filter_changed ), this );
if ( g_PrefsDlg.m_bTextureWindow ) { if ( g_PrefsDlg.m_bTextureWindow ) {
gtk_widget_show( m_pFilter ); gtk_widget_show( m_pFilter );
} }
@ -1716,7 +1716,7 @@ void TexWnd::OnExpose() {
gtk_adjustment_set_lower( vadjustment, 0 ); gtk_adjustment_set_lower( vadjustment, 0 );
gtk_adjustment_set_upper( vadjustment, g_qeglobals.d_texturewin.m_nTotalHeight ); gtk_adjustment_set_upper( vadjustment, g_qeglobals.d_texturewin.m_nTotalHeight );
gtk_signal_emit_by_name( GTK_OBJECT( vadjustment ), "changed" ); g_signal_emit_by_name( G_OBJECT( vadjustment ), "changed" );
m_bNeedRange = false; m_bNeedRange = false;
} }
@ -1784,7 +1784,7 @@ void TexWnd::UpdatePrefs(){
} }
void TexWnd::FocusEdit() { void TexWnd::FocusEdit() {
if ( GTK_WIDGET_VISIBLE( m_pFilter ) ) { if ( gtk_widget_get_visible( m_pFilter ) ) {
gtk_window_set_focus( GTK_WINDOW( g_pParentWnd->m_pWidget ), m_pFilter ); gtk_window_set_focus( GTK_WINDOW( g_pParentWnd->m_pWidget ), m_pFilter );
} }
} }
@ -1851,7 +1851,7 @@ void TexWnd::DragDropTexture( guint32 flags, int pointx, int pointy ){
m_ptXcheck = m_ptX; m_ptXcheck = m_ptX;
m_ptYcheck = m_ptY; m_ptYcheck = m_ptY;
if ( g_pParentWnd->GetCamWnd()->GetWidget()->window != gdk_window_at_pointer( &m_ptXcheck, &m_ptYcheck ) ) { if ( gtk_widget_get_window( g_pParentWnd->GetCamWnd()->GetWidget() ) != gdk_window_at_pointer( &m_ptXcheck, &m_ptYcheck ) ) {
return; return;
} }

View file

@ -78,7 +78,7 @@ static gint keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
IWindowListener *pListen = static_cast<IWindowListener *>( data ); IWindowListener *pListen = static_cast<IWindowListener *>( data );
ret = pListen->OnKeyPressed( gdk_keyval_name( event->keyval ) ); ret = pListen->OnKeyPressed( gdk_keyval_name( event->keyval ) );
if ( ret ) { if ( ret ) {
gtk_signal_emit_stop_by_name( GTK_OBJECT( widget ), "key-press-event" ); g_signal_stop_emission_by_name( widget, "key-press-event" );
} }
return ret; return ret;
} }
@ -133,17 +133,17 @@ bool CGtkWindow::Show(){
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ); GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK );
// Connect signal handlers // Connect signal handlers
gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "expose-event", GTK_SIGNAL_FUNC( expose ), this ); g_signal_connect( G_OBJECT( m_pGLWidget ), "expose-event", G_CALLBACK( expose ), this );
gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "motion-notify-event", g_signal_connect( G_OBJECT( m_pGLWidget ), "motion-notify-event",
GTK_SIGNAL_FUNC( motion ), m_pListen ); G_CALLBACK( motion ), m_pListen );
gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "button-press-event", g_signal_connect( G_OBJECT( m_pGLWidget ), "button-press-event",
GTK_SIGNAL_FUNC( button_press ), m_pListen ); G_CALLBACK( button_press ), m_pListen );
gtk_signal_connect( GTK_OBJECT( m_pGLWidget ), "button-release-event", g_signal_connect( G_OBJECT( m_pGLWidget ), "button-release-event",
GTK_SIGNAL_FUNC( button_release ), m_pListen ); G_CALLBACK( button_release ), m_pListen );
gtk_signal_connect( GTK_OBJECT( m_pWnd ), "delete-event", GTK_SIGNAL_FUNC( close_widget ), this ); g_signal_connect( G_OBJECT( m_pWnd ), "delete-event", G_CALLBACK( close_widget ), this );
gtk_signal_connect( GTK_OBJECT( m_pWnd ), "key-press-event", g_signal_connect( G_OBJECT( m_pWnd ), "key-press-event",
GTK_SIGNAL_FUNC( keypress ), m_pListen ); G_CALLBACK( keypress ), m_pListen );
gtk_widget_show( m_pGLWidget ); gtk_widget_show( m_pGLWidget );
gtk_container_add( GTK_CONTAINER( m_pWnd ), m_pGLWidget ); gtk_container_add( GTK_CONTAINER( m_pWnd ), m_pGLWidget );

View file

@ -1167,12 +1167,12 @@ void XYWnd::OnMouseMove( guint32 nFlags, int pointx, int pointy ){
if ( bCrossHair && !g_bWaitCursor ) { if ( bCrossHair && !g_bWaitCursor ) {
GdkCursor *cursor; GdkCursor *cursor;
cursor = gdk_cursor_new( GDK_CROSSHAIR ); cursor = gdk_cursor_new( GDK_CROSSHAIR );
gdk_window_set_cursor( m_pWidget->window, cursor ); gdk_window_set_cursor( gtk_widget_get_window( m_pWidget ), cursor );
gdk_cursor_unref( cursor ); gdk_cursor_unref( cursor );
} }
else else
{ {
gdk_window_set_cursor( m_pWidget->window, NULL ); gdk_window_set_cursor( gtk_widget_get_window( m_pWidget ), NULL );
} }
} }
@ -1428,7 +1428,7 @@ void XYWnd::XY_MouseUp( int x, int y, int buttons ){
} }
m_nButtonstate = 0; m_nButtonstate = 0;
gdk_window_set_cursor( m_pWidget->window, NULL ); gdk_window_set_cursor( gtk_widget_get_window( m_pWidget ), NULL );
update_xor_rectangle_xy( m_XORRectangle ); update_xor_rectangle_xy( m_XORRectangle );
} }
@ -1471,44 +1471,44 @@ void XYWnd::HandleDrop(){
menu_in_menu = create_menu_in_menu_with_mnemonic( menu, "Select" ); menu_in_menu = create_menu_in_menu_with_mnemonic( menu, "Select" );
create_menu_item_with_mnemonic( menu_in_menu, "Select Complete Tall", create_menu_item_with_mnemonic( menu_in_menu, "Select Complete Tall",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_SELECTCOMPLETETALL ); G_CALLBACK( HandleCommand ), ID_SELECTION_SELECTCOMPLETETALL );
create_menu_item_with_mnemonic( menu_in_menu, "Select Touching", create_menu_item_with_mnemonic( menu_in_menu, "Select Touching",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_SELECTTOUCHING ); G_CALLBACK( HandleCommand ), ID_SELECTION_SELECTTOUCHING );
create_menu_item_with_mnemonic( menu_in_menu, "Select Partial Tall", create_menu_item_with_mnemonic( menu_in_menu, "Select Partial Tall",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_SELECTPARTIALTALL ); G_CALLBACK( HandleCommand ), ID_SELECTION_SELECTPARTIALTALL );
create_menu_item_with_mnemonic( menu_in_menu, "Select Inside", create_menu_item_with_mnemonic( menu_in_menu, "Select Inside",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_SELECTINSIDE ); G_CALLBACK( HandleCommand ), ID_SELECTION_SELECTINSIDE );
menu_separator( menu ); nID++; menu_separator( menu ); nID++;
// NOTE: temporary commented out until we put it back in for good (that is with actual features) // NOTE: temporary commented out until we put it back in for good (that is with actual features)
/* /*
menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Group",); menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Group",);
create_menu_item_with_mnemonic (menu_in_menu, "Add to...", create_menu_item_with_mnemonic (menu_in_menu, "Add to...",
GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_ADDTO); G_CALLBACK (HandleCommand), ID_DROP_GROUP_ADDTO);
create_menu_item_with_mnemonic (menu_in_menu, "Remove", create_menu_item_with_mnemonic (menu_in_menu, "Remove",
GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_REMOVE); G_CALLBACK (HandleCommand), ID_DROP_GROUP_REMOVE);
create_menu_item_with_mnemonic (menu_in_menu, "Name...", create_menu_item_with_mnemonic (menu_in_menu, "Name...",
GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_NAME); G_CALLBACK (HandleCommand), ID_DROP_GROUP_NAME);
menu_separator (menu_in_menu); nID++; menu_separator (menu_in_menu); nID++;
create_menu_item_with_mnemonic (menu_in_menu, "New Group...", create_menu_item_with_mnemonic (menu_in_menu, "New Group...",
GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_NEWGROUP); G_CALLBACK (HandleCommand), ID_DROP_GROUP_NEWGROUP);
*/ */
create_menu_item_with_mnemonic( menu, "Ungroup Entity", create_menu_item_with_mnemonic( menu, "Ungroup Entity",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_UNGROUPENTITY ); G_CALLBACK( HandleCommand ), ID_SELECTION_UNGROUPENTITY );
create_menu_item_with_mnemonic( menu, "Move into entity", create_menu_item_with_mnemonic( menu, "Move into entity",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_MERGE ); G_CALLBACK( HandleCommand ), ID_SELECTION_MERGE );
create_menu_item_with_mnemonic( menu, "Move into worldspawn", create_menu_item_with_mnemonic( menu, "Move into worldspawn",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_SEPERATE ); G_CALLBACK( HandleCommand ), ID_SELECTION_SEPERATE );
create_menu_item_with_mnemonic( menu, "Make Detail", create_menu_item_with_mnemonic( menu, "Make Detail",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_MAKE_DETAIL ); G_CALLBACK( HandleCommand ), ID_SELECTION_MAKE_DETAIL );
create_menu_item_with_mnemonic( menu, "Make Structural", create_menu_item_with_mnemonic( menu, "Make Structural",
GTK_SIGNAL_FUNC( HandleCommand ), ID_SELECTION_MAKE_STRUCTURAL ); G_CALLBACK( HandleCommand ), ID_SELECTION_MAKE_STRUCTURAL );
menu_separator( menu ); nID++; menu_separator( menu ); nID++;
menu_in_menu = create_menu_in_menu_with_mnemonic( menu, "Smart Entities" ); menu_in_menu = create_menu_in_menu_with_mnemonic( menu, "Smart Entities" );
create_menu_item_with_mnemonic( menu_in_menu, "Smart__Train", create_menu_item_with_mnemonic( menu_in_menu, "Smart__Train",
GTK_SIGNAL_FUNC( HandleCommand ), nID++ ); G_CALLBACK( HandleCommand ), nID++ );
menu_separator( menu ); nID++; menu_separator( menu ); nID++;
submenu = NULL; submenu = NULL;
@ -1528,7 +1528,7 @@ void XYWnd::HandleDrop(){
if ( strLeft == strActive ) { // this is a child if ( strLeft == strActive ) { // this is a child
assert( submenu ); assert( submenu );
item = gtk_menu_item_new_with_label( strName ); item = gtk_menu_item_new_with_label( strName );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( HandleCommand ), g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( HandleCommand ),
GINT_TO_POINTER( nID++ ) ); GINT_TO_POINTER( nID++ ) );
gtk_widget_show( item ); gtk_widget_show( item );
CheckMenuSplitting( submenu ); CheckMenuSplitting( submenu );
@ -1552,7 +1552,7 @@ void XYWnd::HandleDrop(){
submenu = gtk_menu_new(); submenu = gtk_menu_new();
submenu_root = submenu; submenu_root = submenu;
item = gtk_menu_item_new_with_label( strName ); item = gtk_menu_item_new_with_label( strName );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( HandleCommand ), g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( HandleCommand ),
GINT_TO_POINTER( nID++ ) ); GINT_TO_POINTER( nID++ ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( submenu ), item ); gtk_menu_append( GTK_MENU( submenu ), item );
@ -1574,7 +1574,7 @@ void XYWnd::HandleDrop(){
strActive = ""; strActive = "";
item = gtk_menu_item_new_with_label( strName ); item = gtk_menu_item_new_with_label( strName );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( HandleCommand ), g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( HandleCommand ),
GINT_TO_POINTER( nID++ ) ); GINT_TO_POINTER( nID++ ) );
gtk_widget_show( item ); gtk_widget_show( item );
gtk_menu_append( GTK_MENU( menu ), item ); gtk_menu_append( GTK_MENU( menu ), item );
@ -1788,7 +1788,7 @@ void XYWnd::XY_MouseMoved( int x, int y, int buttons ){
pixmap = gdk_bitmap_create_from_data( NULL, buffer, 32, 32 ); pixmap = gdk_bitmap_create_from_data( NULL, buffer, 32, 32 );
mask = gdk_bitmap_create_from_data( NULL, buffer, 32, 32 ); mask = gdk_bitmap_create_from_data( NULL, buffer, 32, 32 );
GdkCursor *cursor = gdk_cursor_new_from_pixmap( pixmap, mask, &white, &black, 1, 1 ); GdkCursor *cursor = gdk_cursor_new_from_pixmap( pixmap, mask, &white, &black, 1, 1 );
gdk_window_set_cursor( m_pWidget->window, cursor ); gdk_window_set_cursor( gtk_widget_get_window( m_pWidget ), cursor );
gdk_cursor_unref( cursor ); gdk_cursor_unref( cursor );
gdk_drawable_unref( pixmap ); gdk_drawable_unref( pixmap );
gdk_drawable_unref( mask ); gdk_drawable_unref( mask );