static void mate_panel_applet_frame_dbus_init (MatePanelAppletFrameDBus *frame) { GtkWidget *container; frame->priv = G_TYPE_INSTANCE_GET_PRIVATE (frame, PANEL_TYPE_APPLET_FRAME_DBUS, MatePanelAppletFrameDBusPrivate); container = mate_panel_applet_container_new (); gtk_widget_show (container); gtk_container_add (GTK_CONTAINER (frame), container); frame->priv->container = MATE_PANEL_APPLET_CONTAINER (container); g_signal_connect (container, "child-property-changed::flags", G_CALLBACK (mate_panel_applet_frame_dbus_flags_changed), frame); g_signal_connect (container, "child-property-changed::size-hints", G_CALLBACK (mate_panel_applet_frame_dbus_size_hints_changed), frame); g_signal_connect (container, "applet-broken", G_CALLBACK (mate_panel_applet_frame_dbus_applet_broken), frame); g_signal_connect (container, "applet-remove", G_CALLBACK (mate_panel_applet_frame_dbus_applet_remove), frame); g_signal_connect (container, "applet-move", G_CALLBACK (mate_panel_applet_frame_dbus_applet_move), frame); g_signal_connect (container, "applet-lock", G_CALLBACK (mate_panel_applet_frame_dbus_applet_lock), frame); }
static void load_applet_into_window (const char *title, const char *prefs_path, guint size, guint orientation) { GtkWidget *container; GtkWidget *applet_window; GVariantBuilder builder; container = mate_panel_applet_container_new (); applet_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); //FIXME: we could set the window icon with the applet icon gtk_window_set_title (GTK_WINDOW (applet_window), title); gtk_container_add (GTK_CONTAINER (applet_window), container); gtk_widget_show (container); g_signal_connect (container, "applet-broken", G_CALLBACK (applet_broken_cb), applet_window); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_add (&builder, "{sv}", "prefs-path", g_variant_new_string (prefs_path)); g_variant_builder_add (&builder, "{sv}", "size", g_variant_new_uint32 (size)); g_variant_builder_add (&builder, "{sv}", "orient", g_variant_new_uint32 (orientation)); mate_panel_applet_container_add (MATE_PANEL_APPLET_CONTAINER (container), gtk_widget_get_screen (applet_window), title, NULL, (GAsyncReadyCallback)applet_activated_cb, applet_window, g_variant_builder_end (&builder)); }