aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlecoanet2001-01-04 10:48:21 +0000
committerlecoanet2001-01-04 10:48:21 +0000
commit4650e4ce6c3ff004249db6e684c783f74dc4820e (patch)
treeeb556faa71ccc8aa98d0564e257cb22a18266e98
parente4e6cd076aacae005af8347e3199c75e1cfd42aa (diff)
downloadtkzinc-4650e4ce6c3ff004249db6e684c783f74dc4820e.zip
tkzinc-4650e4ce6c3ff004249db6e684c783f74dc4820e.tar.gz
tkzinc-4650e4ce6c3ff004249db6e684c783f74dc4820e.tar.bz2
tkzinc-4650e4ce6c3ff004249db6e684c783f74dc4820e.tar.xz
Ajout de la compilation conditionnelle de libart
-rw-r--r--Makefile.in4
-rw-r--r--generic/Arc.c18
-rw-r--r--generic/Curve.c14
-rw-r--r--generic/Group.c6
-rw-r--r--generic/Icon.c2
-rw-r--r--generic/Image.c6
-rw-r--r--generic/Image.h7
-rw-r--r--generic/Item.c8
-rw-r--r--generic/Item.h4
-rw-r--r--generic/OverlapMan.c2
-rw-r--r--generic/Rectangle.c14
-rw-r--r--generic/Text.c10
-rw-r--r--generic/WidgetInfo.h6
13 files changed, 88 insertions, 13 deletions
diff --git a/Makefile.in b/Makefile.in
index 26301eb..ffbad64 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -84,8 +84,8 @@ ART=-lart_lgpl
# PERFOS compile performance measurement code
# PROFILE ask for profile support
# OM include code for internal overlap manager
-# SHM include code that need shared memory support (such as
-# local rendering).
+# SHM include code that need shared memory support
+# LIBART include code that need the libart rendering lib
# SHAPE include code for reshaping windows.
# GPC include code for composing polygons.
#
diff --git a/generic/Arc.c b/generic/Arc.c
index 10bcb9c..f3699c8 100644
--- a/generic/Arc.c
+++ b/generic/Arc.c
@@ -92,8 +92,10 @@ typedef struct _ArcItemStruct {
ZnPoint center2;
ZnImage tile;
ZnList render_shape;
+#ifdef LIBART
ArtSVP *outline_svp;
ArtSVP *fill_svp;
+#endif
} ArcItemStruct, *ArcItem;
@@ -240,8 +242,10 @@ Init(Item item,
arc->line_alpha = 255;
arc->line_color = ZnGetColorByValue(wi->win, wi->fore_color);
arc->grad_geom = NULL;
+#ifdef LIBART
arc->outline_svp = arc->fill_svp = NULL;
-
+#endif
+
return ZN_OK;
}
@@ -286,7 +290,9 @@ Clone(Item item)
if (arc->grad_geom) {
arc->grad_geom = GradientGeomDuplicate(arc->grad_geom);
}
+#ifdef LIBART
arc->outline_svp = arc->fill_svp = NULL;
+#endif
arc->render_shape = NULL;
}
@@ -307,12 +313,14 @@ Destroy(Item item)
if (arc->render_shape) {
ZnListFree(arc->render_shape);
}
+#ifdef LIBART
if (arc->outline_svp) {
art_svp_free(arc->outline_svp);
}
if (arc->fill_svp) {
art_svp_free(arc->fill_svp);
}
+#endif
if (arc->first_end) {
LineEndDelete(arc->first_end);
}
@@ -526,7 +534,7 @@ ComputeCoordinates(Item item,
width_2 = (arc->coords[1].x - arc->coords[0].x)/2.0;
height_2 = (arc->coords[1].y - arc->coords[0].y)/2.0;
if (((angle >= PRECISION_LIMIT) && ((width_2 - height_2) > PRECISION_LIMIT)) ||
- arc->grad_geom || wi->local_render) {
+ arc->grad_geom || wi->render) {
SET(arc->flags, USING_POLY_BIT);
if (!arc->render_shape) {
arc->render_shape = ZnListNew(4, sizeof(ZnPoint));
@@ -569,7 +577,8 @@ ComputeCoordinates(Item item,
AddPointsToBBox(&item->item_bounding_box, end_points, LINE_END_POINTS);
}
- if (wi->local_render) {
+ if (wi->render) {
+#ifdef LIBART
ArtVpath *vpath;
GetBezierPath(arc->render_shape, wi->work_pts);
@@ -607,6 +616,7 @@ ComputeCoordinates(Item item,
arc->line_width, 2, 1);
}
ZnFree(vpath);
+#endif
}
return;
}
@@ -1219,6 +1229,7 @@ Draw(Item item)
static void
Render(Item item)
{
+#ifdef LIBART
WidgetInfo *wi = item->wi;
ArcItem arc = (ArcItem) item;
XColor *color = ZnColorGradientMidColor(wi->win, arc->fill_color);
@@ -1239,6 +1250,7 @@ Render(Item item)
arc->line_color->green, arc->line_color->blue,
arc->line_alpha & 0xff, 0, 0, NULL);
}
+#endif
}
diff --git a/generic/Curve.c b/generic/Curve.c
index ab18ce5..8b43a36 100644
--- a/generic/Curve.c
+++ b/generic/Curve.c
@@ -96,8 +96,10 @@ typedef struct _CurveItemStruct {
ZnImage tile;
ZnPoly dev_shape;
ZnColorGradient gradient;
+#ifdef LIBART
ArtSVP *outline_svp;
ArtSVP *fill_svp;
+#endif
#ifdef GPC
gpc_tristrip tristrip;
#endif
@@ -286,7 +288,9 @@ Init(Item item,
cv->line_color = ZnGetColorByValue(wi->win, wi->fore_color);
cv->marker_color = ZnGetColorByValue(wi->win, wi->fore_color);
cv->grad_geom = NULL;
+#ifdef LIBART
cv->outline_svp = cv->fill_svp = NULL;
+#endif
return ZN_OK;
}
@@ -365,7 +369,9 @@ Clone(Item item)
if (cv->grad_geom) {
cv->grad_geom = GradientGeomDuplicate(cv->grad_geom);
}
+#ifdef LIBART
cv->outline_svp = cv->fill_svp = NULL;
+#endif
}
@@ -421,12 +427,14 @@ Destroy(Item item)
gpc_free_tristrip(&cv->tristrip);
}
#endif
+#ifdef LIBART
if (cv->outline_svp) {
art_svp_free(cv->outline_svp);
}
if (cv->fill_svp) {
art_svp_free(cv->fill_svp);
}
+#endif
}
@@ -717,7 +725,8 @@ ComputeCoordinates(Item item,
* PLC Rendering works only with one contour, no relief, no markers,
* round ends, round joins.
*/
- if (wi->local_render) {
+ if (wi->render) {
+#ifdef LIBART
ArtVpath *vpath;
c1 = cv->dev_shape.contours;
@@ -754,6 +763,7 @@ ComputeCoordinates(Item item,
lw, 2, 1);
}
ZnFree(vpath);
+#endif
}
if (ISSET(cv->flags, RELIEF_OK)) {
@@ -1241,6 +1251,7 @@ Draw(Item item)
static void
Render(Item item)
{
+#ifdef LIBART
WidgetInfo *wi = item->wi;
CurveItem cv = (CurveItem) item;
XColor *color = ZnColorGradientMidColor(wi->win, cv->fill_color);
@@ -1260,6 +1271,7 @@ Render(Item item)
cv->line_color->green, cv->line_color->blue,
cv->line_alpha & 0xff, 0, 0, NULL);
}
+#endif
}
diff --git a/generic/Group.c b/generic/Group.c
index 67b30fa..85e6fd4 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -854,7 +854,9 @@ Render(Item item)
WidgetInfo *wi = item->wi;
Item current_item;
ZnBBox bbox, old_damaged_area, *clip_box;
+#ifdef LIBART
RenderBuf buf;
+#endif
PushTransform(item);
PushClip(group, True);
@@ -863,6 +865,7 @@ Render(Item item)
old_damaged_area = wi->damaged_area;
IntersectBBox(&wi->damaged_area, clip_box, &bbox);
wi->damaged_area = bbox;
+#ifdef LIBART
buf = wi->buf;
wi->buf.ox = (int) wi->damaged_area.orig.x;
wi->buf.oy = (int) wi->damaged_area.orig.y;
@@ -870,6 +873,7 @@ Render(Item item)
wi->buf.cy = (int) wi->damaged_area.corner.y;
wi->buf.buf += ((wi->buf.oy - buf.oy) * buf.rowstride +
(wi->buf.ox - buf.ox) * 3);
+#endif
}
current_item = group->tail;
@@ -891,7 +895,9 @@ Render(Item item)
if (group->clip != ZN_NO_ITEM) {
wi->damaged_area = old_damaged_area;
+#ifdef LIBART
wi->buf = buf;
+#endif
}
PopClip(group, True);
PopTransform(item);
diff --git a/generic/Icon.c b/generic/Icon.c
index c9635a1..407302f 100644
--- a/generic/Icon.c
+++ b/generic/Icon.c
@@ -537,6 +537,7 @@ Draw(Item item)
static void
Render(Item item)
{
+#ifdef LIBART
WidgetInfo *wi = item->wi;
IconItem icon = (IconItem) item;
@@ -559,6 +560,7 @@ Render(Item item)
bitmap->pixels, icon->pos_dev.x, icon->pos_dev.y,
bitmap->width, bitmap->height, bitmap->rowstride, rgba);
}
+#endif
}
diff --git a/generic/Image.c b/generic/Image.c
index 63f5daa..33d7c8c 100644
--- a/generic/Image.c
+++ b/generic/Image.c
@@ -94,9 +94,11 @@ GetImageBits(ZnWindow win,
else {
Tk_SizeOfImage(image, &width, &height);
im_bits = (ImageBits *) ZnMalloc(sizeof(ImageBits));
+#ifdef LIBART
#ifdef SHM
im_bits->pixbuf = NULL;
#endif
+#endif
im_bits->pixmaps = NULL;
im_bits->b_bits = NULL;
pmap = XCreatePixmap(dpy, ZnWindowId(win), width, height, depth);
@@ -198,11 +200,13 @@ InvalidateImage(char *image_name)
ZnFree(im_bits->b_bits->pixels);
ZnFree(im_bits->b_bits);
}
+#ifdef LIBART
#ifdef SHM
if (im_bits->pixbuf) {
art_pixbuf_free(im_bits->pixbuf);
}
#endif
+#endif
ZnFree(im_bits);
Tcl_DeleteHashEntry(entry);
}
@@ -439,6 +443,7 @@ GetFontBitmap(ZnWindow win,
}
+#ifdef LIBART
static void
rgb_text_opaque(art_u8 *dst,
int x0, int y0, int x1, int y1, int dst_rowstride,
@@ -1353,3 +1358,4 @@ GetImagePixbuf(ZnWindow win,
return im_bits->pixbuf;
}
#endif
+#endif
diff --git a/generic/Image.h b/generic/Image.h
index b98619b..66d73a7 100644
--- a/generic/Image.h
+++ b/generic/Image.h
@@ -30,8 +30,9 @@
#ifndef _Image_h
#define _Image_h
-
+#ifdef LIBART
#include <libart_lgpl/libart.h>
+#endif
#include "Types.h"
@@ -51,7 +52,7 @@ typedef struct {
int width;
int height;
struct _ImagePixmap *pixmaps;
-#ifdef SHM
+#ifdef LIBART
ArtPixBuf *pixbuf;
#endif
} ImageBits;
@@ -92,6 +93,7 @@ FontBitmap *
GetFontBitmap(ZnWindow win,
ZnFont font);
+#ifdef LIBART
void
rgb_text(art_u8 *dst,
int x0, int y0, int x1, int y1, int dst_rowstride,
@@ -124,6 +126,7 @@ GetImagePixbuf(ZnWindow /* win */,
char */* image_name */,
ZnImage /* image */);
#endif
+#endif
#endif /* _Image_h */
diff --git a/generic/Item.c b/generic/Item.c
index c0f3cb3..1a08044 100644
--- a/generic/Item.c
+++ b/generic/Item.c
@@ -4462,6 +4462,7 @@ Update(WidgetInfo *wi)
}
+#ifdef LIBART
#ifdef SHM
static void
EnsureRGBBuf(WidgetInfo *wi,
@@ -4585,6 +4586,7 @@ RGBToXImage(WidgetInfo *wi,
}
}
#endif
+#endif
static void
Repair(WidgetInfo *wi)
@@ -4614,7 +4616,8 @@ Repair(WidgetInfo *wi)
XStartChrono(draw_time, wi->dpy, wi->draw_buffer);
/*StartChrono(int_draw_time);*/
#endif
- if (wi->local_render) {
+ if (wi->render) {
+#ifdef LIBART
/* if (wi->tile == ZnUnspecifiedImage) {
* }
* else {
@@ -4630,6 +4633,7 @@ Repair(WidgetInfo *wi)
wi->back_color->blue >> 8);
wi->top_group->class->Render(wi->top_group);
RGBToXImage(wi, r.x, r.y, r.width, r.height);
+#endif
}
else {
/* Fill the background of the double buffer pixmap. */
@@ -4703,7 +4707,9 @@ struct _ITEM_P ITEM_P = {
PushClip,
PopClip,
CurrentClip,
+#ifdef LIBART
RenderSVP
+#endif
};
struct _ITEM ITEM = {
diff --git a/generic/Item.h b/generic/Item.h
index 2bba924..85031f2 100644
--- a/generic/Item.h
+++ b/generic/Item.h
@@ -36,7 +36,9 @@
#include "List.h"
#include <X11/Xlib.h>
+#ifdef LIBART
#include <libart_lgpl/libart.h>
+#endif
#define DEFAULT_TRACK_PRIORITY 5
@@ -291,8 +293,10 @@ extern struct _ITEM_P {
void (*PopClip)(struct _WidgetInfo *wi, ZnBool set_gc);
ZnBool (*CurrentClip)(struct _WidgetInfo *wi, Region *reg, ZnBBox **clip_box,
ZnBool *simple);
+#ifdef LIBART
void (*RenderSVP)(struct _WidgetInfo *wi, ArtSVP *svp, int r, int g,
int b, int a, int tile_x, int tile_y, ArtPixBuf *tile);
+#endif
} ITEM_P;
diff --git a/generic/OverlapMan.c b/generic/OverlapMan.c
index 769e395..5d6e8ca 100644
--- a/generic/OverlapMan.c
+++ b/generic/OverlapMan.c
@@ -581,7 +581,7 @@ SetupLeaderPosition(int iw,
int jp;
double alpha;
BOOLEAN ok = FALSE;
- double dx, dy;
+ double dx = 0, dy = 0;
Fx0 = 0.0;
Fy0 = 0.0;
diff --git a/generic/Rectangle.c b/generic/Rectangle.c
index f2b3d68..6723631 100644
--- a/generic/Rectangle.c
+++ b/generic/Rectangle.c
@@ -77,8 +77,10 @@ typedef struct _RectangleItemStruct {
ZnPoint dev[4];
ZnImage tile;
ZnColorGradient gradient;
+#ifdef LIBART
ArtSVP *outline_svp;
ArtSVP *fill_svp;
+#endif
} RectangleItemStruct, *RectangleItem;
@@ -211,7 +213,9 @@ Init(Item item,
ZnNameOfColor(wi->fore_color));
rect->fill_alpha = 255;
rect->grad_geom = NULL;
+#ifdef LIBART
rect->outline_svp = rect->fill_svp = NULL;
+#endif
return ZN_OK;
}
@@ -254,7 +258,9 @@ Clone(Item item)
if (rect->grad_geom) {
rect->grad_geom = GradientGeomDuplicate(rect->grad_geom);
}
+#ifdef LIBART
rect->outline_svp = rect->fill_svp = NULL;
+#endif
}
@@ -292,12 +298,14 @@ Destroy(Item item)
if (rect->grad_geom) {
GradientGeomDelete(rect->grad_geom);
}
+#ifdef LIBART
if (rect->outline_svp) {
art_svp_free(rect->outline_svp);
}
if (rect->fill_svp) {
art_svp_free(rect->fill_svp);
}
+#endif
}
@@ -425,7 +433,8 @@ ComputeCoordinates(Item item,
item->item_bounding_box.corner.x += 1;
item->item_bounding_box.corner.y += 1;
- if (wi->local_render) {
+ if (wi->render) {
+#ifdef LIBART
ArtVpath vpath[6];
if (ISSET(rect->flags, FILLED_BIT) || rect->line_width) {
@@ -463,6 +472,7 @@ ComputeCoordinates(Item item,
ART_PATH_STROKE_CAP_SQUARE,
rect->line_width, 2, 1);
}
+#endif
}
}
@@ -680,6 +690,7 @@ Draw(Item item)
static void
Render(Item item)
{
+#ifdef LIBART
WidgetInfo *wi = item->wi;
RectangleItem rect = (RectangleItem) item;
XColor *color = ZnColorGradientMidColor(wi->win, rect->fill_color);
@@ -700,6 +711,7 @@ Render(Item item)
rect->line_color->green, rect->line_color->blue,
rect->line_alpha & 0xff, 0, 0, NULL);
}
+#endif
}
diff --git a/generic/Text.c b/generic/Text.c
index 489cd82..b8e7336 100644
--- a/generic/Text.c
+++ b/generic/Text.c
@@ -98,7 +98,9 @@ typedef struct _TextItemStruct {
int insert_index;
ZnList text_info;
int max_width;
+#ifdef LIBART
FontBitmap *fb;
+#endif
} TextItemStruct, *TextItem;
@@ -195,7 +197,9 @@ Init(Item item,
text->font = Tk_GetFont(wi->interp, wi->win, Tk_NameOfFont(wi->font));
text->width = 0;
text->spacing = 0;
+#ifdef LIBART
text->fb = NULL;
+#endif
text->insert_index = 0;
CLEAR(text->flags, UNDERLINED);
@@ -308,10 +312,12 @@ Configure(Item item,
else {
item->connected_item = old_connected;
}
- }
+ }
+#ifdef LIBART
if (old_font != text->font) {
text->fb = NULL;
}
+#endif
return ZN_OK;
}
@@ -760,6 +766,7 @@ Draw(Item item)
static void
Render(Item item)
{
+#ifdef LIBART
WidgetInfo *wi = item->wi;
TextItem text = (TextItem) item;
TextLineInfo lines, lines_ptr;
@@ -785,6 +792,7 @@ Render(Item item)
lines_ptr->start, lines_ptr->num_chars,
tmp_x, tmp_y, text->fb, color);
}
+#endif
}
diff --git a/generic/WidgetInfo.h b/generic/WidgetInfo.h
index 0cbbfdd..16e27c8 100644
--- a/generic/WidgetInfo.h
+++ b/generic/WidgetInfo.h
@@ -188,21 +188,25 @@ typedef struct _WidgetInfo {
Screen *screen;
ZnWindow win; /* The window of the widget. */
ZnBool realized;
+#ifdef LIBART
#ifdef SHM
XImage *draw_buffer_im; /* Image for double buffering */
RenderBuf buf;
#endif
+#endif
Pixmap draw_buffer; /* Pixmap for double buffering */
ZnBBox damaged_area; /* The current damaged rectangle */
GC gc;
ZnBool has_x_shm; /* Tell if the SHM X11 ext is avail. */
ZnBool has_x_shape; /* Tell if the X shape ext. is avail. */
ZnBool has_x_input; /* Tell if the X input ext. is avail. */
- ZnBool local_render; /* Instruct to render to a local image,
+ ZnBool render; /* Instruct to render to a local image,
* using libart. */
+#ifdef LIBART
#ifdef SHM
XShmSegmentInfo x_shm_info;
#endif
+#endif
int events_flags; /* NEED_REPICK et al */
Window real_top;
Item top_group;