[Xfce4-commits] [xfce/xfce4-panel] 01/03: Drop support for Gtk2 and 4.6 plugins
noreply at xfce.org
noreply at xfce.org
Mon Sep 30 10:17:43 CEST 2019
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-panel.
commit a539b6559f07450bc2751fc3fdbe1ae31adc4015
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Wed Sep 18 15:32:51 2019 +0200
Drop support for Gtk2 and 4.6 plugins
This also means the Gtk2 API is dropped, so some panel plugins still
using the old API may need updating (e.g. panel_slice_new0 is still used
by some plugins).
---
common/panel-debug.c | 1 -
common/panel-debug.h | 17 +-
common/panel-utils.c | 47 --
configure.ac.in | 13 -
libxfce4panel/Makefile.am | 48 --
libxfce4panel/abicheck.sh | 2 +-
libxfce4panel/libxfce4panel.h | 4 -
libxfce4panel/libxfce4panel.symbols | 10 -
libxfce4panel/xfce-arrow-button.c | 159 -----
libxfce4panel/xfce-hvbox.c | 313 ----------
libxfce4panel/xfce-hvbox.h | 77 ---
libxfce4panel/xfce-panel-convenience.c | 16 -
libxfce4panel/xfce-panel-convenience.h | 1 -
libxfce4panel/xfce-panel-image.c | 153 +----
libxfce4panel/xfce-panel-macros-46.h | 666 --------------------
libxfce4panel/xfce-panel-macros.h | 2 +-
libxfce4panel/xfce-panel-plugin-provider.h | 1 -
libxfce4panel/xfce-panel-plugin.c | 41 +-
libxfce4panel/xfce-panel-plugin.h | 1 -
migrate/Makefile.am | 2 -
migrate/main.c | 26 +-
migrate/migrate-46.c | 943 -----------------------------
migrate/migrate-46.h | 35 --
panel/Makefile.am | 2 -
panel/panel-application.c | 8 -
panel/panel-base-window.c | 1 -
panel/panel-module.c | 33 +-
panel/panel-plugin-external-wrapper.c | 1 -
panel/panel-plugin-external.c | 10 +-
panel/panel-preferences-dialog.h | 1 +
panel/panel-window.c | 1 -
po/POTFILES.in | 1 -
wrapper/Makefile.am | 37 --
wrapper/main.c | 6 -
wrapper/wrapper-plug.c | 151 -----
wrapper/wrapper-plug.h | 6 -
36 files changed, 21 insertions(+), 2815 deletions(-)
diff --git a/common/panel-debug.c b/common/panel-debug.c
index 38af285..5c3cb41 100644
--- a/common/panel-debug.c
+++ b/common/panel-debug.c
@@ -46,7 +46,6 @@ static const GDebugKey panel_debug_keys[] =
{ "applicationsmenu", PANEL_DEBUG_APPLICATIONSMENU },
{ "base-window", PANEL_DEBUG_BASE_WINDOW },
{ "display-layout", PANEL_DEBUG_DISPLAY_LAYOUT },
- { "external46", PANEL_DEBUG_EXTERNAL46 },
{ "external", PANEL_DEBUG_EXTERNAL },
{ "main", PANEL_DEBUG_MAIN },
{ "module-factory", PANEL_DEBUG_MODULE_FACTORY },
diff --git a/common/panel-debug.h b/common/panel-debug.h
index 5617565..57e0768 100644
--- a/common/panel-debug.h
+++ b/common/panel-debug.h
@@ -35,15 +35,14 @@ typedef enum
PANEL_DEBUG_BASE_WINDOW = 1 << 5,
PANEL_DEBUG_DISPLAY_LAYOUT = 1 << 6,
PANEL_DEBUG_EXTERNAL = 1 << 7,
- PANEL_DEBUG_EXTERNAL46 = 1 << 8,
- PANEL_DEBUG_MAIN = 1 << 9,
- PANEL_DEBUG_MODULE = 1 << 10,
- PANEL_DEBUG_MODULE_FACTORY = 1 << 11,
- PANEL_DEBUG_POSITIONING = 1 << 12,
- PANEL_DEBUG_STRUTS = 1 << 13,
- PANEL_DEBUG_SYSTRAY = 1 << 14,
- PANEL_DEBUG_TASKLIST = 1 << 15,
- PANEL_DEBUG_PAGER = 1 << 16
+ PANEL_DEBUG_MAIN = 1 << 8,
+ PANEL_DEBUG_MODULE = 1 << 9,
+ PANEL_DEBUG_MODULE_FACTORY = 1 << 10,
+ PANEL_DEBUG_POSITIONING = 1 << 11,
+ PANEL_DEBUG_STRUTS = 1 << 12,
+ PANEL_DEBUG_SYSTRAY = 1 << 13,
+ PANEL_DEBUG_TASKLIST = 1 << 14,
+ PANEL_DEBUG_PAGER = 1 << 15
}
PanelDebugFlag;
diff --git a/common/panel-utils.c b/common/panel-utils.c
index d7fb483..b8e2239 100644
--- a/common/panel-utils.c
+++ b/common/panel-utils.c
@@ -121,55 +121,8 @@ panel_utils_show_help (GtkWindow *parent,
gboolean
panel_utils_grab_available (void)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
/* TODO fix for gtk3 */
return TRUE;
-#else
- GdkScreen *screen;
- GdkWindow *root;
- GdkGrabStatus grab_pointer = GDK_GRAB_FROZEN;
- GdkGrabStatus grab_keyboard = GDK_GRAB_FROZEN;
- gboolean grab_succeed = FALSE;
- guint i;
- GdkEventMask pointer_mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
- | GDK_POINTER_MOTION_MASK;
-
- screen = xfce_gdk_screen_get_active (NULL);
- root = gdk_screen_get_root_window (screen);
-
- /* don't try to get the grab for longer then 1/4 second */
- for (i = 0; i < (G_USEC_PER_SEC / 100 / 4); i++)
- {
- grab_keyboard = gdk_keyboard_grab (root, TRUE, GDK_CURRENT_TIME);
- if (grab_keyboard == GDK_GRAB_SUCCESS)
- {
- grab_pointer = gdk_pointer_grab (root, TRUE, pointer_mask,
- NULL, NULL, GDK_CURRENT_TIME);
- if (grab_pointer == GDK_GRAB_SUCCESS)
- {
- grab_succeed = TRUE;
- break;
- }
- }
-
- g_usleep (100);
- }
-
- /* release the grab so the gtk_menu_popup() can take it */
- if (grab_pointer == GDK_GRAB_SUCCESS)
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- if (grab_keyboard == GDK_GRAB_SUCCESS)
- gdk_keyboard_ungrab (GDK_CURRENT_TIME);
-
- if (!grab_succeed)
- {
- g_printerr (PACKAGE_NAME ": Unable to get keyboard and mouse "
- "grab. Menu popup failed.\n");
- }
-
- return grab_succeed;
-#endif
}
diff --git a/configure.ac.in b/configure.ac.in
index cb38786..76219df 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -154,14 +154,6 @@ XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.42.0])
XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.0.0])
XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [3.0])
-dnl ***********************************************************
-dnl *** Optional support for a GTK+2 version of the library ***
-dnl ***********************************************************
-XDT_CHECK_OPTIONAL_PACKAGE([GTK2],
- [gtk+-2.0], [2.20.0], [gtk2],
- [GTK+ 2 support])
-AM_CONDITIONAL([ENABLE_GTK2_LIBRARY], [test "x$GTK2_FOUND" = "xyes"])
-
dnl **********************************
dnl *** Optional GIO UNIX features ***
dnl **********************************
@@ -301,9 +293,4 @@ echo "Build Configuration:"
echo
echo "* Debug Support: $enable_debug"
echo "* GNU Visibility: $have_gnuc_visibility"
-if test x"$GTK2_FOUND" = x"yes"; then
-echo "* GTK+ 2 Support: yes"
-else
-echo "* GTK+ 2 Support: no"
-fi
echo
diff --git a/libxfce4panel/Makefile.am b/libxfce4panel/Makefile.am
index f947da0..76015ce 100644
--- a/libxfce4panel/Makefile.am
+++ b/libxfce4panel/Makefile.am
@@ -28,7 +28,6 @@ libxfce4panel_headers = \
xfce-arrow-button.h \
xfce-panel-convenience.h \
xfce-panel-macros.h \
- xfce-panel-macros-46.h \
xfce-panel-plugin.h \
xfce-panel-plugin-provider.h \
xfce-panel-image.h
@@ -74,53 +73,6 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxfce4panel-$(LIBXFCE4PANEL_VERSION_API).pc
#
-# Gtk+ 2 support library
-#
-if ENABLE_GTK2_LIBRARY
-
-lib_LTLIBRARIES += libxfce4panel-1.0.la
-
-libxfce4panel1_includedir = \
- $(includedir)/xfce4/libxfce4panel-1.0/libxfce4panel
-
-libxfce4panel1_include_HEADERS = \
- $(libxfce4panel_public_built_sources) \
- $(libxfce4panel_headers) \
- xfce-hvbox.h
-
-libxfce4panel_1_0_la_SOURCES = \
- $(libxfce4panel_built_sources) \
- $(libxfce4panel_headers) \
- libxfce4panel-config.c \
- xfce-arrow-button.c \
- xfce-hvbox.c \
- xfce-panel-convenience.c \
- xfce-panel-plugin.c \
- xfce-panel-plugin-provider.c \
- xfce-panel-image.c
-
-libxfce4panel_1_0_la_CFLAGS = \
- $(GTK2_CFLAGS) \
- $(LIBXFCE4UTIL_CFLAGS) \
- $(PLATFORM_CFLAGS)
-
-libxfce4panel_1_0_la_LDFLAGS = \
- -no-undefined \
- -export-dynamic \
- -version-info $(LIBXFCE4PANEL_VERINFO) \
- -export-symbols-regex '^[^_].*' \
- $(PLATFORM_LDFLAGS)
-
-libxfce4panel_1_0_la_LIBADD = \
- $(GTK2_LIBS) \
- $(LIBXFCE4UTIL_LIBS) \
- -lm
-
-pkgconfig_DATA += libxfce4panel-1.0.pc
-
-endif
-
-#
# Build sources
#
if MAINTAINER_MODE
diff --git a/libxfce4panel/abicheck.sh b/libxfce4panel/abicheck.sh
index aa76037..2c69d4e 100755
--- a/libxfce4panel/abicheck.sh
+++ b/libxfce4panel/abicheck.sh
@@ -20,5 +20,5 @@
trap 'rm expected-abi actual-abi' EXIT
${CPP:-cpp} -DINCLUDE_INTERNAL_SYMBOLS -DINCLUDE_VARIABLES -DALL_FILES ${srcdir:-.}/libxfce4panel.symbols | sed 's/ G_GNUC.*$//;s/ PRIVATE//;/^ *$/d;/^#/d' | sort >expected-abi
-${NM:-nm} -D -g -P .libs/libxfce4panel-1.0.so | awk '$2~/^[DRTG]$/&&$1~/^[^_]/{print $1}' | sort >actual-abi
+${NM:-nm} -D -g -P .libs/libxfce4panel-2.0.so | awk '$2~/^[DRTG]$/&&$1~/^[^_]/{print $1}' | sort >actual-abi
diff -u expected-abi actual-abi
diff --git a/libxfce4panel/libxfce4panel.h b/libxfce4panel/libxfce4panel.h
index f6b4b22..b3db478 100644
--- a/libxfce4panel/libxfce4panel.h
+++ b/libxfce4panel/libxfce4panel.h
@@ -27,11 +27,7 @@
#include <libxfce4panel/libxfce4panel-enums.h>
#include <libxfce4panel/libxfce4panel-enum-types.h>
#include <libxfce4panel/xfce-panel-macros.h>
-#include <libxfce4panel/xfce-panel-macros-46.h>
#include <libxfce4panel/xfce-arrow-button.h>
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#include <libxfce4panel/xfce-hvbox.h>
-#endif
#include <libxfce4panel/xfce-panel-convenience.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/xfce-panel-image.h>
diff --git a/libxfce4panel/libxfce4panel.symbols b/libxfce4panel/libxfce4panel.symbols
index 92e7a81..536b79a 100644
--- a/libxfce4panel/libxfce4panel.symbols
+++ b/libxfce4panel/libxfce4panel.symbols
@@ -61,16 +61,6 @@ xfce_arrow_button_set_blinking
#endif
#endif
-/* xfce-hvbox.h */
-#if IN_HEADER(__XFCE_HVBOX_H__)
-#if IN_SOURCE(__XFCE_HVBOX_C__)
-xfce_hvbox_get_orientation
-xfce_hvbox_get_type
-xfce_hvbox_new
-xfce_hvbox_set_orientation
-#endif
-#endif
-
/* xfce-panel-convenience.h */
#if IN_HEADER(__XFCE_PANEL_CONVENIENCE_H__)
#if IN_SOURCE(__XFCE_PANEL_CONVENIENCE_C__)
diff --git a/libxfce4panel/xfce-arrow-button.c b/libxfce4panel/xfce-arrow-button.c
index dc61d10..36d8b29 100644
--- a/libxfce4panel/xfce-arrow-button.c
+++ b/libxfce4panel/xfce-arrow-button.c
@@ -75,7 +75,6 @@ static void xfce_arrow_button_get_property (GObject *o
GValue *value,
GParamSpec *pspec);
static void xfce_arrow_button_dispose (GObject *object);
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean xfce_arrow_button_draw (GtkWidget *widget,
cairo_t *cr);
static void xfce_arrow_button_get_preferred_width (GtkWidget *widget,
@@ -84,12 +83,6 @@ static void xfce_arrow_button_get_preferred_width (GtkWidget *w
static void xfce_arrow_button_get_preferred_height (GtkWidget *widget,
gint *minimum_height,
gint *natural_height);
-#else
-static gboolean xfce_arrow_button_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-static void xfce_arrow_button_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
static void xfce_arrow_button_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
@@ -106,11 +99,6 @@ struct _XfceArrowButtonPrivate
/* counter to make the blinking stop when
* MAX_BLINKING_COUNT is reached */
guint blinking_counter;
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* button relief when the blinking starts */
- GtkReliefStyle last_relief;
-#endif
};
@@ -135,14 +123,9 @@ xfce_arrow_button_class_init (XfceArrowButtonClass * klass)
gobject_class->dispose = xfce_arrow_button_dispose;
gtkwidget_class = GTK_WIDGET_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtkwidget_class->draw = xfce_arrow_button_draw;
gtkwidget_class->get_preferred_width = xfce_arrow_button_get_preferred_width;
gtkwidget_class->get_preferred_height = xfce_arrow_button_get_preferred_height;
-#else
- gtkwidget_class->expose_event = xfce_arrow_button_expose_event;
- gtkwidget_class->size_request = xfce_arrow_button_size_request;
-#endif
gtkwidget_class->size_allocate = xfce_arrow_button_size_allocate;
/**
@@ -184,10 +167,8 @@ xfce_arrow_button_class_init (XfceArrowButtonClass * klass)
static void
xfce_arrow_button_init (XfceArrowButton *button)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkCssProvider *provider;
-#endif
button->priv = xfce_arrow_button_get_instance_private (button);
@@ -195,15 +176,11 @@ xfce_arrow_button_init (XfceArrowButton *button)
button->priv->arrow_type = GTK_ARROW_UP;
button->priv->blinking_timeout_id = 0;
button->priv->blinking_counter = 0;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- button->priv->last_relief = GTK_RELIEF_NORMAL;
-#endif
/* set some widget properties */
gtk_widget_set_has_window (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE);
/* Make sure themes like Adwaita, which set excessive padding, don't cause the
launcher buttons to overlap when panels have a fairly normal size */
@@ -213,9 +190,6 @@ xfce_arrow_button_init (XfceArrowButton *button)
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
-#endif
}
@@ -280,7 +254,6 @@ xfce_arrow_button_dispose (GObject *object)
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
xfce_arrow_button_draw (GtkWidget *widget,
cairo_t *cr)
@@ -450,102 +423,6 @@ xfce_arrow_button_get_preferred_height (GtkWidget *widget,
if (natural_height != NULL)
*natural_height = natural_child_height;
}
-#endif
-
-
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static gboolean
-xfce_arrow_button_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- XfceArrowButton *button = XFCE_ARROW_BUTTON (widget);
- GtkWidget *child;
- gint x, y, width;
-
- /* draw the button */
- (*GTK_WIDGET_CLASS (xfce_arrow_button_parent_class)->expose_event) (widget, event);
-
- if (button->priv->arrow_type != GTK_ARROW_NONE
- && GTK_WIDGET_DRAWABLE (widget))
- {
- child = gtk_bin_get_child (GTK_BIN (widget));
- if (child != NULL && GTK_WIDGET_VISIBLE (child))
- {
- if (button->priv->arrow_type == GTK_ARROW_UP
- || button->priv->arrow_type == GTK_ARROW_DOWN)
- {
- width = ARROW_WIDTH;
- x = widget->allocation.x + widget->style->xthickness;
- y = widget->allocation.y + (widget->allocation.height - width) / 2;
- }
- else
- {
- width = ARROW_WIDTH;
- x = widget->allocation.x + (widget->allocation.width - width) / 2;
- y = widget->allocation.y + widget->style->ythickness;
- }
- }
- else
- {
- width = MIN (widget->allocation.height - 2 * widget->style->ythickness,
- widget->allocation.width - 2 * widget->style->xthickness);
- width = CLAMP (width, 1, ARROW_WIDTH);
-
- x = widget->allocation.x + (widget->allocation.width - width) / 2;
- y = widget->allocation.y + (widget->allocation.height - width) / 2;
- }
-
- gtk_paint_arrow (widget->style, widget->window,
- GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
- &(event->area), widget, "xfce_arrow_button",
- button->priv->arrow_type, FALSE,
- x, y, width, width);
- }
-
- return TRUE;
-}
-
-
-
-static void
-xfce_arrow_button_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- XfceArrowButton *button = XFCE_ARROW_BUTTON (widget);
- GtkWidget *child;
-
- requisition->height = requisition->width = 0;
- child = gtk_bin_get_child (GTK_BIN (widget));
- if (child != NULL && GTK_WIDGET_VISIBLE (child))
- {
- /* use gtk for the widget size */
- (*GTK_WIDGET_CLASS (xfce_arrow_button_parent_class)->size_request) (widget, requisition);
-
- /* reserve space for the arrow */
- switch (button->priv->arrow_type)
- {
- case GTK_ARROW_UP:
- case GTK_ARROW_DOWN:
- requisition->width += ARROW_WIDTH;
- break;
-
- case GTK_ARROW_LEFT:
- case GTK_ARROW_RIGHT:
- requisition->height += ARROW_WIDTH;
- break;
-
- default:
- break;
- }
- }
- else if (button->priv->arrow_type != GTK_ARROW_NONE)
- {
- requisition->height = ARROW_WIDTH + 2 * widget->style->xthickness;
- requisition->width = ARROW_WIDTH + 2 * widget->style->ythickness;
- }
-}
-#endif
@@ -597,7 +474,6 @@ xfce_arrow_button_blinking_timeout (gpointer user_data)
{
XfceArrowButton *button = XFCE_ARROW_BUTTON (user_data);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStateFlags flags = gtk_widget_get_state_flags (GTK_WIDGET (button));
if ((flags & GTK_STATE_FLAG_ACTIVE) == GTK_STATE_FLAG_ACTIVE
@@ -609,27 +485,6 @@ xfce_arrow_button_blinking_timeout (gpointer user_data)
{
gtk_widget_set_state_flags (GTK_WIDGET (button), GTK_STATE_FLAG_ACTIVE, FALSE);
}
-#else
- GtkStyle *style;
- GtkRcStyle *rc;
-
- rc = gtk_widget_get_modifier_style (GTK_WIDGET (button));
- if(PANEL_HAS_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG)
- || button->priv->blinking_timeout_id == 0)
- {
- gtk_button_set_relief (GTK_BUTTON (button), button->priv->last_relief);
- PANEL_UNSET_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG);
- gtk_widget_modify_style (GTK_WIDGET (button), rc);
- }
- else
- {
- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
- PANEL_SET_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG);
- style = gtk_widget_get_style (GTK_WIDGET (button));
- rc->bg[GTK_STATE_NORMAL] = style->bg[GTK_STATE_SELECTED];
- gtk_widget_modify_style(GTK_WIDGET (button), rc);
- }
-#endif
return (button->priv->blinking_counter++ < MAX_BLINKING_COUNT);
}
@@ -641,16 +496,7 @@ xfce_arrow_button_blinking_timeout_destroyed (gpointer user_data)
{
XfceArrowButton *button = XFCE_ARROW_BUTTON (user_data);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_unset_state_flags (GTK_WIDGET (button), GTK_STATE_FLAG_ACTIVE);
-#else
- GtkRcStyle *rc;
-
- rc = gtk_widget_get_modifier_style (GTK_WIDGET (button));
- gtk_button_set_relief (GTK_BUTTON (button), button->priv->last_relief);
- PANEL_UNSET_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG);
- gtk_widget_modify_style (GTK_WIDGET (button), rc);
-#endif
button->priv->blinking_timeout_id = 0;
button->priv->blinking_counter = 0;
@@ -764,11 +610,6 @@ xfce_arrow_button_set_blinking (XfceArrowButton *button,
if (blinking)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* store the relief of the button */
- button->priv->last_relief = gtk_button_get_relief (GTK_BUTTON (button));
-#endif
-
if (button->priv->blinking_timeout_id == 0)
{
/* start blinking timeout */
diff --git a/libxfce4panel/xfce-hvbox.c b/libxfce4panel/xfce-hvbox.c
deleted file mode 100644
index 9b25523..0000000
--- a/libxfce4panel/xfce-hvbox.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * This file is partly based on OBox
- * Copyright (C) 2002 Red Hat Inc. based on GtkHBox
- *
- * Copyright (C) 2006-2007 Jasper Huijsmans <jasper at xfce.org>
- * Copyright (C) 2006 Jani Monoses <jani at ubuntu.com>
- * Copyright (C) 2007-2010 Nick Schermer <nick at xfce.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-#include <libxfce4panel/xfce-panel-macros.h>
-#include <libxfce4panel/xfce-hvbox.h>
-#include <libxfce4panel/libxfce4panel-alias.h>
-
-
-
-/**
- * SECTION: xfce-hvbox
- * @title: XfceHVBox
- * @short_description: Container widget with configurable orientation
- * @include: libxfce4panel/libxfce4panel.h
- *
- * > #XfceHVBox is deprecated and will not work with Gtk3.
- * > If your code depends on Gtk+ 2.16 or later, if it better to use
- * > the normal #GtkBox widgets in combination with
- * > gtk_orientable_set_orientation().
- *
- * #XfceHVBox is a #GtkBox widget that allows the user to change
- * its orientation. It is in fact a combination of #GtkHBox and #GtkVBox.
- *
- * See also: #GtkOrientable and #GtkBox.
- **/
-
-
-
-#if !GTK_CHECK_VERSION (2, 16, 0)
-enum
-{
- PROP_0,
- PROP_ORIENTATION
-};
-
-static void xfce_hvbox_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void xfce_hvbox_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static gpointer xfce_hvbox_get_class (XfceHVBox *hvbox);
-static void xfce_hvbox_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-static void xfce_hvbox_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-#endif
-
-
-
-G_DEFINE_TYPE (XfceHVBox, xfce_hvbox, GTK_TYPE_BOX)
-
-
-
-static void
-xfce_hvbox_class_init (XfceHVBoxClass *klass)
-{
-#if !GTK_CHECK_VERSION (2, 16, 0)
- GObjectClass *gobject_class;
- GtkWidgetClass *gtkwidget_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->get_property = xfce_hvbox_get_property;
- gobject_class->set_property = xfce_hvbox_set_property;
-
- gtkwidget_class = GTK_WIDGET_CLASS (klass);
- gtkwidget_class->size_request = xfce_hvbox_size_request;
- gtkwidget_class->size_allocate = xfce_hvbox_size_allocate;
-
- /**
- * XfceHVBox:orientation:
- *
- * The orientation of the #XfceHVBox. When compiled with Gtk+ 2.16,
- * this is the orientation property of the #GtkOrientable.
- **/
- g_object_class_install_property (gobject_class,
- PROP_ORIENTATION,
- g_param_spec_enum ("orientation",
- "Orientation",
- "Orientation of the box",
- GTK_TYPE_ORIENTATION,
- GTK_ORIENTATION_HORIZONTAL,
- G_PARAM_READWRITE
- | G_PARAM_STATIC_STRINGS));
-#endif
-}
-
-
-
-static void
-xfce_hvbox_init (XfceHVBox *hvbox)
-{
- /* initialize variables */
- hvbox->orientation = GTK_ORIENTATION_HORIZONTAL;
-}
-
-
-
-#if !GTK_CHECK_VERSION (2, 16, 0)
-static void
-xfce_hvbox_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- XfceHVBox *hvbox = XFCE_HVBOX (object);
-
- switch (prop_id)
- {
- case PROP_ORIENTATION:
- g_value_set_enum (value, hvbox->orientation);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_hvbox_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- XfceHVBox *hvbox = XFCE_HVBOX (object);
-
- switch (prop_id)
- {
- case PROP_ORIENTATION:
- xfce_hvbox_set_orientation (hvbox, g_value_get_enum (value));
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static gpointer
-xfce_hvbox_get_class (XfceHVBox *hvbox)
-{
- GType type;
- gpointer klass;
-
- if (hvbox->orientation == GTK_ORIENTATION_HORIZONTAL)
- type = GTK_TYPE_HBOX;
- else
- type = GTK_TYPE_VBOX;
-
- /* peek the class, this only works if the class already exists */
- klass = g_type_class_peek (type);
-
- /* return the type or create the class */
- return klass ? klass : g_type_class_ref (type);
-}
-
-
-
-static void
-xfce_hvbox_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- gpointer klass;
-
- /* get the widget class */
- klass = xfce_hvbox_get_class (XFCE_HVBOX (widget));
-
- /* request the size */
- (*GTK_WIDGET_CLASS (klass)->size_request) (widget, requisition);
-}
-
-
-
-static void
-xfce_hvbox_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- gpointer klass;
-
- /* get the widget class */
- klass = xfce_hvbox_get_class (XFCE_HVBOX (widget));
-
- /* allocate the size */
- (*GTK_WIDGET_CLASS (klass)->size_allocate) (widget, allocation);
-}
-#endif
-
-
-
-/**
- * xfce_hvbox_new:
- * @orientation : Orientation of the #XfceHVBox
- * @homogeneous : whether all children should be allocated the same size
- * @spacing : spacing between #XfceHVBox children
- *
- * Creates a new #XfceHVBox container widget.
- *
- * Deprecated: 4.14: Use gtk_box_new() instead
- *
- * Returns: the newly allocated #XfceHVBox container widget.
- **/
-GtkWidget *
-xfce_hvbox_new (GtkOrientation orientation,
- gboolean homogeneous,
- gint spacing)
-{
- XfceHVBox *box;
-
- /* create new object */
- box = g_object_new (XFCE_TYPE_HVBOX,
-#if GTK_CHECK_VERSION (2, 16, 0)
- "orientation", orientation,
-#endif
- "homogeneous", homogeneous,
- "spacing", spacing, NULL);
-
- /* store the orientation */
- box->orientation = orientation;
-
- return GTK_WIDGET (box);
-}
-
-
-
-/**
- * xfce_hvbox_set_orientation:
- * @hvbox : #XfceHVBox
- * @orientation : the new orientation of the #XfceHVBox
- *
- * Set the new orientation of the #XfceHVBox container widget.
- *
- * Deprecated: 4.14: Use gtk_orientable_set_orientation() instead
- **/
-void
-xfce_hvbox_set_orientation (XfceHVBox *hvbox,
- GtkOrientation orientation)
-{
- g_return_if_fail (XFCE_IS_HVBOX (hvbox));
-
- if (G_LIKELY (hvbox->orientation != orientation))
- {
- /* store new orientation */
- hvbox->orientation = orientation;
-
-#if GTK_CHECK_VERSION (2, 16, 0)
- gtk_orientable_set_orientation (GTK_ORIENTABLE (hvbox), orientation);
-#else
- gtk_widget_queue_resize (GTK_WIDGET (hvbox));
-#endif
- }
-}
-
-
-
-/**
- * xfce_hvbox_get_orientation:
- * @hvbox : #XfceHVBox
- *
- * Get the current orientation of the @hvbox.
- *
- * Deprecated: 4.14: Use gtk_orientable_get_orientation() instead
- *
- * Returns: the current orientation of the #XfceHVBox.
- **/
-GtkOrientation
-xfce_hvbox_get_orientation (XfceHVBox *hvbox)
-{
- g_return_val_if_fail (XFCE_IS_HVBOX (hvbox), GTK_ORIENTATION_HORIZONTAL);
-
-#if GTK_CHECK_VERSION (2, 16, 0)
- return gtk_orientable_get_orientation (GTK_ORIENTABLE (hvbox));
-#else
- return hvbox->orientation;
-#endif
-}
-
-
-
-#define __XFCE_HVBOX_C__
-#include <libxfce4panel/libxfce4panel-aliasdef.c>
diff --git a/libxfce4panel/xfce-hvbox.h b/libxfce4panel/xfce-hvbox.h
deleted file mode 100644
index f3b464c..0000000
--- a/libxfce4panel/xfce-hvbox.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * This file is partly based on OBox
- * Copyright (C) 2002 Red Hat Inc. based on GtkHBox
- *
- * Copyright (C) 2006-2007 Jasper Huijsmans <jasper at xfce.org>
- * Copyright (C) 2006 Jani Monoses <jani at ubuntu.com>
- * Copyright (C) 2007-2010 Nick Schermer <nick at xfce.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* #if !defined(LIBXFCE4PANEL_INSIDE_LIBXFCE4PANEL_H) && !defined(LIBXFCE4PANEL_COMPILATION)
-#error "Only <libxfce4panel/libxfce4panel.h> can be included directly, this file may disappear or change contents"
-#endif */
-
-#ifndef __XFCE_HVBOX_H__
-#define __XFCE_HVBOX_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-typedef struct _XfceHVBoxClass XfceHVBoxClass;
-typedef struct _XfceHVBox XfceHVBox;
-
-#define XFCE_TYPE_HVBOX (xfce_hvbox_get_type())
-#define XFCE_HVBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, XFCE_TYPE_HVBOX, XfceHVBox))
-#define XFCE_HVBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, XFCE_TYPE_HVBOX, XfceHVBoxClass))
-#define XFCE_IS_HVBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, XFCE_TYPE_HVBOX))
-#define XFCE_IS_HVBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_HVBOX))
-#define XFCE_HVBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_HVBOX, XfceHVBoxClass))
-
-struct _XfceHVBoxClass
-{
- /*< private >*/
- GtkBoxClass __parent__;
-};
-
-/**
- * XfceHVBox:
- *
- * This struct contain private data only and should be accessed by
- * the functions below.
- **/
-struct _XfceHVBox
-{
- /*< private >*/
- GtkBox __parent__;
-
- GtkOrientation orientation;
-};
-
-GType xfce_hvbox_get_type (void) G_GNUC_CONST;
-
-GtkWidget *xfce_hvbox_new (GtkOrientation orientation,
- gboolean homogeneous,
- gint spacing) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-
-void xfce_hvbox_set_orientation (XfceHVBox *hvbox,
- GtkOrientation orientation);
-GtkOrientation xfce_hvbox_get_orientation (XfceHVBox *hvbox);
-
-G_END_DECLS
-
-#endif /* !__XFCE_HVBOX_H__ */
diff --git a/libxfce4panel/xfce-panel-convenience.c b/libxfce4panel/xfce-panel-convenience.c
index be8679d..3adc86a 100644
--- a/libxfce4panel/xfce-panel-convenience.c
+++ b/libxfce4panel/xfce-panel-convenience.c
@@ -56,22 +56,15 @@ GtkWidget *
xfce_panel_create_button (void)
{
GtkWidget *button = gtk_button_new ();
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkCssProvider *provider;
-#endif
gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
-#endif
gtk_widget_set_name (button, "xfce-panel-button");
-#if GTK_CHECK_VERSION (3, 0, 0)
/* Make sure themes like Adwaita, which set excessive padding, don't cause the
launcher buttons to overlap when panels have a fairly normal size */
context = gtk_widget_get_style_context (GTK_WIDGET (button));
@@ -80,7 +73,6 @@ xfce_panel_create_button (void)
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#endif
return button;
}
@@ -98,24 +90,17 @@ xfce_panel_create_button (void)
GtkWidget *
xfce_panel_create_toggle_button (void)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkCssProvider *provider;
-#endif
GtkWidget *button = gtk_toggle_button_new ();
gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
-#endif
gtk_widget_set_name (button, "xfce-panel-toggle-button");
-#if GTK_CHECK_VERSION (3, 0, 0)
/* Make sure themes like Adwaita, which set excessive padding, don't cause the
launcher buttons to overlap when panels have a fairly normal size */
context = gtk_widget_get_style_context (GTK_WIDGET (button));
@@ -124,7 +109,6 @@ xfce_panel_create_toggle_button (void)
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#endif
return button;
}
diff --git a/libxfce4panel/xfce-panel-convenience.h b/libxfce4panel/xfce-panel-convenience.h
index a16ee24..852814b 100644
--- a/libxfce4panel/xfce-panel-convenience.h
+++ b/libxfce4panel/xfce-panel-convenience.h
@@ -23,7 +23,6 @@
#define __XFCE_PANEL_CONVENIENCE_H__
#include <gtk/gtk.h>
-#include <libxfce4panel/xfce-panel-macros-46.h>
G_BEGIN_DECLS
diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index bc96016..23eca62 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -114,32 +114,17 @@ static void xfce_panel_image_set_property (GObject *object
const GValue *value,
GParamSpec *pspec);
static void xfce_panel_image_finalize (GObject *object);
-#if GTK_CHECK_VERSION (3, 0, 0)
static void xfce_panel_image_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
gint *natural_width);
static void xfce_panel_image_get_preferred_height (GtkWidget *widget,
gint *minimum_height,
gint *natural_height);
-#else
-static void xfce_panel_image_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
static void xfce_panel_image_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean xfce_panel_image_draw (GtkWidget *widget,
cairo_t *cr);
-#else
-static gboolean xfce_panel_image_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
static void xfce_panel_image_style_updated (GtkWidget *widget);
-#else
-static void xfce_panel_image_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
-#endif
static gboolean xfce_panel_image_load (gpointer data);
static void xfce_panel_image_load_destroy (gpointer data);
static GdkPixbuf *xfce_panel_image_scale_pixbuf (GdkPixbuf *source,
@@ -164,20 +149,11 @@ xfce_panel_image_class_init (XfcePanelImageClass *klass)
gobject_class->finalize = xfce_panel_image_finalize;
gtkwidget_class = GTK_WIDGET_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtkwidget_class->get_preferred_width = xfce_panel_image_get_preferred_width;
gtkwidget_class->get_preferred_height = xfce_panel_image_get_preferred_height;
-#else
- gtkwidget_class->size_request = xfce_panel_image_size_request;
-#endif
gtkwidget_class->size_allocate = xfce_panel_image_size_allocate;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtkwidget_class->draw = xfce_panel_image_draw;
gtkwidget_class->style_updated = xfce_panel_image_style_updated;
-#else
- gtkwidget_class->expose_event = xfce_panel_image_expose_event;
- gtkwidget_class->style_set = xfce_panel_image_style_set;
-#endif
g_object_class_install_property (gobject_class,
PROP_SOURCE,
@@ -306,9 +282,7 @@ xfce_panel_image_finalize (GObject *object)
-#if GTK_CHECK_VERSION (3, 0, 0)
#define GTK_BUTTON_SIZING_FIX
-#endif
#ifdef GTK_BUTTON_SIZING_FIX
/* When can_focus is true, GtkButton allocates larger size than requested *
@@ -347,7 +321,7 @@ xfce_panel_image_padding_correction (GtkWidget *widget)
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
+
static void
xfce_panel_image_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
@@ -421,34 +395,6 @@ xfce_panel_image_get_preferred_height (GtkWidget *widget,
if (natural_height != NULL)
*natural_height = height;
}
-#endif
-
-
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-xfce_panel_image_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
-
- if (priv->size > 0)
- {
- requisition->width = priv->size;
- requisition->height = priv->size;
- }
- else if (priv->pixbuf != NULL)
- {
- requisition->width = gdk_pixbuf_get_width (priv->pixbuf);
- requisition->height = gdk_pixbuf_get_height (priv->pixbuf);
- }
- else
- {
- requisition->width = widget->allocation.width;
- requisition->height = widget->allocation.height;
- }
-}
-#endif
@@ -490,7 +436,6 @@ xfce_panel_image_size_allocate (GtkWidget *widget,
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
xfce_panel_image_draw (GtkWidget *widget,
cairo_t *cr)
@@ -537,69 +482,9 @@ xfce_panel_image_draw (GtkWidget *widget,
return FALSE;
}
-#endif
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static gboolean
-xfce_panel_image_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
- gint source_width, source_height;
- gint dest_x, dest_y;
- GtkIconSource *source;
- GdkPixbuf *rendered = NULL;
- GdkPixbuf *pixbuf = priv->cache;
- cairo_t *cr;
-
- if (G_LIKELY (pixbuf != NULL))
- {
- /* get the size of the cache pixbuf */
- source_width = gdk_pixbuf_get_width (pixbuf);
- source_height = gdk_pixbuf_get_height (pixbuf);
-
- /* position */
- dest_x = widget->allocation.x + (priv->width - source_width) / 2;
- dest_y = widget->allocation.y + (priv->height - source_height) / 2;
-
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
- {
- source = gtk_icon_source_new ();
- gtk_icon_source_set_pixbuf (source, pixbuf);
-
- rendered = gtk_style_render_icon (widget->style,
- source,
- gtk_widget_get_direction (widget),
- GTK_WIDGET_STATE (widget),
- -1, widget, "xfce-panel-image");
- gtk_icon_source_free (source);
-
- if (G_LIKELY (rendered != NULL))
- pixbuf = rendered;
- }
-
- /* draw the pixbuf */
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
- if (G_LIKELY (cr != NULL))
- {
- gdk_cairo_set_source_pixbuf (cr, pixbuf, dest_x, dest_y);
- cairo_paint (cr);
- cairo_destroy (cr);
- }
-
- if (rendered != NULL)
- g_object_unref (G_OBJECT (rendered));
- }
-
- return FALSE;
-}
-#endif
-
-
-
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
xfce_panel_image_style_updated (GtkWidget *widget)
{
@@ -631,42 +516,6 @@ xfce_panel_image_style_updated (GtkWidget *widget)
gtk_widget_queue_resize (widget);
}
}
-#endif
-
-
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-xfce_panel_image_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
- gboolean force;
-
- /* let gtk update the widget style */
- (*GTK_WIDGET_CLASS (xfce_panel_image_parent_class)->style_set) (widget, previous_style);
-
- /* get style property */
- gtk_widget_style_get (widget, "force-gtk-icon-sizes", &force, NULL);
-
- /* update if needed */
- if (priv->force_icon_sizes != force)
- {
- priv->force_icon_sizes = force;
- if (priv->size > 0)
- gtk_widget_queue_resize (widget);
- }
-
- /* update the icon if we have an icon-name source */
- if (previous_style != NULL && priv->source != NULL
- && !g_path_is_absolute (priv->source))
- {
- /* unset the size to force an update */
- priv->width = priv->height = -1;
- gtk_widget_queue_resize (widget);
- }
-}
-#endif
diff --git a/libxfce4panel/xfce-panel-macros-46.h b/libxfce4panel/xfce-panel-macros-46.h
deleted file mode 100644
index 7282df2..0000000
--- a/libxfce4panel/xfce-panel-macros-46.h
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
- * Copyright (C) 2009-2010 Nick Schermer <nick at xfce.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-#ifndef __LIBXFCE4PANEL_DEPRECATED_H__
-#define __LIBXFCE4PANEL_DEPRECATED_H__
-
-#include <libxfce4panel/xfce-panel-plugin-provider.h>
-#include <gdk/gdkx.h>
-#include <stdlib.h>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: register-46-plugins
- * @title: Panel Plugin Register Macros (4.6 Style)
- * @short_description: The 4.6 way of registering plugins that compiled as executables
- * @include: libxfce4panel/libxfce4panel.h
- *
- * Macros to register old external panel plugins that are compiled as executables.
- **/
-
-
-/*< private >*/
-#define _PANEL_CLIENT_EVENT_ATOM "XFCE4_PANEL_PLUGIN_46"
-
-
-/**
- * panel_slice_alloc:
- * @block_size : the number of bytes to allocate
- *
- * See g_slice_alloc() for more information.
- *
- * Returns: a pointer to the allocated memory block
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use g_slice_alloc() instead.
- **/
-#define panel_slice_alloc(block_size) (g_slice_alloc ((block_size)))
-
-/**
- * panel_slice_alloc0:
- * @block_size : the number of bytes to allocate
- *
- * See g_slice_alloc0() for more information.
- *
- * Returns: a pointer to the allocated memory block
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use g_slice_alloc0() instead.
- **/
-#define panel_slice_alloc0(block_size) (g_slice_alloc0 ((block_size)))
-
-/**
- * panel_slice_free1:
- * @block_size : the size of the block
- * @mem_block : a pointer to the block to free
- *
- * See g_slice_free1() for more information.
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use g_slice_free1() instead.
- **/
-#define panel_slice_free1(block_size, mem_block) G_STMT_START{ g_slice_free1 ((block_size), (mem_block)); }G_STMT_END
-
-/**
- * panel_slice_new:
- * @type : the type to allocate, typically a structure name
- *
- * See g_slice_new() for more information.
- *
- * Returns: a pointer to the allocated memory block
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use g_slice_new() instead.
- **/
-#define panel_slice_new(type) (g_slice_new (type))
-
-/**
- * panel_slice_new0:
- * @type : the type to allocate, typically a structure name
- *
- * See g_slice_new0() for more information.
- *
- * Returns: a pointer to the allocated memory block
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use g_slice_new0() instead.
- **/
-#define panel_slice_new0(type) (g_slice_new0 (type))
-
-/**
- * panel_slice_free:
- * @type : the type to allocate, typically a structure name
- * @ptr : a pointer to the block to free
- *
- * See g_slice_free() for more information.
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use g_slice_free() instead.
- **/
-#define panel_slice_free(type, ptr) G_STMT_START{ g_slice_free (type, (ptr)); }G_STMT_END
-
-
-
-/**
- * PANEL_PARAM_READABLE:
- *
- * Macro for #G_PARAM_READABLE with static strings.
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use #G_PARAM_READABLE
- * | #G_PARAM_STATIC_STRINGS instead.
- **/
-#define PANEL_PARAM_READABLE (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
-
-/**
- * PANEL_PARAM_WRITABLE:
- *
- * Macro for #PANEL_PARAM_WRITABLE with static strings.
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use #G_PARAM_WRITABLE
- * | #G_PARAM_STATIC_STRINGS instead.
- **/
-#define PANEL_PARAM_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
-
-/**
- * PANEL_PARAM_READWRITE:
- *
- * Macro for #G_PARAM_READWRITE with static strings.
- *
- * Deprecated: 4.8: Deprecated because panel depends on recent enough
- * version of glib. Use #G_PARAM_READWRITE
- * | #G_PARAM_STATIC_STRINGS instead.
- **/
-#define PANEL_PARAM_READWRITE (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
-
-#define _panel_assert(expr) g_assert (expr)
-#define _panel_assert_not_reached() g_assert_not_reached ()
-#define _panel_return_if_fail(expr) g_return_if_fail (expr)
-#define _panel_return_val_if_fail(expr, val) g_return_val_if_fail (expr, (val))
-
-
-/**
- * xfce_create_panel_button:
- *
- * See xfce_panel_create_button() for more information.
- *
- * Deprecated: 4.8: Use xfce_panel_create_button() instead.
- **/
-#define xfce_create_panel_button xfce_panel_create_button
-
-/**
- * xfce_create_panel_toggle_button:
- *
- * See xfce_panel_create_toggle_button() for more information.
- *
- * Deprecated: 4.8: Use xfce_panel_create_toggle_button() instead.
- **/
-#define xfce_create_panel_toggle_button xfce_panel_create_toggle_button
-
-/**
- * xfce_panel_plugin_set_panel_hidden:
- * @plugin : an #XfcePanelPlugin.
- * @hidden : new blocking state of this plugin.
- *
- * See xfce_panel_plugin_block_autohide() for more information.
- *
- * Deprecated: 4.8: Use xfce_panel_plugin_block_autohide() instead.
- **/
-#define xfce_panel_plugin_set_panel_hidden(plugin, hidden) \
- xfce_panel_plugin_block_autohide(plugin,hidden)
-
-/**
- * xfce_allow_panel_customization:
- *
- * Always returns %FALSE. Plugins can be locked on a plugin basis
- * level in the future, so this function is useless.
- *
- * Deprecated: 4.8: Look at xfce_panel_plugin_get_locked().
- **/
-#define xfce_allow_panel_customization (FALSE)
-
-/* <private >*/
-#define _panel_g_type_register_simple(type_parent,type_name_static,class_size,class_init,instance_size,instance_init) \
- g_type_register_static_simple(type_parent,type_name_static,class_size,class_init,instance_size,instance_init, 0)
-
-/**
- * XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL:
- * @construct_func : name of a function that can be cast to an
- * #XfcePanelPluginFunc
- *
- * Registers and initializes the plugin. This is the only thing that is
- * required to create a panel plugin.
- *
- * Deprecated: 4.8: Deprecation is not entirely true, but it should be made
- * clear that it is recommended to use XFCE_PANEL_PLUGIN_REGISTER().
- * See the <link linkend="libxfce4panel-register">Registering Plugins</link>
- * for more information.
- **/
-#define XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(construct_func) \
- XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_FULL (construct_func, NULL, NULL)
-
-/**
- * XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_WITH_CHECK:
- * @construct_func : name of a function that can be cast to an
- * #XfcePanelPluginFunc
- * @check_func : name of a function that can be cast to an
- * #XfcePanelPluginCheck or %NULL
- *
- * Registers and initializes the plugin. This is the only thing that is
- * required to create a panel plugin. The @check functions is run before
- * creating the plugin, and should return FALSE if plugin creation is not
- * possible.
- *
- * Deprecated: 4.8: Deprecation is not entirely true, but it should be made
- * clear that it is recommended to use XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK().
- * See the <link linkend="libxfce4panel-register">Registering Plugins</link>
- * for more information.
- **/
-#define XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_WITH_CHECK(construct_func ,check_func) \
- XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_FULL (construct_func, NULL, check_func)
-
-/**
- * XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_FULL:
- * @construct_func : name of a function that can be cast to an
- * #XfcePanelPluginFunc
- * @preinit_func : name of a function that can be case to #XfcePanelPluginPreInit
- * or %NULL
- * @check_func : name of a function that can be cast to an
- * #XfcePanelPluginCheck or %NULL
- *
- * Same as XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_WITH_CHECK(), but with a
- * preinit function that is called before gtk_init(). This allows plugins
- * to initialize libraries or threads.
- *
- * Since: 4.6
- * Deprecated: 4.8: Deprecation is not entirely true, but it should be made
- * clear that it is recommended to use XFCE_PANEL_PLUGIN_REGISTER_FULL().
- * See the <link linkend="libxfce4panel-register">Registering Plugins</link>
- * for more information.
- **/
-#define XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_FULL(construct_func, preinit_func, check_func) \
- static GdkAtom _xpp_atom = GDK_NONE; \
- static gdouble _xpp_alpha = 1.00; \
- static guint _xpp_bg_style = 0; \
- static GdkColor _xpp_bg_color = { 0, }; \
- static const gchar *_xpp_bg_image = NULL; \
- static cairo_pattern_t *_xpp_bg_image_cache = NULL; \
- static gboolean _xpp_debug = FALSE; \
- static gint _xpp_retval = PLUGIN_EXIT_FAILURE; \
- \
- static void \
- _xpp_quit_main_loop (void) \
- { \
- static gboolean quitting = FALSE; \
- \
- if (!quitting) \
- { \
- quitting = TRUE; \
- gtk_main_quit (); \
- } \
- } \
- \
- static gboolean \
- _xpp_client_event (GtkWidget *plug, \
- GdkEventClient *event, \
- XfcePanelPlugin *xpp) \
- { \
- XfcePanelPluginProvider *provider = XFCE_PANEL_PLUGIN_PROVIDER (xpp); \
- gint value; \
- XfcePanelPluginProviderPropType type; \
- \
- g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (xpp), TRUE); \
- g_return_val_if_fail (GTK_IS_PLUG (plug), TRUE); \
- g_return_val_if_fail (_xpp_atom != GDK_NONE, TRUE); \
- g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (xpp), TRUE); \
- \
- if (event->message_type == _xpp_atom) \
- { \
- type = event->data.s[0]; \
- value = event->data.s[1]; \
- \
- switch (type) \
- { \
- case PROVIDER_PROP_TYPE_ACTION_REMOVED: \
- xfce_panel_plugin_provider_removed (provider); \
- break; \
- \
- case PROVIDER_PROP_TYPE_ACTION_SAVE: \
- xfce_panel_plugin_provider_save (provider); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_BACKGROUND_ALPHA: \
- _xpp_alpha = value / 100.00; \
- if (gtk_widget_is_composited (plug)) \
- gtk_widget_queue_draw (plug); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_LOCKED: \
- xfce_panel_plugin_provider_set_locked (provider, !!value); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_MODE: \
- xfce_panel_plugin_provider_set_mode (provider, value); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_NROWS: \
- xfce_panel_plugin_provider_set_nrows (provider, value); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_SCREEN_POSITION: \
- xfce_panel_plugin_provider_set_screen_position (provider, value); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_SENSITIVE: \
- gtk_widget_set_sensitive (plug, !!value); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_SIZE: \
- xfce_panel_plugin_provider_set_size (provider, value); \
- break; \
- \
- case PROVIDER_PROP_TYPE_ACTION_SHOW_ABOUT: \
- xfce_panel_plugin_provider_show_about (provider); \
- break; \
- \
- case PROVIDER_PROP_TYPE_ACTION_SHOW_CONFIGURE: \
- xfce_panel_plugin_provider_show_configure (provider); \
- break; \
- \
- case PROVIDER_PROP_TYPE_ACTION_QUIT_FOR_RESTART: \
- _xpp_retval = PLUGIN_EXIT_SUCCESS_AND_RESTART; \
- case PROVIDER_PROP_TYPE_ACTION_QUIT: \
- _xpp_quit_main_loop (); \
- break; \
- \
- case PROVIDER_PROP_TYPE_SET_BACKGROUND_COLOR: \
- _xpp_bg_color.red = event->data.s[1]; \
- _xpp_bg_color.green = event->data.s[2]; \
- _xpp_bg_color.blue = event->data.s[3]; \
- _xpp_bg_style = 1; \
- gtk_widget_queue_draw (plug); \
- break; \
- \
- case PROVIDER_PROP_TYPE_ACTION_BACKGROUND_UNSET: \
- _xpp_bg_style = 0; \
- gtk_widget_queue_draw (plug); \
- break; \
- \
- case PROVIDER_PROP_TYPE_ACTION_ASK_REMOVE: \
- xfce_panel_plugin_provider_ask_remove (provider); \
- break; \
- \
- default: \
- g_warning ("Received unknow client event %u", type); \
- break; \
- } \
- \
- return FALSE; \
- } \
- \
- return TRUE; \
- } \
- \
- static void \
- _xpp_provider_signal (GtkWidget *xpp, \
- guint message, \
- GtkWidget *plug) \
- { \
- GdkEventClient event; \
- GdkWindow *window; \
- gint result; \
- \
- g_return_if_fail (GTK_IS_PLUG (plug)); \
- g_return_if_fail (XFCE_IS_PANEL_PLUGIN (xpp)); \
- g_return_if_fail (gtk_widget_get_realized (plug)); \
- g_return_if_fail (_xpp_atom != GDK_NONE); \
- g_return_if_fail (gtk_widget_get_realized (xpp)); \
- \
- if (_xpp_debug) \
- g_printerr ("xfce4-panel(%s): send provider signal %d\n", \
- xfce_panel_plugin_get_name (XFCE_PANEL_PLUGIN (xpp)), message); \
- \
- event.type = GDK_CLIENT_EVENT; \
- event.window = gtk_widget_get_window (plug); \
- event.send_event = TRUE; \
- event.message_type = _xpp_atom; \
- event.data_format = 16; \
- event.data.s[0] = message; \
- event.data.s[1] = 0; \
- \
- window = gtk_plug_get_socket_window (GTK_PLUG (plug)); \
- g_return_if_fail (GDK_IS_WINDOW (window)); \
- \
- gdk_error_trap_push (); \
- gdk_event_send_client_message ((GdkEvent *) &event, GDK_WINDOW_XID (window)); \
- gdk_flush (); \
- result = gdk_error_trap_pop (); \
- if (G_UNLIKELY (result != 0)) \
- g_warning ("Failed to send provider-signal %d: X error code %d", message, result); \
- } \
- \
- static void \
- _xpp_realize (XfcePanelPlugin *xpp, \
- GtkPlug *plug) \
- { \
- GtkWidget *ebox; \
- \
- g_return_if_fail (XFCE_IS_PANEL_PLUGIN (xpp)); \
- g_return_if_fail (GTK_IS_PLUG (plug)); \
- g_return_if_fail (gtk_widget_get_realized (plug)); \
- \
- if (_xpp_debug) \
- g_printerr ("xfce4-panel(%s): calling plugin construct function\n", \
- xfce_panel_plugin_get_name (xpp)); \
- \
- g_signal_handlers_disconnect_by_func (G_OBJECT (xpp), \
- G_CALLBACK (_xpp_realize), NULL); \
- \
- g_signal_connect (G_OBJECT (xpp), "provider-signal", \
- G_CALLBACK (_xpp_provider_signal), plug); \
- \
- ((XfcePanelPluginFunc) construct_func) (xpp); \
- \
- ebox = gtk_bin_get_child (GTK_BIN (xpp)); \
- if (ebox != NULL && GTK_IS_EVENT_BOX (ebox)) \
- gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE); \
- } \
- \
- static gboolean \
- _xpp_expose_event (GtkWidget *plug, \
- GdkEventExpose *event) \
- { \
- cairo_t *cr; \
- const GdkColor *color; \
- gdouble real_alpha; \
- GdkPixbuf *pixbuf; \
- GError *error = NULL; \
- \
- if (!GTK_WIDGET_DRAWABLE (plug)) \
- return FALSE; \
- \
- if (G_UNLIKELY (_xpp_bg_style == 2)) \
- { \
- cr = gdk_cairo_create (gtk_widget_get_window (plug)); \
- cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); \
- gdk_cairo_rectangle (cr, &event->area); \
- cairo_clip (cr); \
- \
- if (G_LIKELY (_xpp_bg_image_cache != NULL)) \
- { \
- cairo_set_source (cr, _xpp_bg_image_cache); \
- cairo_paint (cr); \
- } \
- else \
- { \
- /* load the image in a pixbuf */ \
- pixbuf = gdk_pixbuf_new_from_file (_xpp_bg_image, &error); \
- if (G_LIKELY (pixbuf != NULL)) \
- { \
- gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); \
- g_object_unref (G_OBJECT (pixbuf)); \
- \
- _xpp_bg_image_cache = cairo_get_source (cr); \
- cairo_pattern_reference (_xpp_bg_image_cache); \
- cairo_pattern_set_extend (_xpp_bg_image_cache, CAIRO_EXTEND_REPEAT); \
- cairo_paint (cr); \
- } \
- else \
- { \
- /* print error message */ \
- g_warning ("Background image disabled, \"%s\" could not be loaded: %s", \
- _xpp_bg_image, error != NULL ? error->message : "No error"); \
- g_error_free (error); \
- \
- /* disable background image */ \
- _xpp_bg_style = 0; \
- } \
- } \
- \
- cairo_destroy (cr); \
- } \
- else \
- { \
- real_alpha = gtk_widget_is_composited (plug) ? _xpp_alpha : 1.00; \
- \
- if (_xpp_bg_style == 1 || real_alpha < 1.00) \
- { \
- if (G_LIKELY (_xpp_bg_style == 0)) \
- color = &(gtk_widget_get_style (plug)->bg[GTK_STATE_NORMAL]); \
- else \
- color = &_xpp_bg_color; \
- \
- cr = gdk_cairo_create (gtk_widget_get_window (plug)); \
- cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); \
- cairo_set_source_rgba (cr, \
- color->red / 65535.00, \
- color->green / 65535.00, \
- color->blue / 65535.00, \
- real_alpha); \
- gdk_cairo_rectangle (cr, &event->area); \
- cairo_fill (cr); \
- cairo_destroy (cr); \
- } \
- } \
- \
- return FALSE; \
- } \
- \
- static void \
- _xpp_plug_embedded (GtkPlug *plug) \
- { \
- g_return_if_fail (GTK_IS_PLUG (plug)); \
- \
- if (!gtk_plug_get_embedded (plug)) \
- _xpp_quit_main_loop (); \
- } \
- \
- gint \
- main (gint argc, gchar **argv) \
- { \
- GtkWidget *plug; \
- GdkScreen *screen; \
- GtkWidget *xpp; \
- gint unique_id; \
- GdkNativeWindow socket_id; \
- GdkColormap *colormap = NULL; \
- const gchar *value; \
- gchar *base_name; \
- \
- value = g_getenv ("PANEL_DEBUG"); \
- if (G_UNLIKELY (value != NULL)) \
- { \
- _xpp_debug = TRUE; \
- \
- base_name = g_filename_display_basename (argv[0]);\
- g_printerr ("xfce4-panel(%s): compiled against libxfce4panel %s\n", \
- base_name, LIBXFCE4PANEL_VERSION); \
- g_free (base_name); \
- } \
- \
- if (G_UNLIKELY (argc < PLUGIN_ARGV_ARGUMENTS)) \
- { \
- g_critical ("Not enough arguments are passed to the plugin"); \
- return PLUGIN_EXIT_ARGUMENTS_FAILED; \
- } \
- \
- if (G_UNLIKELY (preinit_func != NULL)) \
- { \
- if (!((XfcePanelPluginPreInit) preinit_func) (argc, argv)) \
- return PLUGIN_EXIT_PREINIT_FAILED; \
- } \
- \
- gtk_init (&argc, &argv); \
- \
- if (check_func != NULL) \
- { \
- screen = gdk_screen_get_default (); \
- if (!((XfcePanelPluginCheck) check_func) (screen)) \
- return PLUGIN_EXIT_CHECK_FAILED; \
- } \
- \
- _xpp_atom = gdk_atom_intern_static_string (_PANEL_CLIENT_EVENT_ATOM); \
- \
- socket_id = strtol (argv[PLUGIN_ARGV_SOCKET_ID], NULL, 0); \
- plug = gtk_plug_new (socket_id); \
- gtk_widget_set_name (GTK_WIDGET (plug), "XfcePanelWindowExternal"); \
- g_signal_connect (G_OBJECT (plug), "embedded", \
- G_CALLBACK (_xpp_plug_embedded), NULL); \
- g_signal_connect (G_OBJECT (plug), "expose-event", \
- G_CALLBACK (_xpp_expose_event), NULL); \
- \
- gtk_widget_set_app_paintable (plug, TRUE); \
- \
- screen = gtk_widget_get_screen (plug); \
- colormap = gdk_screen_get_rgba_colormap (screen); \
- if (colormap != NULL) \
- gtk_widget_set_colormap (plug, colormap); \
- \
- unique_id = strtol (argv[PLUGIN_ARGV_UNIQUE_ID], NULL, 0); \
- xpp = g_object_new (XFCE_TYPE_PANEL_PLUGIN, \
- "name", argv[PLUGIN_ARGV_NAME], \
- "unique-id", unique_id, \
- "display-name", argv[PLUGIN_ARGV_DISPLAY_NAME], \
- "comment", argv[PLUGIN_ARGV_COMMENT], \
- "arguments", argv + PLUGIN_ARGV_ARGUMENTS, NULL); \
- gtk_container_add (GTK_CONTAINER (plug), xpp); \
- g_signal_connect_after (G_OBJECT (xpp), "realize", \
- G_CALLBACK (_xpp_realize), plug); \
- g_signal_connect_after (G_OBJECT (xpp), "destroy", \
- G_CALLBACK (_xpp_quit_main_loop), NULL); \
- gtk_widget_show (xpp); \
- \
- if (*argv[PLUGIN_ARGV_BACKGROUND_IMAGE] != '\0') \
- { \
- _xpp_bg_image = argv[PLUGIN_ARGV_BACKGROUND_IMAGE]; \
- _xpp_bg_style = 2; \
- } \
- \
- g_signal_connect (G_OBJECT (plug), "client-event", \
- G_CALLBACK (_xpp_client_event), xpp); \
- gtk_widget_show (plug); \
- \
- gtk_main (); \
- \
- if (_xpp_retval != PLUGIN_EXIT_SUCCESS_AND_RESTART) \
- _xpp_retval = PLUGIN_EXIT_SUCCESS; \
- \
- if (_xpp_bg_image_cache != NULL) \
- cairo_pattern_destroy (_xpp_bg_image_cache); \
- \
- if (GTK_IS_WIDGET (plug)) \
- gtk_widget_destroy (plug); \
- \
- return _xpp_retval; \
- }
-
-
-
-/**
- * XFCE_PANEL_PLUGIN_REGISTER_INTERNAL:
- * @construct_func : name of a function that can be cast to an
- * #XfcePanelPluginFunc
- *
- * See XFCE_PANEL_PLUGIN_REGISTER() for more information.
- *
- * Deprecated: 4.8: Use XFCE_PANEL_PLUGIN_REGISTER() instead.
- **/
-#define XFCE_PANEL_PLUGIN_REGISTER_INTERNAL(construct_func) \
- XFCE_PANEL_PLUGIN_REGISTER (construct_func)
-
-/**
- * XFCE_PANEL_PLUGIN_REGISTER_INTERNAL_WITH_CHECK:
- * @construct_func : name of a function that can be cast to an
- * #XfcePanelPluginFunc
- * @check_func : name of a function that can be cast to an
- * #XfcePanelPluginCheck or %NULL
- *
- * See XFCE_PANEL_PLUGIN_REGISTER() for more information.
- *
- * Deprecated: 4.8: use XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK() instead.
- **/
-#define XFCE_PANEL_PLUGIN_REGISTER_INTERNAL_WITH_CHECK(construct_func ,check_func) \
- XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK (construct_func, check_func)
-
-G_END_DECLS
-
-#endif /* !__LIBXFCE4PANEL_DEPRECATED_H__ */
diff --git a/libxfce4panel/xfce-panel-macros.h b/libxfce4panel/xfce-panel-macros.h
index 3506c7b..ac45af0 100644
--- a/libxfce4panel/xfce-panel-macros.h
+++ b/libxfce4panel/xfce-panel-macros.h
@@ -24,7 +24,7 @@
#include <glib.h>
#include <glib-object.h>
#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4panel/xfce-panel-macros-46.h>
+#include <libxfce4panel/xfce-panel-convenience.h>
G_BEGIN_DECLS
diff --git a/libxfce4panel/xfce-panel-plugin-provider.h b/libxfce4panel/xfce-panel-plugin-provider.h
index de2a547..3dfaac7 100644
--- a/libxfce4panel/xfce-panel-plugin-provider.h
+++ b/libxfce4panel/xfce-panel-plugin-provider.h
@@ -146,7 +146,6 @@ enum
PLUGIN_ARGV_NAME,
PLUGIN_ARGV_DISPLAY_NAME,
PLUGIN_ARGV_COMMENT,
- PLUGIN_ARGV_BACKGROUND_IMAGE,
PLUGIN_ARGV_ARGUMENTS
};
diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index 436403c..857ccc5 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -28,9 +28,7 @@
#endif
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <gtk/gtkx.h>
-#endif
#include <glib.h>
#include <libxfce4util/libxfce4util.h>
@@ -1026,12 +1024,7 @@ xfce_panel_plugin_button_press_event (GtkWidget *widget,
gtk_widget_set_sensitive (item, plugin->priv->menu_blocked == 0);
/* popup the menu */
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_menu_popup_at_pointer (menu, (GdkEvent *) event);
-#else
- gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
- event->button, event->time);
-#endif
return TRUE;
}
@@ -2501,12 +2494,8 @@ xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin)
{
XfceScreenPosition screen_position;
GdkScreen *screen;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
GdkMonitor *monitor;
-#else
- gint monitor_num;
-#endif
GdkRectangle geometry;
gint x, y;
GdkWindow *window;
@@ -2534,14 +2523,10 @@ xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin)
/* get the monitor geometry */
screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_monitor_at_window (display, window);
gdk_monitor_get_geometry (monitor, &geometry);
-#else
- monitor_num = gdk_screen_get_monitor_at_window (screen, window);
- gdk_screen_get_monitor_geometry (screen, monitor_num, &geometry);
-#endif
+
/* get the plugin root origin */
gdk_window_get_root_origin (window, &x, &y);
@@ -2583,12 +2568,8 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
GtkRequisition requisition;
GdkScreen *screen;
GdkRectangle geometry;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
GdkMonitor *monitor;
-#else
- gint monitor_num;
-#endif
GTimeVal now_t, end_t;
GtkWidget *toplevel, *plug;
gint px, py;
@@ -2612,11 +2593,7 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
gtk_widget_realize (attach_widget);
/* get the menu/widget size request */
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (menu_widget, &requisition, NULL);
-#else
- gtk_widget_size_request (menu_widget, &requisition);
-#endif
/* get the root position of the attach widget */
toplevel = gtk_widget_get_toplevel (attach_widget);
@@ -2626,14 +2603,8 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
plug = gtk_widget_get_ancestor (attach_widget, GTK_TYPE_PLUG);
if (plug != NULL)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_window_get_geometry (gtk_plug_get_socket_window (GTK_PLUG (plug)),
&px, &py, NULL, NULL);
-#else
- gdk_window_get_geometry (gtk_plug_get_socket_window (GTK_PLUG (plug)),
- &px, &py, NULL, NULL, NULL);
-#endif
-
*x += px;
*y += py;
}
@@ -2688,14 +2659,9 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
/* get the monitor geometry */
screen = gtk_widget_get_screen (attach_widget);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (attach_widget));
gdk_monitor_get_geometry (monitor, &geometry);
-#else
- monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (attach_widget));
- gdk_screen_get_monitor_geometry (screen, monitor_num, &geometry);
-#endif
/* keep the menu inside the screen */
if (*x > geometry.x + geometry.width - requisition.width)
@@ -2772,15 +2738,10 @@ xfce_panel_plugin_position_menu (GtkMenu *menu,
xfce_panel_plugin_position_widget (XFCE_PANEL_PLUGIN (panel_plugin),
GTK_WIDGET (menu), attach_widget, x, y);
-#if GTK_CHECK_VERSION (3, 0, 0)
/* FIXME */
/* A workaround for Gtk3 popup menus with scroll buttons */
/* Menus are "pushed in" anyway */
*push_in = FALSE;
-#else
- /* keep the menu inside screen */
- *push_in = TRUE;
-#endif
}
diff --git a/libxfce4panel/xfce-panel-plugin.h b/libxfce4panel/xfce-panel-plugin.h
index 8b2788b..6cfe47c 100644
--- a/libxfce4panel/xfce-panel-plugin.h
+++ b/libxfce4panel/xfce-panel-plugin.h
@@ -23,7 +23,6 @@
#include <gtk/gtk.h>
#include <libxfce4panel/libxfce4panel-enums.h>
-#include <libxfce4panel/xfce-panel-macros-46.h>
G_BEGIN_DECLS
diff --git a/migrate/Makefile.am b/migrate/Makefile.am
index 9cb9d2c..aeffd3b 100644
--- a/migrate/Makefile.am
+++ b/migrate/Makefile.am
@@ -17,8 +17,6 @@ migrate_PROGRAMS = \
migrate_SOURCES = \
main.c \
- migrate-46.c \
- migrate-46.h \
migrate-config.c \
migrate-config.h \
migrate-default.c \
diff --git a/migrate/main.c b/migrate/main.c
index 3a9f655..e1ba5f3 100644
--- a/migrate/main.c
+++ b/migrate/main.c
@@ -36,7 +36,6 @@
#include <libxfce4ui/libxfce4ui.h>
#include <libxfce4panel/xfce-panel-macros.h>
-#include <migrate/migrate-46.h>
#include <migrate/migrate-config.h>
#include <migrate/migrate-default.h>
@@ -53,7 +52,6 @@ main (gint argc, gchar **argv)
gint retval = EXIT_SUCCESS;
XfconfChannel *channel;
gint configver;
- gchar *filename_46;
gchar *filename_default;
gboolean migrate_vendor_default;
@@ -77,17 +75,14 @@ main (gint argc, gchar **argv)
channel = xfconf_channel_get (XFCE_PANEL_CHANNEL_NAME);
if (!xfconf_channel_has_property (channel, "/panels"))
{
- /* lookup the old 4.6 config file */
- filename_46 = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, XFCE_46_CONFIG);
-
/* lookup the default configuration */
xfce_resource_push_path (XFCE_RESOURCE_CONFIG, XDGCONFIGDIR);
filename_default = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, DEFAULT_CONFIG_FILENAME);
xfce_resource_pop_path (XFCE_RESOURCE_CONFIG);
- if (filename_46 == NULL && filename_default == NULL)
+ if (filename_default == NULL)
{
- g_warning ("No default or old configuration found");
+ g_warning ("No default configuration found");
return EXIT_FAILURE;
}
@@ -99,25 +94,13 @@ main (gint argc, gchar **argv)
if (g_getenv ("XFCE_PANEL_MIGRATE_DEFAULT") != NULL
|| migrate_vendor_default)
{
- if (filename_46 != NULL)
- g_message ("Tried to auto-migrate, but old configuration found");
- else if (filename_default == NULL)
+ if (filename_default == NULL)
g_message ("Tried to auto-migrate, but no default configuration found");
else
goto migrate_default;
}
- if (filename_46 != NULL)
- {
- /* restore 4.6 config */
- if (!migrate_46 (filename_46, channel, &error))
- {
- xfce_dialog_show_error (NULL, error, _("Tried but failed to migrate your old panel configuration"));
- g_error_free (error);
- retval = EXIT_FAILURE;
- }
- }
- else if (filename_default != NULL)
+ if (filename_default != NULL)
{
migrate_default:
@@ -130,7 +113,6 @@ main (gint argc, gchar **argv)
}
}
- g_free (filename_46);
g_free (filename_default);
}
diff --git a/migrate/migrate-46.c b/migrate/migrate-46.c
deleted file mode 100644
index b9ab159..0000000
--- a/migrate/migrate-46.c
+++ /dev/null
@@ -1,943 +0,0 @@
-/*
- * Copyright (C) 2009-2010 Nick Schermer <nick at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundatoin; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundatoin, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <xfconf/xfconf.h>
-#include <libxfce4util/libxfce4util.h>
-#include <migrate/migrate-46.h>
-#include <libxfce4panel/xfce-panel-macros.h>
-
-
-
-#define LAUNCHER_FOLDER "launcher"
-
-
-
-typedef enum
-{
- START,
- PANELS,
- PANEL,
- PROPERTIES,
- ITEMS,
- UNKNOWN
-}
-ParserState;
-
-typedef enum
-{
- /* no snapping */
- SNAP_POSITION_NONE, /* snapping */
-
- /* right edge */
- SNAP_POSITION_E, /* right */
- SNAP_POSITION_NE, /* top right */
- SNAP_POSITION_EC, /* right center */
- SNAP_POSITION_SE, /* bottom right */
-
- /* left edge */
- SNAP_POSITION_W, /* left */
- SNAP_POSITION_NW, /* top left */
- SNAP_POSITION_WC, /* left center */
- SNAP_POSITION_SW, /* bottom left */
-
- /* top and bottom */
- SNAP_POSITION_NC, /* top center */
- SNAP_POSITION_SC, /* bottom center */
- SNAP_POSITION_N, /* top */
- SNAP_POSITION_S, /* bottom */
-}
-SnapPosition;
-
-typedef struct
-{
- ParserState state;
- guint plugin_id_counter;
- guint panel_id_counter;
- XfconfChannel *channel;
-
- GPtrArray *panel_plugin_ids;
- gint panel_yoffset;
- gint panel_xoffset;
- XfceScreenPosition panel_screen_position;
- guint panel_transparency;
- gboolean panel_activetrans;
-}
-ConfigParser;
-
-
-
-static void
-migrate_46_panel_screen_position (XfceScreenPosition screen_position,
- SnapPosition *snap_position,
- gboolean *horizontal)
-{
- /* defaults */
- *horizontal = FALSE;
- *snap_position = SNAP_POSITION_NONE;
-
- switch (screen_position)
- {
- /* top */
- case XFCE_SCREEN_POSITION_NW_H:
- *horizontal = TRUE;
- *snap_position = SNAP_POSITION_NW;
- break;
-
- case XFCE_SCREEN_POSITION_N:
- *horizontal = TRUE;
- *snap_position = SNAP_POSITION_NC;
- break;
-
- case XFCE_SCREEN_POSITION_NE_H:
- *horizontal = TRUE;
- *snap_position = SNAP_POSITION_NE;
- break;
-
- /* left */
- case XFCE_SCREEN_POSITION_NW_V:
- *snap_position = SNAP_POSITION_NW;
- break;
-
- case XFCE_SCREEN_POSITION_W:
- *snap_position = SNAP_POSITION_WC;
- break;
-
- case XFCE_SCREEN_POSITION_SW_V:
- *snap_position = SNAP_POSITION_SW;
- break;
-
- /* right */
- case XFCE_SCREEN_POSITION_NE_V:
- *snap_position = SNAP_POSITION_NE;
- break;
-
- case XFCE_SCREEN_POSITION_E:
- *snap_position = SNAP_POSITION_EC;
- break;
-
- case XFCE_SCREEN_POSITION_SE_V:
- *snap_position = SNAP_POSITION_SE;
- break;
-
- /* bottom */
- case XFCE_SCREEN_POSITION_SW_H:
- *horizontal = TRUE;
- *snap_position = SNAP_POSITION_SW;
- break;
-
- case XFCE_SCREEN_POSITION_S:
- *horizontal = TRUE;
- *snap_position = SNAP_POSITION_SC;
- break;
-
- case XFCE_SCREEN_POSITION_SE_H:
- *horizontal = TRUE;
- *snap_position = SNAP_POSITION_SE;
- break;
-
- /* floating */
- case XFCE_SCREEN_POSITION_FLOATING_H:
- *horizontal = TRUE;
- break;
-
- default:
- break;
- }
-}
-
-
-
-static void
-migrate_46_panel_set_property (ConfigParser *parser,
- const gchar *property_name,
- const gchar *value,
- GError **error)
-{
- gchar prop[128];
- GdkDisplay *display;
- gchar *name;
- gint num;
-
- if (strcmp (property_name, "size") == 0)
- {
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/size", parser->panel_id_counter);
- xfconf_channel_set_uint (parser->channel, prop, CLAMP (atoi (value), 16, 128));
- }
- else if (strcmp (property_name, "fullwidth") == 0)
- {
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/length", parser->panel_id_counter);
- xfconf_channel_set_uint (parser->channel, prop, (atoi (value) != 0) ? 100 : 0);
- }
- else if (strcmp (property_name, "screen-position") == 0)
- {
- parser->panel_screen_position = CLAMP (atoi (value),
- XFCE_SCREEN_POSITION_NONE,
- XFCE_SCREEN_POSITION_FLOATING_V);
- }
- else if (strcmp (property_name, "xoffset") == 0)
- {
- parser->panel_xoffset = MAX (0, atoi (value));
- }
- else if (strcmp (property_name, "yoffset") == 0)
- {
- parser->panel_yoffset = MAX (0, atoi (value));
- }
- else if (strcmp (property_name, "monitor") == 0)
- {
- /* in 4.4 and 4.6 we only use monitor and make no difference between monitors
- * and screen's, so check the setup of the user to properly convert this */
- num = MAX (0, atoi (value));
- if (G_LIKELY (num > 0))
- {
- display = gdk_display_get_default ();
- if (display != NULL && gdk_display_get_n_screens (display) > 1)
- name = g_strdup_printf ("screen-%d", num);
- else
- name = g_strdup_printf ("monitor-%d", num);
-
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/output", parser->panel_id_counter);
- xfconf_channel_set_string (parser->channel, prop, name);
- g_free (name);
- }
- }
- else if (strcmp (property_name, "handlestyle") == 0)
- {
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/locked", parser->panel_id_counter);
- xfconf_channel_set_bool (parser->channel, prop, atoi (value) == 0);
- }
- else if (strcmp (property_name, "autohide") == 0)
- {
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/autohide", parser->panel_id_counter);
- xfconf_channel_set_bool (parser->channel, prop, (atoi (value) == 1));
- }
- else if (strcmp (property_name, "transparency") == 0)
- {
- parser->panel_transparency = CLAMP (atoi (value), 0, 100);
- }
- else if (strcmp (property_name, "activetrans") == 0)
- {
- parser->panel_activetrans = (atoi (value) == 1);
- }
- else
- {
- g_set_error (error, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, G_MARKUP_ERROR,
- "Unknown property \"%s\" in #%d \"panel\" element",
- property_name, parser->panel_id_counter);
- }
-}
-
-
-
-#define migrate_46_plugin_string(old_name, new_name, fallback) \
- if (xfce_rc_has_entry (rc, old_name)) \
- xfconf_channel_set_string (channel, "/" new_name, \
- xfce_rc_read_entry (rc, old_name, fallback))
-
-#define migrate_46_plugin_bool(old_name, new_name, fallback) \
- if (xfce_rc_has_entry (rc, old_name)) \
- xfconf_channel_set_bool (channel, "/" new_name, \
- xfce_rc_read_bool_entry (rc, old_name, fallback))
-
-#define migrate_46_plugin_uint(old_name, new_name, fallback) \
- if (xfce_rc_has_entry (rc, old_name)) \
- xfconf_channel_set_uint (channel, "/" new_name, \
- xfce_rc_read_int_entry (rc, old_name, fallback))
-
-
-
-static void
-migrate_46_plugin_actions (XfconfChannel *channel,
- XfceRc *rc)
-{
- gint type;
- guint first_action = 0;
- guint second_action = 0;
-
- if (!xfce_rc_has_entry (rc, "type"))
- return;
-
- type = xfce_rc_read_int_entry (rc, "types", 0);
- switch (type)
- {
- case 0: /* ACTION_QUIT */
- first_action = 1;
- break;
-
- case 1: /* ACTION_LOCK */
- first_action = 2;
- break;
-
- default: /* ACTION_QUIT_LOCK */
- first_action = 1;
- second_action = 3;
- break;
- }
-
- xfconf_channel_set_uint (channel, "/first-action", first_action);
- xfconf_channel_set_uint (channel, "/second-action", second_action);
-}
-
-
-
-static void
-migrate_46_plugin_clock (XfconfChannel *channel,
- XfceRc *rc)
-{
- gint type;
-
- if (xfce_rc_has_entry (rc, "ClockType"))
- {
- type = xfce_rc_read_int_entry (rc, "ClockType", 0);
- if (type == 4) /* XFCE_CLOCK_LCD */
- type++; /* Skip CLOCK_PLUGIN_MODE_FUZZY */
- xfconf_channel_set_uint (channel, "/mode", type);
- }
-
- migrate_46_plugin_string ("DigitalFormat", "digital-format", "%R");
- migrate_46_plugin_string ("TooltipFormat", "tooltip-format", "%A %d %B %Y");
-
- migrate_46_plugin_bool ("ShowFrame", "show-frame", TRUE);
- migrate_46_plugin_bool ("ShowSeconds", "show-seconds", FALSE);
- migrate_46_plugin_bool ("ShowMilitary", "show-military", FALSE);
- migrate_46_plugin_bool ("ShowMeridiem", "show-meridiem", TRUE);
- migrate_46_plugin_bool ("FlashSeparators", "flash-separators", FALSE);
- migrate_46_plugin_bool ("TrueBinary", "true-binary", FALSE);
-}
-
-
-
-static void
-migrate_46_plugin_iconbox (XfconfChannel *channel,
- XfceRc *rc)
-{
- /* tasklist in iconbox mode */
- xfconf_channel_set_uint (channel, "/show-labels", FALSE);
-
- migrate_46_plugin_bool ("only_hidden", "show-only-minimized", FALSE);
- migrate_46_plugin_bool ("all_workspaces", "include-all-workspaces", TRUE);
-
- /* TODO
- * xfce_rc_write_int_entry (rc, "expand", iconbox->expand); */
-}
-
-
-
-static void
-migrate_46_plugin_launcher (XfconfChannel *channel,
- XfceRc *rc,
- guint plugin_id,
- GError **error)
-{
- guint i;
- gchar buf[128];
- XfceRc *new_desktop;
- gchar *path;
- GTimeVal timeval;
- GPtrArray *array;
- GValue *value;
- gchar *filename;
-
- if (xfce_rc_has_group (rc, "Global"))
- {
- xfce_rc_set_group (rc, "Global");
-
- migrate_46_plugin_bool ("MoveFirst", "move-first", FALSE);
- migrate_46_plugin_bool ("ArrowPosition", "arrow-position", 0);
- }
-
- g_get_current_time (&timeval);
- array = g_ptr_array_new ();
-
- for (i = 0; i < 100 /* arbitrary */; i++)
- {
- g_snprintf (buf, sizeof (buf), "Entry %d", i);
- if (!xfce_rc_has_group (rc, buf))
- break;
-
- xfce_rc_set_group (rc, buf);
-
- g_snprintf (buf, sizeof (buf), "xfce4" G_DIR_SEPARATOR_S "panel"
- G_DIR_SEPARATOR_S LAUNCHER_FOLDER "-%d" G_DIR_SEPARATOR_S "%ld%d.desktop",
- plugin_id, timeval.tv_sec, i);
- path = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, buf, TRUE);
- if (G_UNLIKELY (path == NULL))
- {
- g_set_error (error, G_FILE_ERROR_FAILED, G_FILE_ERROR,
- "Failed to create new launcher desktop file in \"%s\"", buf);
- break;
- }
- else if (g_file_test (path, G_FILE_TEST_EXISTS))
- {
- g_set_error (error, G_FILE_ERROR_EXIST, G_FILE_ERROR,
- "Desktop item \"%s\" already exists", path);
- g_free (path);
- break;
- }
-
- new_desktop = xfce_rc_simple_open (path, FALSE);
- if (G_UNLIKELY (new_desktop == NULL))
- {
- g_set_error (error, G_FILE_ERROR_FAILED, G_FILE_ERROR,
- "Failed to create new desktop file \"%s\"", path);
- g_free (path);
- break;
- }
-
-
- xfce_rc_set_group (new_desktop, G_KEY_FILE_DESKTOP_GROUP);
-
- xfce_rc_write_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_TYPE,
- G_KEY_FILE_DESKTOP_TYPE_APPLICATION);
- xfce_rc_write_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_NAME,
- xfce_rc_read_entry (rc, "Name", ""));
- xfce_rc_write_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_COMMENT,
- xfce_rc_read_entry (rc, "Comment", ""));
- xfce_rc_write_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_ICON,
- xfce_rc_read_entry (rc, "Icon", ""));
- xfce_rc_write_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_EXEC,
- xfce_rc_read_entry (rc, "Exec", ""));
- xfce_rc_write_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_PATH,
- xfce_rc_read_entry (rc, "Path", ""));
- xfce_rc_write_bool_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_TERMINAL,
- xfce_rc_read_bool_entry (rc, "Terminal", FALSE));
- xfce_rc_write_bool_entry (new_desktop, G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY,
- xfce_rc_read_bool_entry (rc, "StartupNotify", FALSE));
-
- xfce_rc_flush (new_desktop);
- if (xfce_rc_is_dirty (new_desktop))
- {
- g_set_error (error, G_FILE_ERROR_FAILED, G_FILE_ERROR,
- "Failed to flush desktop file \"%s\"", path);
- g_free (path);
- xfce_rc_close (new_desktop);
- break;
- }
-
- g_free (path);
- xfce_rc_close (new_desktop);
-
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_STRING);
- filename = g_strdup_printf ("%ld%d.desktop", timeval.tv_sec, i);
- g_value_take_string (value, filename);
- g_ptr_array_add (array, value);
- }
-
- xfconf_channel_set_arrayv (channel, "/items", array);
- xfconf_array_free (array);
-}
-
-
-
-static void
-migrate_46_plugin_pager (XfconfChannel *channel,
- XfceRc *rc)
-{
- migrate_46_plugin_uint ("rows", "rows", 1);
- migrate_46_plugin_bool ("show-names", "show-names", FALSE);
- migrate_46_plugin_bool ("scrolling", "workspace-scrolling", TRUE);
-}
-
-
-
-static void
-migrate_46_plugin_separator (XfconfChannel *channel,
- XfceRc *rc)
-{
- gint type;
- guint style;
-
- if (!xfce_rc_has_entry (rc, "separator-type"))
- return;
-
- type = xfce_rc_read_int_entry (rc, "separator-type", 0);
- switch (type)
- {
- case 0: /* SEP_SPACE */
- style = 0; /* SEPARATOR_PLUGIN_STYLE_TRANSPARENT */
- break;
-
- case 1: /* SEP_EXPAND */
- style = 0; /* SEPARATOR_PLUGIN_STYLE_TRANSPARENT */
- xfconf_channel_set_bool (channel, "/expand", TRUE);
- break;
-
- case 2: /* SEP_LINE */
- style = 1; /* SEPARATOR_PLUGIN_STYLE_SEPARATOR */
- break;
-
- case 3: /* SEP_HANDLE */
- style = 2; /* SEPARATOR_PLUGIN_STYLE_HANDLE */
- break;
-
- default: /* SEP_DOTS */
- style = 3; /* SEPARATOR_PLUGIN_STYLE_DOTS */
- break;
- }
-
- xfconf_channel_set_uint (channel, "/style", style);
-}
-
-
-
-static void
-migrate_46_plugin_showdesktop (XfconfChannel *channel,
- XfceRc *rc)
-{
- /* no settings */
-}
-
-
-
-static void
-migrate_46_plugin_systray (XfconfChannel *channel,
- XfceRc *rc)
-{
- if (xfce_rc_has_group (rc, "Global"))
- {
- xfce_rc_set_group (rc, "Global");
-
- migrate_46_plugin_bool ("ShowFrame", "show-frame", TRUE);
- migrate_46_plugin_uint ("Rows", "rows", 1);
- }
-
- if (xfce_rc_has_group (rc, "Applications"))
- {
- xfce_rc_set_group (rc, "Applications");
-
- /* TODO */
- /* xfce_rc_read_bool_entry (rc, appname, hidden); */
- }
-}
-
-
-
-static void
-migrate_46_plugin_tasklist (XfconfChannel *channel,
- XfceRc *rc)
-{
- migrate_46_plugin_uint ("grouping", "grouping", 0);
- migrate_46_plugin_bool ("all_workspaces", "include-all-workspaces", TRUE);
- migrate_46_plugin_bool ("flat_buttons", "flat-buttons", FALSE);
- migrate_46_plugin_bool ("show_handles", "show-handle", TRUE);
-
- /* TODO
- * xfce_rc_write_int_entry (rc, "width", tasklist->width);
- * xfce_rc_write_bool_entry (rc, "fixed_width", tasklist->fixed_width);
- * xfce_rc_write_bool_entry (rc, "expand", tasklist->expand); */
-}
-
-
-
-static void
-migrate_46_plugin_windowlist (XfconfChannel *channel,
- XfceRc *rc)
-{
- if (xfce_rc_has_entry (rc, "urgency_notify"))
- xfconf_channel_set_bool (channel, "/urgentcy-notification",
- xfce_rc_read_int_entry (rc, "button_layout", 0) > 0);
-
- migrate_46_plugin_uint ("button_layout", "style", 0);
- migrate_46_plugin_bool ("show_all_workspaces", "all-workspaces", TRUE);
- migrate_46_plugin_bool ("show_workspace_actions", "workspace-actions", FALSE);
-
- /* TODO
- * xfce_rc_read_bool_entry (rc, "show_window_icons", TRUE); */
-}
-
-
-
-static void
-migrate_46_plugin_xfce4_menu (XfconfChannel *channel,
- XfceRc *rc)
-{
- migrate_46_plugin_bool ("show_menu_icons", "show-menu-icons", TRUE);
- migrate_46_plugin_bool ("show_button_title", "show-button-title", TRUE);
- migrate_46_plugin_string ("menu_file", "custom-menu-file", "");
- migrate_46_plugin_string ("icon_file", "button-icon", "xfce4-panel-menu");
- migrate_46_plugin_string ("button_title", "button-title", "");
-
- if (xfce_rc_has_entry (rc, "use_default_menu"))
- xfconf_channel_set_bool (channel, "/custom-menu",
- !xfce_rc_read_bool_entry (rc, "use_default_menu", TRUE));
-}
-
-
-
-static void
-migrate_46_panel_add_plugin (ConfigParser *parser,
- const gchar *name,
- const gchar *id,
- GError **error)
-{
- XfconfChannel *channel;
- gchar base[256];
- XfceRc *rc;
- const gchar *plugin_name = name;
-
- g_return_if_fail (XFCONF_IS_CHANNEL (parser->channel));
-
- /* open the old rc file of the plugin */
- g_snprintf (base, sizeof (base), "xfce4" G_DIR_SEPARATOR_S
- "panel" G_DIR_SEPARATOR_S "%s-%s.rc", name, id);
- rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, base, TRUE);
-
- /* open a panel with the propert base for the plugin */
- g_snprintf (base, sizeof (base), "/plugins/plugin-%d", parser->plugin_id_counter);
- channel = xfconf_channel_new_with_property_base (XFCE_PANEL_CHANNEL_NAME, base);
-
- if (strcmp (name, "actions") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_actions (channel, rc);
- }
- else if (strcmp (name, "clock") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_clock (channel, rc);
- }
- else if (strcmp (name, "iconbox") == 0)
- {
- plugin_name = "tasklist";
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_iconbox (channel, rc);
- }
- else if (strcmp (name, "launcher") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_launcher (channel, rc, parser->plugin_id_counter, error);
- }
- else if (strcmp (name, "pager") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_pager (channel, rc);
- }
- else if (strcmp (name, "separator") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_separator (channel, rc);
- }
- else if (strcmp (name, "showdesktop") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_showdesktop (channel, rc);
- }
- else if (strcmp (name, "systray") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_systray (channel, rc);
- }
- else if (strcmp (name, "tasklist") == 0)
- {
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_tasklist (channel, rc);
- }
- else if (strcmp (name, "windowlist") == 0)
- {
- plugin_name = "windowmenu";
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_windowlist (channel, rc);
- }
- else if (strcmp (name, "xfce4-menu") == 0)
- {
- plugin_name = "applicationsmenu";
- if (G_LIKELY (rc != NULL))
- migrate_46_plugin_xfce4_menu (channel, rc);
- }
- else
- {
- /* handle other "external" plugins */
- }
-
- /* close plugin configs */
- g_object_unref (G_OBJECT (channel));
- if (G_LIKELY (rc != NULL))
- xfce_rc_close (rc);
-
- /* store the (new) plugin name */
- xfconf_channel_set_string (parser->channel, base, plugin_name);
-}
-
-
-
-static void
-migrate_46_start_element_handler (GMarkupParseContext *context,
- const gchar *element_name,
- const gchar **attribute_names,
- const gchar **attribute_values,
- gpointer user_data,
- GError **error)
-{
- ConfigParser *parser = user_data;
- guint i;
- const gchar *name, *id, *value;
- GValue *id_value;
-
- g_return_if_fail (XFCONF_IS_CHANNEL (parser->channel));
-
- switch (parser->state)
- {
- case START:
- if (strcmp (element_name, "panels") == 0)
- parser->state = PANELS;
- break;
-
- case PANELS:
- if (strcmp (element_name, "panel") == 0)
- {
- parser->state = PANEL;
-
- /* intialize new ids array */
- parser->panel_plugin_ids = g_ptr_array_new ();
-
- /* set defaults */
- parser->panel_screen_position = XFCE_SCREEN_POSITION_NONE;
- parser->panel_xoffset = 100;
- parser->panel_yoffset = 100;
- parser->panel_transparency = 100;
- parser->panel_activetrans = FALSE;
- }
- break;
-
- case PANEL:
- if (strcmp (element_name, "properties") == 0)
- parser->state = PROPERTIES;
- else if (strcmp (element_name, "items") == 0)
- parser->state = ITEMS;
- break;
-
- case PROPERTIES:
- if (strcmp (element_name, "property") == 0)
- {
- name = NULL;
- value = NULL;
-
- for (i = 0; attribute_names[i] != NULL; i++)
- {
- if (strcmp (attribute_names[i], "name") == 0)
- name = attribute_values[i];
- else if (strcmp (attribute_names[i], "value") == 0)
- value = attribute_values[i];
- }
-
- if (G_LIKELY (name != NULL && value != NULL))
- {
- migrate_46_panel_set_property (parser, name, value, error);
- }
- else
- {
- g_set_error (error, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, G_MARKUP_ERROR,
- "Unknown property name (%s) or value (%s) in element",
- name, value);
- }
- }
- break;
-
- case ITEMS:
- if (strcmp (element_name, "item") == 0)
- {
- name = id = NULL;
-
- for (i = 0; attribute_names[i] != NULL; i++)
- {
- if (strcmp (attribute_names[i], "name") == 0)
- name = attribute_values[i];
- else if (strcmp (attribute_names[i], "id") == 0)
- id = attribute_values[i];
- }
-
- if (G_LIKELY (name != NULL && id != NULL))
- {
- parser->plugin_id_counter++;
- migrate_46_panel_add_plugin (parser, name, id, error);
-
- id_value = g_new0 (GValue, 1);
- g_value_init (id_value, G_TYPE_INT);
- g_value_set_int (id_value, parser->plugin_id_counter);
- g_ptr_array_add (parser->panel_plugin_ids, id_value);
- }
- else
- {
- g_set_error (error, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, G_MARKUP_ERROR,
- "Unknown item name (%s) or id (%s) in element",
- name, id);
- }
- }
- break;
-
- default:
- g_set_error (error, G_MARKUP_ERROR_UNKNOWN_ELEMENT, G_MARKUP_ERROR,
- "Unknown start element \"%s\"", element_name);
- break;
- }
-}
-
-
-
-static void
-migrate_46_end_element_handler (GMarkupParseContext *context,
- const gchar *element_name,
- gpointer user_data,
- GError **error)
-{
- ConfigParser *parser = user_data;
- SnapPosition snap_position;
- gboolean horizontal;
- gchar prop[128];
- gchar *position;
-
- g_return_if_fail (XFCONF_IS_CHANNEL (parser->channel));
-
- switch (parser->state)
- {
- case START:
- g_set_error (error, G_MARKUP_ERROR_PARSE, G_MARKUP_ERROR,
- "Unexpected end element \"%s\"", element_name);
- break;
-
- case PANEL:
- if (strcmp ("panel", element_name) == 0)
- {
- parser->state = PANELS;
-
- /* store ids array */
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/plugin-ids", parser->panel_id_counter);
- xfconf_channel_set_arrayv (parser->channel, prop, parser->panel_plugin_ids);
- xfconf_array_free (parser->panel_plugin_ids);
-
- /* translate the old screen position to a snap position and orientation */
- migrate_46_panel_screen_position (parser->panel_screen_position,
- &snap_position, &horizontal);
-
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/horizontal", parser->panel_id_counter);
- xfconf_channel_set_bool (parser->channel, prop, horizontal);
-
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/position", parser->panel_id_counter);
- position = g_strdup_printf ("p=%d;x=%d;y=%d",
- snap_position,
- parser->panel_xoffset,
- parser->panel_yoffset);
- xfconf_channel_set_string (parser->channel, prop, position);
- g_free (position);
-
- /* set transparency */
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/leave-opacity", parser->panel_id_counter);
- xfconf_channel_set_uint (parser->channel, prop, 100 - parser->panel_transparency);
-
- g_snprintf (prop, sizeof (prop), "/panels/panel-%u/enter-opacity", parser->panel_id_counter);
- xfconf_channel_set_uint (parser->channel, prop, parser->panel_activetrans ?
- 100 - parser->panel_transparency : 100);
-
- /* prepare for the next panel */
- parser->panel_id_counter++;
- }
- break;
-
- case PANELS:
- if (strcmp ("panels", element_name) == 0)
- {
- parser->state = START;
- xfconf_channel_set_uint (parser->channel, "/panels", parser->panel_id_counter);
- }
- break;
-
- case PROPERTIES:
- if (strcmp ("properties", element_name) == 0)
- parser->state = PANEL;
- break;
-
- case ITEMS:
- if (strcmp ("items", element_name) == 0)
- parser->state = PANEL;
- break;
-
- default:
- g_set_error (error, G_MARKUP_ERROR_UNKNOWN_ELEMENT, G_MARKUP_ERROR,
- "Unknown end element \"%s\"", element_name);
- break;
- }
-}
-
-
-
-static GMarkupParser markup_parser =
-{
- migrate_46_start_element_handler,
- migrate_46_end_element_handler,
- NULL,
- NULL,
- NULL
-};
-
-
-
-gboolean
-migrate_46 (const gchar *filename,
- XfconfChannel *channel,
- GError **error)
-{
- gsize length;
- gchar *contents;
- GMarkupParseContext *context;
- ConfigParser *parser;
- gboolean succeed = FALSE;
-
- g_return_val_if_fail (filename != NULL, FALSE);
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- g_return_val_if_fail (XFCONF_IS_CHANNEL (channel), FALSE);
-
- if (!g_file_get_contents (filename, &contents, &length, error))
- return FALSE;
-
- parser = g_slice_new0 (ConfigParser);
- parser->state = START;
- parser->plugin_id_counter = 0;
- parser->panel_id_counter = 0;
- parser->channel = channel;
-
- context = g_markup_parse_context_new (&markup_parser, 0, parser, NULL);
-
- if (g_markup_parse_context_parse (context, contents, length, error))
- {
- /* check if the entire file is parsed */
- if (g_markup_parse_context_end_parse (context, error))
- succeed = TRUE;
- }
-
- /* if parsing failed somehow, empty the channel so no broken config is left */
- if (!succeed)
- xfconf_channel_reset_property (parser->channel, "/", TRUE);
-
- g_free (contents);
- g_markup_parse_context_free (context);
- g_slice_free (ConfigParser, parser);
-
- return succeed;
-}
diff --git a/migrate/migrate-46.h b/migrate/migrate-46.h
deleted file mode 100644
index 0db23e9..0000000
--- a/migrate/migrate-46.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2009-2010 Nick Schermer <nick at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef __MIGRATE_46_H__
-#define __MIGRATE_46_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define XFCE_46_CONFIG "xfce4" G_DIR_SEPARATOR_S "panel" G_DIR_SEPARATOR_S "panels.xml"
-
-gboolean migrate_46 (const gchar *filename,
- XfconfChannel *channel,
- GError **error);
-
-G_END_DECLS
-
-#endif /* !__MIGRATE_46_H__ */
-
diff --git a/panel/Makefile.am b/panel/Makefile.am
index b39afae..26724f3 100644
--- a/panel/Makefile.am
+++ b/panel/Makefile.am
@@ -48,8 +48,6 @@ xfce4_panel_SOURCES = \
panel-plugin-external.h \
panel-plugin-external-wrapper.c \
panel-plugin-external-wrapper.h \
- panel-plugin-external-46.c \
- panel-plugin-external-46.h \
panel-preferences-dialog.c \
panel-preferences-dialog.h \
panel-tic-tac-toe.c \
diff --git a/panel/panel-application.c b/panel/panel-application.c
index adcfb51..93dcf27 100644
--- a/panel/panel-application.c
+++ b/panel/panel-application.c
@@ -43,7 +43,6 @@
#include <panel/panel-dbus-service.h>
#include <panel/panel-base-window.h>
-#include <panel/panel-plugin-external-46.h>
#include <panel/panel-window.h>
#include <panel/panel-application.h>
#include <panel/panel-itembar.h>
@@ -799,13 +798,6 @@ panel_application_plugin_insert (PanelApplication *application,
g_signal_connect (G_OBJECT (provider), "provider-signal",
G_CALLBACK (panel_application_plugin_provider_signal), application);
- /* work around the problem that we need a background before
- * realizing for 4.6 panel plugins */
- if (PANEL_BASE_WINDOW (window)->background_style == PANEL_BG_STYLE_IMAGE
- && PANEL_IS_PLUGIN_EXTERNAL_46 (provider))
- panel_plugin_external_set_background_image (PANEL_PLUGIN_EXTERNAL (provider),
- PANEL_BASE_WINDOW (window)->background_image);
-
/* add the item to the panel */
itembar = gtk_bin_get_child (GTK_BIN (window));
panel_itembar_insert (PANEL_ITEMBAR (itembar),
diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c
index 7f216f2..3316a2c 100644
--- a/panel/panel-base-window.c
+++ b/panel/panel-base-window.c
@@ -33,7 +33,6 @@
#include <panel/panel-base-window.h>
#include <panel/panel-window.h>
#include <panel/panel-plugin-external.h>
-#include <panel/panel-plugin-external-46.h>
diff --git a/panel/panel-module.c b/panel/panel-module.c
index 89e4d8f..079d6e3 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -32,7 +32,6 @@
#include <panel/panel-module.h>
#include <panel/panel-module-factory.h>
#include <panel/panel-plugin-external-wrapper.h>
-#include <panel/panel-plugin-external-46.h>
#define PANEL_PLUGINS_LIB_DIR (LIBDIR G_DIR_SEPARATOR_S "panel" G_DIR_SEPARATOR_S "plugins")
#define PANEL_PLUGINS_LIB_DIR_OLD (LIBDIR G_DIR_SEPARATOR_S "panel-plugins")
@@ -61,8 +60,7 @@ enum _PanelModuleRunMode
{
UNKNOWN, /* Unset */
INTERNAL, /* plugin library will be loaded in the panel */
- WRAPPER, /* external library with comunication through PanelPluginExternal */
- EXTERNAL_46 /* external executable with comunication through PanelPluginExternal46 */
+ WRAPPER /* external library with communication through PanelPluginExternal */
};
enum _PanelModuleUnique
@@ -79,8 +77,7 @@ struct _PanelModule
/* module type */
PanelModuleRunMode mode;
- /* filename to the library or executable
- * for an old 4.6 plugin */
+ /* filename of the library */
gchar *filename;
/* plugin information from the desktop file */
@@ -92,7 +89,7 @@ struct _PanelModule
guint use_count;
PanelModuleUnique unique_mode;
- /* module location (null for 4.6 plugins) */
+ /* module location */
GModule *library;
/* for non-gobject plugin */
@@ -306,7 +303,6 @@ panel_module_new_from_desktop_file (const gchar *filename,
XfceRc *rc;
const gchar *module_name;
gchar *path;
- const gchar *module_exec;
const gchar *module_unique;
gboolean found;
@@ -382,24 +378,6 @@ panel_module_new_from_desktop_file (const gchar *filename,
g_free (path);
}
}
- else
- {
- /* yeah, we support ancient shizzle too... */
- module_exec = xfce_rc_read_entry_untranslated (rc, "X-XFCE-Exec", NULL);
- if (module_exec != NULL
- && g_path_is_absolute (module_exec)
- && g_file_test (module_exec, G_FILE_TEST_EXISTS))
- {
- module = g_object_new (PANEL_TYPE_MODULE, NULL);
- module->filename = g_strdup (module_exec);
- module->mode = EXTERNAL_46;
- }
- else
- {
- g_critical ("Plugin %s: There was no executable found at \"%s\"",
- name, module_exec);
- }
- }
if (G_LIKELY (module != NULL))
{
@@ -499,11 +477,6 @@ panel_module_new_plugin (PanelModule *module,
debug_type = "external-wrapper";
break;
- case EXTERNAL_46:
- plugin = panel_plugin_external_46_new (module, unique_id, arguments);
- debug_type = "external-46";
- break;
-
default:
panel_assert_not_reached ();
break;
diff --git a/panel/panel-plugin-external-wrapper.c b/panel/panel-plugin-external-wrapper.c
index d36e5fb..d2509af 100644
--- a/panel/panel-plugin-external-wrapper.c
+++ b/panel/panel-plugin-external-wrapper.c
@@ -242,7 +242,6 @@ panel_plugin_external_wrapper_get_argv (PanelPluginExternal *external,
argv[PLUGIN_ARGV_NAME] = g_strdup (panel_module_get_name (external->module));
argv[PLUGIN_ARGV_DISPLAY_NAME] = g_strdup (panel_module_get_display_name (external->module));
argv[PLUGIN_ARGV_COMMENT] = g_strdup (panel_module_get_comment (external->module));
- argv[PLUGIN_ARGV_BACKGROUND_IMAGE] = g_strdup (""); /* unused, for 4.6 plugins only */
/* append the arguments */
if (G_UNLIKELY (arguments != NULL))
diff --git a/panel/panel-plugin-external.c b/panel/panel-plugin-external.c
index d0d4d69..48ea492 100644
--- a/panel/panel-plugin-external.c
+++ b/panel/panel-plugin-external.c
@@ -46,7 +46,6 @@
#include <panel/panel-module.h>
#include <panel/panel-plugin-external.h>
-#include <panel/panel-plugin-external-46.h>
#include <panel/panel-window.h>
#include <panel/panel-dialogs.h>
@@ -1197,14 +1196,7 @@ panel_plugin_external_set_background_image (PanelPluginExternal *external,
panel_return_if_fail (PANEL_IS_PLUGIN_EXTERNAL (external));
- if (!external->priv->embedded
- && PANEL_IS_PLUGIN_EXTERNAL_46 (external))
- {
- /* hack to set the background of 4.6 plugins before the child is
- * embedded, so it is directly send with the startup arguments */
- panel_plugin_external_46_set_background_image (PANEL_PLUGIN_EXTERNAL_46 (external), image);
- }
- else if (G_UNLIKELY (image != NULL))
+ if (G_UNLIKELY (image != NULL))
{
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, image);
diff --git a/panel/panel-preferences-dialog.h b/panel/panel-preferences-dialog.h
index 0091cdd..f370381 100644
--- a/panel/panel-preferences-dialog.h
+++ b/panel/panel-preferences-dialog.h
@@ -20,6 +20,7 @@
#define __PANEL_PREFERENCES_DIALOG_H__
#include <gtk/gtk.h>
+#include <gtk/gtkx.h>
#include <panel/panel-application.h>
#include <panel/panel-window.h>
diff --git a/panel/panel-window.c b/panel/panel-window.c
index 63776b3..86c417c 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -53,7 +53,6 @@
#include <panel/panel-dialogs.h>
#include <panel/panel-dbus-service.h>
#include <panel/panel-plugin-external.h>
-#include <panel/panel-plugin-external-46.h>
#include <panel/panel-tic-tac-toe.h>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b4b01c7..88e2e85 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -20,7 +20,6 @@ panel/panel-itembar.c
panel/panel-module-factory.c
panel/panel-module.c
panel/panel-plugin-external.c
-panel/panel-plugin-external-46.c
panel/panel-plugin-external-wrapper.c
panel/panel-preferences-dialog.c
panel/panel-preferences-dialog.glade
diff --git a/wrapper/Makefile.am b/wrapper/Makefile.am
index 0c342a2..1aeaa27 100644
--- a/wrapper/Makefile.am
+++ b/wrapper/Makefile.am
@@ -38,43 +38,6 @@ wrapper_2_0_LDADD = \
wrapper_2_0_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel-$(LIBXFCE4PANEL_VERSION_API).la
-#
-# Gtk+ 2 support library
-#
-if ENABLE_GTK2_LIBRARY
-
-wrapper_PROGRAMS += wrapper-1.0
-
-wrapper_1_0_SOURCES = \
- main.c \
- wrapper-module.c \
- wrapper-module.h \
- wrapper-plug.c \
- wrapper-plug.h
-
-wrapper_1_0_CFLAGS = \
- $(GTK2_CFLAGS) \
- $(GIO_CFLAGS) \
- $(GMODULE_CFLAGS) \
- $(LIBXFCE4UTIL_CFLAGS) \
- $(PLATFORM_CFLAGS)
-
-wrapper_1_0_LDFLAGS = \
- -no-undefined \
- $(PLATFORM_LDFLAGS)
-
-wrapper_1_0_LDADD = \
- $(top_builddir)/libxfce4panel/libxfce4panel-1.0.la \
- $(GTK2_LIBS) \
- $(GIO_LIBS) \
- $(GMODULE_LIBS) \
- $(LIBXFCE4UTIL_LIBS)
-
-wrapper_1_0_DEPENDENCIES = \
- $(top_builddir)/libxfce4panel/libxfce4panel-1.0.la
-
-endif
-
if MAINTAINER_MODE
#wrapper-marshal.h: $(top_builddir)/panel/panel-marshal.list Makefile
diff --git a/wrapper/main.c b/wrapper/main.c
index 452e77c..6b145c1 100644
--- a/wrapper/main.c
+++ b/wrapper/main.c
@@ -100,10 +100,8 @@ wrapper_gproxy_set (XfcePanelPluginProvider *provider,
break;
case PROVIDER_PROP_TYPE_SET_OPACITY:
-#if GTK_CHECK_VERSION (3, 0, 0)
plug = g_object_get_qdata (G_OBJECT (provider), plug_quark);
wrapper_plug_set_opacity (plug, g_variant_get_double (variant));
-#endif
break;
case PROVIDER_PROP_TYPE_SET_BACKGROUND_COLOR:
@@ -314,11 +312,7 @@ main (gint argc, gchar **argv)
GError *error = NULL;
const gchar *filename;
gint unique_id;
-#if GTK_CHECK_VERSION (3, 0, 0)
Window socket_id;
-#else
- GdkNativeWindow socket_id;
-#endif
const gchar *name;
const gchar *display_name;
const gchar *comment;
diff --git a/wrapper/wrapper-plug.c b/wrapper/wrapper-plug.c
index 6dde8c9..db973bd 100644
--- a/wrapper/wrapper-plug.c
+++ b/wrapper/wrapper-plug.c
@@ -30,13 +30,8 @@
static void wrapper_plug_finalize (GObject *object);
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean wrapper_plug_draw (GtkWidget *widget,
cairo_t *cr);
-#else
-static gboolean wrapper_plug_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-#endif
static void wrapper_plug_background_reset (WrapperPlug *plug);
@@ -51,11 +46,7 @@ struct _WrapperPlug
GtkPlug __parent__;
/* background information */
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA *background_rgba;
-#else
- gchar *background_color;
-#endif
gchar *background_image;
cairo_pattern_t *background_image_cache;
};
@@ -81,11 +72,7 @@ wrapper_plug_class_init (WrapperPlugClass *klass)
gobject_class->finalize = wrapper_plug_finalize;
gtkwidget_class = GTK_WIDGET_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtkwidget_class->draw = wrapper_plug_draw;
-#else
- gtkwidget_class->expose_event = wrapper_plug_expose_event;
-#endif
}
@@ -93,20 +80,11 @@ wrapper_plug_class_init (WrapperPlugClass *klass)
static void
wrapper_plug_init (WrapperPlug *plug)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkVisual *visual = NULL;
GdkScreen *screen;
GtkStyleContext *context;
-#else
- GdkColormap *colormap = NULL;
- GdkScreen *screen;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
plug->background_rgba = NULL;
-#else
- plug->background_color = NULL;
-#endif
plug->background_image = NULL;
plug->background_image_cache = NULL;
@@ -117,22 +95,14 @@ wrapper_plug_init (WrapperPlug *plug)
/* set the colormap */
screen = gtk_window_get_screen (GTK_WINDOW (plug));
-#if GTK_CHECK_VERSION (3, 0, 0)
visual = gdk_screen_get_rgba_visual (screen);
if (visual != NULL)
gtk_widget_set_visual (GTK_WIDGET (plug), visual);
-#else
- colormap = gdk_screen_get_rgba_colormap (screen);
- if (colormap != NULL)
- gtk_widget_set_colormap (GTK_WIDGET (plug), colormap);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
/* set the panel class */
context = gtk_widget_get_style_context (GTK_WIDGET (plug));
gtk_style_context_add_class (context, "panel");
gtk_style_context_add_class (context, "xfce4-panel");
-#endif
gtk_drag_dest_unset (GTK_WIDGET (plug));
}
@@ -149,7 +119,6 @@ wrapper_plug_finalize (GObject *object)
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
wrapper_plug_draw (GtkWidget *widget,
cairo_t *cr)
@@ -233,99 +202,6 @@ wrapper_plug_draw (GtkWidget *widget,
return GTK_WIDGET_CLASS (wrapper_plug_parent_class)->draw (widget, cr);
}
-#else
-
-static gboolean
-wrapper_plug_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- WrapperPlug *plug = WRAPPER_PLUG (widget);
- cairo_t *cr;
- gchar *color_string;
- gchar **color_strings;
- GdkPixbuf *pixbuf;
- gdouble red, green, blue, alpha;
- GError *error = NULL;
-
- if (GTK_WIDGET_DRAWABLE (widget))
- {
- if (G_UNLIKELY (plug->background_image != NULL))
- {
- cr = gdk_cairo_create (widget->window);
- cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- gdk_cairo_rectangle (cr, &event->area);
- cairo_clip (cr);
-
- if (G_LIKELY (plug->background_image_cache != NULL))
- {
- cairo_set_source (cr, plug->background_image_cache);
- cairo_paint (cr);
- }
- else
- {
- /* load the image in a pixbuf */
- pixbuf = gdk_pixbuf_new_from_file (plug->background_image, &error);
-
- if (G_LIKELY (pixbuf != NULL))
- {
- gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
- g_object_unref (G_OBJECT (pixbuf));
-
- plug->background_image_cache = cairo_get_source (cr);
- cairo_pattern_reference (plug->background_image_cache);
- cairo_pattern_set_extend (plug->background_image_cache, CAIRO_EXTEND_REPEAT);
- cairo_paint (cr);
- }
- else
- {
- /* print error message */
- g_warning ("Background image disabled, \"%s\" could not be loaded: %s",
- plug->background_image, error != NULL ? error->message : "No error");
- g_error_free (error);
-
- /* disable background image */
- wrapper_plug_background_reset (plug);
- }
- }
-
- cairo_destroy (cr);
- }
- else
- {
- if (plug->background_color != NULL)
- {
- /* get the background gdk color */
- if (plug->background_color != NULL) {
- color_string = g_strdup (plug->background_color);
- /* the rgba color string format is always either rgb(0,0,0) or
- rgba(0,0,0,0.0) */
- color_strings = g_strsplit_set (color_string, "(),", -1);
- red = g_ascii_strtod (color_strings[1], NULL) / 255;
- green = g_ascii_strtod (color_strings[2], NULL) / 255;
- blue = g_ascii_strtod (color_strings[3], NULL) / 255;
- /* as the rgb string is null-terminated, check whether an alpha value
- is provided or fall back to full opacity */
- if (g_strcmp0(color_strings[0],"rgba") == 0)
- alpha = g_ascii_strtod (color_strings[4], NULL);
- else
- alpha = 1.0;
- }
-
- /* draw the background color */
- cr = gdk_cairo_create (widget->window);
- cairo_set_source_rgba (cr, red, green, blue, alpha);
- cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- gdk_cairo_rectangle (cr, &event->area);
- cairo_fill (cr);
- cairo_destroy (cr);
- }
- }
- }
-
- return GTK_WIDGET_CLASS (wrapper_plug_parent_class)->expose_event (widget, event);
-}
-#endif
-
static void
@@ -333,15 +209,9 @@ wrapper_plug_background_reset (WrapperPlug *plug)
{
panel_return_if_fail (WRAPPER_IS_PLUG (plug));
-#if GTK_CHECK_VERSION (3, 0, 0)
if (plug->background_rgba != NULL)
gdk_rgba_free (plug->background_rgba);
plug->background_rgba = NULL;
-#else
- if (plug->background_color != NULL)
- g_free (plug->background_color);
- plug->background_color = NULL;
-#endif
if (plug->background_image_cache != NULL)
cairo_pattern_destroy (plug->background_image_cache);
@@ -354,11 +224,7 @@ wrapper_plug_background_reset (WrapperPlug *plug)
WrapperPlug *
-#if GTK_CHECK_VERSION (3, 0, 0)
wrapper_plug_new (Window socket_id)
-#else
-wrapper_plug_new (GdkNativeWindow socket_id)
-#endif
{
WrapperPlug *plug;
@@ -373,7 +239,6 @@ wrapper_plug_new (GdkNativeWindow socket_id)
-#if GTK_CHECK_VERSION (3, 0, 0)
void
wrapper_plug_set_opacity (WrapperPlug *plug,
gdouble opacity)
@@ -384,11 +249,9 @@ wrapper_plug_set_opacity (WrapperPlug *plug,
if (gtk_widget_get_opacity (GTK_WIDGET (plug)) != opacity)
gtk_widget_set_opacity (GTK_WIDGET (plug), opacity);
}
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
void
wrapper_plug_set_background_color (WrapperPlug *plug,
const gchar *color_string)
@@ -405,22 +268,8 @@ wrapper_plug_set_background_color (WrapperPlug *plug,
gtk_widget_queue_draw (GTK_WIDGET (plug));
}
-#else
-void
-wrapper_plug_set_background_color (WrapperPlug *plug,
- const gchar *color_string)
-{
- panel_return_if_fail (WRAPPER_IS_PLUG (plug));
- wrapper_plug_background_reset (plug);
-
- if (color_string != NULL)
- plug->background_color = g_strdup (color_string);
-
- gtk_widget_queue_draw (GTK_WIDGET (plug));
-}
-#endif
void
wrapper_plug_set_background_image (WrapperPlug *plug,
diff --git a/wrapper/wrapper-plug.h b/wrapper/wrapper-plug.h
index f4e7fc5..42975b4 100644
--- a/wrapper/wrapper-plug.h
+++ b/wrapper/wrapper-plug.h
@@ -20,9 +20,7 @@
#define __WRAPPER_PLUG_H__
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <gtk/gtkx.h>
-#endif
#include <libxfce4panel/libxfce4panel.h>
#include <libxfce4panel/xfce-panel-plugin-provider.h>
@@ -42,11 +40,7 @@ extern gchar *wrapper_name;
GType wrapper_plug_get_type (void) G_GNUC_CONST;
-#if GTK_CHECK_VERSION (3, 0, 0)
WrapperPlug *wrapper_plug_new (Window socket_id);
-#else
-WrapperPlug *wrapper_plug_new (GdkNativeWindow socket_id);
-#endif
void wrapper_plug_set_opacity (WrapperPlug *plug,
gdouble opacity);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list