From: ellson Date: Wed, 28 Jun 2006 02:49:58 +0000 (+0000) Subject: -Txlib nearly working X-Git-Tag: LAST_LIBGRAPH~32^2~6222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4827ac87c516db706330f9a8fda72a51befb7b5f;p=graphviz -Txlib nearly working --- diff --git a/plugin/pango/Makefile.am b/plugin/pango/Makefile.am index 5b5897231..4f56686fe 100644 --- a/plugin/pango/Makefile.am +++ b/plugin/pango/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/gvc \ -I$(top_srcdir)/lib/graph \ -I$(top_srcdir)/lib/cdt \ - $(PANGOCAIRO_CFLAGS) $(LIBGVC_CFLAGS) + $(PANGOCAIRO_CFLAGS) noinst_LTLIBRARIES = libgvplugin_pango_C.la diff --git a/plugin/pango/gvrender_pango.c b/plugin/pango/gvrender_pango.c index 76711ba87..5464f82a5 100644 --- a/plugin/pango/gvrender_pango.c +++ b/plugin/pango/gvrender_pango.c @@ -125,12 +125,8 @@ static void cairogen_begin_page(GVJ_t * job) fedisableexcept(FE_ALL_EXCEPT); #endif - if (job->external_surface) { + if (job->surface) cr = (cairo_t *) job->surface; - assert(cr); - - cairo_save(cr); - } switch (job->render.id) { #ifdef CAIRO_HAS_PNG_FUNCTIONS @@ -196,6 +192,7 @@ static void cairogen_begin_page(GVJ_t * job) } job->surface = (void *) cr; + cairo_save(cr); cairo_scale(cr, job->scale.x, job->scale.y); cairo_rotate(cr, job->rotation * M_PI / 180.); cairo_translate(cr, job->translation.x, job->translation.y); @@ -440,14 +437,13 @@ static gvrender_features_t cairogen_features_ps = { "cairo", /* gvloadimage target for usershapes */ }; -#if 0 static gvrender_features_t cairogen_features_x = { GVRENDER_DOES_TRUECOLOR | GVRENDER_Y_GOES_DOWN | GVRENDER_DOES_TRANSFORM | GVRENDER_X11_EVENTS, /* flags */ 0, /* default margin - points */ - {96.,96.}, /* default dpi */ + {72.,72.}, /* default dpi */ 0, /* knowncolors */ 0, /* sizeof knowncolors */ RGBA_DOUBLE, /* color_type */ @@ -461,7 +457,7 @@ static gvrender_features_t cairogen_features_gtk = { | GVRENDER_DOES_TRANSFORM | GVRENDER_X11_EVENTS, /* flags */ 0, /* default margin - points */ - {96.,96.}, /* default dpi */ + {72.,72.}, /* default dpi */ 0, /* knowncolors */ 0, /* sizeof knowncolors */ RGBA_DOUBLE, /* color_type */ @@ -469,7 +465,6 @@ static gvrender_features_t cairogen_features_gtk = { "cairo", /* gvloadimage target for usershapes */ }; #endif -#endif gvplugin_installed_t gvrender_pango_types[] = { #ifdef HAVE_PANGOCAIRO @@ -485,7 +480,6 @@ gvplugin_installed_t gvrender_pango_types[] = { #ifdef CAIRO_HAS_SVG_SURFACE {FORMAT_SVG, "svg", -10, &cairogen_engine, &cairogen_features_ps}, #endif -#if 0 #ifdef CAIRO_HAS_XCB_SURFACE {FORMAT_XCB, "xcb", 0, &cairogen_engine, &cairogen_features_x}, #endif @@ -505,7 +499,6 @@ gvplugin_installed_t gvrender_pango_types[] = { {FORMAT_GTK, "gtk", 0, &cairogen_engine, &cairogen_features_gtk}, {FORMAT_XLIB, "xlib", 0, &cairogen_engine, &cairogen_features_x}, #endif -#endif #endif {0, NULL, 0, NULL, NULL} }; diff --git a/plugin/xlib/Makefile.am b/plugin/xlib/Makefile.am index 1d1289839..5c45d9531 100644 --- a/plugin/xlib/Makefile.am +++ b/plugin/xlib/Makefile.am @@ -3,18 +3,23 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ - $(PANGOCAIRO_CFLAGS) \ - $(LIBGVC_CFLAGS) + -I$(top_srcdir)/lib/common \ + -I$(top_srcdir)/lib/pathplan \ + -I$(top_srcdir)/lib/gvc \ + -I$(top_srcdir)/lib/graph \ + -I$(top_srcdir)/lib/cdt \ + $(PANGOCAIRO_CFLAGS) if WITH_X -lib_LTLIBRARIES = libgvplugin_xlib.la -endif +noinst_LTLIBRARIES = libgvplugin_xlib_C.la -libgvplugin_xlib_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined +pkglib_LTLIBRARIES = libgvplugin_xlib.la +endif -libgvplugin_xlib_la_SOURCES = \ +libgvplugin_xlib_C_la_SOURCES = \ gvplugin_xlib.c \ gvdevice_xlib.c -libgvplugin_xlib_la_LIBADD = \ - $(PANGOCAIRO_LIBS) +libgvplugin_xlib_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined +libgvplugin_xlib_la_SOURCES = $(libgvplugin_xlib_C_la_SOURCES) +libgvplugin_xlib_la_LIBADD = @PANGOCAIRO_LIBS@ diff --git a/plugin/xlib/gvdevice_xlib.c b/plugin/xlib/gvdevice_xlib.c index a3c78b711..bb843e8a2 100644 --- a/plugin/xlib/gvdevice_xlib.c +++ b/plugin/xlib/gvdevice_xlib.c @@ -48,7 +48,7 @@ #include #include -#include +#include "gvplugin_device.h" typedef struct window_xlib_s { Window win; @@ -420,6 +420,7 @@ static void finalize(GVJ_t *firstjob) KeyCode *keycodes; static char *dir; char *p, *cwd = NULL; + struct timeval timeout; FD_ZERO(&rfds); @@ -480,6 +481,13 @@ static void finalize(GVJ_t *firstjob) for (job = firstjob; job; job = job->next_active) init_window(job, dpy, scr); + ret = handle_xlib_events(firstjob, dpy); + + /* FIXME - poll for initial expose event */ + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + select(0, NULL, NULL, NULL, &timeout); + xlib_fd = XConnectionNumber(dpy); /* This is the event loop */