diff -Nur notification-daemon-0.5.0//debian/changelog notification-daemon-0.5.0-2//debian/changelog --- notification-daemon-0.5.0//debian/changelog 2010-06-29 09:23:30.000000000 +0200 +++ notification-daemon-0.5.0-2//debian/changelog 2010-11-12 22:36:48.000000000 +0100 @@ -1,3 +1,24 @@ +notification-daemon (0.5.0-2ubuntu1) natty; urgency=low + + * Merge from debian testing. LP: #609334 + * Remaining changes: + * debian/patches/01_ubuntu_theme.patch: + - add ubuntu theme + - migrate from SexyUrlLabel to GtkLabel. + * debian/patches/02_make_ubuntu_theme_default.patch: + - default to the ubuntu theme + * debian/rules + - regeneration of autoconf and automake files. + - switch to automake instead of automake1.9 + * Dropped: + * build without "-Wl,--as-needed" to avoid crash on theme switching + * debian/patches/09_change_themes_crash_rev1.patch: + - fixed upstream. + * 10_support-for-notification-spec-0.10.patch: + - merged upstream. + + -- Julien Lavergne Fri, 12 Nov 2010 22:36:39 +0100 + notification-daemon (0.5.0-2) unstable; urgency=low * debian/notification-daemon.prerm: @@ -33,6 +54,27 @@ -- Sebastian Dröge Tue, 29 Jun 2010 07:17:39 +0200 +notification-daemon (0.4.0-2ubuntu2) lucid; urgency=low + + * really drop debian/patches/08_hide_properties_desktop.patch + + -- Michael Vogt Wed, 25 Nov 2009 16:51:14 +0100 + +notification-daemon (0.4.0-2ubuntu1) lucid; urgency=low + + * Merge from debian testing, remaining changes: + * build without "-Wl,--as-needed" to avoid crash on theme switching + * debian/patches/01_ubuntu_theme.patch: + - add ubuntu theme + * debian/patches/02_make_ubuntu_theme_default.patch: + - default to the ubuntu theme + * debian/patches/09_change_themes_crash_rev1.patch: + - fix crash on theme switching + * Dropped, now in debian: + * debian/patches/08_hide_properties_desktop.patch + + -- Michael Vogt Wed, 25 Nov 2009 16:31:10 +0100 + notification-daemon (0.4.0-2) unstable; urgency=low * debian/patches/01_hide-capplet.patch: @@ -42,6 +84,38 @@ -- Sebastian Dröge Thu, 08 Oct 2009 12:38:58 +0200 +notification-daemon (0.4.0-1ubuntu3) karmic; urgency=low + + [ Max Bowsher ] + * Restore autotoolization accidentally dropped in -1ubuntu1 resulting in + 01_ubuntu_theme.patch not taking effect. + + [ Didier Roche ] + * Readd wrongly removed debian/control.in + + -- Didier Roche Tue, 25 Aug 2009 10:53:25 +0200 + +notification-daemon (0.4.0-1ubuntu2) karmic; urgency=low + + * Add support for v0.10 of the notification spec. (lp: #408941) + + -- Aurélien Gâteau Tue, 04 Aug 2009 18:05:50 +0200 + +notification-daemon (0.4.0-1ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - build without "-Wl,--as-needed" to avoid crash on theme switching + * debian/patches/01_ubuntu_theme.patch: + - add ubuntu theme + * debian/patches/02_make_ubuntu_theme_default.patch: + - default to the ubuntu theme + * debian/patches/09_change_themes_crash_rev1.patch: + - fix crash on theme switching + * debian/patches/08_hide_properties_desktop.patch: + - do not show notification-properties in the menu + + -- Michael Vogt Tue, 05 May 2009 16:41:29 +0200 + notification-daemon (0.4.0-1) unstable; urgency=low * New upstream release (Closes: #510930, #344883): @@ -72,6 +146,181 @@ -- Sebastian Dröge Thu, 05 Mar 2009 13:28:12 +0100 +notification-daemon (0.4.0-0ubuntu4) jaunty-proposed; urgency=low + + * debian/patches/09_change_themes_crash_rev1.patch resolve (LP: #131227) + - fix crash when changing themes (based on the patch from + Antonio Litterio, many thanks) + * debian/rules: + - build without "-Wl,--as-needed" to avoid another crash releated + to loading/unloading libsexy from the themes (LP: #131227) + + -- Michael Vogt Wed, 22 Apr 2009 13:19:20 +0200 + +notification-daemon (0.4.0-0ubuntu3) jaunty; urgency=low + + * Add 08_hide_properties_desktop.patch: Do not display + notification-properties in the menu by default; it's not worth spending a + menu item for this small thing, users can reenable it with alacarte, and + it doesn't work for notify-osd at all. (LP: #301766, #332014) + + -- Martin Pitt Wed, 04 Mar 2009 09:05:13 +0100 + +notification-daemon (0.4.0-0ubuntu2) jaunty; urgency=low + + * fix FTBFS by adding missing libglade2-dev and libnotify-dev + build dependencies + + -- Michael Vogt Mon, 24 Nov 2008 10:24:14 +0100 + +notification-daemon (0.4.0-0ubuntu1) jaunty; urgency=low + + * New upstream release + * drop 06_fix_default_theme_size (taken upstream) + * drop 95_force_intltooliz.patch + + -- Michael Vogt Fri, 21 Nov 2008 10:22:23 +0100 + +notification-daemon (0.3.7-1ubuntu15) intrepid; urgency=low + + * Added 99_libtool_fix.patch to resolve FTBFS (LP: #262079) + * Bumped standards version to 3.8.0 + + -- Michael Casadevall Wed, 27 Aug 2008 22:10:39 -0400 + +notification-daemon (0.3.7-1ubuntu14) intrepid; urgency=low + + * 06_fix_default_theme_size.patch + - remove a unneeded gtk_widget_set_size_request() + + -- Michael Vogt Tue, 29 Jul 2008 17:32:49 +0200 + +notification-daemon (0.3.7-1ubuntu13) intrepid; urgency=low + + * debian/patches/01_ubuntu_theme.patch: + - fix memory leaks (thanks to Cody Somerville) + * debian/patches/07_memleak_daemon.patch: + - fix leak in the daemon (thanks to seb128) + + -- Michael Vogt Tue, 03 Jun 2008 10:43:28 +0200 + +notification-daemon (0.3.7-1ubuntu12) intrepid; urgency=low + + * debian/patches/01_ubuntu_theme.patch: + - Fixed memory leak reported in lp: #67129 + - Testing has shown significant improvement but there are + inconclusive indicators that another much smaller leak may exist. + * debian/copyright: Updated to make lintian happy. + + -- Cody A.W. Somerville Fri, 23 May 2008 14:43:59 +0200 + +notification-daemon (0.3.7-1ubuntu11) hardy; urgency=low + + * 06_fix_default_theme_size.patch: + - Fix the display of certain long lines. (LP: #40379). + The patch is by BobMauchin, taken from + http://trac.galago-project.org/ticket/162 + * 01_ubuntu_theme.patch + - Patch adapted and applied to the ubuntu theme as well. + + -- James Westby Fri, 04 Apr 2008 13:03:42 +0100 + +notification-daemon (0.3.7-1ubuntu10) hardy; urgency=low + + [ Alex Jones ] + * 01_ubuntu_theme.patch: + - Fixed the summary text label to escape summary text. It's not + Pango markup by specification. + + [ Michael Vogt ] + * 01_ubuntu_theme.patch: + - copy the style of the tooltip instead of just using it, this + should fix a common but hard to reproduce crash (#127904) + + -- Michael Vogt Wed, 19 Dec 2007 16:14:49 +0100 + +notification-daemon (0.3.7-1ubuntu9) hardy; urgency=low + + * 01_ubuntu_theme.patch: + - fix text color under dark themes (thanks to Vincent Untz for + the bugreport) + * 95_force_intltooliz.patch: + - run intltoolize --force + * debian/control: + - added XS-Vcs-Bzr header + + -- Michael Vogt Thu, 01 Nov 2007 11:19:56 -0400 + +notification-daemon (0.3.7-1ubuntu8) gutsy; urgency=low + + * 01_ubuntu_theme.patch: + - improve shaping (LP: #136660) + * 05_notification_spacing.patch: + - add a small spacing between two notifications (LP: #137095) + (Thanks to Alex Jones) + + -- Michael Vogt Thu, 06 Sep 2007 18:43:01 +0200 + +notification-daemon (0.3.7-1ubuntu7) gutsy; urgency=low + + * 01_ubuntu_theme.patch: + - improve the pie chart (LP: #132512), thanks to + Alex Jones (for real this time) + + -- Michael Vogt Thu, 16 Aug 2007 22:54:48 +0200 + +notification-daemon (0.3.7-1ubuntu6) gutsy; urgency=low + + * 01_ubuntu_theme.patch: + - improve the pie chart (LP: #132512), thanks to + Alex Jones + + -- Michael Vogt Wed, 15 Aug 2007 13:37:03 +0200 + +notification-daemon (0.3.7-1ubuntu5) gutsy; urgency=low + + * 01_ubuntu_theme.patch: + - Fix countdown notifications too. Closes LP: #129120. + - Use gtk_widget_ensure_style instead of gtk_widget_realize. + * Refreshed intltool. Unbreak the build! + * Removed 05_dont_crash_on_critical_warnings.patch + + -- Scott Robinson Tue, 07 Aug 2007 22:11:21 -0700 + +notification-daemon (0.3.7-1ubuntu4) gutsy; urgency=low + + * debian/patches/01_ubuntu_theme.patch: + - make the notification background match the tooltip color + + -- Michael Vogt Tue, 07 Aug 2007 11:24:55 +0200 + +notification-daemon (0.3.7-1ubuntu3) gutsy; urgency=low + + * fix crash in ubuntu theme (caused by gtk+ changes + in the way tooltips are handled). Closes LP: #127925 + + -- Michael Vogt Tue, 31 Jul 2007 15:20:36 +0200 + +notification-daemon (0.3.7-1ubuntu2) gutsy; urgency=low + + * No-change rebuild for libwnck transition. + + -- Steve Kowalik Fri, 22 Jun 2007 00:11:11 +1000 + +notification-daemon (0.3.7-1ubuntu1) gutsy; urgency=low + + * Merge from debian unstable, remaining changes: + + 01_ubuntu_theme.patch. + + 02_make_ubuntu_theme_default.patch. + + 03_fix_xinerama_stack.patch. + + updated maintainer field + * Dropped: + + 05_dont_crash_on_critical_warnings.patch + + 06_fix_prefix_for_dbus_binding_tool.patch + + 04_fix_xinerama_in_theme_c.patch + + -- Michael Vogt Fri, 25 May 2007 13:56:34 +0200 + notification-daemon (0.3.7-1) unstable; urgency=low * New upstream release. @@ -94,6 +343,38 @@ -- Riccardo Setti Sat, 18 Nov 2006 14:37:12 +0100 +notification-daemon (0.3.6-0ubuntu3) feisty; urgency=low + + * debian/patches/01_ubuntu_theme.patch: + + fix incorrect background color of timeout pie chart (LP: #58114) + + -- Michael Hofmann Wed, 4 Apr 2007 15:44:43 +0200 + +notification-daemon (0.3.6-0ubuntu2) feisty; urgency=low + + * Rebuild for changes in the amd64 toolchain. + * Set Ubuntu maintainer address. + + -- Matthias Klose Mon, 5 Mar 2007 01:23:18 +0000 + +notification-daemon (0.3.6-0ubuntu1) feisty; urgency=low + + * New upstream release: + + 06_fix_prefix_for_dbus_binding_tool.patch: + o fix the dbus-binding-tool usage to be compatible with dbus-glib 0.72 + (Upstream SVN rev #2938) + * Merged from debian sid: + + Bumped standards version. + * Remaining ubuntu changes: + + 01_ubuntu_theme.patch. + + 02_make_ubuntu_theme_default.patch. + + 03_fix_xinerama.patch. + + 04_fix_xinerama_in_theme_c.patch. + + 05_dont_crash_on_critical_warnings.patch. + + 99_autoreconf.patch + + -- Sivan Greenberg Tue, 21 Nov 2006 00:41:53 +0200 + notification-daemon (0.3.5-2) unstable; urgency=low * added patches: @@ -111,6 +392,83 @@ -- Riccardo Setti Sun, 23 Jul 2006 12:35:37 +0200 +notification-daemon (0.3.5-0ubuntu7) edgy; urgency=low + + * debian/patches/09_nonexisting-notification-id-crash.patch: + + Don't crash when trying replacing a non-existing (for example already + closed) notification id but return a new one. + Patch from upstream SVN (r2883) + * debian/patches/10_standard-theme-memleak.patch: + + Close a memleak in the standard theme occuring whenever a notification + is closed. Patch from upstream SVN (r2902) + * debian/patches/01_ubuntu_theme.patch: + + Close the same memleak here. + + -- Sebastian Dröge Wed, 27 Sep 2006 18:00:28 +0200 + +notification-daemon (0.3.5-0ubuntu6) edgy; urgency=low + + * debian/patches/01_ubuntu_theme.patch: + - fix incorect sizing (too wide, too narrow sometimes) + - fix incorrect shape when the arrow points downwards + - code cleanup + + -- Michael Vogt Wed, 30 Aug 2006 23:13:29 +0200 + +notification-daemon (0.3.5-0ubuntu5) edgy; urgency=low + + * Rebuild against dbus 0.90 + + -- Sebastian Dröge Tue, 29 Aug 2006 18:40:49 +0200 + +notification-daemon (0.3.5-0ubuntu4) edgy; urgency=low + + * debian/patches/08_dont_close_on_mouse_over.patch: + + Don't close a notification after the timeout when the mouse cursor is + over it. (Ubuntu: #50219) + Patch from upstream SVN (r2876) + + -- Sebastian Dröge Tue, 29 Aug 2006 18:06:04 +0200 + +notification-daemon (0.3.5-0ubuntu3) edgy; urgency=low + + * debian/patches/05_dont_crash_on_0_sized_icons.patch: + + Don't crash if the base size of an icon is 0 which could happen for some + themes. Patch from upstream SVN (r2879) + * debian/patches/06_fix_assertion_with_newer_gtk.patch: + + Fix assertion failure when destroying a notification. Patch from + upstream SVN (r2880) + * debian/patches/07_dbus_0.61.patch: + + Fix type validation for dbus >= 0.61. (Ubuntu: #58114) + Patch from upstream SVN (r2881) + + -- Sebastian Dröge Tue, 29 Aug 2006 17:49:15 +0200 + +notification-daemon (0.3.5-0ubuntu2) edgy; urgency=low + + * debian/patches/04_dont_crash_on_critial_warnings.patch: + - don't crash on g_fail_if() + + -- Michael Vogt Tue, 15 Aug 2006 12:33:20 +0200 + +notification-daemon (0.3.5-0ubuntu1) edgy; urgency=low + + * New upstream release. + * Merged with Debian. + * debian/patches/04_from_upstream_cvs_no_crop.diff: + - Dropped, it's now merged upstream. + * debian/patches/70_relibtoolize.patch: + - From Debian, dropped. + * debian/patches/01_ubuntu_theme.patch: + - New patch to make the Ubuntu theme work with upstream version. + - Added new functions that are required by the new theme API. + - Added include for config.h to get consts required by the new functions. + - Merged patching of themes/Makefile.am with upstream changes. + * debian/patches/99_autoreconf.patch: + - Updated. + + -- Sivan Greenberg Tue, 11 Jul 2006 22:26:54 +0300 + notification-daemon (0.3.4-4) unstable; urgency=low * removed a bashism in debian/rules. (closes: #353498) diff -Nur notification-daemon-0.5.0//debian/control notification-daemon-0.5.0-2//debian/control --- notification-daemon-0.5.0//debian/control 2010-06-29 09:17:52.000000000 +0200 +++ notification-daemon-0.5.0-2//debian/control 2010-11-12 22:32:39.000000000 +0100 @@ -1,7 +1,8 @@ Source: notification-daemon Section: x11 Priority: optional -Maintainer: Andre Filipe de Assuncao e Brito +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Andre Filipe de Assuncao e Brito Uploaders: Riccardo Setti , Sebastian Dröge Build-Depends: cdbs (>= 0.4.23-1.1), diff -Nur notification-daemon-0.5.0//debian/patches/01_ubuntu_theme.patch notification-daemon-0.5.0-2//debian/patches/01_ubuntu_theme.patch --- notification-daemon-0.5.0//debian/patches/01_ubuntu_theme.patch 1970-01-01 01:00:00.000000000 +0100 +++ notification-daemon-0.5.0-2//debian/patches/01_ubuntu_theme.patch 2010-11-12 22:32:39.000000000 +0100 @@ -0,0 +1,909 @@ +Index: notification-daemon/configure.ac +=================================================================== +--- notification-daemon.orig/configure.ac 2010-07-23 22:35:33.000000000 +0200 ++++ notification-daemon/configure.ac 2010-07-24 13:23:13.000000000 +0200 +@@ -238,6 +238,7 @@ + src/themes/Makefile + src/themes/slider/Makefile + src/themes/standard/Makefile ++src/themes/ubuntu/Makefile + ]) + + AC_OUTPUT +Index: notification-daemon/src/themes/Makefile.am +=================================================================== +--- notification-daemon.orig/src/themes/Makefile.am 2010-07-23 22:35:33.000000000 +0200 ++++ notification-daemon/src/themes/Makefile.am 2010-07-24 13:24:24.000000000 +0200 +@@ -1,3 +1,3 @@ +-SUBDIRS = slider standard ++SUBDIRS = slider standard ubuntu + + -include $(top_srcdir)/git.mk +Index: notification-daemon/src/themes/ubuntu/Makefile.am +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ notification-daemon/src/themes/ubuntu/Makefile.am 2010-07-24 13:23:13.000000000 +0200 +@@ -0,0 +1,9 @@ ++enginedir = $(libdir)/notification-daemon-1.0/engines ++ ++engine_LTLIBRARIES = libubuntu.la ++ ++libubuntu_la_SOURCES = theme.c ++libubuntu_la_LDFLAGS = -module -avoid-version ++libubuntu_la_LIBADD = $(NOTIFICATION_DAEMON_LIBS) ++ ++INCLUDES = $(NOTIFICATION_DAEMON_CFLAGS) +Index: notification-daemon/src/themes/ubuntu/theme.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ notification-daemon/src/themes/ubuntu/theme.c 2010-07-24 13:23:13.000000000 +0200 +@@ -0,0 +1,869 @@ ++#include "config.h" ++ ++#include ++ ++ ++typedef void (*ActionInvokedCb)(GtkWindow *nw, const char *key); ++typedef void (*UrlClickedCb)(GtkWindow *nw, const char *url); ++ ++typedef struct ++{ ++ GtkWidget *win; ++ GtkWidget *top_spacer; ++ GtkWidget *bottom_spacer; ++ GtkWidget *main_hbox; ++ GtkWidget *iconbox; ++ GtkWidget *icon; ++ GtkWidget *content_hbox; ++ GtkWidget *summary_label; ++ GtkWidget *body_label; ++ GtkWidget *actions_box; ++ GtkWidget *last_sep; ++ GtkWidget *pie_countdown; ++ GtkWidget *close_button; ++ ++ /* do we have a arrow and where do we point to */ ++ gboolean has_arrow; ++ ++ gboolean enable_transparency; ++ ++ int point_x; ++ int point_y; ++ ++ int drawn_arrow_begin_x; ++ int drawn_arrow_begin_y; ++ int drawn_arrow_middle_x; ++ int drawn_arrow_middle_y; ++ int drawn_arrow_end_x; ++ int drawn_arrow_end_y; ++ GtkArrowType arrow_type; ++ ++ GdkGC *gc; ++ GdkRegion *window_region; ++ ++ guchar urgency; ++ glong timeout; ++ glong remaining; ++ ++ UrlClickedCb url_clicked; ++ ++} WindowData; ++ ++enum ++{ ++ URGENCY_LOW, ++ URGENCY_NORMAL, ++ URGENCY_CRITICAL ++}; ++ ++#define WIDTH 300 ++#define IMAGE_SIZE 32 ++#define IMAGE_PADDING 10 ++#define STRIPE_WIDTH 30 ++ ++#define PIE_RADIUS 14 ++#define PIE_WIDTH (2 * PIE_RADIUS) ++#define PIE_HEIGHT (2 * PIE_RADIUS) ++#define PIE_INSIDE_BORDER 2 ++ ++#define BODY_X_OFFSET (IMAGE_SIZE + 8) ++#define DEFAULT_ARROW_OFFSET (STRIPE_WIDTH + 2) ++#define DEFAULT_ARROW_HEIGHT 12 ++#define DEFAULT_ARROW_WIDTH 8 ++#define ARROW_DISTANCE 6 ++ ++static GtkStyle * ++get_tooltip_style() ++{ ++ /* This is a hack to let us copy the style of tooltips for this theme. */ ++ GtkWidget *fake = gtk_window_new(GTK_WINDOW_POPUP); ++ gtk_widget_set_name(fake, "gtk-tooltip"); ++ gtk_widget_realize(fake); ++ // we copy the style to ensure that its available ++ GtkStyle *style = gtk_style_copy(gtk_widget_get_style(fake)); ++ gtk_widget_destroy(fake); ++ // having no style is a fatal error ++ g_assert(style != NULL); ++ return style; ++} ++ ++static void ++fill_background(GtkWidget *widget, WindowData *windata, cairo_t *cr) ++{ ++ GtkStyle *style = get_tooltip_style(); ++ gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_NORMAL]); ++ cairo_rectangle(cr, 0, 0, ++ widget->allocation.width, ++ widget->allocation.height); ++ cairo_fill(cr); ++ g_object_unref(G_OBJECT(style)); ++} ++ ++static void ++draw_stripe(GtkWidget *win, cairo_t *cr, WindowData *windata) ++{ ++ GtkStyle *style = gtk_widget_get_style(windata->win); ++ ++ switch (windata->urgency) ++ { ++ case URGENCY_LOW: ++ cairo_set_source_rgb(cr, ++ 242.0/255.0, ++ 242.0/255.0, ++ 190.0/255.0); ++ break; ++ case URGENCY_NORMAL: ++ cairo_set_source_rgb(cr, ++ 220.0/255.0, ++ 220.0/255.0, ++ 160.0/255.0); ++ break; ++ case URGENCY_CRITICAL: ++ ++ cairo_set_source_rgb(cr, ++ style->bg[GTK_STATE_SELECTED].red/65535.0, ++ style->bg[GTK_STATE_SELECTED].green/65535.0, ++ style->bg[GTK_STATE_SELECTED].blue/65535.0); ++ ++ break; ++ } ++ cairo_rectangle(cr, ++ windata->main_hbox->allocation.x, ++ windata->main_hbox->allocation.y, ++ STRIPE_WIDTH, ++ // FIXME: its unclear why we need the padding ++ // here ++ windata->win->allocation.height+IMAGE_PADDING); ++ cairo_fill(cr); ++ return; ++} ++ ++void draw_rounded_window(cairo_t *mask_cr, float x, float y, ++ float w, float h, WindowData *windata) ++{ ++ if(windata->has_arrow) ++ { ++ // fix the border ++ if(windata->arrow_type == GTK_ARROW_UP) { ++ y += DEFAULT_ARROW_HEIGHT; ++ h -= DEFAULT_ARROW_HEIGHT; ++ } else { ++ h -= (DEFAULT_ARROW_HEIGHT+ARROW_DISTANCE); ++ } ++ } ++ ++ int radius = 6; ++ int bx, by, mx, my, ex, ey; ++ ++ bx = windata->drawn_arrow_begin_x; ++ by = windata->drawn_arrow_begin_y; ++ mx = windata->drawn_arrow_middle_x; ++ my = windata->drawn_arrow_middle_y; ++ ex = windata->drawn_arrow_end_x; ++ ey = windata->drawn_arrow_end_y; ++ ++ cairo_move_to(mask_cr, x+radius, y); ++ ++ // the arrow is on top, so we need to draw it here ++ if(windata->has_arrow && windata->arrow_type == GTK_ARROW_UP) { ++ if (mx < w/2 ) { ++ cairo_line_to(mask_cr, bx-10, by); ++ cairo_curve_to(mask_cr, mx-3, by, mx-3, by, mx, my+ARROW_DISTANCE); ++ cairo_curve_to(mask_cr, mx+8, ey, mx+8, ey, ex+16, ey); ++ } else { ++ cairo_line_to(mask_cr, bx-16, by); ++ cairo_curve_to(mask_cr, mx-8, by, mx-8, by, mx, my+ARROW_DISTANCE); ++ cairo_curve_to(mask_cr, mx+3, ey, mx+5, ey, ex+10, ey); ++ } ++ } ++ ++ cairo_arc(mask_cr, x+w-radius, y+radius, radius, G_PI * 1.5, G_PI * 2); ++ cairo_arc(mask_cr, x+w-radius, y+h-radius, radius, 0, G_PI * 0.5); ++ ++ // the arrow is at the bottom, so it needs to be drawn here ++ if(windata->has_arrow && windata->arrow_type == GTK_ARROW_DOWN) { ++ if (mx > w/2 ) { ++ cairo_line_to(mask_cr, bx+10, by); ++ ++ cairo_curve_to(mask_cr, mx+3, by, mx+3, by, mx, my-ARROW_DISTANCE); ++ cairo_curve_to(mask_cr, mx-8, ey, mx-8, ey, ex-16, ey); ++ } else { ++ cairo_line_to(mask_cr, bx+16, by); ++ ++ cairo_curve_to(mask_cr, mx+8, by, mx+8, by, mx, my-ARROW_DISTANCE); ++ cairo_curve_to(mask_cr, mx-3, ey, mx-5, ey, ex-10, ey); ++ } ++ } ++ ++ cairo_arc(mask_cr, x+radius, y+h-radius, radius, G_PI * 0.5, G_PI); ++ cairo_arc(mask_cr, x+radius, y+radius, radius, G_PI, G_PI *1.5); ++} ++ ++static gboolean ++mouse_over(GtkWidget *win, GdkEventExpose *event, WindowData *windata) ++{ ++ gtk_widget_set_state(GTK_WIDGET((WindowData*)windata->close_button), GTK_STATE_PRELIGHT); ++ return FALSE; ++} ++ ++static gboolean ++mouse_over_end(GtkWidget *win, GdkEventExpose *event, WindowData *windata) ++{ ++ gtk_widget_set_state(GTK_WIDGET((WindowData*)windata->close_button), GTK_STATE_NORMAL); ++ return FALSE; ++} ++ ++ ++static gboolean ++draw_border(GtkWidget *win, GdkEventExpose *event, WindowData *windata) ++{ ++ int w, h; ++ ++ gdk_drawable_get_size(win->window, &w, &h); ++ ++ // calculate a shape for it ++ GdkPixmap *mask; ++ cairo_t *mask_cr; ++ ++ mask = gdk_pixmap_new (NULL, w, h, 1); ++ mask_cr = gdk_cairo_create ((GdkDrawable *) mask); ++ ++ // draw border ++ cairo_t *cr = gdk_cairo_create((GdkDrawable*) win->window); ++ ++ GtkStyle *style = get_tooltip_style(); ++ GdkColor bg_color = style->bg[GTK_STATE_NORMAL]; ++ ++ cairo_set_source_rgb(cr, ++ bg_color.red/65535.0, ++ bg_color.green/65535.0, ++ bg_color.blue/65535.0); ++ ++ cairo_paint (cr); ++ ++ // draw a stripe ++ draw_stripe(win, cr, windata); ++ ++ // then a redish one ++ cairo_set_source_rgb(cr, ++ 218.0/255.0, ++ 178.0/255.0, ++ 85.0/255.0); ++ draw_rounded_window (cr, 0, 0, w, h, windata); ++ // Stroke the border 2 pixels wide so we get a 1 pixel stroke inside our ++ // path (we'll mask the outside half of it later). ++ cairo_set_line_width (cr, 2); ++ cairo_stroke (cr); ++ ++ // Clear the shape mask ++ cairo_set_operator (mask_cr, CAIRO_OPERATOR_CLEAR); ++ cairo_paint (mask_cr); ++ ++ // Draw the window shape to the input mask ++ cairo_set_source_rgba(mask_cr, 1, 1, 1, 1); ++ cairo_set_operator (mask_cr, CAIRO_OPERATOR_OVER); ++ draw_rounded_window(mask_cr, 0, 0, w, h, windata); ++ cairo_fill(mask_cr); ++ ++ if (windata->enable_transparency) { ++ // If transparency is enabled, we can mask the drawing itself and just ++ // use the shape mask as an input mask. ++ cairo_set_operator (cr, CAIRO_OPERATOR_DEST_IN); ++ cairo_set_source_rgb (cr, 0, 0, 0); ++ draw_rounded_window (cr, 0, 0, w, h, windata); ++ cairo_fill (cr); ++ gdk_window_input_shape_combine_mask (win->window, (GdkBitmap *) mask, 0, 0); ++ } else { ++ // Otherwise, use the shape mask for bilevel visual shaping as well. ++ gdk_window_shape_combine_mask (win->window, (GdkBitmap *) mask, 0, 0); ++ } ++ g_object_unref(G_OBJECT(style)); ++ cairo_destroy(mask_cr); ++ cairo_destroy(cr); ++ ++ return FALSE; ++} ++ ++ ++ ++static void ++destroy_windata(WindowData *windata) ++{ ++ if (windata->gc != NULL) ++ g_object_unref(G_OBJECT(windata->gc)); ++ ++ if (windata->window_region != NULL) ++ gdk_region_destroy(windata->window_region); ++} ++ ++static void ++update_content_hbox_visibility(WindowData *windata) ++{ ++ /* ++ * This is all a hack, but until we have a libview-style ContentBox, ++ * it'll just have to do. ++ */ ++ if (GTK_WIDGET_VISIBLE(windata->icon) || ++ GTK_WIDGET_VISIBLE(windata->body_label) || ++ GTK_WIDGET_VISIBLE(windata->actions_box)) ++ { ++ gtk_widget_show(windata->content_hbox); ++ } ++ else ++ { ++ gtk_widget_hide(windata->content_hbox); ++ } ++} ++ ++GtkWindow * ++create_notification(UrlClickedCb url_clicked) ++{ ++ GtkWidget *spacer; ++ GtkWidget *win; ++ GtkWidget *main_vbox; ++ GtkWidget *hbox; ++ GtkWidget *vbox; ++ GtkWidget *close_button; ++ GtkWidget *image; ++ GtkWidget *alignment; ++ WindowData *windata; ++ GdkColormap *colormap; ++ GdkScreen *screen; ++ ++ windata = g_new0(WindowData, 1); ++ windata->urgency = URGENCY_NORMAL; ++ windata->url_clicked = url_clicked; ++ ++ win = gtk_window_new(GTK_WINDOW_POPUP); ++ windata->win = win; ++ ++ windata->enable_transparency = FALSE; ++ screen = gtk_window_get_screen(GTK_WINDOW(win)); ++ colormap = gdk_screen_get_rgba_colormap(screen); ++ ++ if (colormap != NULL && gdk_screen_is_composited(screen)) ++ { ++ gtk_widget_set_colormap(win, colormap); ++ windata->enable_transparency = TRUE; ++ } ++ ++ ++ gtk_widget_add_events(win, GDK_BUTTON_RELEASE_MASK); ++ gtk_widget_realize(win); ++ g_object_set_data_full(G_OBJECT(win), "windata", windata, ++ (GDestroyNotify)destroy_windata); ++ gtk_widget_set_app_paintable(win, TRUE); ++ ++ g_signal_connect(G_OBJECT(win), "expose-event", ++ G_CALLBACK(draw_border), windata); ++ g_signal_connect(G_OBJECT(win), "motion-notify-event", ++ G_CALLBACK(mouse_over), windata); ++ g_signal_connect(G_OBJECT(win), "leave-notify-event", ++ G_CALLBACK(mouse_over_end), windata); ++ ++ main_vbox = gtk_vbox_new(FALSE, 0); ++ gtk_widget_show(main_vbox); ++ gtk_container_add(GTK_CONTAINER(win), main_vbox); ++ gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 1); ++ ++ windata->top_spacer = gtk_image_new(); ++ gtk_box_pack_start(GTK_BOX(main_vbox), windata->top_spacer, ++ FALSE, FALSE, 0); ++ gtk_widget_set_size_request(windata->top_spacer, -1, DEFAULT_ARROW_HEIGHT); ++ ++ windata->main_hbox = gtk_hbox_new(FALSE, 0); ++ gtk_widget_show(windata->main_hbox); ++ gtk_box_pack_start(GTK_BOX(main_vbox), windata->main_hbox, ++ FALSE, FALSE, 0); ++ ++ windata->bottom_spacer = gtk_image_new(); ++ gtk_box_pack_start(GTK_BOX(main_vbox), windata->bottom_spacer, ++ FALSE, FALSE, 0); ++ gtk_widget_set_size_request(windata->bottom_spacer, -1, ++ DEFAULT_ARROW_HEIGHT+ARROW_DISTANCE); ++ ++ vbox = gtk_vbox_new(FALSE, 0); ++ gtk_widget_show(vbox); ++ gtk_box_pack_start(GTK_BOX(windata->main_hbox), vbox, TRUE, TRUE, 0); ++ gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); ++ ++ hbox = gtk_hbox_new(FALSE, 6); ++ gtk_widget_show(hbox); ++ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); ++ ++ spacer = gtk_image_new(); ++ gtk_widget_show(spacer); ++ gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0); ++ gtk_widget_set_size_request(spacer, STRIPE_WIDTH, -1); ++ ++ windata->summary_label = gtk_label_new(NULL); ++ gtk_widget_show(windata->summary_label); ++ GtkStyle *style = get_tooltip_style(); ++ gtk_widget_set_style(windata->summary_label, style); ++ ++ gtk_box_pack_start(GTK_BOX(hbox), windata->summary_label, TRUE, TRUE, 0); ++ gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0); ++ gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE); ++ ++ /* Add the close button */ ++ windata->close_button = close_button = gtk_button_new(); ++ gtk_widget_show(close_button); ++ gtk_box_pack_start(GTK_BOX(hbox), close_button, FALSE, FALSE, 0); ++ gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE); ++ gtk_container_set_border_width(GTK_CONTAINER(close_button), 0); ++ gtk_widget_set_size_request(close_button, 20, 20); ++ g_signal_connect_swapped(G_OBJECT(close_button), "clicked", ++ G_CALLBACK(gtk_widget_destroy), win); ++ ++ image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); ++ gtk_widget_show(image); ++ gtk_container_add(GTK_CONTAINER(close_button), image); ++ ++ windata->content_hbox = gtk_hbox_new(FALSE, 6); ++ gtk_box_pack_start(GTK_BOX(vbox), windata->content_hbox, FALSE, FALSE, 0); ++ ++ windata->iconbox = gtk_hbox_new(FALSE, 0); ++ gtk_widget_show(windata->iconbox); ++ gtk_box_pack_start(GTK_BOX(windata->content_hbox), windata->iconbox, ++ FALSE, FALSE, 0); ++ gtk_widget_set_size_request(windata->iconbox, BODY_X_OFFSET, -1); ++ ++ windata->icon = gtk_image_new(); ++ gtk_box_pack_start(GTK_BOX(windata->iconbox), windata->icon, ++ TRUE, TRUE, 0); ++ gtk_misc_set_alignment(GTK_MISC(windata->icon), 0.5, 0.0); ++ ++ vbox = gtk_vbox_new(FALSE, 6); ++ gtk_widget_show(vbox); ++ gtk_box_pack_start(GTK_BOX(windata->content_hbox), vbox, TRUE, TRUE, 0); ++ ++ windata->body_label = gtk_label_new(NULL); ++ gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0); ++ gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0); ++ gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE); ++ g_signal_connect_swapped(G_OBJECT(windata->body_label), "url_activated", ++ G_CALLBACK(windata->url_clicked), win); ++ gtk_widget_set_style(windata->body_label, style); ++ ++ alignment = gtk_alignment_new(1, 0.5, 0, 0); ++ gtk_widget_show(alignment); ++ gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, TRUE, 0); ++ ++ windata->actions_box = gtk_hbox_new(FALSE, 6); ++ gtk_container_add(GTK_CONTAINER(alignment), windata->actions_box); ++ g_object_unref(G_OBJECT(style)); ++ ++ return GTK_WINDOW(win); ++} ++ ++void ++set_notification_hints(GtkWindow *nw, GHashTable *hints) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ GValue *value; ++ ++ g_assert(windata != NULL); ++ ++ value = (GValue *)g_hash_table_lookup(hints, "urgency"); ++ ++ if (value) ++ windata->urgency = g_value_get_uchar(value); ++} ++ ++void ++set_notification_timeout(GtkWindow *nw, glong timeout) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ g_assert(windata != NULL); ++ ++ windata->timeout = timeout; ++} ++ ++void ++notification_tick(GtkWindow *nw, glong remaining) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ windata->remaining = remaining; ++ ++ if (windata->pie_countdown != NULL) ++ { ++ gtk_widget_queue_draw_area(windata->pie_countdown, 0, 0, ++ PIE_WIDTH, PIE_HEIGHT); ++ } ++} ++ ++void ++set_notification_text(GtkWindow *nw, const char *summary, const char *body) ++{ ++ char *str; ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ g_assert(windata != NULL); ++ ++ str = g_markup_printf_escaped("%s", summary); ++ gtk_label_set_markup(GTK_LABEL(windata->summary_label), str); ++ g_free(str); ++ ++ gtk_label_set_markup(GTK_LABEL(windata->body_label), body); ++ ++ if (body == NULL || *body == '\0') ++ gtk_widget_hide(windata->body_label); ++ else ++ gtk_widget_show(windata->body_label); ++ ++ update_content_hbox_visibility(windata); ++ ++ gtk_widget_set_size_request(((body != NULL && *body != '\0') ? ++ windata->body_label : windata->summary_label), ++ WIDTH - (IMAGE_SIZE + IMAGE_PADDING) - 10, ++ -1); ++} ++ ++void ++set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ g_assert(windata != NULL); ++ ++ gtk_image_set_from_pixbuf(GTK_IMAGE(windata->icon), pixbuf); ++ ++ if (pixbuf != NULL) ++ { ++ int pixbuf_width = gdk_pixbuf_get_width(pixbuf); ++ ++ gtk_widget_show(windata->icon); ++ gtk_widget_set_size_request(windata->iconbox, ++ MAX(BODY_X_OFFSET, pixbuf_width), -1); ++ } ++ else ++ { ++ gtk_widget_hide(windata->icon); ++ gtk_widget_set_size_request(windata->iconbox, BODY_X_OFFSET, -1); ++ } ++ ++ update_content_hbox_visibility(windata); ++} ++ ++void ++set_notification_arrow(GtkWindow *nw, gboolean visible, int x, int y) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ g_assert(windata != NULL); ++ ++ windata->has_arrow = visible; ++ windata->point_x = x; ++ windata->point_y = y; ++ ++ if (!visible) ++ { ++ gtk_widget_hide(windata->top_spacer); ++ gtk_widget_hide(windata->bottom_spacer); ++ } ++} ++ ++static gboolean ++countdown_expose_cb(GtkWidget *pie, GdkEventExpose *event, ++ WindowData *windata) ++{ ++ GtkStyle *style = gtk_widget_get_style(windata->win); ++ ++ cairo_t *context; ++ cairo_surface_t *surface; ++ cairo_t *cr; ++ context = gdk_cairo_create(GDK_DRAWABLE(windata->pie_countdown->window)); ++ cairo_set_operator(context, CAIRO_OPERATOR_SOURCE); ++ surface = cairo_surface_create_similar( ++ cairo_get_target(context), ++ CAIRO_CONTENT_COLOR_ALPHA, ++ pie->allocation.width, ++ pie->allocation.height); ++ cr = cairo_create(surface); ++ ++ fill_background(pie, windata, cr); ++ ++ gdk_cairo_set_source_color(cr, &style->base[GTK_STATE_NORMAL]); ++ ++ cairo_arc(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS, 0, 2 * G_PI); ++ cairo_close_path(cr); ++ ++ cairo_fill(cr); ++ ++ if (windata->timeout > 0) ++ { ++ gdouble pct = (gdouble)windata->remaining / (gdouble)windata->timeout; ++ ++ gdk_cairo_set_source_color(cr, &style->base[GTK_STATE_SELECTED]); ++ ++ cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS); ++ cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS - PIE_INSIDE_BORDER, ++ -G_PI_2, -(pct * G_PI * 2) - G_PI_2); ++ cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS); ++ cairo_fill(cr); ++ } ++ ++ cairo_destroy(cr); ++ cairo_set_source_surface(context, surface, 0, 0); ++ cairo_paint(context); ++ cairo_surface_destroy(surface); ++ cairo_destroy(context); ++ ++ return TRUE; ++} ++ ++static void ++action_clicked_cb(GtkWidget *w, GdkEventButton *event, ++ ActionInvokedCb action_cb) ++{ ++ GtkWindow *nw = g_object_get_data(G_OBJECT(w), "_nw"); ++ const char *key = g_object_get_data(G_OBJECT(w), "_action_key"); ++ ++ action_cb(nw, key); ++} ++ ++void ++add_notification_action(GtkWindow *nw, const char *text, const char *key, ++ ActionInvokedCb cb) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ GtkWidget *label; ++ GtkWidget *button; ++ GtkWidget *hbox; ++ GdkPixbuf *pixbuf; ++ char *buf; ++ ++ g_assert(windata != NULL); ++ ++ if (!GTK_WIDGET_VISIBLE(windata->actions_box)) ++ { ++ GtkWidget *alignment; ++ ++ gtk_widget_show(windata->actions_box); ++ update_content_hbox_visibility(windata); ++ ++ alignment = gtk_alignment_new(1, 0.5, 0, 0); ++ gtk_widget_show(alignment); ++ gtk_box_pack_end(GTK_BOX(windata->actions_box), alignment, ++ FALSE, TRUE, 0); ++ ++ windata->pie_countdown = gtk_drawing_area_new(); ++ gtk_widget_show(windata->pie_countdown); ++ gtk_container_add(GTK_CONTAINER(alignment), windata->pie_countdown); ++ gtk_widget_set_size_request(windata->pie_countdown, ++ PIE_WIDTH, PIE_HEIGHT); ++ g_signal_connect(G_OBJECT(windata->pie_countdown), "expose_event", ++ G_CALLBACK(countdown_expose_cb), windata); ++ } ++ ++ button = gtk_button_new(); ++ gtk_widget_show(button); ++ gtk_box_pack_start(GTK_BOX(windata->actions_box), button, FALSE, FALSE, 0); ++ ++ hbox = gtk_hbox_new(FALSE, 6); ++ gtk_widget_show(hbox); ++ gtk_container_add(GTK_CONTAINER(button), hbox); ++ ++ /* Try to be smart and find a suitable icon. */ ++ buf = g_strdup_printf("stock_%s", key); ++ pixbuf = gtk_icon_theme_load_icon( ++ gtk_icon_theme_get_for_screen( ++ gdk_drawable_get_screen(GTK_WIDGET(nw)->window)), ++ buf, 16, GTK_ICON_LOOKUP_USE_BUILTIN, NULL); ++ g_free(buf); ++ ++ if (pixbuf != NULL) ++ { ++ GtkWidget *image = gtk_image_new_from_pixbuf(pixbuf); ++ gtk_widget_show(image); ++ gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); ++ gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); ++ } ++ ++ label = gtk_label_new(NULL); ++ /* mvo: hardcode black here, it sucks */ ++ GdkColor black; ++ gdk_color_black(gdk_colormap_get_system(), &black); ++ gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &black); ++ ++ gtk_widget_show(label); ++ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); ++ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); ++ buf = g_strdup_printf("%s", text); ++ gtk_label_set_markup(GTK_LABEL(label), buf); ++ ++ g_free(buf); ++ ++ g_object_set_data(G_OBJECT(button), "_nw", nw); ++ g_object_set_data_full(G_OBJECT(button), ++ "_action_key", g_strdup(key), g_free); ++ g_signal_connect(G_OBJECT(button), "button-release-event", ++ G_CALLBACK(action_clicked_cb), cb); ++} ++ ++ ++static void ++create_border_with_arrow(GtkWidget *nw, WindowData *windata) ++{ ++ GtkRequisition req; ++ GdkScreen *screen; ++ int monitor_num; ++ GdkRectangle monitor_geom; ++ int monitor_left, monitor_right, monitor_top, monitor_bottom; ++ int arrow_side1_width = DEFAULT_ARROW_WIDTH / 2; ++ int arrow_side2_width = DEFAULT_ARROW_WIDTH / 2; ++ int arrow_offset = DEFAULT_ARROW_OFFSET; ++ ++ gtk_widget_realize(nw); ++ gtk_widget_size_request(nw, &req); ++ ++ screen = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window)); ++ monitor_num = gdk_screen_get_monitor_at_point(screen, ++ windata->point_x, windata->point_y); ++ gdk_screen_get_monitor_geometry(screen, monitor_num, &monitor_geom); ++ ++ monitor_left = monitor_geom.x; ++ monitor_right = monitor_left + monitor_geom.width; ++ monitor_top = monitor_geom.y; ++ monitor_bottom = monitor_top + monitor_geom.height; ++ ++ if (windata->point_y + req.height + DEFAULT_ARROW_HEIGHT >= monitor_bottom) ++ windata->arrow_type = GTK_ARROW_DOWN; ++ else ++ windata->arrow_type = GTK_ARROW_UP; ++ ++ /* Handle the offset and such */ ++ switch (windata->arrow_type) ++ { ++ case GTK_ARROW_NONE: ++ /* nothing to do */ ++ break; ++ case GTK_ARROW_UP: ++ case GTK_ARROW_DOWN: ++ if (windata->point_x < monitor_left + arrow_side1_width) ++ { ++ arrow_side1_width = 0; ++ arrow_offset = 0; ++ } ++ else if (windata->point_x >= monitor_right - arrow_side2_width) ++ { ++ arrow_side2_width = 0; ++ arrow_offset = req.width - arrow_side1_width; ++ } ++ else ++ { ++ if (windata->point_x - arrow_side2_width + req.width >= ++ monitor_right) ++ { ++ arrow_offset = ++ req.width - arrow_side1_width - arrow_side2_width - ++ (monitor_right - MAX(windata->point_x + ++ arrow_side1_width, ++ monitor_right - ++ DEFAULT_ARROW_OFFSET)); ++ } ++ else ++ { ++ arrow_offset = MIN(windata->point_x - arrow_side1_width - monitor_left, ++ DEFAULT_ARROW_OFFSET); ++ } ++ ++ } ++ ++ windata->drawn_arrow_begin_x = arrow_offset; ++ windata->drawn_arrow_middle_x = arrow_offset + arrow_side1_width; ++ windata->drawn_arrow_end_x = arrow_offset + arrow_side1_width + ++ arrow_side2_width; ++ ++ if (windata->arrow_type == GTK_ARROW_UP) ++ { ++ gtk_widget_show(windata->top_spacer); ++ windata->drawn_arrow_begin_y = DEFAULT_ARROW_HEIGHT; ++ windata->drawn_arrow_middle_y = 0; ++ windata->drawn_arrow_end_y = DEFAULT_ARROW_HEIGHT; ++ } ++ else ++ { ++ gtk_widget_show(windata->bottom_spacer); ++ windata->drawn_arrow_begin_y = req.height; ++ windata->drawn_arrow_middle_y = req.height + ++ DEFAULT_ARROW_HEIGHT; ++ windata->drawn_arrow_end_y = req.height; ++ } ++ ++ gtk_window_move(GTK_WINDOW(nw), ++ windata->point_x - arrow_offset - ++ arrow_side1_width, ++ (windata->arrow_type == GTK_ARROW_UP ++ ? windata->point_y ++ : windata->point_y - req.height - ++ DEFAULT_ARROW_HEIGHT)); ++ ++ break; ++ ++ case GTK_ARROW_LEFT: ++ case GTK_ARROW_RIGHT: ++ if (windata->point_y < monitor_top + arrow_side1_width) ++ { ++ arrow_side1_width = 0; ++ arrow_offset = windata->point_y; ++ } ++ else if (windata->point_y >= monitor_bottom - arrow_side2_width) ++ { ++ arrow_side2_width = 0; ++ arrow_offset = windata->point_y - arrow_side1_width; ++ } ++ break; ++ } ++ ++ draw_border(nw, NULL, windata); ++} ++ ++void ++move_notification(GtkWindow *nw, int x, int y) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ g_assert(windata != NULL); ++ ++ if (windata->has_arrow) ++ { ++ create_border_with_arrow(GTK_WIDGET(nw), windata); ++ } ++ else ++ { ++ gtk_window_move(GTK_WINDOW(nw), x, y); ++ } ++} ++ ++void ++get_theme_info(char **theme_name, ++ char **theme_ver, ++ char **author, ++ char **homepage) ++{ ++ *theme_name = g_strdup("Ubuntu"); ++ *theme_ver = g_strdup_printf("%d.%d.%d", ++ NOTIFICATION_DAEMON_MAJOR_VERSION, ++ NOTIFICATION_DAEMON_MINOR_VERSION, ++ NOTIFICATION_DAEMON_MICRO_VERSION); ++ *author = g_strdup("Michael Vogt"); ++ *homepage = g_strdup("http://www.ubuntu.com/"); ++} ++ ++gboolean ++theme_check_init(unsigned int major_ver, unsigned int minor_ver, ++ unsigned int micro_ver) ++{ ++ return major_ver == NOTIFICATION_DAEMON_MAJOR_VERSION && ++ minor_ver == NOTIFICATION_DAEMON_MINOR_VERSION && ++ micro_ver == NOTIFICATION_DAEMON_MICRO_VERSION; ++} ++ ++void ++clear_notification_actions(GtkWindow *nw) ++{ ++ WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); ++ ++ windata->pie_countdown = NULL; ++ ++ gtk_widget_hide(windata->actions_box); ++ gtk_container_foreach(GTK_CONTAINER(windata->actions_box), ++ (GtkCallback)gtk_object_destroy, NULL); ++} diff -Nur notification-daemon-0.5.0//debian/patches/02_make_ubuntu_theme_default.patch notification-daemon-0.5.0-2//debian/patches/02_make_ubuntu_theme_default.patch --- notification-daemon-0.5.0//debian/patches/02_make_ubuntu_theme_default.patch 1970-01-01 01:00:00.000000000 +0100 +++ notification-daemon-0.5.0-2//debian/patches/02_make_ubuntu_theme_default.patch 2010-11-12 22:32:39.000000000 +0100 @@ -0,0 +1,13 @@ +Index: notification-daemon/data/notification-daemon.schemas.in +=================================================================== +--- notification-daemon.orig/data/notification-daemon.schemas.in 2010-07-24 13:25:56.000000000 +0200 ++++ notification-daemon/data/notification-daemon.schemas.in 2010-07-24 13:26:05.000000000 +0200 +@@ -18,7 +18,7 @@ + /apps/notification-daemon/theme + notification-daemon + string +- slider ++ ubuntu + + Current theme + The theme used when displaying notifications. diff -Nur notification-daemon-0.5.0//debian/patches/series notification-daemon-0.5.0-2//debian/patches/series --- notification-daemon-0.5.0//debian/patches/series 2010-06-29 07:18:38.000000000 +0200 +++ notification-daemon-0.5.0-2//debian/patches/series 2010-11-12 22:32:39.000000000 +0100 @@ -1,2 +1,4 @@ +01_ubuntu_theme.patch +02_make_ubuntu_theme_default.patch 04_dont_crash_on_critical_warnings.patch 99_ltmain_as-needed.patch diff -Nur notification-daemon-0.5.0//debian/rules notification-daemon-0.5.0-2//debian/rules --- notification-daemon-0.5.0//debian/rules 2010-06-29 07:18:38.000000000 +0200 +++ notification-daemon-0.5.0-2//debian/rules 2010-11-12 22:32:39.000000000 +0100 @@ -5,6 +5,24 @@ LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed +# 01_ubuntu_theme.patch requires regeneration of autoconf and automake files. +# +# It would be nice if we could just say: +# DEB_AUTO_UPDATE_AUTOMAKE := 1.9 +# DEB_AUTO_UPDATE_AUTOCONF := 2.61 +# but cdbs is currently hardwired to always run aclocal if running automake. +# So, we copy the rules from autotools-files.mk, and prune appropriately. + +common-configure-arch common-configure-indep:: debian/stamp-autotools-files +debian/stamp-autotools-files: + cd $(DEB_SRCDIR) && autoconf + cd $(DEB_SRCDIR) && automake + cd $(DEB_SRCDIR) && touch aclocal.m4 # Avoid remaking by package's Makefile + touch debian/stamp-autotools-files + +clean:: + rm -f debian/stamp-autotools-files + binary-install/notification-daemon:: rm debian/notification-daemon/usr/lib/notification-daemon-1.0/engines/*.a rm debian/notification-daemon/usr/lib/notification-daemon-1.0/engines/*.la