inline void CHECK_MINIMIZE( ui::Widget w ){
g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( gtk_widget_get_visible( w ) ) );
- gtk_widget_hide( w );
+ w.hide();
}
static gboolean main_window_iconified( ui::Widget widget, GdkEventWindowState* event, gpointer data ){
}
unsigned int connect_floating( ui::Window main_window, ui::Window floating ){
- return g_signal_connect( G_OBJECT( main_window ), "window_state_event", G_CALLBACK( main_window_iconified ), floating );
+ return main_window.connect( "window_state_event", G_CALLBACK( main_window_iconified ), floating );
}
gboolean destroy_disconnect_floating( ui::Window widget, gpointer data ){
}
guint connect_floating_window_delete_present( ui::Window floating, ui::Window main_window ){
- return g_signal_connect( G_OBJECT( floating ), "delete_event", G_CALLBACK( floating_window_delete_present ), main_window );
+ return floating.connect( "delete_event", G_CALLBACK( floating_window_delete_present ), main_window );
}
gboolean floating_window_destroy_present( ui::Window floating, ui::Window main_window ){
}
guint connect_floating_window_destroy_present( ui::Window floating, ui::Window main_window ){
- return g_signal_connect( G_OBJECT( floating ), "destroy", G_CALLBACK( floating_window_destroy_present ), main_window );
+ return floating.connect( "destroy", G_CALLBACK( floating_window_destroy_present ), main_window );
}
ui::Window create_floating_window( const char* title, ui::Window parent ){
gtk_window_set_transient_for( window, parent );
connect_floating_window_destroy_present( window, parent );
g_object_set_data( G_OBJECT( window ), "floating_handler", gint_to_pointer( connect_floating( parent, window ) ) );
- g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_disconnect_floating ), parent );
+ window.connect( "destroy", G_CALLBACK( destroy_disconnect_floating ), parent );
}
return window;
}
void destroy_floating_window( ui::Window window ){
- gtk_widget_destroy( GTK_WIDGET( window ) );
+ window.destroy();
}
gint window_realize_remove_sysmenu( ui::Widget widget, gpointer data ){
}
gboolean persistent_floating_window_delete( ui::Window floating, GdkEvent *event, ui::Window main_window ){
- gtk_widget_hide( GTK_WIDGET( floating ) );
+ floating.hide();
return TRUE;
}
gtk_widget_set_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK );
connect_floating_window_delete_present( window, main_window );
- g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
+ window.connect( "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
#if 0
if ( g_multimon_globals.m_bStartOnPrimMon && g_multimon_globals.m_bNoSysMenuPopups ) {
- g_signal_connect( G_OBJECT( window ), "realize", G_CALLBACK( window_realize_remove_sysmenu ), 0 );
+ window.connect( "realize", G_CALLBACK( window_realize_remove_sysmenu ), 0 );
}
#endif
}
void window_remove_minmax( ui::Window window ){
- g_signal_connect( G_OBJECT( window ), "realize", G_CALLBACK( window_realize_remove_minmax ), 0 );
+ window.connect( "realize", G_CALLBACK( window_realize_remove_minmax ), 0 );
}
ui::ScrolledWindow create_scrolled_window( ui::Policy hscrollbar_policy, ui::Policy vscrollbar_policy, int border ){
- auto scr = ui::ScrolledWindow();
+ auto scr = ui::ScrolledWindow(ui::New);
gtk_widget_show( GTK_WIDGET( scr ) );
gtk_scrolled_window_set_policy( scr, (GtkPolicyType) hscrollbar_policy, (GtkPolicyType) vscrollbar_policy );
gtk_scrolled_window_set_shadow_type( scr, GTK_SHADOW_IN );
guint window_connect_focus_in_clear_focus_widget(ui::Window window)
{
- return g_signal_connect( G_OBJECT( window ), "focus_in_event", G_CALLBACK( window_focus_in_clear_focus_widget ), NULL );
+ return window.connect( "focus_in_event", G_CALLBACK( window_focus_in_clear_focus_widget ), NULL );
}
void window_get_position(ui::Window window, WindowPosition &position)
void WindowPositionTracker::connect(ui::Window window)
{
sync( window );
- g_signal_connect( G_OBJECT( window ), "configure_event", G_CALLBACK( configure ), this );
+ window.connect( "configure_event", G_CALLBACK( configure ), this );
}
const WindowPosition &WindowPositionTracker::getPosition() const