2003-09-17 07:44:49 +00:00
|
|
|
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
|
2003-09-17 07:32:52 +00:00
|
|
|
|
|
|
|
dock.c for the Openbox window manager
|
2006-08-22 16:44:18 +00:00
|
|
|
Copyright (c) 2006 Mikael Magnusson
|
2007-04-23 17:56:35 +00:00
|
|
|
Copyright (c) 2003-2007 Dana Jansens
|
2003-09-17 07:32:52 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
See the COPYING file for a copy of the GNU General Public License.
|
|
|
|
*/
|
|
|
|
|
2003-07-24 06:02:38 +00:00
|
|
|
#include "debug.h"
|
2003-05-16 18:10:10 +00:00
|
|
|
#include "dock.h"
|
2003-08-30 07:20:16 +00:00
|
|
|
#include "mainloop.h"
|
2003-05-16 18:10:10 +00:00
|
|
|
#include "screen.h"
|
2003-05-16 20:20:33 +00:00
|
|
|
#include "prop.h"
|
2003-05-16 18:10:10 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "grab.h"
|
|
|
|
#include "openbox.h"
|
|
|
|
#include "render/theme.h"
|
|
|
|
|
|
|
|
#define DOCK_EVENT_MASK (ButtonPressMask | ButtonReleaseMask | \
|
|
|
|
EnterWindowMask | LeaveWindowMask)
|
|
|
|
#define DOCKAPP_EVENT_MASK (StructureNotifyMask)
|
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
static ObDock *dock;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-08-02 06:25:32 +00:00
|
|
|
StrutPartial dock_strut;
|
2003-05-16 19:15:56 +00:00
|
|
|
|
2003-09-26 07:59:06 +00:00
|
|
|
static void dock_app_grab_button(ObDockApp *app, gboolean grab)
|
|
|
|
{
|
|
|
|
if (grab) {
|
|
|
|
grab_button_full(config_dock_app_move_button,
|
|
|
|
config_dock_app_move_modifiers, app->icon_win,
|
|
|
|
ButtonPressMask | ButtonReleaseMask |
|
2007-04-24 01:00:27 +00:00
|
|
|
ButtonMotionMask | PointerMotionHintMask,
|
2003-09-26 07:59:06 +00:00
|
|
|
GrabModeAsync, OB_CURSOR_MOVE);
|
|
|
|
} else {
|
|
|
|
ungrab_button(config_dock_app_move_button,
|
|
|
|
config_dock_app_move_modifiers, app->icon_win);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-09-03 18:11:39 +00:00
|
|
|
void dock_startup(gboolean reconfig)
|
2003-05-16 18:10:10 +00:00
|
|
|
{
|
|
|
|
XSetWindowAttributes attrib;
|
|
|
|
|
2003-09-03 18:11:39 +00:00
|
|
|
if (reconfig) {
|
2003-09-26 07:59:06 +00:00
|
|
|
GList *it;
|
|
|
|
|
2003-09-21 18:19:11 +00:00
|
|
|
XSetWindowBorder(ob_display, dock->frame,
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
RrColorPixel(ob_rr_theme->frame_b_color));
|
|
|
|
XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->fbwidth);
|
2003-09-21 18:19:11 +00:00
|
|
|
|
|
|
|
RrAppearanceFree(dock->a_frame);
|
2006-08-18 19:57:14 +00:00
|
|
|
dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title);
|
2003-09-21 18:19:11 +00:00
|
|
|
|
2003-09-08 03:08:32 +00:00
|
|
|
stacking_add(DOCK_AS_WINDOW(dock));
|
2003-09-21 18:19:11 +00:00
|
|
|
|
2003-09-03 18:11:39 +00:00
|
|
|
dock_configure();
|
2003-09-24 17:16:01 +00:00
|
|
|
dock_hide(TRUE);
|
2003-09-26 07:59:06 +00:00
|
|
|
|
|
|
|
for (it = dock->dock_apps; it; it = g_list_next(it))
|
|
|
|
dock_app_grab_button(it->data, TRUE);
|
2003-09-03 18:11:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0);
|
2003-05-16 19:15:56 +00:00
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
dock = g_new0(ObDock, 1);
|
2003-05-16 18:10:10 +00:00
|
|
|
dock->obwin.type = Window_Dock;
|
|
|
|
|
|
|
|
dock->hidden = TRUE;
|
|
|
|
|
|
|
|
attrib.event_mask = DOCK_EVENT_MASK;
|
|
|
|
attrib.override_redirect = True;
|
2003-07-10 19:01:41 +00:00
|
|
|
dock->frame = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen),
|
|
|
|
0, 0, 1, 1, 0,
|
2003-06-21 00:42:47 +00:00
|
|
|
RrDepth(ob_rr_inst), InputOutput,
|
|
|
|
RrVisual(ob_rr_inst),
|
2003-05-16 18:10:10 +00:00
|
|
|
CWOverrideRedirect | CWEventMask,
|
|
|
|
&attrib);
|
2006-08-18 19:57:14 +00:00
|
|
|
dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title);
|
2003-07-10 17:03:05 +00:00
|
|
|
XSetWindowBorder(ob_display, dock->frame,
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
RrColorPixel(ob_rr_theme->frame_b_color));
|
|
|
|
XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->fbwidth);
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
g_hash_table_insert(window_map, &dock->frame, dock);
|
2003-05-16 19:32:22 +00:00
|
|
|
stacking_add(DOCK_AS_WINDOW(dock));
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
2003-09-03 18:11:39 +00:00
|
|
|
void dock_shutdown(gboolean reconfig)
|
2003-05-16 18:10:10 +00:00
|
|
|
{
|
2003-09-08 03:08:32 +00:00
|
|
|
if (reconfig) {
|
2003-09-26 07:59:06 +00:00
|
|
|
GList *it;
|
|
|
|
|
2003-09-08 03:08:32 +00:00
|
|
|
stacking_remove(DOCK_AS_WINDOW(dock));
|
2003-09-26 07:59:06 +00:00
|
|
|
|
|
|
|
for (it = dock->dock_apps; it; it = g_list_next(it))
|
|
|
|
dock_app_grab_button(it->data, FALSE);
|
2003-09-08 03:08:32 +00:00
|
|
|
return;
|
|
|
|
}
|
2003-09-03 18:11:39 +00:00
|
|
|
|
2003-05-16 18:10:10 +00:00
|
|
|
XDestroyWindow(ob_display, dock->frame);
|
2003-06-21 00:42:47 +00:00
|
|
|
RrAppearanceFree(dock->a_frame);
|
2003-05-16 18:10:10 +00:00
|
|
|
g_hash_table_remove(window_map, &dock->frame);
|
|
|
|
stacking_remove(dock);
|
|
|
|
}
|
|
|
|
|
|
|
|
void dock_add(Window win, XWMHints *wmhints)
|
|
|
|
{
|
2003-07-10 16:29:40 +00:00
|
|
|
ObDockApp *app;
|
2003-05-16 18:10:10 +00:00
|
|
|
XWindowAttributes attrib;
|
2003-07-10 16:29:40 +00:00
|
|
|
gchar **data;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
app = g_new0(ObDockApp, 1);
|
2003-05-16 18:34:29 +00:00
|
|
|
app->obwin.type = Window_DockApp;
|
2003-05-16 18:10:10 +00:00
|
|
|
app->win = win;
|
|
|
|
app->icon_win = (wmhints->flags & IconWindowHint) ?
|
|
|
|
wmhints->icon_window : win;
|
2003-05-16 20:20:33 +00:00
|
|
|
|
|
|
|
if (PROP_GETSS(app->win, wm_class, locale, &data)) {
|
|
|
|
if (data[0]) {
|
2004-03-21 01:03:00 +00:00
|
|
|
app->name = g_strdup(data[0]);
|
2003-05-16 20:20:33 +00:00
|
|
|
if (data[1])
|
|
|
|
app->class = g_strdup(data[1]);
|
|
|
|
}
|
|
|
|
g_strfreev(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (app->name == NULL) app->name = g_strdup("");
|
|
|
|
if (app->class == NULL) app->class = g_strdup("");
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
|
|
|
|
app->w = attrib.width;
|
|
|
|
app->h = attrib.height;
|
|
|
|
} else {
|
|
|
|
app->w = app->h = 64;
|
|
|
|
}
|
|
|
|
|
|
|
|
dock->dock_apps = g_list_append(dock->dock_apps, app);
|
|
|
|
dock_configure();
|
|
|
|
|
|
|
|
XReparentWindow(ob_display, app->icon_win, dock->frame, app->x, app->y);
|
|
|
|
/*
|
|
|
|
This is the same case as in frame.c for client windows. When Openbox is
|
|
|
|
starting, the window is already mapped so we see unmap events occur for
|
|
|
|
it. There are 2 unmap events generated that we see, one with the 'event'
|
|
|
|
member set the root window, and one set to the client, but both get
|
|
|
|
handled and need to be ignored.
|
|
|
|
*/
|
2003-07-10 19:06:00 +00:00
|
|
|
if (ob_state() == OB_STATE_STARTING)
|
2004-03-21 01:03:00 +00:00
|
|
|
app->ignore_unmaps += 2;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
if (app->win != app->icon_win) {
|
|
|
|
/* have to map it so that it can be re-managed on a restart */
|
|
|
|
XMoveWindow(ob_display, app->win, -1000, -1000);
|
|
|
|
XMapWindow(ob_display, app->win);
|
|
|
|
}
|
|
|
|
XMapWindow(ob_display, app->icon_win);
|
|
|
|
XSync(ob_display, False);
|
|
|
|
|
|
|
|
/* specify that if we exit, the window should not be destroyed and should
|
|
|
|
be reparented back to root automatically */
|
|
|
|
XChangeSaveSet(ob_display, app->icon_win, SetModeInsert);
|
|
|
|
XSelectInput(ob_display, app->icon_win, DOCKAPP_EVENT_MASK);
|
|
|
|
|
2003-09-26 07:59:06 +00:00
|
|
|
dock_app_grab_button(app, TRUE);
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
g_hash_table_insert(window_map, &app->icon_win, app);
|
|
|
|
|
2003-07-24 06:02:38 +00:00
|
|
|
ob_debug("Managed Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void dock_remove_all()
|
|
|
|
{
|
|
|
|
while (dock->dock_apps)
|
|
|
|
dock_remove(dock->dock_apps->data, TRUE);
|
|
|
|
}
|
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
void dock_remove(ObDockApp *app, gboolean reparent)
|
2003-05-16 18:10:10 +00:00
|
|
|
{
|
2003-09-26 07:59:06 +00:00
|
|
|
dock_app_grab_button(app, FALSE);
|
2003-05-16 18:10:10 +00:00
|
|
|
XSelectInput(ob_display, app->icon_win, NoEventMask);
|
|
|
|
/* remove the window from our save set */
|
|
|
|
XChangeSaveSet(ob_display, app->icon_win, SetModeDelete);
|
|
|
|
XSync(ob_display, False);
|
|
|
|
|
|
|
|
g_hash_table_remove(window_map, &app->icon_win);
|
|
|
|
|
|
|
|
if (reparent)
|
2004-03-21 01:03:00 +00:00
|
|
|
XReparentWindow(ob_display, app->icon_win,
|
2003-07-10 19:01:41 +00:00
|
|
|
RootWindow(ob_display, ob_screen), app->x, app->y);
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
dock->dock_apps = g_list_remove(dock->dock_apps, app);
|
|
|
|
dock_configure();
|
|
|
|
|
2003-07-24 06:02:38 +00:00
|
|
|
ob_debug("Unmanaged Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-05-16 20:20:33 +00:00
|
|
|
g_free(app->name);
|
|
|
|
g_free(app->class);
|
2003-05-16 18:10:10 +00:00
|
|
|
g_free(app);
|
|
|
|
}
|
|
|
|
|
|
|
|
void dock_configure()
|
|
|
|
{
|
|
|
|
GList *it;
|
2003-07-10 16:29:40 +00:00
|
|
|
gint spot;
|
|
|
|
gint gravity;
|
|
|
|
gint minw, minh;
|
|
|
|
gint strw, strh;
|
2003-06-27 04:20:30 +00:00
|
|
|
Rect *a;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-06-26 05:46:06 +00:00
|
|
|
RrMinsize(dock->a_frame, &minw, &minh);
|
|
|
|
|
|
|
|
dock->w = dock->h = 0;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-05-19 20:27:11 +00:00
|
|
|
/* get the size */
|
2003-10-25 19:27:09 +00:00
|
|
|
for (it = dock->dock_apps; it; it = g_list_next(it)) {
|
2003-07-10 16:29:40 +00:00
|
|
|
ObDockApp *app = it->data;
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-05-16 18:10:10 +00:00
|
|
|
dock->w += app->w;
|
|
|
|
dock->h = MAX(dock->h, app->h);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-05-19 20:27:11 +00:00
|
|
|
dock->w = MAX(dock->w, app->w);
|
|
|
|
dock->h += app->h;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
2003-05-19 20:27:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-10 16:38:45 +00:00
|
|
|
spot = (config_dock_orient == OB_ORIENTATION_HORZ ? minw : minh) / 2;
|
2003-06-26 05:46:06 +00:00
|
|
|
|
2003-05-19 20:27:11 +00:00
|
|
|
/* position the apps */
|
2003-10-25 19:27:09 +00:00
|
|
|
for (it = dock->dock_apps; it; it = g_list_next(it)) {
|
2003-07-10 16:29:40 +00:00
|
|
|
ObDockApp *app = it->data;
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-05-19 20:18:46 +00:00
|
|
|
app->x = spot;
|
|
|
|
app->y = (dock->h - app->h) / 2;
|
2003-05-16 18:10:10 +00:00
|
|
|
spot += app->w;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-05-19 20:18:46 +00:00
|
|
|
app->x = (dock->w - app->w) / 2;
|
|
|
|
app->y = spot;
|
2003-05-16 18:10:10 +00:00
|
|
|
spot += app->h;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XMoveWindow(ob_display, app->icon_win, app->x, app->y);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* used for calculating offsets */
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->w += ob_rr_theme->fbwidth * 2;
|
|
|
|
dock->h += ob_rr_theme->fbwidth * 2;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-06-27 04:20:30 +00:00
|
|
|
a = screen_physical_area();
|
|
|
|
|
2003-05-16 18:10:10 +00:00
|
|
|
/* calculate position */
|
2003-07-10 16:29:40 +00:00
|
|
|
if (config_dock_floating) {
|
2003-05-16 18:10:10 +00:00
|
|
|
dock->x = config_dock_x;
|
|
|
|
dock->y = config_dock_y;
|
|
|
|
gravity = NorthWestGravity;
|
2003-07-10 16:29:40 +00:00
|
|
|
} else {
|
|
|
|
switch (config_dock_pos) {
|
|
|
|
case OB_DIRECTION_NORTHWEST:
|
|
|
|
dock->x = 0;
|
|
|
|
dock->y = 0;
|
|
|
|
gravity = NorthWestGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_NORTH:
|
|
|
|
dock->x = a->width / 2;
|
|
|
|
dock->y = 0;
|
|
|
|
gravity = NorthGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_NORTHEAST:
|
|
|
|
dock->x = a->width;
|
|
|
|
dock->y = 0;
|
|
|
|
gravity = NorthEastGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_WEST:
|
|
|
|
dock->x = 0;
|
|
|
|
dock->y = a->height / 2;
|
|
|
|
gravity = WestGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_EAST:
|
|
|
|
dock->x = a->width;
|
|
|
|
dock->y = a->height / 2;
|
|
|
|
gravity = EastGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTHWEST:
|
|
|
|
dock->x = 0;
|
|
|
|
dock->y = a->height;
|
|
|
|
gravity = SouthWestGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTH:
|
|
|
|
dock->x = a->width / 2;
|
|
|
|
dock->y = a->height;
|
|
|
|
gravity = SouthGravity;
|
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTHEAST:
|
|
|
|
dock->x = a->width;
|
|
|
|
dock->y = a->height;
|
|
|
|
gravity = SouthEastGravity;
|
|
|
|
break;
|
2007-03-02 02:23:00 +00:00
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
2003-07-10 16:29:40 +00:00
|
|
|
}
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch(gravity) {
|
|
|
|
case NorthGravity:
|
|
|
|
case CenterGravity:
|
|
|
|
case SouthGravity:
|
|
|
|
dock->x -= dock->w / 2;
|
|
|
|
break;
|
|
|
|
case NorthEastGravity:
|
|
|
|
case EastGravity:
|
|
|
|
case SouthEastGravity:
|
|
|
|
dock->x -= dock->w;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch(gravity) {
|
|
|
|
case WestGravity:
|
|
|
|
case CenterGravity:
|
|
|
|
case EastGravity:
|
|
|
|
dock->y -= dock->h / 2;
|
|
|
|
break;
|
|
|
|
case SouthWestGravity:
|
|
|
|
case SouthGravity:
|
|
|
|
case SouthEastGravity:
|
|
|
|
dock->y -= dock->h;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (config_dock_hide && dock->hidden) {
|
2003-07-10 16:29:40 +00:00
|
|
|
if (!config_dock_floating) {
|
|
|
|
switch (config_dock_pos) {
|
|
|
|
case OB_DIRECTION_NORTHWEST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->y -= dock->h - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->x -= dock->w - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_NORTH:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->y -= dock->h - ob_rr_theme->fbwidth;
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_NORTHEAST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->y -= dock->h - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->x += dock->w - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_WEST:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->x -= dock->w - ob_rr_theme->fbwidth;
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_EAST:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->x += dock->w - ob_rr_theme->fbwidth;
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTHWEST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->y += dock->h - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->x -= dock->w - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
} break;
|
2003-07-10 16:29:40 +00:00
|
|
|
case OB_DIRECTION_SOUTH:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->y += dock->h - ob_rr_theme->fbwidth;
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTHEAST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->y += dock->h - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->x += dock->w - ob_rr_theme->fbwidth;
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
if (!config_dock_floating && config_dock_hide) {
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
strw = ob_rr_theme->fbwidth;
|
|
|
|
strh = ob_rr_theme->fbwidth;
|
2003-06-30 23:11:58 +00:00
|
|
|
} else {
|
|
|
|
strw = dock->w;
|
2003-09-03 21:07:46 +00:00
|
|
|
strh = dock->h;
|
2003-06-30 23:11:58 +00:00
|
|
|
}
|
|
|
|
|
2003-05-16 19:15:56 +00:00
|
|
|
/* set the strut */
|
2003-09-03 21:07:46 +00:00
|
|
|
if (!dock->dock_apps) {
|
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0);
|
2005-03-26 06:34:58 +00:00
|
|
|
} else if (config_dock_floating || config_dock_nostrut) {
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0);
|
2003-07-10 16:29:40 +00:00
|
|
|
} else {
|
|
|
|
switch (config_dock_pos) {
|
|
|
|
case OB_DIRECTION_NORTHWEST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
|
|
|
|
0, 0, dock->x, dock->x + dock->w - 1,
|
|
|
|
0, 0, 0, 0);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
|
|
|
|
dock->y, dock->y + dock->h - 1,
|
|
|
|
0, 0, 0, 0, 0, 0);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_NORTH:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
|
|
|
|
dock->x, dock->x + dock->w - 1,
|
|
|
|
0, 0, 0, 0, 0, 0);
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_NORTHEAST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
|
|
|
|
0, 0, dock->x, dock->x + dock->w -1,
|
|
|
|
0, 0, 0, 0);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
dock->y, dock->y + dock->h - 1, 0, 0);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_WEST:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
|
|
|
|
dock->y, dock->y + dock->h - 1,
|
|
|
|
0, 0, 0, 0, 0, 0);
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_EAST:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
dock->y, dock->y + dock->h - 1, 0, 0);
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTHWEST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
|
|
|
|
0, 0, 0, 0, 0, 0,
|
|
|
|
dock->x, dock->x + dock->w - 1);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
|
|
|
|
dock->y, dock->y + dock->h - 1,
|
|
|
|
0, 0, 0, 0, 0, 0);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTH:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
|
|
|
|
0, 0, 0, 0, 0, 0,
|
|
|
|
dock->x, dock->x + dock->w - 1);
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
case OB_DIRECTION_SOUTHEAST:
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
|
|
|
|
0, 0, 0, 0, 0, 0,
|
|
|
|
dock->x, dock->x + dock->w - 1);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-08-02 06:25:32 +00:00
|
|
|
STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
dock->y, dock->y + dock->h - 1, 0, 0);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-10 16:29:40 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-05-16 19:15:56 +00:00
|
|
|
}
|
|
|
|
|
2003-06-26 05:46:06 +00:00
|
|
|
dock->w += minw;
|
|
|
|
dock->h += minh;
|
|
|
|
|
2003-05-16 18:10:10 +00:00
|
|
|
/* not used for actually sizing shit */
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->w -= ob_rr_theme->fbwidth * 2;
|
|
|
|
dock->h -= ob_rr_theme->fbwidth * 2;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
2003-09-03 21:07:46 +00:00
|
|
|
if (dock->dock_apps) {
|
|
|
|
g_assert(dock->w > 0);
|
|
|
|
g_assert(dock->h > 0);
|
|
|
|
|
2003-05-16 18:10:10 +00:00
|
|
|
XMoveResizeWindow(ob_display, dock->frame,
|
|
|
|
dock->x, dock->y, dock->w, dock->h);
|
|
|
|
|
2003-06-21 00:42:47 +00:00
|
|
|
RrPaint(dock->a_frame, dock->frame, dock->w, dock->h);
|
2003-05-16 18:10:10 +00:00
|
|
|
XMapWindow(ob_display, dock->frame);
|
|
|
|
} else
|
|
|
|
XUnmapWindow(ob_display, dock->frame);
|
|
|
|
|
|
|
|
/* but they are useful outside of this function! */
|
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN.
Openbox has just moved it's theme format to an XML based one. The details of
this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd
ALSO! This is very good and important and stuff! In the tools directory you
will find THEMETOXML ! This tool takes a themerc on stdin, and spits out
the same theme in theme.xml format. So this is all you need to do to update
your themes.
PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply
builds and then lives out in its tools/themetoxml directory, and that's it. So
if you want to use it, that is where to find it.
In moving to the new XML format, a number of additions/changes to the theme
engine have been made. Themetoxml takes these into account and will set all
the new things appropriately to make your theme look the same as it always has.
New additions include..
* padding now has an horizontal and vertical component, instead of being one number
* menus can have different borders than windows (color and size)
* menu offset can now be negative. it's a little weird, but someone will want it no doubt
* fonts are no longer controled by the theme at all, however font shadowing is, and on that note..
* font shadows are now any color you want, not just black and white
* you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc.
* every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people.
* font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal
* if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below.
* shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow
This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see.
Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback.
Here's the font configuration example. Hopefully ObConf will let you set this real soon.
<theme>
...
<font place="ActiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="InactiveWindow">
<name>arial,sans</name>
<size>7</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuTitle">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
<font place="MenuItem">
<name>arial,sans</name>
<size>8</size>
<weight>bold</weight>
<slant>normal</slant>
</font>
</theme>
2007-03-05 15:44:17 +00:00
|
|
|
dock->w += ob_rr_theme->fbwidth * 2;
|
|
|
|
dock->h += ob_rr_theme->fbwidth * 2;
|
2003-05-16 19:15:56 +00:00
|
|
|
|
2003-06-27 04:20:30 +00:00
|
|
|
screen_update_areas();
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
void dock_app_configure(ObDockApp *app, gint w, gint h)
|
2003-05-16 18:10:10 +00:00
|
|
|
{
|
|
|
|
app->w = w;
|
|
|
|
app->h = h;
|
|
|
|
dock_configure();
|
|
|
|
}
|
|
|
|
|
2003-07-10 16:29:40 +00:00
|
|
|
void dock_app_drag(ObDockApp *app, XMotionEvent *e)
|
2003-05-16 18:10:10 +00:00
|
|
|
{
|
2003-07-10 16:29:40 +00:00
|
|
|
ObDockApp *over = NULL;
|
2003-05-16 18:10:10 +00:00
|
|
|
GList *it;
|
2003-07-10 16:29:40 +00:00
|
|
|
gint x, y;
|
2003-05-16 18:10:10 +00:00
|
|
|
gboolean after;
|
2003-07-10 16:38:45 +00:00
|
|
|
gboolean stop;
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
x = e->x_root;
|
|
|
|
y = e->y_root;
|
|
|
|
|
|
|
|
/* are we on top of the dock? */
|
|
|
|
if (!(x >= dock->x &&
|
|
|
|
y >= dock->y &&
|
|
|
|
x < dock->x + dock->w &&
|
|
|
|
y < dock->y + dock->h))
|
|
|
|
return;
|
|
|
|
|
|
|
|
x -= dock->x;
|
|
|
|
y -= dock->y;
|
|
|
|
|
|
|
|
/* which dock app are we on top of? */
|
2003-07-10 16:38:45 +00:00
|
|
|
stop = FALSE;
|
2003-10-25 19:27:09 +00:00
|
|
|
for (it = dock->dock_apps; it; it = g_list_next(it)) {
|
2003-05-16 18:10:10 +00:00
|
|
|
over = it->data;
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-05-16 18:10:10 +00:00
|
|
|
if (x >= over->x && x < over->x + over->w)
|
2003-07-10 16:38:45 +00:00
|
|
|
stop = TRUE;
|
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-05-16 18:10:10 +00:00
|
|
|
if (y >= over->y && y < over->y + over->h)
|
2003-07-10 16:38:45 +00:00
|
|
|
stop = TRUE;
|
|
|
|
break;
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
2003-07-11 02:51:03 +00:00
|
|
|
/* dont go to it->next! */
|
|
|
|
if (stop) break;
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
if (!it || app == over) return;
|
|
|
|
|
|
|
|
x -= over->x;
|
|
|
|
y -= over->y;
|
|
|
|
|
2003-07-10 16:38:45 +00:00
|
|
|
switch (config_dock_orient) {
|
|
|
|
case OB_ORIENTATION_HORZ:
|
2003-05-16 18:10:10 +00:00
|
|
|
after = (x > over->w / 2);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
|
|
|
case OB_ORIENTATION_VERT:
|
2003-05-16 18:10:10 +00:00
|
|
|
after = (y > over->h / 2);
|
2003-07-10 16:38:45 +00:00
|
|
|
break;
|
2007-03-02 02:23:00 +00:00
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
2003-07-10 16:38:45 +00:00
|
|
|
}
|
2003-05-16 18:10:10 +00:00
|
|
|
|
|
|
|
/* remove before doing the it->next! */
|
|
|
|
dock->dock_apps = g_list_remove(dock->dock_apps, app);
|
|
|
|
|
|
|
|
if (after) it = it->next;
|
|
|
|
|
|
|
|
dock->dock_apps = g_list_insert_before(dock->dock_apps, it, app);
|
|
|
|
dock_configure();
|
|
|
|
}
|
|
|
|
|
2003-08-30 07:20:16 +00:00
|
|
|
static gboolean hide_timeout(gpointer data)
|
2003-05-16 18:10:10 +00:00
|
|
|
{
|
|
|
|
/* hide */
|
|
|
|
dock->hidden = TRUE;
|
|
|
|
dock_configure();
|
2003-08-30 07:20:16 +00:00
|
|
|
|
|
|
|
return FALSE; /* don't repeat */
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:45:24 +00:00
|
|
|
static gboolean show_timeout(gpointer data)
|
|
|
|
{
|
|
|
|
/* hide */
|
|
|
|
dock->hidden = FALSE;
|
|
|
|
dock_configure();
|
|
|
|
|
|
|
|
return FALSE; /* don't repeat */
|
|
|
|
}
|
|
|
|
|
2003-05-16 18:10:10 +00:00
|
|
|
void dock_hide(gboolean hide)
|
|
|
|
{
|
|
|
|
if (!hide) {
|
2005-09-25 14:45:24 +00:00
|
|
|
if (dock->hidden && config_dock_hide) {
|
|
|
|
ob_main_loop_timeout_add(ob_main_loop, config_dock_show_delay,
|
2007-04-22 04:16:00 +00:00
|
|
|
show_timeout, NULL, g_direct_equal, NULL);
|
2005-09-25 14:45:24 +00:00
|
|
|
} else if (!dock->hidden && config_dock_hide) {
|
|
|
|
ob_main_loop_timeout_remove(ob_main_loop, hide_timeout);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!dock->hidden && config_dock_hide) {
|
|
|
|
ob_main_loop_timeout_add(ob_main_loop, config_dock_hide_delay,
|
2007-04-22 04:16:00 +00:00
|
|
|
hide_timeout, NULL, g_direct_equal, NULL);
|
2005-09-25 14:45:24 +00:00
|
|
|
} else if (dock->hidden && config_dock_hide) {
|
|
|
|
ob_main_loop_timeout_remove(ob_main_loop, show_timeout);
|
|
|
|
}
|
2003-05-16 18:10:10 +00:00
|
|
|
}
|
|
|
|
}
|