Subject: FVWM: Own mouse pointers: define hot spot?

From: Felix Kater <[email-masked]>
Date: Mon, 12 Aug 2002 16:07:04 +0200

Hi,

I created an xpm file as a new mouse pointer. This works fine. But can
you tell me how to define the hotspot?

I guess I should be able do it with a graphics application like the gimp
and define it inside the xpm file. But up to now I don't find any
command to do it. Could you tell me how you do it?

Thank You,
 Felix
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 12 Aug 2002 16:53:13 +0200

> command to do it. Could you tell me how you do it?

I've never found out how to create an xpm with a hotspot.  But you
can trick fvwm into using the correct hotspot by using a larger
image and shifting it so that the hotspot is in the middle of the
picture.  E.g. if your image looks like this:

  *xx..
  xx...
  x.x..
  ...x.
  ....x

  * = hotspot
  x = black
  . = transparent

Pad it like this:

  .........
  .........
  .........
  .........
  ....*xx..
  ....xx...
  ....x.x..
  .......x.
  ........x

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Mon, 12 Aug 2002 11:11:40 -0400

> picture.  E.g. if your image looks like this:

Heres how to create an XPM with a hotspot (from the XPM docs):

The Values-string is a single  string that must contain four  integers
that correspond to the  width and height of  the pixmap, the number of
colors in the  pixmap, and the number  of characters per  pixel in the
color specification.  The string  can  optionally specify the  hotspot
coordinates   and  the   word  XPMEXT   if   the  pixmap  includes  an
Extensions-string.

The format of the string is as follows:
 width height ncolors cpp [x_hotspot y_hotspot] [XPMEXT]

The hotspot is available to the program thru the XpmAttributes
structure.

-- 
Dan Espen                           E-mail: [email-masked]
444 Hoes Lane  Room RRC 1C-214      Phone: (732) 699-5570
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 12 Aug 2002 17:38:14 +0200

> The hotspot is available to the program thru the XpmAttributes

Could you put that in the FAQ?

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Mon, 12 Aug 2002 11:49:54 -0400

> Could you put that in the FAQ?

Sure.

I haven't checked that Fvwm actually uses the hotspot if defined.
I'll check if you haven't done so already.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 12 Aug 2002 18:10:16 +0200

> I'll check if you haven't done so already.

As far as I remember, I implemented hotspot handling with the
pixmap cursors a while ago.  From cursors.c:

  if (!PImageLoadCursorPixmapFromFile(
    dpy, Scr.Root, path, &source, &mask, &x, &y))
                                         ^^^^^^ hotspot coords
  ...
  Scr.FvwmCursors[index] = XCreatePixmapCursor(
    dpy, source, mask, &(colors[0]), &(colors[1]), x, y);
                                                   ^^^^

Bye

Dominik ^_^  ^_^

---

From: Gregg Dameron <[email-masked]>
Date: Mon, 12 Aug 2002 10:42:38 -0600

>     dpy, source, mask, &(colors[0]), &(colors[1]), x, y);

I can confirm that fvwm (2.4.7) honors cursor hotspots.  On Solaris, I
use the "dticon" utility to create most of the cursors I use.  Dticon
lets you set a cursor's hotspot with a mouse click on its enlarged image.

Gregg Dameron

---

From: Bruce M Beach <[email-masked]>
Date: Tue, 13 Aug 2002 09:41:58 +0000 (UTC)

On Mon, 12 Aug 2002, Gregg Dameron wrote:

> > > Sure.     ...................

    I noticed that there was a facility shipped with the standard xwindows
    distribution called "bitmap"  which seems to do what is wanted. ie
    set the hotspot.

    Bruce

[email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 13 Aug 2002 02:19:36 +0000

>     distribution called "bitmap"  which seems to do what is wanted. ie

bitmap creates xbm files, not xpm. Two xbms are needed to define a cursor
(in some other WMs) and only one xpm in FVWM, because 3 colors are used.

I think I will just add a small example of such xpm (from fvwm-themes) to
the man page. But then the FAQ entry is a bit redudant. :)

Regards,
Mikhael.