[gnome-panel] panel: remove background change signals
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel: remove background change signals
- Date: Wed, 21 Sep 2016 15:05:52 +0000 (UTC)
commit c4d7c9c82bd2796c8ab27867116bedaf8a8ef9d4
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Sep 21 17:45:31 2016 +0300
panel: remove background change signals
gnome-panel/applet.c | 1 -
.../panel-applet-container.c | 1 -
.../panel-applet-frame-dbus.c | 51 ------------------
gnome-panel/panel-applet-frame.c | 56 --------------------
gnome-panel/panel-applet-frame.h | 7 ---
gnome-panel/panel-background.c | 40 --------------
gnome-panel/panel-background.h | 3 -
gnome-panel/panel-toplevel.c | 1 -
gnome-panel/panel-widget.c | 19 -------
gnome-panel/panel-widget.h | 3 -
gnome-panel/panel.c | 55 -------------------
gnome-panel/panel.h | 1 -
libpanel-applet/panel-applet.c | 44 ---------------
13 files changed, 0 insertions(+), 282 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index a776fe1..a0ad84f 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -985,7 +985,6 @@ panel_applet_register (GtkWidget *applet,
gtk_widget_show (applet);
orientation_change (info, panel);
- back_change (info, panel);
if (type != PANEL_OBJECT_APPLET)
gtk_widget_grab_focus (applet);
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.c
b/gnome-panel/libpanel-applet-private/panel-applet-container.c
index 95bb243..6e94577 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ -57,7 +57,6 @@ static const AppletPropertyInfo applet_properties [] = {
{ "settings-path", "SettingsPath" },
{ "orient", "Orient" },
{ "size-hints", "SizeHints" },
- { "background", "Background" },
{ "flags", "Flags" },
{ "locked-down", "LockedDown" }
};
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
b/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
index f31a218..0ada1a8 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
@@ -221,46 +221,6 @@ panel_applet_frame_dbus_change_orientation (PanelAppletFrame *frame,
}
static void
-container_child_background_set (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
-{
- PanelAppletContainer *container = PANEL_APPLET_CONTAINER (source_object);
- PanelAppletFrameDBus *frame = PANEL_APPLET_FRAME_DBUS (user_data);
-
- panel_applet_container_child_set_finish (container, res, NULL);
-
- if (frame->priv->bg_cancellable)
- g_object_unref (frame->priv->bg_cancellable);
- frame->priv->bg_cancellable = NULL;
-}
-
-static void
-panel_applet_frame_dbus_change_background (PanelAppletFrame *frame,
- PanelBackgroundType type)
-{
- PanelAppletFrameDBus *dbus_frame = PANEL_APPLET_FRAME_DBUS (frame);
- char *bg_str;
-
- bg_str = _panel_applet_frame_get_background_string (
- frame, PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame))), type);
-
- if (bg_str != NULL) {
- if (dbus_frame->priv->bg_cancellable)
- g_cancellable_cancel (dbus_frame->priv->bg_cancellable);
- dbus_frame->priv->bg_cancellable = g_cancellable_new ();
-
- panel_applet_container_child_set (dbus_frame->priv->container,
- "background",
- g_variant_new_string (bg_str),
- dbus_frame->priv->bg_cancellable,
- container_child_background_set,
- dbus_frame);
- g_free (bg_str);
- }
-}
-
-static void
panel_applet_frame_dbus_flags_changed (PanelAppletContainer *container,
const gchar *prop_name,
GVariant *value,
@@ -365,7 +325,6 @@ panel_applet_frame_dbus_class_init (PanelAppletFrameDBusClass *class)
frame_class->popup_menu = panel_applet_frame_dbus_popup_menu;
frame_class->popup_edit_menu = panel_applet_frame_dbus_popup_edit_menu;
frame_class->change_orientation = panel_applet_frame_dbus_change_orientation;
- frame_class->change_background = panel_applet_frame_dbus_change_background;
g_type_class_add_private (class, sizeof (PanelAppletFrameDBusPrivate));
}
@@ -396,7 +355,6 @@ panel_applet_frame_dbus_load (const gchar *iid,
GVariantBuilder builder;
GdkScreen *screen;
gchar *settings_path;
- gchar *background;
guint orient;
g_return_val_if_fail (iid != NULL, FALSE);
@@ -412,9 +370,6 @@ panel_applet_frame_dbus_load (const gchar *iid,
screen = panel_applet_frame_activating_get_screen (frame_act);
orient = get_panel_applet_orient (panel_applet_frame_activating_get_orientation (frame_act));
settings_path = panel_applet_frame_activating_get_settings_path (frame_act);
- /* we can't really get a background string at this point since we don't
- * know the position of the applet */
- background = NULL;
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (&builder, "{sv}",
@@ -426,11 +381,6 @@ panel_applet_frame_dbus_load (const gchar *iid,
g_variant_builder_add (&builder, "{sv}",
"locked-down",
g_variant_new_boolean (panel_applet_frame_activating_get_locked_down
(frame_act)));
- if (background) {
- g_variant_builder_add (&builder, "{sv}",
- "background",
- g_variant_new_string (background));
- }
g_object_set_data (G_OBJECT (frame), "panel-applet-frame-activating", frame_act);
@@ -441,7 +391,6 @@ panel_applet_frame_dbus_load (const gchar *iid,
g_variant_builder_end (&builder));
g_free (settings_path);
- g_free (background);
return TRUE;
}
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 91460dc..89547c5 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -225,25 +225,6 @@ panel_applet_frame_get_preferred_height(GtkWidget *widget, gint *minimal_height,
}
static void
-change_background (PanelAppletFrame *frame,
- GtkAllocation *old,
- GtkAllocation *new)
-{
- PanelBackgroundType type;
-
- if (old->x == new->x &&
- old->y == new->y &&
- old->width == new->width &&
- old->height == new->height)
- return;
-
- type = frame->priv->panel->toplevel->background.type;
-
- PANEL_APPLET_FRAME_GET_CLASS (frame)->change_background (frame,
- type);
-}
-
-static void
panel_applet_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
@@ -262,12 +243,10 @@ panel_applet_frame_size_allocate (GtkWidget *widget,
if (!frame->priv->has_handle) {
GTK_WIDGET_CLASS (panel_applet_frame_parent_class)->size_allocate (widget,
allocation);
- change_background (frame, &widget_allocation, allocation);
return;
}
gtk_widget_set_allocation (widget, allocation);
- change_background (frame, &widget_allocation, allocation);
frame->priv->handle_rect.x = 0;
frame->priv->handle_rect.y = 0;
@@ -611,41 +590,6 @@ _panel_applet_frame_update_size_hints (PanelAppletFrame *frame,
n_elements);
}
-char *
-_panel_applet_frame_get_background_string (PanelAppletFrame *frame,
- PanelWidget *panel,
- PanelBackgroundType type)
-{
- GtkAllocation allocation;
- int x;
- int y;
-
- gtk_widget_get_allocation (GTK_WIDGET (frame), &allocation);
-
- x = allocation.x;
- y = allocation.y;
-
- if (frame->priv->has_handle) {
- switch (frame->priv->orientation) {
- case PANEL_ORIENTATION_TOP:
- case PANEL_ORIENTATION_BOTTOM:
- if (gtk_widget_get_direction (GTK_WIDGET (frame)) !=
- GTK_TEXT_DIR_RTL)
- x += frame->priv->handle_rect.width;
- break;
- case PANEL_ORIENTATION_LEFT:
- case PANEL_ORIENTATION_RIGHT:
- y += frame->priv->handle_rect.height;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- }
-
- return panel_background_make_string (&panel->toplevel->background, x, y);
-}
-
static void
panel_applet_frame_reload_response (GtkWidget *dialog,
int response,
diff --git a/gnome-panel/panel-applet-frame.h b/gnome-panel/panel-applet-frame.h
index 1a786aa..fa4f760 100644
--- a/gnome-panel/panel-applet-frame.h
+++ b/gnome-panel/panel-applet-frame.h
@@ -61,9 +61,6 @@ struct _PanelAppletFrameClass {
void (*change_orientation) (PanelAppletFrame *frame,
PanelOrientation orientation);
-
- void (*change_background) (PanelAppletFrame *frame,
- PanelBackgroundType type);
};
struct _PanelAppletFrame {
@@ -115,10 +112,6 @@ void _panel_applet_frame_update_size_hints (PanelAppletFrame *frame,
gint *size_hints,
guint n_elements);
-char *_panel_applet_frame_get_background_string (PanelAppletFrame *frame,
- PanelWidget *panel,
- PanelBackgroundType type);
-
void _panel_applet_frame_applet_broken (PanelAppletFrame *frame);
void _panel_applet_frame_applet_remove (PanelAppletFrame *frame);
diff --git a/gnome-panel/panel-background.c b/gnome-panel/panel-background.c
index c448450..3ad300b 100644
--- a/gnome-panel/panel-background.c
+++ b/gnome-panel/panel-background.c
@@ -36,11 +36,9 @@
#include "panel-schemas.h"
#include "panel-util.h"
-
static gboolean panel_background_composite (PanelBackground *background);
static void load_background_file (PanelBackground *background);
-
static gboolean
panel_background_prepare (PanelBackground *background)
{
@@ -929,44 +927,6 @@ panel_background_free (PanelBackground *background)
background->default_pattern = NULL;
}
-char *
-panel_background_make_string (PanelBackground *background,
- int x,
- int y)
-{
- PanelBackgroundType effective_type;
- GVariant *variant;
- gchar *retval;
-
- effective_type = panel_background_effective_type (background);
-
- if (effective_type == PANEL_BACK_IMAGE ||
- (effective_type == PANEL_BACK_COLOR && background->has_alpha)) {
- cairo_surface_t *surface;
-
- if (!background->composited_pattern)
- return NULL;
-
- if (cairo_pattern_get_surface (background->composited_pattern, &surface) !=
CAIRO_STATUS_SUCCESS)
- return NULL;
-
- g_assert (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_XLIB);
-
- variant = g_variant_new ("(uii)", (guint32)cairo_xlib_surface_get_drawable (surface),
- x, y);
- } else if (effective_type == PANEL_BACK_COLOR) {
- variant = g_variant_new ("(dddd)",
- background->color.red, background->color.green,
- background->color.blue, background->color.alpha);
- } else
- variant = g_variant_new ("()");
-
- retval = g_variant_print (variant, TRUE);
- g_variant_unref (variant);
-
- return retval;
-}
-
PanelBackgroundType
panel_background_get_type (PanelBackground *background)
{
diff --git a/gnome-panel/panel-background.h b/gnome-panel/panel-background.h
index 286d526..b09e73f 100644
--- a/gnome-panel/panel-background.h
+++ b/gnome-panel/panel-background.h
@@ -91,9 +91,6 @@ void panel_background_change_region (PanelBackground *background,
int y,
int width,
int height);
-char *panel_background_make_string (PanelBackground *background,
- int x,
- int y);
PanelBackgroundType panel_background_get_type (PanelBackground *background);
const GdkRGBA *panel_background_get_color (PanelBackground *background);
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 28d0992..e33e020 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -4276,7 +4276,6 @@ background_changed (PanelBackground *background,
PanelToplevel *toplevel)
{
panel_toplevel_update_edges (toplevel);
- panel_widget_emit_background_changed (toplevel->priv->panel_widget);
}
static void
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index 4b1d7c2..ee419c9 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -35,7 +35,6 @@ typedef enum {
G_DEFINE_TYPE (PanelWidget, panel_widget, GTK_TYPE_FIXED);
enum {
- BACK_CHANGE_SIGNAL,
APPLET_MOVE_SIGNAL,
APPLET_ADDED_SIGNAL,
APPLET_REMOVED_SIGNAL,
@@ -269,17 +268,6 @@ panel_widget_class_init (PanelWidgetClass *class)
GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
GtkContainerClass *container_class = (GtkContainerClass*) class;
- panel_widget_signals[BACK_CHANGE_SIGNAL] =
- g_signal_new ("back_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (PanelWidgetClass, back_change),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-
panel_widget_signals[APPLET_MOVE_SIGNAL] =
g_signal_new ("applet_move",
G_TYPE_FROM_CLASS (object_class),
@@ -363,7 +351,6 @@ panel_widget_class_init (PanelWidgetClass *class)
G_TYPE_NONE,
0);
- class->back_change = NULL;
class->applet_move = NULL;
class->applet_added = NULL;
class->applet_removed = NULL;
@@ -2672,9 +2659,3 @@ panel_widget_register_open_dialog (PanelWidget *panel,
panel,
G_CONNECT_SWAPPED);
}
-
-void
-panel_widget_emit_background_changed (PanelWidget *panel)
-{
- g_signal_emit (panel, panel_widget_signals [BACK_CHANGE_SIGNAL], 0);
-}
diff --git a/gnome-panel/panel-widget.h b/gnome-panel/panel-widget.h
index 05c0598..762a6de 100644
--- a/gnome-panel/panel-widget.h
+++ b/gnome-panel/panel-widget.h
@@ -108,7 +108,6 @@ struct _PanelWidgetClass
{
GtkFixedClass parent_class;
- void (* back_change) (PanelWidget *panel);
void (* applet_move) (PanelWidget *panel,
GtkWidget *applet);
void (* applet_added) (PanelWidget *panel,
@@ -203,8 +202,6 @@ void panel_widget_set_applet_size_hints (PanelWidget *panel,
void panel_widget_register_open_dialog (PanelWidget *panel,
GtkWidget *dialog);
-void panel_widget_emit_background_changed (PanelWidget *panel);
-
G_END_DECLS
#endif /* PANEL_WIDGET_H */
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index a608537..985874b 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -108,56 +108,6 @@ panel_orient_change (GtkWidget *widget, gpointer data)
widget);
}
-void
-back_change (AppletInfo *info,
- PanelWidget *panel)
-{
- PanelAppletFrame *frame;
- PanelBackgroundType type;
-
- switch (info->type) {
- case PANEL_OBJECT_APPLET:
- frame = PANEL_APPLET_FRAME (info->widget);
- type = panel->toplevel->background.type;
-
- PANEL_APPLET_FRAME_GET_CLASS (frame)->change_background (frame, type);
- break;
- case PANEL_OBJECT_ACTION:
- case PANEL_OBJECT_LAUNCHER:
- case PANEL_OBJECT_MENU:
- case PANEL_OBJECT_MENU_BAR:
- case PANEL_OBJECT_USER_MENU:
- case PANEL_OBJECT_SEPARATOR:
- break;
- default:
- break;
- }
-}
-
-static void
-back_change_foreach (GtkWidget *widget,
- PanelWidget *panel)
-{
- AppletInfo *info;
-
- info = g_object_get_data (G_OBJECT (widget), "applet_info");
-
- back_change (info, panel);
-}
-
-static void
-panel_back_change (GtkWidget *widget, gpointer data)
-{
- gtk_container_foreach (GTK_CONTAINER (widget),
- (GtkCallback) back_change_foreach,
- widget);
-
-#ifdef FIXME_FOR_NEW_CONFIG
- /*update the configuration box if it is displayed*/
- update_config_back(PANEL_WIDGET(widget));
-#endif /* FIXME_FOR_NEW_CONFIG */
-}
-
static void
panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
{
@@ -166,7 +116,6 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
info = g_object_get_data (G_OBJECT (applet), "applet_info");
orientation_change(info,PANEL_WIDGET(widget));
- back_change(info,PANEL_WIDGET(widget));
}
static gboolean
@@ -1267,10 +1216,6 @@ panel_widget_setup(PanelWidget *panel)
"applet_move",
G_CALLBACK(panel_applet_move),
NULL);
- g_signal_connect (G_OBJECT (panel),
- "back_change",
- G_CALLBACK (panel_back_change),
- NULL);
}
PanelData *
diff --git a/gnome-panel/panel.h b/gnome-panel/panel.h
index 2ac80c1..4893d5b 100644
--- a/gnome-panel/panel.h
+++ b/gnome-panel/panel.h
@@ -17,7 +17,6 @@ struct _PanelData {
};
void orientation_change(AppletInfo *info, PanelWidget *panel);
-void back_change(AppletInfo *info, PanelWidget *panel);
PanelData *panel_setup (PanelToplevel *toplevel);
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index 24dd355..4cd1838 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -90,7 +90,6 @@ struct _PanelAppletPrivate {
PanelAppletFlags flags;
PanelAppletOrient orient;
- char *background;
int *size_hints;
int size_hints_len;
@@ -115,7 +114,6 @@ enum {
PROP_CONNECTION,
PROP_SETTINGS_PATH,
PROP_ORIENT,
- PROP_BACKGROUND,
PROP_FLAGS,
PROP_SIZE_HINTS,
PROP_LOCKED_DOWN
@@ -861,7 +859,6 @@ panel_applet_finalize (GObject *object)
g_free (applet->priv->size_hints);
g_free (applet->priv->settings_path);
- g_free (applet->priv->background);
g_free (applet->priv->id);
/* closure is owned by the factory */
@@ -1242,23 +1239,6 @@ panel_applet_focus (GtkWidget *widget,
}
static void
-panel_applet_set_background_string (PanelApplet *applet,
- const gchar *background)
-{
- if (applet->priv->background == background)
- return;
-
- if (g_strcmp0 (applet->priv->background, background) == 0)
- return;
-
- if (applet->priv->background)
- g_free (applet->priv->background);
- applet->priv->background = background ? g_strdup (background) : NULL;
-
- g_object_notify (G_OBJECT (applet), "background");
-}
-
-static void
panel_applet_move_focus_out_of_applet (PanelApplet *applet,
GtkDirectionType dir)
{
@@ -1296,9 +1276,6 @@ panel_applet_get_property (GObject *object,
case PROP_ORIENT:
g_value_set_uint (value, applet->priv->orient);
break;
- case PROP_BACKGROUND:
- g_value_set_string (value, applet->priv->background);
- break;
case PROP_FLAGS:
g_value_set_uint (value, applet->priv->flags);
break;
@@ -1354,9 +1331,6 @@ panel_applet_set_property (GObject *object,
case PROP_ORIENT:
panel_applet_set_orient (applet, g_value_get_uint (value));
break;
- case PROP_BACKGROUND:
- panel_applet_set_background_string (applet, g_value_get_string (value));
- break;
case PROP_FLAGS:
panel_applet_set_flags (applet, g_value_get_uint (value));
break;
@@ -1575,18 +1549,6 @@ panel_applet_class_init (PanelAppletClass *klass)
PANEL_APPLET_ORIENT_UP,
G_PARAM_READWRITE));
/**
- * PanelApplet:background: (skip)
- *
- * Implementation detail.
- **/
- g_object_class_install_property (gobject_class,
- PROP_BACKGROUND,
- g_param_spec_string ("background",
- "Background",
- "Panel Applet Background",
- NULL,
- G_PARAM_READWRITE));
- /**
* PanelApplet:flags:
*
* The #PanelAppletFlags of the applet.
@@ -1721,9 +1683,6 @@ get_property_cb (GDBusConnection *connection,
applet->priv->settings_path : "");
} else if (g_strcmp0 (property_name, "Orient") == 0) {
retval = g_variant_new_uint32 (applet->priv->orient);
- } else if (g_strcmp0 (property_name, "Background") == 0) {
- retval = g_variant_new_string (applet->priv->background ?
- applet->priv->background : "");
} else if (g_strcmp0 (property_name, "Flags") == 0) {
retval = g_variant_new_uint32 (applet->priv->flags);
} else if (g_strcmp0 (property_name, "SizeHints") == 0) {
@@ -1759,8 +1718,6 @@ set_property_cb (GDBusConnection *connection,
panel_applet_set_settings_path (applet, g_variant_get_string (value, NULL));
} else if (g_strcmp0 (property_name, "Orient") == 0) {
panel_applet_set_orient (applet, g_variant_get_uint32 (value));
- } else if (g_strcmp0 (property_name, "Background") == 0) {
- panel_applet_set_background_string (applet, g_variant_get_string (value, NULL));
} else if (g_strcmp0 (property_name, "Flags") == 0) {
panel_applet_set_flags (applet, g_variant_get_uint32 (value));
} else if (g_strcmp0 (property_name, "SizeHints") == 0) {
@@ -1789,7 +1746,6 @@ static const gchar introspection_xml[] =
"</method>"
"<property name='SettingsPath' type='s' access='readwrite'/>"
"<property name='Orient' type='u' access='readwrite' />"
- "<property name='Background' type='s' access='readwrite'/>"
"<property name='Flags' type='u' access='readwrite'/>"
"<property name='SizeHints' type='ai' access='readwrite'/>"
"<property name='LockedDown' type='b' access='readwrite'/>"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]