summaryrefslogtreecommitdiff
path: root/examples/viewer-x.h
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-06 11:25:14 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-06 11:25:14 +0000
commit8c71138ba5500a3d1bf446357992e8f165101173 (patch)
treea453bbcc0fba741aba3b3e16074933407f60dccc /examples/viewer-x.h
parent9f81790eaec937ced41c31fb6204d63a377a00a7 (diff)
downloadpango-8c71138ba5500a3d1bf446357992e8f165101173.tar.gz
Bug 328067 – Install pango-view
2006-02-06 Behdad Esfahbod <behdad@gnome.org> Bug 328067 – Install pango-view Added a rather generic framework for a pango-view example. All backends have their own pango*-view built, and a pango-view binary is built too, that can choose backend via --backend. This one is installed in bindir. * examples/Makefile.am: Updated, to build pangox-view, pangoft2-view, pangoxft-view, pangocairo-view, and pango-view. * examples/viewer.h, examples/viewer-x.c, examples/viewer-x.h examples/viewer-cairo.c, examples/viewer-cairo.h, examples/viewer-main.c, examples/viewer-pangox.c, examples/viewer-pangoft2.c, examples/viewer-pangoxft.c, examples/viewer-pangocairo.c, examples/pango-view.c, examples/pango-xview.c, examples/pango-ft2view.c, examples/pango-xftview.c, examples/pango-cairoview.c: Added. * examples/cairoview.c, examples/xftview.c, examples/pangoft2topgm.c, examples/viewer-qt.cc, examples/viewer-qt.h: Removed. * configure.in: Check for Cairo Xlib backend, also AC_DEFINE various backend bits.
Diffstat (limited to 'examples/viewer-x.h')
-rw-r--r--examples/viewer-x.h64
1 files changed, 45 insertions, 19 deletions
diff --git a/examples/viewer-x.h b/examples/viewer-x.h
index 83c40358..71c1279e 100644
--- a/examples/viewer-x.h
+++ b/examples/viewer-x.h
@@ -1,4 +1,4 @@
-/* viewer-x.h: Common code X-based rendering demos
+/* viewer-x.h: Common headers for X-based viewers
*
* Copyright (C) 1999,2004,2005 Red Hat, Inc.
* Copyright (C) 2001 Sun Microsystems
@@ -18,27 +18,53 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#ifndef VIEWER_X_H
+#define VIEWER_X_H
#include <pango/pango.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-/* to be implemented by the backend-specific part */
-
-void do_init (Display *display,
- int screen,
- int dpi,
- /* output */
- PangoContext **context,
- int *width,
- int *height);
-
-void do_render (Display *display,
- int screen,
- Window window,
- Pixmap pixmap,
- PangoContext *context,
- int width,
- int height,
- gboolean show_borders);
+#include "viewer.h"
+
+
+typedef struct
+{
+ Display *display;
+ int screen;
+} XViewer;
+
+
+extern const PangoViewer x_viewer;
+
+void x_view_init (gpointer instance,
+ const PangoViewer *klass);
+
+gpointer x_view_create (const PangoViewer *klass);
+
+void x_view_destroy (gpointer instance);
+
+gpointer x_view_create_surface (gpointer instance,
+ int width,
+ int height);
+
+void x_view_destroy_surface (gpointer instance,
+ gpointer surface);
+
+gpointer x_view_create_window (gpointer instance,
+ const char *title,
+ int width,
+ int height);
+
+void x_view_destroy_window (gpointer instance,
+ gpointer window);
+
+gpointer x_view_display (gpointer instance,
+ gpointer surface,
+ gpointer window,
+ int width,
+ int height,
+ gpointer state);
+
+#endif /* VIEWER_X_H */