diff options
author | monsta <[email protected]> | 2016-11-22 17:47:06 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-11-22 17:47:06 +0300 |
commit | f7acf55db3ab4b97d60faae24555a07b6b08d43c (patch) | |
tree | 6feb99e63f801161642669b01c9ce0c217e60d0b /geyes | |
parent | 45354a60352e05eba7e66e24a171e713876d71e9 (diff) | |
download | mate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.bz2 mate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.xz |
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require mate-panel >= 1.17
WARNING: use GTK+3 build of libmateweather for this build.
that lib is not migrated to GTK+3 only as we will possibly
use libgweather instead of it.
Diffstat (limited to 'geyes')
-rw-r--r-- | geyes/geyes.c | 34 | ||||
-rw-r--r-- | geyes/themes.c | 15 |
2 files changed, 7 insertions, 42 deletions
diff --git a/geyes/geyes.c b/geyes/geyes.c index 81d7b2d3..5a49d129 100644 --- a/geyes/geyes.c +++ b/geyes/geyes.c @@ -26,12 +26,6 @@ #define UPDATE_TIMEOUT 100 -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - -#if GTK_CHECK_VERSION (3, 0, 0) static gfloat gtk_align_to_gfloat (GtkAlign align) { @@ -47,7 +41,6 @@ gtk_align_to_gfloat (GtkAlign align) return 0.0; } } -#endif /* TODO - Optimize this a bit */ static void @@ -68,13 +61,8 @@ calculate_pupil_xy (EyesApplet *eyes_applet, gtk_widget_get_allocation (GTK_WIDGET(widget), &allocation); width = allocation.width; height = allocation.height; -#if GTK_CHECK_VERSION (3, 0, 0) - xalign = gtk_align_to_gfloat (gtk_widget_get_halign (widget)); yalign = gtk_align_to_gfloat (gtk_widget_get_valign (widget)); -#else - gtk_misc_get_alignment(GTK_MISC(widget), &xalign, &yalign); -#endif nx = x - MAX(width - eyes_applet->eye_width, 0) * xalign - eyes_applet->eye_width / 2; ny = y - MAX(height- eyes_applet->eye_height, 0) * yalign - eyes_applet->eye_height / 2; @@ -135,7 +123,6 @@ draw_eye (EyesApplet *eyes_applet, static gint timer_cb (EyesApplet *eyes_applet) { -#if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; #if GTK_CHECK_VERSION (3, 20, 0) GdkSeat *seat; @@ -143,12 +130,10 @@ timer_cb (EyesApplet *eyes_applet) GdkDeviceManager *device_manager; GdkDevice *device; #endif -#endif gint x, y; gint pupil_x, pupil_y; gint i; -#if GTK_CHECK_VERSION (3, 0, 0) display = gtk_widget_get_display (GTK_WIDGET (eyes_applet->applet)); #if GTK_CHECK_VERSION (3, 20, 0) seat = gdk_display_get_default_seat (display); @@ -156,11 +141,9 @@ timer_cb (EyesApplet *eyes_applet) device_manager = gdk_display_get_device_manager (display); device = gdk_device_manager_get_client_pointer (device_manager); #endif -#endif for (i = 0; i < eyes_applet->num_eyes; i++) { if (gtk_widget_get_realized (eyes_applet->eyes[i])) { -#if GTK_CHECK_VERSION (3, 0, 0) #if GTK_CHECK_VERSION (3, 20, 0) gdk_window_get_device_position (gtk_widget_get_window (eyes_applet->eyes[i]), gdk_seat_get_pointer (seat), @@ -168,9 +151,6 @@ timer_cb (EyesApplet *eyes_applet) #else gdk_window_get_device_position (gtk_widget_get_window (eyes_applet->eyes[i]), device, &x, &y, NULL); #endif -#else - gtk_widget_get_pointer (eyes_applet->eyes[i], &x, &y); -#endif if ((x != eyes_applet->pointer_last_x[i]) || (y != eyes_applet->pointer_last_y[i])) { calculate_pupil_xy (eyes_applet, x, y, &pupil_x, &pupil_y, eyes_applet->eyes[i]); @@ -242,7 +222,7 @@ setup_eyes (EyesApplet *eyes_applet) { int i; - eyes_applet->hbox = gtk_hbox_new (FALSE, 0); + eyes_applet->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (eyes_applet->vbox), eyes_applet->hbox, TRUE, TRUE, 0); eyes_applet->eyes = g_new0 (GtkWidget *, eyes_applet->num_eyes); @@ -267,7 +247,6 @@ setup_eyes (EyesApplet *eyes_applet) 0); if ((eyes_applet->num_eyes != 1) && (i == 0)) { -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (eyes_applet->eyes[i], GTK_ALIGN_END); gtk_widget_set_valign (eyes_applet->eyes[i], GTK_ALIGN_CENTER); } @@ -278,15 +257,6 @@ setup_eyes (EyesApplet *eyes_applet) else { gtk_widget_set_halign (eyes_applet->eyes[i], GTK_ALIGN_CENTER); gtk_widget_set_valign (eyes_applet->eyes[i], GTK_ALIGN_CENTER); -#else - gtk_misc_set_alignment (GTK_MISC (eyes_applet->eyes[i]), 1.0, 0.5); - } - else if ((eyes_applet->num_eyes != 1) && (i == eyes_applet->num_eyes - 1)) { - gtk_misc_set_alignment (GTK_MISC (eyes_applet->eyes[i]), 0.0, 0.5); - } - else { - gtk_misc_set_alignment (GTK_MISC (eyes_applet->eyes[i]), 0.5, 0.5); -#endif } gtk_widget_realize (eyes_applet->eyes[i]); @@ -319,7 +289,7 @@ create_eyes (MatePanelApplet *applet) EyesApplet *eyes_applet = g_new0 (EyesApplet, 1); eyes_applet->applet = applet; - eyes_applet->vbox = gtk_vbox_new (FALSE, 0); + eyes_applet->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); eyes_applet->settings = mate_panel_applet_settings_new (applet, "org.mate.panel.applet.geyes"); diff --git a/geyes/themes.c b/geyes/themes.c index b2167288..3af628c8 100644 --- a/geyes/themes.c +++ b/geyes/themes.c @@ -29,11 +29,6 @@ #define NUM_THEME_DIRECTORIES 2 #define HIG_IDENTATION " " -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - static char *theme_directories[NUM_THEME_DIRECTORIES]; enum { @@ -301,18 +296,18 @@ properties_cb (GtkAction *action, G_CALLBACK (presponse_cb), eyes_applet); - vbox = gtk_vbox_new (FALSE, 0); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (pbox))), vbox, TRUE, TRUE, 0); - categories_vbox = gtk_vbox_new (FALSE, 18); + categories_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18); gtk_box_pack_start (GTK_BOX (vbox), categories_vbox, TRUE, TRUE, 0); gtk_widget_show (categories_vbox); - category_vbox = gtk_vbox_new (FALSE, 6); + category_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (categories_vbox), category_vbox, TRUE, TRUE, 0); gtk_widget_show (category_vbox); @@ -328,7 +323,7 @@ properties_cb (GtkAction *action, gtk_box_pack_start (GTK_BOX (category_vbox), label, FALSE, FALSE, 0); g_free (title); - hbox = gtk_hbox_new (FALSE, 0); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (category_vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); @@ -337,7 +332,7 @@ properties_cb (GtkAction *action, gtk_box_pack_start (GTK_BOX (hbox), indent, FALSE, FALSE, 0); gtk_widget_show (indent); - control_vbox = gtk_vbox_new (FALSE, 6); + control_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox), control_vbox, TRUE, TRUE, 0); gtk_widget_show (control_vbox); |