Page 1 of 1

JWM title bar window buttons bitmask? [SOLVED]

Posted: Wed 08 Aug 2012, 08:46
by Argolance
Hello,
In earlier version of jwm, it was possible to replace default JWM window title bar buttons pictures with xbm pictures (such as ".jwm-bClose.xbm", etc.) copied inside home directory. This seems not to work with latest version of jwm.

Does somebody know how to do this nevertheless?

Cordialement.

Posted: Fri 10 Aug 2012, 18:09
by technosaurus
You can always change the hard coded ones... Otherwise can you point to a version that works as such?

Posted: Sat 11 Aug 2012, 00:29
by `f00
reply here in eyecandy ยง..

Posted: Sat 11 Aug 2012, 10:38
by Argolance
Hello,
Cannot answer to your post because thread is locked! So I do it here...
Yes, it was back when Patriot was doing betas of jwm for translucency effects
I noticed that (with latest JWM versions) it is no need anymore to configure the Xorg file for tranlucency effects: they work out of the box.
Option "Composite" "Enable"
and
Section "Extensions"
Option "Composite" "Enable"
EndSection
This should cover some of the versions to use masks for titlebar buttons
This thread learned me how to use the xbm pictures to replace standard window buttons.
I never got the fancy effects like icewm, pekwm and 'box looks can give (prelight, animation, 3D borders and so on)
Yes, it is true but, (I don't know why?), I like JWM and Rox, which are as both lungs of original Puppy...
Though it should be a great thing Joe to enhanced his wonderful WM, especially these window buttons...

Cordialement.

Posted: Sat 11 Aug 2012, 23:49
by technosaurus
use the source Luke

I use grep -i (case insensitive) to find likely candidates

grep -i 0x * --> border.c

leads to bmpfiles also in border.c, which pointed setbuttonmask to parse.c which leads to TOK_BUTTON... in lex.c and from there you can see that the tags are:
  • "ButtonClose",
    "ButtonMax",
    "ButtonMaxActive",
    "ButtonMin",
but I think if you do one, you may have to do them all (looking at the code it looked like it did either/or) so something like

Code: Select all

<ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
<ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
<ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
<ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>
I assume they can just be in the pixmap path, but don't have the properly sized xbm files around to test, but I did one of them for reference:

Code: Select all

#define close_width 16
#define close_height 16
static unsigned char close_bits[] = {
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x30, 0x06, 0x70, 0x07,
0xE0, 0x03, 0xC0, 0x01,
0xE0, 0x03, 0x70, 0x07,
0x30, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
save as close.xbm and open in mtpaint

Posted: Sun 12 Aug 2012, 06:23
by technosaurus
rather than editing my last post I'll just condense it:

the jwmrc (or its template or one of its include files) should have any/all of these tags containing the full path to 16x16 xbm image(s)

Code: Select all

   <ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
   <ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
   <ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
   <ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>
anyone want to do ttuuxxx's paw prints from his icewm theme?

Posted: Sun 12 Aug 2012, 07:36
by technosaurus
another example based on paws and bones

Posted: Sun 12 Aug 2012, 07:56
by technosaurus
and mac-ish circles

Posted: Sun 12 Aug 2012, 10:16
by Argolance
Hello technosaurus,
Waou! :D !
Thank you a lot: this is quite perfect. I thought this would be more complicated! Possible pictures are obviously a bit poor but it is better than nothing...

Cordialement.

Posted: Sun 12 Aug 2012, 18:05
by technosaurus
I am 90% sure the xbm format is a holdover from early versions. It is feasible to patch it for xpm/png/jpg, but it would also make themeing more complex and add a small amount of overhead... Probably not worth it since icewm basically does that already.

Posted: Sun 12 Aug 2012, 20:57
by `f00
How hard would it be code-wise to make the three 'standard' buttons multifunction (according to which mousebutton is clicked)? This is a real convenience for mouse users and one of the reasons I regularly switch out of jwm - the scrollwheel on my old mouse died quite some time ago so shading is a bit awkward in jwm, plus I use vertical/horizontal maximize much more often than full. The close button is fine as-is since if the window needs killing, chances are the button on it won't work anyway.

I'm thinking something along the lines of

Code: Select all

minimize-button        maximize-button                    close-button
m1=minimize/m2=shade   m1=full/m2=vertical/m3=horizontal  m(any)=close
nice job on the variations (new looks keep things from getting stale)

Posted: Mon 13 Aug 2012, 03:34
by technosaurus
some 3d-ish buttons

Posted: Mon 13 Aug 2012, 07:09
by Argolance
Hello,
nice job on the variations (new looks keep things from getting stale)
:)
As well as I think it is a pity to drink some good wine in a plastic timbale mold (even if a glass is a bit... heavier...)!

Cordialement.

Posted: Tue 28 Aug 2012, 12:43
by 01micko
I have been following this thread as I made a patch requested by Mavrothal for the OLPC to enlarge the deco in JWM.

I have followed your lead Argolance and made a "switcher". It is called from the jwm settings gui in the Desktop menu. It is possible (easy really) to add more themes, or delete the stock ones.

Be aware that the xdg template I attach is for Slacko (don't know the consequences in other pups, be warned) and so optional. You probably should add the code that technosaurus posted to your jwmrc-personal file;

Code: Select all

  <ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
   <ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
   <ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
   <ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>	

Posted: Tue 28 Aug 2012, 15:21
by Argolance
Hello,
It is a pity that JWM doesn't yet support anti aliasing: pictures are somewhat rough and I think, as JWM "lover", that it is no need sophisticated pictures to be displayed as window buttons: just smoothed simple pictures... This would be great and should be taken into account for the next releases!

Cordialement.

Posted: Thu 08 Nov 2012, 11:17
by mavrothal
01micko wrote: Be aware that the xdg template I attach is for Slacko (don't know the consequences in other pups, be warned) and so optional.
Only took 2 months to stumbled upon this one... :oops:

What about dropping jwm_xdg_template-0.1-hack.pet for a jwm_window_decor-switcher-0.1.pet pinstall like this:

Code: Select all

if [ -f /etc/xdg/templates/_root_.jwmrc ] ; then
	sed -i "s/<\/JWM>//" /etc/xdg/templates/_root_.jwmrc
	cat << EOF >> /etc/xdg/templates/_root_.jwmrc

	<!-- window buttons -->
	<ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
	<ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
	<ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
	<ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>

</JWM>
EOF
fi
Should work in any JWM puppy. No?

Later Yeap. It does. Here is Micko's pet with this change. Tested in a couple of puppies OK

Posted: Tue 19 Mar 2013, 01:41
by scsijon
As a reply from joe I thought it might be appropriate to copy.
It's possible (and was done in the past). I removed this feature so that JWM would draw the buttons scaled to the right size (JWM now uses Xlib drawing primitives rather than bitmaps).
I probably won't implement this (at least not in the near future) though since I would like to keep JWM as lean as possible.
regards
scsijon

ps JWM has it's own thread under Desktops.