summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-10-06 23:54:09 -0700
committerBenjamin Otte <otte@redhat.com>2011-10-14 00:31:15 -0700
commit626e381d682a345b8a8e3c7f0e3b79258b3eaac3 (patch)
tree99cb7d517937f24b6544e923e0e59d4e8a4247d4
parent26aefe576df82032900db79e40016f152924b44d (diff)
glitz: Remove support for glitz code
Glitz never worked.
-rw-r--r--configure.ac25
-rw-r--r--src/gnome/glitz-board.c408
-rw-r--r--src/gnome/glitz-board.h70
-rw-r--r--src/gnome/gnome-board.c124
4 files changed, 0 insertions, 627 deletions
diff --git a/configure.ac b/configure.ac
index d6f3c94..cc2f558 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,31 +77,6 @@ GAME_LIBS="\$(top_builddir)/libgame/$PACKAGE-$LIBGAME_VERS.la"
dnl Gnome Frontend
PKG_CHECK_MODULES(GNOME, libglade-2.0)
PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.10.0, HAVE_GCONF="yes", HAVE_GCONF="no")
-if test "x$HAVE_WIN32" = "xyes"
-then
- PKG_CHECK_MODULES(GLITZ, glitz-wgl >= 0.5.5, HAVE_GLITZ="yes", HAVE_GLITZ="no")
-else
- PKG_CHECK_MODULES(GLITZ, glitz-glx >= 0.5.5, HAVE_GLITZ="yes", HAVE_GLITZ="no")
-fi
-if test "x$HAVE_GLITZ" = "xyes"
-then
- AC_MSG_CHECKING([if cairo was compiled with glitz support])
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $LIBGAME_CFLAGS"
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
-#include <cairo-glitz.h>
-]), , HAVE_GLITZ="no", [cairo.h])
- CFLAGS="$save_CFLAGS"
-fi
-AC_MSG_RESULT($HAVE_GLITZ)
-AM_CONDITIONAL(HAVE_GLITZ, test "x$HAVE_GLITZ" = "xyes")
-if test "x$HAVE_GLITZ" = "xyes"
-then
- AC_DEFINE_UNQUOTED(HAVE_GLITZ, 1, [Define if glitz is supported in cairo])
-else
- GLITZ_CFLAGS=""
- GLITZ_LIBS=""
-fi
AM_CONDITIONAL(HAVE_GCONF, test "x$HAVE_GCONF" = "xyes")
if test "x$HAVE_GCONF" = "xyes"
then
diff --git a/src/gnome/glitz-board.c b/src/gnome/glitz-board.c
deleted file mode 100644
index c050c80..0000000
--- a/src/gnome/glitz-board.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
- *
- * 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <glib/gi18n.h>
-#include "glitz-board.h"
-#include <libgame/game-sprite.h>
-#include <string.h>
-#include <math.h>
-#include <cairo-glitz.h>
-#include <gdk/gdkx.h>
-
-static GtkWidgetClass *parent_class = NULL;
-
-static void
-game_gnome_board_get_graphic_size (GameGnomeBoard *board, double *width, double *height)
-{
- GameGraphic *graphic = board->graphic;
-
- if (width)
- *width = graphic ? graphic->rect.x2 - graphic->rect.x1 : 0;
- if (height)
- *height = graphic ? graphic->rect.y2 - graphic->rect.y1 : 0;
-}
-
-static void
-game_gnome_board_recreate_surface (GameGnomeBoard *board)
-{
- GtkWidget *widget = GTK_WIDGET (board);
- Display *disp;
- int screen;
- glitz_format_t *format;
- glitz_surface_t *glitz_surface;
-
- if (!GTK_WIDGET_REALIZED (widget))
- return;
- disp = gdk_x11_display_get_xdisplay (gtk_widget_get_display (widget));
- screen = gdk_screen_get_number (gtk_widget_get_screen (widget));
- if (board->format == NULL) {
- glitz_glx_init (NULL);
- board->format = glitz_glx_find_drawable_format_for_visual (disp, screen,
- XVisualIDFromVisual (gdk_x11_visual_get_xvisual (gtk_widget_get_visual (widget))));
- g_print ("%s buffered\n", board->format->doublebuffer ? "double" : "single");
- }
- if (board->cairo_surface != NULL)
- cairo_surface_destroy (board->cairo_surface);
- if (board->glitz_drawable != NULL)
- glitz_drawable_destroy (board->glitz_drawable);
- board->glitz_drawable = glitz_glx_create_drawable_for_window (disp, screen,
- board->format, GDK_DRAWABLE_XID (widget->window), widget->allocation.width,
- widget->allocation.height);
- format = glitz_find_standard_format (board->glitz_drawable, GLITZ_STANDARD_ARGB32);
- glitz_surface = glitz_surface_create (board->glitz_drawable, format,
- MAX (widget->allocation.width, 1), MAX (widget->allocation.height, 1), 0, NULL);
- glitz_surface_attach (glitz_surface, board->glitz_drawable, GLITZ_DRAWABLE_BUFFER_FRONT_COLOR);
- board->cairo_surface = cairo_glitz_surface_create (glitz_surface);
- //glitz_surface_destroy (glitz_surface);
-}
-
-static void
-game_gnome_board_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
- double width, height;
-
- game_gnome_board_get_graphic_size (GAME_GNOME_BOARD (widget),
- &width, &height);
- requisition->width = ceil (width);
- requisition->height = ceil (height);
-}
-
-static void
-game_gnome_board_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- GameGnomeBoard *board = GAME_GNOME_BOARD (widget);
- double width, height;
-
- if (board->graphic) {
- game_gnome_board_get_graphic_size (board, &width, &height);
- board->scale = MIN ((double) allocation->width / width , (double) allocation->height/ height);
- board->skip_x = (int) (allocation->width - width * board->scale) / 2; // + allocation->x;
- board->skip_y = (int) (allocation->height - height * board->scale) / 2; // + allocation->y;
- }
-
- GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
-
- game_gnome_board_recreate_surface (board);
-}
-
-static gboolean
-game_gnome_board_expose (GtkWidget *widget, GdkEventExpose *event)
-{
- GameRectangle rect, clip_rect;
- GameGnomeBoard *board = GAME_GNOME_BOARD (widget);
- GamePoint p = { -board->skip_x, -board->skip_y };
- cairo_t *cr;
- double w, h;
-
- if (!board->graphic)
- return FALSE;
-
- //game_gnome_board_recreate_surface (board);
- game_gnome_board_get_graphic_size (board, &w, &h);
- clip_rect.x1 = event->area.x;
- clip_rect.y1 = event->area.y;
- clip_rect.x2 = event->area.x + event->area.width;
- clip_rect.y2 = event->area.y + event->area.height;
- rect.x1 = board->skip_x;
- rect.x2 = board->skip_x + w * board->scale;
- rect.y1 = board->skip_y;
- rect.y2 = board->skip_y + h * board->scale;
- //if (!game_rectangle_intersect (&rect, &rect, &clip_rect))
- // return FALSE;
-
-#if 0
- cr = gdk_cairo_create (widget->window);
-#else
- cr = cairo_create (board->cairo_surface);
-#endif
- game_rectangle_move (&rect, &rect, &p);
- rect.x1 /= board->scale;
- rect.x2 /= board->scale;
- rect.y1 /= board->scale;
- rect.y2 /= board->scale;
- cairo_translate (cr, board->skip_x, board->skip_y);
- cairo_scale (cr, board->scale, board->scale);
- cairo_rectangle (cr, rect.x1, rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1);
- cairo_clip (cr);
-#if 1
- {
- //GTimer *timer = g_timer_new ();
- game_graphic_draw_area (board->graphic, cr, &rect);
- //g_timer_stop (timer);
- //g_print ("drawing took %gs\n", g_timer_elapsed (timer, NULL));
- }
-#else
- /* This code is supposed to get rid of drawing errors by scaling up
- * to the next integer factor and then scaling the complete image down again.
- * Unfortunately there's some weird bug that I can't find */
- {
- GameRectangle rounded = { floor (rect.x1), floor (rect.y1), ceil (rect.x2), ceil (rect.y2) };
- double factor = ceil (board->scale);
- cairo_surface_t *surface;
- cairo_t *crs;
- surface = cairo_surface_create_similar (cairo_get_target (cr),
- CAIRO_CONTENT_COLOR_ALPHA, factor * (rounded.x2 - rounded.x1), factor * (rounded.y2 - rounded.y1));
- crs = cairo_create (surface);
- cairo_scale (crs, factor, factor);
- cairo_translate (crs, - rounded.x1, - rounded.y1);
-#if 0
- {
- GameRectangle r = rounded;
- cairo_matrix_t matrix;
- cairo_get_matrix (crs, &matrix);
- cairo_matrix_transform_point (&matrix, &r.x1, &r.y1);
- cairo_matrix_transform_point (&matrix, &r.x2, &r.y2);
- g_print ("painting: %g %g x %g %g ==> %g %g x %g %g\n",
- rounded.x1, rounded.y1, rounded.x2, rounded.y2,
- r.x1, r.y1, r.x2, r.y2);
- }
-#endif
- game_graphic_draw_area (board->graphic, crs, &rounded);
- cairo_destroy (crs);
- cairo_translate (cr, rounded.x1, rounded.y1);
- game_rectangle_move (&rect, &rect, -rounded.x1, -rounded.y1);
- rect.x1 *= factor;
- rect.y1 *= factor;
- rect.x2 *= factor;
- rect.y2 *= factor;
- cairo_scale (cr, 1 / factor, 1 / factor);
- cairo_set_source_surface (cr, surface, 0, 0);
- cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
-#if 0
- {
- GameRectangle r = rect;
- cairo_matrix_t matrix;
- cairo_get_matrix (cr, &matrix);
- cairo_matrix_transform_point (&matrix, &r.x1, &r.y1);
- cairo_matrix_transform_point (&matrix, &r.x2, &r.y2);
- g_print ("copying: %g %g x %g %g ==> %g %g x %g %g\n",
- rect.x1, rect.y1, rect.x2, rect.y2,
- r.x1, r.y1, r.x2, r.y2);
- }
-#endif
- cairo_rectangle (cr, rect.x1, rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1);
- cairo_fill (cr);
- cairo_surface_destroy (surface);
- }
-#endif
- if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
- g_printerr ("drawing error: %s\n", cairo_status_to_string (cairo_status (cr)));
- cairo_destroy (cr);
- glitz_drawable_flush (board->glitz_drawable);
- //glitz_drawable_swap_buffers (board->glitz_drawable);
- return FALSE;
-}
-
-static void
-game_gnome_board_destroy (GtkObject *object)
-{
- GameGnomeBoard *board = GAME_GNOME_BOARD (object);
-
- game_gnome_board_set_graphic (board, NULL);
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
-game_gnome_board_realize (GtkWidget *widget)
-{
- GameGnomeBoard *board = GAME_GNOME_BOARD (widget);
- GdkWindowAttr attributes;
- gint attributes_mask;
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-
- attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.event_mask = gtk_widget_get_events (widget) |
- GDK_EXPOSURE_MASK;
-
- attributes_mask = GDK_WA_X | GDK_WA_Y;
-
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, attributes_mask);
- gdk_window_set_user_data (widget->window, widget);
-
- widget->style = gtk_style_attach (widget->style, widget->window);
-
- game_gnome_board_recreate_surface (board);
- g_print ("created window %p\n", widget->window);
-}
-
-static void
-game_gnome_board_unrealize (GtkWidget *widget)
-{
- GameGnomeBoard *board = GAME_GNOME_BOARD (widget);
-
- cairo_surface_destroy (board->cairo_surface);
- board->cairo_surface = NULL;
- glitz_drawable_destroy (board->glitz_drawable);
- board->glitz_drawable = NULL;
- board->format = NULL;
-
- GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
-}
-
-static void
-game_gnome_board_class_init (gpointer g_class, gpointer class_data)
-{
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (g_class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (g_class);
-
- parent_class = g_type_class_peek_parent (g_class);
-
- object_class->destroy = game_gnome_board_destroy;
-
- widget_class->size_request = game_gnome_board_size_request;
- widget_class->size_allocate = game_gnome_board_size_allocate;
- widget_class->expose_event = game_gnome_board_expose;
- widget_class->realize = game_gnome_board_realize;
- widget_class->unrealize = game_gnome_board_unrealize;
-}
-
-static void
-game_gnome_board_init (GTypeInstance *instance, gpointer g_class)
-{
- gtk_widget_set_double_buffered (GTK_WIDGET (instance), FALSE);
-}
-
-GType
-game_gnome_board_get_type ()
-{
- static GType gnome_board_type = 0;
-
- if (!gnome_board_type) {
- static const GTypeInfo gnome_board_info = {
- sizeof (GameGnomeBoardClass),
- NULL,
- NULL,
- game_gnome_board_class_init,
- NULL,
- NULL,
- sizeof (GameGnomeBoard),
- 0,
- game_gnome_board_init,
- };
-
- gnome_board_type = g_type_register_static (GTK_TYPE_WIDGET, "GameGnomeBoard", &gnome_board_info, 0);
- }
-
- return gnome_board_type;
-}
-
-
-GtkWidget *
-game_gnome_board_new (GameGraphic *graphic)
-{
- GameGnomeBoard *gnome_board;
-
- gnome_board = GAME_GNOME_BOARD (g_object_new (GAME_TYPE_GNOME_BOARD, NULL));
- game_gnome_board_set_graphic (gnome_board, graphic);
-
- return GTK_WIDGET (gnome_board);
-}
-
-static void
-callback_weak_notify (gpointer data, GObject *unused)
-{
- GameGnomeBoard *board = GAME_GNOME_BOARD (data);
-
- board->graphic = NULL;
- //g_object_notify (G_OBJECT (board), "board");
- gtk_widget_queue_draw (GTK_WIDGET (board));
-}
-
-static void
-callback_notify (GameGraphic *graphic, GParamSpec *pspec, GameGnomeBoard *board)
-{
- //g_assert_not_reached ();
-}
-
-static void
-callback_invalidate (GameGraphic *graphic, const GameRectangle *rect,
- GameGnomeBoard *board)
-{
- gint x, y, w, h;
- GameRectangle inval;
- GamePoint p = { - graphic->rect.x1, - graphic->rect.y1 };
-
- /* move relative to 0 */
- game_rectangle_move (&inval, rect, &p);
- /* scale */
- game_rectangle_scale (&inval, &inval, board->scale, board->scale);
- /* round */
- x = floor (inval.x1);
- w = ceil (inval.x2) - x;
- y = floor (inval.y1);
- h = ceil (inval.y2) - y;
- /* move relative to skipped */
- x += board->skip_x;
- y += board->skip_y;
-
- //gtk_widget_queue_draw (GTK_WIDGET (board));
- gtk_widget_queue_draw_area (GTK_WIDGET (board), x, y, w, h);
-}
-
-void
-game_gnome_board_set_graphic (GameGnomeBoard *board, GameGraphic* graphic)
-{
- g_return_if_fail (GAME_IS_GNOME_BOARD (board));
- g_return_if_fail (graphic == NULL || GAME_IS_GRAPHIC (graphic));
-
- if (board->graphic == graphic)
- return;
-
- if (board->graphic) {
- if (g_signal_handlers_disconnect_matched (board->graphic, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, board) != 2) {
- g_assert_not_reached ();
- }
- g_object_weak_unref (G_OBJECT (board->graphic), callback_weak_notify, board);
- }
-
- if (graphic) {
- board->graphic = graphic;
- g_signal_connect (graphic, "notify", (GCallback) callback_notify, board);
- g_signal_connect (graphic, "invalidate", (GCallback) callback_invalidate, board);
- g_object_weak_ref (G_OBJECT (board->graphic), callback_weak_notify, board);
- } else {
- board->graphic = NULL;
- }
- //g_object_notify (G_OBJECT (gnome_board), "board");
- gtk_widget_queue_resize (GTK_WIDGET (board));
- gtk_widget_queue_draw (GTK_WIDGET (board));
-}
-
-GameGraphic *
-game_gnome_board_get_graphic (GameGnomeBoard *board)
-{
- g_return_val_if_fail (GAME_IS_GNOME_BOARD (board), NULL);
-
- return board->graphic;
-}
-
diff --git a/src/gnome/glitz-board.h b/src/gnome/glitz-board.h
deleted file mode 100644
index 1008e09..0000000
--- a/src/gnome/glitz-board.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
- *
- * 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- */
-
-#ifndef __GAME_GNOME_BOARD_H__
-#define __GAME_GNOME_BOARD_H__
-
-#include <libgame/game-graphic.h>
-#include <libgame/game-game.h>
-#include <gtk/gtk.h>
-#include <glitz-glx.h>
-
-G_BEGIN_DECLS
-
-#define GAME_TYPE_GNOME_BOARD (game_gnome_board_get_type ())
-#define GAME_GNOME_BOARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAME_TYPE_GNOME_BOARD, GameGnomeBoard))
-#define GAME_GNOME_BOARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAME_TYPE_GNOME_BOARD, GameGnomeBoardClass))
-#define GAME_IS_GNOME_BOARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAME_TYPE_GNOME_BOARD))
-#define GAME_IS_GNOME_BOARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAME_TYPE_GNOME_BOARD))
-#define GAME_GNOME_BOARD_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GAME_TYPE_GNOME_BOARD, GameGnomeBoardClass))
-
-typedef struct _GameGnomeBoard GameGnomeBoard;
-typedef struct _GameGnomeBoardClass GameGnomeBoardClass;
-
-struct _GameGnomeBoard
-{
- GtkWidget widget;
-
- GameGraphic * graphic;
- double scale; /* how many pixels represent 1 game unit */
- int skip_x; /* pixels skipped on left (no uint to not get overflows)*/
- int skip_y; /* pixels skipped at top */
-
- glitz_drawable_format_t * format;
- glitz_drawable_t * glitz_drawable;
- cairo_surface_t * cairo_surface;
-};
-
-struct _GameGnomeBoardClass
-{
- GtkWidgetClass widget_class;
-};
-
-GType game_gnome_board_get_type (void) G_GNUC_CONST;
-
-GtkWidget * game_gnome_board_new (GameGraphic * graphic);
-
-void game_gnome_board_set_graphic (GameGnomeBoard * board,
- GameGraphic * graphic);
-GameGraphic * game_gnome_board_get_graphic (GameGnomeBoard * board);
-
-G_END_DECLS
-
-#endif /* __GAME_GNOME_BOARD_H__ */
diff --git a/src/gnome/gnome-board.c b/src/gnome/gnome-board.c
index bb39aca..df4a6d7 100644
--- a/src/gnome/gnome-board.c
+++ b/src/gnome/gnome-board.c
@@ -26,18 +26,6 @@
#include <libgame/game-sprite.h>
#include <string.h>
#include <math.h>
-#ifdef HAVE_GLITZ
-# include <cairo-glitz.h>
-# if defined (GDK_WINDOWING_X11)
-# include <gdk/gdkx.h>
-# include <glitz-glx.h>
-# elif defined (GDK_WINDOWING_WIN32)
-# include <gdk/gdkwin32.h>
-# include <glitz-wgl.h>
-# else
-# error "Your GDK Windowing system does not work with glitz support"
-# endif
-#endif
enum {
PROP_0,
@@ -64,114 +52,6 @@ struct _GameGnomeBoardBackend {
gpointer data);
};
-/*** GLITZ BACKEND ***/
-
-#ifdef HAVE_GLITZ
-
-typedef struct {
- glitz_drawable_format_t * glitz_format;
- glitz_drawable_t * glitz_drawable;
- cairo_surface_t * cairo_surface;
-} GlitzData;
-
-gpointer
-game_gnome_board_glitz_realize (GameGnomeBoard *board, gint width, gint height)
-{
- GtkWidget *widget = GTK_WIDGET (board);
- glitz_format_t *format;
- glitz_surface_t *surface;
- GlitzData *data = g_new0 (GlitzData, 1);
-#if defined (GDK_WINDOWING_X11)
- Display *disp = gdk_x11_display_get_xdisplay (gtk_widget_get_display (widget));
- int screen = gdk_screen_get_number (gtk_widget_get_screen (widget));
-
- glitz_glx_init (NULL);
- data->glitz_format = glitz_glx_find_drawable_format_for_visual (
- disp, screen, XVisualIDFromVisual (gdk_x11_visual_get_xvisual (
- gtk_widget_get_visual (widget))));
- data->glitz_drawable = glitz_glx_create_drawable_for_window (disp, screen,
- data->glitz_format, GDK_DRAWABLE_XID (widget->window), width, height);
-#elif defined (GDK_WINDOWING_WIN32)
- HWND window = GDK_WINDOW_HWND (widget->window);
-
- glitz_wgl_init (NULL);
- data->glitz_format = glitz_wgl_find_window_format (0, NULL, 0);
- data->glitz_drawable = glitz_wgl_create_drawable_for_window (data->glitz_format,
- window, width, height);
-#endif
- format = glitz_find_standard_format (data->glitz_drawable, GLITZ_STANDARD_ARGB32);
- surface = glitz_surface_create (data->glitz_drawable, format,
- width, height, 0, NULL);
- glitz_surface_attach (surface, data->glitz_drawable,
- data->glitz_format->doublebuffer ? GLITZ_DRAWABLE_BUFFER_BACK_COLOR
- : GLITZ_DRAWABLE_BUFFER_FRONT_COLOR);
- glitz_surface_attach (surface, data->glitz_drawable,
- GLITZ_DRAWABLE_BUFFER_FRONT_COLOR);
- data->cairo_surface = cairo_glitz_surface_create (surface);
- glitz_surface_destroy (surface);
-
- return data;
-}
-
-static void
-game_gnome_board_glitz_unrealize (GameGnomeBoard *board, gpointer datap)
-{
- GlitzData *data = datap;
- cairo_surface_destroy (data->cairo_surface);
- glitz_drawable_destroy (data->glitz_drawable);
- g_free (data);
-}
-
-static void
-game_gnome_board_glitz_resize (GameGnomeBoard *board, gpointer datap,
- int new_width, int new_height)
-{
- GlitzData *data = datap;
- glitz_format_t *format;
- glitz_surface_t *surface;
-
- cairo_surface_destroy (data->cairo_surface);
- glitz_drawable_update_size (data->glitz_drawable, new_width, new_height);
- format = glitz_find_standard_format (data->glitz_drawable, GLITZ_STANDARD_ARGB32);
- surface = glitz_surface_create (data->glitz_drawable, format,
- new_width, new_height, 0, NULL);
- glitz_surface_attach (surface, data->glitz_drawable,
- GLITZ_DRAWABLE_BUFFER_FRONT_COLOR);
- data->cairo_surface = cairo_glitz_surface_create (surface);
- glitz_surface_destroy (surface);
-}
-
-static cairo_t *
-game_gnome_board_glitz_begin_paint (GameGnomeBoard *board, gpointer datap)
-{
- GlitzData *data = datap;
-
- return cairo_create (data->cairo_surface);
-}
-
-static void
-game_gnome_board_glitz_end_paint (GameGnomeBoard *board, gpointer datap)
-{
- GlitzData *data = datap;
-
- if (data->glitz_format->doublebuffer) {
- glitz_drawable_swap_buffers (data->glitz_drawable);
- } else {
- glitz_drawable_flush (data->glitz_drawable);
- }
-}
-
-static const GameGnomeBoardBackend glitz_backend = {
- FALSE,
- game_gnome_board_glitz_realize,
- game_gnome_board_glitz_unrealize,
- game_gnome_board_glitz_resize,
- game_gnome_board_glitz_begin_paint,
- game_gnome_board_glitz_end_paint,
-};
-
-#endif
-
/*** IMAGE BACKEND ***/
static gpointer
@@ -556,10 +436,6 @@ game_gnome_board_set_backend (GameGnomeBoard *board, const char *backend)
board->backend = &gtk_backend;
} else if (g_str_equal (backend, "image")) {
board->backend = &image_backend;
-#ifdef HAVE_GLITZ
- } else if (g_str_equal (backend, "glitz")) {
- board->backend = &glitz_backend;
-#endif
}
gtk_widget_set_double_buffered (GTK_WIDGET (board), board->backend->double_buffered);