[Xfce4-commits] [apps/xfce4-taskmanager] 13/14: Use #if GTK_CHECK_VERSION(3, 0, 0) instead of #ifdef HAVE_GTK3
noreply at xfce.org
noreply at xfce.org
Fri Dec 19 22:58:43 CET 2014
This is an automated email from the git hooks/post-receive script.
landry pushed a commit to branch master
in repository apps/xfce4-taskmanager.
commit 5b68649063cb4bfeec107058ccbb051fa404244b
Author: Landry Breuil <landry at xfce.org>
Date: Fri Dec 19 22:54:16 2014 +0100
Use #if GTK_CHECK_VERSION(3, 0, 0) instead of #ifdef HAVE_GTK3
---
src/exec-tool-button.c | 2 +-
src/process-monitor.c | 8 ++++----
src/process-statusbar.c | 8 ++++----
src/process-window.c | 6 +++---
src/settings-dialog.c | 6 +++---
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/exec-tool-button.c b/src/exec-tool-button.c
index 50db0ca..1bf5bc0 100644
--- a/src/exec-tool-button.c
+++ b/src/exec-tool-button.c
@@ -79,7 +79,7 @@ static void
execute_command (const gchar *command)
{
GError *error = NULL;
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
GdkScreen *screen;
GdkDisplay *display;
GdkAppLaunchContext *launch_context;
diff --git a/src/process-monitor.c b/src/process-monitor.c
index d0e8d7e..726b85d 100644
--- a/src/process-monitor.c
+++ b/src/process-monitor.c
@@ -40,7 +40,7 @@ G_DEFINE_TYPE (XtmProcessMonitor, xtm_process_monitor, GTK_TYPE_DRAWING_AREA)
static void xtm_process_monitor_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void xtm_process_monitor_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
static gboolean xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr);
#else
static gboolean xtm_process_monitor_expose (GtkWidget *widget, GdkEventExpose *event);
@@ -57,7 +57,7 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass)
xtm_process_monitor_parent_class = g_type_class_peek_parent (klass);
class->get_property = xtm_process_monitor_get_property;
class->set_property = xtm_process_monitor_set_property;
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
widget_class->draw = xtm_process_monitor_draw;
#else
widget_class->expose_event = xtm_process_monitor_expose;
@@ -114,7 +114,7 @@ xtm_process_monitor_set_property (GObject *object, guint property_id, const GVal
}
}
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
static gboolean
xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr)
{
@@ -217,7 +217,7 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor, cairo_t *cr)
gint width, height;
static const double dashed[] = {1.5};
gint i;
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
width = gtk_widget_get_allocated_width(GTK_WIDGET(monitor));
height = gtk_widget_get_allocated_height(GTK_WIDGET(monitor));
#else
diff --git a/src/process-statusbar.c b/src/process-statusbar.c
index c9e343f..3bb7e34 100644
--- a/src/process-statusbar.c
+++ b/src/process-statusbar.c
@@ -81,7 +81,7 @@ xtm_process_statusbar_init (XtmProcessStatusbar *statusbar)
GtkWidget *hbox, *hbox_cpu, *hbox_mem;
statusbar->settings = xtm_settings_get_default ();
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
hbox_cpu = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
hbox_mem = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
@@ -133,7 +133,7 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
XtmProcessStatusbar *statusbar = XTM_PROCESS_STATUSBAR (object);
gchar *text;
gchar *float_value;
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
GdkRGBA color;
#else
GdkColor color;
@@ -146,7 +146,7 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
float_value = rounded_float_value (statusbar->cpu, statusbar->settings);
text = g_strdup_printf (_("CPU: %s%%"), float_value);
gtk_label_set_text (GTK_LABEL (statusbar->label_cpu), text);
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
gdk_rgba_parse (&color, "#ff6e00");
gtk_widget_override_color (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
#else
@@ -161,7 +161,7 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
g_strlcpy(statusbar->memory, g_value_get_string (value), 64);
text = g_strdup_printf (_("Memory: %s"), statusbar->memory);
gtk_label_set_text (GTK_LABEL (statusbar->label_memory), text);
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
gdk_rgba_parse (&color, "#ab1852");
gtk_widget_override_color (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
#else
diff --git a/src/process-window.c b/src/process-window.c
index df1d4be..a029c31 100644
--- a/src/process-window.c
+++ b/src/process-window.c
@@ -22,7 +22,7 @@
#include "settings.h"
#include "process-window.h"
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
#include "process-window-gtk3_ui.h"
#else
#include "process-window_ui.h"
@@ -182,7 +182,7 @@ xtm_process_window_init (XtmProcessWindow *window)
if (geteuid () == 0)
{
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
GtkCssProvider *css_provider;
css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (css_provider,
@@ -389,7 +389,7 @@ show_about_dialog (XtmProcessWindow *window)
"version", PACKAGE_VERSION,
"copyright", "Copyright \302\251 2005-2014 The Xfce development team",
"logo-icon-name", "utilities-system-monitor",
-#ifndef HAVE_GTK3
+#if !GTK_CHECK_VERSION(3, 0, 0)
"icon-name", GTK_STOCK_ABOUT,
#endif
"comments", _("Easy to use task manager"),
diff --git a/src/settings-dialog.c b/src/settings-dialog.c
index 2309533..46ab437 100644
--- a/src/settings-dialog.c
+++ b/src/settings-dialog.c
@@ -17,7 +17,7 @@
#include "settings.h"
#include "settings-dialog.h"
-#ifdef HAVE_GTK3
+#if GTK_CHECK_VERSION(3, 0, 0)
#include "settings-dialog-gtk3_ui.h"
#else
#include "settings-dialog_ui.h"
@@ -173,7 +173,7 @@ xtm_settings_dialog_show (GtkWidget *widget)
g_return_if_fail (GTK_IS_WIDGET (XTM_SETTINGS_DIALOG (widget)->window));
gtk_widget_show (XTM_SETTINGS_DIALOG (widget)->window);
gtk_window_present (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window));
-#ifndef HAVE_GTK3
+#if !GTK_CHECK_VERSION(3, 0, 0)
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
#endif
}
@@ -188,7 +188,7 @@ xtm_settings_dialog_hide (GtkWidget *widget)
gtk_window_get_position (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), &winx, &winy);
gtk_widget_hide (XTM_SETTINGS_DIALOG (widget)->window);
gtk_window_move (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), winx, winy);
-#ifndef HAVE_GTK3
+#if !GTK_CHECK_VERSION(3, 0, 0)
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
#endif
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list