Пример #1
0
static void
conv_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type) {
	PidginConversation *pconv = PIDGIN_CONVERSATION(conv);
	PidginWindow *win = pidgin_conv_get_window(pconv);

	if (type == PURPLE_CONV_UPDATE_UNSEEN && !pidgin_conv_is_hidden(pconv)
			&& pconv->unseen_state == PIDGIN_UNSEEN_NONE
			&& pidgin_conv_window_get_gtkconv_count(win) == 1) {
		GtkWidget *window = win->window;
		gboolean has_focus;

		g_object_get(G_OBJECT(window), "has-toplevel-focus", &has_focus, NULL);

		if (!has_focus || !purple_prefs_get_bool(OPT_WINTRANS_IM_ONFOCUS))
			set_conv_window_trans(NULL, win);

		if (g_signal_handler_find(G_OBJECT(window), G_SIGNAL_MATCH_FUNC,
				0, 0, NULL, G_CALLBACK(focus_conv_win_cb), NULL) == 0) {
			g_signal_connect(G_OBJECT(window), "focus_in_event",
				G_CALLBACK(focus_conv_win_cb), window);
			g_signal_connect(G_OBJECT(window), "focus_out_event",
				G_CALLBACK(focus_conv_win_cb), window);
		}
	}
}
Пример #2
0
GLContext* GLContext::getContextForWidget(GtkWidget* widget)
{
    ASSERT(widget);

    WindowContextMap& windowContexts = windowContextsMap();
    WindowContextMap::iterator i = windowContextsMap().find(widget);
    if (i != windowContexts.end())
        return i->second.get();

    // It's important that this context doesn't hang around after the window
    // is unmapped, so we make sure to clean it up once that happens.
    if (!g_signal_handler_find(widget, G_SIGNAL_MATCH_FUNC, 0, 0, 0, reinterpret_cast<void*>(shutdownGLContext), 0))
        g_signal_connect(widget, "unmap", G_CALLBACK(shutdownGLContext), 0);

    // If this GDK window doesn't have its own native window then, we don't want
    // to use it for rendering, since we'll be drawing over some other widget's area.
    GdkWindow* gdkWindow = gtk_widget_get_window(widget);
    GLContext* context = gdkWindow && gdk_window_has_native(gdkWindow) ?  createContext(GDK_WINDOW_XID(gdkWindow)) : createContext(0);

    if (!context)
        return 0;

    windowContexts.set(widget, adoptPtr(context));
    return context;
}
Пример #3
0
/**
 * ogd_provider_auth_user_and_pwd:
 * @provider:       the #OGDProvider to which enable access with desired username and password
 * @username:       username used for authentication
 * @password:       password used for authentication
 *
 * Set @username and @password to access the #OGDProvider. Those authentication parameters must
 * be obtained separately, perhaps registering to the target website
 */
void ogd_provider_auth_user_and_pwd (OGDProvider *provider, gchar *username, gchar *password)
{
    PTR_CHECK_FREE_NULLIFY (provider->priv->username);
    provider->priv->username = g_strdup (username);
    PTR_CHECK_FREE_NULLIFY (provider->priv->password);
    provider->priv->password = g_strdup (password);

    PTR_CHECK_FREE_NULLIFY (provider->priv->access_url);
    provider->priv->access_url = g_strdup_printf ("http://%s/v%d/", provider->priv->server_name, OPEN_COLLABORATION_API_VERSION);

    if (g_signal_handler_find (provider->priv->http_session, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, authenticate_call, provider) == 0)
        g_signal_connect (provider->priv->http_session, "authenticate", G_CALLBACK (authenticate_call), provider);

    if (g_signal_handler_find (provider->priv->async_http_session, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, authenticate_call, provider) == 0)
        g_signal_connect (provider->priv->async_http_session, "authenticate", G_CALLBACK (authenticate_call), provider);
}
/* Block all unblocked signal handlers connect to signal ID in object instance.
 * Returns a list of all signal handlers block to get them unblocked again in
 * _interface_tweaks_unblock_handlers()
 */
static GSList* _interface_tweaks_block_all_handlers(GObject *inObject, guint inSignalID)
{
	gulong		handlerID;
	GSList		*blockedHandlers=NULL;

	/* Block unblocked signal handlers and keep a list of them */
	do
	{
		/* Find unblocked signal handler to signal ID in object instance.
		 * This will always the next one as the previous one has blocked
		 * or 0L if all signal handlers were blocked.
		 */
		handlerID=g_signal_handler_find(	inObject,
											G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_UNBLOCKED,
											inSignalID,
											0,
											NULL,
											NULL,
											NULL);

		/* Check if we found an unblocked signal handler */
		if(handlerID!=0L)
		{
			/* Add its signal handler ID to list to signal handlers blocked by us */
			blockedHandlers=g_slist_prepend(blockedHandlers, GSIZE_TO_POINTER(handlerID));

			/* Block signal */
			g_signal_handler_block(inObject, handlerID);
		}
	}
	while(handlerID!=0);

	/* Return list of block signal handlers */
	return(blockedHandlers);
}
Пример #5
0
void maintainr_projectbox_set_conf (MaintainrProjectbox *box, MaintainrProjectconf *conf)
{
	int pos;
	const gchar *name;
	GList *iter;
	GtkWidget *button;
	GtkTreeModel *model;
	MaintainrTodo *todo;
	MaintainrService *service;

	box->priv->conf = conf;
	name = maintainr_projectconf_get_name (conf);

	if (name != NULL) {
		gtk_label_set_text (GTK_LABEL (box->priv->label), name);
		gtk_entry_set_text (GTK_ENTRY (box->priv->project_name), name);
	}

	pos = maintainr_projectconf_get_priority (conf);
	gtk_combo_box_set_active (GTK_COMBO_BOX (box->priv->priority), pos);
	set_priority_icon (box, pos);

	model = gtk_tree_view_get_model (GTK_TREE_VIEW (box->priv->todos));

	for (pos = 0, iter = maintainr_projectconf_get_todos (conf); iter; pos++, iter = iter->next) {
		todo = iter->data;
		gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, G_MAXINT,
						   0, maintainr_todo_get_done (todo),
						   1, maintainr_todo_get_string (todo),
						   2, pos, -1);
	}

	for (iter = maintainr_projectconf_get_services (conf); iter; iter = iter->next) {
		service = iter->data;
		name = maintainr_service_get_name (service);

		gtk_notebook_append_page (GTK_NOTEBOOK (box->priv->services_confs), maintainr_service_config_panel (service), gtk_label_new (name));
		gtk_notebook_append_page (GTK_NOTEBOOK (box), do_service_action_panel (box, service), NULL);

		button = gtk_button_new_with_label (name);
		gtk_widget_set_no_show_all (button, TRUE);
		gtk_box_pack_start (GTK_BOX (box->priv->services_buttons), button, TRUE, TRUE, 0);
		g_signal_connect (button, "clicked", G_CALLBACK (activate_service), box);

		if (maintainr_service_get_active (service))
			gtk_widget_show (button);
		else
			gtk_widget_hide (button);

		g_signal_connect_swapped (service, "require-main-screen", G_CALLBACK (show_main), box);
	}

	if (g_signal_handler_find (box->priv->todos, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK (check_if_sorted), box) == 0)
		g_signal_connect (box->priv->todos, "drag-end", G_CALLBACK (check_if_sorted), box);

	todo_aging_color (box);
	g_signal_connect_swapped (conf, "on-top", G_CALLBACK (todo_aging_color), box);

	gtk_widget_show_all (GTK_WIDGET (box));
}
Пример #6
0
static void
dispose (GObject *gobject)
{
    GeglCache *self = GEGL_CACHE (gobject);

    while (g_idle_remove_by_data (gobject)) ;

    /* Check with GEGL_IS_NODE since sometimes the node is destroyed
     * before we get here
     */
    if (GEGL_IS_NODE (self->node))
    {
        gint handler = g_signal_handler_find (self->node, G_SIGNAL_MATCH_DATA,
                                              g_signal_lookup ("invalidated",
                                                      GEGL_TYPE_NODE),
                                              0, NULL, NULL, self);
        if (handler)
        {
            g_signal_handler_disconnect (self->node, handler);
        }
        self->node = NULL;
    }

    G_OBJECT_CLASS (gegl_cache_parent_class)->dispose (gobject);
}
Пример #7
0
static guint
nux_area_accessible_add_focus_handler(AtkComponent* component,
                                      AtkFocusHandler handler)
{
  GSignalMatchType match_type;
  gulong ret;
  guint signal_id;

  g_return_val_if_fail(NUX_IS_AREA_ACCESSIBLE(component), 0);

  match_type = (GSignalMatchType)(G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC);
  signal_id = g_signal_lookup("focus-event", ATK_TYPE_OBJECT);

  ret = g_signal_handler_find(component, match_type, signal_id, 0, NULL,
                              (gpointer) handler, NULL);
  if (!ret)
  {
    return g_signal_connect_closure_by_id(component,
                                          signal_id, 0,
                                          g_cclosure_new(G_CALLBACK(handler), NULL,
                                                         (GClosureNotify) NULL),
                                          FALSE);
  }
  else
    return 0;
}
Пример #8
0
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{
    wxASSERT_MSG( m_menuBar == NULL, "Only one menubar allowed" );

    m_menuBar = menu_bar;

    if (m_menuBar)
    {
        wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->GetParent();

        m_menuBar->SetParent( mdi_frame );

        /* insert the invisible menu bar into the _parent_ mdi frame */
        m_menuBar->Show(false);
        gtk_box_pack_start(GTK_BOX(mdi_frame->m_mainWidget), m_menuBar->m_widget, false, false, 0);
        gtk_box_reorder_child(GTK_BOX(mdi_frame->m_mainWidget), m_menuBar->m_widget, 0);

        gulong handler_id = g_signal_handler_find(
            m_menuBar->m_widget,
            GSignalMatchType(G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DATA),
            g_signal_lookup("size_request", GTK_TYPE_WIDGET),
            0, NULL, NULL, m_menuBar);
        if (handler_id != 0)
            g_signal_handler_disconnect(m_menuBar->m_widget, handler_id);
        gtk_widget_set_size_request(m_menuBar->m_widget, -1, -1);
    }
}
Пример #9
0
void wxFrame::SetToolBar(wxToolBar *toolbar)
{
    m_frameToolBar = toolbar;
    if (toolbar)
    {
        if (toolbar->IsVertical())
        {
            // Vertical toolbar and m_wxwindow go into an hbox, inside the
            // vbox (m_mainWidget). hbox is created on demand.
            GtkWidget* hbox = gtk_widget_get_parent(m_wxwindow);
            if (!GTK_IS_HBOX(hbox))
            {
                hbox = gtk_hbox_new(false, 0);
                gtk_widget_show(hbox);
                gtk_container_add(GTK_CONTAINER(m_mainWidget), hbox);
                gtk_widget_reparent(m_wxwindow, hbox);
            }
            gtk_widget_reparent(toolbar->m_widget, hbox);
            gtk_box_set_child_packing(GTK_BOX(hbox),
                toolbar->m_widget, false, false, 0, GTK_PACK_START);

            int pos = 0;  // left
            if (toolbar->HasFlag(wxTB_RIGHT))
                pos = 1;  // right
            gtk_box_reorder_child(GTK_BOX(hbox), toolbar->m_widget, pos);
        }
        else
        {
            // Horizontal toolbar goes into vbox (m_mainWidget)
            gtk_widget_reparent(toolbar->m_widget, m_mainWidget);
            gtk_box_set_child_packing(GTK_BOX(m_mainWidget),
                toolbar->m_widget, false, false, 0, GTK_PACK_START);

            int pos = 0;  // top
            if (m_frameMenuBar)
                pos = 1;  // below menubar
            if (toolbar->HasFlag(wxTB_BOTTOM))
                pos += 2;  // below client area (m_wxwindow)
            gtk_box_reorder_child(
                GTK_BOX(m_mainWidget), toolbar->m_widget, pos);
        }

        // disconnect wxWindowGTK "size_request" handler,
        // it interferes with sizing of detached GtkHandleBox
        gulong handler_id = g_signal_handler_find(
            toolbar->m_widget,
            GSignalMatchType(G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DATA),
            g_signal_lookup("size_request", GTK_TYPE_WIDGET),
            0, NULL, NULL, toolbar);
        if (handler_id != 0)
            g_signal_handler_disconnect(toolbar->m_widget, handler_id);

        // reset size request to allow native sizing to work
        gtk_widget_set_size_request(toolbar->m_widget, -1, -1);
    }
    // make sure next size_allocate causes a wxSizeEvent
    m_oldClientWidth = 0;
}
Пример #10
0
static void
tab_panel_browser_add_tab_cb (MidoriBrowser*   browser,
                              GtkWidget*       view,
                              MidoriExtension* extension)
{
    GtkWidget* notebook = katze_object_get_object (browser, "notebook");
    gint page = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), view);
    MidoriWebSettings* settings = midori_browser_get_settings (browser);
    gboolean minimized = katze_object_get_boolean (view, "minimized");
    GdkPixbuf* icon = midori_view_get_icon (MIDORI_VIEW (view));
    const gchar* title = midori_view_get_display_title (MIDORI_VIEW (view));
    GtkTreeModel* model = tab_panel_get_model_for_browser (browser);

    if (minimized)
    {
        GtkWidget* toolbar = tab_panel_get_toolbar_for_browser (browser);
        GtkWidget* image = gtk_image_new_from_pixbuf (
            midori_view_get_icon (MIDORI_VIEW (view)));
        GtkToolItem* toolitem = gtk_tool_button_new (image, NULL);
        gtk_tool_item_set_tooltip_text (toolitem, title);
        gtk_widget_show (image);
        g_object_set_data (G_OBJECT (view), "tab-panel-ext-toolitem", toolitem);
        gtk_widget_show (GTK_WIDGET (toolitem));
        gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
        tab_panel_toggle_toolbook (toolbar);
        g_signal_connect (toolitem, "clicked",
            G_CALLBACK (tab_panel_toolitem_clicked_cb), view);
        g_signal_connect (gtk_bin_get_child (GTK_BIN (toolitem)), "button-press-event",
            G_CALLBACK (tab_panel_toolitem_button_press_event_cb), view);
    }
    else
    {
        GtkTreeIter iter;
        gboolean buttons = katze_object_get_boolean (settings, "close-buttons-on-tabs");
        gint ellipsize = midori_view_get_label_ellipsize (MIDORI_VIEW (view));

        gtk_tree_store_insert_with_values (GTK_TREE_STORE (model),
            &iter, NULL, page, 0, view, 1, GTK_STOCK_CLOSE, 2, buttons,
            3, icon, 4, title, 5, ellipsize, 6, NULL, -1);
    }

    if (!g_signal_handler_find (view, G_SIGNAL_MATCH_FUNC,
        g_signal_lookup ("notify", MIDORI_TYPE_VIEW), 0, NULL,
        tab_panel_view_notify_minimized_cb, extension))
    {
        g_signal_connect (settings, "notify::close-buttons-on-tabs",
            G_CALLBACK (tab_panel_settings_notify_cb), model);
        g_signal_connect (view, "notify::minimized",
            G_CALLBACK (tab_panel_view_notify_minimized_cb), extension);
        g_signal_connect (view, "notify::icon",
            G_CALLBACK (tab_panel_view_notify_icon_cb), extension);
        g_signal_connect (view, "notify::title",
            G_CALLBACK (tab_panel_view_notify_title_cb), extension);
    }

    g_object_unref (notebook);
}
Пример #11
0
gboolean
gy_utility_handlers_is_blocked_by_func (gpointer instance,
                                        gpointer func,
                                        gpointer data)
{
  return g_signal_handler_find (instance,
                                G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA | G_SIGNAL_MATCH_UNBLOCKED,
                                0, 0, NULL, func, data) == 0;
}
Пример #12
0
static void
set_property (GObject      *gobject,
              guint         property_id,
              const GValue *value,
              GParamSpec   *pspec)
{
    GeglCache *self = GEGL_CACHE (gobject);

    switch (property_id)
    {
    case PROP_NODE:
        g_mutex_lock (self->mutex);
        if (self->node)
        {
            gulong handler;
            handler = g_signal_handler_find (self->node, G_SIGNAL_MATCH_DATA,
                                             g_signal_lookup ("invalidated",
                                                     GEGL_TYPE_NODE),
                                             0, NULL, NULL, self);
            if (handler)
            {
                g_signal_handler_disconnect (self->node, handler);
            }
        }
        /* just getting the node, the cache holds no reference on the node,
         * it is the node that holds reference on the cache
         */
        self->node = GEGL_NODE (g_value_get_object (value));
        g_signal_connect (G_OBJECT (self->node), "invalidated",
                          G_CALLBACK (node_invalidated), self);
        g_mutex_unlock (self->mutex);
        break;

    case PROP_X:
        g_object_set_property (gobject, "GeglBuffer::x", value);
        break;

    case PROP_Y:
        g_object_set_property (gobject, "GeglBuffer::y", value);
        break;

    case PROP_WIDTH:
        g_object_set_property (gobject, "GeglBuffer::width", value);
        break;

    case PROP_HEIGHT:
        g_object_set_property (gobject, "GeglBuffer::height", value);
        break;

    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
        break;
    }
}
Пример #13
0
static void
mail_shell_view_reader_changed_cb (EMailShellView *mail_shell_view,
                                   EMailReader *reader)
{
	GtkWidget *message_list;
	EMailDisplay *display;
	EShellView *shell_view;
	EShellTaskbar *shell_taskbar;

	shell_view = E_SHELL_VIEW (mail_shell_view);
	shell_taskbar = e_shell_view_get_shell_taskbar (shell_view);

	display = e_mail_reader_get_mail_display (reader);
	message_list = e_mail_reader_get_message_list (reader);

	e_shell_view_update_actions_in_idle (E_SHELL_VIEW (mail_shell_view));
	e_mail_shell_view_update_sidebar (mail_shell_view);

	/* Connect if its not connected already */
	if (g_signal_handler_find (
		message_list, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
		mail_shell_view_message_list_key_press_cb, NULL))
		return;

	g_signal_connect_object (
		message_list, "key-press",
		G_CALLBACK (mail_shell_view_message_list_key_press_cb),
		mail_shell_view, G_CONNECT_SWAPPED);

	g_signal_connect_object (
		message_list, "popup-menu",
		G_CALLBACK (mail_shell_view_message_list_popup_menu_cb),
		mail_shell_view, G_CONNECT_SWAPPED);

	g_signal_connect_object (
		message_list, "right-click",
		G_CALLBACK (mail_shell_view_message_list_right_click_cb),
		mail_shell_view, G_CONNECT_SWAPPED);

	g_signal_connect_object (
		display, "key-press-event",
		G_CALLBACK (mail_shell_view_key_press_event_cb),
		mail_shell_view, G_CONNECT_SWAPPED);

	g_signal_connect_object (
		display, "popup-event",
		G_CALLBACK (mail_shell_view_popup_event_cb),
		mail_shell_view, G_CONNECT_SWAPPED);

	g_signal_connect_object (
		display, "status-message",
		G_CALLBACK (e_shell_taskbar_set_message),
		shell_taskbar, G_CONNECT_SWAPPED);
}
static void
_element_added_callback (GstBin *parent, GstElement *element,
    gpointer user_data)
{
  FsElementAddedNotifier *notifier = FS_ELEMENT_ADDED_NOTIFIER (user_data);

  if (GST_IS_BIN (element)) {
    GstIterator *iter = NULL;
    gboolean done;

    g_signal_connect_object (element, "element-added",
        G_CALLBACK (_element_added_callback), notifier, 0);

    if (parent)
      g_signal_connect_object (element, "parent-unset",
          G_CALLBACK (_bin_unparented_cb), notifier, 0);

    iter = gst_bin_iterate_elements (GST_BIN (element));

    done = FALSE;
    while (!done)
    {
      gpointer item = NULL;

      switch (gst_iterator_next (iter, &item)) {
       case GST_ITERATOR_OK:
         /* We make sure the callback has not already been added */
         if (g_signal_handler_find (item,
                 G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
                 0, 0, NULL, /* id, detail, closure */
                 _element_added_callback, notifier) == 0)
           _element_added_callback (GST_BIN_CAST (element), item, notifier);
         gst_object_unref (item);
         break;
       case GST_ITERATOR_RESYNC:
         // We don't rollback anything, we just ignore already processed ones
         gst_iterator_resync (iter);
         break;
       case GST_ITERATOR_ERROR:
         g_error ("Wrong parameters were given?");
         done = TRUE;
         break;
       case GST_ITERATOR_DONE:
         done = TRUE;
         break;
     }
    }

    gst_iterator_free (iter);
  }

  g_signal_emit (notifier, signals[ELEMENT_ADDED], 0, parent, element);
}
Пример #15
0
/****************************************************************************
  Re-enable a signal callback blocked by disable_gobject_callback.
****************************************************************************/
void enable_gobject_callback(GObject *obj, GCallback cb)
{
  gulong hid;

  if (!obj || !cb) {
    return;
  }

  hid = g_signal_handler_find(obj, G_SIGNAL_MATCH_FUNC,
                              0, 0, NULL, cb, NULL);
  g_signal_handler_unblock(obj, hid);
}
Пример #16
0
static void
pidgin_media_disconnect_levels(PurpleMedia *media, PidginMedia *gtkmedia)
{
	PurpleMediaManager *manager = purple_media_get_manager(media);
	GstElement *element = purple_media_manager_get_pipeline(manager);
	gulong handler_id = g_signal_handler_find(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))),
						  G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0,
						  NULL, G_CALLBACK(level_message_cb), gtkmedia);
	if (handler_id)
		g_signal_handler_disconnect(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))),
					    handler_id);
}
Пример #17
0
static gboolean
toolbox_delete (GtkWidget *widget, GdkEvent *event, gpointer data)
{
  gulong handlerid;
  /** Stop toolbox_destroy from being called */
  handlerid = g_signal_handler_find(widget, G_SIGNAL_MATCH_FUNC,
				    0, 0, NULL, toolbox_destroy, NULL);
  if (handlerid != 0)
    g_signal_handler_disconnect (G_OBJECT (widget), handlerid);

  /** If the app didn't exit, don't close the window */
  return (!app_exit());
}
Пример #18
0
/* SoupSession should clean up all signal handlers on a message after
 * it is finished, allowing the message to be reused if desired.
 * #559054
 */
static void
ensure_no_signal_handlers (SoupMessage *msg, guint *signal_ids, guint n_signal_ids)
{
	int i;

	for (i = 0; i < n_signal_ids; i++) {
		if (g_signal_handler_find (msg, G_SIGNAL_MATCH_ID, signal_ids[i],
					   0, NULL, NULL, NULL)) {
			debug_printf (1, "    Message has handler for '%s'\n",
				      g_signal_name (signal_ids[i]));
			errors++;
		}
	}
}
Пример #19
0
void tooltip_remove(GeanyEditor *editor)
{
	GtkWidget *widget = GTK_WIDGET(editor->sci);

	if (gtk_widget_get_has_tooltip(widget))
	{
		gulong query_tooltip_id = g_signal_handler_find(widget, G_SIGNAL_MATCH_ID,
			g_signal_lookup("query-tooltip", GTK_TYPE_WIDGET), 0, NULL, NULL, NULL);

		if (query_tooltip_id)
			g_signal_handler_disconnect(widget, query_tooltip_id);
		gtk_widget_set_has_tooltip(widget, FALSE);
	}
}
Пример #20
0
void
ags_drum_read(AgsFile *file, xmlNode *node, AgsPlugin *plugin)
{
  AgsDrum *gobject;
  AgsFileLookup *file_lookup;
  AgsFileLaunch *file_launch;
  GList *list;

  gobject = AGS_DRUM(plugin);

  ags_file_add_id_ref(file,
		      g_object_new(AGS_TYPE_FILE_ID_REF,
				   "application-context\0", file->application_context,
				   "file\0", file,
				   "node\0", node,
				   "xpath\0", g_strdup_printf("xpath=//*[@id='%s']\0", xmlGetProp(node, AGS_FILE_ID_PROP)),
				   "reference\0", gobject,
				   NULL));

  list = file->lookup;

  while((file_lookup = ags_file_lookup_find_by_node(list,
						    node->parent)) != NULL){
    if(g_signal_handler_find(list->data,
			     G_SIGNAL_MATCH_FUNC,
			     0,
			     0,
			     NULL,
			     ags_file_read_machine_resolve_audio,
			     NULL) != 0){
      g_signal_connect_after(G_OBJECT(file_lookup), "resolve\0",
			     G_CALLBACK(ags_drum_read_resolve_audio), gobject);
      
      break;
    }

    list = list->next;
  }

  /*  */
  file_launch = g_object_new(AGS_TYPE_FILE_LAUNCH,
			     "node\0", node,
			     "file\0", file,
			     NULL);
  g_signal_connect(G_OBJECT(file_launch), "start\0",
		   G_CALLBACK(ags_drum_launch_task), gobject);
  ags_file_add_launch(file,
		      file_launch);
}
Пример #21
0
void window_clear(WnckWindow *window)
{
	int signal_id = g_signal_lookup("delete-event", GTK_TYPE_WINDOW);
	window_decorate(window, TRUE);
	window_set_state(window, "_NET_WM_STATE_BELOW", FALSE);
	window_set_state(window, "_NET_WM_STATE_ABOVE", FALSE);
	if (configuration.tiled_skip_pager) {
		wnck_window_set_skip_pager(window, FALSE);
		wnck_window_set_skip_tasklist(window, FALSE);
	}
	gulong signal_handler = g_signal_handler_find(window, G_SIGNAL_MATCH_ID, signal_id, 0, NULL, NULL, NULL);
	if (0 != signal_handler) {
		g_signal_handler_disconnect(window, signal_handler);
	}
}
Пример #22
0
static gboolean
gtk_hotkey_x11_listener_real_unbind_hotkey (GtkHotkeyListener   *base,
												GtkHotkeyInfo		*hotkey,
												GError				**error)
{
	GtkHotkeyX11Listener	*self;
	GtkHotkeyInfo			*saved_hk;
	const gchar				*signature;
	
	g_return_val_if_fail (GTK_HOTKEY_IS_X11_LISTENER (base), FALSE);
	g_return_val_if_fail (GTK_HOTKEY_IS_INFO (hotkey), FALSE);
	
	self = GTK_HOTKEY_X11_LISTENER (base);
	signature = gtk_hotkey_info_get_signature (hotkey);
	saved_hk = find_hotkey_from_key_id (self, gtk_hotkey_info_get_key_id(hotkey));
	
	if (!saved_hk) {
		g_set_error (error, GTK_HOTKEY_LISTENER_ERROR,
					 GTK_HOTKEY_LISTENER_ERROR_UNBIND,
					 "Failed to unregister hotkey '%s' with signature '%s'. "
					 "No hotkey with that signature is known",
					 gtk_hotkey_info_get_key_id (hotkey),
					 signature);
		return FALSE;
	}
	
	/* Remove actual keybinding */
	tomboy_keybinder_unbind (signature, hotkey_activated_cb);
	
	/* Clean up refs */
	self->priv->hotkeys = g_list_remove (self->priv->hotkeys, saved_hk);
	g_object_unref (saved_hk);
	
	/* Clean up signal handler */
	gulong handler = g_signal_handler_find (self,
											G_SIGNAL_MATCH_DATA | G_SIGNAL_MATCH_FUNC,
											0, 0, NULL, gtk_hotkey_info_activated,
											hotkey);
	if (handler == 0) {
		g_warning ("Failed to disconnect signal handler for hotkey '%s'",
				   gtk_hotkey_info_get_key_id (hotkey));
	} else {
		g_signal_handler_disconnect (self, handler);
	}
	
	return TRUE;
											
}
Пример #23
0
void gtk_roccat_radio_buttons_block_toggled(GSList *radios, gboolean block) {
    GSList *radio;
    guint signal_id;
    gulong signal_handler;

    signal_id = g_signal_lookup("toggled", GTK_TYPE_RADIO_BUTTON);
    radio = radios;
    while (radio) {
        signal_handler = g_signal_handler_find(G_OBJECT(radio->data), G_SIGNAL_MATCH_ID, signal_id, 0, 0, 0, 0);
        if (block)
            g_signal_handler_block(G_OBJECT(radio->data), signal_handler);
        else
            g_signal_handler_unblock(G_OBJECT(radio->data), signal_handler);
        radio = g_slist_next(radio);
    }
}
gboolean
fs_element_added_notifier_remove (FsElementAddedNotifier *notifier,
    GstBin *bin)
{
  g_return_val_if_fail (FS_IS_ELEMENT_ADDED_NOTIFIER (notifier), FALSE);
  g_return_val_if_fail (GST_IS_BIN (bin), FALSE);

  if (g_signal_handler_find (bin,
          G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
          0, 0, NULL, /* id, detail, closure */
          _element_added_callback, notifier) != 0)
  {
    _bin_unparented_cb (GST_OBJECT (bin), NULL, notifier);
    return TRUE;
  }
  else
  {
    return FALSE;
  }
}
Пример #25
0
void
ags_panel_read(AgsFile *file, xmlNode *node, AgsPlugin *plugin)
{
  AgsPanel *gobject;
  AgsFileLookup *file_lookup;
  GList *list;
  guint64 length, index;

  gobject = AGS_PANEL(plugin);

  ags_file_add_id_ref(file,
		      g_object_new(AGS_TYPE_FILE_ID_REF,
				   "application-context", file->application_context,
				   "file", file,
				   "node", node,
				   "xpath", g_strdup_printf("xpath=//*[@id='%s']", xmlGetProp(node, AGS_FILE_ID_PROP)),
				   "reference", gobject,
				   NULL));

  list = file->lookup;

  while((list = ags_file_lookup_find_by_node(list,
					     node->parent)) != NULL){
    file_lookup = AGS_FILE_LOOKUP(list->data);
    
    if(g_signal_handler_find(list->data,
			     G_SIGNAL_MATCH_FUNC,
			     0,
			     0,
			     NULL,
			     ags_file_read_machine_resolve_audio,
			     NULL) != 0){
      g_signal_connect_after(G_OBJECT(file_lookup), "resolve",
			     G_CALLBACK(ags_panel_read_resolve_audio), gobject);
      
      break;
    }

    list = list->next;
  }
}
Пример #26
0
static void
autoexp_disable(dt_iop_module_t *self)
{
  if (self->request_color_pick <= 0) return;

  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;

  gulong signal_id = g_signal_lookup("toggled", GTK_TYPE_CHECK_BUTTON);
  gulong handler_id = g_signal_handler_find(G_OBJECT(g->autoexp),
                                            G_SIGNAL_MATCH_ID,
                                            signal_id,
                                            0, NULL, NULL, NULL);

  g_signal_handler_block(G_OBJECT (g->autoexp), handler_id);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE);
  g_signal_handler_unblock(G_OBJECT (g->autoexp), handler_id);

  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), FALSE);

  self->request_color_pick = 0;
}
Пример #27
0
static guint
goo_canvas_item_accessible_add_focus_handler (AtkComponent    *component,
					      AtkFocusHandler  handler)
{
  GSignalMatchType match_type;
  GClosure *closure;
  guint signal_id;

  g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), 0);

  match_type = G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC;
  signal_id = g_signal_lookup ("focus-event", ATK_TYPE_OBJECT);

  /* If the handler has already been added just return. */
  if (g_signal_handler_find (component, match_type, signal_id, 0, NULL,
			     (gpointer) handler, NULL))
    return 0;

  closure = g_cclosure_new (G_CALLBACK (handler), NULL, (GClosureNotify) NULL);
  return g_signal_connect_closure_by_id (component, signal_id, 0, closure,
					 FALSE);
}
Пример #28
0
static void
path_bar_path_set_callback (GtkWidget *widget,
                            GFile *location,
                            CajaNavigationWindowPane *pane)
{
    GList *children, *l;
    GtkWidget *child;

    children = gtk_container_get_children (GTK_CONTAINER (widget));

    for (l = children; l != NULL; l = l->next)
    {
        child = GTK_WIDGET (l->data);

        if (!GTK_IS_TOGGLE_BUTTON (child))
        {
            continue;
        }

        if (!g_signal_handler_find (child,
                                    G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
                                    0, 0, NULL,
                                    path_bar_button_pressed_callback,
                                    pane))
        {
            g_signal_connect (child, "button-press-event",
                              G_CALLBACK (path_bar_button_pressed_callback),
                              pane);
            g_signal_connect (child, "button-release-event",
                              G_CALLBACK (path_bar_button_released_callback),
                              pane);
            g_signal_connect (child, "drag-begin",
                              G_CALLBACK (path_bar_button_drag_begin_callback),
                              pane);
        }
    }

    g_list_free (children);
}
Пример #29
0
static void
deflicker_disable(dt_iop_module_t *self)
{
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  gulong signal_id = g_signal_lookup("toggled", GTK_TYPE_CHECK_BUTTON);
  gulong handler_id = g_signal_handler_find(G_OBJECT(g->deflicker),
                                      G_SIGNAL_MATCH_ID,
                                      signal_id,
                                      0, NULL, NULL, NULL);

  g_signal_handler_block(G_OBJECT (g->deflicker), handler_id);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->deflicker), FALSE);
  g_signal_handler_unblock(G_OBJECT (g->deflicker), handler_id);

  gtk_widget_set_sensitive(GTK_WIDGET(g->deflicker_percentile), FALSE);
  gtk_widget_set_sensitive(GTK_WIDGET(g->deflicker_level), FALSE);

  p->deflicker = FALSE;

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
Пример #30
0
static void
gtk_image_menu_item_screen_changed (GtkWidget *widget,
                                    GdkScreen *previous_screen)
{
    GtkSettings *settings;
    gulong show_image_connection;

    if (!gtk_widget_has_screen (widget))
        return;

    settings = gtk_widget_get_settings (widget);

    show_image_connection =
        g_signal_handler_find (settings, G_SIGNAL_MATCH_FUNC, 0, 0,
                               NULL, gtk_image_menu_item_setting_changed, NULL);

    if (show_image_connection)
        return;

    g_signal_connect (settings, "notify::gtk-menu-images",
                      G_CALLBACK (gtk_image_menu_item_setting_changed), NULL);

    show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget));
}