Пример #1
0
void GlobalPressedKeys_disconnect(GtkWindow* window)
{
  g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "key_press_handler")));
  g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "key_release_handler")));
  g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "focus_in_handler")));
  g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "focus_out_handler")));
}
Пример #2
0
void global_accel_disconnect_window( ui::Window window ){
#if 1
	GlobalPressedKeys_disconnect( window );

	g_signal_handler_disconnect( G_OBJECT( window ), gpointer_to_int( g_object_get_data( G_OBJECT( window ), "override_handler" ) ) );
	g_signal_handler_disconnect( G_OBJECT( window ), gpointer_to_int( g_object_get_data( G_OBJECT( window ), "special_key_press_handler" ) ) );
#else
	g_signal_handler_disconnect( G_OBJECT( window ), gpointer_to_int( g_object_get_data( G_OBJECT( window ), "key_press_handler" ) ) );
	g_signal_handler_disconnect( G_OBJECT( window ), gpointer_to_int( g_object_get_data( G_OBJECT( window ), "key_release_handler" ) ) );
#endif
	gtk_window_remove_accel_group( window, global_accel );
	std::size_t count = g_accel_windows.erase( window );
	ASSERT_MESSAGE( count == 1, "failed to remove accel group\n" );
}
Пример #3
0
void radio_button_set_active_no_signal( GtkRadioButton* radio, int index ){
	{
		for ( GSList* l = gtk_radio_button_get_group( radio ); l != 0; l = g_slist_next( l ) )
		{
			g_signal_handler_block( G_OBJECT( l->data ), gpointer_to_int( g_object_get_data( G_OBJECT( l->data ), "handler" ) ) );
		}
	}
	radio_button_set_active( radio, index );
	{
		for ( GSList* l = gtk_radio_button_get_group( radio ); l != 0; l = g_slist_next( l ) )
		{
			g_signal_handler_unblock( G_OBJECT( l->data ), gpointer_to_int( g_object_get_data( G_OBJECT( l->data ), "handler" ) ) );
		}
	}
}
Пример #4
0
// This is needed to correctly connect the ToggleButton to Radiant's callbacks
// The "handler" object data was set in CreateToolItem
inline void toggleButtonSetActiveNoSignal(GtkToggleToolButton* button, gboolean active)
{
  guint handler_id = gpointer_to_int(g_object_get_data(G_OBJECT(button), "handler"));
  g_signal_handler_block(G_OBJECT(button), handler_id);
  gtk_toggle_tool_button_set_active(button, active);
  g_signal_handler_unblock(G_OBJECT(button), handler_id);
}
Пример #5
0
static void dialog_button_callback( ui::Widget widget, gpointer data ){
	int *loop, *ret;

	auto parent = widget.window();
	loop = (int*)g_object_get_data( G_OBJECT( parent ), "loop" );
	ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );

	*loop = 0;
	*ret = gpointer_to_int( data );
}
Пример #6
0
void toggle_button_set_active_no_signal( GtkToggleButton* button, gboolean active ){
	//globalOutputStream() << "set active: " << active << "\n";
	guint handler_id = gpointer_to_int( g_object_get_data( G_OBJECT( button ), "handler" ) );
	//guint signal_id = g_signal_lookup("toggled", G_OBJECT_TYPE (button));
	//globalOutputStream() << "signal_id: " << signal_id << "\n";
	//guint found = g_signal_handler_find(G_OBJECT(button), G_SIGNAL_MATCH_ID, signal_id, 0, 0, 0, 0);
	//globalOutputStream() << " handler found: " << found << "\n";
	g_signal_handler_block( G_OBJECT( button ), handler_id );
	gtk_toggle_button_set_active( button, active );
	g_signal_handler_unblock( G_OBJECT( button ), handler_id );
}
Пример #7
0
static void dialog_button_callback( GtkWidget *widget, gpointer data ){
	GtkWidget *parent;
	int *loop, *ret;

	parent = gtk_widget_get_toplevel( widget );
	loop = (int*)g_object_get_data( G_OBJECT( parent ), "loop" );
	ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );

	*loop = 0;
	*ret = gpointer_to_int( data );
}
Пример #8
0
static void file_sel_callback (GtkWidget *widget, gpointer data)
{
  GtkWidget *parent;
  int *loop;
  char **filename;
 
  parent = gtk_widget_get_toplevel (widget);
  loop = (int*)g_object_get_data (G_OBJECT (parent), "loop");
  filename = (char**)g_object_get_data (G_OBJECT (parent), "filename");
 
  *loop = 0;
  if (gpointer_to_int(data) == IDOK)
    *filename = g_strdup (gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent)));
}
Пример #9
0
/**
 * Callback function for menu items to load the specific file
 * @param menuItem activated menu item
 * @param name map name to load as pointer to g_quark
 */
void UMPMenu::_activate (GtkMenuItem* menuItem, gpointer name)
{
	GlobalMap().changeMap(_("Open Map"), g_quark_to_string(gpointer_to_int(name)));
}
Пример #10
0
gboolean destroy_disconnect_floating( ui::Window widget, gpointer data ){
	g_signal_handler_disconnect( G_OBJECT( data ), gpointer_to_int( g_object_get_data( G_OBJECT( widget ), "floating_handler" ) ) );
	return FALSE;
}
Пример #11
0
inline void CHECK_RESTORE( ui::Widget w ){
	if ( gpointer_to_int( g_object_get_data( G_OBJECT( w ), "was_mapped" ) ) != 0 ) {
		w.show();
	}
}
Пример #12
0
void plugin_activated( GtkWidget* widget, gpointer data ){
	const char* str = (const char*)g_object_get_data( G_OBJECT( widget ),"command" );
	GetPlugInMgr().Dispatch( gpointer_to_int( data ), str );
}