aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog24
-rw-r--r--configure.ac1
-rw-r--r--data/themes/Default/theme.xml37
-rw-r--r--data/themes/Makefile.am5
-rw-r--r--data/themes/PngSample/Makefile.am5
-rw-r--r--data/themes/PngSample/template.png (renamed from data/themes/PngSample/background.png)bin22170 -> 22170 bytes
-rw-r--r--data/themes/PngSample/theme.xml38
-rw-r--r--doc/MBWM2-Overview.xml28
-rw-r--r--matchbox/managers/maemo/theme/Makefile.am4
-rw-r--r--matchbox/managers/maemo/theme/template.png (renamed from matchbox/managers/maemo/theme/background.png)bin24222 -> 24222 bytes
-rw-r--r--matchbox/managers/maemo/theme/theme.xml60
-rw-r--r--matchbox/theme-engines/mb-wm-theme.c36
12 files changed, 160 insertions, 78 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b63cc9..1c504e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,29 @@
2008-03-09 Robert Bragg <bob@o-hand.com>
+ * matchbox/theme-engines/mb-wm-theme.c
+ Some theme.xml schema changes. clr-* now color-*
+ All x/y width/height attributes related to specifying regions within
+ a template image are now prefixed template-*
+
+ * doc/MBWM2-Overview.xml
+ Documentation updated in lines with schema changes
+
+ * matchbox/managers/maemo/theme/theme.xml
+ * matchbox/managers/maemo/theme/background.png
+ * matchbox/managers/maemo/theme/Makefile.am
+ * data/themes/Default/theme.xml
+ * data/themes/PngSample/theme.xml
+ * data/themes/PngSample/background.png
+ * data/themes/PngSample/Makefile.am
+ Existing themes updated to use the new attribute names and
+ background.png images have been renamed to template.png
+
+ * configure.ac
+ * data/themes/Makefile.am
+ Install the PngSample theme by default if PNG theme engine enabled
+
+2008-03-09 Robert Bragg <bob@o-hand.com>
+
* configure.ac
fix for clutter composite manager: glib main loop had accidentally
been disabled
diff --git a/configure.ac b/configure.ac
index 9109abf..6006c51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,6 +289,7 @@ matchbox/theme-engines/Makefile
data/Makefile
data/themes/Makefile
data/themes/Default/Makefile
+data/themes/PngSample/Makefile
data/libmatchbox2.pc
doc/Makefile
util/Makefile
diff --git a/data/themes/Default/theme.xml b/data/themes/Default/theme.xml
index cf498ed..c3b170b 100644
--- a/data/themes/Default/theme.xml
+++ b/data/themes/Default/theme.xml
@@ -1,22 +1,33 @@
<?xml version="1.0"?>
<theme name="Default" author="Tomas Frydrych, tf@o-hand.com"
desc="" version="1.0" engine-version="2" engine-type="default"
- shadow-type="gaussian" clr-shadow="#44444444">
+ shadow-type="gaussian" color-shadow="#44444444">
<img src="test.png" />
<client type="app">
<transition type="fade" duration="200" />
- <effect event="minimize" duration="300" gravity="ne" type="scale-down" />
- <effect event="map" duration="100" gravity="e" type="slide-in" />
- <effect event="unmap" duration="100" gravity="none" type="fade" />
- <decor type="north" clr-bg="#ff0000" clr-bg2="#ffffff" clr-fg="#ffffff"
-height="22" font-family="Sans" font-size="18" clr-frame="#000000">
- <button type="close" packing="end" clr-fg="#ffffff" clr-bg="#59595f"
- width="18" height="18" x="2" y="2"/>
- <button type="minimize" packing="end" clr-fg="#ffffff" clr-bg="#59595f"
- width="18" height="18" x="2" y="2"/>
- <button type="menu" packing="start" clr-fg="#ffffff" clr-bg="#59595f"
- width="18" height="18" x="2" y="2"/>
+
+ <effect event="minimize" duration="300" gravity="ne" type="scale-down" />
+ <effect event="map" duration="100" gravity="e" type="slide-in" />
+ <effect event="unmap" duration="100" gravity="none" type="fade" />
+
+ <decor type="north"
+ color-bg="#ff0000" color-bg2="#ffffff" color-fg="#ffffff"
+ template-height="22"
+ font-family="Sans" font-size="18" color-frame="#000000">
+ <button type="close" packing="end"
+ color-fg="#ffffff" color-bg="#59595f"
+ template-x="2" template-y="2"
+ width="18" height="18"/>
+ <button type="minimize" packing="end"
+ color-fg="#ffffff" color-bg="#59595f"
+ template-x="2" template-y="2"
+ width="18" height="18"/>
+ <button type="menu" packing="start"
+ color-fg="#ffffff" color-bg="#59595f"
+ template-x="2" template-y="2"
+ width="18" height="18"/>
</decor>
</client>
-</theme> \ No newline at end of file
+</theme>
+
diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am
index f20f87f..9ddff07 100644
--- a/data/themes/Makefile.am
+++ b/data/themes/Makefile.am
@@ -1 +1,6 @@
SUBDIRS=Default
+
+if THEME_PNG
+SUBDIRS+=PngSample
+endif
+
diff --git a/data/themes/PngSample/Makefile.am b/data/themes/PngSample/Makefile.am
new file mode 100644
index 0000000..5ce55a2
--- /dev/null
+++ b/data/themes/PngSample/Makefile.am
@@ -0,0 +1,5 @@
+
+themesdir = $(datadir)/themes/PngSample/matchbox2
+themes_DATA = theme.xml template.png
+
+EXTRA_DIST = theme.xml template.png
diff --git a/data/themes/PngSample/background.png b/data/themes/PngSample/template.png
index 11ccafa..11ccafa 100644
--- a/data/themes/PngSample/background.png
+++ b/data/themes/PngSample/template.png
Binary files differ
diff --git a/data/themes/PngSample/theme.xml b/data/themes/PngSample/theme.xml
index 5cfe3cb..05032aa 100644
--- a/data/themes/PngSample/theme.xml
+++ b/data/themes/PngSample/theme.xml
@@ -1,21 +1,37 @@
<?xml version="1.0"?>
<theme name="Default" author="Tomas Frydrych, tf@o-hand.com"
desc="" version="1.0" engine-version="2" engine-type="png">
-<img src="background.png" />
+<img src="template.png" />
<client type="app">
- <decor type="north" clr-fg="#ffffff" x="0" y="0" width="320"
-height="20" font-family="Sans" font-size="12" clr-frame="#000000">
- <button type="close" width="16" height="16" x="302" y="2"/>
- <button type="minimize" width="16" height="16" x="284" y="2"/>
- <button type="menu" width="16" height="16" x="2" y="2"/>
+ <decor type="north" color-fg="#ffffff"
+ template-x="0" template-y="0"
+ template-width="320" template-height="20"
+ font-family="Sans" font-size="12" color-frame="#000000">
+ <button type="close"
+ template-x="302" template-y="2"
+ width="16" height="16"/>
+ <button type="minimize"
+ template-x="284" template-y="2"
+ width="16" height="16"/>
+ <button type="menu"
+ template-x="2" template-y="2"
+ width="16" height="16"/>
</decor>
</client>
<client type="dialog">
- <decor type="north" x="83" y="73" width="146" height="3" />
- <decor type="south" x="83" y="190" width="146" height="3" />
- <decor type="west" x="83" y="76" width="3" height="114" />
- <decor type="east" x="263" y="76" width="3" height="114" />
+ <decor type="north"
+ template-x="83" template-y="73"
+ template-width="146" template-height="3"/>
+ <decor type="south"
+ template-x="83" template-y="190"
+ template-width="146" template-height="3"/>
+ <decor type="west"
+ template-x="83" template-y="76"
+ template-width="3" template-height="114"/>
+ <decor type="east"
+ template-x="263" template-y="76"
+ template-width="3" template-height="114"/>
</client>
-</theme> \ No newline at end of file
+</theme>
diff --git a/doc/MBWM2-Overview.xml b/doc/MBWM2-Overview.xml
index 16756c9..3c5e480 100644
--- a/doc/MBWM2-Overview.xml
+++ b/doc/MBWM2-Overview.xml
@@ -581,19 +581,19 @@
</listitem>
<listitem>
- <para>x: for PNG-based themes this is the the x coordinates of the
+ <para>template-x: for PNG-based themes this is the the x coordinates of the
decor in the image; ignored for other theme engines.
</para>
</listitem>
<listitem>
- <para>y: for PNG-based themes this is the the y coordinates of the
+ <para>template-y: for PNG-based themes this is the the y coordinates of the
decor in the image; ignored for other theme engines.
</para>
</listitem>
<listitem>
- <para>width: width of the decor. For PNG themes this value has to
+ <para>template-width: width of the decor. For PNG themes this value has to
be given explicitly, and is the width of the decor in the image
(if actual decor is wider than this value, the image will be
expanded by tiling the middle section); for other themes, it has
@@ -603,7 +603,7 @@
</listitem>
<listitem>
- <para>height: height of the decor. For PNG themes this value has
+ <para>template-height: height of the decor. For PNG themes this value has
to be given explicitly, and is the height of the decor in the
image (if actual decor is taller than this value, the image will
be expanded by tiling the middle section); for other themes, it
@@ -623,12 +623,12 @@
</listitem>
<listitem>
- <para>clr-fg: the foreground colour to use.
+ <para>color-fg: the foreground colour to use.
</para>
</listitem>
<listitem>
- <para>clr-bg: the basic background colour. If a background color
+ <para>color-bg: the basic background colour. If a background color
is specfied for a PNG based theme, the decor will be first filled
with this color, and then the PNG image will be composited over
it; in this case, the images for any buttons must be located of
@@ -638,14 +638,14 @@
</listitem>
<listitem>
- <para>clr-bg2: secondary background colour. This could be used by
+ <para>color-bg2: secondary background colour. This could be used by
a theme engine to create gradiented background; ignored by current
theme engines.
</para>
</listitem>
<listitem>
- <para>clr-frame: colour to use for drawing a frame around the
+ <para>color-frame: colour to use for drawing a frame around the
client window (non-PNG engines only).
</para>
</listitem>
@@ -676,14 +676,14 @@
</listitem>
<listitem>
- <para>x: for PNG-based themes this is the the x coordinates of
+ <para>template-x: for PNG-based themes this is the the x coordinates of
the button in the image; the button must be located directly on
the parent decor. Ignored for other theme engines.
</para>
</listitem>
<listitem>
- <para>y: for PNG-based themes this is the the y coordinates of
+ <para>template-y: for PNG-based themes this is the the y coordinates of
the button in the image; the button must be located directly on
the parent decor. Ignored for other theme engines.
</para>
@@ -700,7 +700,7 @@
</listitem>
<listitem>
- <para>inactive-x: for PNG-based themes this is the the x
+ <para>template-inactive-x: for PNG-based themes this is the the x
coordinates of the button in inactive state in the image;
ignored for other theme engines. (The inactive image can be
located directly on the decor image, in which case, this
@@ -709,7 +709,7 @@
</listitem>
<listitem>
- <para>inactive-y: for PNG-based themes this is the the y
+ <para>template-inactive-y: for PNG-based themes this is the the y
coordinates of the button in inactive state in the image;
ignored for other theme engines. (The inactive image can be
located directly on the decor image, in which case, this
@@ -718,14 +718,14 @@
</listitem>
<listitem>
- <para>active-x: for PNG-based themes this is the the x
+ <para>template-active-x: for PNG-based themes this is the the x
coordinates of the button in active state in the image; ignored
for other theme engines.
</para>
</listitem>
<listitem>
- <para>active-y: for PNG-based themes this is the the y
+ <para>template-active-y: for PNG-based themes this is the the y
coordinates of the button in active state in the image; ignored
for other theme engines.
</para>
diff --git a/matchbox/managers/maemo/theme/Makefile.am b/matchbox/managers/maemo/theme/Makefile.am
index 6c11484..3c32322 100644
--- a/matchbox/managers/maemo/theme/Makefile.am
+++ b/matchbox/managers/maemo/theme/Makefile.am
@@ -1,6 +1,6 @@
themesdir = $(datadir)/themes/Default/matchbox2
-themes_DATA = theme.xml background.png
+themes_DATA = theme.xml template.png
-EXTRA_DIST = theme.xml background.png
+EXTRA_DIST = theme.xml template.png
diff --git a/matchbox/managers/maemo/theme/background.png b/matchbox/managers/maemo/theme/template.png
index 5ebb9be..5ebb9be 100644
--- a/matchbox/managers/maemo/theme/background.png
+++ b/matchbox/managers/maemo/theme/template.png
Binary files differ
diff --git a/matchbox/managers/maemo/theme/theme.xml b/matchbox/managers/maemo/theme/theme.xml
index f752397..f0160fc 100644
--- a/matchbox/managers/maemo/theme/theme.xml
+++ b/matchbox/managers/maemo/theme/theme.xml
@@ -1,37 +1,57 @@
<?xml version="1.0"?>
<theme name="Mockup Maemo theme" author="Tomas Frydrych, tf@o-hand.com"
desc="" version="1.0" engine-version="2" engine-type="png" shaped="yes">
-<img src="background.png" />
+<img src="template.png" />
<client type="app">
- <decor type="north" show-title="yes"
- clr-fg="#ffffff" clr-frame="#000000"
- x="0" y="0" width="720" height="60"
+ <decor type="north" show-title="yes" color-fg="#ffffff" color-frame="#000000"
+ template-x="0" template-y="0"
+ template-width="720" template-height="60"
font-family="Sans" font-size="20">
- <button type="close" width="26" height="26" x="680" y="17"
- active-x="680" active-y="64"/>
- <button type="minimize" width="26" height="26" x="650" y="17"
- active-x="650" active-y="64"/>
- <button type="menu" width="20" height="20" x="9" y="17"
- active-x="628" active-y="64"
+ <button type="close"
+ template-x="680" template-y="17"
+ width="26" height="26"
+ template-active-x="680" template-active-y="64"/>
+ <button type="minimize"
+ template-x="650" template-y="17"
+ template-active-x="650" template-active-y="64"
+ width="26" height="26"/>
+ <button type="menu"
+ template-x="9" template-y="17"
+ template-active-x="628" template-active-y="64"
+ width="20" height="20"
press-activated="yes"/>
-
</decor>
</client>
<client type="dialog" shaped="yes">
<decor type="north" show-title="yes"
- x="4" y="66" width="207" height="43" />
- <decor type="south" x="4" y="119" width="207" height="5" />
- <decor type="west" x="4" y="109" width="6" height="9" />
- <decor type="east" x="205" y="109" width="6" height="9" />
+ template-x="4" template-y="66"
+ template-width="207" template-height="43"/>
+ <decor type="south"
+ template-x="4" template-y="119"
+ template-width="207" template-height="5"/>
+ <decor type="west"
+ template-x="4" template-y="109"
+ template-width="6" template-height="9"/>
+ <decor type="east"
+ template-x="205" template-y="109"
+ template-width="6" template-height="9"/>
</client>
<client type="notification" shaped="yes">
<decor type="north"
- x="215" y="104" width="207" height="5" />
- <decor type="south" x="215" y="119" width="207" height="5" />
- <decor type="west" x="215" y="109" width="6" height="9" />
- <decor type="east" x="416" y="109" width="6" height="9" />
+ template-x="215" template-y="104"
+ template-width="207" template-height="5"/>
+ <decor type="south"
+ template-x="215" template-y="119"
+ template-width="207" template-height="5"/>
+ <decor type="west"
+ template-x="215" template-y="109"
+ template-width="6" template-height="9"/>
+ <decor type="east"
+ template-x="416" template-y="109"
+ template-width="6" template-height="9"/>
</client>
-</theme> \ No newline at end of file
+</theme>
+
diff --git a/matchbox/theme-engines/mb-wm-theme.c b/matchbox/theme-engines/mb-wm-theme.c
index e26b04e..8619fbb 100644
--- a/matchbox/theme-engines/mb-wm-theme.c
+++ b/matchbox/theme-engines/mb-wm-theme.c
@@ -863,7 +863,7 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
if (!strcmp (*(p+1), "yes") || !strcmp (*(p+1), "1"))
exd->shaped = 1;
}
- else if (!strcmp (*p, "clr-shadow"))
+ else if (!strcmp (*p, "color-shadow"))
{
mb_wm_xml_clr_from_string (&clr, *(p+1));
@@ -876,7 +876,7 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
exd->color_shadow.set = True;
}
}
- else if (!strcmp (*p, "clr-lowlight"))
+ else if (!strcmp (*p, "color-lowlight"))
{
mb_wm_xml_clr_from_string (&clr, *(p+1));
@@ -1073,13 +1073,13 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
while (*p)
{
- if (!strcmp (*p, "clr-fg"))
+ if (!strcmp (*p, "color-fg"))
mb_wm_xml_clr_from_string (&d->clr_fg, *(p+1));
- else if (!strcmp (*p, "clr-bg"))
+ else if (!strcmp (*p, "color-bg"))
mb_wm_xml_clr_from_string (&d->clr_bg, *(p+1));
- else if (!strcmp (*p, "clr-bg2"))
+ else if (!strcmp (*p, "color-bg2"))
mb_wm_xml_clr_from_string (&d->clr_bg2, *(p+1));
- else if (!strcmp (*p, "clr-frame"))
+ else if (!strcmp (*p, "color-frame"))
mb_wm_xml_clr_from_string (&d->clr_frame, *(p+1));
else if (!strcmp (*p, "type"))
{
@@ -1092,19 +1092,19 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
else if (!strcmp (*(p+1), "west"))
d->type = MBWMDecorTypeWest;
}
- else if (!strcmp (*p, "width"))
+ else if (!strcmp (*p, "template-width"))
{
d->width = atoi (*(p+1));
}
- else if (!strcmp (*p, "height"))
+ else if (!strcmp (*p, "template-height"))
{
d->height = atoi (*(p+1));
}
- else if (!strcmp (*p, "x"))
+ else if (!strcmp (*p, "template-x"))
{
d->x = atoi (*(p+1));
}
- else if (!strcmp (*p, "y"))
+ else if (!strcmp (*p, "template-y"))
{
d->y = atoi (*(p+1));
}
@@ -1172,9 +1172,9 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
while (*p)
{
- if (!strcmp (*p, "clr-fg"))
+ if (!strcmp (*p, "color-fg"))
mb_wm_xml_clr_from_string (&b->clr_fg, *(p+1));
- else if (!strcmp (*p, "clr-bg"))
+ else if (!strcmp (*p, "color-bg"))
mb_wm_xml_clr_from_string (&b->clr_bg, *(p+1));
else if (!strcmp (*p, "type"))
{
@@ -1198,11 +1198,11 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
else if (!strcmp (*(p+1), "start"))
b->packing = MBWMDecorButtonPackStart;
}
- else if (!strcmp (*p, "x"))
+ else if (!strcmp (*p, "template-x"))
{
b->x = atoi (*(p+1));
}
- else if (!strcmp (*p, "y"))
+ else if (!strcmp (*p, "template-y"))
{
b->y = atoi (*(p+1));
}
@@ -1214,19 +1214,19 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
{
b->height = atoi (*(p+1));
}
- else if (!strcmp (*p, "active-x"))
+ else if (!strcmp (*p, "template-active-x"))
{
b->active_x = atoi (*(p+1));
}
- else if (!strcmp (*p, "active-y"))
+ else if (!strcmp (*p, "template-active-y"))
{
b->active_y = atoi (*(p+1));
}
- else if (!strcmp (*p, "inactive-x"))
+ else if (!strcmp (*p, "template-inactive-x"))
{
b->inactive_x = atoi (*(p+1));
}
- else if (!strcmp (*p, "inactive-y"))
+ else if (!strcmp (*p, "template-inactive-y"))
{
b->inactive_y = atoi (*(p+1));
}