mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
ResizebarBack option
This commit is contained in:
@@ -16,6 +16,8 @@ Changes since version 0.52.0:
|
|||||||
- applied WMSound patch from "Quinn, Anthony" <Anthony.Quinn@usa.xerox.com>
|
- applied WMSound patch from "Quinn, Anthony" <Anthony.Quinn@usa.xerox.com>
|
||||||
- fixed focus bug with unfocusable window (I swear I had fixed that before...)
|
- fixed focus bug with unfocusable window (I swear I had fixed that before...)
|
||||||
- applied windoze cycle patch from Paul Warren <pdw@ferret.lmh.ox.ac.uk>
|
- applied windoze cycle patch from Paul Warren <pdw@ferret.lmh.ox.ac.uk>
|
||||||
|
- changed initscript and exitscript execution from fork()/exec() to system()
|
||||||
|
- added ResizebarBack and added appropriate backwards compat. hacks in setstyle
|
||||||
|
|
||||||
Changes since version 0.51.2:
|
Changes since version 0.51.2:
|
||||||
.............................
|
.............................
|
||||||
|
|||||||
20
NEWS
20
NEWS
@@ -2,10 +2,12 @@
|
|||||||
NEWS for veteran Window Maker users
|
NEWS for veteran Window Maker users
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
--- 0.53.0
|
--- 0.52.1
|
||||||
|
|
||||||
New Option
|
New Options
|
||||||
----------
|
-----------
|
||||||
|
|
||||||
|
** MenuStyle
|
||||||
|
|
||||||
MenuStyle=<style>; will change the menu texture style.
|
MenuStyle=<style>; will change the menu texture style.
|
||||||
|
|
||||||
@@ -19,6 +21,18 @@ in each item
|
|||||||
flat: singleTexture without the bevels
|
flat: singleTexture without the bevels
|
||||||
|
|
||||||
|
|
||||||
|
** ResizebarBack
|
||||||
|
|
||||||
|
ResizebarBack=<texture>;
|
||||||
|
|
||||||
|
where <texture> is any of the textures you normally use in titlebars and
|
||||||
|
other places.
|
||||||
|
|
||||||
|
If the style file/theme does not contain a ResizebarBack option, setstyle
|
||||||
|
will automatically hack it so that wmaker will make the theme work like
|
||||||
|
before.
|
||||||
|
|
||||||
|
|
||||||
--- 0.52.0
|
--- 0.52.0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
TODO
4
TODO
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
|
selection to get icon background
|
||||||
|
|
||||||
Do ASAP:
|
Do ASAP:
|
||||||
========
|
========
|
||||||
- exitscript
|
|
||||||
- fix bestvisual selection code. Broken.
|
- fix bestvisual selection code. Broken.
|
||||||
- fix RemakeStackList() to account for transient windows
|
- fix RemakeStackList() to account for transient windows
|
||||||
- blink border of clients with UrgencyHint set between red and black
|
- blink border of clients with UrgencyHint set between red and black
|
||||||
- finish session stuff
|
- finish session stuff
|
||||||
- fix scroller to not jump while dragging knob
|
|
||||||
- add multiline support for balloons
|
- add multiline support for balloons
|
||||||
- move/add balloon to WINGs
|
- move/add balloon to WINGs
|
||||||
- finish XStandardColormap stuff in wrlib
|
- finish XStandardColormap stuff in wrlib
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ AC_INIT(src/WindowMaker.h)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE(WindowMaker, 0.53.0)
|
AM_INIT_AUTOMAKE(WindowMaker, 0.52.1)
|
||||||
|
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ static int setWTitleColor();
|
|||||||
static int setFTitleBack();
|
static int setFTitleBack();
|
||||||
static int setPTitleBack();
|
static int setPTitleBack();
|
||||||
static int setUTitleBack();
|
static int setUTitleBack();
|
||||||
|
static int setResizebarBack();
|
||||||
static int setWorkspaceBack();
|
static int setWorkspaceBack();
|
||||||
static int setWorkspaceSpecificBack();
|
static int setWorkspaceSpecificBack();
|
||||||
static int setMenuTitleColor();
|
static int setMenuTitleColor();
|
||||||
@@ -550,6 +551,9 @@ WDefaultEntry optionList[] = {
|
|||||||
{"UTitleBack", "(solid, gray)", NULL,
|
{"UTitleBack", "(solid, gray)", NULL,
|
||||||
NULL, getTexture, setUTitleBack
|
NULL, getTexture, setUTitleBack
|
||||||
},
|
},
|
||||||
|
{"ResizebarBack", "(solid, gray)", NULL,
|
||||||
|
NULL, getTexture, setResizebarBack
|
||||||
|
},
|
||||||
{"MenuTitleColor", "white", NULL,
|
{"MenuTitleColor", "white", NULL,
|
||||||
NULL, getColor, setMenuTitleColor
|
NULL, getColor, setMenuTitleColor
|
||||||
},
|
},
|
||||||
@@ -2815,6 +2819,10 @@ setWidgetColor(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo
|
|||||||
}
|
}
|
||||||
scr->widget_texture = *(WTexSolid**)texture;
|
scr->widget_texture = *(WTexSolid**)texture;
|
||||||
|
|
||||||
|
if (scr->geometry_display != None)
|
||||||
|
XSetWindowBackground(dpy, scr->geometry_display,
|
||||||
|
scr->widget_texture->normal.pixel);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2851,15 +2859,17 @@ setUTitleBack(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
|
|||||||
}
|
}
|
||||||
scr->window_title_texture[WS_UNFOCUSED] = *texture;
|
scr->window_title_texture[WS_UNFOCUSED] = *texture;
|
||||||
|
|
||||||
if (scr->resizebar_texture[0]) {
|
return REFRESH_WINDOW_TEXTURES;
|
||||||
wTextureDestroy(scr, (WTexture*)scr->resizebar_texture[0]);
|
|
||||||
}
|
}
|
||||||
scr->resizebar_texture[0]
|
|
||||||
= wTextureMakeSolid(scr, &scr->window_title_texture[WS_UNFOCUSED]->any.color);
|
|
||||||
|
|
||||||
if (scr->geometry_display != None)
|
|
||||||
XSetWindowBackground(dpy, scr->geometry_display,
|
static int
|
||||||
scr->resizebar_texture[0]->normal.pixel);
|
setResizebarBack(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
|
||||||
|
{
|
||||||
|
if (scr->resizebar_texture[0]) {
|
||||||
|
wTextureDestroy(scr, scr->resizebar_texture[0]);
|
||||||
|
}
|
||||||
|
scr->resizebar_texture[0] = *texture;
|
||||||
|
|
||||||
return REFRESH_WINDOW_TEXTURES;
|
return REFRESH_WINDOW_TEXTURES;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1359,8 +1359,8 @@ doWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
wRaiseFrame(newFocused->frame->core);
|
wRaiseFrame(newFocused->frame->core);
|
||||||
|
|
||||||
if (wPreferences.popup_switchmenu &&
|
if (wPreferences.popup_switchmenu &&
|
||||||
(!scr->switch_menu || !scr->switch_menu->flags.mapped))
|
(!scr->switch_menu || !scr->switch_menu->flags.mapped)) {
|
||||||
{
|
|
||||||
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
|
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
|
||||||
openedSwitchMenu = True;
|
openedSwitchMenu = True;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
|||||||
|
|
||||||
img = wTextureRenderImage(texture, width, height, WREL_FLAT);
|
img = wTextureRenderImage(texture, width, height, WREL_FLAT);
|
||||||
if (!img) {
|
if (!img) {
|
||||||
wwarning(_("could not render gradient: %s"), RMessageForError(RErrorCode));
|
wwarning(_("could not render texture: %s"), RMessageForError(RErrorCode));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,6 +550,49 @@ renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
renderResizebarTexture(WScreen *scr, WTexture *texture, int width, int height,
|
||||||
|
int cwidth, Pixmap *pmap)
|
||||||
|
{
|
||||||
|
RImage *img;
|
||||||
|
RColor light;
|
||||||
|
RColor dark;
|
||||||
|
|
||||||
|
*pmap = None;
|
||||||
|
|
||||||
|
img = wTextureRenderImage(texture, width, height, WREL_FLAT);
|
||||||
|
if (!img) {
|
||||||
|
wwarning(_("could not render texture: %s"),
|
||||||
|
RMessageForError(RErrorCode));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
light.alpha = 0;
|
||||||
|
light.red = light.green = light.blue = 80;
|
||||||
|
|
||||||
|
dark.alpha = 0;
|
||||||
|
dark.red = dark.green = dark.blue = 40;
|
||||||
|
|
||||||
|
ROperateLine(img, RSubtractOperation, 0, 0, width-1, 0, &dark);
|
||||||
|
ROperateLine(img, RAddOperation, 0, 1, width-1, 1, &light);
|
||||||
|
|
||||||
|
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height, &dark);
|
||||||
|
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height, &light);
|
||||||
|
|
||||||
|
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, width-cwidth-2,
|
||||||
|
height, &dark);
|
||||||
|
ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1,
|
||||||
|
height, &light);
|
||||||
|
|
||||||
|
if (!RConvertImage(scr->rcontext, img, pmap)) {
|
||||||
|
wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
RDestroyImage(img);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
updateTexture(WFrameWindow *fwin)
|
updateTexture(WFrameWindow *fwin)
|
||||||
{
|
{
|
||||||
@@ -593,12 +636,6 @@ updateTexture(WFrameWindow *fwin)
|
|||||||
handleButtonExpose(&fwin->right_button->descriptor, NULL);
|
handleButtonExpose(&fwin->right_button->descriptor, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fwin->resizebar) {
|
|
||||||
XSetWindowBackground(dpy, fwin->resizebar->window,
|
|
||||||
fwin->resizebar_texture[0]->solid.normal.pixel);
|
|
||||||
XClearWindow(dpy, fwin->resizebar->window);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -639,13 +676,39 @@ remakeTexture(WFrameWindow *fwin, int state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (fwin->resizebar_texture && fwin->resizebar_texture[0]
|
||||||
|
&& fwin->resizebar && state == 0) {
|
||||||
|
|
||||||
|
FREE_PIXMAP(fwin->resizebar_back[0]);
|
||||||
|
|
||||||
|
if (fwin->resizebar_texture[0]->any.type!=WTEX_SOLID) {
|
||||||
|
|
||||||
|
renderResizebarTexture(fwin->screen_ptr,
|
||||||
|
fwin->resizebar_texture[0],
|
||||||
|
fwin->resizebar->width,
|
||||||
|
fwin->resizebar->height,
|
||||||
|
fwin->resizebar_corner_width,
|
||||||
|
&pmap);
|
||||||
|
|
||||||
|
fwin->resizebar_back[0] = pmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this part should be in updateTexture() */
|
||||||
|
if (fwin->resizebar_texture[0]->any.type!=WTEX_SOLID) {
|
||||||
|
XSetWindowBackgroundPixmap(dpy, fwin->resizebar->window,
|
||||||
|
fwin->resizebar_back[0]);
|
||||||
|
} else {
|
||||||
|
XSetWindowBackground(dpy, fwin->resizebar->window,
|
||||||
|
fwin->resizebar_texture[0]->solid.normal.pixel);
|
||||||
|
}
|
||||||
|
XClearWindow(dpy, fwin->resizebar->window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wFrameWindowPaint(WFrameWindow *fwin)
|
wFrameWindowPaint(WFrameWindow *fwin)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (fwin->flags.is_client_window_frame)
|
if (fwin->flags.is_client_window_frame)
|
||||||
fwin->flags.justification = wPreferences.title_justification;
|
fwin->flags.justification = wPreferences.title_justification;
|
||||||
|
|
||||||
@@ -685,7 +748,8 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
WREL_RAISED);
|
WREL_RAISED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fwin->resizebar && !fwin->flags.repaint_only_titlebar) {
|
if (fwin->resizebar && !fwin->flags.repaint_only_titlebar
|
||||||
|
&& fwin->resizebar_texture[0]->any.type == WTEX_SOLID) {
|
||||||
Window win;
|
Window win;
|
||||||
int w, h;
|
int w, h;
|
||||||
int cw;
|
int cw;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ typedef struct WFrameWindow {
|
|||||||
WCoreWindow *resizebar; /* bottom resizebar */
|
WCoreWindow *resizebar; /* bottom resizebar */
|
||||||
|
|
||||||
Pixmap title_back[3]; /* focused, unfocused, pfocused */
|
Pixmap title_back[3]; /* focused, unfocused, pfocused */
|
||||||
|
Pixmap resizebar_back[3]; /* any, None, None */
|
||||||
Pixmap lbutton_back[3];
|
Pixmap lbutton_back[3];
|
||||||
Pixmap rbutton_back[3];
|
Pixmap rbutton_back[3];
|
||||||
|
|
||||||
|
|||||||
10
src/main.c
10
src/main.c
@@ -297,11 +297,16 @@ execInitScript()
|
|||||||
|
|
||||||
file = wfindfile(DEF_CONFIG_PATHS, DEF_INIT_SCRIPT);
|
file = wfindfile(DEF_CONFIG_PATHS, DEF_INIT_SCRIPT);
|
||||||
if (file) {
|
if (file) {
|
||||||
|
if (system(file) != 0) {
|
||||||
|
wsyserror(_("%s:could not execute initialization script"), file);
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
if (fork()==0) {
|
if (fork()==0) {
|
||||||
execl("/bin/sh", "/bin/sh", "-c",file, NULL);
|
execl("/bin/sh", "/bin/sh", "-c",file, NULL);
|
||||||
wsyserror(_("%s:could not execute initialization script"), file);
|
wsyserror(_("%s:could not execute initialization script"), file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
free(file);
|
free(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,11 +319,16 @@ ExecExitScript()
|
|||||||
|
|
||||||
file = wfindfile(DEF_CONFIG_PATHS, DEF_EXIT_SCRIPT);
|
file = wfindfile(DEF_CONFIG_PATHS, DEF_EXIT_SCRIPT);
|
||||||
if (file) {
|
if (file) {
|
||||||
|
if (system(file) != 0) {
|
||||||
|
wsyserror(_("%s:could not execute exit script"), file);
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
if (fork()==0) {
|
if (fork()==0) {
|
||||||
execl("/bin/sh", "/bin/sh", "-c", file, NULL);
|
execl("/bin/sh", "/bin/sh", "-c", file, NULL);
|
||||||
wsyserror(_("%s:could not execute exit script"), file);
|
wsyserror(_("%s:could not execute exit script"), file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
free(file);
|
free(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ showPosition(WWindow *wwin, int x, int y)
|
|||||||
sprintf(num, "%+i %-+i", x, y);
|
sprintf(num, "%+i %-+i", x, y);
|
||||||
fw = wTextWidth(scr->info_text_font->font, num, strlen(num));
|
fw = wTextWidth(scr->info_text_font->font, num, strlen(num));
|
||||||
|
|
||||||
XSetForeground(dpy, gc, scr->window_title_pixel[WS_UNFOCUSED]);
|
XSetForeground(dpy, gc, scr->black_pixel);
|
||||||
|
|
||||||
fh = scr->info_text_font->height;
|
fh = scr->info_text_font->height;
|
||||||
wDrawString(scr->geometry_display, scr->info_text_font, gc,
|
wDrawString(scr->geometry_display, scr->info_text_font, gc,
|
||||||
@@ -149,8 +149,8 @@ showPosition(WWindow *wwin, int x, int y)
|
|||||||
(scr->geometry_display_height-fh)/2 + scr->info_text_font->y,
|
(scr->geometry_display_height-fh)/2 + scr->info_text_font->y,
|
||||||
num, strlen(num));
|
num, strlen(num));
|
||||||
wDrawBevel(scr->geometry_display, scr->geometry_display_width+1,
|
wDrawBevel(scr->geometry_display, scr->geometry_display_width+1,
|
||||||
scr->geometry_display_height+1, scr->resizebar_texture[0],
|
scr->geometry_display_height+1,
|
||||||
WREL_RAISED);
|
scr->widget_texture, WREL_RAISED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,8 +343,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
|||||||
/ wwin->normal_hints->height_inc);
|
/ wwin->normal_hints->height_inc);
|
||||||
fw = wTextWidth(scr->info_text_font->font, num, strlen(num));
|
fw = wTextWidth(scr->info_text_font->font, num, strlen(num));
|
||||||
|
|
||||||
XSetForeground(dpy, scr->info_text_gc,
|
XSetForeground(dpy, scr->info_text_gc, scr->black_pixel);
|
||||||
scr->window_title_pixel[WS_UNFOCUSED]);
|
|
||||||
|
|
||||||
/* Display the height. */
|
/* Display the height. */
|
||||||
wDrawString(scr->geometry_display, scr->info_text_font,
|
wDrawString(scr->geometry_display, scr->info_text_font,
|
||||||
@@ -353,8 +352,8 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
|||||||
(scr->geometry_display_height-fh)/2 +scr->info_text_font->y,
|
(scr->geometry_display_height-fh)/2 +scr->info_text_font->y,
|
||||||
num, strlen(num));
|
num, strlen(num));
|
||||||
wDrawBevel(scr->geometry_display, scr->geometry_display_width+1,
|
wDrawBevel(scr->geometry_display, scr->geometry_display_width+1,
|
||||||
scr->geometry_display_height+1, scr->resizebar_texture[0],
|
scr->geometry_display_height+1,
|
||||||
WREL_RAISED);
|
scr->widget_texture, WREL_RAISED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -484,8 +484,8 @@ createInternalWindows(WScreen *scr)
|
|||||||
attribs.override_redirect = True;
|
attribs.override_redirect = True;
|
||||||
attribs.cursor = wCursor[WCUR_DEFAULT];
|
attribs.cursor = wCursor[WCUR_DEFAULT];
|
||||||
attribs.background_pixmap = None;
|
attribs.background_pixmap = None;
|
||||||
if (scr->resizebar_texture[0])
|
if (scr->widget_texture)
|
||||||
attribs.background_pixel = scr->resizebar_texture[0]->normal.pixel;
|
attribs.background_pixel = scr->widget_texture->normal.pixel;
|
||||||
else
|
else
|
||||||
attribs.background_pixel = scr->light_pixel;
|
attribs.background_pixel = scr->light_pixel;
|
||||||
vmask |= CWColormap;
|
vmask |= CWColormap;
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ typedef struct _WScreen {
|
|||||||
|
|
||||||
union WTexture *menu_title_texture[3];/* menu titlebar texture (tex, -, -) */
|
union WTexture *menu_title_texture[3];/* menu titlebar texture (tex, -, -) */
|
||||||
union WTexture *window_title_texture[3]; /* win textures (foc, unfoc, pfoc) */
|
union WTexture *window_title_texture[3]; /* win textures (foc, unfoc, pfoc) */
|
||||||
struct WTexSolid *resizebar_texture[3];/* window resizebar texture (tex, -, -) */
|
union WTexture *resizebar_texture[3];/* window resizebar texture (tex, -, -) */
|
||||||
|
|
||||||
union WTexture *menu_item_texture; /* menu item texture */
|
union WTexture *menu_item_texture; /* menu item texture */
|
||||||
|
|
||||||
|
|||||||
@@ -44,10 +44,6 @@
|
|||||||
extern WPreferences wPreferences;
|
extern WPreferences wPreferences;
|
||||||
|
|
||||||
|
|
||||||
static Pixmap renderTexture(WScreen *scr, int width, int height,
|
|
||||||
WTexture *texture, int rel);
|
|
||||||
|
|
||||||
|
|
||||||
static void bevelImage(RImage *image, int relief);
|
static void bevelImage(RImage *image, int relief);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -886,7 +886,7 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
wwin->frame = wFrameWindowCreate(scr, window_level,
|
wwin->frame = wFrameWindowCreate(scr, window_level,
|
||||||
x, y, width, height, foo,
|
x, y, width, height, foo,
|
||||||
scr->window_title_texture,
|
scr->window_title_texture,
|
||||||
(WTexture**)scr->resizebar_texture,
|
scr->resizebar_texture,
|
||||||
scr->window_title_pixel,
|
scr->window_title_pixel,
|
||||||
&scr->window_title_gc,
|
&scr->window_title_gc,
|
||||||
&scr->title_font);
|
&scr->title_font);
|
||||||
@@ -1237,7 +1237,7 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
|||||||
wwin->frame_x, wwin->frame_y,
|
wwin->frame_x, wwin->frame_y,
|
||||||
width, height, foo,
|
width, height, foo,
|
||||||
scr->window_title_texture,
|
scr->window_title_texture,
|
||||||
(WTexture**)scr->resizebar_texture,
|
scr->resizebar_texture,
|
||||||
scr->window_title_pixel,
|
scr->window_title_pixel,
|
||||||
&scr->window_title_gc,
|
&scr->window_title_gc,
|
||||||
&scr->title_font);
|
&scr->title_font);
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ static char *options[] = {
|
|||||||
"FTitleBack",
|
"FTitleBack",
|
||||||
"PTitleBack",
|
"PTitleBack",
|
||||||
"UTitleBack",
|
"UTitleBack",
|
||||||
|
"ResizebarBack",
|
||||||
"MenuTitleColor",
|
"MenuTitleColor",
|
||||||
"MenuTextColor",
|
"MenuTextColor",
|
||||||
"MenuDisabledColor",
|
"MenuDisabledColor",
|
||||||
@@ -68,7 +69,7 @@ static char *options[] = {
|
|||||||
"IconBack",
|
"IconBack",
|
||||||
"IconTitleColor",
|
"IconTitleColor",
|
||||||
"IconTitleBack",
|
"IconTitleBack",
|
||||||
"AlternativeMenuStyle",
|
"MenuStyle",
|
||||||
#ifdef TITLE_TEXT_SHADOW
|
#ifdef TITLE_TEXT_SHADOW
|
||||||
"Shadow",
|
"Shadow",
|
||||||
"FShadowColor",
|
"FShadowColor",
|
||||||
|
|||||||
138
util/setstyle.c
138
util/setstyle.c
@@ -51,6 +51,7 @@ char *FontOptions[] = {
|
|||||||
char *ProgName;
|
char *ProgName;
|
||||||
int ignoreFonts = 0;
|
int ignoreFonts = 0;
|
||||||
|
|
||||||
|
Display *dpy;
|
||||||
|
|
||||||
char*
|
char*
|
||||||
defaultsPathForDomain(char *domain)
|
defaultsPathForDomain(char *domain)
|
||||||
@@ -127,6 +128,69 @@ hackPaths(proplist_t style, char *prefix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static proplist_t
|
||||||
|
getColor(proplist_t texture)
|
||||||
|
{
|
||||||
|
proplist_t value, type;
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
type = PLGetArrayElement(texture, 0);
|
||||||
|
if (!type)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
value = NULL;
|
||||||
|
|
||||||
|
str = PLGetString(type);
|
||||||
|
if (strcasecmp(str, "solid")==0) {
|
||||||
|
value = PLGetArrayElement(texture, 1);
|
||||||
|
} else if (strcasecmp(str, "dgradient")==0
|
||||||
|
|| strcasecmp(str, "hgradient")==0
|
||||||
|
|| strcasecmp(str, "vgradient")==0) {
|
||||||
|
proplist_t c1, c2;
|
||||||
|
int r1, g1, b1, r2, g2, b2;
|
||||||
|
char buffer[32];
|
||||||
|
|
||||||
|
c1 = PLGetArrayElement(texture, 1);
|
||||||
|
c2 = PLGetArrayElement(texture, 2);
|
||||||
|
if (!dpy) {
|
||||||
|
if (sscanf(PLGetString(c1), "#%2x%2x%2x", &r1, &g1, &b1)==3
|
||||||
|
&& sscanf(PLGetString(c2), "#%2x%2x%2x", &r2, &g2, &b2)==3) {
|
||||||
|
sprintf(buffer, "#%2x%2x%2x", (r1+r2)/2, (g1+g2)/2,
|
||||||
|
(b1+b2)/2);
|
||||||
|
value = PLMakeString(buffer);
|
||||||
|
} else {
|
||||||
|
value = c1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
XColor color1;
|
||||||
|
XColor color2;
|
||||||
|
|
||||||
|
XParseColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)),
|
||||||
|
PLGetString(c1), &color1);
|
||||||
|
XParseColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)),
|
||||||
|
PLGetString(c1), &color2);
|
||||||
|
|
||||||
|
sprintf(buffer, "#%4x%4x%4x", (color1.red+color2.red)/2,
|
||||||
|
(color1.green+color2.green)/2,
|
||||||
|
(color1.blue+color2.blue)/2);
|
||||||
|
value = PLMakeString(buffer);
|
||||||
|
}
|
||||||
|
} else if (strcasecmp(str, "mdgradient")==0
|
||||||
|
|| strcasecmp(str, "mhgradient")==0
|
||||||
|
|| strcasecmp(str, "mvgradient")==0) {
|
||||||
|
|
||||||
|
value = PLGetArrayElement(texture, 1);
|
||||||
|
|
||||||
|
} else if (strcasecmp(str, "tpixmap")==0
|
||||||
|
|| strcasecmp(str, "cpixmap")==0
|
||||||
|
|| strcasecmp(str, "spixmap")==0) {
|
||||||
|
|
||||||
|
value = PLGetArrayElement(texture, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* since some of the options introduce incompatibilities, we will need
|
* since some of the options introduce incompatibilities, we will need
|
||||||
@@ -142,6 +206,7 @@ hackStyle(proplist_t style)
|
|||||||
proplist_t tmp;
|
proplist_t tmp;
|
||||||
int i;
|
int i;
|
||||||
int foundIconTitle = 0;
|
int foundIconTitle = 0;
|
||||||
|
int foundResizebarBack = 0;
|
||||||
|
|
||||||
keys = PLGetAllDictionaryKeys(style);
|
keys = PLGetAllDictionaryKeys(style);
|
||||||
|
|
||||||
@@ -168,6 +233,8 @@ hackStyle(proplist_t style)
|
|||||||
if (strcasecmp(str, "IconTitleColor")==0
|
if (strcasecmp(str, "IconTitleColor")==0
|
||||||
|| strcasecmp(str, "IconTitleBack")==0) {
|
|| strcasecmp(str, "IconTitleBack")==0) {
|
||||||
foundIconTitle = 1;
|
foundIconTitle = 1;
|
||||||
|
} else if (strcasecmp(str, "ResizebarBack")==0) {
|
||||||
|
foundResizebarBack = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,48 +249,9 @@ hackStyle(proplist_t style)
|
|||||||
|
|
||||||
tmp = PLGetDictionaryEntry(style, PLMakeString("FTitleBack"));
|
tmp = PLGetDictionaryEntry(style, PLMakeString("FTitleBack"));
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
proplist_t type;
|
|
||||||
proplist_t value;
|
proplist_t value;
|
||||||
char *str;
|
|
||||||
|
|
||||||
type = PLGetArrayElement(tmp, 0);
|
value = getColor(tmp);
|
||||||
if (!type)
|
|
||||||
return;
|
|
||||||
|
|
||||||
value = NULL;
|
|
||||||
|
|
||||||
str = PLGetString(type);
|
|
||||||
if (strcasecmp(str, "solid")==0) {
|
|
||||||
value = PLGetArrayElement(tmp, 1);
|
|
||||||
} else if (strcasecmp(str, "dgradient")==0
|
|
||||||
|| strcasecmp(str, "hgradient")==0
|
|
||||||
|| strcasecmp(str, "vgradient")==0) {
|
|
||||||
proplist_t c1, c2;
|
|
||||||
int r1, g1, b1, r2, g2, b2;
|
|
||||||
char buffer[32];
|
|
||||||
|
|
||||||
c1 = PLGetArrayElement(tmp, 1);
|
|
||||||
c2 = PLGetArrayElement(tmp, 2);
|
|
||||||
if (sscanf(PLGetString(c1), "#%2x%2x%2x", &r1, &g1, &b1)==3
|
|
||||||
&& sscanf(PLGetString(c2), "#%2x%2x%2x", &r2, &g2, &b2)==3) {
|
|
||||||
sprintf(buffer, "#%2x%2x%2x", (r1+r2)/2, (g1+g2)/2,
|
|
||||||
(b1+b2)/2);
|
|
||||||
value = PLMakeString(buffer);
|
|
||||||
} else {
|
|
||||||
value = c1;
|
|
||||||
}
|
|
||||||
} else if (strcasecmp(str, "mdgradient")==0
|
|
||||||
|| strcasecmp(str, "mhgradient")==0
|
|
||||||
|| strcasecmp(str, "mvgradient")==0) {
|
|
||||||
|
|
||||||
value = PLGetArrayElement(tmp, 1);
|
|
||||||
|
|
||||||
} else if (strcasecmp(str, "tpixmap")==0
|
|
||||||
|| strcasecmp(str, "cpixmap")==0
|
|
||||||
|| strcasecmp(str, "spixmap")==0) {
|
|
||||||
|
|
||||||
value = PLGetArrayElement(tmp, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
PLInsertDictionaryEntry(style, PLMakeString("IconTitleBack"),
|
PLInsertDictionaryEntry(style, PLMakeString("IconTitleBack"),
|
||||||
@@ -232,9 +260,29 @@ hackStyle(proplist_t style)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PLGetDictionaryEntry(style, PLMakeString("AlternativeMenuStyle"))) {
|
if (!foundResizebarBack) {
|
||||||
PLInsertDictionaryEntry(style, PLMakeString("AlternativeMenuStyle"),
|
/* set the default values */
|
||||||
PLMakeString("NO"));
|
tmp = PLGetDictionaryEntry(style, PLMakeString("UTitleBack"));
|
||||||
|
if (tmp) {
|
||||||
|
proplist_t value;
|
||||||
|
|
||||||
|
value = getColor(tmp);
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
proplist_t t;
|
||||||
|
|
||||||
|
t = PLMakeArrayFromElements(PLMakeString("solid"), value,
|
||||||
|
NULL);
|
||||||
|
PLInsertDictionaryEntry(style, PLMakeString("ResizebarBack"),
|
||||||
|
t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!PLGetDictionaryEntry(style, PLMakeString("MenuStyle"))) {
|
||||||
|
PLInsertDictionaryEntry(style, PLMakeString("MenuStyle"),
|
||||||
|
PLMakeString("normal"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,6 +325,8 @@ main(int argc, char **argv)
|
|||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
dpy = XOpenDisplay("");
|
||||||
|
|
||||||
ProgName = argv[0];
|
ProgName = argv[0];
|
||||||
|
|
||||||
if (argc<2) {
|
if (argc<2) {
|
||||||
@@ -380,10 +430,8 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
PLSave(prop, YES);
|
PLSave(prop, YES);
|
||||||
{
|
{
|
||||||
Display *dpy;
|
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
dpy = XOpenDisplay("");
|
|
||||||
if (dpy) {
|
if (dpy) {
|
||||||
int i;
|
int i;
|
||||||
char *msg = "Reconfigure";
|
char *msg = "Reconfigure";
|
||||||
|
|||||||
Reference in New Issue
Block a user