nanogui: How to add a funtion to nano-X?


Previous by date: 28 Apr 2001 16:08:38 -0000 Re: is multithread program supported by flnx of nano-X?, Gary James
Next by date: 28 Apr 2001 16:08:38 -0000 some more questions, bob
Previous in thread: 28 Apr 2001 16:08:38 -0000 How to add a funtion to nano-X?, Qian Liu
Next in thread:

Subject: Re: How to add a funtion to nano-X?
From: Gary James ####@####.####
Date: 28 Apr 2001 16:08:38 -0000
Message-Id: <20010428120933.C787@pc.twcny.rr.com>

Bob (Qian Liu),

Start with Greg's architecture document. This will give you an overview of
how all the layers work together. Note: the architecture document is old,
everything is correct as far as the layers go, but some of the API
described has changed slightly. Here's the architecture document:
http://home.twcny.rr.com/embedded/microwin/architecture/index.html

Then start digging through the code. You might want to consider looking at
the function GrGetFontInfo() as a starting point. 

The nano-X layer function GrGetFontInfo() is a wrapper for the device
independant layer function GdGetFontInfo(). Look in these files for the
implementation of the nano-X wrapper for these two functions:
".../microwin/src/nanox/client.c"
".../microwin/src/nanox/srvnet.c"
".../microwin/src/nanox/srvfunc.c"

The files "client.c" and "srvnet.c" provide the wrappers so that the
function works in nano-X client-server mode. The file "srvfunc.c" provides
the nano-X implementation of the function. You will see that
GrGetFontInfo() in "srvfunc.c" converts nano-X types into device
independent engine types. Then calls the device independent engine function
GdGetFontInfo().

Look in the file ".../microwin/src/engine/devfont.c" for the implementation
of GdGetFontInfo().

What you will probably want to do is create a function GdGetFontCharmap()
in "devfont.c". Then create the nano-X implementation function
GrGetFontCharmap() in "srvfunc.c". Then add nano-X client/server wrappers
to "srvnet.c" and "client.c".

To debug this thing... If you are used to running nano-X in client/server
mode, you will not be able to step through your new function to test it. If
you find that you need to debug your new function, then link your app to
nano-X by setting "LINK_APP_INTO_SERVER = Y" in ".../microwin/config"
rebuild microwindows. Then build your test application with all the
additional libraries that nano-x server usually builds with (ie. -lnano-X
-lmwengine -lmwdrivers -lmwfonts -lttf ).

After linking nano-X to your application you will be able to step right
through to GdGetFontCharmap(). You'll notice that you do not step through
the functions in "client.c" and "srvnet.c". These functions are only used
when running in client/server mode. 

When everything works with nano-X and your app linked together, then you
should rebuild Microwindows with "LINK_APP_INTO_SERVER = N" and verify the
functions in "client.c" and "srvnet.c". 

Good luck and have fun...


Gary James
####@####.####
http://home.twcny.rr.com/embedded/



On Fri, 27 Apr 2001 23:01:07 Qian Liu wrote:
> Hi
> I am going to add a funtion to get the charmap of current font in nano-x.
> But I have no experience of that. Where should I start? Or is there any
> document about the mechanism of nano-X?
> 
> 					Bob
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
> 
> 


Previous by date: 28 Apr 2001 16:08:38 -0000 Re: is multithread program supported by flnx of nano-X?, Gary James
Next by date: 28 Apr 2001 16:08:38 -0000 some more questions, bob
Previous in thread: 28 Apr 2001 16:08:38 -0000 How to add a funtion to nano-X?, Qian Liu
Next in thread:


Powered by ezmlm-browse 0.20.