Goto navigation
PHP-GTK Theme package for Windows

    by Christian Weiske
    cweiske-at-cweiske-dot-de
    http://www.cweiske.de

This file contains all you need to get GTK themes working
with your existing PHP-GTK installation on windows.
(On *nix it makes no sense, cause what you need
sould be delivered with your installation)
It includes the needed engines and some themes.

Please contact me if you've got some notes or ideas.



INSTALLATION
- Extract the file to your PHP-GTK path where the php.exe is located in.
- Run the "rctest/ThemeDirInfo.php-gtk" to see if you did all right.
- Run the "rctest/rctest.php-gtk" to see a theme.
  Open it, goto line 60 and uncomment the theme you want to see.
- See the "rctest/rctest.php-gtk" how to use themes in your applictions



TECHNICAL NOTES



THEMES
======
I've included some themes which definiteley work.
If you want more themes, have a look at http://gtk.themes.org
The themes included in this file are mostly modified by me
because the font size wsa too small. The original files have the
name "gtkrc.original".



DEFAULT PATHS:
==============
{PHP-PATH} ist the path to the php.exe, e.g. c:\php4\
If you've got the GIMP installed, there is a dir
    C:\Programme\Common Files\GTK\1.3\ or
    C:\Programme\Gemeinsame Dateien\GTK\1.3\
You could override the {PHP-PATH} for each setting below with this dir.
(So you've got all the things in one dir where everyone can find it)


Module dir:     {PHP-PATH}/lib/gtk/themes/engines/
    -> The theme engines are searched directly there,
    -> e.g. {PHP-PATH}/lib/gtk/themes/engines/libmetal.dll
    -> The {PHP-PATH} can be overridden by setting the GTK_EXE_PREFIX environment variable

Theme dir:      {PHP-PATH}/share/themes/
    -> You really should make a subdir for each theme,
    -> e.g. {PHP-PATH}/share/themes/Brushed/
    -> in this dir, the subdir "gtk" should exist, and in
    -> this dir the file "gtkrc"
    -> {PHP-PATH}/share/themes/Brushed/gtk/gtkrc
    -> The {PHP-PATH} can be overridden by setting the GTK_DATA_PREFIX environment variable

Pixmap path:    {PHP-PATH}/share/gtk/themes/
    -> Pixmaps are taken directly from there!
    -> no subdirs, but THIS dir, e.g. {PHP-PATH}/share/gtk/themes/brushed-light.xpm
    -> The {PHP-PATH} can be overridden by setting the GTK_DATA_PREFIX environment variable


In gtkrc files, sometimes the paths are explicitly specified:
    module_path "./themes/engines"
    pixmap_path "./themes/brushed"
The problem is that the "." refers to the current APPLICATION directory, the dir where your
php-gtk script is located!
So the only thing you can do is open the theme's gtkrc file and set the pixmap_path hard to the dir
where the theme is located, e.g.
    "C:/Programme/System/PHP-GTK/php4/share/themes/brushed/gtk"
Then you don't need to copy the graphic files to the
    {PHP-PATH}/share/themes/
dir.



DEFAULT THEME
=============
You can specify a default theme for you:
Just copy the "gtkrc" file of your favorite theme into your USER directory, e.g.
    C:\Documents and Settings(??)\{USERNAME}\.gtkrc
and rename it to ".gtkrc" (set a dot before the filename)
I think you have to do this in the DOS-Box, because the explorer doesn't allow to
create/rename files with a "." at the beginning



DEFAULT RC FILES
================
The GTK_RC_FILES environment variable can be set with a list of rc files (seperated by a ";").
This files are used before the normal files from your script apply



ENGINES
=======
First: If you want the real Windows 95 style, use the "redmond95" theme. "Crowberry" is also near.

I tried to get as much engines as possible for windows. Thanks to Øystein Johansen, who compiled the most of them.
Included are:
libengradient.dll
libflat.dll
liblighthouseblue.dll
libltdl.dll
libmetal.dll
libnotif.dll
libraleigh.dll
libredmond95.dll
libthinice.dll
libwhistler.dll


Engine "pixmap"
Many themes use the "libpixmap.dll" engine. I'm sorry to say that, but this one is not included.
The reason for this: I tried to compile this engine for about 4 days. All other engines worked well,
but the libpixmap is a mess. I also contacted Øystein Johansen [oeysteij_at_online.no], who compiled some engines
some years ago. His answer to the pixmap theme:
> Pixmap theme engine is "impossible" to compile for windows. The theme is a
> mess of a code, and mixes code from both Xlib and GTK. I would not recommend
> that you even try to complie this theme engine for windows. I wasted a lot of
> time to try to compile it, but things got so bad I won't even talk about it.
> And the pixmap theme engine is also _very_ slow. It slows down your
> application by a lot! Unless you want to hack alot of code, (much of the code
> needs a complete rewrite), or you're able to use a newer version of
> pixmap-theme, save yourself the problems.
As I spent a very long time doing this, I gave up...
Seems as we have to wait, until the PHP-GTK supports GTK2.
BUT: The libpixmap is just for loading images OTHER THAN XPM.
-> You can replace the pictures in the themes with *.xpm images (use GIMP to convert the pictures).
Remember the pixmap path /share/gtk/themes/ - you should rename the xpm
files to a leading "{THEME_NAME}_*.xpm
The "brushed" themes shows that pictures are possible.


Engine "metal"
This engine seems to have a problem with the "thickness" settings; it is always recognized as "0",
even if the thickness is set. I tried many configurations, "1.0" included, but then the engine doesn't
start (requires integer)... If someone gets this working, please contact me.






SOURCE
excerpts from the source:
-------------------------
gtk_rc_append_default_module_path
  var = getenv("GTK_EXE_PREFIX");
  if (var)
    path = g_strdup_printf("%s%s", var, "/lib/gtk/themes/engines");
  else
    path = g_strdup_printf("%s%s", GTK_LIBDIR, "/gtk/themes/engines");


gtk_rc_get_module_dir(void)
  var = getenv("GTK_EXE_PREFIX");
  if (var)
    path = g_strdup_printf("%s%s", var, "/lib/gtk/themes/engines");
  else
    path = g_strdup_printf("%s%s", GTK_LIBDIR, "/gtk/themes/engines");


gtk_rc_append_default_pixmap_path(void)
  var = getenv("GTK_DATA_PREFIX");
  if (var)
    path = g_strdup_printf("%s%s", var, "/share/gtk/themes");
  else
    path = g_strdup_printf("%s%s", GTK_DATA_PREFIX, "/share/gtk/themes");


gtk_rc_get_theme_dir(void)
  var = getenv("GTK_DATA_PREFIX");
  if (var)
    path = g_strdup_printf("%s%s", var, "/share/themes");
  else
    path = g_strdup_printf("%s%s", GTK_DATA_PREFIX, "/share/themes");


str = g_strdup_printf ("%s%s", g_get_home_dir (), "/.gtkrc");
Navigation
File: phpgtk_themes_readme.htm | last update: 2023-04-06 23:45:02 Valid XHTML Valid CSS