struct decor *decor = data;
printf(" decor id %s\n", decor->name);
printf(" anchor.x = %f\n", expression_eval(&decor->space.anchor.x));
+ if (decor->texture.present) {
+ if (decor->texture.internal)
+ printf(" texture internal: %s\n", decor->texture.name);
+ else
+ printf(" texture file: %s\n", decor->texture.name);
+ }
// printf(" anchor (%d %d %d)\n", decor->space.anchor.x, decor->space.anchor.y, decor->space.anchor.z);
// printf(" up (%d %d %d)\n", decor->space.up.x, decor->space.up.y, decor->space.up.z);
if (decor->children)
RrSurfaceColorType gradient;
struct expression expr;
struct variable var;
+ struct texture tex;
+ struct material *matptr;
+ struct box box;
+ struct geometry geometry;
}
%token NORTH NORTHEAST EAST SOUTHEAST SOUTH SOUTHWEST
%token WEST NORTHWEST NONE UNCHANGED
-%token LCB RCB LB RB
+%token LCB RCB LB RB TO
%token LEFT_ARROW RIGHT_ARROW DOUBLE_ARROW
%token SEMICOLON AT COLON DEFAULT NOT
-%token PLUS MINUS STAR SLASH COMMA
+%token PLUS MINUS STAR SLASH COMMA BOX
%token <string> STRING ID
%token <integer> NUMBER SUBST BULK BIG LITTLE
%token THEME FRAME SPACE GEOMETRY MATERIAL GRADIENT
%token CONTEXT CURSOR UP ANCHOR STYLE TEXTURE OPACITY
-%token SHAPEOF DECOR DOT
+%token SHAPEOF DECOR DOT IMAGE
%type <decor> decor
%type <decor> decoritems styleitem
%type <space> space
%type <gradient> gradient
%type <expr> expression
%type <var> variable
-
+%type <tex> texture image texitems
+%type <matptr> material_use
+%type <box> box
+%type <geometry> geometry geometry_item
%left PLUS MINUS
%left STAR SLASH
%left LB
shape : SHAPEOF LB ID RB
;
+box : BOX LB expression COMMA expression COMMA expression RB TO
+ LB expression COMMA expression COMMA expression RB {
+
+ }
+ ;
+
geometry_item : /* empty */
| shape
+ | box { $$.box = $1; }
;
-geometry : GEOMETRY LCB geometry_item RCB
+geometry : GEOMETRY LCB geometry_item RCB {
+ $$ = $3;
+ }
;
material_use : MATERIAL LB ID RB {
- if (g_hash_table_lookup(pc->target->materials, $3) == NULL) {
+ $$ = g_hash_table_lookup(pc->target->materials, $3);
+ if ($$ == NULL) {
snprintf(pc->error_buf, 4000, "No definition for material '%s'\n", $3);
obthemeerror(pc, pc->error_buf);
return 1;
$$.space.up.y.v.number = 1;
$$.space.up.z.op = OB_THEME_EQL;
$$.space.up.z.v.number = 1;
+ $$.texture.present = 0;
+ $$.material = NULL;
}
| decoritems decor {
struct decor *out = malloc(sizeof(struct decor));
$$.children = g_slist_append($1.children, out);
}
| decoritems space { $1.space = $2; $$ = $1; }
- | decoritems material_use
- | decoritems geometry
- | decoritems texture
- | decoritems context { $1.context = $2; }
- | decoritems cursor { $1.cursor = $2; }
+ | decoritems material_use { $1.material = $2; $$ = $1; }
+ | decoritems geometry { $1.geometry = $2; $$ = $1;}
+ | decoritems texture { $1.texture = $2; $$ = $1; } //XXX multitexture?
+ | decoritems context { $1.context = $2; $$ = $1; }
+ | decoritems cursor { $1.cursor = $2; $$ = $1; }
;
;
}
;
-texture : TEXTURE LCB RCB
+image : IMAGE LB STRING RB {
+ $$.present = 1;
+ $$.internal = 0;
+ $$.name = $3;
+ }
+ | IMAGE LB ID RB {
+ $$.present = 1;
+ $$.internal = 1;
+ $$.name = $3;
+ }
+ ;
+
+texitems : image { $$ = $1; }
+ ;
+
+texture : TEXTURE LCB texitems RCB { $$ = $3; }
;
context : CONTEXT LB ID RB {
style regular_window {
decor clientwindow {
space {
- anchor(1 + client.width + 1/3* 9/2, 0, 0)
+ anchor(0, 0, 0)
up(0, 0, 0)
}
geometry {
shapeof(client)
}
material(flat)
- texture { //$CLIENT.contents
+ texture {
+ image(client)
}
decor titlebar {
context(titlebar)
geometry {
- // box (0, 0, 0) to (.1 * client.width / (4/client.width), 100%, 0)
+ box (0, 0, 0) to (client.width, font.height + 5, 0)
}
material(flat)
-//texture {
+
decor title {
geometry {
+ box (client.width / 4, font.height + 5, 0) to (3*client.width / 4, font.height + 5, 0)
// text(client.title)
// justify(center)
}
}
decor minbutton {
+ geometry {
+ box (0, 0, 0) to (10, 10, 0)
+ }
material(none)
context(minimize)
}