summaryrefslogtreecommitdiff
path: root/capplets
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-12-02 00:45:36 +0300
committermonsta <[email protected]>2016-12-02 00:50:14 +0300
commit0c27d18ab5efb721a2f02549767016c81fc6ce2c (patch)
tree76b7b89cface072e011a3757a833e9090bab44f2 /capplets
parent1aa83d45ebf9599c6d4d3f47211c3961282e98f0 (diff)
downloadmate-control-center-0c27d18ab5efb721a2f02549767016c81fc6ce2c.tar.bz2
mate-control-center-0c27d18ab5efb721a2f02549767016c81fc6ce2c.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require libmatekbd, libmate-desktop, marco, m-s-d >= 1.17
Diffstat (limited to 'capplets')
-rw-r--r--capplets/about-me/e-image-chooser.c8
-rw-r--r--capplets/about-me/eel-alert-dialog.c12
-rw-r--r--capplets/about-me/mate-about-me-password.c4
-rw-r--r--capplets/about-me/mate-about-me.c8
-rw-r--r--capplets/appearance/appearance-desktop.c50
-rw-r--r--capplets/appearance/appearance-font.c16
-rw-r--r--capplets/appearance/appearance-main.c14
-rw-r--r--capplets/appearance/appearance-style.c56
-rw-r--r--capplets/appearance/appearance-themes.c23
-rw-r--r--capplets/appearance/appearance-ui.c91
-rw-r--r--capplets/appearance/mate-wp-item.c30
-rw-r--r--capplets/appearance/mate-wp-item.h5
-rw-r--r--capplets/appearance/mate-wp-xml.c25
-rw-r--r--capplets/appearance/theme-installer.c7
-rw-r--r--capplets/common/file-transfer-dialog.c14
-rw-r--r--capplets/common/mate-theme-info.c44
-rw-r--r--capplets/common/mate-theme-info.h5
-rw-r--r--capplets/common/theme-thumbnail.c149
-rw-r--r--capplets/display/scrollarea.c408
-rw-r--r--capplets/display/scrollarea.h19
-rw-r--r--capplets/display/xrandr-capplet.c80
-rw-r--r--capplets/keybindings/eggcellrendererkeys.c4
-rw-r--r--capplets/keybindings/mate-keybinding-properties.c6
-rw-r--r--capplets/keyboard/mate-keyboard-properties-a11y.c15
-rw-r--r--capplets/keyboard/mate-keyboard-properties-xkbot.c4
-rw-r--r--capplets/keyboard/mate-keyboard-properties.c4
-rw-r--r--capplets/mouse/mate-mouse-properties.c8
-rw-r--r--capplets/windows/mate-metacity-support.c4
-rw-r--r--capplets/windows/mate-window-properties.c66
29 files changed, 61 insertions, 1118 deletions
diff --git a/capplets/about-me/e-image-chooser.c b/capplets/about-me/e-image-chooser.c
index d87bf0b5..c69bc204 100644
--- a/capplets/about-me/e-image-chooser.c
+++ b/capplets/about-me/e-image-chooser.c
@@ -29,10 +29,6 @@
#include "e-image-chooser.h"
-#if !GTK_CHECK_VERSION(3,0,0)
-#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
-#endif
-
struct _EImageChooserPrivate {
GtkWidget *image;
@@ -128,11 +124,7 @@ e_image_chooser_class_init (EImageChooserClass *klass)
G_STRUCT_OFFSET (EImageChooserClass, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
-#if GTK_CHECK_VERSION (3, 0, 0)
G_TYPE_NONE, 0);
-#else
- GTK_TYPE_NONE, 0);
-#endif
object_class->dispose = e_image_chooser_dispose;
}
diff --git a/capplets/about-me/eel-alert-dialog.c b/capplets/about-me/eel-alert-dialog.c
index 9fd4d52e..cbf28edf 100644
--- a/capplets/about-me/eel-alert-dialog.c
+++ b/capplets/about-me/eel-alert-dialog.c
@@ -159,12 +159,8 @@ eel_alert_dialog_init (EelAlertDialog *dialog)
dialog->details->secondary_label = gtk_label_new (NULL);
dialog->details->details_label = gtk_label_new (NULL);
dialog->details->image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_halign (dialog->details->image, GTK_ALIGN_CENTER);
gtk_widget_set_valign (dialog->details->image, GTK_ALIGN_START);
-#else
- gtk_misc_set_alignment (GTK_MISC (dialog->details->image), 0.5, 0.0);
-#endif
gtk_label_set_line_wrap (GTK_LABEL (dialog->details->primary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (dialog->details->primary_label), TRUE);
@@ -191,21 +187,13 @@ eel_alert_dialog_init (EelAlertDialog *dialog)
gtk_misc_set_alignment (GTK_MISC (dialog->details->details_label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-#else
- hbox = gtk_hbox_new (FALSE, 12);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (hbox), dialog->details->image,
FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
-#else
- vbox = gtk_vbox_new (FALSE, 12);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), vbox,
FALSE, FALSE, 0);
diff --git a/capplets/about-me/mate-about-me-password.c b/capplets/about-me/mate-about-me-password.c
index 91369fa6..6de5218f 100644
--- a/capplets/about-me/mate-about-me-password.c
+++ b/capplets/about-me/mate-about-me-password.c
@@ -685,11 +685,7 @@ passdlg_set_busy (PasswordDialog *pdialog, gboolean busy)
gdk_display_flush (display);
if (busy) {
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (cursor);
-#else
- gdk_cursor_unref (cursor);
-#endif
}
/* Disable/Enable UI */
diff --git a/capplets/about-me/mate-about-me.c b/capplets/about-me/mate-about-me.c
index e379467a..1f94f3bb 100644
--- a/capplets/about-me/mate-about-me.c
+++ b/capplets/about-me/mate-about-me.c
@@ -345,11 +345,7 @@ about_me_icon_theme_changed (GtkWindow *window,
if (icon != NULL) {
g_free (me->person);
me->person = g_strdup (gtk_icon_info_get_filename (icon));
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (icon);
-#else
- gtk_icon_info_free (icon);
-#endif
}
if (me->have_image)
@@ -424,11 +420,7 @@ about_me_setup_dialog (void)
icon = gtk_icon_theme_lookup_icon (me->theme, "stock_person", 80, 0);
if (icon != NULL) {
me->person = g_strdup (gtk_icon_info_get_filename (icon));
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (icon);
-#else
- gtk_icon_info_free (icon);
-#endif
}
g_signal_connect_object (me->theme, "changed",
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c
index a79e3c5c..e13a54d9 100644
--- a/capplets/appearance/appearance-desktop.c
+++ b/capplets/appearance/appearance-desktop.c
@@ -214,11 +214,7 @@ wp_add_images (AppearanceData *data,
cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
GDK_WATCH);
gdk_window_set_cursor (window, cursor);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (cursor);
-#else
- gdk_cursor_unref (cursor);
-#endif
while (images != NULL)
{
@@ -368,25 +364,15 @@ wp_color_changed (AppearanceData *data,
if (item == NULL)
return;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker), item->pcolor);
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker), item->scolor);
-#else
- gtk_color_button_get_color (GTK_COLOR_BUTTON (data->wp_pcpicker), item->pcolor);
- gtk_color_button_get_color (GTK_COLOR_BUTTON (data->wp_scpicker), item->scolor);
-#endif
if (update)
{
gchar *pcolor, *scolor;
-#if GTK_CHECK_VERSION (3, 0, 0)
pcolor = gdk_rgba_to_string (item->pcolor);
scolor = gdk_rgba_to_string (item->scolor);
-#else
- pcolor = gdk_color_to_string (item->pcolor);
- scolor = gdk_color_to_string (item->scolor);
-#endif
g_settings_delay (data->wp_settings);
g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor);
g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor);
@@ -509,24 +495,14 @@ wp_color1_changed (GSettings *settings,
gchar *key,
AppearanceData *data)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- GdkColor color;
-#endif
gchar *colorhex;
colorhex = g_settings_get_string (settings, key);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_parse (&color, colorhex);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker), &color);
-#else
- gdk_color_parse (colorhex, &color);
-
- gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_pcpicker), &color);
-#endif
wp_color_changed (data, FALSE);
@@ -538,26 +514,16 @@ wp_color2_changed (GSettings *settings,
gchar *key,
AppearanceData *data)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- GdkColor color;
-#endif
gchar *colorhex;
wp_set_sensitivities (data);
colorhex = g_settings_get_string (settings, key);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_parse (&color, colorhex);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker), &color);
-#else
- gdk_color_parse (colorhex, &color);
-
- gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_scpicker), &color);
-#endif
wp_color_changed (data, FALSE);
@@ -597,13 +563,8 @@ wp_props_wp_set (AppearanceData *data, MateWPItem *item)
g_settings_set_enum (data->wp_settings, WP_SHADING_KEY, item->shade_type);
-#if GTK_CHECK_VERSION (3, 0, 0)
pcolor = gdk_rgba_to_string (item->pcolor);
scolor = gdk_rgba_to_string (item->scolor);
-#else
- pcolor = gdk_color_to_string (item->pcolor);
- scolor = gdk_color_to_string (item->scolor);
-#endif
g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor);
g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor);
g_free (pcolor);
@@ -631,17 +592,10 @@ wp_props_wp_selected (GtkTreeSelection *selection,
wp_option_menu_set (data, item->shade_type, TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker),
item->pcolor);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker),
item->scolor);
-#else
- gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_pcpicker),
- item->pcolor);
- gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_scpicker),
- item->scolor);
-#endif
wp_props_wp_set (data, item);
}
@@ -755,11 +709,7 @@ wp_drag_received (GtkWidget *widget,
cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
GDK_WATCH);
gdk_window_set_cursor (window, cursor);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (cursor);
-#else
- gdk_cursor_unref (cursor);
-#endif
for (uri = uris; *uri; ++uri)
{
diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c
index 26db940e..af2a1a41 100644
--- a/capplets/appearance/appearance-font.c
+++ b/capplets/appearance/appearance-font.c
@@ -46,11 +46,7 @@
static gboolean in_change = FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
static void sample_draw(GtkWidget* darea, cairo_t* cr)
-#else
-static void sample_expose(GtkWidget* darea, GdkEventExpose* expose)
-#endif
{
cairo_surface_t* surface = g_object_get_data(G_OBJECT(darea), "sample-surface");
GtkAllocation allocation;
@@ -62,10 +58,6 @@ static void sample_expose(GtkWidget* darea, GdkEventExpose* expose)
w = cairo_image_surface_get_width (surface);
h = cairo_image_surface_get_height (surface);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *cr = gdk_cairo_create (expose->window);
-#endif
-
cairo_set_line_width (cr, 1);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
@@ -78,10 +70,6 @@ static void sample_expose(GtkWidget* darea, GdkEventExpose* expose)
cairo_set_source_surface (cr, surface, (x - w) / 2, (y - h) / 2);
cairo_paint(cr);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_destroy (cr);
-#endif
}
typedef enum {
@@ -188,11 +176,7 @@ static void setup_font_sample(GtkWidget* darea, Antialiasing antialiasing, Hinti
g_object_set_data_full(G_OBJECT(darea), "sample-surface", surface, (GDestroyNotify) cairo_surface_destroy);
gtk_widget_set_size_request (GTK_WIDGET(darea), width + 2, height + 2);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect(darea, "draw", G_CALLBACK(sample_draw), NULL);
-#else
- g_signal_connect(darea, "expose_event", G_CALLBACK(sample_expose), NULL);
-#endif
}
/*
diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c
index 91040e62..b2b77353 100644
--- a/capplets/appearance/appearance-main.c
+++ b/capplets/appearance/appearance-main.c
@@ -40,11 +40,6 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context)
GtkBuilder *ui;
GError *err = NULL;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_init ();
- gdk_threads_enter ();
-#endif
-
theme_thumbnail_factory_init (*argc, *argv);
capplet_init (context, argc, argv);
activate_settings_daemon ();
@@ -147,9 +142,7 @@ main (int argc, char **argv)
{
AppearanceData *data;
GtkWidget *w;
-#if GTK_CHECK_VERSION(3, 0, 0)
GtkStyleContext *context;
-#endif
gchar *install_filename = NULL;
gchar *start_page = NULL;
@@ -202,10 +195,9 @@ main (int argc, char **argv)
/* prepare the main window */
w = appearance_capplet_get_widget (data, "appearance_window");
-#if GTK_CHECK_VERSION(3, 0, 0)
context = gtk_widget_get_style_context (GTK_WIDGET (w));
gtk_style_context_add_class (context, "appearance-window");
-#endif
+
capplet_set_icon (w, "preferences-desktop-theme");
gtk_widget_show_all (w);
@@ -247,10 +239,6 @@ main (int argc, char **argv)
/* start the mainloop */
gtk_main ();
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_leave ();
-#endif
-
/* free stuff */
g_free (data);
diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c
index a5ad6730..e71e4f83 100644
--- a/capplets/appearance/appearance-style.c
+++ b/capplets/appearance/appearance-style.c
@@ -240,18 +240,10 @@ static void update_message_area(AppearanceData* data)
gtk_misc_set_alignment (GTK_MISC (data->style_message_label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
-#else
- hbox = gtk_hbox_new (FALSE, 9);
-#endif
icon = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_halign (icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (icon, GTK_ALIGN_START);
-#else
- gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), data->style_message_label, TRUE, TRUE, 0);
content = gtk_info_bar_get_content_area (GTK_INFO_BAR (data->style_message_area));
@@ -263,43 +255,13 @@ static void update_message_area(AppearanceData* data)
gtk_box_pack_start (GTK_BOX (parent), data->style_message_area, FALSE, FALSE, 0);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- if (engine != NULL)
- {
- gchar* message = g_strdup_printf(_("This theme will not look as intended because the required GTK+ theme engine '%s' is not installed."), engine);
- gtk_label_set_text(GTK_LABEL(data->style_message_label), message);
- g_free(message);
- g_free(engine);
-
- if (packagekit_available())
- {
- gtk_widget_show(data->style_install_button);
- }
- else
- {
- gtk_widget_hide(data->style_install_button);
- }
-
- gtk_widget_show(data->style_message_area);
- gtk_widget_queue_draw(data->style_message_area);
- }
- else
- {
- gtk_widget_hide(data->style_message_area);
- }
-#else
gtk_widget_hide(data->style_message_area);
-#endif
}
static void
update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *data)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA colors[NUM_SYMBOLIC_COLORS];
-#else
- GdkColor colors[NUM_SYMBOLIC_COLORS];
-#endif
GtkWidget *widget;
gint i;
@@ -309,11 +271,7 @@ update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *dat
/* now set all the buttons to the correct settings */
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
widget = appearance_capplet_get_widget (data, symbolic_names[i]);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (widget), &colors[i]);
-#else
- gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &colors[i]);
-#endif
}
}
@@ -384,11 +342,7 @@ static void
color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
{
GtkWidget *widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- GdkColor color;
-#endif
GString *scheme = g_string_new (NULL);
gchar *colstr;
gchar *old_scheme = NULL;
@@ -396,17 +350,9 @@ color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
widget = appearance_capplet_get_widget (data, symbolic_names[i]);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (widget), &color);
-#else
- gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &color);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
colstr = gdk_rgba_to_string (&color);
-#else
- colstr = gdk_color_to_string (&color);
-#endif
g_string_append_printf (scheme, "%s:%s\n", symbolic_names[i], colstr);
g_free (colstr);
}
@@ -1070,10 +1016,8 @@ style_init (AppearanceData *data)
icon_theme_changed (data->interface_settings, ICON_THEME_KEY, data);
cursor_theme_changed (data->mouse_settings, CURSOR_THEME_KEY, data);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkNotebook *style_nb = GTK_NOTEBOOK (appearance_capplet_get_widget (data, "notebook2"));
gtk_notebook_remove_page (style_nb, 1);
-#endif
w = appearance_capplet_get_widget (data, "color_scheme_message_hbox");
gtk_widget_set_no_show_all (w, TRUE);
diff --git a/capplets/appearance/appearance-themes.c b/capplets/appearance/appearance-themes.c
index 6669e822..0025e90e 100644
--- a/capplets/appearance/appearance-themes.c
+++ b/capplets/appearance/appearance-themes.c
@@ -667,23 +667,14 @@ theme_message_area_update (AppearanceData *data)
gtk_misc_set_alignment (GTK_MISC (data->theme_message_label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
-#else
- hbox = gtk_hbox_new (FALSE, 9);
-#endif
gtk_widget_show (hbox);
data->theme_info_icon = gtk_image_new_from_icon_name ("dialog-information", GTK_ICON_SIZE_DIALOG);
data->theme_error_icon = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_halign (data->theme_info_icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (data->theme_info_icon, GTK_ALIGN_START);
gtk_widget_set_halign (data->theme_error_icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (data->theme_error_icon, GTK_ALIGN_START);
-#else
- gtk_misc_set_alignment (GTK_MISC (data->theme_info_icon), 0.5, 0.0);
- gtk_misc_set_alignment (GTK_MISC (data->theme_error_icon), 0.5, 0.0);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), data->theme_info_icon, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), data->theme_error_icon, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), data->theme_message_label, TRUE, TRUE, 0);
@@ -1072,20 +1063,8 @@ void themes_init(AppearanceData* data)
"wrap-mode", PANGO_WRAP_WORD_CHAR,
"wrap-width", gtk_icon_view_get_item_width (icon_view),
"width", gtk_icon_view_get_item_width (icon_view),
-#if GTK_CHECK_VERSION (3, 0, 0)
- /* The xalign property should be 0.5 here, but due to a bug
- * which was never fixed in GTK+2, it was set to 0.0.
- * In GTK+3 the bug is fixed, so this workaround causes
- * theme name to be left-aligned instead of being centered.
- * So set it to 0.5 for GTK+3.
- *
- * The fix was applied in
- * https://git.gnome.org/browse/gtk+/commit?id=09bf05b
- */
"xalign", 0.5, "yalign", 0.0, NULL);
-#else
- "xalign", 0.0, "yalign", 0.0, NULL);
-#endif
+
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (icon_view), renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view), renderer,
"markup", COL_LABEL, NULL);
diff --git a/capplets/appearance/appearance-ui.c b/capplets/appearance/appearance-ui.c
index 04b8a49e..00427e96 100644
--- a/capplets/appearance/appearance-ui.c
+++ b/capplets/appearance/appearance-ui.c
@@ -50,21 +50,6 @@ show_handlebar (AppearanceData *data, gboolean show)
g_object_unref (toolbar);
}
-#if !GTK_CHECK_VERSION (3, 10, 0)
-static void
-set_toolbar_style (AppearanceData *data, const char *value)
-{
- static const GtkToolbarStyle gtk_toolbar_styles[] =
- { GTK_TOOLBAR_BOTH, GTK_TOOLBAR_BOTH_HORIZ, GTK_TOOLBAR_ICONS, GTK_TOOLBAR_TEXT };
-
- int enum_val = gtk_combo_box_get_active((GtkComboBox *)
- appearance_capplet_get_widget (data, "toolbar_style_select"));
-
- gtk_toolbar_set_style (GTK_TOOLBAR (appearance_capplet_get_widget (data, "toolbar_toolbar")),
- gtk_toolbar_styles[enum_val]);
-}
-#endif
-
static void
set_have_icons (AppearanceData *data, gboolean value)
{
@@ -101,48 +86,6 @@ set_have_icons (AppearanceData *data, gboolean value)
}
}
-/** GConf Callbacks and Conversions **/
-
-#if !GTK_CHECK_VERSION (3, 10, 0)
-static gboolean
-toolbar_to_widget (GValue *value, GVariant *variant, gpointer user_data)
-{
- const gchar *val = g_variant_get_string(variant, NULL);
- gint i = 0;
-
- if (g_strcmp0(val, "both-horiz") == 0 || g_strcmp0(val, "both_horiz") == 0)
- i = 1;
- else if (g_strcmp0(val, "icons") == 0)
- i = 2;
- else if (g_strcmp0(val, "text") == 0)
- i = 3;
-
- g_value_set_int(value, i);
-
- return TRUE;
-}
-
-static GVariant *
-toolbar_from_widget (const GValue *value,
- const GVariantType *expected_type,
- gpointer user_data)
-{
- static const char *gtk_toolbar_styles_str[] = {
- "both", "both-horiz", "icons", "text" };
-
- gint index = g_value_get_int(value);
- return g_variant_new_string(gtk_toolbar_styles_str[index]);
-}
-
-static void
-toolbar_style_cb (GSettings *settings,
- gchar *key,
- AppearanceData *data)
-{
- set_toolbar_style (data, g_settings_get_string (settings, key));
-}
-#endif
-
static void
menus_have_icons_cb (GSettings *settings,
gchar *key,
@@ -176,7 +119,7 @@ ui_init (AppearanceData *data)
{
GtkWidget* widget;
-#if GTK_CHECK_VERSION (3, 10, 0)
+ /* FIXME maybe just remove that stuff from .ui file */
GtkWidget* container = appearance_capplet_get_widget(data, "vbox24");
// Remove menu accels and toolbar style toggles for new GTK versions
@@ -184,7 +127,6 @@ ui_init (AppearanceData *data)
appearance_capplet_get_widget(data, "menu_accel_toggle"));
gtk_container_remove((GtkContainer *) container,
appearance_capplet_get_widget(data, "hbox11"));
-#endif
widget = appearance_capplet_get_widget(data, "menu_icons_toggle");
g_settings_bind (data->interface_settings,
@@ -199,37 +141,6 @@ ui_init (AppearanceData *data)
g_settings_get_boolean (data->interface_settings,
MENU_ICONS_KEY));
-#if !GTK_CHECK_VERSION (3, 10, 0)
- widget = appearance_capplet_get_widget(data, "menu_accel_toggle");
- g_settings_bind (data->interface_settings,
- ACCEL_CHANGE_KEY,
- G_OBJECT (widget),
- "active",
- G_SETTINGS_BIND_DEFAULT);
-
- widget = appearance_capplet_get_widget(data, "toolbar_style_select");
- g_settings_bind_with_mapping (data->interface_settings,
- TOOLBAR_STYLE_KEY,
- G_OBJECT (widget),
- "active",
- G_SETTINGS_BIND_DEFAULT,
- toolbar_to_widget,
- toolbar_from_widget,
- data,
- NULL);
-
- g_signal_connect (data->interface_settings, "changed::" TOOLBAR_STYLE_KEY,
- (GCallback) toolbar_style_cb, data);
-
- char* toolbar_style;
-
- toolbar_style = g_settings_get_string
- (data->interface_settings,
- TOOLBAR_STYLE_KEY);
- set_toolbar_style (data, toolbar_style);
- g_free (toolbar_style);
-#endif
-
g_signal_connect (appearance_capplet_get_widget (data, "toolbar_handlebox"),
"button_press_event",
(GCallback) button_press_block_cb, NULL);
diff --git a/capplets/appearance/mate-wp-item.c b/capplets/appearance/mate-wp-item.c
index 9daef0d0..766f1b7a 100644
--- a/capplets/appearance/mate-wp-item.c
+++ b/capplets/appearance/mate-wp-item.c
@@ -118,11 +118,7 @@ void mate_wp_item_ensure_mate_bg (MateWPItem *item)
void mate_wp_item_update (MateWPItem *item) {
GSettings *settings;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color1 = { 0, 0, 0, 1.0 }, color2 = { 0, 0, 0, 1.0 };
-#else
- GdkColor color1 = { 0, 0, 0, 0 }, color2 = { 0, 0, 0, 0 };
-#endif
gchar *s;
settings = g_settings_new (WP_SCHEMA);
@@ -133,45 +129,26 @@ void mate_wp_item_update (MateWPItem *item) {
s = g_settings_get_string (settings, WP_PCOLOR_KEY);
if (s != NULL) {
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_parse (&color1, s);
-#else
- gdk_color_parse (s, &color1);
-#endif
g_free (s);
}
s = g_settings_get_string (settings, WP_SCOLOR_KEY);
if (s != NULL) {
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_parse (&color2, s);
-#else
- gdk_color_parse (s, &color2);
-#endif
g_free (s);
}
g_object_unref (settings);
if (item->pcolor != NULL)
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_free (item->pcolor);
-#else
- gdk_color_free (item->pcolor);
-#endif
if (item->scolor != NULL)
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_free (item->scolor);
item->pcolor = gdk_rgba_copy (&color1);
item->scolor = gdk_rgba_copy (&color2);
-#else
- gdk_color_free (item->scolor);
-
- item->pcolor = gdk_color_copy (&color1);
- item->scolor = gdk_color_copy (&color2);
-#endif
}
MateWPItem * mate_wp_item_new (const gchar * filename,
@@ -215,17 +192,10 @@ void mate_wp_item_free (MateWPItem * item) {
g_free (item->description);
if (item->pcolor != NULL)
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_free (item->pcolor);
if (item->scolor != NULL)
gdk_rgba_free (item->scolor);
-#else
- gdk_color_free (item->pcolor);
-
- if (item->scolor != NULL)
- gdk_color_free (item->scolor);
-#endif
mate_wp_info_free (item->fileinfo);
if (item->bg)
diff --git a/capplets/appearance/mate-wp-item.h b/capplets/appearance/mate-wp-item.h
index f75b8474..0f04081b 100644
--- a/capplets/appearance/mate-wp-item.h
+++ b/capplets/appearance/mate-wp-item.h
@@ -45,13 +45,8 @@ struct _MateWPItem {
GtkTreeRowReference * rowref;
/* Real colors */
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA * pcolor;
GdkRGBA * scolor;
-#else
- GdkColor * pcolor;
- GdkColor * scolor;
-#endif
MateWPInfo * fileinfo;
diff --git a/capplets/appearance/mate-wp-xml.c b/capplets/appearance/mate-wp-xml.c
index 2ef58fa0..8a998630 100644
--- a/capplets/appearance/mate-wp-xml.c
+++ b/capplets/appearance/mate-wp-xml.c
@@ -124,13 +124,8 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
xmlNode* wpa;
xmlChar* nodelang;
const char* const* syslangs;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color1;
GdkRGBA color2;
-#else
- GdkColor color1;
- GdkColor color2;
-#endif
gint i;
wplist = xmlParseFile(filename);
@@ -275,11 +270,7 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
continue;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
/* Verify the colors and alloc some GdkRGBA here */
-#else
- /* Verify the colors and alloc some GdkColors here */
-#endif
if (!have_scale)
{
wp->options = g_settings_get_enum(data->wp_settings, WP_OPTIONS_KEY);
@@ -305,7 +296,6 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
wp->artist = g_strdup ("(none)");
}
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_parse(&color1, pcolor);
gdk_rgba_parse(&color2, scolor);
g_free(pcolor);
@@ -313,15 +303,6 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
wp->pcolor = gdk_rgba_copy(&color1);
wp->scolor = gdk_rgba_copy(&color2);
-#else
- gdk_color_parse(pcolor, &color1);
- gdk_color_parse(scolor, &color2);
- g_free(pcolor);
- g_free(scolor);
-
- wp->pcolor = gdk_color_copy(&color1);
- wp->scolor = gdk_color_copy(&color2);
-#endif
if ((wp->filename != NULL && g_file_test (wp->filename, G_FILE_TEST_EXISTS)) || !strcmp (wp->filename, "(none)"))
{
@@ -523,13 +504,9 @@ void mate_wp_xml_save_list(AppearanceData* data)
filename = g_filename_to_utf8(wpitem->filename, -1, NULL, NULL, NULL);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
pcolor = gdk_rgba_to_string(wpitem->pcolor);
scolor = gdk_rgba_to_string(wpitem->scolor);
-#else
- pcolor = gdk_color_to_string(wpitem->pcolor);
- scolor = gdk_color_to_string(wpitem->scolor);
-#endif
+
scale = wp_item_option_to_string(wpitem->options);
shade = wp_item_shading_to_string(wpitem->shade_type);
diff --git a/capplets/appearance/theme-installer.c b/capplets/appearance/theme-installer.c
index 20b89e59..2ffb1158 100644
--- a/capplets/appearance/theme-installer.c
+++ b/capplets/appearance/theme-installer.c
@@ -628,9 +628,6 @@ static void
transfer_done_cb (GtkWidget *dialog,
TransferData *tdata)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_enter ();
-#endif
/* XXX: path should be on the local filesystem by now? */
if (dialog != NULL) {
@@ -641,10 +638,6 @@ transfer_done_cb (GtkWidget *dialog,
g_free (tdata->path);
g_free (tdata);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_leave ();
-#endif
}
void
diff --git a/capplets/common/file-transfer-dialog.c b/capplets/common/file-transfer-dialog.c
index 15f39ae7..a879469e 100644
--- a/capplets/common/file-transfer-dialog.c
+++ b/capplets/common/file-transfer-dialog.c
@@ -305,11 +305,7 @@ file_transfer_dialog_init (FileTransferDialog *dlg)
gtk_widget_set_size_request (GTK_WIDGET (dlg), 350, -1);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
@@ -327,11 +323,7 @@ file_transfer_dialog_init (FileTransferDialog *dlg)
gtk_box_pack_start (GTK_BOX (vbox), dlg->priv->status, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
table = gtk_table_new (2, 2, FALSE);
@@ -339,11 +331,7 @@ file_transfer_dialog_init (FileTransferDialog *dlg)
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (table), FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
progress_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-#else
- progress_vbox = gtk_vbox_new (TRUE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), progress_vbox, FALSE, FALSE, 0);
dlg->priv->progress = gtk_progress_bar_new ();
@@ -406,9 +394,7 @@ file_transfer_job_progress (goffset current_bytes,
data->current_bytes = current_bytes;
data->total_bytes = total_bytes;
- gdk_threads_enter ();
file_transfer_job_update (data);
- gdk_threads_leave ();
}
static void
diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c
index 38f2c741..c80c95f1 100644
--- a/capplets/common/mate-theme-info.c
+++ b/capplets/common/mate-theme-info.c
@@ -1598,20 +1598,6 @@ gboolean mate_theme_meta_info_validate(const MateThemeMetaInfo* info, GError** e
return FALSE;
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* check for gtk theme engines */
- gchar *engine = gtk_theme_info_missing_engine(info->gtk_theme_name, TRUE);
-
- if (engine != NULL)
- {
- g_set_error (error, MATE_THEME_ERROR, MATE_THEME_ERROR_GTK_ENGINE_NOT_AVAILABLE,
- _("This theme will not look as intended because the required GTK+ theme engine '%s' is not installed."),
- engine);
- g_free (engine);
- return FALSE;
- }
-#endif
-
return TRUE;
}
@@ -1704,11 +1690,7 @@ mate_theme_info_register_theme_change (ThemeChangedCallback func,
}
gboolean
-#if GTK_CHECK_VERSION (3, 0, 0)
mate_theme_color_scheme_parse (const gchar *scheme, GdkRGBA *colors)
-#else
-mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors)
-#endif
{
gchar **color_scheme_strings, **color_scheme_pair, *current_string;
gint i;
@@ -1735,7 +1717,6 @@ mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors)
g_strstrip (color_scheme_pair[1]);
if (!strcmp ("fg_color", color_scheme_pair[0]))
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_rgba_parse (&colors[COLOR_FG], color_scheme_pair[1]);
else if (!strcmp ("bg_color", color_scheme_pair[0]))
gdk_rgba_parse (&colors[COLOR_BG], color_scheme_pair[1]);
@@ -1751,23 +1732,6 @@ mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors)
gdk_rgba_parse (&colors[COLOR_TOOLTIP_FG], color_scheme_pair[1]);
else if (!strcmp ("tooltip_bg_color", color_scheme_pair[0]))
gdk_rgba_parse (&colors[COLOR_TOOLTIP_BG], color_scheme_pair[1]);
-#else
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_FG]);
- else if (!strcmp ("bg_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_BG]);
- else if (!strcmp ("text_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_TEXT]);
- else if (!strcmp ("base_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_BASE]);
- else if (!strcmp ("selected_fg_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_SELECTED_FG]);
- else if (!strcmp ("selected_bg_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_SELECTED_BG]);
- else if (!strcmp ("tooltip_fg_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_TOOLTIP_FG]);
- else if (!strcmp ("tooltip_bg_color", color_scheme_pair[0]))
- gdk_color_parse (color_scheme_pair[1], &colors[COLOR_TOOLTIP_BG]);
-#endif
}
g_strfreev (color_scheme_pair);
@@ -1781,11 +1745,7 @@ mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors)
gboolean
mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA c1[NUM_SYMBOLIC_COLORS], c2[NUM_SYMBOLIC_COLORS];
-#else
- GdkColor c1[NUM_SYMBOLIC_COLORS], c2[NUM_SYMBOLIC_COLORS];
-#endif
int i;
if (!mate_theme_color_scheme_parse (s1, c1) ||
@@ -1793,11 +1753,7 @@ mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2)
return FALSE;
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
-#if GTK_CHECK_VERSION (3, 0, 0)
if (!gdk_rgba_equal (&c1[i], &c2[i]))
-#else
- if (!gdk_color_equal (&c1[i], &c2[i]))
-#endif
return FALSE;
}
diff --git a/capplets/common/mate-theme-info.h b/capplets/common/mate-theme-info.h
index 9b45951c..1ef14b37 100644
--- a/capplets/common/mate-theme-info.h
+++ b/capplets/common/mate-theme-info.h
@@ -183,13 +183,8 @@ void mate_theme_init (void);
void mate_theme_info_register_theme_change (ThemeChangedCallback func,
gpointer data);
-#if GTK_CHECK_VERSION (3, 0, 0)
gboolean mate_theme_color_scheme_parse (const gchar *scheme,
GdkRGBA *colors);
-#else
-gboolean mate_theme_color_scheme_parse (const gchar *scheme,
- GdkColor *colors);
-#endif
gboolean mate_theme_color_scheme_equal (const gchar *s1,
const gchar *s2);
diff --git a/capplets/common/theme-thumbnail.c b/capplets/common/theme-thumbnail.c
index 775b460c..2b11d01f 100644
--- a/capplets/common/theme-thumbnail.c
+++ b/capplets/common/theme-thumbnail.c
@@ -19,14 +19,6 @@
#include "gtkrc-utils.h"
#include "capplet-util.h"
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define GdkRegion cairo_region_t
-#define gdk_region_destroy cairo_region_destroy
-#endif
typedef struct {
gboolean set;
@@ -97,48 +89,8 @@ static int pipe_from_factory_fd[2];
#define MARCO_THUMBNAIL_WIDTH 120
#define MARCO_THUMBNAIL_HEIGHT 60
-/* This draw the thumbnail of gtk
- */
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static GdkPixmap *
-draw_window_on_pixbuf(GtkWidget* widget)
-{
- GdkVisual* visual;
- GdkPixmap* pixmap;
- GtkStyle* style;
- GdkScreen* screen = gdk_screen_get_default();
- GdkWindow* window;
- gint width, height;
-
- gtk_widget_ensure_style(widget);
-
- style = gtk_widget_get_style(widget);
-
- g_assert(style);
- g_assert(style->font_desc);
-
- gtk_window_get_size(GTK_WINDOW(widget), &width, &height);
-
- visual = gtk_widget_get_visual(widget);
- pixmap = gdk_pixmap_new(NULL, width, height, gdk_visual_get_depth (visual));
- gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), gtk_widget_get_colormap(widget));
-
- window = gtk_widget_get_window(widget);
- gdk_window_redirect_to_drawable(window, pixmap, 0, 0, 0, 0, width, height);
- gdk_window_set_override_redirect(window, TRUE);
- gtk_window_move(GTK_WINDOW(widget), gdk_screen_get_width(screen), gdk_screen_get_height(screen));
- gtk_widget_show(widget);
-
- gdk_window_process_updates(window, TRUE);
-
- gtk_widget_hide(widget);
-
- return pixmap;
-}
-#endif
-
-static void pixbuf_apply_mask_region(GdkPixbuf* pixbuf, GdkRegion* region)
+static void pixbuf_apply_mask_region(GdkPixbuf* pixbuf, cairo_region_t* region)
{
gint nchannels, rowstride, w, h;
guchar *pixels, *p;
@@ -158,11 +110,7 @@ static void pixbuf_apply_mask_region(GdkPixbuf* pixbuf, GdkRegion* region)
for (w = 0; w < gdk_pixbuf_get_width (pixbuf); ++w)
for (h = 0; h < gdk_pixbuf_get_height (pixbuf); ++h)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
if (!cairo_region_contains_point (region, w, h))
-#else
- if (!gdk_region_point_in (region, w, h))
-#endif
{
p = pixels + h * rowstride + w * nchannels;
if (G_BYTE_ORDER == G_BIG_ENDIAN)
@@ -201,11 +149,7 @@ create_folder_icon (char *icon_theme_name)
if (folder_icon_info != NULL)
{
folder_icon = gtk_icon_info_load_icon (folder_icon_info, NULL);
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (folder_icon_info);
-#else
- gtk_icon_info_free (folder_icon_info);
-#endif
}
if (folder_icon == NULL)
@@ -236,14 +180,11 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
GtkRequisition requisition;
GtkAllocation allocation;
GtkAllocation vbox_allocation;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkPixmap *pixmap;
-#endif
MetaFrameFlags flags;
MetaTheme *theme;
GdkPixbuf *pixbuf, *icon;
int icon_width, icon_height;
- GdkRegion *region;
+ cairo_region_t *region;
g_object_set (gtk_settings_get_default (),
"gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data,
@@ -272,36 +213,19 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
META_FRAME_ALLOWS_SHADE |
META_FRAME_ALLOWS_MOVE;
-#if GTK_CHECK_VERSION (3, 0, 0)
window = gtk_offscreen_window_new ();
-#else
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-#endif
preview = meta_preview_new ();
gtk_container_add (GTK_CONTAINER (window), preview);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_show_all (window);
-#else
- gtk_widget_realize (window);
- gtk_widget_realize (preview);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (preview), vbox);
align = gtk_alignment_new (0, 0, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
stock_button = gtk_button_new_from_stock (GTK_STOCK_OPEN);
gtk_container_add (GTK_CONTAINER (align), stock_button);
-#if GTK_CHECK_VERSION (3, 0, 0)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- box = gtk_hbox_new (FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0);
checkbox = gtk_check_button_new ();
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
@@ -325,18 +249,11 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_widget_size_allocate (window, &allocation);
gtk_widget_get_preferred_size (window, &requisition, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_queue_draw (window);
while (gtk_events_pending ())
gtk_main_iteration ();
pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
-#else
- pixmap = draw_window_on_pixbuf (window);
-
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
- gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
-#endif
gtk_widget_get_allocation (vbox, &vbox_allocation);
@@ -351,14 +268,11 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
region = meta_preview_get_clip_region (META_PREVIEW (preview),
META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
pixbuf_apply_mask_region (pixbuf, region);
- gdk_region_destroy (region);
+ cairo_region_destroy (region);
g_object_unref (icon);
gtk_widget_destroy (window);
meta_theme_free (theme);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- g_object_unref (pixmap);
-#endif
return pixbuf;
}
@@ -370,9 +284,6 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
GtkWidget *window, *vbox, *box, *stock_button, *checkbox, *radio;
GtkRequisition requisition;
GtkAllocation allocation;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkPixmap *pixmap;
-#endif
GdkPixbuf *pixbuf, *retval;
gint width, height;
@@ -381,23 +292,11 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
"gtk-color-scheme", (char *) theme_thumbnail_data->gtk_color_scheme->data,
NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
window = gtk_offscreen_window_new ();
-#else
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-#else
- vbox = gtk_vbox_new (FALSE, 0);
-#endif
gtk_container_add (GTK_CONTAINER (window), vbox);
-#if GTK_CHECK_VERSION (3, 0, 0)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- box = gtk_hbox_new (FALSE, 6);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (box), 6);
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0);
stock_button = gtk_button_new_from_stock (GTK_STOCK_OPEN);
@@ -408,9 +307,7 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
radio = gtk_radio_button_new_from_widget (NULL);
gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_show_all (window);
-#else
gtk_widget_show_all (vbox);
gtk_widget_realize (stock_button);
gtk_widget_realize (gtk_bin_get_child (GTK_BIN (stock_button)));
@@ -420,7 +317,6 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_widget_map (gtk_bin_get_child (GTK_BIN (stock_button)));
gtk_widget_map (checkbox);
gtk_widget_map (radio);
-#endif
gtk_widget_get_preferred_size (window, &requisition, NULL);
allocation.x = 0;
@@ -432,18 +328,11 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_window_get_size (GTK_WINDOW (window), &width, &height);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_queue_draw (window);
while (gtk_events_pending ())
gtk_main_iteration ();
pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
-#else
- pixmap = draw_window_on_pixbuf (window);
-
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
- gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, width, height);
-#endif
retval = gdk_pixbuf_scale_simple (pixbuf,
GTK_THUMBNAIL_SIZE,
@@ -451,9 +340,6 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
gtk_widget_destroy (window);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- g_object_unref (pixmap);
-#endif
return retval;
}
@@ -466,11 +352,8 @@ create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
MetaTheme *theme;
GtkRequisition requisition;
GtkAllocation allocation;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkPixmap *pixmap;
-#endif
GdkPixbuf *pixbuf, *retval;
- GdkRegion *region;
+ cairo_region_t *region;
theme = meta_theme_load ((char *) theme_thumbnail_data->wm_theme_name->data, NULL);
if (theme == NULL)
@@ -486,11 +369,7 @@ create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
META_FRAME_ALLOWS_SHADE |
META_FRAME_ALLOWS_MOVE;
-#if GTK_CHECK_VERSION (3, 0, 0)
window = gtk_offscreen_window_new ();
-#else
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-#endif
gtk_window_set_default_size (GTK_WINDOW (window), (int) MARCO_THUMBNAIL_WIDTH * 1.2, (int) MARCO_THUMBNAIL_HEIGHT * 1.2);
preview = meta_preview_new ();
@@ -502,15 +381,7 @@ create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
dummy = gtk_label_new ("");
gtk_container_add (GTK_CONTAINER (preview), dummy);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_show_all (window);
-#else
- gtk_widget_realize (window);
- gtk_widget_realize (preview);
- gtk_widget_realize (dummy);
- gtk_widget_show_all (preview);
- gtk_widget_map (dummy);
-#endif
gtk_widget_get_preferred_size (window, &requisition, NULL);
allocation.x = 0;
@@ -520,23 +391,16 @@ create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_widget_size_allocate (window, &allocation);
gtk_widget_get_preferred_size (window, &requisition, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_queue_draw (window);
while (gtk_events_pending ())
gtk_main_iteration ();
pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
-#else
- pixmap = draw_window_on_pixbuf (window);
-
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, (int) MARCO_THUMBNAIL_WIDTH * 1.2, (int) MARCO_THUMBNAIL_HEIGHT * 1.2);
- gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, (int) MARCO_THUMBNAIL_WIDTH * 1.2, (int) MARCO_THUMBNAIL_HEIGHT * 1.2);
-#endif
region = meta_preview_get_clip_region (META_PREVIEW (preview),
MARCO_THUMBNAIL_WIDTH * 1.2, MARCO_THUMBNAIL_HEIGHT * 1.2);
pixbuf_apply_mask_region (pixbuf, region);
- gdk_region_destroy (region);
+ cairo_region_destroy (region);
retval = gdk_pixbuf_scale_simple (pixbuf,
@@ -547,9 +411,6 @@ create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_widget_destroy (window);
meta_theme_free (theme);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- g_object_unref (pixmap);
-#endif
return retval;
}
diff --git a/capplets/display/scrollarea.c b/capplets/display/scrollarea.c
index 7a8845ab..b475fda2 100644
--- a/capplets/display/scrollarea.c
+++ b/capplets/display/scrollarea.c
@@ -20,17 +20,13 @@
#include "scrollarea.h"
#include "foo-marshal.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE_WITH_CODE (FooScrollArea, foo_scroll_area, GTK_TYPE_CONTAINER, G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL));
-#else
-G_DEFINE_TYPE (FooScrollArea, foo_scroll_area, GTK_TYPE_CONTAINER);
-#endif
static GtkWidgetClass *parent_class;
typedef struct BackingStore BackingStore;
-typedef void (* ExposeFunc) (cairo_t *cr, GdkRegion *region, gpointer data);
+typedef void (* ExposeFunc) (cairo_t *cr, cairo_region_t *region, gpointer data);
typedef struct InputPath InputPath;
typedef struct InputRegion InputRegion;
@@ -52,7 +48,7 @@ struct InputPath
/* InputRegions are mutually disjoint */
struct InputRegion
{
- GdkRegion *region; /* the boundary of this area in canvas coordinates */
+ cairo_region_t *region; /* the boundary of this area in canvas coordinates */
InputPath *paths;
};
@@ -77,10 +73,10 @@ struct FooScrollAreaPrivate
GtkAdjustment *hadj;
GtkAdjustment *vadj;
-#if GTK_CHECK_VERSION (3, 0, 0)
+
GtkScrollablePolicy hscroll_policy;
GtkScrollablePolicy vscroll_policy;
-#endif
+
int x_offset;
int y_offset;
@@ -91,26 +87,14 @@ struct FooScrollAreaPrivate
AutoScrollInfo *auto_scroll_info;
- /* During expose, this region is set to the region
- * being exposed. At other times, it is NULL
- *
- * It is used for clipping of input areas
- */
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkRegion *expose_region;
-#endif
InputRegion *current_input;
gboolean grabbed;
FooScrollAreaEventFunc grab_func;
gpointer grab_data;
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_surface_t *surface;
-#else
- GdkPixmap *pixmap;
-#endif
- GdkRegion *update_region; /* In canvas coordinates */
+ cairo_region_t *update_region; /* In canvas coordinates */
};
enum
@@ -121,7 +105,6 @@ enum
LAST_SIGNAL,
};
-#if GTK_CHECK_VERSION (3, 0, 0)
enum {
PROP_0,
PROP_VADJUSTMENT,
@@ -129,40 +112,23 @@ enum {
PROP_HSCROLL_POLICY,
PROP_VSCROLL_POLICY
};
-#endif
static guint signals [LAST_SIGNAL] = { 0 };
-#if GTK_CHECK_VERSION (3, 0, 0)
static void foo_scroll_area_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural);
static void foo_scroll_area_get_preferred_height (GtkWidget *widget,
gint *minimum,
gint *natural);
-#else
-static void foo_scroll_area_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean foo_scroll_area_draw (GtkWidget *widget,
cairo_t *cr);
-#else
-static gboolean foo_scroll_area_expose (GtkWidget *widget,
- GdkEventExpose *expose);
-#endif
static void foo_scroll_area_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-#if GTK_CHECK_VERSION (3, 0, 0)
static void foo_scroll_area_set_hadjustment (FooScrollArea *scroll_area,
GtkAdjustment *hadjustment);
static void foo_scroll_area_set_vadjustment (FooScrollArea *scroll_area,
GtkAdjustment *vadjustment);
-#else
-static void foo_scroll_area_set_scroll_adjustments (FooScrollArea *scroll_area,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment);
-#endif
static void foo_scroll_area_realize (GtkWidget *widget);
static void foo_scroll_area_unrealize (GtkWidget *widget);
static void foo_scroll_area_map (GtkWidget *widget);
@@ -211,7 +177,6 @@ foo_scroll_area_finalize (GObject *object)
G_OBJECT_CLASS (foo_scroll_area_parent_class)->finalize (object);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
foo_scroll_area_get_property (GObject *object,
guint property_id,
@@ -263,7 +228,6 @@ foo_scroll_area_set_property (GObject *object,
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
-#endif
static void
foo_scroll_area_class_init (FooScrollAreaClass *class)
@@ -272,16 +236,11 @@ foo_scroll_area_class_init (FooScrollAreaClass *class)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->finalize = foo_scroll_area_finalize;
-#if GTK_CHECK_VERSION (3, 0, 0)
object_class->set_property = foo_scroll_area_set_property;
object_class->get_property = foo_scroll_area_get_property;
widget_class->draw = foo_scroll_area_draw;
widget_class->get_preferred_width = foo_scroll_area_get_preferred_width;
widget_class->get_preferred_height = foo_scroll_area_get_preferred_height;
-#else
- widget_class->size_request = foo_scroll_area_size_request;
- widget_class->expose_event = foo_scroll_area_expose;
-#endif
widget_class->size_allocate = foo_scroll_area_size_allocate;
widget_class->realize = foo_scroll_area_realize;
widget_class->unrealize = foo_scroll_area_unrealize;
@@ -291,19 +250,13 @@ foo_scroll_area_class_init (FooScrollAreaClass *class)
widget_class->map = foo_scroll_area_map;
widget_class->unmap = foo_scroll_area_unmap;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- class->set_scroll_adjustments = foo_scroll_area_set_scroll_adjustments;
-#endif
-
parent_class = g_type_class_peek_parent (class);
-#if GTK_CHECK_VERSION (3, 0, 0)
/* Scrollable interface properties */
g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment");
g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment");
g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy");
g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy");
-#endif
signals[VIEWPORT_CHANGED] =
g_signal_new ("viewport_changed",
@@ -324,34 +277,10 @@ foo_scroll_area_class_init (FooScrollAreaClass *class)
G_STRUCT_OFFSET (FooScrollAreaClass,
paint),
NULL, NULL,
-#if GTK_CHECK_VERSION (3, 0, 0)
g_cclosure_marshal_VOID__POINTER,
-#else
- foo_marshal_VOID__POINTER_BOXED_POINTER,
-#endif
G_TYPE_NONE,
-#if GTK_CHECK_VERSION (3, 0, 0)
1,
-#else
- 3,
- G_TYPE_POINTER,
- GDK_TYPE_RECTANGLE,
-#endif
G_TYPE_POINTER);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- widget_class->set_scroll_adjustments_signal =
- g_signal_new ("set_scroll_adjustments",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (FooScrollAreaClass,
- set_scroll_adjustments),
- NULL, NULL,
- foo_marshal_VOID__OBJECT_OBJECT,
- G_TYPE_NONE, 2,
- GTK_TYPE_ADJUSTMENT,
- GTK_TYPE_ADJUSTMENT);
-#endif
}
static GtkAdjustment *
@@ -377,43 +306,13 @@ foo_scroll_area_init (FooScrollArea *scroll_area)
scroll_area->priv->vadj = g_object_ref_sink (new_adjustment());
scroll_area->priv->x_offset = 0.0;
scroll_area->priv->y_offset = 0.0;
-#if GTK_CHECK_VERSION (3, 0, 0)
scroll_area->priv->min_width = 0;
scroll_area->priv->min_height = 0;
-#else
- scroll_area->priv->min_width = -1;
- scroll_area->priv->min_height = -1;
-#endif
scroll_area->priv->auto_scroll_info = NULL;
scroll_area->priv->input_regions = g_ptr_array_new ();
-#if GTK_CHECK_VERSION (3, 0, 0)
scroll_area->priv->surface = NULL;
-#else
- scroll_area->priv->pixmap = NULL;
-#endif
- scroll_area->priv->update_region = gdk_region_new ();
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_widget_set_double_buffered (widget, FALSE);
-#endif
-}
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-translate_cairo_device (cairo_t *cr,
- int x_offset,
- int y_offset)
-{
- cairo_surface_t *surface = cairo_get_target (cr);
- double dev_x;
- double dev_y;
-
- cairo_surface_get_device_offset (surface, &dev_x, &dev_y);
- dev_x += x_offset;
- dev_y += y_offset;
- cairo_surface_set_device_offset (surface, dev_x, dev_y);
+ scroll_area->priv->update_region = cairo_region_create ();
}
-#endif
typedef void (* PathForeachFunc) (double *x,
double *y,
@@ -469,7 +368,7 @@ static void
input_region_free (InputRegion *region)
{
input_path_free_list (region->paths);
- gdk_region_destroy (region->region);
+ cairo_region_destroy (region->region);
g_free (region);
}
@@ -500,33 +399,33 @@ allocation_to_canvas (FooScrollArea *area,
static void
clear_exposed_input_region (FooScrollArea *area,
- GdkRegion *exposed) /* in canvas coordinates */
+ cairo_region_t *exposed) /* in canvas coordinates */
{
int i;
- GdkRegion *viewport;
+ cairo_region_t *viewport;
GdkRectangle allocation;
gtk_widget_get_allocation (GTK_WIDGET (area), &allocation);
allocation.x = 0;
allocation.y = 0;
allocation_to_canvas (area, &allocation.x, &allocation.y);
- viewport = gdk_region_rectangle (&allocation);
- gdk_region_subtract (viewport, exposed);
+ viewport = cairo_region_create_rectangle (&allocation);
+ cairo_region_subtract (viewport, exposed);
for (i = 0; i < area->priv->input_regions->len; ++i)
{
InputRegion *region = area->priv->input_regions->pdata[i];
- gdk_region_intersect (region->region, viewport);
+ cairo_region_intersect (region->region, viewport);
- if (gdk_region_empty (region->region))
+ if (cairo_region_is_empty (region->region))
{
input_region_free (region);
g_ptr_array_remove_index_fast (area->priv->input_regions, i--);
}
}
- gdk_region_destroy (viewport);
+ cairo_region_destroy (viewport);
}
static void
@@ -535,7 +434,6 @@ setup_background_cr (GdkWindow *window,
int x_offset,
int y_offset)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkWindow *parent = gdk_window_get_parent (window);
cairo_pattern_t *bg_pattern;
@@ -553,27 +451,6 @@ setup_background_cr (GdkWindow *window,
cairo_set_source (cr, bg_pattern);
cairo_translate (cr, x_offset, y_offset);
}
-#else
- GdkWindowObject *private = (GdkWindowObject *)window;
-
- if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG && private->parent)
- {
- x_offset += private->x;
- y_offset += private->y;
-
- setup_background_cr (GDK_WINDOW (private->parent), cr, x_offset, y_offset);
- }
- else if (private->bg_pixmap &&
- private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
- private->bg_pixmap != GDK_NO_BG)
- {
- gdk_cairo_set_source_pixmap (cr, private->bg_pixmap, -x_offset, -y_offset);
- }
- else
- {
- gdk_cairo_set_source_color (cr, &private->bg_color);
- }
-#endif
}
static void
@@ -585,49 +462,26 @@ initialize_background (GtkWidget *widget,
cairo_paint (cr);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-clip_to_region (cairo_t *cr, GdkRegion *region)
-{
- int n_rects;
- GdkRectangle *rects;
-
- gdk_region_get_rectangles (region, &rects, &n_rects);
-
- cairo_new_path (cr);
- while (n_rects--)
- {
- GdkRectangle *rect = &(rects[n_rects]);
-
- cairo_rectangle (cr, rect->x, rect->y, rect->width, rect->height);
- }
- cairo_clip (cr);
-
- g_free (rects);
-}
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
foo_scroll_area_draw (GtkWidget *widget,
cairo_t *widget_cr)
{
FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
cairo_t *cr;
- GdkRegion *region;
+ cairo_region_t *region;
GtkAllocation widget_allocation;
/* Setup input areas */
clear_exposed_input_region (scroll_area, scroll_area->priv->update_region);
scroll_area->priv->current_input = g_new0 (InputRegion, 1);
- scroll_area->priv->current_input->region = gdk_region_copy (scroll_area->priv->update_region);
+ scroll_area->priv->current_input->region = cairo_region_copy (scroll_area->priv->update_region);
scroll_area->priv->current_input->paths = NULL;
g_ptr_array_add (scroll_area->priv->input_regions,
scroll_area->priv->current_input);
region = scroll_area->priv->update_region;
- scroll_area->priv->update_region = gdk_region_new ();
+ scroll_area->priv->update_region = cairo_region_create ();
/* Create cairo context */
cr = cairo_create (scroll_area->priv->surface);
@@ -644,84 +498,10 @@ foo_scroll_area_draw (GtkWidget *widget,
cairo_set_source_surface (widget_cr, scroll_area->priv->surface, widget_allocation.x, widget_allocation.y);
cairo_paint (widget_cr);
- gdk_region_destroy (region);
-
- return TRUE;
-}
-#else
-static gboolean
-foo_scroll_area_expose (GtkWidget *widget,
- GdkEventExpose *expose)
-{
- FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
- cairo_t *cr;
- GdkRectangle extents;
- GdkWindow *window = gtk_widget_get_window (widget);
- GdkRegion *region;
- int x_offset, y_offset;
- GtkAllocation widget_allocation;
-
- /* I don't think expose can ever recurse for the same area */
- g_assert (!scroll_area->priv->expose_region);
-
- /* Note that this function can be called at a time
- * where the adj->value is different from x_offset.
- * Ie., the GtkScrolledWindow changed the adj->value
- * without emitting the value_changed signal.
- *
- * Hence we must always use the value we got
- * the last time the signal was emitted, ie.,
- * priv->{x,y}_offset.
- */
-
- x_offset = scroll_area->priv->x_offset;
- y_offset = scroll_area->priv->y_offset;
-
- scroll_area->priv->expose_region = expose->region;
-
- /* Setup input areas */
- clear_exposed_input_region (scroll_area, scroll_area->priv->update_region);
-
- scroll_area->priv->current_input = g_new0 (InputRegion, 1);
- scroll_area->priv->current_input->region = gdk_region_copy (scroll_area->priv->update_region);
- scroll_area->priv->current_input->paths = NULL;
- g_ptr_array_add (scroll_area->priv->input_regions,
- scroll_area->priv->current_input);
-
- region = scroll_area->priv->update_region;
- scroll_area->priv->update_region = gdk_region_new ();
-
- /* Create cairo context */
- cr = gdk_cairo_create (scroll_area->priv->pixmap);
- translate_cairo_device (cr, -x_offset, -y_offset);
- clip_to_region (cr, region);
- initialize_background (widget, cr);
-
- /* Create regions */
- gdk_region_get_clipbox (region, &extents);
-
- g_signal_emit (widget, signals[PAINT], 0, cr, &extents, region);
-
- /* Destroy stuff */
- cairo_destroy (cr);
-
- scroll_area->priv->expose_region = NULL;
- scroll_area->priv->current_input = NULL;
-
- /* Finally draw the backing pixmap */
- gtk_widget_get_allocation (widget, &widget_allocation);
+ cairo_region_destroy (region);
- cr = gdk_cairo_create (window);
- gdk_cairo_set_source_pixmap (cr, scroll_area->priv->pixmap,
- widget_allocation.x, widget_allocation.y);
- gdk_cairo_region (cr, expose->region);
- cairo_fill (cr);
- cairo_destroy (cr);
- gdk_region_destroy (region);
-
return TRUE;
}
-#endif
void
foo_scroll_area_get_viewport (FooScrollArea *scroll_area,
@@ -750,10 +530,9 @@ emit_viewport_changed (FooScrollArea *scroll_area,
g_signal_emit (scroll_area, signals[VIEWPORT_CHANGED], 0,
new_viewport, old_viewport);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (scroll_area->priv->input_window == NULL)
return;
-#endif
+
gdk_window_get_pointer (scroll_area->priv->input_window, &px, &py, NULL);
process_event (scroll_area, FOO_MOTION, px, py);
@@ -813,9 +592,7 @@ foo_scroll_area_realize (GtkWidget *widget)
GtkAllocation widget_allocation;
GdkWindow *window;
gint attributes_mask;
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr;
-#endif
gtk_widget_get_allocation (widget, &widget_allocation);
gtk_widget_set_realized (widget, TRUE);
@@ -844,17 +621,11 @@ foo_scroll_area_realize (GtkWidget *widget)
area->priv->input_window = gdk_window_new (window,
&attributes, attributes_mask);
-#if GTK_CHECK_VERSION (3, 0, 0)
cr = gdk_cairo_create (gtk_widget_get_window (widget));
area->priv->surface = cairo_surface_create_similar (cairo_get_target (cr), CAIRO_CONTENT_COLOR,
widget_allocation.width, widget_allocation.height);
cairo_destroy (cr);
-#else
- area->priv->pixmap = gdk_pixmap_new (window,
- widget_allocation.width,
- widget_allocation.height,
- -1);
-#endif
+
gdk_window_set_user_data (area->priv->input_window, area);
gtk_widget_style_attach (widget);
@@ -875,7 +646,6 @@ foo_scroll_area_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static cairo_surface_t *
create_new_surface (GtkWidget *widget,
cairo_surface_t *old)
@@ -910,48 +680,14 @@ create_new_surface (GtkWidget *widget,
return new;
}
-#else
-static GdkPixmap *
-create_new_pixmap (GtkWidget *widget,
- GdkPixmap *old)
-{
- GtkAllocation widget_allocation;
- GdkPixmap *new;
- cairo_t *cr;
-
- gtk_widget_get_allocation (widget, &widget_allocation);
-
- new = gdk_pixmap_new (gtk_widget_get_window (widget),
- widget_allocation.width,
- widget_allocation.height,
- -1);
-
- /* Unfortunately we don't know in which direction we were resized,
- * so we just assume we were dragged from the south-east corner.
- *
- * Although, maybe we could get the root coordinates of the input-window?
- * That might just work, actually. We need to make sure marco uses
- * static gravity for the window before this will be useful.
- */
-
- cr = gdk_cairo_create (new);
- gdk_cairo_set_source_pixmap (cr, old, 0, 0);
-
- cairo_paint (cr);
- cairo_destroy (cr);
-
- return new;
-}
-#endif
static void
allocation_to_canvas_region (FooScrollArea *area,
- GdkRegion *region)
+ cairo_region_t *region)
{
- gdk_region_offset (region, area->priv->x_offset, area->priv->y_offset);
+ cairo_region_translate (region, area->priv->x_offset, area->priv->y_offset);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
_cairo_region_xor (cairo_region_t *dst, const cairo_region_t *src)
{
@@ -964,7 +700,6 @@ _cairo_region_xor (cairo_region_t *dst, const cairo_region_t *src)
cairo_region_union (dst, trb);
cairo_region_destroy (trb);
}
-#endif
static void
foo_scroll_area_size_allocate (GtkWidget *widget,
@@ -973,51 +708,37 @@ foo_scroll_area_size_allocate (GtkWidget *widget,
FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
GdkRectangle new_viewport;
GdkRectangle old_viewport;
- GdkRegion *old_allocation;
- GdkRegion *invalid;
+ cairo_region_t *old_allocation;
+ cairo_region_t *invalid;
GtkAllocation widget_allocation;
get_viewport (scroll_area, &old_viewport);
gtk_widget_get_allocation (widget, &widget_allocation);
- old_allocation = gdk_region_rectangle (&widget_allocation);
- gdk_region_offset (old_allocation,
+ old_allocation = cairo_region_create_rectangle (&widget_allocation);
+ cairo_region_translate (old_allocation,
-widget_allocation.x, -widget_allocation.y);
- invalid = gdk_region_rectangle (allocation);
- gdk_region_offset (invalid, -allocation->x, -allocation->y);
-#if GTK_CHECK_VERSION (3, 0, 0)
+ invalid = cairo_region_create_rectangle (allocation);
+ cairo_region_translate (invalid, -allocation->x, -allocation->y);
_cairo_region_xor (invalid, old_allocation);
-#else
- gdk_region_xor (invalid, old_allocation);
-#endif
allocation_to_canvas_region (scroll_area, invalid);
foo_scroll_area_invalidate_region (scroll_area, invalid);
- gdk_region_destroy (old_allocation);
- gdk_region_destroy (invalid);
+ cairo_region_destroy (old_allocation);
+ cairo_region_destroy (invalid);
gtk_widget_set_allocation (widget, allocation);
if (scroll_area->priv->input_window)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_surface_t *new_surface;
-#else
- GdkPixmap *new_pixmap;
-#endif
gdk_window_move_resize (scroll_area->priv->input_window,
allocation->x, allocation->y,
allocation->width, allocation->height);
-#if GTK_CHECK_VERSION (3, 0, 0)
new_surface = create_new_surface (widget, scroll_area->priv->surface);
cairo_surface_destroy (scroll_area->priv->surface);
scroll_area->priv->surface = new_surface;
-#else
- new_pixmap = create_new_pixmap (widget, scroll_area->priv->pixmap);
- g_object_unref (scroll_area->priv->pixmap);
- scroll_area->priv->pixmap = new_pixmap;
-#endif
}
get_viewport (scroll_area, &new_viewport);
@@ -1071,7 +792,7 @@ process_event (FooScrollArea *scroll_area,
{
InputRegion *region = scroll_area->priv->input_regions->pdata[i];
- if (gdk_region_point_in (region->region, x, y))
+ if (cairo_region_contains_point (region->region, x, y))
{
InputPath *path;
@@ -1212,7 +933,6 @@ foo_scroll_area_set_size (FooScrollArea *scroll_area,
set_adjustment_values (scroll_area);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
foo_scroll_area_get_preferred_width (GtkWidget *widget,
gint *minimum,
@@ -1242,17 +962,6 @@ foo_scroll_area_get_preferred_height (GtkWidget *widget,
*natural = scroll_area->priv->min_height;
}
}
-#else
-static void
-foo_scroll_area_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
-
- requisition->width = scroll_area->priv->min_width;
- requisition->height = scroll_area->priv->min_height;
-}
-#endif
static void
foo_scroll_area_scroll (FooScrollArea *area,
@@ -1262,7 +971,7 @@ foo_scroll_area_scroll (FooScrollArea *area,
GdkRectangle allocation;
GdkRectangle src_area;
GdkRectangle move_area;
- GdkRegion *invalid_region;
+ cairo_region_t *invalid_region;
gtk_widget_get_allocation (GTK_WIDGET (area), &allocation);
allocation.x = 0;
@@ -1272,18 +981,14 @@ foo_scroll_area_scroll (FooScrollArea *area,
src_area.x -= dx;
src_area.y -= dy;
- invalid_region = gdk_region_rectangle (&allocation);
+ invalid_region = cairo_region_create_rectangle (&allocation);
if (gdk_rectangle_intersect (&allocation, &src_area, &move_area))
{
- GdkRegion *move_region;
+ cairo_region_t *move_region;
cairo_t *cr;
-#if GTK_CHECK_VERSION (3, 0, 0)
cr = cairo_create (area->priv->surface);
-#else
- cr = gdk_cairo_create (area->priv->pixmap);
-#endif
/* Cairo doesn't allow self-copies, so we do this little trick instead:
* 1) Clip so the group size is small.
@@ -1293,11 +998,7 @@ foo_scroll_area_scroll (FooScrollArea *area,
cairo_clip (cr);
cairo_push_group (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_set_source_surface (cr, area->priv->surface, dx, dy);
-#else
- gdk_cairo_set_source_pixmap (cr, area->priv->pixmap, dx, dy);
-#endif
gdk_cairo_rectangle (cr, &move_area);
cairo_fill (cr);
@@ -1308,17 +1009,17 @@ foo_scroll_area_scroll (FooScrollArea *area,
gtk_widget_queue_draw (GTK_WIDGET (area));
- move_region = gdk_region_rectangle (&move_area);
- gdk_region_offset (move_region, dx, dy);
- gdk_region_subtract (invalid_region, move_region);
- gdk_region_destroy (move_region);
+ move_region = cairo_region_create_rectangle (&move_area);
+ cairo_region_translate (move_region, dx, dy);
+ cairo_region_subtract (invalid_region, move_region);
+ cairo_region_destroy (move_region);
}
allocation_to_canvas_region (area, invalid_region);
foo_scroll_area_invalidate_region (area, invalid_region);
- gdk_region_destroy (invalid_region);
+ cairo_region_destroy (invalid_region);
}
static void
@@ -1392,7 +1093,6 @@ set_one_adjustment (FooScrollArea *scroll_area,
scroll_area);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
foo_scroll_area_set_hadjustment (FooScrollArea *scroll_area,
GtkAdjustment *hadjustment)
@@ -1410,18 +1110,6 @@ foo_scroll_area_set_vadjustment (FooScrollArea *scroll_area,
set_adjustment_values (scroll_area);
}
-#else
-static void
-foo_scroll_area_set_scroll_adjustments (FooScrollArea *scroll_area,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment)
-{
- set_one_adjustment (scroll_area, hadjustment, &scroll_area->priv->hadj);
- set_one_adjustment (scroll_area, vadjustment, &scroll_area->priv->vadj);
-
- set_adjustment_values (scroll_area);
-}
-#endif
FooScrollArea *
foo_scroll_area_new (void)
@@ -1524,33 +1212,33 @@ foo_scroll_area_invalidate (FooScrollArea *scroll_area)
static void
canvas_to_window (FooScrollArea *area,
- GdkRegion *region)
+ cairo_region_t *region)
{
GtkAllocation allocation;
GtkWidget *widget = GTK_WIDGET (area);
gtk_widget_get_allocation (widget, &allocation);
- gdk_region_offset (region,
+ cairo_region_translate (region,
-area->priv->x_offset + allocation.x,
-area->priv->y_offset + allocation.y);
}
static void
window_to_canvas (FooScrollArea *area,
- GdkRegion *region)
+ cairo_region_t *region)
{
GtkAllocation allocation;
GtkWidget *widget = GTK_WIDGET (area);
gtk_widget_get_allocation (widget, &allocation);
- gdk_region_offset (region,
+ cairo_region_translate (region,
area->priv->x_offset - allocation.x,
area->priv->y_offset - allocation.y);
}
void
foo_scroll_area_invalidate_region (FooScrollArea *area,
- GdkRegion *region)
+ cairo_region_t *region)
{
GtkWidget *widget;
@@ -1558,7 +1246,7 @@ foo_scroll_area_invalidate_region (FooScrollArea *area,
widget = GTK_WIDGET (area);
- gdk_region_union (area->priv->update_region, region);
+ cairo_region_union (area->priv->update_region, region);
if (gtk_widget_get_realized (widget))
{
@@ -1579,15 +1267,15 @@ foo_scroll_area_invalidate_rect (FooScrollArea *scroll_area,
int height)
{
GdkRectangle rect = { x, y, width, height };
- GdkRegion *region;
+ cairo_region_t *region;
g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
- region = gdk_region_rectangle (&rect);
+ region = cairo_region_create_rectangle (&rect);
foo_scroll_area_invalidate_region (scroll_area, region);
- gdk_region_destroy (region);
+ cairo_region_destroy (region);
}
void
diff --git a/capplets/display/scrollarea.h b/capplets/display/scrollarea.h
index 9e0caa67..9c39cc60 100644
--- a/capplets/display/scrollarea.h
+++ b/capplets/display/scrollarea.h
@@ -18,21 +18,6 @@
#include <cairo.h>
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define GdkRegion cairo_region_t
-#define gdk_region_new cairo_region_create
-#define gdk_region_destroy cairo_region_destroy
-#define gdk_region_rectangle cairo_region_create_rectangle
-#define gdk_region_subtract cairo_region_subtract
-#define gdk_region_intersect cairo_region_intersect
-#define gdk_region_empty cairo_region_is_empty
-#define gdk_region_copy cairo_region_copy
-#define gdk_region_get_clipbox cairo_region_get_extents
-#define gdk_region_offset cairo_region_translate
-#define gdk_region_point_in cairo_region_contains_point
-#define gdk_region_union cairo_region_union
-#endif
-
#define FOO_TYPE_SCROLL_AREA (foo_scroll_area_get_type ())
#define FOO_SCROLL_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_SCROLL_AREA, FooScrollArea))
#define FOO_SCROLL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_SCROLL_AREA, FooScrollAreaClass))
@@ -85,7 +70,7 @@ struct FooScrollAreaClass
void (*paint) (FooScrollArea *scroll_area,
cairo_t *cr,
GdkRectangle *extents,
- GdkRegion *region);
+ cairo_region_t *region);
};
GType foo_scroll_area_get_type (void);
@@ -120,7 +105,7 @@ void foo_scroll_area_add_input_from_fill (FooScrollArea *scroll_area,
FooScrollAreaEventFunc func,
gpointer data);
void foo_scroll_area_invalidate_region (FooScrollArea *area,
- GdkRegion *region);
+ cairo_region_t *region);
void foo_scroll_area_invalidate (FooScrollArea *scroll_area);
void foo_scroll_area_invalidate_rect (FooScrollArea *scroll_area,
int x,
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index 96b1900e..4a538f43 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -476,11 +476,7 @@ static void
rebuild_current_monitor_label (App *app)
{
char *str, *tmp;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- GdkColor color;
-#endif
gboolean use_color;
if (app->current_output)
@@ -491,11 +487,7 @@ rebuild_current_monitor_label (App *app)
tmp = g_strdup_printf (_("Monitor: %s"), mate_rr_output_info_get_display_name (app->current_output));
str = g_strdup_printf ("<b>%s</b>", tmp);
-#if GTK_CHECK_VERSION (3, 0, 0)
mate_rr_labeler_get_rgba_for_output (app->labeler, app->current_output, &color);
-#else
- mate_rr_labeler_get_color_for_output (app->labeler, app->current_output, &color);
-#endif
use_color = TRUE;
g_free (tmp);
}
@@ -510,7 +502,6 @@ rebuild_current_monitor_label (App *app)
if (use_color)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA black = { 0, 0, 0, 1.0 };
gtk_widget_override_background_color (app->current_monitor_event_box, gtk_widget_get_state_flags (app->current_monitor_event_box), &color);
@@ -520,28 +511,7 @@ rebuild_current_monitor_label (App *app)
* pastel background. See bgo#556050
*/
gtk_widget_override_color (app->current_monitor_label, gtk_widget_get_state_flags (app->current_monitor_label), &black);
-#else
- GdkColor black = { 0, 0, 0, 0 };
-
- gtk_widget_modify_bg (app->current_monitor_event_box, gtk_widget_get_state (app->current_monitor_event_box), &color);
-
- /* Make the label explicitly black. We don't want it to follow the
- * theme's colors, since the label is always shown against a light
- * pastel background. See bgo#556050
- */
- gtk_widget_modify_fg (app->current_monitor_label, gtk_widget_get_state (app->current_monitor_label), &black);
-#endif
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- else
- {
- /* Remove any modifications we did on the label's color */
- GtkRcStyle *reset_rc_style;
-
- reset_rc_style = gtk_rc_style_new ();
- gtk_widget_modify_style (app->current_monitor_label, reset_rc_style); /* takes ownership of, and destroys, the rc style */
- }
-#endif
gtk_event_box_set_visible_window (GTK_EVENT_BOX (app->current_monitor_event_box), use_color);
}
@@ -1503,11 +1473,7 @@ set_cursor (GtkWidget *widget, GdkCursorType type)
gdk_window_set_cursor (window, cursor);
if (cursor)
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (cursor);
-#else
- gdk_cursor_unref (cursor);
-#endif
}
static void
@@ -1680,25 +1646,16 @@ paint_background (FooScrollArea *area,
{
GdkRectangle viewport;
GtkWidget *widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *widget_style;
GdkRGBA *base_color = NULL;
GdkRGBA dark_color;
-#else
- GtkStyle *widget_style;
-#endif
widget = GTK_WIDGET (area);
foo_scroll_area_get_viewport (area, &viewport);
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_style = gtk_widget_get_style_context (widget);
-#else
- widget_style = gtk_widget_get_style (widget);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_style_context_save (widget_style);
gtk_style_context_set_state (widget_style, GTK_STATE_FLAG_SELECTED);
gtk_style_context_get (widget_style,
@@ -1708,12 +1665,6 @@ paint_background (FooScrollArea *area,
gtk_style_context_restore (widget_style);
gdk_cairo_set_source_rgba(cr, base_color);
gdk_rgba_free (base_color);
-#else
- cairo_set_source_rgb (cr,
- widget_style->base[GTK_STATE_SELECTED].red / 65535.0,
- widget_style->base[GTK_STATE_SELECTED].green / 65535.0,
- widget_style->base[GTK_STATE_SELECTED].blue / 65535.0);
-#endif
cairo_rectangle (cr,
viewport.x, viewport.y,
@@ -1723,7 +1674,6 @@ paint_background (FooScrollArea *area,
foo_scroll_area_add_input_from_fill (area, cr, on_canvas_event, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_style_context_save (widget_style);
gtk_style_context_set_state (widget_style, GTK_STATE_FLAG_SELECTED);
mate_desktop_gtk_style_get_dark_color (widget_style,
@@ -1731,12 +1681,6 @@ paint_background (FooScrollArea *area,
&dark_color);
gtk_style_context_restore (widget_style);
gdk_cairo_set_source_rgba (cr, &dark_color);
-#else
- cairo_set_source_rgb (cr,
- widget_style->dark[GTK_STATE_SELECTED].red / 65535.0,
- widget_style->dark[GTK_STATE_SELECTED].green / 65535.0,
- widget_style->dark[GTK_STATE_SELECTED].blue / 65535.0);
-#endif
cairo_stroke (cr);
}
@@ -1755,11 +1699,7 @@ paint_output (App *app, cairo_t *cr, int i)
PangoLayout *layout = get_display_name (app, output);
PangoRectangle ink_extent, log_extent;
GdkRectangle viewport;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA output_color;
-#else
- GdkColor output_color;
-#endif
double r, g, b;
double available_w;
double factor;
@@ -1811,17 +1751,10 @@ paint_output (App *app, cairo_t *cr, int i)
cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5);
cairo_clip_preserve (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
mate_rr_labeler_get_rgba_for_output (app->labeler, output, &output_color);
r = output_color.red;
g = output_color.green;
b = output_color.blue;
-#else
- mate_rr_labeler_get_color_for_output (app->labeler, output, &output_color);
- r = output_color.red / 65535.0;
- g = output_color.green / 65535.0;
- b = output_color.blue / 65535.0;
-#endif
if (!mate_rr_output_info_is_active (output))
{
@@ -1881,19 +1814,10 @@ paint_output (App *app, cairo_t *cr, int i)
g_object_unref (layout);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
on_area_paint (FooScrollArea *area,
cairo_t *cr,
gpointer data)
-#else
-static void
-on_area_paint (FooScrollArea *area,
- cairo_t *cr,
- GdkRectangle *extent,
- GdkRegion *region,
- gpointer data)
-#endif
{
App *app = data;
double scale;
@@ -2280,11 +2204,7 @@ get_output_for_window (MateRRConfig *configuration, GdkWindow *window)
int largest_index;
MateRROutputInfo **outputs;
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height);
-#else
- gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height, NULL);
-#endif
gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
largest_area = 0;
diff --git a/capplets/keybindings/eggcellrendererkeys.c b/capplets/keybindings/eggcellrendererkeys.c
index b521cf0a..8cd91ce9 100644
--- a/capplets/keybindings/eggcellrendererkeys.c
+++ b/capplets/keybindings/eggcellrendererkeys.c
@@ -6,10 +6,6 @@
#include "eggcellrendererkeys.h"
#include "eggaccelerators.h"
-#if !GTK_CHECK_VERSION(3,0,0)
-#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
-#endif
-
#ifndef EGG_COMPILATION
#ifndef _
#define _(x) dgettext (GETTEXT_PACKAGE, x)
diff --git a/capplets/keybindings/mate-keybinding-properties.c b/capplets/keybindings/mate-keybinding-properties.c
index f06ab09b..9d548569 100644
--- a/capplets/keybindings/mate-keybinding-properties.c
+++ b/capplets/keybindings/mate-keybinding-properties.c
@@ -19,10 +19,6 @@
#include "activate-settings-daemon.h"
#include "dconf-util.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 GSETTINGS_KEYBINDINGS_DIR "/org/mate/desktop/keybindings/"
#define CUSTOM_KEYBINDING_SCHEMA "org.mate.control-center.keybinding"
@@ -1891,13 +1887,11 @@ setup_dialog (GtkBuilder *builder, GSettings *marco_settings)
/* set up the dialog */
reload_key_entries (builder);
-#if GTK_CHECK_VERSION(3, 0, 0)
widget = _gtk_builder_get_widget (builder, "mate-keybinding-dialog");
gtk_window_set_default_size (GTK_WINDOW (widget), 400, 500);
widget = _gtk_builder_get_widget (builder, "label-suggest");
gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (widget), 60);
-#endif
widget = _gtk_builder_get_widget (builder, "mate-keybinding-dialog");
capplet_set_icon (widget, "preferences-desktop-keyboard-shortcuts");
diff --git a/capplets/keyboard/mate-keyboard-properties-a11y.c b/capplets/keyboard/mate-keyboard-properties-a11y.c
index 7a3b566e..23aea9e1 100644
--- a/capplets/keyboard/mate-keyboard-properties-a11y.c
+++ b/capplets/keyboard/mate-keyboard-properties-a11y.c
@@ -320,19 +320,4 @@ setup_a11y_tabs (GtkBuilder *dialog)
gtk_range_get_adjustment (GTK_RANGE (WID ("mousekeys_init_delay_slide"))),
"value",
G_SETTINGS_BIND_DEFAULT);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- const char *range_names[] = {
- "slowkeys_delay_slide",
- "bouncekeys_delay_slide",
- "mousekeys_accel_time_slide",
- "mousekeys_max_speed_slide",
- "mousekeys_init_delay_slide"
- };
-
- int i;
- for (i = 0; i < 5; ++i) {
- gtk_range_set_update_policy (GTK_RANGE (WID (range_names[i])), GTK_UPDATE_DISCONTINUOUS);
- }
-#endif
}
diff --git a/capplets/keyboard/mate-keyboard-properties-xkbot.c b/capplets/keyboard/mate-keyboard-properties-xkbot.c
index 90301082..6f59498a 100644
--- a/capplets/keyboard/mate-keyboard-properties-xkbot.c
+++ b/capplets/keyboard/mate-keyboard-properties-xkbot.c
@@ -327,11 +327,7 @@ xkb_options_add_group (XklConfigRegistry * config_registry,
g_free (titlemarkup);
align = gtk_alignment_new (0, 0, 1, 1);
gtk_alignment_set_padding (GTK_ALIGNMENT (align), 6, 12, 12, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (TRUE, 6);
-#endif
gtk_container_add (GTK_CONTAINER (align), vbox);
gtk_container_add (GTK_CONTAINER (current_expander), align);
diff --git a/capplets/keyboard/mate-keyboard-properties.c b/capplets/keyboard/mate-keyboard-properties.c
index d0418616..66dd13c0 100644
--- a/capplets/keyboard/mate-keyboard-properties.c
+++ b/capplets/keyboard/mate-keyboard-properties.c
@@ -186,10 +186,6 @@ setup_dialog (GtkBuilder * dialog)
gtk_notebook_remove_page (nb, tb_page);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_range_set_update_policy (GTK_RANGE (WID ("cursor_blink_time_scale")), GTK_UPDATE_DISCONTINUOUS);
-#endif
-
g_signal_connect (WID ("keyboard_dialog"), "response",
(GCallback) dialog_response, NULL);
diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c
index 3a961530..27eb573c 100644
--- a/capplets/mouse/mate-mouse-properties.c
+++ b/capplets/mouse/mate-mouse-properties.c
@@ -210,11 +210,7 @@ synaptics_check_capabilities (GtkBuilder *dialog)
XFree (data);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
XCloseDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device);
}
@@ -264,11 +260,7 @@ find_synaptics (void)
ret = TRUE;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
XCloseDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device);
diff --git a/capplets/windows/mate-metacity-support.c b/capplets/windows/mate-metacity-support.c
index ec9ca7aa..079b18d1 100644
--- a/capplets/windows/mate-metacity-support.c
+++ b/capplets/windows/mate-metacity-support.c
@@ -46,11 +46,7 @@ mate_metacity_config_tool ()
gtk_window_set_icon_name (GTK_WINDOW (dialog), "preferences-system-windows");
gtk_window_set_default_size (GTK_WINDOW (dialog), 350, 150);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
str = g_strdup_printf ("<b>%s</b>", _("Compositing Manager"));
widget = gtk_label_new (str);
diff --git a/capplets/windows/mate-window-properties.c b/capplets/windows/mate-window-properties.c
index 7f8442f9..4cafde89 100644
--- a/capplets/windows/mate-window-properties.c
+++ b/capplets/windows/mate-window-properties.c
@@ -369,40 +369,22 @@ main (int argc, char **argv)
nb = gtk_notebook_new ();
-#if GTK_CHECK_VERSION (3, 0, 0)
general_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
behaviour_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
placement_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-#else
- general_vbox = gtk_vbox_new (FALSE, 0);
- behaviour_vbox = gtk_vbox_new (FALSE, 0);
- placement_vbox = gtk_vbox_new (FALSE, 0);
-#endif
widget = gtk_label_new (_("General"));
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), general_vbox, FALSE, FALSE, 6);
gtk_notebook_append_page (GTK_NOTEBOOK (nb), hbox, widget);
widget = gtk_label_new (_("Behaviour"));
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), behaviour_vbox, FALSE, FALSE, 6);
gtk_notebook_append_page (GTK_NOTEBOOK (nb), hbox, widget);
widget = gtk_label_new (_("Placement"));
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), placement_vbox, FALSE, FALSE, 6);
gtk_notebook_append_page (GTK_NOTEBOOK (nb), hbox, widget);
@@ -410,15 +392,10 @@ main (int argc, char **argv)
widget = title_label_new (N_("Compositing Manager"));
gtk_box_pack_start (GTK_BOX (general_vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- vbox = gtk_vbox_new (FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
- hbox1 = gtk_hbox_new (FALSE, 0);
-#endif
+
compositing_checkbutton = gtk_check_button_new_with_mnemonic (_("Enable software _compositing window manager"));
compositing_fast_alt_tab_checkbutton = gtk_check_button_new_with_mnemonic (_("Disable _thumbnails in Alt-Tab"));
gtk_box_pack_start (GTK_BOX (vbox), compositing_checkbutton, FALSE, FALSE, 6);
@@ -431,11 +408,7 @@ main (int argc, char **argv)
widget = title_label_new (N_("Titlebar Buttons"));
gtk_box_pack_start (GTK_BOX (general_vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
widget = gtk_label_new (_("Position:"));
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 6);
titlebar_layout_optionmenu = gtk_combo_box_text_new ();
@@ -446,11 +419,7 @@ main (int argc, char **argv)
widget = title_label_new (N_("New Windows"));
gtk_box_pack_start (GTK_BOX (placement_vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
center_new_windows_checkbutton = gtk_check_button_new_with_mnemonic (_("Center _new windows"));
gtk_box_pack_start (GTK_BOX (hbox), center_new_windows_checkbutton, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (placement_vbox), hbox, FALSE, FALSE, 6);
@@ -459,11 +428,7 @@ main (int argc, char **argv)
widget = title_label_new (N_("Window Snapping"));
gtk_box_pack_start (GTK_BOX (placement_vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
side_by_side_tiling_checkbutton = gtk_check_button_new_with_mnemonic (_("Enable side by side _tiling"));
gtk_box_pack_start (GTK_BOX (hbox), side_by_side_tiling_checkbutton, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (placement_vbox), hbox, FALSE, FALSE, 6);
@@ -472,22 +437,12 @@ main (int argc, char **argv)
widget = title_label_new (N_("Window Selection"));
gtk_box_pack_start (GTK_BOX (behaviour_vbox), widget, FALSE, FALSE, 6);
-
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- vbox = gtk_vbox_new (FALSE, 0);
- vbox1 = gtk_vbox_new (FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
- hbox1 = gtk_hbox_new (FALSE, 0);
- hbox2 = gtk_hbox_new (FALSE, 0);
- hbox3 = gtk_hbox_new (FALSE, 0);
-#endif
focus_mode_checkbutton = gtk_check_button_new_with_mnemonic (_("_Select windows when the mouse moves over them"));
gtk_box_pack_start (GTK_BOX (vbox), focus_mode_checkbutton, FALSE, FALSE, 6);
@@ -500,13 +455,9 @@ main (int argc, char **argv)
gtk_box_pack_start (GTK_BOX (hbox2), autoraise_checkbutton, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
autoraise_delay_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
autoraise_delay_slider = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 10, 0.2);
-#else
- autoraise_delay_hbox = gtk_hbox_new (FALSE, 0);
- autoraise_delay_slider = gtk_hscale_new_with_range (0, 10, 0.2);
-#endif
+
widget = gtk_label_new_with_mnemonic (_("_Interval before raising:"));
gtk_box_pack_start (GTK_BOX (autoraise_delay_hbox), widget, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (autoraise_delay_hbox), autoraise_delay_slider, TRUE, TRUE, 6);
@@ -525,11 +476,7 @@ main (int argc, char **argv)
widget = title_label_new (N_("Titlebar Action"));
gtk_box_pack_start (GTK_BOX (behaviour_vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
widget = gtk_label_new_with_mnemonic (_("_Double-click titlebar to perform this action:"));
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 6);
double_click_titlebar_optionmenu = gtk_combo_box_text_new ();
@@ -541,13 +488,8 @@ main (int argc, char **argv)
widget = title_label_new (N_("Movement Key"));
gtk_box_pack_start (GTK_BOX (behaviour_vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- vbox = gtk_vbox_new (FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
widget = gtk_label_new_with_mnemonic (_("To move a window, press-and-hold this key then grab the window:"));
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -558,11 +500,7 @@ main (int argc, char **argv)
#endif
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
alt_click_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- alt_click_vbox = gtk_vbox_new (FALSE, 6);
-#endif
gtk_label_set_mnemonic_widget (GTK_LABEL (widget), alt_click_vbox);
gtk_box_pack_start (GTK_BOX (vbox), alt_click_vbox, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 6);