add_definitions(-DRADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}")
-add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES)
+add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE)
if(NOT WIN32)
add_definitions(
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default(w, true);
gtk_widget_grab_default( w );
gtk_widget_show( w );
ret = eIDOK;
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
GtkWidget *window, *w, *vbox, *hbox;
- GtkWidget *radio1, *radio2;
GtkWidget *check1, *check2;
EMessageBoxReturn ret;
int loop = 1;
// ---- vbox ----
- radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" );
+ auto radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" );
gtk_box_pack_start( GTK_BOX( vbox ), radio1, FALSE, FALSE, 2 );
gtk_widget_show( radio1 );
- radio2 = gtk_radio_button_new_with_label( ( (GtkRadioButton*)radio1 )->group, "Use Selected Brushes" );
+ auto 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_widget_show( radio2 );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Disable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
parent = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
}
else{
- parent = widget->parent;
+ parent = gtk_widget_get_parent(widget);
}
if ( !parent ) {
parent = (GtkWidget*) g_object_get_data( G_OBJECT( widget ), "GladeParentKey" );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
}
// start edit mode
- if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) {
+ if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) {
DoStartEdit( GetCurrentCam() );
}
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
// start edit mode
g_iActiveTarget = -1;
- if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) {
+ if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) {
DoStartEdit( GetCurrentCam() );
}
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
w = ui::Button( "Cancel" );
w = gtk_button_new_with_label( "Close" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_close ), NULL );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
}
void UpdatePreview( bool DataChange ){
- if ( g_pWndPreview && GTK_WIDGET_VISIBLE( g_pWndPreview ) ) {
+ if ( g_pWndPreview && gtk_widget_get_visible( g_pWndPreview ) ) {
if ( DataChange ) {
GenerateXYZ();
}
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
ret = IDOK;
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
clr[2] = ( (double)GetBValue( *c ) ) / 255.0;
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_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), clr );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy",
GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
- gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked",
+
+ GtkWidget *ok_button, *cancel_button;
+ g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr);
+
+ gtk_signal_connect( GTK_OBJECT(ok_button), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
- gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked",
+ gtk_signal_connect( GTK_OBJECT(cancel_button), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
while ( loop )
gtk_main_iteration();
- gtk_color_selection_get_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
+ gtk_color_selection_get_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), clr );
gtk_grab_remove( dlg );
gtk_widget_destroy( dlg );
}
static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
- portals.width_2d = static_cast<float>( adj->value );
+ portals.width_2d = static_cast<float>( gtk_adjustment_get_value(adj) );
Set2DText( GTK_WIDGET( data ) );
Portals_shadersChanged();
}
static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
- portals.width_3d = static_cast<float>( adj->value );
+ portals.width_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
Set3DText( GTK_WIDGET( data ) );
SceneChangeNotify();
}
static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
- portals.trans_3d = static_cast<float>( adj->value );
+ portals.trans_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
Set3DTransText( GTK_WIDGET( data ) );
SceneChangeNotify();
}
static void OnScrollClip( GtkAdjustment *adj, gpointer data ){
- portals.clip_range = static_cast<float>( adj->value );
+ portals.clip_range = static_cast<float>( gtk_adjustment_get_value(adj) );
SetClipText( GTK_WIDGET( data ) );
SceneChangeNotify();
{
GtkWindow* toplevel = *i;
ASSERT_MESSAGE( window_has_accel( toplevel ), "ERROR" );
- ASSERT_MESSAGE( GTK_WIDGET_TOPLEVEL( toplevel ), "disabling accel for non-toplevel window" );
+ ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "disabling accel for non-toplevel window" );
gtk_window_remove_accel_group( toplevel, global_accel );
#if 0
globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": disabled global accelerators\n";
{
GtkWindow* toplevel = *i;
ASSERT_MESSAGE( !window_has_accel( toplevel ), "ERROR" );
- ASSERT_MESSAGE( GTK_WIDGET_TOPLEVEL( toplevel ), "enabling accel for non-toplevel window" );
+ ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "enabling accel for non-toplevel window" );
gtk_window_add_accel_group( toplevel, global_accel );
#if 0
globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": enabled global accelerators\n";
}
return entry->closure;
}
- return 0;
+ return nullptr;
}
void global_accel_group_connect( const Accelerator& accelerator, const Callback& callback ){
}
static void clipboard_received( GtkClipboard *clipboard, GtkSelectionData *data, gpointer user_data ){
- if ( data->length < 0 ) {
+ if ( gtk_selection_data_get_length(data) < 0 ) {
globalErrorStream() << "Error retrieving selection\n";
}
- else if ( strcmp( gdk_atom_name( data->type ), clipboard_targets[0].target ) == 0 ) {
- BufferInputStream istream( reinterpret_cast<const char*>( data->data ), data->length );
+ else if ( strcmp( gdk_atom_name( gtk_selection_data_get_data_type(data) ), clipboard_targets[0].target ) == 0 ) {
+ BufferInputStream istream( reinterpret_cast<const char*>( gtk_selection_data_get_data(data) ), gtk_selection_data_get_length(data) );
( *reinterpret_cast<ClipboardPasteFunc*>( user_data ) )( istream );
}
}
void blank_cursor( GtkWidget* widget ){
GdkCursor* cursor = create_blank_cursor();
- gdk_window_set_cursor( widget->window, cursor );
+ gdk_window_set_cursor( gtk_widget_get_window(widget), cursor );
gdk_cursor_unref( cursor );
}
void default_cursor( GtkWidget* widget ){
- gdk_window_set_cursor( widget->window, 0 );
+ gdk_window_set_cursor( gtk_widget_get_window(widget), 0 );
}
GdkCursor* cursor = create_blank_cursor();
//GdkGrabStatus status =
- gdk_pointer_grab( GTK_WIDGET( window )->window, TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
+ gdk_pointer_grab( gtk_widget_get_window(GTK_WIDGET(window)), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
gdk_cursor_unref( cursor );
Sys_GetCursorPos( window, &recorded_x, &recorded_y );
#include <ctype.h>
#include <gtk/gtk.h>
#include <uilib/uilib.h>
+#include <debugging/debugging.h>
#include "generic/callback.h"
}
}
-void menu_item_set_accelerator( GtkMenuItem* item, Accelerator accelerator ){
- GtkAccelLabel* accel_label = GTK_ACCEL_LABEL( gtk_bin_get_child( GTK_BIN( item ) ) );
-
- g_free( accel_label->accel_string );
- accel_label->accel_string = 0;
-
- GString* gstring = g_string_new( accel_label->accel_string );
- g_string_append( gstring, " " );
-
- accelerator_name( accelerator, gstring );
-
- g_free( accel_label->accel_string );
- accel_label->accel_string = gstring->str;
- g_string_free( gstring, FALSE );
-
- if ( !accel_label->accel_string ) {
- accel_label->accel_string = g_strdup( "" );
- }
-
- gtk_widget_queue_resize( GTK_WIDGET( accel_label ) );
-}
-
void menu_item_add_accelerator( GtkMenuItem* item, Accelerator accelerator ){
if ( accelerator.key != 0 ) {
GClosure* closure = global_accel_group_find( accelerator );
- if ( closure != 0 ) {
- menu_item_set_accelerator( item, closure );
- }
- else
- {
- menu_item_set_accelerator( item, accelerator );
- }
+ ASSERT_NOTNULL(closure);
+ menu_item_set_accelerator( item, closure );
}
}
}
static gboolean focus_out( GtkEntry* entry, GdkEventFocus *event, NonModalEntry* self ){
- if ( self->m_editing && GTK_WIDGET_VISIBLE( entry ) ) {
+ if ( self->m_editing && gtk_widget_get_visible( GTK_WIDGET(entry) ) ) {
self->m_apply();
}
self->m_editing = false;
void toolbar_append( GtkToolbar* toolbar, GtkButton* button, const char* description ){
gtk_widget_show( GTK_WIDGET( button ) );
gtk_button_set_relief( button, GTK_RELIEF_NONE );
- GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_FOCUS );
- GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_DEFAULT );
+ gtk_widget_set_can_focus(GTK_WIDGET( button ), false);
+ gtk_widget_set_can_default(GTK_WIDGET( button ), false);
gtk_toolbar_append_element( toolbar, GTK_TOOLBAR_CHILD_WIDGET, GTK_WIDGET( button ), "", description, "", 0, 0, 0 );
}
}
inline bool widget_is_visible( GtkWidget* widget ){
- return GTK_WIDGET_VISIBLE( widget ) != FALSE;
+ return gtk_widget_get_visible( widget ) != FALSE;
}
inline void widget_toggle_visible( GtkWidget* widget ){
return FALSE;
}
static gboolean destroy( GtkWidget* widget, ToggleShown* self ){
- self->m_shownDeferred = GTK_WIDGET_VISIBLE( self->m_widget ) != FALSE;
+ self->m_shownDeferred = gtk_widget_get_visible( self->m_widget ) != FALSE;
self->m_widget = 0;
return FALSE;
}
}
else
{
- return GTK_WIDGET_VISIBLE( m_widget ) != FALSE;
+ return gtk_widget_get_visible( m_widget ) != FALSE;
}
}
void exportActive( const BoolImportCallback& importCallback ){
inline void widget_make_default( GtkWidget* widget ){
- GTK_WIDGET_SET_FLAGS( widget, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( widget, true );
gtk_widget_grab_default( widget );
}
}
inline void CHECK_MINIMIZE( GtkWidget* w ){
- g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( GTK_WIDGET_VISIBLE( w ) ) );
+ g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( gtk_widget_get_visible( w ) ) );
gtk_widget_hide( w );
}
}
gint window_realize_remove_sysmenu( GtkWidget* widget, gpointer data ){
- gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) );
+ gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) );
return FALSE;
}
}
gint window_realize_remove_minmax( GtkWidget* widget, gpointer data ){
- gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
+ gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
return FALSE;
}
}
void lazy_init(){
if ( !initialised() ) {
- m_gc = gdk_gc_new( m_widget->window );
+ m_gc = gdk_gc_new( gtk_widget_get_window(m_widget) );
GdkColor color = { 0, 0xffff, 0xffff, 0xffff, };
- GdkColormap* colormap = gdk_window_get_colormap( m_widget->window );
+ GdkColormap* colormap = gdk_window_get_colormap( gtk_widget_get_window(m_widget) );
gdk_colormap_alloc_color( colormap, &color, FALSE, TRUE );
- gdk_gc_copy( m_gc, m_widget->style->white_gc );
+ gdk_gc_copy( m_gc, gtk_widget_get_style(m_widget)->white_gc );
gdk_gc_set_foreground( m_gc, &color );
gdk_gc_set_background( m_gc, &color );
const int y = float_to_integer( m_rectangle.y );
const int w = float_to_integer( m_rectangle.w );
const int h = float_to_integer( m_rectangle.h );
- gdk_draw_rectangle( m_widget->window, m_gc, FALSE, x, -( h ) - ( y - m_widget->allocation.height ), w, h );
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(m_widget, &allocation);
+ gdk_draw_rectangle( gtk_widget_get_window(m_widget), m_gc, FALSE, x, -( h ) - ( y - allocation.height ), w, h );
}
public:
}
}
void set( rectangle_t rectangle ){
- if ( GTK_WIDGET_REALIZED( m_widget ) ) {
+ if ( gtk_widget_get_realized( m_widget ) ) {
lazy_init();
draw();
m_rectangle = rectangle;
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
ret = IDOK;
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
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 ) );
- GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+ gtk_widget_set_can_default( w, true );
gtk_widget_grab_default( w );
gtk_widget_show( w );
#endif
void camwnd_update_xor_rectangle( CamWnd& self, rect_t area ){
- if ( GTK_WIDGET_VISIBLE( self.m_gl_widget ) ) {
+ if ( gtk_widget_get_visible( self.m_gl_widget ) ) {
self.m_XORRectangle.set( rectangle_from_area( area.min, area.max, self.getCamera().width, self.getCamera().height ) );
}
}
}
inline WindowVector windowvector_for_widget_centre( ui::Widget widget ){
- return WindowVector( static_cast<float>( GTK_WIDGET(widget)->allocation.width / 2 ), static_cast<float>(GTK_WIDGET(widget)->allocation.height / 2 ) );
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
+ return WindowVector( static_cast<float>( allocation.width / 2 ), static_cast<float>(allocation.height / 2 ) );
}
gboolean selection_button_press_freemove( ui::Widget widget, GdkEventButton* event, WindowObserver* observer ){
gtk_widget_ref( m_gl_widget );
gtk_widget_set_events( m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
- GTK_WIDGET_SET_FLAGS( m_gl_widget, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( m_gl_widget, true );
m_sizeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "size_allocate", G_CALLBACK( camera_size_allocate ), this );
m_exposeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "expose_event", G_CALLBACK( camera_expose ), this );
if ( contains_newline ) {
gtk_text_view_scroll_mark_onscreen( GTK_TEXT_VIEW( g_console ), end );
- if ( !ScreenUpdates_Enabled() && GTK_WIDGET_REALIZED( g_console ) ) {
+ if ( !ScreenUpdates_Enabled() && gtk_widget_get_realized( g_console ) ) {
ScreenUpdates_process();
}
}
for ( int i = 0; i < g_spawnflag_count; ++i )
{
ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] ));
- gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), " " );
+ gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), " " );
gtk_widget_hide( widget );
gtk_widget_ref( widget );
gtk_container_remove( GTK_CONTAINER( g_spawnflagsTable ), widget );
(GtkAttachOptions)( GTK_FILL ), 0, 0 );
gtk_widget_unref( widget );
- gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), str.c_str() );
+ gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), str.c_str() );
}
}
}
GtkTreeView* view = g_entityClassList;
GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
- if ( GTK_WIDGET_REALIZED( view ) ) {
+ if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
}
gtk_tree_path_free( path );
if ( toupper( text[0] ) == (int)code ) {
GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
- if ( GTK_WIDGET_REALIZED( view ) ) {
+ if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
}
gtk_tree_path_free( path );
}
bool visible() const {
- return GTK_WIDGET_VISIBLE( m_window );
+ return gtk_widget_get_visible( m_window );
}
};
}
bool FindTextureDialog::isOpen(){
- return GTK_WIDGET_VISIBLE( g_FindTextureDialog.GetWidget() ) == TRUE;
+ return gtk_widget_get_visible( g_FindTextureDialog.GetWidget() ) == TRUE;
}
void FindTextureDialog::setFindStr( const char* name ){
clr[2] = color[2];
dlg = ui::Widget(gtk_color_selection_dialog_new( title ));
- gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
+ gtk_color_selection_set_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), clr );
g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( dialog_delete_callback ), &dialog );
- g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked", G_CALLBACK( dialog_button_ok ), &dialog );
- g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked", G_CALLBACK( dialog_button_cancel ), &dialog );
+ GtkWidget *ok_button, *cancel_button;
+ g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr);
+ g_signal_connect( ok_button, "clicked", G_CALLBACK( dialog_button_ok ), &dialog );
+ g_signal_connect( cancel_button, "clicked", G_CALLBACK( dialog_button_cancel ), &dialog );
if ( parent ) {
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( parent ) );
bool ok = modal_dialog_show( GTK_WINDOW( dlg ), dialog ) == eIDOK;
if ( ok ) {
GdkColor gdkcolor;
- gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), &gdkcolor );
+ gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), &gdkcolor );
clr[0] = gdkcolor.red / 65535.0;
clr[1] = gdkcolor.green / 65535.0;
clr[2] = gdkcolor.blue / 65535.0;
}
gint window_realize_remove_decoration( ui::Widget widget, gpointer data ){
- gdk_window_set_decorations( GTK_WIDGET(widget)->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
+ gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
return FALSE;
}
}
void ScreenUpdates_process(){
- if ( redrawRequired() && GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+ if ( redrawRequired() && gtk_widget_get_visible( g_wait.m_window ) ) {
process_gui();
}
}
ScreenUpdates_process();
}
}
- else if ( GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+ else if ( gtk_widget_get_visible( g_wait.m_window ) ) {
gtk_label_set_text( g_wait.m_label, message );
ScreenUpdates_process();
}
//gtk_window_present(MainFrame_getWindow());
}
- else if ( GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+ else if ( gtk_widget_get_visible( g_wait.m_window ) ) {
gtk_label_set_text( g_wait.m_label, g_wait_stack.back().c_str() );
ScreenUpdates_process();
}
class MainWindowActive
{
static gboolean notify( ui::Window window, gpointer dummy, MainWindowActive* self ){
- if ( g_wait.m_window && gtk_window_is_active( window ) && !GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+ if ( g_wait.m_window && gtk_window_is_active( window ) && !gtk_widget_get_visible( g_wait.m_window ) ) {
gtk_widget_show( GTK_WIDGET( g_wait.m_window ) );
}
g_layout_globals.m_position = m_position_tracker.getPosition();
- g_layout_globals.nState = gdk_window_get_state( GTK_WIDGET( m_window )->window );
+ g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(GTK_WIDGET( m_window )) );
}
void MainFrame::Shutdown(){
MRU_SetText( i, MRU_GetText( i + 1 ) );
if ( MRU_used == 0 ) {
- gtk_label_set_text( GTK_LABEL( GTK_BIN( MRU_items[0] )->child ), "Recent Files" );
+ gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN( MRU_items[0] )) ), "Recent Files" );
gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), FALSE );
}
else
}
bool visible(){
- return GTK_WIDGET_VISIBLE( GetWidget() );
+ return gtk_widget_get_visible( GetWidget() );
}
// void UpdateInfo();
td.scale[0] = td.scale[1] = 0;
td.shift[0] = td.shift[1] = 0;
- if ( adj->value == 0 ) {
+ if ( gtk_adjustment_get_value(adj) == 0 ) {
return;
}
if ( adj == g_object_get_data( G_OBJECT( g_PatchInspector.GetWidget() ), "hshift_adj" ) ) {
g_pi_globals.shift[0] = static_cast<float>( atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ) );
- if ( adj->value > 0 ) {
+ if ( gtk_adjustment_get_value(adj) > 0 ) {
td.shift[0] = g_pi_globals.shift[0];
}
else{
else if ( adj == g_object_get_data( G_OBJECT( g_PatchInspector.GetWidget() ), "vshift_adj" ) ) {
g_pi_globals.shift[1] = static_cast<float>( atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ) );
- if ( adj->value > 0 ) {
+ if ( gtk_adjustment_get_value(adj) > 0 ) {
td.shift[1] = g_pi_globals.shift[1];
}
else{
if ( g_pi_globals.scale[0] == 0.0f ) {
return;
}
- if ( adj->value > 0 ) {
+ if ( gtk_adjustment_get_value(adj) > 0 ) {
td.scale[0] = g_pi_globals.scale[0];
}
else{
if ( g_pi_globals.scale[1] == 0.0f ) {
return;
}
- if ( adj->value > 0 ) {
+ if ( gtk_adjustment_get_value(adj) > 0 ) {
td.scale[1] = g_pi_globals.scale[1];
}
else{
else if ( adj == g_object_get_data( G_OBJECT( g_PatchInspector.GetWidget() ), "rotate_adj" ) ) {
g_pi_globals.rotate = static_cast<float>( atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ) );
- if ( adj->value > 0 ) {
+ if ( gtk_adjustment_get_value(adj) > 0 ) {
td.rotate = g_pi_globals.rotate;
}
else{
}
}
- adj->value = 0;
+ gtk_adjustment_set_value(adj, 0);
// will scale shift rotate the patch accordingly
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "hshift_adj", adj );
- GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+ auto spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
- GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( spin, false );
}
{
GtkEntry* entry = ui::Entry();
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vshift_adj", adj );
- GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+ auto spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
- GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( spin, false );
}
{
GtkEntry* entry = ui::Entry();
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "hscale_adj", adj );
- GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+ auto spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
- GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( spin, false );
}
{
GtkEntry* entry = ui::Entry();
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vscale_adj", adj );
- GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+ auto spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
- GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( spin, false );
}
{
GtkEntry* entry = ui::Entry();
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "rotate_adj", adj );
- GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+ auto spin = ui::SpinButton( adj, 1, 0 );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
- GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( spin, false );
}
}
GtkHBox* hbox2 = ui::HBox( TRUE, 5 );
}
void Widget_updateDependency( ui::Widget self, ui::Widget toggleButton ){
- gtk_widget_set_sensitive( self, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( toggleButton ) ) && GTK_WIDGET_IS_SENSITIVE( toggleButton ) );
+ gtk_widget_set_sensitive( self, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( toggleButton ) ) && gtk_widget_is_sensitive( toggleButton ) );
}
void ToggleButton_toggled_Widget_updateDependency( ui::Widget toggleButton, ui::Widget self ){
void Sys_BeginWait( void ){
ScreenUpdates_Disable( "Processing...", "Please Wait" );
GdkCursor *cursor = gdk_cursor_new( GDK_WATCH );
- gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, cursor );
+ gdk_window_set_cursor( gtk_widget_get_window(MainFrame_getWindow()), cursor );
gdk_cursor_unref( cursor );
g_bWaitCursor = true;
}
void Sys_EndWait( void ){
ScreenUpdates_Enable();
- gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, 0 );
+ gdk_window_set_cursor(gtk_widget_get_window(MainFrame_getWindow()), 0 );
g_bWaitCursor = false;
}
inline void spin_button_set_step( GtkSpinButton* spin, gfloat step ){
#if 1
- gtk_spin_button_get_adjustment( spin )->step_increment = step;
+ gtk_adjustment_set_step_increment(gtk_spin_button_get_adjustment( spin ), step);
#else
GValue gvalue = GValue_default();
g_value_init( &gvalue, G_TYPE_DOUBLE );
Destroy();
}
bool visible() const {
- return GTK_WIDGET_VISIBLE( GetWidget() );
+ return gtk_widget_get_visible( GetWidget() );
}
void queueDraw(){
if ( visible() ) {
// --> Dunno, but this stuff may be necessary... (Looks like it!)
gtk_widget_ref( TexTool::g_textoolWin );
gtk_widget_set_events( TexTool::g_textoolWin, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK );
- GTK_WIDGET_SET_FLAGS( TexTool::g_textoolWin, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( TexTool::g_textoolWin, true );
// <-- end stuff...
gtk_widget_show( TexTool::g_textoolWin );
gtk_widget_set_usize( TexTool::g_textoolWin, -1, 240 ); //Yeah!
void spin_button_set_step_increment( GtkSpinButton* spin, gdouble value ){
GtkAdjustment* adjust = gtk_spin_button_get_adjustment( spin );
- adjust->step_increment = value;
+ gtk_adjustment_set_step_increment(adjust, value);
}
void SurfaceInspector::Update(){
}
}
static void adjustment_value_changed( GtkAdjustment *adjustment, DeferredAdjustment* self ){
- self->value_changed( adjustment->value );
+ self->value_changed( gtk_adjustment_get_value(adjustment) );
}
};
}
static void TextureBrowser_verticalScroll( GtkAdjustment *adjustment, TextureBrowser* textureBrowser ){
- textureBrowser->m_scrollAdjustment.value_changed( adjustment->value );
+ textureBrowser->m_scrollAdjustment.value_changed( gtk_adjustment_get_value(adjustment) );
}
void TextureBrowser_updateScroll( TextureBrowser& textureBrowser ){
GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( textureBrowser.m_texture_scroll ) );
- vadjustment->value = -TextureBrowser_getOriginY( textureBrowser );
- vadjustment->page_size = textureBrowser.height;
- vadjustment->page_increment = textureBrowser.height / 2;
- vadjustment->step_increment = 20;
- vadjustment->lower = 0;
- vadjustment->upper = totalHeight;
+ gtk_adjustment_set_value(vadjustment, -TextureBrowser_getOriginY( textureBrowser ));
+ gtk_adjustment_set_page_size(vadjustment, textureBrowser.height);
+ gtk_adjustment_set_page_increment(vadjustment, textureBrowser.height / 2);
+ gtk_adjustment_set_step_increment(vadjustment, 20);
+ gtk_adjustment_set_lower(vadjustment, 0);
+ gtk_adjustment_set_upper(vadjustment, totalHeight);
g_signal_emit_by_name( G_OBJECT( vadjustment ), "changed" );
}
gtk_widget_ref( g_TextureBrowser.m_gl_widget );
gtk_widget_set_events( g_TextureBrowser.m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
- GTK_WIDGET_SET_FLAGS( g_TextureBrowser.m_gl_widget, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( g_TextureBrowser.m_gl_widget, true );
gtk_table_attach_defaults( GTK_TABLE( table ), g_TextureBrowser.m_gl_widget, 1, 2, 1, 2 );
gtk_widget_show( g_TextureBrowser.m_gl_widget );
Shader* XYWnd::m_state_selected = 0;
void xy_update_xor_rectangle( XYWnd& self, rect_t area ){
- if ( GTK_WIDGET_VISIBLE( self.GetWidget() ) ) {
+ if ( gtk_widget_get_visible( self.GetWidget() ) ) {
self.m_XORRectangle.set( rectangle_from_area( area.min, area.max, self.Width(), self.Height() ) );
}
}
gtk_widget_ref( m_gl_widget );
gtk_widget_set_events( m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
- GTK_WIDGET_SET_FLAGS( m_gl_widget, GTK_CAN_FOCUS );
+ gtk_widget_set_can_focus( m_gl_widget, true );
m_sizeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "size_allocate", G_CALLBACK( xywnd_size_allocate ), this );
m_exposeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "expose_event", G_CALLBACK( xywnd_expose ), this );
if ( ClipMode() && GlobalClipPoints_Find( mousePosition, (VIEWTYPE)m_viewType, m_fScale ) != 0 ) {
GdkCursor *cursor;
cursor = gdk_cursor_new( GDK_CROSSHAIR );
- gdk_window_set_cursor( GTK_WIDGET(m_gl_widget)->window, cursor );
+ gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), cursor );
gdk_cursor_unref( cursor );
}
else
{
- gdk_window_set_cursor( GTK_WIDGET(m_gl_widget)->window, 0 );
+ gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), 0 );
}
}
void entitycreate_activated( ui::Widget item ){
scene::Node* world_node = Map_FindWorldspawn( g_map );
- const char* entity_name = gtk_label_get_text( GTK_LABEL( GTK_BIN( item )->child ) );
+ const char* entity_name = gtk_label_get_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN( item )) ) );
if ( !( world_node && string_equal( entity_name, "worldspawn" ) ) ) {
g_pParentWnd->ActiveXY()->OnEntityCreate( entity_name );