aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/Item.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/generic/Item.c b/generic/Item.c
index 456f814..89656d2 100644
--- a/generic/Item.c
+++ b/generic/Item.c
@@ -78,7 +78,7 @@ typedef struct _FieldStruct {
char *image_name;
char *tile_name;
ZnFont font;
- unsigned char flags;
+ unsigned short flags;
Border border_edges;
ZnJustify alignment;
ReliefStyle relief;
@@ -363,10 +363,11 @@ ConfigureAttributes(char *record,
desc = attr_desc;
while (True) {
if (desc->type == ZN_CONFIG_END) {
- /*printf("ERROR: record <0x%X>\n", record);*/
- Tcl_AppendResult(wi->interp, "unknown attribute \"",
- Tcl_GetString(args[i]), "\"", NULL);
- return ZN_ERROR;
+ /*
+ * No attribute found, do _not_ report an error
+ * this is very counter productive when using tags.
+ */
+ break;
}
else if (attr_uid == desc->uid) {
if (desc->read_only) {
@@ -493,8 +494,8 @@ ConfigureAttributes(char *record,
Tcl_GetString(args[i]), "\"", NULL);
return ZN_ERROR;
}
- if (b ^ (ISSET(*((char *) valp), desc->bool_bit) != 0)) {
- ASSIGN(*((char *) valp), desc->bool_bit, b);
+ if (b ^ (ISSET(*((unsigned short *) valp), desc->bool_bit) != 0)) {
+ ASSIGN(*((unsigned short *) valp), desc->bool_bit, b);
*flags |= desc->flags;
}
break;
@@ -1287,7 +1288,7 @@ AttributeToObj(WidgetInfo *wi,
}
break;
case ZN_CONFIG_BOOL:
- Tcl_SetBooleanObj(result, ISSET(*((char *) valp), desc->bool_bit)?1:0);
+ Tcl_SetBooleanObj(result, ISSET(*((unsigned short *) valp), desc->bool_bit)?1:0);
break;
case ZN_CONFIG_PATTERN:
if (*((Pixmap *) valp)) {
@@ -2876,7 +2877,7 @@ CloneItem(Item model)
item->transfo = ZnTransfoDuplicate(item->transfo);
}
- /* Call item's clone duplicate not shared resources */
+ /* Call item's clone to duplicate non shared resources */
item->class->Clone(item);
SET(wi->events_flags, INTERNAL_NEED_REPICK);
@@ -3891,8 +3892,11 @@ CloneFields(FieldSet field_set)
if (field->gradient) {
field->gradient = ZnGetGradientByValue(field->gradient);
}
- field->grad_geo = NULL;
-
+ if (field->grad_geo) {
+ ZnPoint *grad_geo = ZnMalloc(4*sizeof(ZnPoint));
+ memcpy(grad_geo, field->grad_geo, 4*sizeof(ZnPoint));
+ field->grad_geo = grad_geo;
+ }
if (field->image != ZnUnspecifiedImage) {
text = ZnMalloc((strlen(field->image_name) + 1) * sizeof(char));
strcpy(text, field->image_name);
@@ -4840,7 +4844,6 @@ Repair(WidgetInfo *wi)
#endif
glXMakeCurrent(wi->dpy, ZnWindowId(wi->win), wi->gl_context);
-
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
#if 0
@@ -4957,7 +4960,6 @@ Repair(WidgetInfo *wi)
glEnable(GL_SCISSOR_TEST);
#endif
}
-
/* Switch the GL buffers. */
glXSwapBuffers(wi->dpy, ZnWindowId(wi->win));
glFlush();