added metal theme, fixed pixmap theme now to use pixmap path - and removed

Thu Aug 20 18:25:07 EDT 1998 The Rasterman <raster@redhat.com>
        * added metal theme, fixed pixmap theme now to use pixmap path - and
	removed lots of annoying print's, added gtkr's for each
	theme data.. all your rc needs to do is include these rc's.
This commit is contained in:
EDT 1998 The Rasterman
1998-08-20 22:20:49 +00:00
committed by Carsten Haitzler
parent f54298e6dc
commit d9e68d7ac3
47 changed files with 3736 additions and 33 deletions

View File

@@ -1,3 +1,8 @@
Thu Aug 20 18:25:07 EDT 1998 The Rasterman <raster@redhat.com>
* added metal theme, fixed pixmap theme now to use pixmap path - and
removed lots of annoying print's, added gtkr's for each theme data.. now all
your rc needs to do is include these rc's.
Thu Jul 30 14:51:34 EDT 1998 The Rasterman <raster@redhat.com>
* Moved all the themes to install cleanly the engine *.so's in
$(exec_prefix)/lib/gtk/themes/engines/ .

View File

@@ -64,8 +64,8 @@ VERSION = @VERSION@
########################################################
lib_LTLIBRARIES = libpixmap.la libwin95.la libmotif.la
lib_DATA = pixmap_data win95_data motif_data
lib_LTLIBRARIES = libpixmap.la libwin95.la libmotif.la libmetal.la
lib_DATA = pixmap_data win95_data motif_data metal_data
###### pixmap theme -> libpixmap.so
@@ -88,6 +88,16 @@ libwin95include_HEADERS = \
libwin95_LDFLAGS = -lgdk_imlib -ljpeg -ltiff -lgif -lpng -lz @GTK_LIBS@
###### metal theme -> libmetal.so
libmetal_la_SOURCES = \
metal_theme_draw.c \
metal_theme_main.c
libmetalinclude_HEADERS = \
metal_theme.h
libmetal_LDFLAGS = -lgdk_imlib -ljpeg -ltiff -lgif -lpng -lz @GTK_LIBS@
###### motif theme -> libmotif.so
libmotif_la_SOURCES = \
motif_theme_draw.c \
@@ -118,6 +128,9 @@ libpixmap_la_OBJECTS = pixmap_theme_draw.lo pixmap_theme_main.lo
libwin95_la_LDFLAGS =
libwin95_la_LIBADD =
libwin95_la_OBJECTS = win95_theme_draw.lo win95_theme_main.lo
libmetal_la_LDFLAGS =
libmetal_la_LIBADD =
libmetal_la_OBJECTS = metal_theme_draw.lo metal_theme_main.lo
libmotif_la_LDFLAGS =
libmotif_la_LIBADD =
libmotif_la_OBJECTS = motif_theme_draw.lo motif_theme_main.lo
@@ -135,10 +148,11 @@ GZIP = --best
DEP_FILES = \
.deps/pixmap_theme_draw.P .deps/pixmap_theme_main.P \
.deps/win95_theme_draw.P .deps/win95_theme_main.P \
.deps/metal_theme_draw.P .deps/metal_theme_main.P \
.deps/motif_theme_draw.P .deps/motif_theme_main.P
SOURCES = $(libpixmap_la_SOURCES) $(libwin95_la_SOURCES) $(libmotif_la_SOURCES)
OBJECTS = $(libpixmap_la_OBJECTS) $(libwin95_la_OBJECTS) $(libmotif_la_OBJECTS)
SOURCES = $(libpixmap_la_SOURCES) $(libwin95_la_SOURCES) $(libmetal_la_SOURCES) $(libmotif_la_SOURCES)
OBJECTS = $(libpixmap_la_OBJECTS) $(libwin95_la_OBJECTS) $(libmetal_la_SOURCES) $(libmotif_la_OBJECTS)
all: Makefile $(LTLIBRARIES)
@@ -237,6 +251,10 @@ libwin95.la: $(libwin95_la_OBJECTS) $(libwin95_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libwin95_la_LDFLAGS) $(libwin95_la_OBJECTS) $(libwin95_la_LIBADD) $(LIBS)
libmetal.la: $(libmetal_la_OBJECTS) $(libmetal_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libmetal_la_LDFLAGS) $(libmetal_la_OBJECTS) $(libmetal_la_LIBADD) $(LIBS)
libmotif.la: $(libmotif_la_OBJECTS) $(libmotif_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libmotif_la_LDFLAGS) $(libmotif_la_OBJECTS) $(libmotif_la_LIBADD) $(LIBS)

29
themes/README.metal Normal file
View File

@@ -0,0 +1,29 @@
GTK Metal Look-and-feel Theme
=============================
August 18, 1998
This is a very quick hack to the
initial GTK theme support provided
recently by Red Hat's Rasterman to add
a theme that closely mimics the
"Java Look-and-Feel" (also known
as "Metal").
This is very, very early code and
is not polished at all, and is not
complete, but a number of controls
draw nicely and the color scheme
is more-or-less correct so it
demos well.
I can't offer any formal support for
this at this point - let me know if
you are interested and it may encourage
me to devote more time to it.
Randy Gordon
randy@datachannel.com
rangor@ix.netcom.com

178
themes/metal_data/gtkrc Normal file
View File

@@ -0,0 +1,178 @@
# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
#
# include "rc-file"
#
# style <name> [= <name>]
# {
# <option>
# }
#
# widget <widget_set> style <style_name>
# widget_class <widget_class_set> style <style_name>
# testgtkrc2 sets all the buttons in the main window to blue by default
#include "testgtkrc2"
#module_path ".:/home/raster/themes"
pixmap_path "."
style "default"
{
# font = "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*"
# font = "-adobe-times-medium-r-normal--*-*-*-*-*-*-*-*"
font = "-b&h-lucida-bold-r-normal-sans-12-*-*-*-p-*-iso8859-1"
bg[NORMAL] = { 0.80, 0.80, 0.80 }
fg[NORMAL] = { 0.40, 0.40, 0.60 }
bg[PRELIGHT] = { 0.80, 0.80, 1.00 }
fg[PRELIGHT] = { 0.40, 0.40, 0.60 }
bg[ACTIVE] = { 0.80, 0.80, 0.80 }
fg[ACTIVE] = { 0.40, 0.40, 0.60 }
bg[SELECTED] = { 0.60, 0.60, 0.80 }
fg[SELECTED] = { 0.00, 0.00, 0.00 }
engine "metal"
{
}
}
style "menu"
{
fg[NORMAL] = { 0.00, 0.00, 0.00 }
fg[PRELIGHT] = { 0.00, 0.00, 0.00 }
fg[ACTIVE] = { 0.00, 0.00, 0.00 }
fg[SELECTED] = { 0.00, 0.00, 0.00 }
}
style "list"
{
bg[NORMAL] = { 1.0, 1.0, 1.0 }
bg[ACTIVE] = { 1.0, 1.0, 1.0 }
bg[PRELIGHT] = { 1.0, 1.0, 1.0 }
# bg[PRELIGHT] = { 1.0, 1.0, 1.0 }
}
widget_class "*MenuItem*" style "menu"
#widget_class "*Menu*" style "menu"
widget_class "GtkCTree" style "list"
widget_class "GtkCList" style "list"
style "window"
{
# bg_pixmap[NORMAL] = "warning.xpm"
}
style "scale"
{
# fg[NORMAL] = { 1.0, 0, 0 }
# bg[PRELIGHT] = { 1.0, 1.0, 0 }
# bg_pixmap[NORMAL] = "<parent>"
}
style "button"
{
fg[NORMAL] = { 0.00, 0.00, 0.00 }
fg[PRELIGHT] = { 0.00, 0.00, 0.00 }
fg[ACTIVE] = { 0.00, 0.00, 0.00 }
fg[SELECTED] = { 0.00, 0.00, 0.00 }
# fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
# bg[PRELIGHT] = { 0, 0, 0.75 }
# bg[PRELIGHT] = { 0.75, 0, 0x00 }
}
style "toggle_button" = "button"
{
# fg[NORMAL] = { 1.0, 0, 0 }
# fg[ACTIVE] = { 1.0, 0, 0 }
# bg_pixmap[NORMAL] = "<parent>"
}
style "text"
{
# bg_pixmap[NORMAL] = "marble.xpm"
# text[NORMAL] = { 0.2, 0.2, 1.0 }
fg[NORMAL] = { 1.0, 1.0, 1.0 }
# base[NORMAL] = { 0.0, 0.0, 0.0 }
}
style "slider"
{
# fg[NORMAL] = { 1.0, 1.0, 1.0 }
# bg[NORMAL] = { 0.0, 0.0, 1.0 }
# bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
# bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
}
style "ruler"
{
# font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*'
}
style "curve"
{
# fg[NORMAL] = { 58000, 0, 0 } # red
}
style "red-bar"
{
# bg[PRELIGHT] = { 0.95, .55, 0.55 }
}
# override testgtk2, introduce the green color in the button list
style 'button_list' = 'button'
{
# font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
# bg[PRELIGHT] = { 0, 0.75, 0x00 }
}
widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
# common default
class "GtkWidget" style "default"
class "GtkScrollbar" style "red-bar"
widget_class "GtkWindow" style "window"
widget_class "GtkDialog" style "window"
widget_class "GtkFileSelection" style "window"
widget_class "*Gtk*Scale" style "scale"
widget_class "*GtkCheckButton*" style "toggle_button"
widget_class "*GtkRadioButton*" style "toggle_button"
widget_class "*GtkButton*" style "button"
widget_class "*Ruler" style "ruler"
widget_class "*GtkText" style "text"
widget "*GtkCurve" style "curve"
binding "test1"
{
bind "<ctrl>1" {
"debug-msg" ("hallo and")
"debug-msg" ("huhu")
}
}
binding "test2"
{
bind "<ctrl>1" {
"debug-msg" ("jup!")
}
}
# possible priorities are (in ascending order):
# lowest
# gtk (used by gtk for internal class bindings)
# application (for hard coded bindings on application basis)
# rc (used implicitel by rc files)
# highest
class "GtkButton" binding "test1" # implicit : rc
class "GtkButton" binding : highest "test2" # override "rc" priority
binding "clist-test"
{
bind "j" {
"scroll-vertical" (step-backward, 0.0)
}
bind "k" {
"scroll-vertical" (step-forward, 0.0)
}
}
class "GtkCList" binding "clist-test"

13
themes/metal_theme.h Normal file
View File

@@ -0,0 +1,13 @@
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <gtk/gtkrc.h>
#include <gtk/gtkthemes.h>
#include <gtk/gtkbutton.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>

1894
themes/metal_theme_draw.c Normal file

File diff suppressed because it is too large Load Diff

223
themes/metal_theme_main.c Normal file
View File

@@ -0,0 +1,223 @@
#include "metal_theme.h"
/* Theme functions to export */
void theme_init(GtkThemeEngine * engine);
void theme_exit(void);
/* Exported vtable from th_draw */
extern GtkStyleClass th_default_class;
/* internals */
/* external theme functions called */
typedef struct
{
gchar *name;
}
ThemeRcData;
typedef struct
{
gchar *name;
}
ThemeStyleData;
guint
theme_parse_rc_style(GScanner * scanner,
GtkRcStyle * rc_style)
{
static GQuark scope_id = 0;
ThemeRcData *theme_data;
guint old_scope;
guint token;
/* Set up a new scope in this scanner. */
if (!scope_id)
scope_id = g_quark_from_string("theme_engine");
/* If we bail out due to errors, we *don't* reset the scope, so the
* error messaging code can make sense of our tokens.
*/
old_scope = g_scanner_set_scope(scanner, scope_id);
/* We're ready to go, now parse the top level */
theme_data = g_new(ThemeRcData, 1);
theme_data->name = NULL;
token = g_scanner_peek_next_token(scanner);
while (token != G_TOKEN_RIGHT_CURLY)
{
switch (token)
{
default:
g_scanner_get_next_token(scanner);
token = G_TOKEN_RIGHT_CURLY;
break;
}
if (token != G_TOKEN_NONE)
{
g_free(theme_data);
return token;
}
token = g_scanner_peek_next_token(scanner);
}
g_scanner_get_next_token(scanner);
rc_style->engine_data = theme_data;
g_scanner_set_scope(scanner, old_scope);
return G_TOKEN_NONE;
}
void
theme_merge_rc_style(GtkRcStyle * dest,
GtkRcStyle * src)
{
ThemeRcData *src_data = src->engine_data;
ThemeRcData *dest_data = dest->engine_data;
if (!dest_data)
{
dest_data = g_new(ThemeRcData, 1);
dest_data->name = NULL;
dest->engine_data = dest_data;
}
if (dest_data->name == NULL)
dest_data->name = g_strdup(src_data->name);
}
void
theme_rc_style_to_style(GtkStyle * style,
GtkRcStyle * rc_style)
{
ThemeRcData *data = rc_style->engine_data;
ThemeStyleData *style_data;
style_data = g_new(ThemeStyleData, 1);
style_data->name = g_strdup(data->name);
style->klass = &th_default_class;
style->engine_data = style_data;
g_print("Theme theme: Creating style for \"%s\"\n", data->name);
}
void
theme_duplicate_style(GtkStyle * dest,
GtkStyle * src)
{
ThemeStyleData *dest_data;
ThemeStyleData *src_data = src->engine_data;
dest_data = g_new(ThemeStyleData, 1);
dest_data->name = g_strdup(src_data->name);
dest->engine_data = dest_data;
g_print("Theme theme: Duplicated style for \"%s\"\n", src_data->name);
}
void
theme_realize_style(GtkStyle * style)
{
ThemeStyleData *data = style->engine_data;
g_print("Theme theme: Realizing style for \"%s\"\n", data->name);
}
void
theme_unrealize_style(GtkStyle * style)
{
ThemeStyleData *data = style->engine_data;
g_print("Theme theme: Unrealizing style for \"%s\"\n", data->name);
}
void
theme_destroy_rc_style(GtkRcStyle * rc_style)
{
ThemeRcData *data = rc_style->engine_data;
if (data)
{
g_free(data->name);
g_free(data);
}
g_print("Theme theme: Destroying rc style for \"%s\"\n", data->name);
}
void
theme_destroy_style(GtkStyle * style)
{
ThemeStyleData *data = style->engine_data;
if (data)
{
g_free(data->name);
g_free(data);
}
g_print("Theme theme: Destroying style for \"%s\"\n", data->name);
}
void
theme_set_background(GtkStyle * style,
GdkWindow * window,
GtkStateType state_type)
{
GdkPixmap *pixmap;
gint parent_relative;
g_return_if_fail(style != NULL);
g_return_if_fail(window != NULL);
if (style->bg_pixmap[state_type])
{
if (style->bg_pixmap[state_type] == (GdkPixmap *) GDK_PARENT_RELATIVE)
{
pixmap = NULL;
parent_relative = TRUE;
}
else
{
pixmap = style->bg_pixmap[state_type];
parent_relative = FALSE;
}
gdk_window_set_back_pixmap(window, pixmap, parent_relative);
}
else
gdk_window_set_background(window, &style->bg[state_type]);
}
void
theme_init(GtkThemeEngine * engine)
{
printf("Metal Theme Init\n");
engine->parse_rc_style = theme_parse_rc_style;
engine->merge_rc_style = theme_merge_rc_style;
engine->rc_style_to_style = theme_rc_style_to_style;
engine->duplicate_style = theme_duplicate_style;
engine->realize_style = theme_realize_style;
engine->unrealize_style = theme_unrealize_style;
engine->destroy_rc_style = theme_destroy_rc_style;
engine->destroy_style = theme_destroy_style;
engine->set_background = theme_set_background;
}
void
theme_exit(void)
{
printf("Metal Theme Exit\n* Need to add memory deallocation code here *\n");
}

154
themes/motif_data/gtkrc Normal file
View File

@@ -0,0 +1,154 @@
# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
#
# include "rc-file"
#
# style <name> [= <name>]
# {
# <option>
# }
#
# widget <widget_set> style <style_name>
# widget_class <widget_class_set> style <style_name>
# testgtkrc2 sets all the buttons in the main window to blue by default
#include "testgtkrc2"
#module_path ".:/home/raster/themes"
pixmap_path ".:/home/raster/themes"
style "default"
{
font = "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*"
bg[NORMAL] = { 0.75, 0.75, 0.75 }
bg[PRELIGHT] = { 0.75, 0.75, 0.75 }
engine "motif"
{
}
}
style "list"
{
bg[NORMAL] = { 1.0, 0.5, 0.5 }
bg[PRELIGHT] = { 0.5, 0.5, 0.5 }
}
widget_class "GtkCTree" style "list"
widget_class "GtkCList" style "list"
style "window"
{
# bg_pixmap[NORMAL] = "warning.xpm"
}
style "scale"
{
# fg[NORMAL] = { 1.0, 0, 0 }
# bg[PRELIGHT] = { 1.0, 1.0, 0 }
# bg_pixmap[NORMAL] = "<parent>"
}
style "button"
{
# fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
# bg[PRELIGHT] = { 0, 0, 0.75 }
# bg[PRELIGHT] = { 0.75, 0, 0x00 }
}
style "toggle_button" = "button"
{
# fg[NORMAL] = { 1.0, 0, 0 }
# fg[ACTIVE] = { 1.0, 0, 0 }
# bg_pixmap[NORMAL] = "<parent>"
}
style "text"
{
# bg_pixmap[NORMAL] = "marble.xpm"
# text[NORMAL] = { 0.2, 0.2, 1.0 }
# fg[NORMAL] = { 1.0, 1.0, 1.0 }
# base[NORMAL] = { 0.0, 0.0, 0.0 }
}
style "slider"
{
# fg[NORMAL] = { 1.0, 1.0, 1.0 }
# bg[NORMAL] = { 0.0, 0.0, 1.0 }
# bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
# bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
}
style "ruler"
{
# font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*'
}
style "curve"
{
# fg[NORMAL] = { 58000, 0, 0 } # red
}
style "red-bar"
{
# bg[PRELIGHT] = { 0.95, .55, 0.55 }
}
# override testgtk2, introduce the green color in the button list
style 'button_list' = 'button'
{
# font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
# bg[PRELIGHT] = { 0, 0.75, 0x00 }
}
widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
# common default
class "GtkWidget" style "default"
class "GtkScrollbar" style "red-bar"
widget_class "GtkWindow" style "window"
widget_class "GtkDialog" style "window"
widget_class "GtkFileSelection" style "window"
widget_class "*Gtk*Scale" style "scale"
widget_class "*GtkCheckButton*" style "toggle_button"
widget_class "*GtkRadioButton*" style "toggle_button"
widget_class "*GtkButton*" style "button"
widget_class "*Ruler" style "ruler"
widget_class "*GtkText" style "text"
widget "*GtkCurve" style "curve"
binding "test1"
{
bind "<ctrl>1" {
"debug-msg" ("hallo and")
"debug-msg" ("huhu")
}
}
binding "test2"
{
bind "<ctrl>1" {
"debug-msg" ("jup!")
}
}
# possible priorities are (in ascending order):
# lowest
# gtk (used by gtk for internal class bindings)
# application (for hard coded bindings on application basis)
# rc (used implicitel by rc files)
# highest
class "GtkButton" binding "test1" # implicit : rc
class "GtkButton" binding : highest "test2" # override "rc" priority
binding "clist-test"
{
bind "j" {
"scroll-vertical" (step-backward, 0.0)
}
bind "k" {
"scroll-vertical" (step-forward, 0.0)
}
}
class "GtkCList" binding "clist-test"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

1050
themes/pixmap_data/gtkrc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -315,22 +315,7 @@ GtkStyleClass th_default_class =
static GdkImlibImage *
load_image(char *name)
{
static char *themedir = NULL;
char buf[1024];
if (!themedir)
{
char buf2[1024];
g_snprintf(buf2, 1024, "%s/themes/", getenv("HOME"));
themedir = g_strdup(buf2);
}
strcpy(buf, themedir);
strncat(buf, name, 1023);
buf[1023] = '\0';
return gdk_imlib_load_image(buf);
return gdk_imlib_load_image(name);
}
struct theme_image *

View File

@@ -315,7 +315,7 @@ theme_parse_file(GScanner * scanner,
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
data->file = g_strdup(scanner->value.v_string);
data->file = gtk_rc_find_pixmap_in_path(scanner, scanner->value.v_string);
return G_TOKEN_NONE;
}
@@ -769,7 +769,7 @@ theme_parse_overlay_file(GScanner * scanner,
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
data->overlay_file = g_strdup(scanner->value.v_string);
data->overlay_file = gtk_rc_find_pixmap_in_path(scanner, scanner->value.v_string);
return G_TOKEN_NONE;
}
@@ -791,7 +791,7 @@ theme_parse_gap_file(GScanner * scanner,
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
data->gap_file = g_strdup(scanner->value.v_string);
data->gap_file = gtk_rc_find_pixmap_in_path(scanner, scanner->value.v_string);
return G_TOKEN_NONE;
}
@@ -813,7 +813,7 @@ theme_parse_gap_start_file(GScanner * scanner,
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
data->gap_start_file = g_strdup(scanner->value.v_string);
data->gap_start_file = gtk_rc_find_pixmap_in_path(scanner, scanner->value.v_string);
return G_TOKEN_NONE;
}
@@ -835,7 +835,7 @@ theme_parse_gap_end_file(GScanner * scanner,
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
data->gap_end_file = g_strdup(scanner->value.v_string);
data->gap_end_file = gtk_rc_find_pixmap_in_path(scanner, scanner->value.v_string);
return G_TOKEN_NONE;
}

161
themes/win95_data/gtkrc Normal file
View File

@@ -0,0 +1,161 @@
# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
#
# include "rc-file"
#
# style <name> [= <name>]
# {
# <option>
# }
#
# widget <widget_set> style <style_name>
# widget_class <widget_class_set> style <style_name>
# testgtkrc2 sets all the buttons in the main window to blue by default
#include "testgtkrc2"
#module_path ".:/home/raster/themes"
pixmap_path ".:/home/raster/themes"
style "default"
{
font = "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*"
bg[NORMAL] = { 0.75, 0.75, 0.75 }
bg[PRELIGHT] = { 0.75, 0.75, 0.75 }
engine "win95"
{
}
}
style "menu"
{
fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
}
style "list"
{
bg[NORMAL] = { 0.9, 0.9, 0.9 }
bg[PRELIGHT] = { 0.9, 0.9, 0.9 }
}
widget_class "*MenuItem*" style "menu"
widget_class "*Menu*" style "menu"
widget_class "GtkCTree" style "list"
widget_class "GtkCList" style "list"
style "window"
{
# bg_pixmap[NORMAL] = "warning.xpm"
}
style "scale"
{
# fg[NORMAL] = { 1.0, 0, 0 }
# bg[PRELIGHT] = { 1.0, 1.0, 0 }
# bg_pixmap[NORMAL] = "<parent>"
}
style "button"
{
# fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
# bg[PRELIGHT] = { 0, 0, 0.75 }
# bg[PRELIGHT] = { 0.75, 0, 0x00 }
}
style "toggle_button" = "button"
{
# fg[NORMAL] = { 1.0, 0, 0 }
# fg[ACTIVE] = { 1.0, 0, 0 }
# bg_pixmap[NORMAL] = "<parent>"
}
style "text"
{
# bg_pixmap[NORMAL] = "marble.xpm"
# text[NORMAL] = { 0.2, 0.2, 1.0 }
# fg[NORMAL] = { 1.0, 1.0, 1.0 }
# base[NORMAL] = { 0.0, 0.0, 0.0 }
}
style "slider"
{
# fg[NORMAL] = { 1.0, 1.0, 1.0 }
# bg[NORMAL] = { 0.0, 0.0, 1.0 }
# bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
# bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
}
style "ruler"
{
# font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*'
}
style "curve"
{
# fg[NORMAL] = { 58000, 0, 0 } # red
}
style "red-bar"
{
# bg[PRELIGHT] = { 0.95, .55, 0.55 }
}
# override testgtk2, introduce the green color in the button list
style 'button_list' = 'button'
{
# font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
# bg[PRELIGHT] = { 0, 0.75, 0x00 }
}
widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
# common default
class "GtkWidget" style "default"
class "GtkScrollbar" style "red-bar"
widget_class "GtkWindow" style "window"
widget_class "GtkDialog" style "window"
widget_class "GtkFileSelection" style "window"
widget_class "*Gtk*Scale" style "scale"
widget_class "*GtkCheckButton*" style "toggle_button"
widget_class "*GtkRadioButton*" style "toggle_button"
widget_class "*GtkButton*" style "button"
widget_class "*Ruler" style "ruler"
widget_class "*GtkText" style "text"
widget "*GtkCurve" style "curve"
binding "test1"
{
bind "<ctrl>1" {
"debug-msg" ("hallo and")
"debug-msg" ("huhu")
}
}
binding "test2"
{
bind "<ctrl>1" {
"debug-msg" ("jup!")
}
}
# possible priorities are (in ascending order):
# lowest
# gtk (used by gtk for internal class bindings)
# application (for hard coded bindings on application basis)
# rc (used implicitel by rc files)
# highest
class "GtkButton" binding "test1" # implicit : rc
class "GtkButton" binding : highest "test2" # override "rc" priority
binding "clist-test"
{
bind "j" {
"scroll-vertical" (step-backward, 0.0)
}
bind "k" {
"scroll-vertical" (step-forward, 0.0)
}
}
class "GtkCList" binding "clist-test"

View File

@@ -1053,15 +1053,11 @@ draw_box(GtkStyle * style,
else if (height == -1)
gdk_window_get_size(window, NULL, &height);
printf("%p %s %i %i\n", detail, detail, width, height);
if ((detail) && (!strcmp("trough", detail)))
{
GdkPixmap *pm;
gint depth;
printf("troff\n");
if (GTK_CHECK_TYPE(widget, gtk_progress_bar_get_type()))
{
if (area)
@@ -1228,8 +1224,6 @@ draw_check(GtkStyle * style,
GdkGC *gc2;
gint xx, yy, ww, hh;
printf("%p %s %i %i\n", detail, detail, width, height);
gc2 = style->light_gc[GTK_STATE_NORMAL];
gc1 = style->black_gc;
@@ -1677,7 +1671,6 @@ draw_entry(GtkStyle * style,
else if (height == -1)
gdk_window_get_size(window, NULL, &height);
printf("entry draw\n");
if ((detail) && (!strcmp("selected", detail)))
{
gdk_draw_rectangle(window,

View File

@@ -219,5 +219,5 @@ theme_init(GtkThemeEngine * engine)
void
theme_exit(void)
{
printf("Motif Theme Exit\n* Need to add memory deallocation code here *\n");
printf("Win95 Theme Exit\n* Need to add memory deallocation code here *\n");
}