static void atk_real_gobject_accessible_initialize (AtkObject *atk_obj, gpointer data) { AtkGObjectAccessible *atk_gobj; atk_gobj = ATK_GOBJECT_ACCESSIBLE (atk_obj); g_object_set_qdata (G_OBJECT (atk_gobj), quark_object, data); atk_obj->layer = ATK_LAYER_WIDGET; g_object_weak_ref (data, (GWeakNotify) atk_gobject_accessible_dispose, atk_gobj); }
static void attach_window (EphyExtension *ext, EphyWindow *window) { GtkWidget *notebook; gulong handler_id; notebook = ephy_window_get_notebook (window); handler_id = g_signal_connect (notebook, "button-press-event", G_CALLBACK (button_press_event_cb), window); g_object_set_qdata (G_OBJECT (notebook), HANDLER_ID, GUINT_TO_POINTER (handler_id)); }
static GSList* gwy_radio_buttons_create_real(const GwyEnum *entries, gint nentries, GCallback callback, gpointer cbdata, gint current, gboolean translate) { GtkWidget *button, *curbutton; GSList *group; gint i; if (nentries < 0) { for (nentries = 0; entries[nentries].name != NULL; nentries++) ; } setup_quark(); button = curbutton = NULL; /* FIXME: this relies on undocumented GtkRadioButton behaviour; * we assume it puts the items into the group in reverse order */ for (i = nentries-1; i >= 0; i--) { if (translate) button = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(button), gwy_sgettext(entries[i].name)); else button = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(button), entries[i].name); g_object_set_qdata(G_OBJECT(button), gwyrb_quark, GINT_TO_POINTER(entries[i].value)); if (entries[i].value == current) curbutton = button; } gwy_debug("current: %p", curbutton); if (curbutton) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(curbutton), TRUE); if (callback) { for (group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button)); group; group = g_slist_next(group)) g_signal_connect(group->data, "clicked", callback, cbdata); } return gtk_radio_button_get_group(GTK_RADIO_BUTTON(button)); }
static void ppg_process_menu_add_item (PpgProcessMenu *menu, GPid pid) { GtkMenuItem *item; gchar *path = NULL; gchar *label = NULL; gchar *buffer = NULL; gchar cmd[32]; g_return_if_fail(PPG_IS_PROCESS_MENU(menu)); path = g_strdup_printf("/proc/%d/cmdline", (gint)pid); if (!g_file_test(path, G_FILE_TEST_IS_REGULAR)) { goto cleanup; } if (!g_file_get_contents(path, &buffer, NULL, NULL)) { goto cleanup; } if (!buffer || !buffer[0]) { /* * Probably a kernel thread. */ goto cleanup; } strncpy(cmd, buffer, sizeof cmd - 1); cmd[sizeof cmd - 1] = '\0'; label = g_strdup_printf("%d - %s", (gint)pid, cmd); item = g_object_new(GTK_TYPE_MENU_ITEM, "label", label, "visible", TRUE, "tooltip-text", buffer, NULL); gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(item)); g_object_set_qdata(G_OBJECT(item), pid_quark, GINT_TO_POINTER(pid)); g_signal_connect(item, "activate", G_CALLBACK(ppg_process_menu_item_activate), menu); cleanup: g_free(label); g_free(buffer); g_free(path); }
Atom xdk_display_atom_get(XdkDisplay * self, GQuark name) { g_return_val_if_fail(self, None); g_return_val_if_fail(name, None); Atom atom = (Atom) g_object_get_qdata(G_OBJECT(self), name); if(None == atom) { atom = xdk_display_atom_from_name( self, g_quark_to_string(name), FALSE); g_object_set_qdata(G_OBJECT(self), name, GUINT_TO_POINTER(atom)); } return atom; }
/** * eel_accessibility_set_atk_object_return: * @object: a GObject * @atk_object: it's AtkObject * * used to register and return a new accessible object for something * * Return value: @atk_object. **/ AtkObject * eel_accessibility_set_atk_object_return (gpointer object, AtkObject *atk_object) { atk_object_initialize (atk_object, object); if (!ATK_IS_GOBJECT_ACCESSIBLE (atk_object)) { g_object_set_qdata_full (object, get_quark_accessible (), atk_object, (GDestroyNotify)eel_accessibility_destroy); g_object_set_qdata (G_OBJECT (atk_object), get_quark_gobject (), object); } return atk_object; }
void _gtk_recent_chooser_set_related_action (GtkRecentChooser *recent_chooser, GtkAction *action) { GtkAction *prev_action; prev_action = g_object_get_qdata (G_OBJECT (recent_chooser), quark_gtk_related_action); if (prev_action == action) return; G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (recent_chooser), action); G_GNUC_END_IGNORE_DEPRECATIONS; g_object_set_qdata (G_OBJECT (recent_chooser), quark_gtk_related_action, action); }
void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink) { NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized"); NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject"); if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) { MaiHyperlink* maiHyperlink = GetMaiHyperlink(PR_FALSE); if (!maiHyperlink && !aMaiHyperlink) { return; // Never set and we're shutting down } if (maiHyperlink) { delete maiHyperlink; } g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink, aMaiHyperlink); } }
static void gtk_file_chooser_native_init (GtkFileChooserNative *self) { /* We always create a File chooser dialog and delegate all properties to it. * This way we can reuse that store, plus we always have a dialog we can use * in case something makes the native one not work (like the custom widgets) */ self->dialog = g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG, NULL); self->cancel_button = gtk_dialog_add_button (GTK_DIALOG (self->dialog), _("_Cancel"), GTK_RESPONSE_CANCEL); self->accept_button = gtk_dialog_add_button (GTK_DIALOG (self->dialog), _("_Open"), GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (self->dialog), GTK_RESPONSE_ACCEPT); gtk_window_set_hide_on_close (GTK_WINDOW (self->dialog), TRUE); /* This is used, instead of the standard delegate, to ensure that signals are not delegated. */ g_object_set_qdata (G_OBJECT (self), GTK_FILE_CHOOSER_DELEGATE_QUARK, self->dialog); }
/** * gimp_help_set_help_data_with_markup: * @widget: The #GtkWidget you want to set a @tooltip and/or @help_id for. * @tooltip: The markup for this widget's tooltip (or %NULL). * @help_id: The @help_id for the #GtkTipsQuery tooltips inspector. * * Just like gimp_help_set_help_data(), but it allows to pass text which * is marked up with * <link linkend="PangoMarkupFormat">Pango text markup language</link>. * * Since: GIMP 2.6 **/ void gimp_help_set_help_data_with_markup (GtkWidget *widget, const gchar *tooltip, const gchar *help_id) { g_return_if_fail (GTK_IS_WIDGET (widget)); if (tooltips_enabled) { gtk_widget_set_tooltip_markup (widget, tooltip); if (GTK_IS_MENU_ITEM (widget)) gimp_help_menu_item_set_tooltip (widget, tooltip, help_id); } g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id); }
static gint tooltip_browse_mode_expired (gpointer data) { GtkTooltip *tooltip; GdkDisplay *display; tooltip = GTK_TOOLTIP (data); tooltip->browse_mode_enabled = FALSE; tooltip->browse_mode_timeout_id = 0; /* destroy tooltip */ display = gtk_widget_get_display (tooltip->window); g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL); return FALSE; }
static void _dentry_ui_finish(gpointer pdata, gboolean cancelled) { FmFilePropertiesDEntryData *data = pdata; gsize len; char *text; if (data == NULL) return; if (!cancelled) { text = g_object_get_qdata(data->icon, fm_qdata_id); if (text) { g_key_file_set_string(data->kf, GRP_NAME, "Icon", text); /* disable default handler for icon change since we'll do it below */ g_object_set_qdata(data->icon, fm_qdata_id, NULL); data->changed = TRUE; } } if (!cancelled && data->changed) { text = g_key_file_to_data(data->kf, &len, NULL); g_file_replace_contents(data->file, text, len, NULL, FALSE, 0, NULL, NULL, NULL); /* FIXME: handle errors */ g_free(text); } g_object_unref(data->file); g_key_file_free(data->kf); /* disable own handler on data->name */ g_signal_handlers_disconnect_by_func(data->name, _dentry_name_changed, data); /* restore the field so properties dialog will not do own processing */ gtk_entry_set_text(data->name, data->saved_name); if (data->hidden) { /* disable own handler on data->hidden */ g_signal_handlers_disconnect_by_func(data->hidden, _dentry_hidden_toggled, data); /* disable default handler returning previous value */ gtk_toggle_button_set_active(data->hidden, data->was_hidden); } g_free(data->saved_name); g_free(data->lang); g_slice_free(FmFilePropertiesDEntryData, data); }
static inline void gwy_graph_data_pack_renderer(GwyGraphData *graph_data, GtkTreeViewColumn *column, gint id) { GtkCellRenderer *renderer; renderer = gtk_cell_renderer_text_new(); gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT(renderer), 1); g_object_set(renderer, "xalign", 1.0, NULL); if (id) g_object_set_qdata(G_OBJECT(renderer), quark_id, GINT_TO_POINTER(id)); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(column, renderer, render_data, graph_data, NULL); }
static void gail_focus_tracker (AtkObject *focus_object) { /* * Do not report focus on redundant object */ if (focus_object && (atk_object_get_role(focus_object) != ATK_ROLE_REDUNDANT_OBJECT)) { AtkObject *old_focus_object; if (!GTK_IS_ACCESSIBLE (focus_object)) { AtkObject *parent; parent = focus_object; while (1) { parent = atk_object_get_parent (parent); if (parent == NULL) break; if (GTK_IS_ACCESSIBLE (parent)) break; } if (parent) { gail_set_focus_object (focus_object, parent); } } else { old_focus_object = g_object_get_qdata (G_OBJECT (focus_object), quark_focus_object); if (old_focus_object) { g_object_weak_unref (G_OBJECT (old_focus_object), (GWeakNotify) gail_focus_object_destroyed, focus_object); g_object_set_qdata (G_OBJECT (focus_object), quark_focus_object, NULL); g_object_unref (G_OBJECT (focus_object)); } } } }
void tool_manager_init (Gimp *gimp) { GimpToolManager *tool_manager; GimpContext *user_context; g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (tool_manager_quark == 0); tool_manager_quark = g_quark_from_static_string ("gimp-tool-manager"); tool_manager = g_slice_new0 (GimpToolManager); g_object_set_qdata (G_OBJECT (gimp), tool_manager_quark, tool_manager); tool_manager->image_clean_handler_id = gimp_container_add_handler (gimp->images, "clean", G_CALLBACK (tool_manager_image_clean_dirty), tool_manager); tool_manager->image_dirty_handler_id = gimp_container_add_handler (gimp->images, "dirty", G_CALLBACK (tool_manager_image_clean_dirty), tool_manager); tool_manager->image_saving_handler_id = gimp_container_add_handler (gimp->images, "saving", G_CALLBACK (tool_manager_image_saving), tool_manager); user_context = gimp_get_user_context (gimp); g_signal_connect (user_context, "tool-changed", G_CALLBACK (tool_manager_tool_changed), tool_manager); g_signal_connect (user_context, "tool-preset-changed", G_CALLBACK (tool_manager_preset_changed), tool_manager); tool_manager_tool_changed (user_context, gimp_context_get_tool (user_context), tool_manager); }
static void gtk_css_node_ensure_style (GtkCssNode *cssnode, gint64 current_time) { gboolean style_changed; if (!gtk_css_node_needs_new_style (cssnode)) return; if (cssnode->parent) gtk_css_node_ensure_style (cssnode->parent, current_time); if (cssnode->style_is_invalid) { GtkCssStyle *new_style; if (cssnode->previous_sibling) gtk_css_node_ensure_style (cssnode->previous_sibling, current_time); new_style = GTK_CSS_NODE_GET_CLASS (cssnode)->update_style (cssnode, cssnode->pending_changes, current_time, cssnode->style); style_changed = gtk_css_node_set_style (cssnode, new_style); g_object_unref (new_style); if (!style_changed && (cssnode->pending_changes & GTK_CSS_CHANGE_SOURCE)) { /* clear the global cache if we reuse the same style after the CSS changed */ g_object_set_qdata (G_OBJECT (cssnode->style), quark_global_cache, NULL); } } else { style_changed = FALSE; } gtk_css_node_propagate_pending_changes (cssnode, style_changed); cssnode->pending_changes = 0; cssnode->style_is_invalid = FALSE; }
static GtkWidget* _create_applet (AwnAppletManager *manager, const gchar *path, const gchar *uid) { AwnAppletManagerPrivate *priv; GtkWidget *applet = NULL; g_return_val_if_fail (AWN_IS_APPLET_MANAGER (manager), NULL); priv = AWN_APPLET_MANAGER_GET_PRIVATE (manager); if (g_strstr_len (path, strlen (path), "taskman")) { applet = _load_taskmanager (manager); } else { applet = awn_applet_proxy_new (path, uid); } g_object_set (G_OBJECT (applet), "orient", AWN_ORIENTATION_BOTTOM, "height", priv->settings->bar_height, NULL); gtk_widget_set_size_request (applet, -1, priv->settings->bar_height *2); gtk_box_pack_start (GTK_BOX (manager), applet, FALSE, FALSE, 0); gtk_widget_show_all (GTK_WIDGET (applet)); g_object_set_qdata (G_OBJECT (applet), touch_quark, GINT_TO_POINTER (0)); g_hash_table_insert (priv->applets, g_strdup (uid), applet); if (AWN_IS_APPLET_PROXY (applet)) awn_applet_proxy_exec (AWN_APPLET_PROXY (applet)); if (g_strstr_len (path, strlen (path), "separator")) { awn_bar_add_separator (AWN_BAR (priv->settings->bar), applet); } return applet; }
/** * mex_menu_push: * @menu: A #MexMenu * * Increments the current depth of the menu. If the current depth is %0, * or positive, this will add a new menu level. If the depth is negative, * this will remove a menu level. * * Returns: The new menu depth */ gint mex_menu_push (MexMenu *menu) { MexMenuPrivate *priv; g_return_val_if_fail (MEX_IS_MENU (menu), 0); priv = menu->priv; if (priv->depth < 0) { GList *l; GList *children = clutter_container_get_children (CLUTTER_CONTAINER (menu)); l = g_list_find (children, clutter_actor_get_parent (priv->layout)); priv->layout = l->next->data; priv->action_layout = g_object_get_data (G_OBJECT (priv->layout), "action-layout"); clutter_container_remove_actor (CLUTTER_CONTAINER (menu), CLUTTER_ACTOR (l->data)); g_list_free (children); priv->depth ++; priv->focus_on_add = priv->has_focus; mex_menu_uncheck_buttons (menu); } else { priv->depth ++; priv->layout = mex_menu_create_layout (menu, FALSE); g_object_set_qdata (G_OBJECT (priv->layout), mex_menu_depth_quark, GINT_TO_POINTER (priv->depth)); if (priv->has_focus) priv->focus_on_add = TRUE; } g_object_notify (G_OBJECT (menu), "depth"); return priv->depth; }
/* The default for use-action-appearance is TRUE, so we try to set the * qdata backwards for this case. */ void _gtk_recent_chooser_set_use_action_appearance (GtkRecentChooser *recent_chooser, gboolean use_appearance) { GtkAction *action; gboolean use_action_appearance; action = g_object_get_qdata (G_OBJECT (recent_chooser), quark_gtk_related_action); use_action_appearance = !GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (recent_chooser), quark_gtk_use_action_appearance)); if (use_action_appearance != use_appearance) { g_object_set_qdata (G_OBJECT (recent_chooser), quark_gtk_use_action_appearance, GINT_TO_POINTER (!use_appearance)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (recent_chooser), action); G_GNUC_END_IGNORE_DEPRECATIONS; } }
static void do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev) { GstPad *peer_pad = GST_PAD_PEER (pad); GstElement *parent = get_real_pad_parent (peer_pad); if (parent && (!GST_IS_BIN (parent)) && GST_OBJECT_FLAG_IS_SET (parent, GST_ELEMENT_FLAG_SINK)) { if (GST_EVENT_TYPE (ev) == GST_EVENT_CUSTOM_DOWNSTREAM) { const GstStructure *data = gst_event_get_structure (ev); if (gst_structure_get_name_id (data) == latency_probe_id) { /* store event and calculate latency when the buffer that follows * has been processed */ g_object_set_qdata ((GObject *) peer_pad, latency_probe_id, gst_event_ref (ev)); } } } }
/** * shell_xfixes_cursor_get_for_stage: * @stage: (transfer none): The #ClutterStage to get the cursor for * * Return value: (transfer none): A #ShellXFixesCursor instance */ ShellXFixesCursor * shell_xfixes_cursor_get_for_stage (ClutterStage *stage) { ShellXFixesCursor *instance; static GQuark xfixes_cursor_quark; if (G_UNLIKELY (xfixes_cursor_quark == 0)) xfixes_cursor_quark = g_quark_from_static_string ("gnome-shell-xfixes-cursor"); instance = g_object_get_qdata (G_OBJECT (stage), xfixes_cursor_quark); if (instance == NULL) { instance = g_object_new (SHELL_TYPE_XFIXES_CURSOR, "stage", stage, NULL); g_object_set_qdata (G_OBJECT (stage), xfixes_cursor_quark, instance); } return instance; }
static void gtk_application_impl_dbus_window_added (GtkApplicationImpl *impl, GtkWindow *window) { GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl; GActionGroup *actions; gchar *path; guint id; if (!dbus->session || !GTK_IS_APPLICATION_WINDOW (window)) return; /* Export the action group of this window, based on its id */ actions = gtk_application_window_get_action_group (GTK_APPLICATION_WINDOW (window)); path = gtk_application_impl_dbus_get_window_path (dbus, window); id = g_dbus_connection_export_action_group (dbus->session, path, actions, NULL); g_free (path); g_object_set_qdata (G_OBJECT (window), gtk_application_impl_dbus_export_id_quark (), GUINT_TO_POINTER (id)); }
/** * cinnamon_xfixes_cursor_get_for_stage: * @stage: (transfer none): The #ClutterStage to get the cursor for * * Return value: (transfer none): A #CinnamonXFixesCursor instance */ CinnamonXFixesCursor * cinnamon_xfixes_cursor_get_for_stage (ClutterStage *stage) { CinnamonXFixesCursor *instance; static GQuark xfixes_cursor_quark; if (G_UNLIKELY (xfixes_cursor_quark == 0)) xfixes_cursor_quark = g_quark_from_static_string ("cinnamon-xfixes-cursor"); instance = g_object_get_qdata (G_OBJECT (stage), xfixes_cursor_quark); if (instance == NULL) { instance = g_object_new (CINNAMON_TYPE_XFIXES_CURSOR, "stage", stage, NULL); g_object_set_qdata (G_OBJECT (stage), xfixes_cursor_quark, instance); } return instance; }
OxWindowObject* OxWindow_New(OxWidgetObject* oxParent, OxRect* rc, char* sCaption) { OxWindowObject* ox = (OxWindowObject*)OxObject_Allocate(pOxClass); if (ox == NULL) return NULL; if (!OxWidget_Init((OxWidgetObject*)ox, oxParent, rc)) return NULL; ox->oxIcon = NULL; ox->oxMenu = NULL; ox->oxToolBar = NULL; ox->oxStatusBar = NULL; ox->oxMdiArea = NULL; ox->oxWindow = ox; ox->oxFocusWidget = NULL; ox->fnBeforeCloseCB = NULL; ox->iMinWidth = 320; ox->iMinHeight = 240; ox->iMaxWidth = -1; ox->iMaxHeight = -1; ox->bModal = false; ox->bDeleteOnClose = true; ox->pGtk = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(ox->pGtk), sCaption); gtk_window_set_application(GTK_WINDOW(ox->pGtk), OxApp->pGtk); g_object_set_qdata(ox->pGtk, OxQuark, ox); //OxWidget_CalculateRect((OxWidgetObject*)ox, rc); gtk_window_set_default_size(GTK_WINDOW(ox->pGtk), rc->iWidth, rc->iHeight); gtk_window_move(GTK_WINDOW(ox->pGtk), rc->iLeft, rc->iTop); ox->pGtkFixed = gtk_fixed_new(); gtk_container_add(GTK_CONTAINER(ox->pGtk), ox->pGtkFixed); gtk_widget_show_all(ox->pGtk); g_signal_connect(G_OBJECT(ox->pGtk), "configure-event", G_CALLBACK(OxWindowConfigureEventCB), ox); return ox; }
/** * gwy_radio_buttons_create: * @entries: Radio button group items. * @nentries: The number of items. * @key: Value object data key. * @callback: A callback called when a menu item is activated (or %NULL for * no callback). * @cbdata: User data passed to the callback. * @current: Value to be shown as currently selected (-1 to use what happens * to be first). * * Creates a radio button group for an enum. * * It sets object data identified by @key for each menu item to its value. * Try to avoid -1 as an enum value. * * Returns: The newly created radio button group (a #GSList). Iterate over * the list and pack the widgets (the order is the same as in * @entries). * * Since: 1.2. **/ GSList* gwy_radio_buttons_create(const GwyEnum *entries, gint nentries, const gchar *key, GCallback callback, gpointer cbdata, gint current) { GtkWidget *button, *curbutton; GSList *group; GQuark quark; gint i; quark = g_quark_from_string(key); button = curbutton = NULL; /* FIXME: this relies on undocumented GtkRadioButton behaviour; * we assume it puts the items into the group in reverse order */ for (i = nentries-1; i >= 0; i--) { button = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(button), _(entries[i].name)); g_object_set_qdata(G_OBJECT(button), quark, GINT_TO_POINTER(entries[i].value)); if (entries[i].value == current) curbutton = button; } gwy_debug("current: %p", curbutton); if (curbutton) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(curbutton), TRUE); if (callback) { for (group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button)); group; group = g_slist_next(group)) g_signal_connect(group->data, "clicked", callback, cbdata); } return gtk_radio_button_get_group(GTK_RADIO_BUTTON(button)); }
static GstPadProbeReturn remove_on_unlinked_blocked (GstPad * pad, GstPadProbeInfo * info, gpointer elem) { KmsAgnosticBin2 *self; GstPad *sink; if (elem == NULL) { return GST_PAD_PROBE_REMOVE; } GST_DEBUG_OBJECT (pad, "Unlinking pad"); GST_OBJECT_LOCK (pad); if (g_object_get_qdata (G_OBJECT (pad), unlinking_data_quark ())) { GST_OBJECT_UNLOCK (pad); if (GST_PAD_PROBE_INFO_TYPE (info) & GST_PAD_PROBE_TYPE_QUERY_BOTH) { /* Queries must be answered */ return GST_PAD_PROBE_PASS; } else { return GST_PAD_PROBE_DROP; } } g_object_set_qdata (G_OBJECT (pad), unlinking_data_quark (), GINT_TO_POINTER (TRUE)); GST_OBJECT_UNLOCK (pad); sink = gst_pad_get_peer (pad); if (sink != NULL) { gst_pad_unlink (pad, sink); g_object_unref (sink); } self = KMS_AGNOSTIC_BIN2 (GST_OBJECT_PARENT (elem)); g_thread_pool_push (self->priv->remove_pool, g_object_ref (elem), NULL); return GST_PAD_PROBE_PASS; }
static void gimp_ui_manager_connect_proxy (GtkUIManager *manager, GtkAction *action, GtkWidget *proxy) { g_object_set_qdata (G_OBJECT (proxy), GIMP_HELP_ID, g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID)); if (GTK_IS_MENU_ITEM (proxy)) { g_signal_connect (proxy, "select", G_CALLBACK (gimp_ui_manager_menu_item_select), manager); g_signal_connect (proxy, "deselect", G_CALLBACK (gimp_ui_manager_menu_item_deselect), manager); g_signal_connect_after (proxy, "realize", G_CALLBACK (gimp_ui_manager_item_realize), manager); } }
/** * gwy_sensitivity_group_add_widget: * @sensgroup: A widget flag sensitivity group. * @widget: Widget to add to @sensgroup. * @mask: Which flags the widget is sensitive to. See * gwy_sensitivity_group_set_state() for details. * * Adds a widget to flag sensitivity group. * * Widget sensitivity should not be set manually after the addition as the * result is likely to be a fight over sensitivity setting. * * The added widget takes a reference on @sensgroup. So the group is not * destroyed when they are any widgets in, generally, you can release your * initial reference after adding widgets to the group. **/ void gwy_sensitivity_group_add_widget(GwySensitivityGroup *sensgroup, GtkWidget *widget, guint mask) { SensList *senslist; GObject *object; gboolean sens; g_return_if_fail(GWY_IS_SENSITIVITY_GROUP(sensgroup)); g_return_if_fail(GTK_IS_WIDGET(widget)); object = G_OBJECT(widget); if (g_object_get_qdata(object, sensitivity_group_quark)) { g_warning("Widget cannot be member of more than one sensitivity " "group at once."); return; } senslist = gwy_sensitivity_group_find_list(sensgroup, mask); if (!senslist) { senslist = g_new(SensList, 1); senslist->widgets = NULL; senslist->dirty = FALSE; senslist->mask = mask; senslist->parent = sensgroup; sensgroup->lists = g_list_prepend(sensgroup->lists, senslist); } senslist->widgets = g_list_prepend(senslist->widgets, widget); g_object_set_qdata(object, sensitivity_group_quark, senslist); /* Pass the list item as cbdata */ g_signal_connect(object, "destroy", G_CALLBACK(gwy_sensitivity_group_widget_gone), senslist->widgets); /* Self-reference (pretend the widget has referenced us) */ g_object_ref(sensgroup); sens = ((senslist->mask & sensgroup->old_state) == senslist->mask); gtk_widget_set_sensitive(widget, sens); }
/** * gdk_pixmap_unset_gl_capability: * @pixmap: a #GdkPixmap. * * Unset the OpenGL-capability of the @pixmap. * This function destroys the #GdkGLPixmap held by the @pixmap. * **/ void gdk_pixmap_unset_gl_capability (GdkPixmap *pixmap) { GdkGLPixmap *glpixmap; GDK_GL_NOTE_FUNC (); if (quark_gl_pixmap == 0) quark_gl_pixmap = g_quark_from_static_string (quark_gl_pixmap_string); /* * Destroy OpenGL resources explicitly, then unref. */ glpixmap = g_object_get_qdata (G_OBJECT (pixmap), quark_gl_pixmap); if (glpixmap == NULL) return; _gdk_gl_pixmap_destroy (glpixmap); g_object_set_qdata (G_OBJECT (pixmap), quark_gl_pixmap, NULL); }
OxLabelObject* OxLabel_New(OxWidgetObject* oxParent, OxRect* rc, char* sCaption) { OxLabelObject* ox = (OxLabelObject*)OxObject_Allocate(pOxClass); if (ox == NULL) return NULL; if (!OxWidget_Init((OxWidgetObject*)ox, oxParent, rc)) return NULL; ox->oxAssociatedWidget = NULL; ox->sFormat = NULL; ox->fContentAlignment = 0; ox->pGtk = gtk_label_new(sCaption); gtk_fixed_put(oxParent->pGtkFixed, ox->pGtk, 0, 0); gtk_widget_show(ox->pGtk); OxWidget_Reposition(ox); g_object_set_qdata(ox->pGtk, OxQuark, ox); return ox; }