Re: Quick AfterStep Question

Sasha_Vasko@osca.state.mo.us
Fri, 26 May 2000 16:28:37 -0500



Hiya Larry

>Larry Riedel <larry@Riedel.org> writes:

> Doug, I have a quick AfterStep Question.  I want to
> make a "module" or whatever is called a program which

Oh, wow, a potential contributor !
Come right up - we need you ! :)

> communicates with the window manager via a socket or
> a named pipe or however it works with AfterStep.

ok, yes, there are no such manuall for AfterStep module developers
The best source of information would be to communicate directly
to me or Ethan Fisher, we will gladly help you out and
explain internals in details.

Perhaps such dialogue can become a prototype of documentation :)

In short what you are looking for is :

include/module.h

header file. It defines all the module functionality that you may require.

plus
include/functions.h

that lists all the possible functions/messages that
you can exchange with afterstep.

also some description of functions is supplied as comments to
src/Config/function.c
(which is function parsing code)

Basically sequence should be as follows :


1) set MyName variable - SetMyName(argv[0]);
2) process command line args - ProcessModlueArgs(....)
3) open X server connection and initialize some global
libafterstep variables :
   ConnectX(&Scr, display_name, RootEventMask);
Note: it also sets default AfterStep X Error handler

4) intern afterstep atoms :
   InternUsefulAtoms() - it initializes some global libafterstep
   variables to the values of all AfterStep related X atoms.

5) connect afterstep pipe, aknoledge self to AfterStep
and inform it on what messages you would like to receive :
   ConnectAfterStep(afterstep_messages_mask );
mask is ORed combination of any of the M_ values defined in module.h

6) read all your configuration - you'll need to add your module related
file into
src/Config
and learn how to use parser/writer - again I can explain it.

7) exchange messages with X and AfterStep :
     use ReadASPacket, CheckASMessage - to read messages from AfterStep
          SendInfo or SendCommand  - to send messages to AfterStep.
         (SendCommand sends data structure, SendInfo - plain text string).
      Alternatively you can use My_XNextEvent to check and retrieve
ASMessages
      and XEvents whichever comes first.

      if you need to move resize  your modules window overriding all the
ICCCM
      stuff and AfterStep policies. ( like WinList does )
      you can use ASMoveWindow and ASResizeWindow, and ASWaitResized and
ASWaitMoved
      if you need to synchronously wait for move/resized to be completed.

That should cover most of what you need - as you see everything is
in libafterstep and you don't have to play with low level protocol stuff
at all.

you may find headers messed up - major cleanup is under way, and you are
invited to participate in it :)

If you have any questions/suggestions feel free to ask me or Ethan or
better
yet submit a patch.
If you'll get going on development well, Ethan will add you as a developer
on CVS server so you could access CVS tree.

So far try checking out from CVS as anonymous,
and submit your changes as a patch.

Also come see us on #afterstep on EFNet and we'll chat.

>
> For some reason I am having trouble finding a
> document which describes the protocol, the commands
> and the mechanism for establishing a connection to the
> window manager.  For FVWM there is a module developer
> information page at <http://www.fvwm.org/modules.html>,
> and something like that for AfterStep would be great.
>

I agree and we may build something up from this dialogue :)


> (__)  Doug Alcorn (mailto:doug@lathi.net - http://www.lathi.net)

Cheers
Sasha Vasko,
Developer

Home: <sashav@sprintmail.com>
Work: <Sasha_Vasko@osca.state.mo.us>


--------------------------------------------------------------------
To unsubscribe from this mailing list, simply type the following at #
echo "unsubscribe as-users <your_email>" | mail majordomo@afterstep.org