theme: Upgrade to use Cairo for painting (changes API)

This commit is in preparation for the work happening in GTK3, which will
use Cairo for drawing exclusively. So it is necessary to move all
drawing code to Cairo. In this commit the "gtk2" code is used for both
gtk2 and gtk3; compatibility with newer versions of gtk3 where different
code is needed will be added subsequently.
For compatibility with older GTK versions, the file gdk2-drawing-utils.h
provides a compatibility layer.

The commit changes the API of libmutter-private.

https://bugzilla.gnome.org/show_bug.cgi?id=630203
This commit is contained in:
Benjamin Otte
2010-09-23 17:35:41 +02:00
parent dc80242e51
commit aa65f94c67
9 changed files with 406 additions and 163 deletions

View File

@ -36,6 +36,7 @@
#include "prefs.h"
#include "ui.h"
#include "gdk2-drawing-utils.h"
#include "gtk-compat.h"
#include "gdk-compat.h"
@ -2384,6 +2385,7 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
MetaButtonLayout button_layout;
MetaGrabOp grab_op;
Display *display;
cairo_t *cr;
widget = GTK_WIDGET (frames);
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
@ -2496,11 +2498,12 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
meta_prefs_get_button_layout (&button_layout);
cr = meta_cairo_create (drawable);
meta_theme_draw_frame_with_style (meta_theme_get_current (),
frame->style,
widget,
drawable,
NULL, /* &areas[i], */
cr,
x_offset, y_offset,
type,
flags,
@ -2510,6 +2513,8 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
&button_layout,
button_states,
mini_icon, icon);
cairo_destroy (cr);
}
static void