Use #if GTK_CHECK_VERSION(3, 0, 0) instead of #ifdef HAVE_GTK3
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user