File: modules.html

package info (click to toggle)
fvwm2 2.0.46-BETA-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,172 kB
  • ctags: 5,559
  • sloc: ansic: 52,902; cpp: 2,465; perl: 2,275; python: 779; sh: 604; makefile: 221
file content (511 lines) | stat: -rw-r--r-- 26,320 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>The Fvwm Module Interface</TITLE>
<META NAME="description" CONTENT="The Fvwm Module Interface">
<META NAME="keywords" CONTENT="modules">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="modules.css">
</HEAD>
<BODY LANG="EN" >
<H1 ALIGN=CENTER>The Fvwm-2.xx Module Interface</H1>
<!-- <P ALIGN=CENTER><STRONG>Robert J. Nation</STRONG></P><P>
<P ALIGN=CENTER><STRONG>February 28, 1997</STRONG></P><P> -->
<hr>
<P>
<H1><A NAME="SECTION00010000000000000000">Important Changes Since Fvwm-1.xx</A></H1>
<P>
The module interface remained fairly stable when going from Fvwm-1.xx
to Fvwm-2.xx. The change most likely to affect modules is the addition
of an extra value to the header. This value is a timestamp. Most
modules contained the line:
<PRE>	unsigned long header[3];</PRE>
This should be changed to:
<PRE>	unsigned long header[HEADER_SIZE];</PRE>
The rest of the changes are handled in the library function
ReadFvwmPacket.
<P>
Another notable change is that modules do not have to read the .fvwmrc
file themselves. They can request the appropriate lines from fvwm:
<PRE>	char *tline;

	GetConfigLine(fd, &amp;tline);
	while(tline != NULL)
	  {
	    /* Parse the line as needed */

	    /* Get a new line */
           GetConfigLine(fd, &amp;tline);	
	  }</PRE>
This will be the preferred method of getting module-specific
configuration lines in the future.
<P>
In fvwm-2.0 pl 1, I also had fvwm parse out the command line arguments
for the modules, so if the user said ``FvwmPager 2 4'', the module
will see argv[6] = 2 and argv[7] = 4, instead of argv[6] = ``2 4''.
<P>
Some new packet types were defined, and a few values were added to
some packet types.
<P>
<H1><A NAME="SECTION00020000000000000000">Concept</A></H1>
<P>
The module interface had several design goals:
<UL>
<LI>Modules (user programs) should be able to provide the window
manager with a limited amount of instruction regarding instructions to
execute.
<LI>Modules should not be able to corrupt the internal data bases
maintained by Fvwm, nor should unauthorized modules be able to
interface to Fvwm.
<LI>Modules should be able to extract all or nearly all information
held by the window manager, in a simple manner, to provide users with
feedback not available from built in services.
<LI>Modules should gracefully terminate when the window manager
dies, quits, or is re-started.
<LI>It should be possible for programmer-users to add modules
without understanding the internals of Fvwm. Ideally, modules could be
written in some scripting language such as Tcl/Tk.
</UL>
These goals have not entirely been met at this point, as the module
interface is a work in progress.
<P>
<H1><A NAME="SECTION00030000000000000000">Implementation Overview</A></H1>
<P>
Although the module interface is not complete, some details of its
implementation are available.
<H2><A NAME="SECTION00031000000000000000">Security</A></H2>
<P>
Limited effort has been placed on security issues. In short, modules
can not communicate with Fvwm unless they are launched by Fvwm, which
means that they must be listed in the user's .fvwmrc file.
Modules can only issue commands to Fvwm that could be issued from a
menu or key binding. These measures do not keep a poorly written
module from destroying windows or terminating an X session, but they
do keep users from maliciously connecting to another users window
manager, and it should keep modules from corrupting the Fvwm internal 
databases.
<H2><A NAME="SECTION00032000000000000000">Interface and Initialization Mechanism</A></H2>
<P>
Modules MUST be launched by Fvwm. Fvwm will first open a pair of pipes
for communication with the module. One pipe is for messages to Fvwm
from the module, and the other is for messages to the module from
Fvwm. Each module has its own pair of pipes. After the pipes are open,
Fvwm will fork and spawn the module. Modules must be located in the
ModulePath, as specified in the user's .fvwmrc file. Modules can be
initiated as fvwm starts up, or can be launched part way through an X
session.
<P>
The pipes already will be open when the module starts execution. The
integer file descriptor are passed to the module as the first and
second command line arguments. The third command line argument is the
full path name of the last configuration file that fvwm read in.
The next command line argument is the application
window in whose context the module was launched. This will be 0 if the
module is launched without an application window context. The next
argument is the context of the window decoration in which the module
was launched. Contexts are listed below:
<PRE>#define C_NO_CONTEXT 	 0 - launched during initialization
#define C_WINDOW	 1 - launched from an application window
#define C_TITLE		 2 - launched from a title bar
#define C_ICON		 4 - launched from an icon window
#define C_ROOT		 8 - launched from the root window
#define C_FRAME		16 - launched from a corner piece
#define C_SIDEBAR       32 - launched from a side-bar
#define C_L1            64 - launched from left button #1
#define C_L2           128 - launched from left button #2
#define C_L3           256 - launched from left button #3
#define C_L4           512 - launched from left button #4
#define C_L5          1024 - launched from left button #5
#define C_R1          2048 - launched from right button #1
#define C_R2          4096 - launched from right button #2
#define C_R3          8192 - launched from right button #3
#define C_R4         16384 - launched from right button #4
#define C_R5         32768 - launched from right button #5</PRE>
A number of user specified command line arguments may be present
(optional). Up to 35 arguments may be passed. For example, in:
<PRE>	Module	&quot;FvwmIdentify&quot;	FvwmIdentify Hello rob! ``-fg purple''</PRE>
we would get argv[6] = ``Hello'', argv[7] = ``rob!'', argv[8] = ``-fg purple''.
<P>
The following mechanism is recommended to acquire the pipe
descriptors:
<PRE>int fd[2];
void main(int argc, char **argv)
{
  if((argc &lt; 6))
    {	
      fprintf(stderr,&quot;Modules should only be executed by fvwm!\n&quot;);
      exit(1);
    }
  fd[0] = atoi(argv[1]);
  fd[1] = atoi(argv[2]);</PRE>
<P>
The descriptor fd[0] is available for the module to send messages to
fvwm, while the descriptor fd[1] is available to read messages from
fvwm.
<P>
Special attention is paid to the status of the pipe. If Fvwm gets a
read error on a module-to-fvwm  pipe, then it assumes that the module 
is terminating,
and all communication with the module is terminated. Similarly, if a
module gets a read error on an fvwm-to-module pipe, then it should
assume that fvwm is terminating, and it should gracefully shut down.
All modules should also allow themselves to be shut down via the
Delete Window protocol for X-11.
<P>
In previous implementations, the modules were expected to read and
parse the .fvwmrc file by themselves. This caused some difficulty if a
pre-processor was used on the .fvwmrc file. In fvwm-2.0 and later,
fvwm retains the module command lines (those which start with a
``*''), and will pass them to any module on request. Modules can
request the command list by sending a ``Send_ConfigInfo'' command to
fvwm.
<P>
<H1><A NAME="SECTION00040000000000000000">Module-to-Fvwm Communication</A></H1>
<P>
Modules communicate with fvwm via a simple protocol. In essence, a
textual command line, similar to a command line which could be bound
to a mouse, or key-stroke in the .fvwmrc, is transmitted to fvwm.
<P>
First, the module should send the ID of the window which should be
manipulated. A window ID of ``None'' may be used, in which case Fvwm
will prompt the user to select  a window if needed. Next, length of
the the command line is send as an integer. After that, the command
line itself is sent. Finally, an integer 1 is sent if the module plans
to continue operating, or 0 if the module is finished. The following
subroutine is provided as an example of a suitable method of sending
messages to fvwm:
<PRE>void SendInfo(int *fd,Window win, char *message)
{
  int w;

  if((message != NULL)&amp;&amp;(strlen(message) &gt;0))
    {	
      /* if win == None, then Fvwm will prompt the user for a window
       * on which to operate, if needed. Some commands, like Exec,
       * don't operate on a window, so None is appropriate. */
       write(fd[0],&amp;win,sizeof(Window));
      
      /* calculate the length of the message */
      w=strlen(message);
      /* send the message length */
      write(fd[0],&amp;w,sizeof(int));
      /* send the message itself
      write(fd[0],message,w);

      /* send a 1, indicating that this module will keep going */
      /* a 0 would mean that this module is done */
      w=1;
      write(fd[0],&amp;w,sizeof(int));
    }
}</PRE>
This routine is available as a library function in libfvwmlib.
<P>
There are special built-in functions, Send_WindowList and
Send_ConfigInfo.
Send_WindowList causes fvwm to transmit everything that it is
currently thinking about to the module which requests the information.
This information contains the paging status (enabled/disabled),
current desktop number, position on the desktop, current focus and,
for each window, the window configuration, window, icon, and class
names, and, if the window is iconified, the icon location and size.
Send_ConfigInfo causes fvwm to send the module a list of all
commands it has received which start with a ``*'', as will as the
pixmap-path and icon-paths that fvwm is using.
<P>
An additional special function has been added to fvwm, which is used
to control exactly what information fvwm passes to each module. The
command Set_Mask, followed by a number which is the bitwise OR of the
packet-type values which the module wishes to receive. If the module
never sends the Set_Mask command, then all message types will be
sent. A library function, SetMessageMask, exists to make it easy to
set this mask. This mask should be used to reduce the amount of
communication between fvwm and its modules to a minimum.
<P>
<H1><A NAME="SECTION00050000000000000000">Fvwm-to-Module Communication</A></H1>
<P>
Fvwm
can send messages to the modules in either a broadcast mode, or a
module specific mode. Certain messages regarding important window or
desktop manipulations will be broadcast to all modules, whether they 
want it or not. Modules are able to request information about current windows
from fvwm, via the Send_WindowList built-in. When invoked this way,
only requesting module will receive the data.
<P>
Packets from fvwm to modules conform to a standard format, so modules
which are not interested in broadcast messages can easily ignore them.
A header consisting of 4 unsigned long integers, followed by a body of
a variable length make up a packet. The header always begins with
0xffffffff. This is provided to help modules re-synchronize to the
data stream if necessary. The next entry describes the packet type.
Existing packet types are listing in the file module.h:
<PRE>#define M_NEW_PAGE           (1)
#define M_NEW_DESK           (1&lt;&lt;1)
#define M_ADD_WINDOW         (1&lt;&lt;2)
#define M_RAISE_WINDOW       (1&lt;&lt;3)
#define M_LOWER_WINDOW       (1&lt;&lt;4)
#define M_CONFIGURE_WINDOW   (1&lt;&lt;5)
#define M_FOCUS_CHANGE       (1&lt;&lt;6)
#define M_DESTROY_WINDOW     (1&lt;&lt;7)
#define M_ICONIFY            (1&lt;&lt;8)
#define M_DEICONIFY          (1&lt;&lt;9)
#define M_WINDOW_NAME        (1&lt;&lt;10)
#define M_ICON_NAME          (1&lt;&lt;11)
#define M_RES_CLASS          (1&lt;&lt;12)
#define M_RES_NAME           (1&lt;&lt;13)
#define M_END_WINDOWLIST     (1&lt;&lt;14)
#define M_ICON_LOCATION      (1&lt;&lt;15)
#define M_MAP                (1&lt;&lt;16)
#define M_ERROR              (1&lt;&lt;17)
#define M_CONFIG_INFO        (1&lt;&lt;18)
#define M_END_CONFIG_INFO    (1&lt;&lt;19)</PRE>
<P>
Additional packet types will be defined in the future. The third entry
in the header tells the total length of the packet, in unsigned longs,
including the header. The fourth entry is the last time stamp received
from the X server, which is expressed in milliseconds.
<P>
The body information is packet specific, as described below.
<H2><A NAME="SECTION00051000000000000000">M_NEW_PAGE</A></H2>
<P>
These packets contain 5 integers. The first two are the x and y
coordinates of the upper left corner of the current viewport on the
virtual desktop. The third value is the number of the current desktop.
The fourth and fifth values are the maximum allowed values of the
coordinates of the upper-left hand corner of the viewport.
<P>
<H2><A NAME="SECTION00052000000000000000">M_NEW_DESK</A></H2>
<P>
The body of this packet consists of a single long integer, whose value
is the number of the currently active desktop. This packet is
transmitted whenever the desktop number is changed.
<P>
<H2><A NAME="SECTION00053000000000000000">M_ADD_WINDOW, and M_CONFIGURE_WINDOW</A></H2>
<P>
These packets contain 24 values. The first 3 identify the window, and
the next twelve identify the location and size, as described in the
table below. Configure packets will be generated when the
viewport on the current desktop changes, or when the size or location
of the window is changed. The flags field is an bitwise OR of the
flags defined in fvwm.h.
<P>
<P><DIV ALIGN=CENTER><P ALIGN=CENTER><TABLE COLS=2 BORDER FRAME=BOX RULES=GROUPS>
<COLGROUP><COL ALIGN=LEFT><COLGROUP><COL ALIGN=LEFT>
<TBODY>
<TR><TD VALIGN=BASELINE ALIGN=CENTER NOWRAP COLSPAN=2>
Format for Add and Configure Window Packets</TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>Byte </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>Significance </TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>0    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 0xffffffff - Start of packet </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
1    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> packet type </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
2    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> length of packet, including header, expressed in long integers
</TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>3    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> ID of the application's top level window </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
4    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> ID of the Fvwm frame window </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
5    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Pointer to the Fvwm database entry </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
6    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> X location of the window's frame </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
7    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Y location of the window's frame</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
8    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Width of the window's frame (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
9    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Height of the window's frame (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
10   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Desktop number</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>  
11   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Windows flags field</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
12   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Title Height (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
13   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Border Width (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
14   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Base Width (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
15   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Base Height (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
16   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Resize Width Increment(pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
17   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Resize Height Increment (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
18   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Minimum Width (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
19   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Minimum Height (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
20   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Maximum Width Increment(pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   
21   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Maximum Height Increment (pixels) </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
22   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Icon Label Window ID, or 0</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
23   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Icon Pixmap Window ID, or 0</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>  
24   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Window Gravity</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>   \
25   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Pixel value of the text color </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
26   </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Pixel value of the window border color </TD></TR>
</TBODY>
</TABLE>
</P></DIV><P><H2><A NAME="SECTION00054000000000000000">M_LOWER_WINDOW, M_RAISE_WINDOW, and M_DESTROY</A></H2>
<P>
These packets contain 3 values, all of the same size as an unsigned
long. The first value is the ID of the affected application's top level
window, the next is the ID of the Fvwm frame window, and the final
value is the pointer to Fvwm's internal database entry for that
window. Although the pointer itself is of no use to a module, it can
be used as a reference number when referring to the window.
<P>
<P><DIV ALIGN=CENTER><P ALIGN=CENTER><TABLE COLS=2 BORDER FRAME=BOX RULES=GROUPS>
<COLGROUP><COL ALIGN=LEFT><COLGROUP><COL ALIGN=LEFT>
<TBODY>
<TR><TD VALIGN=BASELINE ALIGN=CENTER NOWRAP COLSPAN=2>
Format for Lower, Raise, and Focus Change Packets</TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>Byte </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>Significance </TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>0    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 0xffffffff - Start of packet </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
1    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> packet type </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
2    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> length of packet, including header, expressed in long integers
</TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>3    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> ID of the application's top level window </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
4    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> ID of the Fvwm frame window </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
5    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Pointer to the Fvwm database entry </TD></TR>
</TBODY>
</TABLE>
</P></DIV><P><H2><A NAME="SECTION00055000000000000000">M_FOCUS_CHANGE</A></H2>
<P>
These packets contain 5 values, all of the same size as an unsigned
long. The first value is the ID of the affected application's (the
application which now has the input focus) top level
window, the next is the ID of the Fvwm frame window, and the final
value is the pointer to Fvwm's internal database entry for that
window. Although the pointer itself is of no use to a module, it can
be used as a reference number when referring to the window. The fourth
and fifth values are the text focus color's pixel value and the window
border's focus color's pixel value. In the
event that the window which now has the focus is not a window which
fvwm recognizes, only the ID of the affected application's top level
window is passed. Zeros are passed for the other values.
<P>
<H2><A NAME="SECTION00056000000000000000">M_ICONIFY and M_ICON_LOCATION</A></H2>
<P>
These packets contain 7 values. The first 3 are the usual identifiers,
and the next four describe the location and size of the icon window,
as described in the table. Note that M_ICONIFY packets will be sent
whenever a window is first iconified, or when the icon window is changed
via the XA_WM_HINTS in a property notify event. An M_ICON_LOCATION
packet will be sent when the icon is moved.
In addition, if a window which has transients is
iconified, then an M_ICONIFY packet is sent for each transient
window, with the x, y, width, and height fields set to 0. This packet
will be sent even if the transients were already iconified. Note that
no icons are actually generated for the transients in this case.
<P>
<P><DIV ALIGN=CENTER><P ALIGN=CENTER><TABLE COLS=2 BORDER FRAME=BOX RULES=GROUPS>
<COLGROUP><COL ALIGN=LEFT><COLGROUP><COL ALIGN=LEFT>
<TBODY>
<TR><TD VALIGN=BASELINE ALIGN=CENTER NOWRAP COLSPAN=2>
Format for Iconify and Icon Location Packets</TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>Byte </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>Significance </TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>0    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 0xffffffff - Start of packet </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
1    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> packet type </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
2    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> length of packet, including header, expressed in long integers
</TD></TR>
</TBODY><TBODY>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP>3    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> ID of the application's top level window </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
4    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> ID of the Fvwm frame window </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
5    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Pointer to the Fvwm database entry </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
6    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> X location of the icon's frame </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
7    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Y location of the icon's frame</TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
8    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Width of the icon's frame </TD></TR>
<TR><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> 
9    </TD><TD VALIGN=BASELINE ALIGN=LEFT NOWRAP> Height of the icon's frame </TD></TR>
</TBODY>
</TABLE>
</P></DIV><P><H2><A NAME="SECTION00057000000000000000">M_DEICONIFY</A></H2>
<P>
These packets contain 3 values, which are the usual window
identifiers. The packet is sent when a window is de-iconified.
<P>
<H2><A NAME="SECTION00058000000000000000">M_MAP</A></H2>
<P>
These packets contain 3 values, which are the usual window
identifiers. The packets are sent when a window is mapped, if it is
not being deiconified. This is useful to determine when a window is
finally mapped, after being added.
<P>
<H2><A NAME="SECTION00059000000000000000">M_WINDOW_NAME, M_ICON_NAME, M_RES_CLASS, M_RES_NAME</A></H2>
<P>
These packets contain 3 values, which are the usual window
identifiers, followed by a variable length character string. The
packet size field in the header is expressed in units of unsigned
longs, and the packet is zero-padded until it is the  size of an
unsigned long. The RES_CLASS and RES_NAME fields are fields in the
XClass structure for the window. Icon and Window name packets will
will be sent upon window creation or whenever the name is changed. The
RES_CLASS and RES_NAME packets are sent on window creation. All
packets are sent in response to a Send_WindowList request from a module.
<P>
<H2><A NAME="SECTION000510000000000000000">M_END_WINDOWLIST</A></H2>
<P>
These packets contain no values. This packet is sent to mark the end
of transmission in response to  a Send_WindowList request. A module
which request Send_WindowList, and processes all packets received
between the request and the M_END_WINDOWLIST will have a snapshot of
the status of the desktop.
<P>
<H2><A NAME="SECTION000511000000000000000">M_ERROR</A></H2>
<P>
When fvwm has an error message to report, it is echoed to the modules
in a packet of this type. This packet has 3 values, all zero, followed
by a variable length string which contains the error message.
<P>
<H2><A NAME="SECTION000512000000000000000">M_CONFIG_INFO</A></H2>
<P>
Fvwm records all configuration commands that it encounters which
begins with the character ``*''. When the built-in command
``Send_ConfigInfo'' is invoked by a module, this entire list is
transmitted to the module in packets (one line per packet) of this
type. The packet consists of three zeros, followed by a variable
length character string. In addition, the PixmapPath, IconPath, and
ClickTime  are sent to the module.
<P>
<H2><A NAME="SECTION000513000000000000000">M_END_CONFIG_INFO</A></H2>
<P>
After fvwm sends all of its M_CONFIG_INFO packets to a module, it
sends a packet of this type to indicate the end of the configuration
information. This packet contains no values.
<P>
<H1><A NAME="SECTION00060000000000000000">  About this document ... </A></H1>
<P>
 <STRONG>The Fvwm Module Interface</STRONG><P>
This document was originally generated using the <A HREF="http://www-dsed.llnl.gov/files/programs/unix/latex2html/manual/"><STRONG>LaTeX</STRONG>2<tt>HTML</tt></A> translator Version 96.1-h (September 30, 1996) Copyright &#169; 1993, 1994, 1995, 1996,  <A HREF="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos Drakos</A>, Computer Based Learning Unit, University of Leeds. <P> The command line arguments were: <BR>
<STRONG>latex2html</STRONG> <tt>-split 0 -ascii_mode -no_images -html_version 3.1 modules.tex</tt>. <P>The translation was initiated by Charles Hines on Fri Feb 28 15:55:01 EST 1997<HR>[Next] [Up] [Previous]   <BR>
<P><ADDRESS>
<I>Charles Hines <BR>
Fri Feb 28 15:55:01 EST 1997</I>
</ADDRESS>
</BODY>
</HTML>