Wrapper's for GraphApp
Contents
Introduction
GraphApp are a library for window applications. Made
by :
L. Patrick
Basser Department or computer Science
School or Information Technologies
University or Sydney 2006
Australia
http://enchantia.com/software/graphapp/
It is called simply to use and after some
puzzeling it turns out better than expected indeed, however.
The advantage of this library is that it is rather small
(approximately 800k).
And both X11 (Linux/Unix) and so libary as under
MSWindows (98/XP) work as dll libary.
It contains things as menus list and radiobuttons , PopUp menus's etc.
Also a number of dialogues are present such as FileOpen FaleSave and
a Messagebox with different answer possibilities is.
Also it is possible three types pictures to know gif, use png,
jpg. (Sometimes to much remember)
Compiling Graph Application
Compile with the mingw (mswindows) and linux.
Mingwin .
For the mingw DLL the next task must be add to the make
file .
MAKE_DYNAMIC_LIB = gcc - shared - o
DLL = graphapp.dll
dynamic: apptypes.h $ (dll)
$ (dll): $ (object) $ (headers)
$(exist $ (dll), del $ (dll))
$(make_dynamic_lib) $ (dll) win32/*.o utility/*.o gui/*.o
imgfmt/*.o libgif/*.o \
libjpeg/*.o libpng/*.o libz/*.o - mwindows - Wl, --
out-implib,libgraphapp.a
Up to that point I have understood it -
mwindows
ensure that no console box (DOS box) is
started up.
- Wl, -- out-implib,libgraphapp.a
obtain the symbolreferentie for the DLL from the lib.
(want you to references from other DLL uses gives then -
Bdynamic plus the desired lib's.)
Linux (GCC)
The linux version can use you with the given Makefile.
However, you need a number of header has files from
X11.
Wrapper for Peu/Euphoria
The wrapper for Peu and Euphoria have been written by Matt Arriola .
The wrap file graphapp.eu
have been made orginaly
for Linux but work also in MSWindows if you add the DLL .
These contain include libary file.e
which call's
contain to pipe, remove these if you work in MSWindows. (example
ex05 no longer works)
Remove double the claim get_image_area
. Modify get_window_area
,
parameters are incorrect.
Change app_fil_rec
t in app_window_fill_app
(and remove
euapp_fill_rext
)
Example EX04 has been extended with required edit-actie such as
copy/paste appropriate.
Example TRY2 is to beginning for equivalend for Xdailog (what up to that point I weet
are only for Linux/Unix available)
Peu and Euphoria work mainly with CallBack function. It is
however also possible these repalace this by a scanner function.
Instead of main_loop()
which assumes CallBack's use then next_event()
which pointer return of the structure which has been
called. (to see EX02A) . For that purpose
all hook's are modified in the library by central hook for the
( get_hook(hook)
) with -1 nothing, 0 event_scanner differently
callbackfunc ().
Wrapper for Fortran (G77)
The wrapper are still long
not finished! But it has been meant to see how to do it . And it's , however,
possible.
Examples of two probeems you wil see :
- Parameter is given as call by reference that means as pointers.
If CHAR parameter are used the length of this is the last parameter
as in the parameterlist given by value .
- (
call
proc(charstring,integer)
gives in c void
proc_(char *txt, int *i, int length_txt)
-
result=char
function(parameter)
gives in c void proc_(
char *result , int len_result , int *parameter)
)
- Characterstring of Fortran to c must provide to become with a
last sign ' \0 ' and possibly must striped off the leading spaces.
- Characterstring of c to Fortran must become copyed until '
\0 ' and filled with spatie's to the given length by Fortran .
Event Scanning
(example)
There for scanning techiek t.b.v the event settlement it has
been chosen (to see also JAPI). This meant that the call of next_event()
pointer returns which indentiek is to of the
var=GraphApp_functie made () or 1 if are there no callback or it is 0
what indicate that all windows are closed. This gives the
possibility is entirely differently do between two event's.
You can translate the example both in Linux and in MSWindows.
Linux : g77 -o test grapappg77.f grapappg77.c ./libapp.so
Mingw: g77 -o test grapappg77.f
grapappg77.c graphapp.dll -mwindows
How you foutlose get typcasting escapes me still, but remaining
warnings and it does not work there, however, for, only netjes.
CallBack (example)
At this method event call a function to which it is carried out
directly. In the current wrapper event now all are
settled main_loop()
. If all windows are closed the procedure
returns . This meant in Fortran that the CallBack's must be
declared as a external
function. The
parameters of the CallBack function are pointers i.e. to get value the
pointer must use the parameter by the function %loc
to
obtain it.
EXample: parameter are I (that reflects the value of the first
element of the Graph structure) , the address of the
structure is obtained by adresStruct = %loc(I) .
the CallBack of menu item gives
as a value is parent but by using %loc now get you the address of menu
item (to see struct MenuItem in app.h
).
You can translate the example both in Linux and in MSWindows.
Linux : g77 -o test grapappcb.f grapappg77.c ./libapp.so
Mingw: g77 -o test grapappcb.f
grapappg77.c graphapp.dll -mwindows
source code downloading
Uitleiding
Beside GraphApp I know the follwing two system that works on both
Linux/unix and MSWondows .
- JAPI
- JAPI stand for Java Application Programming interface.
It has Wrapper for a lot of languages and O.S.
- JAPI up to this point it's no longer developed but you can still get it
on http://www.japi.de
.
- Japi works with a server/client technique. The server is
the Java scripts and the client is you programme.
- wxWindows
- wxWindows have been written in c ++ and for this reason
what more with difficulty to wrapp it for something as
Fortran
- wxWindows and wxWidgets , you can get it from http://www.wxwindows.org
.
If this was interesting for you can reach me by eMail .