diff -Nru gtk3-engines-unico-0.1.0+r74/configure gtk3-engines-unico-0.1.0+r66/configure --- gtk3-engines-unico-0.1.0+r74/configure 2011-06-30 09:48:24.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/configure 2011-06-01 17:20:35.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for unico 0.1.0+r74. +# Generated by GNU Autoconf 2.68 for unico 0.1.0+r66. # # Report bugs to . # @@ -570,8 +570,8 @@ # Identity of this package. PACKAGE_NAME='unico' PACKAGE_TARNAME='unico' -PACKAGE_VERSION='0.1.0+r74' -PACKAGE_STRING='unico 0.1.0+r74' +PACKAGE_VERSION='0.1.0+r66' +PACKAGE_STRING='unico 0.1.0+r66' PACKAGE_BUGREPORT='https://bugs.launchpad.net/unico' PACKAGE_URL='' @@ -1316,7 +1316,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures unico 0.1.0+r74 to adapt to many kinds of systems. +\`configure' configures unico 0.1.0+r66 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1386,7 +1386,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unico 0.1.0+r74:";; + short | recursive ) echo "Configuration of unico 0.1.0+r66:";; esac cat <<\_ACEOF @@ -1501,7 +1501,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unico configure 0.1.0+r74 +unico configure 0.1.0+r66 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1870,7 +1870,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by unico $as_me 0.1.0+r74, which was +It was created by unico $as_me 0.1.0+r66, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2689,7 +2689,7 @@ # Define the identity of the package. PACKAGE='unico' - VERSION='0.1.0+r74' + VERSION='0.1.0+r66' cat >>confdefs.h <<_ACEOF @@ -2742,7 +2742,7 @@ AM_BACKSLASH='\' -NANO=`echo 0.1.0+r74 | cut -d'.' -f4` +NANO=`echo 0.1.0+r66 | cut -d'.' -f4` if test x"$NANO" = x || test "x$NANO" = "x0" ; then UNICO_TRUNK="no" PACKAGE_VERSION_NANO="0" @@ -12459,7 +12459,7 @@ glib_req=2.26.0 -gtk_req=3.1.6 +gtk_req=3.0.8 cairo_req=1.10 @@ -13215,7 +13215,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by unico $as_me 0.1.0+r74, which was +This file was extended by unico $as_me 0.1.0+r66, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13281,7 +13281,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -unico config.status 0.1.0+r74 +unico config.status 0.1.0+r66 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru gtk3-engines-unico-0.1.0+r74/configure.ac gtk3-engines-unico-0.1.0+r66/configure.ac --- gtk3-engines-unico-0.1.0+r74/configure.ac 2011-06-30 09:48:17.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/configure.ac 2011-06-01 17:20:30.000000000 +0000 @@ -2,7 +2,7 @@ # Package -AC_INIT([unico],[0.1.0+r74],[https://bugs.launchpad.net/unico],[unico]) +AC_INIT([unico],[0.1.0+r66],[https://bugs.launchpad.net/unico],[unico]) AC_CONFIG_SRCDIR([unico/unico.h]) AC_CONFIG_MACRO_DIR([build]) AC_CONFIG_AUX_DIR([build]) @@ -35,7 +35,7 @@ PKG_PROG_PKG_CONFIG AC_SUBST(glib_req, 2.26.0) -AC_SUBST(gtk_req, 3.1.6) +AC_SUBST(gtk_req, 3.0.8) AC_SUBST(cairo_req, 1.10) PKG_CHECK_MODULES(DEPS, glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req cairo >= $cairo_req) diff -Nru gtk3-engines-unico-0.1.0+r74/debian/changelog gtk3-engines-unico-0.1.0+r66/debian/changelog --- gtk3-engines-unico-0.1.0+r74/debian/changelog 2011-07-18 14:34:46.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/debian/changelog 2011-07-20 13:25:05.000000000 +0000 @@ -1,26 +1,23 @@ -gtk3-engines-unico (0.1.0+r74-0natty1) natty; urgency=low +gtk3-engines-unico (0.1.0+r66-0natty2) natty; urgency=low - * New upstream release. - * debian/control - - bump build depends for libgtk-3-dev >= 3.1.6 + * no change rebuild - -- Ken VanDine Thu, 30 Jun 2011 10:51:38 +0100 + -- Ken VanDine Wed, 20 Jul 2011 09:24:53 -0400 -gtk3-engines-unico (0.1.0+r69-0ubuntu1) oneiric; urgency=low +gtk3-engines-unico (0.1.0+r66-0natty1) natty; urgency=low - * New upstream snapshot. * debian/control - Updated Vcs-Bzr to point to the proper project - Updated maintainer email to use @ubuntu.com - - Updated standards version to 3.9.2 - -- Ken VanDine Fri, 17 Jun 2011 16:18:41 -0400 + -- Ken VanDine Wed, 01 Jun 2011 13:28:13 -0400 gtk3-engines-unico (0.1.0+r66-0ubuntu1) oneiric; urgency=low * New upstream snapshot. - Fix for a gnome-control-center crasher (LP: #789010) + -- Ken VanDine Wed, 01 Jun 2011 13:21:40 -0400 gtk3-engines-unico (0.1.0+r64-0ubuntu1) oneiric; urgency=low diff -Nru gtk3-engines-unico-0.1.0+r74/debian/control gtk3-engines-unico-0.1.0+r66/debian/control --- gtk3-engines-unico-0.1.0+r74/debian/control 2011-06-30 09:52:19.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/debian/control 2011-06-07 19:24:11.000000000 +0000 @@ -3,10 +3,10 @@ Maintainer: Ken VanDine Build-Depends: debhelper (>= 7.0.50~), autotools-dev, - libgtk-3-dev (>= 3.1.6), + libgtk-3-dev (>= 3.0.8), libglib2.0-dev (>= 2.26.0), libcairo2-dev (>= 1.10) -Standards-Version: 3.9.2 +Standards-Version: 3.9.1 Section: x11 Homepage: https://launchpad.net/unico Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/unico/ubuntu diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-cairo-support.c gtk3-engines-unico-0.1.0+r66/unico/unico-cairo-support.c --- gtk3-engines-unico-0.1.0+r74/unico/unico-cairo-support.c 2011-06-24 20:40:18.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-cairo-support.c 2011-05-19 13:27:48.000000000 +0000 @@ -167,7 +167,7 @@ gdouble offset1, red1, green1, blue1, alpha1; gdouble x00, x01, y00, y01, x10, x11, y10, y11; gdouble r00, r01, r10, r11; - gint i; + guint i; if (type == CAIRO_PATTERN_TYPE_LINEAR) { @@ -435,7 +435,7 @@ gdouble offset1, red1, green1, blue1, alpha1; gdouble x00, x01, y00, y01, x10, x11, y10, y11; gdouble r00, r01, r10, r11; - gint i; + guint i; if (type == CAIRO_PATTERN_TYPE_LINEAR) { @@ -562,7 +562,6 @@ switch (border_style) { - default: case GTK_BORDER_STYLE_NONE: break; /* FIXME Need to implement those two styles. */ @@ -632,22 +631,26 @@ line_width = cairo_get_line_width (cr); - if (inner_stroke_pat) + if (inner_stroke_pat || inner_stroke_color) { - unico_cairo_style_pattern_set_matrix (inner_stroke_pat, width - line_width, height - line_width); - cairo_set_source (cr, inner_stroke_pat); - } - else - gdk_cairo_set_source_rgba (cr, inner_stroke_color); + if (inner_stroke_pat) + { + unico_cairo_style_pattern_set_matrix (inner_stroke_pat, width - line_width, height - line_width); + cairo_set_source (cr, inner_stroke_pat); + } + else + gdk_cairo_set_source_rgba (cr, inner_stroke_color); - cairo_stroke (cr); + cairo_stroke (cr); + } cairo_restore (cr); if (inner_stroke_pat != NULL) cairo_pattern_destroy (inner_stroke_pat); - gdk_rgba_free (inner_stroke_color); + if (inner_stroke_color != NULL) + gdk_rgba_free (inner_stroke_color); } void @@ -685,7 +688,7 @@ { GtkStateFlags flags; GdkRGBA *outer_stroke_color; - UnicoStrokeStyle outer_stroke_style; + UnicoOuterStrokeStyle outer_stroke_style; cairo_pattern_t *outer_stroke_pat; gdouble line_width; @@ -702,7 +705,8 @@ line_width = cairo_get_line_width (cr); - if (outer_stroke_style != UNICO_STROKE_STYLE_NONE) + if (outer_stroke_style != UNICO_OUTER_STROKE_STYLE_NONE && + (outer_stroke_pat || outer_stroke_color)) { if (outer_stroke_pat) { @@ -720,7 +724,8 @@ if (outer_stroke_pat != NULL) cairo_pattern_destroy (outer_stroke_pat); - gdk_rgba_free (outer_stroke_color); + if (outer_stroke_color != NULL) + gdk_rgba_free (outer_stroke_color); } void diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-css-support.c gtk3-engines-unico-0.1.0+r66/unico/unico-css-support.c --- gtk3-engines-unico-0.1.0+r74/unico/unico-css-support.c 2011-06-17 20:12:43.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-css-support.c 2011-05-19 13:27:48.000000000 +0000 @@ -25,20 +25,20 @@ #include "unico-css-support.h" GType -unico_stroke_style_get_type (void) +unico_outer_stroke_style_get_type (void) { static GType etype = 0; if (G_UNLIKELY (etype == 0)) { static const GEnumValue values[] = { - { UNICO_STROKE_STYLE_CUSTOM, "UNICO_STROKE_STYLE_CUSTOM", "custom" }, - { UNICO_STROKE_STYLE_INSET, "UNICO_STROKE_STYLE_INSET", "inset" }, - { UNICO_STROKE_STYLE_NONE, "UNICO_STROKE_STYLE_NONE", "none" }, + { UNICO_OUTER_STROKE_STYLE_CUSTOM, "UNICO_OUTER_STROKE_STYLE_CUSTOM", "custom" }, + { UNICO_OUTER_STROKE_STYLE_INSET, "UNICO_OUTER_STROKE_STYLE_INSET", "inset" }, + { UNICO_OUTER_STROKE_STYLE_NONE, "UNICO_OUTER_STROKE_STYLE_NONE", "none" }, { 0, NULL, NULL } }; - etype = g_enum_register_static (g_intern_static_string ("UnicoStrokeStyle"), values); + etype = g_enum_register_static (g_intern_static_string ("UnicoOuterStrokeStyle"), values); } return etype; diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-css-support.h gtk3-engines-unico-0.1.0+r66/unico/unico-css-support.h --- gtk3-engines-unico-0.1.0+r74/unico/unico-css-support.h 2011-06-17 20:12:43.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-css-support.h 2011-05-19 13:27:48.000000000 +0000 @@ -29,8 +29,8 @@ G_BEGIN_DECLS -GType unico_stroke_style_get_type (void) G_GNUC_CONST; -#define UNICO_TYPE_STROKE_STYLE (unico_stroke_style_get_type ()) +GType unico_outer_stroke_style_get_type (void) G_GNUC_CONST; +#define UNICO_TYPE_OUTER_STROKE_STYLE (unico_outer_stroke_style_get_type ()) G_END_DECLS diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-draw.c gtk3-engines-unico-0.1.0+r66/unico/unico-draw.c --- gtk3-engines-unico-0.1.0+r74/unico/unico-draw.c 2011-06-24 20:40:18.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-draw.c 2011-06-01 17:19:55.000000000 +0000 @@ -23,10 +23,8 @@ #include #include -#include "math.h" #include "unico-cairo-support.h" #include "unico-draw.h" -#include "unico-support.h" #include "unico-types.h" #define UNICO_RECT_SET(rect, _x, _y, _w, _h) (rect).x = (_x); \ @@ -35,88 +33,38 @@ (rect).height = (_h); static void -unico_draw_arrow (GtkThemingEngine *engine, - cairo_t *cr, - gdouble angle, - gdouble x, - gdouble y, - gdouble size) -{ - GtkStateFlags state; - GdkRGBA color; - gdouble size_reduction = 2; - - state = gtk_theming_engine_get_state (engine); - gtk_theming_engine_get_color (engine, state, &color); - - cairo_save (cr); - - /* use floor function to adjust those doubles. */ - y = floor (y); - x = floor (x); - size = floor (size); - - size -= size_reduction; - - cairo_translate (cr, size_reduction / 2, size_reduction / 2); - cairo_translate (cr, x + size / 2.0 + 0.5, y + size / 2.0 + 0.5); - cairo_rotate (cr, angle - G_PI_2); - cairo_translate (cr, (gint) (size / 4.0), 0); - - /* FIXME(Cimi) This +1 / -1 is done to fix blurred diagonal lines. - * I know it's not nice at all, but it fix a visual bug. */ - cairo_move_to (cr, -size / 2.0, -size / 2.0); - cairo_rel_line_to (cr, size / 2.0 + 1, size / 2.0); - cairo_rel_line_to (cr, -size / 2.0 - 1, size / 2.0); - cairo_close_path (cr); - - cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha * 0.75); - cairo_fill_preserve (cr); - - gdk_cairo_set_source_rgba (cr, &color); - cairo_stroke (cr); - - cairo_restore (cr); -} - -static void unico_draw_cell (DRAW_ARGS, GtkRegionFlags flags) { GtkJunctionSides junction; - guint hidden_side; - - junction = GTK_JUNCTION_RIGHT | GTK_JUNCTION_LEFT; - - hidden_side = SIDE_RIGHT; if ((flags & GTK_REGION_FIRST) != 0) - junction &= ~(GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMLEFT); - if ((flags & GTK_REGION_LAST) != 0) - { - junction &= ~(GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMRIGHT); - hidden_side = 0; - } + junction = GTK_JUNCTION_RIGHT; + else if ((flags & GTK_REGION_LAST) != 0) + junction = GTK_JUNCTION_LEFT; + else + junction = GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM; unico_cairo_draw_background (engine, cr, x, y, width, height, - hidden_side, junction); + 0, junction); unico_cairo_draw_frame (engine, cr, x, y, width, height, - hidden_side, junction); + 0, junction); } static void unico_draw_check (DRAW_ARGS) { GtkStateFlags flags; - gboolean in_menu; + gboolean in_cell, in_menu; gboolean draw_bullet, inconsistent; flags = gtk_theming_engine_get_state (engine); - in_menu = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUITEM); + in_cell = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_CELL); + in_menu = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENU); inconsistent = (flags & GTK_STATE_FLAG_INCONSISTENT) != 0; draw_bullet = (flags & GTK_STATE_FLAG_ACTIVE) != 0; @@ -212,7 +160,12 @@ { GtkJunctionSides junction; - junction = GTK_JUNCTION_RIGHT | GTK_JUNCTION_LEFT; + if ((flags & GTK_REGION_FIRST) != 0) + junction = GTK_JUNCTION_RIGHT | GTK_JUNCTION_CORNER_BOTTOMLEFT; + else if ((flags & GTK_REGION_LAST) != 0) + junction = GTK_JUNCTION_LEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT; + else + junction = GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM; unico_cairo_draw_background (engine, cr, x, y, width, height, @@ -224,24 +177,17 @@ GtkRegionFlags flags) { GtkJunctionSides junction; - guint hidden_side; - - junction = GTK_JUNCTION_RIGHT | GTK_JUNCTION_LEFT; - - hidden_side = SIDE_RIGHT | SIDE_TOP; if ((flags & GTK_REGION_FIRST) != 0) - { - hidden_side |= SIDE_LEFT; - } - if ((flags & GTK_REGION_LAST) != 0) - { - hidden_side = SIDE_RIGHT | SIDE_TOP; - } + junction = GTK_JUNCTION_RIGHT | GTK_JUNCTION_CORNER_BOTTOMLEFT; + else if ((flags & GTK_REGION_LAST) != 0) + junction = GTK_JUNCTION_LEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT; + else + junction = GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM; unico_cairo_draw_frame (engine, cr, x, y, width, height, - hidden_side, junction); + 0, junction); } static void @@ -275,116 +221,25 @@ } static void -unico_draw_expander (DRAW_ARGS) -{ - GtkStateFlags state; - GdkRGBA color; - gdouble size; - gdouble angle = G_PI_2; - - state = gtk_theming_engine_get_state (engine); - gtk_theming_engine_get_color (engine, state, &color); - - cairo_save (cr); - - size = floor (MIN (width, height)); - - x += width / 2 - size / 2; - y += height / 2 - size / 2; - - if ((state & GTK_STATE_FLAG_ACTIVE) == 0) - angle = 0; - - cairo_translate (cr, x + size / 2.0 + 0.5, y + size / 2.0 + 0.5); - cairo_rotate (cr, angle); - cairo_translate (cr, (gint) (size / 4.0), 0); - - /* FIXME(Cimi) This +1 / -1 is done to fix blurred diagonal lines. - * I know it's not nice at all, but it fix a visual bug. */ - cairo_move_to (cr, -size / 2.0, -size / 2.0); - cairo_rel_line_to (cr, size / 2.0 + 1, size / 2.0); - cairo_rel_line_to (cr, -size / 2.0 - 1, size / 2.0); - cairo_close_path (cr); - - cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha * 0.75); - cairo_fill_preserve (cr); - - gdk_cairo_set_source_rgba (cr, &color); - cairo_stroke (cr); - - cairo_restore (cr); -} - -static void -unico_draw_focus (DRAW_ARGS) -{ - GdkRGBA *fill_color, *border_color, *outer_stroke_color; - GtkStateFlags state; - gint line_width; - gint radius; - - state = gtk_theming_engine_get_state (engine); - gtk_theming_engine_get (engine, state, - "-unico-focus-border-color", &border_color, - "-unico-focus-border-radius", &radius, - "-unico-focus-fill-color", &fill_color, - "-unico-focus-outer-stroke-color", &outer_stroke_color, - NULL); - - gtk_theming_engine_get_style (engine, - "focus-line-width", &line_width, - NULL); - - cairo_save (cr); - cairo_set_line_width (cr, line_width); - - unico_cairo_round_rect (cr, x, y, - width, height, - radius, SIDE_ALL, GTK_JUNCTION_NONE); - gdk_cairo_set_source_rgba (cr, fill_color); - cairo_fill (cr); - - unico_cairo_round_rect_inner (cr, x - line_width, y - line_width, - width + line_width * 2, height + line_width * 2, - radius + 1, SIDE_ALL, GTK_JUNCTION_NONE); - gdk_cairo_set_source_rgba (cr, outer_stroke_color); - cairo_stroke (cr); - - unico_cairo_round_rect_inner (cr, x, y, - width, height, - radius, SIDE_ALL, GTK_JUNCTION_NONE); - gdk_cairo_set_source_rgba (cr, border_color); - cairo_stroke (cr); - - cairo_restore (cr); - - gdk_rgba_free (border_color); - gdk_rgba_free (fill_color); - gdk_rgba_free (outer_stroke_color); -} - -static void unico_draw_frame_gap (DRAW_ARGS, GtkPositionType gap_side, gdouble xy0_gap, gdouble xy1_gap) { GtkJunctionSides junction; + GtkStateFlags flags; gint border_width, radius; gdouble x0, y0, x1, y1, xc, yc, wc, hc; gdouble line_width; xc = yc = wc = hc = 0; + flags = gtk_theming_engine_get_state (engine); junction = gtk_theming_engine_get_junction_sides (engine); unico_get_line_width (engine, &line_width); unico_get_border_radius (engine, &radius); - - border_width = cairo_get_line_width (cr); - - if (unico_has_outer_stroke (engine)) - border_width = 2 * cairo_get_line_width (cr); + border_width = 3 * cairo_get_line_width (cr); cairo_save (cr); @@ -403,7 +258,6 @@ junction |= GTK_JUNCTION_CORNER_TOPRIGHT; break; - default: case GTK_POS_BOTTOM: xc = x + xy0_gap + border_width; yc = y + height - border_width; @@ -528,12 +382,13 @@ unico_draw_radio (DRAW_ARGS) { GtkStateFlags flags; - gboolean in_menu; + gboolean in_cell, in_menu; gboolean draw_bullet, inconsistent; flags = gtk_theming_engine_get_state (engine); - in_menu = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUITEM); + in_cell = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_CELL); + in_menu = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENU); inconsistent = (flags & GTK_STATE_FLAG_INCONSISTENT) != 0; draw_bullet = (flags & GTK_STATE_FLAG_ACTIVE) != 0; @@ -632,22 +487,12 @@ } static void -unico_draw_scrolled_window_frame (DRAW_ARGS) -{ - gint radius; - - unico_get_border_radius (engine, &radius); - - unico_cairo_draw_border_rect (engine, cr, - x, y, width, height, - 0, 0, gtk_theming_engine_get_junction_sides (engine)); -} - -static void unico_draw_separator (DRAW_ARGS) { + GtkStateFlags flags; gdouble line_width; + flags = gtk_theming_engine_get_state (engine); unico_get_line_width (engine, &line_width); /* FIXME right code should be @@ -664,7 +509,7 @@ unico_cairo_draw_border_from_path (engine, cr, x, y + height / 2 - line_width / 2, width, line_width); } else - { + { cairo_move_to (cr, x + width / 2 + line_width / 2, y); cairo_line_to (cr, x + width / 2 + line_width / 2, y + height); unico_cairo_draw_inner_stroke_from_path (engine, cr, x + width / 2 + line_width / 2, y, line_width, height); @@ -766,59 +611,31 @@ } static void -unico_draw_switch (DRAW_ARGS, - GtkOrientation orientation) -{ - unico_cairo_draw_background (engine, cr, - x, y, width, height, - 0, gtk_theming_engine_get_junction_sides (engine)); - unico_cairo_draw_frame (engine, cr, - x, y, width, height, - 0, gtk_theming_engine_get_junction_sides (engine)); -} - -static void unico_draw_tab (DRAW_ARGS, GtkPositionType gap_side) { + GtkStateFlags flags; GtkJunctionSides junction = 0; gdouble line_width; + gdouble offset; guint hidden_side = 0; - gdouble offset = 0; + flags = gtk_theming_engine_get_state (engine); unico_get_line_width (engine, &line_width); offset = 0; - if (unico_has_outer_stroke (engine)) - offset = line_width * 2; + if (unico_has_outer_stroke (engine) && (flags & GTK_STATE_FLAG_ACTIVE)) + offset = line_width; cairo_save (cr); switch (gap_side) { - case GTK_POS_TOP: - junction = GTK_JUNCTION_TOP; - hidden_side = SIDE_TOP; - - y -= offset; - - cairo_translate (cr, x + width, y + height); - cairo_rotate (cr, G_PI); - break; - default: - case GTK_POS_BOTTOM: - junction = GTK_JUNCTION_BOTTOM; - hidden_side = SIDE_BOTTOM; - - height += offset; - - cairo_translate (cr, x, y); - break; case GTK_POS_LEFT: junction = GTK_JUNCTION_LEFT; hidden_side = SIDE_LEFT; - x -= offset; + x -= line_width * 2 + offset; cairo_translate (cr, x + width, y); cairo_rotate (cr, G_PI / 2); @@ -827,11 +644,28 @@ junction = GTK_JUNCTION_RIGHT; hidden_side = SIDE_RIGHT; - width += offset; + width += line_width * 2 + offset; cairo_translate (cr, x, y + height); cairo_rotate (cr, - G_PI / 2); break; + case GTK_POS_TOP: + junction = GTK_JUNCTION_TOP; + hidden_side = SIDE_TOP; + + y -= line_width * 2 + offset; + + cairo_translate (cr, x + width, y + height); + cairo_rotate (cr, G_PI); + break; + case GTK_POS_BOTTOM: + junction = GTK_JUNCTION_BOTTOM; + hidden_side = SIDE_BOTTOM; + + height += line_width * 2 + offset; + + cairo_translate (cr, x, y); + break; } if (gap_side == GTK_POS_TOP || @@ -853,7 +687,6 @@ { g_assert (functions); - functions->draw_arrow = unico_draw_arrow; functions->draw_cell = unico_draw_cell; functions->draw_check = unico_draw_check; functions->draw_column_header_background = unico_draw_column_header_background; @@ -862,8 +695,6 @@ functions->draw_combo_button_frame = unico_draw_combo_button_frame; functions->draw_common_background = unico_draw_common_background; functions->draw_common_frame = unico_draw_common_frame; - functions->draw_expander = unico_draw_expander; - functions->draw_focus = unico_draw_focus; functions->draw_frame_gap = unico_draw_frame_gap; functions->draw_icon_view = unico_draw_icon_view; functions->draw_menubaritem_background = unico_draw_menubaritem_background; @@ -875,9 +706,7 @@ functions->draw_scrollbar_slider = unico_draw_scrollbar_slider; functions->draw_scrollbar_stepper_background = unico_draw_scrollbar_stepper_background; functions->draw_scrollbar_stepper_frame = unico_draw_scrollbar_stepper_frame; - functions->draw_scrolled_window_frame = unico_draw_scrolled_window_frame; functions->draw_separator = unico_draw_separator; functions->draw_slider_button = unico_draw_slider_button; - functions->draw_switch = unico_draw_switch; functions->draw_tab = unico_draw_tab; } diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-engine.c gtk3-engines-unico-0.1.0+r66/unico/unico-engine.c --- gtk3-engines-unico-0.1.0+r74/unico/unico-engine.c 2011-06-24 20:40:18.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-engine.c 2011-05-19 13:27:48.000000000 +0000 @@ -25,11 +25,9 @@ #include #include "unico.h" -#include "unico-cairo-support.h" #include "unico-css-support.h" -#include "unico-draw.h" +#include "unico-cairo-support.h" #include "unico-engine.h" -#include "unico-support.h" #include "unico-types.h" #define UNICO_NAMESPACE "unico" @@ -88,33 +86,6 @@ return retval; } -static void -trim_allocation_for_scale (GtkThemingEngine *engine, - gdouble *x, - gdouble *y, - gdouble *width, - gdouble *height) -{ - const GtkWidgetPath *path; - - path = gtk_theming_engine_get_path (engine); - - if (gtk_widget_path_is_type (path, GTK_TYPE_SCALE) && - (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_TROUGH) || - gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PROGRESSBAR))) - { - if (!gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_VERTICAL)) - { - *y += *height / 2.0 - 2.0; - *height = 4; - } - else - { - *x += *width / 2.0 - 2.0; - *width = 4; - } - } -} static void unico_engine_render_activity (GtkThemingEngine *engine, @@ -147,13 +118,7 @@ gdouble y, gdouble size) { - UnicoStyleFunctions *style_functions; - - UNICO_CAIRO_INIT - - unico_lookup_functions (UNICO_ENGINE (engine), &style_functions); - - style_functions->draw_arrow (engine, cr, angle, x, y, size); + GTK_THEMING_ENGINE_CLASS (unico_engine_parent_class)->render_arrow (engine, cr, angle, x, y, size); } static void @@ -175,8 +140,16 @@ path = gtk_theming_engine_get_path (engine); len = gtk_widget_path_length (path); - trim_allocation_for_scale (engine, &x, &y, &width, &height); - +/* if ((gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUBAR)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_TOOLBAR)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_DOCK)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_BUTTON)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_ENTRY) &&*/ +/* !gtk_widget_path_has_parent (path, GTK_TYPE_TREE_VIEW)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUITEM)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENU)))*/ +/* style_functions->draw_common_background (engine, cr, x, y, width, height);*/ +/* else */ if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_BUTTON) && gtk_widget_path_iter_has_region (path, len - 2, GTK_STYLE_REGION_COLUMN_HEADER, &flags)) style_functions->draw_column_header_background (engine, cr, x, y, width, height, flags); @@ -231,13 +204,49 @@ gdouble width, gdouble height) { - UnicoStyleFunctions *style_functions; + /* FIXME put the code in unico-draw.c */ + GdkRGBA border, bg, fg; + GtkStateFlags flags; + gint side; - UNICO_CAIRO_INIT + side = MIN (width, height); - unico_lookup_functions (UNICO_ENGINE (engine), &style_functions); + x += ((int) width / 2) - (side / 2); + y += ((int) height / 2) - (side / 2); + + flags = gtk_theming_engine_get_state (engine); + + gtk_theming_engine_get_border_color (engine, flags, &border); + gtk_theming_engine_get_background_color (engine, flags, &bg); + gtk_theming_engine_get_color (engine, flags, &fg); + + cairo_save (cr); + + cairo_set_line_width (cr, 1); - style_functions->draw_expander (engine, cr, x, y, width, height); + unico_cairo_round_rect (cr, x + 0.5, y + 0.5, side, side, 2, SIDE_ALL, 0); + gdk_cairo_set_source_rgba (cr, &bg); + cairo_fill_preserve (cr); + + gdk_cairo_set_source_rgba (cr, &border); + cairo_stroke (cr); + + cairo_set_line_width (cr, 1); + cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); + gdk_cairo_set_source_rgba (cr, &fg); + + cairo_move_to (cr, x + 3, y + side / 2 + 0.5); + cairo_line_to (cr, x + side - 2, y + side / 2 + 0.5); + + if ((flags & GTK_STATE_FLAG_ACTIVE) == 0) + { + cairo_move_to (cr, x + side / 2 + 0.5, y + 3); + cairo_line_to (cr, x + side / 2 + 0.5, y + side - 2); + } + + cairo_stroke (cr); + + cairo_restore (cr); } static void @@ -269,13 +278,7 @@ gdouble width, gdouble height) { - UnicoStyleFunctions *style_functions; - - UNICO_CAIRO_INIT - - unico_lookup_functions (UNICO_ENGINE (engine), &style_functions); - - style_functions->draw_focus (engine, cr, x, y, width, height); + GTK_THEMING_ENGINE_CLASS (unico_engine_parent_class)->render_focus (engine, cr, x, y, width, height); } static void @@ -297,8 +300,16 @@ path = gtk_theming_engine_get_path (engine); len = gtk_widget_path_length (path); - trim_allocation_for_scale (engine, &x, &y, &width, &height); - +/* if ((gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUBAR)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_TOOLBAR)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_DOCK)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_BUTTON)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_ENTRY) &&*/ +/* !gtk_widget_path_has_parent (path, GTK_TYPE_TREE_VIEW)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUITEM)) ||*/ +/* (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENU)))*/ +/* style_functions->draw_common_frame (engine, cr, x, y, width, height);*/ +/* else*/ if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_BUTTON) && gtk_widget_path_iter_has_region (path, len - 2, GTK_STYLE_REGION_COLUMN_HEADER, &flags)) style_functions->draw_column_header_frame (engine, cr, x, y, width, height, flags); @@ -313,9 +324,6 @@ else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUITEM) && gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUBAR)) style_functions->draw_menubaritem_frame (engine, cr, x, y, width, height); - else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_FRAME) && - gtk_widget_path_is_type (path, GTK_TYPE_SCROLLED_WINDOW)) - style_functions->draw_scrolled_window_frame (engine, cr, x, y, width, height); else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_DOCK)) GTK_THEMING_ENGINE_CLASS (unico_engine_parent_class)->render_frame (engine, cr, x, y, width, height); else @@ -480,7 +488,52 @@ gdouble y, PangoLayout *layout) { - GTK_THEMING_ENGINE_CLASS (unico_engine_parent_class)->render_layout (engine, cr, x, y, layout); + GdkRGBA *color; + GtkStateFlags flags; + + UNICO_CAIRO_INIT + + cairo_translate (cr, x, y); + + flags = gtk_theming_engine_get_state (engine); + gtk_theming_engine_get (engine, flags, + "color", &color, + NULL); + + gdk_cairo_set_source_rgba (cr, color); + + if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_ACCELERATOR)) + { + unico_cairo_set_source_color_with_alpha (cr, color, 0.6); + } + + if (flags & GTK_STATE_FLAG_INSENSITIVE) + { + GdkRGBA *text_shadow_color; + + gtk_theming_engine_get (engine, flags, + "-unico-text-shadow-color", &text_shadow_color, + NULL); + + cairo_save (cr); + + cairo_translate (cr, 1, 1); + + if (text_shadow_color) + gdk_cairo_set_source_rgba (cr, text_shadow_color); + else + cairo_set_source_rgba (cr, 1, 1, 1, 0.6); + + pango_cairo_show_layout (cr, layout); + + cairo_restore (cr); + + gdk_rgba_free (text_shadow_color); + } + + pango_cairo_show_layout (cr, layout); + + gdk_rgba_free (color); } static void @@ -527,21 +580,16 @@ GtkOrientation orientation) { UnicoStyleFunctions *style_functions; - const GtkWidgetPath *path; UNICO_CAIRO_INIT unico_lookup_functions (UNICO_ENGINE (engine), &style_functions); - path = gtk_theming_engine_get_path (engine); - if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_SCROLLBAR)) + if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_SLIDER) && + gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_SCROLLBAR)) { style_functions->draw_scrollbar_slider (engine, cr, x, y, width, height); } - else if (gtk_widget_path_is_type (path, GTK_TYPE_SWITCH)) - { - style_functions->draw_switch (engine, cr, x, y, width, height, orientation); - } else { UnicoSliderParameters slider; @@ -606,27 +654,9 @@ GDK_TYPE_RGBA, 0)); gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL, - g_param_spec_boxed ("focus-border-color", - "Focus border color", - "Focus border color", - GDK_TYPE_RGBA, 0)); - - gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL, - g_param_spec_int ("focus-border-radius", - "Focus border radius", - "Focus border radius", - 0, G_MAXINT, 0, 0)); - - gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL, - g_param_spec_boxed ("focus-fill-color", - "Focus fill color", - "Focus fill color", - GDK_TYPE_RGBA, 0)); - - gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL, - g_param_spec_boxed ("focus-outer-stroke-color", - "Focus outer stroke color", - "Focus outer stroke color", + g_param_spec_boxed ("focus-color", + "Focus color", + "Focus color", GDK_TYPE_RGBA, 0)); gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL, @@ -657,8 +687,9 @@ g_param_spec_enum ("outer-stroke-style", "Outer stroke style", "Outer stroke style", - UNICO_TYPE_STROKE_STYLE, - UNICO_STROKE_STYLE_NONE, 0)); + UNICO_TYPE_OUTER_STROKE_STYLE, + UNICO_OUTER_STROKE_STYLE_NONE, + 0)); gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL, g_param_spec_boxed ("text-shadow-color", diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-support.c gtk3-engines-unico-0.1.0+r66/unico/unico-support.c --- gtk3-engines-unico-0.1.0+r74/unico/unico-support.c 2011-06-24 20:40:18.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-support.c 2011-05-19 13:27:48.000000000 +0000 @@ -23,7 +23,6 @@ #include #include "unico-engine.h" -#include "unico-support.h" #include "unico-types.h" void @@ -68,12 +67,12 @@ unico_has_outer_stroke (GtkThemingEngine *engine) { GtkStateFlags flags; - UnicoStrokeStyle outer_stroke_style; + UnicoOuterStrokeStyle outer_stroke_style; flags = gtk_theming_engine_get_state (engine); gtk_theming_engine_get (engine, flags, "-unico-outer-stroke-style", &outer_stroke_style, NULL); - return outer_stroke_style != UNICO_STROKE_STYLE_NONE; + return outer_stroke_style != UNICO_OUTER_STROKE_STYLE_NONE; } diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-theme.c gtk3-engines-unico-0.1.0+r66/unico/unico-theme.c --- gtk3-engines-unico-0.1.0+r74/unico/unico-theme.c 2011-06-24 20:40:18.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-theme.c 2011-05-19 13:27:48.000000000 +0000 @@ -25,12 +25,6 @@ #include "unico-engine.h" -G_MODULE_EXPORT void theme_init (GTypeModule *module); - -G_MODULE_EXPORT void theme_exit (void); - -G_MODULE_EXPORT GtkThemingEngine* create_engine (void); - G_MODULE_EXPORT void theme_init (GTypeModule *module) { diff -Nru gtk3-engines-unico-0.1.0+r74/unico/unico-types.h gtk3-engines-unico-0.1.0+r66/unico/unico-types.h --- gtk3-engines-unico-0.1.0+r74/unico/unico-types.h 2011-06-24 20:40:18.000000000 +0000 +++ gtk3-engines-unico-0.1.0+r66/unico/unico-types.h 2011-05-19 13:27:48.000000000 +0000 @@ -49,10 +49,10 @@ typedef enum { - UNICO_STROKE_STYLE_CUSTOM = 0, - UNICO_STROKE_STYLE_INSET = 1, - UNICO_STROKE_STYLE_NONE = 2 -} UnicoStrokeStyle; + UNICO_OUTER_STROKE_STYLE_CUSTOM = 0, + UNICO_OUTER_STROKE_STYLE_INSET = 1, + UNICO_OUTER_STROKE_STYLE_NONE = 2 +} UnicoOuterStrokeStyle; typedef enum { @@ -64,13 +64,6 @@ struct _UnicoStyleFunctions { - void (*draw_arrow) (GtkThemingEngine *engine, - cairo_t *cr, - gdouble angle, - gdouble x, - gdouble y, - gdouble size); - void (*draw_cell) (DRAW_ARGS, GtkRegionFlags flags); @@ -90,10 +83,6 @@ void (*draw_common_frame) (DRAW_ARGS); - void (*draw_expander) (DRAW_ARGS); - - void (*draw_focus) (DRAW_ARGS); - void (*draw_frame_gap) (DRAW_ARGS, GtkPositionType gap_side, gdouble xy0_gap, @@ -122,13 +111,8 @@ void (*draw_scrollbar_stepper_frame) (DRAW_ARGS); - void (*draw_scrolled_window_frame) (DRAW_ARGS); - void (*draw_separator) (DRAW_ARGS); - void (*draw_switch) (DRAW_ARGS, - GtkOrientation orientation); - void (*draw_slider_button) (DRAW_ARGS, UnicoSliderParameters *slider);