summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am18
-rw-r--r--src/egg-unique.c151
-rw-r--r--src/egg-unique.h59
-rw-r--r--src/gpm-backlight.c15
-rw-r--r--src/gpm-button.c4
-rw-r--r--src/gpm-graph-widget.c81
-rw-r--r--src/gpm-idle.c1
-rw-r--r--src/gpm-kbd-backlight.c15
-rw-r--r--src/gpm-prefs-core.c10
-rw-r--r--src/gpm-prefs-core.h4
-rw-r--r--src/gpm-prefs.c50
-rw-r--r--src/gpm-statistics.c44
-rw-r--r--src/gpm-tray-icon.c2
-rw-r--r--src/gsd-media-keys-window.c52
-rw-r--r--src/msd-osd-window.c290
-rw-r--r--src/msd-osd-window.h17
16 files changed, 5 insertions, 808 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 2d8ab23..48d071b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,10 +39,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(DISABLE_DEPRECATED)
-if !GTK3
-AM_CPPFLAGS += $(UNIQUE_CFLAGS)
-endif
-
AM_CPPFLAGS += $(NULL)
bin_PROGRAMS = \
@@ -85,12 +81,6 @@ libgpmshared_a_SOURCES = \
gpm-upower.c \
gpm-upower.h
-if !GTK3
-libgpmshared_a_SOURCES += egg-unique.h egg-unique.c
-endif
-
-libgpmshared_a_SOURCES += $(NULL)
-
mate_power_backlight_helper_SOURCES = \
gpm-backlight-helper.c \
$(NULL)
@@ -121,10 +111,6 @@ mate_power_statistics_LDADD = \
$(DBUS_LIBS) \
-lm
-if !GTK3
-mate_power_statistics_LDADD += $(UNIQUE_LIBS)
-endif
-
mate_power_statistics_CFLAGS = \
$(WARNINGFLAGS) \
$(NULL)
@@ -145,10 +131,6 @@ mate_power_preferences_LDADD = \
$(UPOWER_LIBS) \
-lm
-if !GTK3
-mate_power_preferences_LDADD += $(UNIQUE_LIBS)
-endif
-
mate_power_preferences_CFLAGS = \
$(WARNINGFLAGS) \
$(NULL)
diff --git a/src/egg-unique.c b/src/egg-unique.c
deleted file mode 100644
index 41a5182..0000000
--- a/src/egg-unique.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2008 Richard Hughes <[email protected]>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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.
- */
-
-#include "config.h"
-
-#include <string.h>
-#include <glib.h>
-#include <unique/unique.h>
-
-#include "egg-unique.h"
-#include "egg-debug.h"
-
-static void egg_unique_finalize (GObject *object);
-
-#define EGG_UNIQUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_UNIQUE_TYPE, EggUniquePrivate))
-
-struct EggUniquePrivate
-{
- UniqueApp *uniqueapp;
-};
-
-enum {
- ACTIVATED,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = { 0 };
-
-G_DEFINE_TYPE (EggUnique, egg_unique, G_TYPE_OBJECT)
-
-/**
- * egg_unique_message_cb:
- **/
-static void
-egg_unique_message_cb (UniqueApp *app, UniqueCommand command, UniqueMessageData *message_data, guint time_s, EggUnique *egg_unique)
-{
- g_return_if_fail (EGG_IS_UNIQUE (egg_unique));
- if (command == UNIQUE_ACTIVATE)
- g_signal_emit (egg_unique, signals [ACTIVATED], 0);
-}
-
-/**
- * egg_unique_assign:
- * @egg_unique: This class instance
- * @service: The service name
- * Return value: %FALSE if we should exit as another instance is running
- **/
-gboolean
-egg_unique_assign (EggUnique *egg_unique, const gchar *service)
-{
- g_return_val_if_fail (EGG_IS_UNIQUE (egg_unique), FALSE);
- g_return_val_if_fail (service != NULL, FALSE);
-
- if (egg_unique->priv->uniqueapp != NULL) {
- g_warning ("already assigned!");
- return FALSE;
- }
-
- /* check to see if the user has another instance open */
- egg_unique->priv->uniqueapp = unique_app_new (service, NULL);
- if (unique_app_is_running (egg_unique->priv->uniqueapp)) {
- egg_debug ("You have another instance running. This program will now close");
- unique_app_send_message (egg_unique->priv->uniqueapp, UNIQUE_ACTIVATE, NULL);
- return FALSE;
- }
-
- /* Listen for messages from another instances */
- g_signal_connect (G_OBJECT (egg_unique->priv->uniqueapp), "message-received",
- G_CALLBACK (egg_unique_message_cb), egg_unique);
- return TRUE;
-}
-
-/**
- * egg_unique_class_init:
- * @egg_unique: This class instance
- **/
-static void
-egg_unique_class_init (EggUniqueClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = egg_unique_finalize;
- g_type_class_add_private (klass, sizeof (EggUniquePrivate));
-
- signals [ACTIVATED] =
- g_signal_new ("activated",
- G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EggUniqueClass, activated),
- NULL, NULL, g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-}
-
-/**
- * egg_unique_init:
- * @egg_unique: This class instance
- **/
-static void
-egg_unique_init (EggUnique *egg_unique)
-{
- egg_unique->priv = EGG_UNIQUE_GET_PRIVATE (egg_unique);
- egg_unique->priv->uniqueapp = NULL;
-}
-
-/**
- * egg_unique_finalize:
- * @object: This class instance
- **/
-static void
-egg_unique_finalize (GObject *object)
-{
- EggUnique *egg_unique;
- g_return_if_fail (object != NULL);
- g_return_if_fail (EGG_IS_UNIQUE (object));
-
- egg_unique = EGG_UNIQUE_OBJECT (object);
- egg_unique->priv = EGG_UNIQUE_GET_PRIVATE (egg_unique);
-
- if (egg_unique->priv->uniqueapp != NULL)
- g_object_unref (egg_unique->priv->uniqueapp);
- G_OBJECT_CLASS (egg_unique_parent_class)->finalize (object);
-}
-
-/**
- * egg_unique_new:
- * Return value: new class instance.
- **/
-EggUnique *
-egg_unique_new (void)
-{
- EggUnique *egg_unique;
- egg_unique = g_object_new (EGG_UNIQUE_TYPE, NULL);
- return EGG_UNIQUE_OBJECT (egg_unique);
-}
-
diff --git a/src/egg-unique.h b/src/egg-unique.h
deleted file mode 100644
index 7259135..0000000
--- a/src/egg-unique.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2008 Richard Hughes <[email protected]>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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 __EGG_UNIQUE_H
-#define __EGG_UNIQUE_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EGG_UNIQUE_TYPE (egg_unique_get_type ())
-#define EGG_UNIQUE_OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EGG_UNIQUE_TYPE, EggUnique))
-#define EGG_UNIQUE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EGG_UNIQUE_TYPE, EggUniqueClass))
-#define EGG_IS_UNIQUE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_UNIQUE_TYPE))
-#define EGG_IS_UNIQUE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EGG_UNIQUE_TYPE))
-#define EGG_UNIQUE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EGG_UNIQUE_TYPE, EggUniqueClass))
-
-typedef struct EggUniquePrivate EggUniquePrivate;
-
-typedef struct
-{
- GObject parent;
- EggUniquePrivate *priv;
-} EggUnique;
-
-typedef struct
-{
- GObjectClass parent_class;
- void (* activated) (EggUnique *unique);
-} EggUniqueClass;
-
-GType egg_unique_get_type (void);
-EggUnique *egg_unique_new (void);
-
-gboolean egg_unique_assign (EggUnique *unique,
- const gchar *service);
-
-G_END_DECLS
-
-#endif /* __EGG_UNIQUE_H */
-
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c
index 82841b3..0989640 100644
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -55,10 +55,6 @@
#include "gpm-icon-names.h"
#include "egg-console-kit.h"
-#if !GTK_CHECK_VERSION(3,0,0)
-#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
-#endif
-
#define GPM_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BACKLIGHT, GpmBacklightPrivate))
struct GpmBacklightPrivate
@@ -214,11 +210,9 @@ gpm_backlight_dialog_show (GpmBacklight *backlight)
GdkScreen *pointer_screen;
GdkRectangle geometry;
int monitor;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *device;
-#endif
/*
* get the window size
@@ -236,7 +230,6 @@ gpm_backlight_dialog_show (GpmBacklight *backlight)
}
pointer_screen = NULL;
-#if GTK_CHECK_VERSION(3,0,0)
display = gtk_widget_get_display (backlight->priv->popup);
device_manager = gdk_display_get_device_manager (display);
device = gdk_device_manager_get_client_pointer (device_manager);
@@ -244,13 +237,7 @@ gpm_backlight_dialog_show (GpmBacklight *backlight)
&pointer_screen,
&pointer_x,
&pointer_y);
-#else
- gdk_display_get_pointer (gtk_widget_get_display (backlight->priv->popup),
- &pointer_screen,
- &pointer_x,
- &pointer_y,
- NULL);
-#endif
+
monitor = gdk_screen_get_monitor_at_point (pointer_screen,
pointer_x,
pointer_y);
diff --git a/src/gpm-button.c b/src/gpm-button.c
index 8c2e808..cbf7f45 100644
--- a/src/gpm-button.c
+++ b/src/gpm-button.c
@@ -171,11 +171,7 @@ gpm_button_grab_keystring (GpmButton *button, guint64 keycode)
/* we are not processing the error */
gdk_flush ();
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
egg_debug ("Grabbed modmask=%x, keycode=%li", modmask, (long int) keycode);
return TRUE;
diff --git a/src/gpm-graph-widget.c b/src/gpm-graph-widget.c
index af74ba7..a8acf46 100644
--- a/src/gpm-graph-widget.c
+++ b/src/gpm-graph-widget.c
@@ -24,6 +24,7 @@
#include <pango/pangocairo.h>
#include <glib/gi18n.h>
#include <stdlib.h>
+#include <math.h>
#include "gpm-common.h"
#include "gpm-point-obj.h"
@@ -33,10 +34,6 @@
#include "egg-color.h"
#include "egg-precision.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#include <math.h>
-#endif
-
G_DEFINE_TYPE (GpmGraphWidget, gpm_graph_widget, GTK_TYPE_DRAWING_AREA);
#define GPM_GRAPH_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_GRAPH_WIDGET, GpmGraphWidgetPrivate))
#define GPM_GRAPH_WIDGET_FONT "Sans 8"
@@ -73,11 +70,7 @@ struct GpmGraphWidgetPrivate
GPtrArray *plot_list;
};
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean gpm_graph_widget_draw (GtkWidget *graph, cairo_t *cr);
-#else
-static gboolean gpm_graph_widget_expose (GtkWidget *graph, GdkEventExpose *event);
-#endif
static void gpm_graph_widget_finalize (GObject *object);
enum
@@ -241,11 +234,7 @@ gpm_graph_widget_class_init (GpmGraphWidgetClass *class)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
GObjectClass *object_class = G_OBJECT_CLASS (class);
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->draw = gpm_graph_widget_draw;
-#else
- widget_class->expose_event = gpm_graph_widget_expose;
-#endif
object_class->get_property = up_graph_get_property;
object_class->set_property = up_graph_set_property;
object_class->finalize = gpm_graph_widget_finalize;
@@ -1075,7 +1064,6 @@ gpm_graph_widget_legend_calculate_size (GpmGraphWidget *graph, cairo_t *cr,
return TRUE;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
/**
* gpm_graph_widget_draw:
* @graph: This class instance
@@ -1111,43 +1099,6 @@ gpm_graph_widget_draw (GtkWidget *widget, cairo_t *cr)
graph->priv->box_y = 5;
gtk_widget_get_allocation (widget, &allocation);
-#else
-/**
- * gpm_graph_widget_draw_graph:
- * @graph: This class instance
- * @cr: Cairo drawing context
- *
- * Draw the complete graph, with the box, the grid, the labels and the line.
- **/
-static void
-gpm_graph_widget_draw_graph (GtkWidget *graph_widget, cairo_t *cr)
-{
- GtkAllocation allocation;
- gint legend_x = 0;
- gint legend_y = 0;
- guint legend_height = 0;
- guint legend_width = 0;
- gfloat data_x;
- gfloat data_y;
-
- GpmGraphWidget *graph = (GpmGraphWidget*) graph_widget;
- g_return_if_fail (graph != NULL);
- g_return_if_fail (GPM_IS_GRAPH_WIDGET (graph));
-
- gpm_graph_widget_legend_calculate_size (graph, cr, &legend_width, &legend_height);
- cairo_save (cr);
-
- /* we need this so we know the y text */
- if (graph->priv->autorange_x)
- gpm_graph_widget_autorange_x (graph);
- if (graph->priv->autorange_y)
- gpm_graph_widget_autorange_y (graph);
-
- graph->priv->box_x = gpm_graph_widget_get_y_label_max_width (graph, cr) + 10;
- graph->priv->box_y = 5;
-
- gtk_widget_get_allocation (graph_widget, &allocation);
-#endif
graph->priv->box_height = allocation.height - (20 + graph->priv->box_y);
/* make size adjustment for legend */
@@ -1180,38 +1131,8 @@ gpm_graph_widget_draw_graph (GtkWidget *graph_widget, cairo_t *cr)
gpm_graph_widget_draw_legend (graph, legend_x, legend_y, legend_width, legend_height);
cairo_restore (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
- return FALSE;
-#endif
-}
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
-/**
- * gpm_graph_widget_expose:
- * @graph: This class instance
- * @event: The expose event
- *
- * Just repaint the entire graph widget on expose.
- **/
-static gboolean
-gpm_graph_widget_expose (GtkWidget *graph, GdkEventExpose *event)
-{
- cairo_t *cr;
-
- /* get a cairo_t */
- cr = gdk_cairo_create (gtk_widget_get_window (graph));
- cairo_rectangle (cr,
- event->area.x, event->area.y,
- event->area.width, event->area.height);
- cairo_clip (cr);
- ((GpmGraphWidget *)graph)->priv->cr = cr;
-
- gpm_graph_widget_draw_graph (graph, cr);
-
- cairo_destroy (cr);
return FALSE;
}
-#endif
/**
* gpm_graph_widget_new:
diff --git a/src/gpm-idle.c b/src/gpm-idle.c
index a593fe9..d2e92e0 100644
--- a/src/gpm-idle.c
+++ b/src/gpm-idle.c
@@ -36,7 +36,6 @@
#include <glib.h>
#include <glib/gi18n.h>
-#include <gtk/gtk.h>
#include "egg-debug.h"
#include "egg-idletime.h"
diff --git a/src/gpm-kbd-backlight.c b/src/gpm-kbd-backlight.c
index cdfadbc..ae8e0fa 100644
--- a/src/gpm-kbd-backlight.c
+++ b/src/gpm-kbd-backlight.c
@@ -32,10 +32,6 @@
#include "gpm-kbd-backlight.h"
#include "gsd-media-keys-window.h"
-#if !GTK_CHECK_VERSION(3,0,0)
-#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
-#endif
-
#define GPM_KBD_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_KBD_BACKLIGHT, GpmKbdBacklightPrivate))
struct GpmKbdBacklightPrivate
@@ -190,11 +186,9 @@ gpm_kbd_backlight_dialog_show (GpmKbdBacklight *backlight)
GdkScreen *pointer_screen;
GdkRectangle geometry;
int monitor;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *device;
-#endif
/*
* get the window size
@@ -212,7 +206,6 @@ gpm_kbd_backlight_dialog_show (GpmKbdBacklight *backlight)
}
pointer_screen = NULL;
-#if GTK_CHECK_VERSION(3,0,0)
display = gtk_widget_get_display (backlight->priv->popup);
device_manager = gdk_display_get_device_manager (display);
device = gdk_device_manager_get_client_pointer (device_manager);
@@ -220,13 +213,7 @@ gpm_kbd_backlight_dialog_show (GpmKbdBacklight *backlight)
&pointer_screen,
&pointer_x,
&pointer_y);
-#else
- gdk_display_get_pointer (gtk_widget_get_display (backlight->priv->popup),
- &pointer_screen,
- &pointer_x,
- &pointer_y,
- NULL);
-#endif
+
monitor = gdk_screen_get_monitor_at_point (pointer_screen,
pointer_x,
pointer_y);
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 2a2459f..b33ff22 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -110,17 +110,11 @@ gpm_prefs_class_init (GpmPrefsClass *klass)
* Activates (shows) the window.
**/
void
-#if GTK_CHECK_VERSION (3, 0, 0)
gpm_prefs_activate_window (GtkApplication *app, GpmPrefs *prefs)
-#else
-gpm_prefs_activate_window (GpmPrefs *prefs)
-#endif
{
GtkWindow *window;
window = GTK_WINDOW (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences"));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_application_add_window (GTK_APPLICATION (app), window);
-#endif
gtk_window_present (window);
}
@@ -871,10 +865,6 @@ gpm_prefs_init (GpmPrefs *prefs)
prefs_setup_ups (prefs);
prefs_setup_general (prefs);
prefs_setup_notification (prefs);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_widget_show (main_window);
-#endif
}
/**
diff --git a/src/gpm-prefs-core.h b/src/gpm-prefs-core.h
index ed8f936..6810d4d 100644
--- a/src/gpm-prefs-core.h
+++ b/src/gpm-prefs-core.h
@@ -50,12 +50,8 @@ typedef struct
GType gpm_prefs_get_type (void);
GpmPrefs *gpm_prefs_new (void);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *gpm_window (GpmPrefs *prefs);
void gpm_prefs_activate_window (GtkApplication *app, GpmPrefs *prefs);
-#else
-void gpm_prefs_activate_window (GpmPrefs *prefs);
-#endif
G_END_DECLS
diff --git a/src/gpm-prefs.c b/src/gpm-prefs.c
index ad3c3a2..4785cc0 100644
--- a/src/gpm-prefs.c
+++ b/src/gpm-prefs.c
@@ -30,11 +30,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-/* local .la */
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#include <egg-unique.h>
-#endif
-
#include "gpm-common.h"
#include "egg-debug.h"
#include "gpm-prefs-core.h"
@@ -58,17 +53,10 @@ gpm_prefs_help_cb (GpmPrefs *prefs)
* We have been asked to show the window
**/
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
gpm_prefs_activated_cb (GtkApplication *app, GpmPrefs *prefs)
{
gpm_prefs_activate_window (app, prefs);
}
-#else
-gpm_prefs_activated_cb (EggUnique *egg_unique, GpmPrefs *prefs)
-{
- gpm_prefs_activate_window (prefs);
-}
-#endif
/**
* main:
@@ -80,13 +68,9 @@ main (int argc, char **argv)
GOptionContext *context;
GpmPrefs *prefs = NULL;
gboolean ret;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkApplication *app;
GtkWidget *window;
gint status;
-#else
- EggUnique *egg_unique;
-#endif
const GOptionEntry options[] = {
{ "verbose", '\0', 0, G_OPTION_ARG_NONE, &verbose,
@@ -105,62 +89,28 @@ main (int argc, char **argv)
g_option_context_add_group (context, gtk_get_option_group (FALSE));
g_option_context_parse (context, &argc, &argv, NULL);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_init (&argc, &argv);
-#endif
egg_debug_init (verbose);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_init (&argc, &argv);
app = gtk_application_new("org.mate.PowerManager.Preferences", 0);
-#else
- /* are we already activated? */
- egg_unique = egg_unique_new ();
- ret = egg_unique_assign (egg_unique, "org.mate.PowerManager.Preferences");
- if (!ret) {
- goto unique_out;
- }
-#endif
prefs = gpm_prefs_new ();
-#if GTK_CHECK_VERSION (3, 0, 0)
window = gpm_window (prefs);
g_signal_connect (app, "activate",
-#else
- g_signal_connect (egg_unique, "activated",
-#endif
G_CALLBACK (gpm_prefs_activated_cb), prefs);
g_signal_connect (prefs, "action-help",
G_CALLBACK (gpm_prefs_help_cb), prefs);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped (prefs, "action-close",
G_CALLBACK (gtk_widget_destroy), window);
-#else
- g_signal_connect_swapped (prefs, "action-close",
- G_CALLBACK (gtk_main_quit), NULL);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
status = g_application_run (G_APPLICATION (app), argc, argv);
-#else
- gtk_main ();
-#endif
g_object_unref (prefs);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (app);
-#else
-unique_out:
- g_object_unref (egg_unique);
-#endif
/* seems to not work...
g_option_context_free (context); */
-#if GTK_CHECK_VERSION (3, 0, 0)
return status;
-#else
- return 0;
-#endif
}
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index 21a0a52..af24fbb 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -33,9 +33,6 @@
#include "egg-debug.h"
#include "egg-color.h"
#include "egg-array-float.h"
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#include "egg-unique.h"
-#endif
#include "gpm-common.h"
#include "gpm-icon-names.h"
@@ -1177,17 +1174,11 @@ gpm_stats_devices_treeview_clicked_cb (GtkTreeSelection *selection, gboolean dat
* gpm_stats_window_activated_cb
**/
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
gpm_stats_window_activated_cb (GtkApplication *app, gpointer data)
-#else
-gpm_stats_window_activated_cb (EggUnique *egg_unique, gpointer data)
-#endif
{
GtkWidget *widget;
widget = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_stats"));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (widget));
-#endif
gtk_window_present (GTK_WINDOW (widget));
}
@@ -1571,12 +1562,8 @@ main (int argc, char *argv[])
GtkBox *box;
GtkWidget *widget, *window;
GtkTreeSelection *selection;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkApplication *app;
gint status;
-#else
- EggUnique *egg_unique;
-#endif
gboolean ret;
UpClient *client;
GPtrArray *devices = NULL;
@@ -1617,21 +1604,9 @@ main (int argc, char *argv[])
egg_debug_init (verbose);
gtk_init (&argc, &argv);
-#if GTK_CHECK_VERSION (3, 0, 0)
app = gtk_application_new ("org.mate.PowerManager.Statistics", 0);
-#else
- /* are we already activated? */
- egg_unique = egg_unique_new ();
- ret = egg_unique_assign (egg_unique, "org.mate.PowerManager.Statistics");
- if (!ret)
- goto unique_out;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (app, "activate",
-#else
- g_signal_connect (egg_unique, "activated",
-#endif
G_CALLBACK (gpm_stats_window_activated_cb), NULL);
/* add application specific icons to search path */
@@ -1669,13 +1644,8 @@ main (int argc, char *argv[])
/* Get the main window quit */
widget = GTK_WIDGET (gtk_builder_get_object (builder, "button_close"));
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped (window, "delete_event", G_CALLBACK (gtk_widget_destroy), window);
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (gtk_widget_destroy), window);
-#else
- g_signal_connect_swapped (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect_swapped (widget, "clicked", G_CALLBACK (gtk_main_quit), NULL);
-#endif
gtk_widget_grab_default (widget);
widget = GTK_WIDGET (gtk_builder_get_object (builder, "button_help"));
@@ -1877,12 +1847,7 @@ main (int argc, char *argv[])
widget = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_stats"));
-#if GTK_CHECK_VERSION (3, 0, 0)
status = g_application_run (G_APPLICATION (app), argc, argv);
-#else
- gtk_widget_show (widget);
- gtk_main ();
-#endif
#if !UP_CHECK_VERSION(0, 99, 0)
out:
#endif
@@ -1894,16 +1859,7 @@ out:
g_object_unref (wakeups);
g_object_unref (builder);
g_object_unref (list_store_info);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (app);
-#else
-unique_out:
- g_object_unref (egg_unique);
-#endif
g_free (last_device);
-#if GTK_CHECK_VERSION (3, 0, 0)
return status;
-#else
- return 0;
-#endif
}
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index 052af38..3bcd09b 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -355,7 +355,6 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon)
G_CALLBACK (gpm_tray_icon_show_preferences_cb), icon);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-#if GTK_CHECK_VERSION (3, 0, 0)
/*Set up custom panel menu theme support-gtk3 only */
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu));
/* Fix any failures of compiz/other wm's to communicate with gtk for transparency in menu theme */
@@ -367,7 +366,6 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon)
context = gtk_widget_get_style_context (GTK_WIDGET(toplevel));
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
-#endif
/* about */
item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL);
diff --git a/src/gsd-media-keys-window.c b/src/gsd-media-keys-window.c
index cec33f9..e59ba44 100644
--- a/src/gsd-media-keys-window.c
+++ b/src/gsd-media-keys-window.c
@@ -402,29 +402,14 @@ draw_volume_boxes (MsdMediaKeysWindow *window,
double height)
{
gdouble x1;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
-#else
- GdkColor color;
- double r, g, b;
- GtkStyle *style;
-#endif
-#if !GTK_CHECK_VERSION (3, 0, 0)
- _x0 += 0.5;
- _y0 += 0.5;
-#endif
height = round (height) - 1;
width = round (width) - 1;
x1 = round ((width - 1) * percentage);
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (GTK_WIDGET (window));
-#else
- style = gtk_widget_get_style (GTK_WIDGET (window));
-#endif
/* bar background */
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
@@ -444,35 +429,6 @@ draw_volume_boxes (MsdMediaKeysWindow *window,
gtk_render_frame (context, cr, _x0 + 0.5, _y0 + 0.5, x1, height -1 );
gtk_style_context_restore (context);
-#else
- msd_osd_window_color_reverse (&style->dark[GTK_STATE_NORMAL], &color);
- r = (float)color.red / 65535.0;
- g = (float)color.green / 65535.0;
- b = (float)color.blue / 65535.0;
- msd_osd_window_draw_rounded_rectangle (cr, 1.0, _x0, _y0, height / 6, width, height);
- cairo_set_source_rgba (cr, r, g, b, MSD_OSD_WINDOW_FG_ALPHA / 2);
- cairo_fill_preserve (cr);
-
- /* bar border */
- msd_osd_window_color_reverse (&style->light[GTK_STATE_NORMAL], &color);
- r = (float)color.red / 65535.0;
- g = (float)color.green / 65535.0;
- b = (float)color.blue / 65535.0;
- cairo_set_source_rgba (cr, r, g, b, MSD_OSD_WINDOW_FG_ALPHA / 2);
- cairo_set_line_width (cr, 1);
- cairo_stroke (cr);
-
- /* bar progress */
- if (percentage < 0.01)
- return;
- color = style->bg[GTK_STATE_NORMAL];
- r = (float)color.red / 65535.0;
- g = (float)color.green / 65535.0;
- b = (float)color.blue / 65535.0;
- msd_osd_window_draw_rounded_rectangle (cr, 1.0, _x0 + 0.5, _y0 + 0.5, height / 6 - 0.5, x1, height - 1);
- cairo_set_source_rgba (cr, r, g, b, MSD_OSD_WINDOW_FG_ALPHA);
- cairo_fill (cr);
-#endif
}
static void
@@ -664,11 +620,7 @@ draw_action_custom (MsdMediaKeysWindow *window,
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
msd_media_keys_window_draw_when_composited (MsdOsdWindow *osd_window,
-#else
-msd_media_keys_window_expose_when_composited (MsdOsdWindow *osd_window,
-#endif
cairo_t *cr)
{
MsdMediaKeysWindow *window = MSD_MEDIA_KEYS_WINDOW (osd_window);
@@ -690,11 +642,7 @@ msd_media_keys_window_class_init (MsdMediaKeysWindowClass *klass)
{
MsdOsdWindowClass *osd_window_class = MSD_OSD_WINDOW_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
osd_window_class->draw_when_composited = msd_media_keys_window_draw_when_composited;
-#else
- osd_window_class->expose_when_composited = msd_media_keys_window_expose_when_composited;
-#endif
g_type_class_add_private (klass, sizeof (MsdMediaKeysWindowPrivate));
}
diff --git a/src/msd-osd-window.c b/src/msd-osd-window.c
index 1b97df1..d40cd13 100644
--- a/src/msd-osd-window.c
+++ b/src/msd-osd-window.c
@@ -55,11 +55,7 @@ struct MsdOsdWindowPrivate
};
enum {
-#if GTK_CHECK_VERSION (3, 0, 0)
DRAW_WHEN_COMPOSITED,
-#else
- EXPOSE_WHEN_COMPOSITED,
-#endif
LAST_SIGNAL
};
@@ -143,137 +139,27 @@ add_hide_timeout (MsdOsdWindow *window)
window);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-void
-msd_osd_window_draw_rounded_rectangle (cairo_t* cr,
- gdouble aspect,
- gdouble x,
- gdouble y,
- gdouble corner_radius,
- gdouble width,
- gdouble height)
-{
- gdouble radius = corner_radius / aspect;
-
- cairo_move_to (cr, x + radius, y);
-
- cairo_line_to (cr,
- x + width - radius,
- y);
- cairo_arc (cr,
- x + width - radius,
- y + radius,
- radius,
- -90.0f * G_PI / 180.0f,
- 0.0f * G_PI / 180.0f);
- cairo_line_to (cr,
- x + width,
- y + height - radius);
- cairo_arc (cr,
- x + width - radius,
- y + height - radius,
- radius,
- 0.0f * G_PI / 180.0f,
- 90.0f * G_PI / 180.0f);
- cairo_line_to (cr,
- x + radius,
- y + height);
- cairo_arc (cr,
- x + radius,
- y + height - radius,
- radius,
- 90.0f * G_PI / 180.0f,
- 180.0f * G_PI / 180.0f);
- cairo_line_to (cr,
- x,
- y + radius);
- cairo_arc (cr,
- x + radius,
- y + radius,
- radius,
- 180.0f * G_PI / 180.0f,
- 270.0f * G_PI / 180.0f);
- cairo_close_path (cr);
-}
-
-void
-msd_osd_window_color_reverse (const GdkColor *a,
- GdkColor *b)
-{
- gdouble red;
- gdouble green;
- gdouble blue;
- gdouble h;
- gdouble s;
- gdouble v;
-
- red = (gdouble) a->red / 65535.0;
- green = (gdouble) a->green / 65535.0;
- blue = (gdouble) a->blue / 65535.0;
-
- gtk_rgb_to_hsv (red, green, blue, &h, &s, &v);
-
- v = 0.5 + (0.5 - v);
- if (v > 1.0)
- v = 1.0;
- else if (v < 0.0)
- v = 0.0;
-
- gtk_hsv_to_rgb (h, s, v, &red, &green, &blue);
-
- b->red = red * 65535.0;
- b->green = green * 65535.0;
- b->blue = blue * 65535.0;
-}
-#endif
-
-/* This is our expose-event handler when the window is in a compositing manager.
+/* This is our draw-event handler when the window is in a compositing manager.
* We draw everything by hand, using Cairo, so that we can have a nice
* transparent/rounded look.
*/
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
draw_when_composited (GtkWidget *widget, cairo_t *orig_cr)
-#else
-expose_when_composited (GtkWidget *widget, GdkEventExpose *event)
-#endif
{
MsdOsdWindow *window;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *context;
-#endif
cairo_t *cr;
cairo_surface_t *surface;
int width;
int height;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
-#else
- GtkStyle *style;
- GdkColor color;
- double r, g, b;
-#endif
window = MSD_OSD_WINDOW (widget);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- context = gdk_cairo_create (gtk_widget_get_window (widget));
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (widget);
cairo_set_operator (orig_cr, CAIRO_OPERATOR_SOURCE);
-#else
- style = gtk_widget_get_style (widget);
- cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
-#endif
gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
-#if GTK_CHECK_VERSION (3, 0, 0)
surface = cairo_surface_create_similar (cairo_get_target (orig_cr),
-#else
- surface = cairo_surface_create_similar (cairo_get_target (context),
-#endif
CAIRO_CONTENT_COLOR_ALPHA,
width,
height);
@@ -286,66 +172,26 @@ expose_when_composited (GtkWidget *widget, GdkEventExpose *event)
if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
goto done;
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
- cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_paint (cr);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_render_background (context, cr, 0, 0, width, height);
gtk_render_frame (context, cr, 0, 0, width, height);
-#else
- /* draw a box */
- msd_osd_window_draw_rounded_rectangle (cr, 1.0, 0.5, 0.5, height / 10, width-1, height-1);
- msd_osd_window_color_reverse (&style->bg[GTK_STATE_NORMAL], &color);
- r = (float)color.red / 65535.0;
- g = (float)color.green / 65535.0;
- b = (float)color.blue / 65535.0;
- cairo_set_source_rgba (cr, r, g, b, BG_ALPHA);
- cairo_fill_preserve (cr);
-
- msd_osd_window_color_reverse (&style->text_aa[GTK_STATE_NORMAL], &color);
- r = (float)color.red / 65535.0;
- g = (float)color.green / 65535.0;
- b = (float)color.blue / 65535.0;
- cairo_set_source_rgba (cr, r, g, b, BG_ALPHA / 2);
- cairo_set_line_width (cr, 1);
- cairo_stroke (cr);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_emit (window, signals[DRAW_WHEN_COMPOSITED], 0, cr);
-#else
- g_signal_emit (window, signals[EXPOSE_WHEN_COMPOSITED], 0, cr);
-#endif
cairo_destroy (cr);
/* Make sure we have a transparent background */
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_rectangle (orig_cr, 0, 0, width, height);
cairo_set_source_rgba (orig_cr, 0.0, 0.0, 0.0, 0.0);
cairo_fill (orig_cr);
cairo_set_source_surface (orig_cr, surface, 0, 0);
cairo_paint_with_alpha (orig_cr, window->priv->fade_out_alpha);
-#else
- cairo_rectangle (context, 0, 0, width, height);
- cairo_set_source_rgba (context, 0.0, 0.0, 0.0, 0.0);
- cairo_fill (context);
-
- cairo_set_source_surface (context, surface, 0, 0);
- cairo_paint_with_alpha (context, window->priv->fade_out_alpha);
-#endif
done:
if (surface != NULL) {
cairo_surface_destroy (surface);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_destroy (context);
-#endif
}
/* This is our expose/draw-event handler when the window is *not* in a compositing manager.
@@ -354,7 +200,6 @@ done:
* either case (composited or non-composited), callers can assume that this works
* identically to a GtkWindow without any intermediate widgetry.
*/
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
draw_when_not_composited (GtkWidget *widget, cairo_t *cr)
{
@@ -374,29 +219,7 @@ draw_when_not_composited (GtkWidget *widget, cairo_t *cr)
width,
height);
}
-#else
-static void
-expose_when_not_composited (GtkWidget *widget, GdkEventExpose *event)
-{
- GtkAllocation allocation;
-
- gtk_widget_get_allocation (widget, &allocation);
-
- gtk_paint_shadow (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
- gtk_widget_get_state (widget),
- GTK_SHADOW_OUT,
- &event->area,
- widget,
- NULL, /* NULL detail -> themes should use the MsdOsdWindow widget name, probably */
- 0,
- 0,
- allocation.width,
- allocation.height);
-}
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
msd_osd_window_draw (GtkWidget *widget,
cairo_t *cr)
@@ -417,28 +240,6 @@ msd_osd_window_draw (GtkWidget *widget,
return FALSE;
}
-#else
-static gboolean
-msd_osd_window_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- MsdOsdWindow *window;
- GtkWidget *child;
-
- window = MSD_OSD_WINDOW (widget);
-
- if (window->priv->is_composited)
- expose_when_composited (widget, event);
- else
- expose_when_not_composited (widget, event);
-
- child = gtk_bin_get_child (GTK_BIN (window));
- if (child)
- gtk_container_propagate_expose (GTK_CONTAINER (window), child, event);
-
- return FALSE;
-}
-#endif
static void
msd_osd_window_real_show (GtkWidget *widget)
@@ -470,7 +271,6 @@ msd_osd_window_real_hide (GtkWidget *widget)
static void
msd_osd_window_real_realize (GtkWidget *widget)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkScreen *screen;
GdkVisual *visual;
cairo_region_t *region;
@@ -492,40 +292,8 @@ msd_osd_window_real_realize (GtkWidget *widget)
region = cairo_region_create ();
gtk_widget_input_shape_combine_region (widget, region);
cairo_region_destroy (region);
-#else
- GdkColormap *colormap;
- GtkAllocation allocation;
- GdkBitmap *mask;
- cairo_t *cr;
-
- colormap = gdk_screen_get_rgba_colormap (gtk_widget_get_screen (widget));
-
- if (colormap != NULL) {
- gtk_widget_set_colormap (widget, colormap);
- }
-
- if (GTK_WIDGET_CLASS (msd_osd_window_parent_class)->realize) {
- GTK_WIDGET_CLASS (msd_osd_window_parent_class)->realize (widget);
- }
-
- gtk_widget_get_allocation (widget, &allocation);
- mask = gdk_pixmap_new (gtk_widget_get_window (widget),
- allocation.width,
- allocation.height,
- 1);
- cr = gdk_cairo_create (mask);
-
- cairo_set_source_rgba (cr, 1., 1., 1., 0.);
- cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_paint (cr);
-
- /* make the whole window ignore events */
- gdk_window_input_shape_combine_mask (gtk_widget_get_window (widget), mask, 0, 0);
- g_object_unref (mask);
- cairo_destroy (cr);
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
+
static void
msd_osd_window_style_updated (GtkWidget *widget)
{
@@ -543,25 +311,7 @@ msd_osd_window_style_updated (GtkWidget *widget)
gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &padding);
gtk_container_set_border_width (GTK_CONTAINER (widget), 12 + MAX (padding.left, padding.top));
}
-#else
-static void
-msd_osd_window_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- GtkStyle *style;
-
- GTK_WIDGET_CLASS (msd_osd_window_parent_class)->style_set (widget, previous_style);
- /* We set our border width to 12 (per the MATE standard), plus the
- * thickness of the frame that we draw in our expose handler. This will
- * make our child be 12 pixels away from the frame.
- */
-
- style = gtk_widget_get_style (widget);
- gtk_container_set_border_width (GTK_CONTAINER (widget), 12 + MAX (style->xthickness, style->ythickness));
-}
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
msd_osd_window_get_preferred_width (GtkWidget *widget,
gint *minimum,
@@ -599,23 +349,6 @@ msd_osd_window_get_preferred_height (GtkWidget *widget,
*minimum += padding.top;
*natural += padding.top;
}
-#else
-static void
-msd_osd_window_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- GtkStyle *style;
-
- GTK_WIDGET_CLASS (msd_osd_window_parent_class)->size_request (widget, requisition);
-
- /* See the comment in msd_osd_window_style_set() for why we add the thickness here */
-
- style = gtk_widget_get_style (widget);
-
- requisition->width += style->xthickness;
- requisition->height += style->ythickness;
-}
-#endif
static GObject *
msd_osd_window_constructor (GType type,
@@ -634,11 +367,9 @@ msd_osd_window_constructor (GType type,
"focus-on-map", FALSE,
NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *widget = GTK_WIDGET (object);
GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
gtk_style_context_add_class (style_context, "osd");
-#endif
return object;
}
@@ -654,29 +385,15 @@ msd_osd_window_class_init (MsdOsdWindowClass *klass)
widget_class->show = msd_osd_window_real_show;
widget_class->hide = msd_osd_window_real_hide;
widget_class->realize = msd_osd_window_real_realize;
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->style_updated = msd_osd_window_style_updated;
widget_class->get_preferred_width = msd_osd_window_get_preferred_width;
widget_class->get_preferred_height = msd_osd_window_get_preferred_height;
widget_class->draw = msd_osd_window_draw;
-#else
- widget_class->style_set = msd_osd_window_style_set;
- widget_class->size_request = msd_osd_window_size_request;
- widget_class->expose_event = msd_osd_window_expose_event;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
signals[DRAW_WHEN_COMPOSITED] = g_signal_new ("draw-when-composited",
-#else
- signals[EXPOSE_WHEN_COMPOSITED] = g_signal_new ("expose-when-composited",
-#endif
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_FIRST,
-#if GTK_CHECK_VERSION (3, 0, 0)
G_STRUCT_OFFSET (MsdOsdWindowClass, draw_when_composited),
-#else
- G_STRUCT_OFFSET (MsdOsdWindowClass, expose_when_composited),
-#endif
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
@@ -685,7 +402,6 @@ msd_osd_window_class_init (MsdOsdWindowClass *klass)
#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_class_set_css_name (widget_class, "MsdOsdWindow");
#endif
-
g_type_class_add_private (klass, sizeof (MsdOsdWindowPrivate));
}
@@ -733,10 +449,8 @@ msd_osd_window_init (MsdOsdWindow *window)
gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *style = gtk_widget_get_style_context (GTK_WIDGET (window));
gtk_style_context_add_class (style, "window-frame");
-#endif
/* assume 130x130 on a 640x480 display and scale from there */
scalew = gdk_screen_get_width (screen) / 640.0;
diff --git a/src/msd-osd-window.h b/src/msd-osd-window.h
index 42229f4..ac3325a 100644
--- a/src/msd-osd-window.h
+++ b/src/msd-osd-window.h
@@ -70,11 +70,7 @@ struct MsdOsdWindow {
struct MsdOsdWindowClass {
GtkWindowClass parent_class;
-#if GTK_CHECK_VERSION (3, 0, 0)
void (* draw_when_composited) (MsdOsdWindow *window, cairo_t *cr);
-#else
- void (* expose_when_composited) (MsdOsdWindow *window, cairo_t *cr);
-#endif
};
GType msd_osd_window_get_type (void);
@@ -84,19 +80,6 @@ gboolean msd_osd_window_is_composited (MsdOsdWindow *windo
gboolean msd_osd_window_is_valid (MsdOsdWindow *window);
void msd_osd_window_update_and_hide (MsdOsdWindow *window);
-#if !GTK_CHECK_VERSION (3, 0, 0)
-void msd_osd_window_draw_rounded_rectangle (cairo_t *cr,
- gdouble aspect,
- gdouble x,
- gdouble y,
- gdouble corner_radius,
- gdouble width,
- gdouble height);
-
-void msd_osd_window_color_reverse (const GdkColor *a,
- GdkColor *b);
-#endif
-
#ifdef __cplusplus
}
#endif