summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Sourada <martin.sourada@gmail.com>2008-08-05 20:57:06 (GMT)
committerMartin Sourada <martin.sourada@gmail.com>2008-08-05 20:57:06 (GMT)
commit11c515d5fe4d64fc5fc3c601bd1480c51aad2692 (patch)
treec05c152b2a7d979def08993f950d27602972f6d2
parentbafecaae81d96288d263ec6344b4df0d200c38ca (diff)
downloadnodoka-11c515d5fe4d64fc5fc3c601bd1480c51aad2692.zip
nodoka-11c515d5fe4d64fc5fc3c601bd1480c51aad2692.tar.gz
nodoka-11c515d5fe4d64fc5fc3c601bd1480c51aad2692.tar.xz
Add "style" engine option.
- Can be set to CLASSIC, MODERN or GLOSSY, default is MODERN. - Currently has no effect. Prepare files for style-specific draw functions. - Currently empty and not included in build sripts.
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.c0
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.h0
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.c0
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.h0
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.c0
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.h0
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.c55
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.h2
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_style.c2
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_style.h2
-rw-r--r--gtk-nodoka-engine/src/GTKEngine/nodoka_types.h7
11 files changed, 68 insertions, 0 deletions
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.c b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.c
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.h b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_classic.h
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.c b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.c
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.h b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_glossy.h
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.c b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.c
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.h b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_draw_modern.h
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.c b/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.c
index 5f8505c..455331a 100644
--- a/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.c
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.c
@@ -22,6 +22,7 @@
#include "nodoka_style.h"
#include "nodoka_rc_style.h"
+#include "nodoka_types.h"
#include "animation.h"
@@ -43,6 +44,10 @@ GType nodoka_type_rc_style = 0;
enum
{
TOKEN_SCROLLBARCOLOR = G_TOKEN_LAST + 1,
+ TOKEN_STYLE,
+ TOKEN_STYLE_CLASSIC,
+ TOKEN_STYLE_MODERN,
+ TOKEN_STYLE_GLOSSY,
TOKEN_CONTRAST,
TOKEN_HILIGHT_RATIO,
TOKEN_ROUNDNESS,
@@ -75,6 +80,14 @@ theme_symbols[] =
{
"scrollbar_color", TOKEN_SCROLLBARCOLOR},
{
+ "style", TOKEN_STYLE},
+ {
+ "CLASSIC", TOKEN_STYLE_CLASSIC},
+ {
+ "MODERN", TOKEN_STYLE_MODERN},
+ {
+ "GLOSSY", TOKEN_STYLE_GLOSSY},
+ {
"contrast", TOKEN_CONTRAST},
{
"hilight_ratio", TOKEN_HILIGHT_RATIO},
@@ -139,6 +152,7 @@ nodoka_rc_style_init (NodokaRcStyle * nodoka_rc)
{
nodoka_rc->flags = 0;
+ nodoka_rc->style = NDK_STYLE_MODERN;
nodoka_rc->has_scrollbar_color = FALSE;
nodoka_rc->contrast = 1.0;
nodoka_rc->hilight_ratio = 0.909090909;
@@ -191,6 +205,40 @@ nodoka_rc_style_class_init (NodokaRcStyleClass * klass)
}
static guint
+theme_parse_style_type (GtkSettings * settings, GScanner * scanner,
+ NodokaStyleType * retval)
+{
+ guint token;
+
+ /* Skip 'style' */
+ token = g_scanner_get_next_token (scanner);
+
+ token = g_scanner_get_next_token (scanner);
+ if (token != G_TOKEN_EQUAL_SIGN)
+ return G_TOKEN_EQUAL_SIGN;
+
+ token = g_scanner_get_next_token (scanner);
+
+ switch (token)
+ {
+ case TOKEN_STYLE_CLASSIC:
+ *retval = NDK_STYLE_CLASSIC;
+ break;
+ case TOKEN_STYLE_MODERN:
+ *retval = NDK_STYLE_MODERN;
+ break;
+ case TOKEN_STYLE_GLOSSY:
+ *retval = NDK_STYLE_GLOSSY;
+ break;
+ default:
+ return TOKEN_STYLE;
+ break;
+ }
+
+ return G_TOKEN_NONE;
+}
+
+static guint
theme_parse_boolean (GtkSettings * settings,
GScanner * scanner, gboolean * retval)
{
@@ -339,6 +387,11 @@ nodoka_rc_style_parse (GtkRcStyle * rc_style,
{
switch (token)
{
+ case TOKEN_STYLE:
+ token = theme_parse_style_type (settings, scanner,
+ &nodoka_style->style);
+ nodoka_style->flags |= NDK_FLAG_STYLE;
+ break;
case TOKEN_SCROLLBARCOLOR:
token =
theme_parse_color (settings, scanner,
@@ -468,6 +521,8 @@ nodoka_rc_style_merge (GtkRcStyle * dest, GtkRcStyle * src)
flags = (~dest_w->flags) & src_w->flags;
+ if (flags & NDK_FLAG_STYLE)
+ dest_w->style = src_w->style;
if (flags & NDK_FLAG_SCROLLBAR_COLOR)
{
dest_w->has_scrollbar_color = TRUE;
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.h b/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.h
index 30d5378..4f6e307 100644
--- a/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.h
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_rc_style.h
@@ -51,6 +51,7 @@ typedef enum
NDK_FLAG_BULLETCOLOR = 1 << 12,
NDK_FLAG_FOCUSINNER = 1 << 13,
NDK_FLAG_FOCUSFILL = 1 << 14,
+ NDK_FLAG_STYLE = 1 << 15,
} NodokaRcFlags;
struct _NodokaRcStyle
@@ -59,6 +60,7 @@ struct _NodokaRcStyle
NodokaRcFlags flags;
+ NodokaStyleType style;
GdkColor scrollbar_color;
gboolean has_scrollbar_color;
double contrast;
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_style.c b/gtk-nodoka-engine/src/GTKEngine/nodoka_style.c
index e40e694..6351f9f 100644
--- a/gtk-nodoka-engine/src/GTKEngine/nodoka_style.c
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_style.c
@@ -1554,6 +1554,7 @@ nodoka_style_init_from_rc (GtkStyle * style, GtkRcStyle * rc_style)
contrast = NODOKA_RC_STYLE (rc_style)->contrast;
nodoka_style->hilight_ratio = NODOKA_RC_STYLE (rc_style)->hilight_ratio;
+ nodoka_style->style = NODOKA_RC_STYLE (rc_style)->style;
nodoka_style->roundness = NODOKA_RC_STYLE (rc_style)->roundness;
nodoka_style->menubarstyle = NODOKA_RC_STYLE (rc_style)->menubarstyle;
nodoka_style->toolbarstyle = NODOKA_RC_STYLE (rc_style)->toolbarstyle;
@@ -1796,6 +1797,7 @@ nodoka_style_copy (GtkStyle * style, GtkStyle * src)
NodokaStyle *ndk_src = NODOKA_STYLE (src);
ndk_style->colors = ndk_src->colors;
+ ndk_style->style = ndk_src->style;
ndk_style->hilight_ratio = ndk_src->hilight_ratio;
ndk_style->roundness = ndk_src->roundness;
ndk_style->progressbarstyle = ndk_src->progressbarstyle;
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_style.h b/gtk-nodoka-engine/src/GTKEngine/nodoka_style.h
index 13befba..8c87b2d 100644
--- a/gtk-nodoka-engine/src/GTKEngine/nodoka_style.h
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_style.h
@@ -43,6 +43,8 @@ struct _NodokaStyle
NodokaColors colors;
+ NodokaStyleType style;
+
double hilight_ratio;
guint8 roundness;
diff --git a/gtk-nodoka-engine/src/GTKEngine/nodoka_types.h b/gtk-nodoka-engine/src/GTKEngine/nodoka_types.h
index 3a5c6e8..53f2f24 100644
--- a/gtk-nodoka-engine/src/GTKEngine/nodoka_types.h
+++ b/gtk-nodoka-engine/src/GTKEngine/nodoka_types.h
@@ -28,6 +28,13 @@ typedef unsigned char uint8;
typedef enum
{
+ NDK_STYLE_CLASSIC,
+ NDK_STYLE_MODERN,
+ NDK_STYLE_GLOSSY
+} NodokaStyleType;
+
+typedef enum
+{
NDK_STATE_NORMAL,
NDK_STATE_ACTIVE,
NDK_STATE_SELECTED,