summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-02-03 20:23:19 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-02-03 20:23:19 +0000
commit7782bba2c87b79bff8fa4e62ed84b95b74574617 (patch)
tree79d989164f0c8ab27e825ef98ef3c47a14c39228 /examples
parentc7e3de50fdaec8436fd78b229bbdf04c6c9271d3 (diff)
downloadpango-7782bba2c87b79bff8fa4e62ed84b95b74574617.tar.gz
Open the file with mode "wb", include cairo-png.h.
2005-02-03 Owen Taylor <otaylor@redhat.com> * examples/cairosimple.c: Open the file with mode "wb", include cairo-png.h. * examples/xftview.c examples/cairoview.c: Set WM_NORMAL_HINTS to avoid triggering a metacity bug. * examples/cairoview.c: Include cairo-xlib.h. * configure.in: Add checks for the Win32 Cairo backend. (not committing the code yet). * examples/Makefile.am pango/Makefile.am: add CAIRO_CFLAGS. * pango/pangocairo-fc.h pango/pangocairo-fcfont.c pango/pangocairo-fcfontmap.c pango/pangofc-fontmap.[ch]: Rework Cairo/Fontconfig backend to use the current Cairo API. Make some PangoFcFontMap changes to enable that. * pango/pango/pangocairo-private.h pango/pangocairo-render.c: Update for cairo_font_t changes.
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile.am2
-rw-r--r--examples/cairosimple.c3
-rw-r--r--examples/cairoview.c9
-rw-r--r--examples/xftview.c8
4 files changed, 20 insertions, 2 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 88979360..dce8b604 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -7,7 +7,7 @@ INCLUDES = \
-DPANGO_DISABLE_DEPRECATED \
$(PANGO_DEBUG_FLAGS) \
-I$(top_srcdir) \
- $(QT_INCLUDES) \
+ $(CAIRO_CFLAGS) \
$(GLIB_CFLAGS) \
$(XFT_CFLAGS) \
$(FREETYPE_CFLAGS)
diff --git a/examples/cairosimple.c b/examples/cairosimple.c
index 1ec7edf2..49528995 100644
--- a/examples/cairosimple.c
+++ b/examples/cairosimple.c
@@ -1,5 +1,6 @@
#include <math.h>
#include <pango/pangocairo.h>
+#include <cairo-png.h>
static void
draw_text (cairo_t *cr)
@@ -64,7 +65,7 @@ int main (int argc, char **argv)
return 1;
}
- f = fopen (argv[1], "w");
+ f = fopen (argv[1], "wb");
if (!f)
{
g_printerr ("Usage: cannot open '%s'\n", argv[1]);
diff --git a/examples/cairoview.c b/examples/cairoview.c
index ec285432..9d5f9ff8 100644
--- a/examples/cairoview.c
+++ b/examples/cairoview.c
@@ -29,6 +29,7 @@
#include "renderdemo.h"
#include <pango/pangocairo.h>
+#include <cairo-xlib.h>
static pixman_region16_t *update_region = NULL;
static PangoContext *context;
@@ -204,6 +205,7 @@ int main (int argc, char **argv)
XEvent xev;
unsigned long bg;
int width, height;
+ XSizeHints size_hints;
RenderData render_data;
unsigned int quit_keycode;
unsigned int borders_keycode;
@@ -237,6 +239,13 @@ int main (int argc, char **argv)
XmbSetWMProperties (display, window,
get_options_string (),
NULL, NULL, 0, NULL, NULL, NULL);
+
+ memset ((char *)&size_hints, 0, sizeof (XSizeHints));
+ size_hints.flags = PSize | PMaxSize;
+ size_hints.width = width; size_hints.height = height; /* for compat only */
+ size_hints.max_width = width; size_hints.max_height = height;
+
+ XSetWMNormalHints (display, window, &size_hints);
borders_keycode = XKeysymToKeycode(display, 'B');
quit_keycode = XKeysymToKeycode(display, 'Q');
diff --git a/examples/xftview.c b/examples/xftview.c
index c559c8ee..0bfcec04 100644
--- a/examples/xftview.c
+++ b/examples/xftview.c
@@ -96,6 +96,7 @@ int main (int argc, char **argv)
XEvent xev;
unsigned long bg;
int width, height;
+ XSizeHints size_hints;
g_type_init();
@@ -126,6 +127,13 @@ int main (int argc, char **argv)
get_options_string (),
NULL, NULL, 0, NULL, NULL, NULL);
+ memset ((char *)&size_hints, 0, sizeof (XSizeHints));
+ size_hints.flags = PSize | PMaxSize;
+ size_hints.width = width; size_hints.height = height; /* for compat only */
+ size_hints.max_width = width; size_hints.max_height = height;
+
+ XSetWMNormalHints (display, window, &size_hints);
+
while (1)
{
if (!XPending (display) && update_region)