[Galago-commits] r2983 - in trunk/notification-daemon: .
src/themes/standard
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Sun Apr 29 03:00:01 PDT 2007
Author: chipx86
Date: 2007-04-29 02:59:59 -0700 (Sun, 29 Apr 2007)
New Revision: 2983
Modified:
trunk/notification-daemon/NEWS
trunk/notification-daemon/configure.ac
trunk/notification-daemon/src/themes/standard/theme.c
Log:
- Bumped up the required minimum version of GTK+ to 2.8.0.
- Got rid of all the non-Cairo code.
Modified: trunk/notification-daemon/NEWS
===================================================================
--- trunk/notification-daemon/NEWS 2007-04-29 09:45:29 UTC (rev 2982)
+++ trunk/notification-daemon/NEWS 2007-04-29 09:59:59 UTC (rev 2983)
@@ -1,4 +1,5 @@
version 0.3.8:
+ * Bumped up the required minimum version of GTK+ to 2.8.0.
* Fixed a bug where we were quitting on theme engine failure, instead of
falling back to the default theme engine. Patch by
driehuis-at-playbeing.org. (Ticket #128)
Modified: trunk/notification-daemon/configure.ac
===================================================================
--- trunk/notification-daemon/configure.ac 2007-04-29 09:45:29 UTC (rev 2982)
+++ trunk/notification-daemon/configure.ac 2007-04-29 09:59:59 UTC (rev 2983)
@@ -3,7 +3,7 @@
dnl ################################################################
dnl # Initialize autoconf
dnl ################################################################
-AC_INIT(notification-daemon, 0.3.7, galago-devel at lists.freedesktop.org)
+AC_INIT(notification-daemon, 0.3.7.90, galago-devel at lists.freedesktop.org)
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(config.h.in)
AC_COPYRIGHT([Copyright 2006 Christian Hammond])
@@ -15,7 +15,7 @@
NOTIFICATION_DAEMON_MAJOR_VERSION=0
NOTIFICATION_DAEMON_MINOR_VERSION=3
NOTIFICATION_DAEMON_MICRO_VERSION=7
-NOTIFICATION_DAEMON_DEVEL_VERSION=0
+NOTIFICATION_DAEMON_DEVEL_VERSION=90
NOTIFICATION_DAEMON_VERSION=$NOTIFICATION_DAEMON_MAJOR_VERSION.$NOTIFICATION_DAEMON_MINOR_VERSION.$NOTIFICATION_DAEMON_MICRO_VERSION
@@ -73,7 +73,7 @@
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
AM_GLIB_GNU_GETTEXT
-REQ_GTK_VERSION=2.4.0
+REQ_GTK_VERSION=2.8.0
REQ_GLIB_VERSION=$REQ_GTK_VERSION
REQ_SEXY_VERSION=0.1.3
REQ_DBUS_VERSION=0.36
Modified: trunk/notification-daemon/src/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/src/themes/standard/theme.c 2007-04-29 09:45:29 UTC (rev 2982)
+++ trunk/notification-daemon/src/themes/standard/theme.c 2007-04-29 09:59:59 UTC (rev 2983)
@@ -80,16 +80,11 @@
#define BACKGROUND_OPACITY 0.92
#define BOTTOM_GRADIENT_HEIGHT 30
-#if GTK_CHECK_VERSION(2, 8, 0)
-# define USE_CAIRO
-#endif
-
#if GTK_CHECK_VERSION(2, 10, 0)
# define USE_COMPOSITE
#endif
-#ifdef USE_CAIRO
static void
fill_background(GtkWidget *widget, WindowData *windata, cairo_t *cr)
{
@@ -131,21 +126,7 @@
cairo_pattern_destroy(gradient);
#endif
}
-#else /* !USE_CAIRO */
-static void
-fill_background(GtkWidget *widget, WindowData *windata)
-{
- GtkStyle *style = gtk_widget_get_style(windata->win);
- gdk_draw_rectangle(GDK_DRAWABLE(widget->window),
- style->base_gc[GTK_STATE_NORMAL], TRUE,
- 0, 0,
- widget->allocation.width,
- widget->allocation.height);
-}
-#endif
-
-#ifdef USE_CAIRO
static void
draw_stripe(GtkWidget *widget, WindowData *windata, cairo_t *cr)
{
@@ -193,46 +174,7 @@
cairo_fill(cr);
#endif
}
-#else /* !USE_CAIRO */
-static void
-draw_stripe(GtkWidget *widget, WindowData *windata)
-{
- GtkStyle *style = gtk_widget_get_style(widget);
- gboolean custom_gc = FALSE;
- GdkColor color;
- GdkGC *gc;
- switch (windata->urgency)
- {
- case URGENCY_LOW: // LOW
- gc = style->bg_gc[GTK_STATE_NORMAL];
- break;
-
- case URGENCY_CRITICAL: // CRITICAL
- custom_gc = TRUE;
- gc = gdk_gc_new(GDK_DRAWABLE(widget->window));
- gdk_color_parse("#CC0000", &color);
- gdk_gc_set_rgb_fg_color(gc, &color);
- break;
-
- case URGENCY_NORMAL: // NORMAL
- default:
- gc = style->bg_gc[GTK_STATE_SELECTED];
- break;
- }
-
-
- gdk_draw_rectangle(widget->window, gc, TRUE,
- windata->main_hbox->allocation.x + 1,
- windata->main_hbox->allocation.y + 1,
- STRIPE_WIDTH,
- windata->main_hbox->allocation.height - 2);
-
- if (custom_gc)
- g_object_unref(G_OBJECT(gc));
-}
-#endif
-
static GtkArrowType
get_notification_arrow_type(GtkWidget *nw)
{
@@ -463,7 +405,6 @@
g_free(shape_points);
}
-#ifdef USE_CAIRO
static void
draw_border(GtkWidget *widget, WindowData *windata, cairo_t *cr)
{
@@ -501,56 +442,21 @@
cairo_stroke(cr);
}
-#else /* !USE_CAIRO */
-static void
-draw_border(GtkWidget *widget,
- WindowData *windata)
-{
- if (windata->gc == NULL)
- {
- GdkColor color;
- windata->gc = gdk_gc_new(widget->window);
- gdk_color_parse("black", &color);
- gdk_gc_set_rgb_fg_color(windata->gc, &color);
- }
-
- if (windata->has_arrow)
- {
- create_border_with_arrow(windata->win, windata);
-
- gdk_draw_polygon(widget->window, windata->gc, FALSE,
- windata->border_points, windata->num_border_points);
- gdk_window_shape_combine_region(windata->win->window,
- windata->window_region,
- 0, 0);
- g_free(windata->border_points);
- windata->border_points = NULL;
- }
- else
- {
- gdk_draw_rectangle(widget->window, windata->gc, FALSE,
- 0, 0, windata->width - 1, windata->height - 1);
- }
-
-}
-#endif
-
static gboolean
paint_window(GtkWidget *widget,
GdkEventExpose *event,
WindowData *windata)
{
+ cairo_t *context;
+ cairo_surface_t *surface;
+ cairo_t *cr;
+
if (windata->width == 0) {
windata->width = windata->win->allocation.width;
windata->height = windata->win->allocation.height;
}
-#ifdef USE_CAIRO
- cairo_t *context;
- cairo_surface_t *surface;
- cairo_t *cr;
-
context = gdk_cairo_create(widget->window);
cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
@@ -569,11 +475,6 @@
cairo_paint(context);
cairo_surface_destroy(surface);
cairo_destroy(context);
-#else /* !USE_CAIRO */
- fill_background(widget, windata);
- draw_border(widget, windata);
- draw_stripe(widget, windata);
-#endif
return FALSE;
}
@@ -943,11 +844,10 @@
WindowData *windata)
{
GtkStyle *style = gtk_widget_get_style(windata->win);
-
-#ifdef USE_CAIRO
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(
@@ -958,15 +858,11 @@
cr = cairo_create(surface);
fill_background(pie, windata, cr);
-#else /* !USE_CAIRO */
- fill_background(pie, windata);
-#endif
if (windata->timeout > 0)
{
gdouble pct = (gdouble)windata->remaining / (gdouble)windata->timeout;
-#ifdef USE_CAIRO
gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_ACTIVE]);
cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS);
@@ -974,21 +870,13 @@
-G_PI_2, -(pct * G_PI * 2) - G_PI_2);
cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS);
cairo_fill(cr);
-#else /* !USE_CAIRO */
- gdk_draw_arc(GDK_DRAWABLE(windata->pie_countdown->window),
- style->bg_gc[GTK_STATE_ACTIVE], TRUE,
- 0, 0, PIE_WIDTH, PIE_HEIGHT,
- 90 * 64, pct * 360.0 * 64.0);
-#endif
}
-#ifdef USE_CAIRO
cairo_destroy(cr);
cairo_set_source_surface(context, surface, 0, 0);
cairo_paint(context);
cairo_surface_destroy(surface);
cairo_destroy(context);
-#endif
return TRUE;
}
More information about the galago-commits
mailing list