aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
authorlecoanet2001-11-12 10:00:42 +0000
committerlecoanet2001-11-12 10:00:42 +0000
commit3b3701f044ef47166cc224e82d199e363dfc0a75 (patch)
tree95c0490c16996d785a960df9970693e51a08d113 /generic/tkZinc.c
parent708edd284f45b7728388c13159d6be977605b73a (diff)
downloadtkzinc-3b3701f044ef47166cc224e82d199e363dfc0a75.zip
tkzinc-3b3701f044ef47166cc224e82d199e363dfc0a75.tar.gz
tkzinc-3b3701f044ef47166cc224e82d199e363dfc0a75.tar.bz2
tkzinc-3b3701f044ef47166cc224e82d199e363dfc0a75.tar.xz
Ajout des commandes de nommage des gradients (gname, gdelete).
Correction du bug d'expose.
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c59
1 files changed, 48 insertions, 11 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index 82b4ce0..8d372e7 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -50,6 +50,7 @@ static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ "
#include "Track.h"
#include "Transfo.h"
#include "Image.h"
+#include "Color.h"
#include "perfos.h"
#ifdef GPC
#include "gpc/gpc.h"
@@ -561,7 +562,7 @@ ZincObjCmd(ClientData client_data, /* Main window associated with
wi->render = False;
}
else {
-#if PRINT_CONFIG
+#ifdef PRINT_CONFIG
printf(" Visual : 0x%x, ", (int) wi->gl_visual->visualid);
glXGetConfig(wi->dpy, wi->gl_visual, GLX_RGBA, &val);
printf("RGBA : %d, ", val);
@@ -2456,8 +2457,8 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
"add", "addtag", "anchorxy", "bbox", "becomes", "bind",
"cget", "chggroup", "clone", "configure", "contour",
"coords", "currentpart", "cursor", "dchars",
- "dtag", "find", "fit", "focus", "gettags", "group",
- "hasanchors", "hasfields", "hastag",
+ "dtag", "find", "fit", "focus", "gdelete", "gettags",
+ "gname", "group", "hasanchors", "hasfields", "hastag",
"index", "insert", "itemcget", "itemconfigure",
"lower", "monitor", "numparts", "postscript", "raise",
"remove", "rotate", "scale", "select", "smooth",
@@ -2468,8 +2469,8 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
ZN_W_ADD, ZN_W_ADDTAG, ZN_W_ANCHORXY, ZN_W_BBOX, ZN_W_BECOMES, ZN_W_BIND,
ZN_W_CGET, ZN_W_CHGGROUP, ZN_W_CLONE, ZN_W_CONFIGURE,
ZN_W_CONTOUR, ZN_W_COORDS, ZN_W_CURRENTPART, ZN_W_CURSOR, ZN_W_DCHARS,
- ZN_W_DTAG, ZN_W_FIND, ZN_W_FIT, ZN_W_FOCUS, ZN_W_GETTAGS, ZN_W_GROUP,
- ZN_W_HASANCHORS, ZN_W_HASFIELDS, ZN_W_HASTAG,
+ ZN_W_DTAG, ZN_W_FIND, ZN_W_FIT, ZN_W_FOCUS, ZN_W_GDELETE, ZN_W_GETTAGS,
+ ZN_W_GNAME, ZN_W_GROUP, ZN_W_HASANCHORS, ZN_W_HASFIELDS, ZN_W_HASTAG,
ZN_W_INDEX, ZN_W_INSERT, ZN_W_ITEMCGET, ZN_W_ITEMCONFIGURE,
ZN_W_LOWER, ZN_W_MONITOR, ZN_W_NUMPARTS, ZN_W_POSTSCRIPT, ZN_W_RAISE,
ZN_W_REMOVE, ZN_W_ROTATE, ZN_W_SCALE, ZN_W_SELECT, ZN_W_SMOOTH,
@@ -3104,6 +3105,18 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
break;
/*
+ * gdelete
+ */
+ case ZN_W_GDELETE:
+ {
+ if (argc != 3) {
+ Tcl_WrongNumArgs(interp, 1, args, "gdelete gName");
+ goto error;
+ }
+ ZnDeleteGradientName(Tcl_GetString(args[2]));
+ }
+ break;
+ /*
* gettags
*/
case ZN_W_GETTAGS:
@@ -3133,6 +3146,25 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
break;
/*
+ * gname
+ */
+ case ZN_W_GNAME:
+ {
+ ZnBool ok;
+
+ if (argc != 4) {
+ Tcl_WrongNumArgs(interp, 1, args, "gname grad gName");
+ goto error;
+ }
+ ok = ZnNameGradient(interp, wi->win, Tcl_GetString(args[2]), Tcl_GetString(args[3]));
+ if (!ok) {
+ Tcl_AppendResult(interp, "gradient name \"", Tcl_GetString(args[3]),
+ "\", already in use or incorrect specification", NULL);
+ goto error;
+ }
+ }
+ break;
+ /*
* group
*/
case ZN_W_GROUP:
@@ -4371,7 +4403,7 @@ Event(ClientData client_data, /* Information about widget. */
/*glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, r);*/
glGetFloatv(GL_SMOOTH_POINT_SIZE_RANGE, r);
wi->max_point_width = r[1];
-#if PRINT_CONFIG
+#ifdef PRINT_CONFIG
printf("OpenGL version %s\n", (char *) glGetString(GL_VERSION));
printf(" Moteur de rendu : %s, ", (char *) glGetString(GL_RENDERER));
printf(" Fabriquant : %s\n", (char *) glGetString(GL_VENDOR));
@@ -5347,18 +5379,22 @@ Redisplay(ClientData client_data) /* Information about the widget. */
ISSET(wi->events_flags, INTERNAL_NEED_REPICK));
/*
- * Repair the scene where it is no longer up to date,
- * then merge the repaired area with the exposed area
- * and send it back to the screen.
+ * Merge the repaired area with the exposed area.
*/
- ITEM_P.Repair(wi);
-
ResetBBox(&merge);
CopyBBox(&wi->damaged_area, &merge);
wi->damaged_area_w = wi->damaged_area.corner.x-wi->damaged_area.orig.x;
wi->damaged_area_h = wi->damaged_area.corner.y-wi->damaged_area.orig.y;
AddBBoxToBBox(&merge, &wi->exposed_area);
+ /*
+ * Repair the scene where it is no longer up to date,
+ * then send the merged area back to the screen.
+ */
if (!IsEmptyBBox(&merge)) {
+ if (wi->render || !IsEmptyBBox(&wi->damaged_area)) {
+ ITEM_P.Repair(wi);
+ }
+
BBox2XRect(&merge, &r);
if (wi->render) {
#ifdef GLX
@@ -5900,6 +5936,7 @@ MapInfoObjCmd(ClientData client_data,
coords[1], coords[2]);
}
}
+ break;
case ZN_E_TEXT:
{
if (argc != (num_param+5)) {