diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/capplet/mate-notification-properties.c | 34 | ||||
-rw-r--r-- | src/daemon/mnd-daemon.c | 6 | ||||
-rw-r--r-- | src/themes/coco/coco-theme.c | 36 | ||||
-rw-r--r-- | src/themes/nodoka/nodoka-theme.c | 104 |
5 files changed, 92 insertions, 92 deletions
diff --git a/configure.ac b/configure.ac index b9b758f..95050c5 100644 --- a/configure.ac +++ b/configure.ac @@ -218,7 +218,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then else AC_MSG_RESULT(no) fi - + dnl --------------------------------------------------------------------------- dnl Enabel/disable icon cache generation dnl --------------------------------------------------------------------------- @@ -227,7 +227,7 @@ AC_ARG_ENABLE(icon-update, AC_HELP_STRING([--disable-icon-update], if (test "$enable_icon_update" != no); then AC_PATH_PROG(UPDATE_ICON_CACHE, [gtk-update-icon-cache]) fi -AM_CONDITIONAL([ICON_UPDATE], [test -n "$UPDATE_ICON_CACHE"]) +AM_CONDITIONAL([ICON_UPDATE], [test -n "$UPDATE_ICON_CACHE"]) AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $WARNINGCFLAGS" AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS" diff --git a/src/capplet/mate-notification-properties.c b/src/capplet/mate-notification-properties.c index 2f5b103..f74897e 100644 --- a/src/capplet/mate-notification-properties.c +++ b/src/capplet/mate-notification-properties.c @@ -105,16 +105,16 @@ static void notification_properties_monitor_changed(GtkComboBox* widget, Notific { gint monitor; GtkTreeIter iter; - + GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->monitor_combo)); - + if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dialog->monitor_combo), &iter)) { return; } - + gtk_tree_model_get(model, &iter, NOTIFY_MONITOR_NUMBER, &monitor, -1); - + g_settings_set_int(dialog->gsettings, GSETTINGS_KEY_MONITOR_NUMBER, monitor); } @@ -129,11 +129,11 @@ static void notification_properties_monitor_notify(GSettings *settings, gchar *k model = gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->monitor_combo)); monitor_number = g_settings_get_int(dialog->gsettings, GSETTINGS_KEY_MONITOR_NUMBER); - + for (valid = gtk_tree_model_get_iter_first(model, &iter); valid; valid = gtk_tree_model_iter_next(model, &iter)) { gtk_tree_model_get(model, &iter, NOTIFY_MONITOR_NUMBER, &monitor_number_at_iter, -1); - + if (monitor_number_at_iter == monitor_number) { gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dialog->monitor_combo), &iter); @@ -207,15 +207,15 @@ static void notification_properties_dialog_setup_monitors(NotificationAppletDial // TODO: add support for multiple displays. display = gdk_display_get_default(); g_assert(display != NULL); - + // Assumes the user has only one screen. // TODO: add support for mulitple screens. screen = gdk_display_get_default_screen(display); g_assert(screen != NULL); - + num_monitors = gdk_display_get_n_monitors(display); g_assert(num_monitors >= 1); - + store = gtk_list_store_new(N_COLUMNS_MONITOR, G_TYPE_INT); gint i; @@ -224,21 +224,21 @@ static void notification_properties_dialog_setup_monitors(NotificationAppletDial gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, NOTIFY_MONITOR_NUMBER, i, -1); } - + gtk_combo_box_set_model(GTK_COMBO_BOX (dialog->monitor_combo), GTK_TREE_MODEL (store)); - + g_signal_connect(dialog->gsettings, "changed::" GSETTINGS_KEY_MONITOR_NUMBER, G_CALLBACK (notification_properties_monitor_notify), dialog); cur_monitor_number = g_settings_get_int(dialog->gsettings, GSETTINGS_KEY_MONITOR_NUMBER); for (valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL (store), &iter); valid; valid = gtk_tree_model_iter_next(GTK_TREE_MODEL (store), &iter)) { gtk_tree_model_get(GTK_TREE_MODEL (store), &iter, NOTIFY_MONITOR_NUMBER, &cur_monitor_number_at_iter, -1); - + if (cur_monitor_number_at_iter == cur_monitor_number) { gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dialog->monitor_combo), &iter); break; - } + } } g_object_unref(store); @@ -536,16 +536,16 @@ static gboolean notification_properties_dialog_init(NotificationAppletDialog* di dialog->monitor_combo = GTK_WIDGET(gtk_builder_get_object(builder, "monitor_combo")); g_assert(dialog->monitor_combo != NULL); - + dialog->theme_combo = GTK_WIDGET(gtk_builder_get_object(builder, "theme_combo")); g_assert(dialog->theme_combo != NULL); - + dialog->active_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "use_active_check")); - g_assert(dialog->active_checkbox != NULL); + g_assert(dialog->active_checkbox != NULL); dialog->monitor_label = GTK_WIDGET(gtk_builder_get_object(builder, "monitor_label")); g_assert(dialog->monitor_label != NULL); - + g_object_unref(builder); dialog->gsettings = g_settings_new (GSETTINGS_SCHEMA); diff --git a/src/daemon/mnd-daemon.c b/src/daemon/mnd-daemon.c index bcb28af..4e52541 100644 --- a/src/daemon/mnd-daemon.c +++ b/src/daemon/mnd-daemon.c @@ -3,17 +3,17 @@ * mnd-daemon.c: This file is part of mate-notification-daemon * * Copyright (C) 2018 Wu Xiaotian <[email protected]> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c index a08baf7..f52729b 100644 --- a/src/themes/coco/coco-theme.c +++ b/src/themes/coco/coco-theme.c @@ -6,19 +6,19 @@ * Copyright (C) 2010 - Eduardo Grajeda * Copyright (C) 2008 - Martin Sourada * - * notification-daemon-engine-coco is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 3 of the License, + * notification-daemon-engine-coco is free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * - * notification-daemon-engine-coco is distributed in the hope that it will be + * notification-daemon-engine-coco is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with notification-daemon-engine-coco; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * along with notification-daemon-engine-coco; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ @@ -146,19 +146,19 @@ fill_background(GtkWidget *widget, WindowData *windata, cairo_t *cr) cairo_pattern_t *pattern; pattern = cairo_pattern_create_linear (0, 0, 0, windata->height); - cairo_pattern_add_color_stop_rgba (pattern, 0, + cairo_pattern_add_color_stop_rgba (pattern, 0, 19/255.0, 19/255.0, 19/255.0, alpha); - cairo_pattern_add_color_stop_rgba (pattern, GRADIENT_CENTER, + cairo_pattern_add_color_stop_rgba (pattern, GRADIENT_CENTER, 19/255.0, 19/255.0, 19/255.0, alpha); - cairo_pattern_add_color_stop_rgba (pattern, 1, + cairo_pattern_add_color_stop_rgba (pattern, 1, 19/255.0, 19/255.0, 19/255.0, alpha); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); - + nodoka_rounded_rectangle (cr, 0, 8, windata->width-8, windata->height-8, 6); - cairo_fill (cr); + cairo_fill (cr); } static void @@ -173,8 +173,8 @@ draw_pie(GtkWidget *pie, WindowData *windata, cairo_t *cr) cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS, -G_PI/2, (-0.25 + arc_angle)*2*G_PI); cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS); - - cairo_fill (cr); + + cairo_fill (cr); } static void @@ -361,8 +361,8 @@ get_theme_info(char **theme_name, char **homepage) { *theme_name = g_strdup("Coco"); - *theme_ver = g_strdup_printf("%d.%d.%d", NOTIFICATION_DAEMON_MAJOR_VERSION, - NOTIFICATION_DAEMON_MINOR_VERSION, + *theme_ver = g_strdup_printf("%d.%d.%d", NOTIFICATION_DAEMON_MAJOR_VERSION, + NOTIFICATION_DAEMON_MINOR_VERSION, NOTIFICATION_DAEMON_MICRO_VERSION); *author = g_strdup("Eduardo Grajeda"); *homepage = g_strdup("http://github.com/tatofoo/"); @@ -431,13 +431,13 @@ create_notification(UrlClickedCb url_clicked) gtk_widget_show (windata->main_hbox); gtk_box_pack_start (GTK_BOX(main_vbox), windata->main_hbox, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(windata->main_hbox), 13); - - /* The icon goes at the left */ + + /* The icon goes at the left */ windata->iconbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show(windata->iconbox); gtk_box_pack_start(GTK_BOX(windata->main_hbox), windata->iconbox, FALSE, FALSE, 0); - + windata->icon = gtk_image_new(); gtk_box_pack_start(GTK_BOX(windata->iconbox), windata->icon, FALSE, FALSE, 0); diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c index 970038e..9633178 100644 --- a/src/themes/nodoka/nodoka-theme.c +++ b/src/themes/nodoka/nodoka-theme.c @@ -5,23 +5,23 @@ * Copyright (C) 2012 - Stefano Karapetsas <[email protected]> * Copyright (C) 2008 - Martin Sourada * - * notification-daemon-engine-nodoka is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 3 of the License, + * notification-daemon-engine-nodoka is free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * - * notification-daemon-engine-nodoka is distributed in the hope that it will be + * notification-daemon-engine-nodoka is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with notification-daemon-engine-nodoka; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * along with notification-daemon-engine-nodoka; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ - - + + #include "config.h" @@ -167,19 +167,19 @@ set_arrow_parameters (WindowData *windata) GtkAllocation alloc; gtk_widget_get_allocation(windata->win, &alloc); - if ((windata->arrow.position.x - DEFAULT_ARROW_SKEW - - DEFAULT_ARROW_OFFSET + alloc.width) > + if ((windata->arrow.position.x - DEFAULT_ARROW_SKEW - + DEFAULT_ARROW_OFFSET + alloc.width) > screen_width) { - windata->arrow.offset = windata->arrow.position.x - - DEFAULT_ARROW_SKEW - - (screen_width - + windata->arrow.offset = windata->arrow.position.x - + DEFAULT_ARROW_SKEW - + (screen_width - alloc.width); } - else if ((windata->arrow.position.x - DEFAULT_ARROW_SKEW - + else if ((windata->arrow.position.x - DEFAULT_ARROW_SKEW - DEFAULT_ARROW_OFFSET < 0)) { - windata->arrow.offset = windata->arrow.position.x - + windata->arrow.offset = windata->arrow.position.x - DEFAULT_ARROW_SKEW; } else @@ -192,17 +192,17 @@ set_arrow_parameters (WindowData *windata) windata->arrow.offset = 6; windata->arrow.position.x += 6; } - else if (windata->arrow.offset + DEFAULT_ARROW_WIDTH + 6 > + else if (windata->arrow.offset + DEFAULT_ARROW_WIDTH + 6 > alloc.width) { - windata->arrow.offset = alloc.width - 6 - + windata->arrow.offset = alloc.width - 6 - DEFAULT_ARROW_WIDTH; windata->arrow.position.x -= 6; } /* Set arrow points X position */ windata->arrow.point_begin.x = windata->arrow.offset; - windata->arrow.point_middle.x = windata->arrow.offset + + windata->arrow.point_middle.x = windata->arrow.offset + DEFAULT_ARROW_SKEW; windata->arrow.point_end.x = windata->arrow.offset + DEFAULT_ARROW_WIDTH; @@ -210,7 +210,7 @@ set_arrow_parameters (WindowData *windata) /* Set arrow points Y position */ arrow_type = get_notification_arrow_type(windata->win); - + switch (arrow_type) { case GTK_ARROW_UP: @@ -220,13 +220,13 @@ set_arrow_parameters (WindowData *windata) y = windata->arrow.position.y; break; case GTK_ARROW_DOWN: - windata->arrow.point_begin.y = - alloc.height - + windata->arrow.point_begin.y = + alloc.height - DEFAULT_ARROW_HEIGHT; - windata->arrow.point_middle.y = + windata->arrow.point_middle.y = alloc.height; - windata->arrow.point_end.y = - alloc.height - + windata->arrow.point_end.y = + alloc.height - DEFAULT_ARROW_HEIGHT; y = windata->arrow.position.y - alloc.height; break; @@ -309,8 +309,8 @@ nodoka_rounded_rectangle (cairo_t * cr, /* Rounded rectangle with arrow */ static void -nodoka_rounded_rectangle_with_arrow (cairo_t * cr, - double x, double y, double w, double h, +nodoka_rounded_rectangle_with_arrow (cairo_t * cr, + double x, double y, double w, double h, int radius, ArrowParameters * arrow) { gboolean arrow_up; @@ -323,38 +323,38 @@ nodoka_rounded_rectangle_with_arrow (cairo_t * cr, rect.width = w; if (arrow_up) rect.y = 0 + DEFAULT_ARROW_HEIGHT; - else + else rect.y = 0; rect.height = h - DEFAULT_ARROW_HEIGHT; - cairo_move_to (cr, rect.x + radius, rect.y); + cairo_move_to (cr, rect.x + radius, rect.y); if (arrow_up) { - cairo_line_to (cr, rect.x + arrow->point_begin.x, + cairo_line_to (cr, rect.x + arrow->point_begin.x, rect.y); - cairo_line_to (cr, rect.x + arrow->point_middle.x, + cairo_line_to (cr, rect.x + arrow->point_middle.x, rect.y - DEFAULT_ARROW_HEIGHT); - cairo_line_to (cr, rect.x + arrow->point_end.x, + cairo_line_to (cr, rect.x + arrow->point_end.x, rect.y); } - cairo_arc (cr, rect.x + rect.width - radius, rect.y + radius, radius, + cairo_arc (cr, rect.x + rect.width - radius, rect.y + radius, radius, G_PI * 1.5, G_PI * 2); - cairo_arc (cr, rect.x + rect.width - radius, + cairo_arc (cr, rect.x + rect.width - radius, rect.y + rect.height - radius, radius, 0, G_PI * 0.5); if (!arrow_up) { - cairo_line_to (cr, rect.x + arrow->point_end.x, + cairo_line_to (cr, rect.x + arrow->point_end.x, rect.y + rect.height); - cairo_line_to (cr, rect.x + arrow->point_middle.x, + cairo_line_to (cr, rect.x + arrow->point_middle.x, rect.y + rect.height + DEFAULT_ARROW_HEIGHT); - cairo_line_to (cr, rect.x + arrow->point_begin.x, + cairo_line_to (cr, rect.x + arrow->point_begin.x, rect.y + rect.height); } - cairo_arc (cr, rect.x + radius, rect.y + rect.height - radius, + cairo_arc (cr, rect.x + radius, rect.y + rect.height - radius, radius, G_PI * 0.5, G_PI); cairo_arc (cr, rect.x + radius, rect.y + radius, radius, G_PI, G_PI * 1.5); @@ -380,14 +380,14 @@ fill_background(GtkWidget *widget, WindowData *windata, cairo_t *cr) cairo_pattern_add_color_stop_rgba (pattern, 1, 0.984, 0.984, 0.663, alpha); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); - + if (windata->arrow.has_arrow) - nodoka_rounded_rectangle_with_arrow (cr, 0, 0, + nodoka_rounded_rectangle_with_arrow (cr, 0, 0, windata->width, windata->height, 6, & (windata->arrow)); else - nodoka_rounded_rectangle (cr, 0, 0, windata->width, + nodoka_rounded_rectangle (cr, 0, 0, windata->width, windata->height, 6); - cairo_fill (cr); + cairo_fill (cr); } @@ -460,10 +460,10 @@ draw_stripe(GtkWidget *widget, WindowData *windata, cairo_t *cr) cairo_pattern_destroy (pattern); if (windata->arrow.has_arrow) - nodoka_rounded_rectangle_with_arrow (cr, 1, 1, + nodoka_rounded_rectangle_with_arrow (cr, 1, 1, windata->width - 2, windata->height - 2, 5, & (windata->arrow)); else - nodoka_rounded_rectangle (cr, 1, 1, windata->width - 2, + nodoka_rounded_rectangle (cr, 1, 1, windata->width - 2, windata->height - 2, 5); cairo_fill (cr); @@ -485,16 +485,16 @@ draw_border(GtkWidget *widget, WindowData *windata, cairo_t *cr) cairo_pattern_add_color_stop_rgba (pattern, 1, 0.776, 0.757, 0.596, alpha); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); - + if (windata->arrow.has_arrow) - nodoka_rounded_rectangle_with_arrow (cr, 0.5, 0.5, + nodoka_rounded_rectangle_with_arrow (cr, 0.5, 0.5, windata->width -1, windata->height -1, 6, & (windata->arrow)); else - nodoka_rounded_rectangle (cr, 0.5, 0.5, windata->width -1, + nodoka_rounded_rectangle (cr, 0.5, 0.5, windata->width -1, windata->height -1, 6); cairo_set_line_width (cr, 1.0); - cairo_stroke (cr); + cairo_stroke (cr); } static void @@ -509,8 +509,8 @@ draw_pie(GtkWidget *pie, WindowData *windata, cairo_t *cr) cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS, -G_PI/2, (-0.25 + arc_angle)*2*G_PI); cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS); - - cairo_fill (cr); + + cairo_fill (cr); } static void @@ -560,7 +560,7 @@ paint_window (GtkWidget *widget, windata->width = allocation.width; windata->height = allocation.height; } - + if (windata->arrow.has_arrow) set_arrow_parameters (windata); @@ -704,8 +704,8 @@ get_theme_info(char **theme_name, char **homepage) { *theme_name = g_strdup("Nodoka"); - *theme_ver = g_strdup_printf("%d.%d.%d", NOTIFICATION_DAEMON_MAJOR_VERSION, - NOTIFICATION_DAEMON_MINOR_VERSION, + *theme_ver = g_strdup_printf("%d.%d.%d", NOTIFICATION_DAEMON_MAJOR_VERSION, + NOTIFICATION_DAEMON_MINOR_VERSION, NOTIFICATION_DAEMON_MICRO_VERSION); *author = g_strdup("Martin Sourada"); *homepage = g_strdup("https://nodoka.fedorahosted.org/"); |