LGI is a GUI framework for abstracting out all the operating system dependencies
that you can produce portable code. It handles all the graphical interface functions,
threading and semaphores, network connectivity and lots of other bits and peices to
help build small, fast and reliable applications.
The strengths of LGI is that it's a small enough library that one person can understand
it all. Also it's not too much of a burden on an application, both in increased download
time and memory footprint. LGI at the moment compresses to about 300kb, which while not
insignificant is quite a bit smaller than the other options.
Ultimately however size is a secondary consideration to the core feature of LGI and that
is portability. Currently 3 serious ports exist: Win32, Mac and Linux. There is also a
legacy BeOS port which is unsupported.
I have completed some basic documentation (available online here)
for the library, and there are a number of
example apps with source code available from this site as well.
Related Information:
Version: v3.02
[Stable]
Version: v3.01
[Stable]
Version: v3.00
[Stable]
Version: v2.20
[Stable]
Version: v2.10
[Stable]
Version: v2.00
[Stable]
Version: v1.99
[Stable]
|
Ports Status
- Win32 (98[se]/ME/NT/2K/XP)
This is the most stable and featured port, as it's the native plaform. Well DOS was
technically
the first platform, but there is no code left from those days. Everything works in Windows,
and it's the fastest due to the speed of the Win32 Graphical Subsystem being miles ahead of
Linux or BeOS. Sure other parts of Windows "Suck(TM)" but graphically it's king. It should
run on Win95 as well, but some things won't work as advertised. I longer support or test on
Win95 and I barely support Win98 or ME.
- Linux (>=2.4)
This is the 2nd best platform for LGI, it's pretty rock solid these days and has almost all
the features of the Win32 port. There are a few things missing here and there but it's 95%.
It's definately not optimal speed wise but I don't have time to tinker with better ways of
doing things. It does work quite well.
- Mac OS X (>=10.3.9)
The newest port of Lgi, most things are working but there are less used areas that need implementing
or fixing. The GUI code is fairly complete and solid, although some more optimization is needed.
Threads, sockets etc all work too.
- Cygwin
I ported the win32 code to gcc/cygwin and there is working makefiles. The code isn't extensively
tested but the IDE runs ok when built under Cygwin, YMMV. The underlying Win32 code is very
good, so there would only be problems that Cygwin/GCC introduced. Also works under MingW.
- BeOS (Zeta)
This is an old old port from the r5 days that I recently updated to work on Zeta for v2. Most of the
basic functionality works to put windows on the screen. But lots of little quirks still exist
or things arent implemented. However that said some of the design concepts for Lgi came
straight out of BeOS, so that BeOS port often is the "cleanest" of the implementations,
having a direct mapping to the native API instead of convoluted hacks to make things work.
Currently the BeOS port doesn't run very well on Zeta, there is some problem with locks getting
stuck in really weird places. I consider this port deprecated at the moment.
|
- File system abstraction (GFile, GDirectory)
- Basic windows (GView, GWindow, GLayout, GDialog). GView is the base
window class and handles all the basic window API calls and events. GView
API looks like:
| virtual Events
| Properties (Get/Set)
|
- int OnEvent(GMessage *Msg);
- void OnMouseClick(GMouse &m);
- void OnMouseEnter(GMouse &m);
- void OnMouseExit(GMouse &m);
- void OnMouseMove(GMouse &m);
- void OnKey(GKey &k);
- void OnMouseWheel(double Lines);
- void OnCreate();
- void OnDestroy();
- void OnFocus(bool Has);
- void OnPulse();
- void OnPosChange();
- bool OnRequestClose();
- int OnHitTest(int x, int y);
- int OnNotify(GView *Ctrl, int Flags);
- void OnChildrenChanged(GView *Wnd, bool Attaching);
- int OnCommand(int Cmd, int Event, OsView Wnd);
- void OnPaint(GSurface *pDC);
- bool OnViewKey(GView *v, GKey &k);
|
- char *Name();
- int Value();
- GRegion &GetPos();
- int GetId();
- bool Enabled();
- bool Visible();
- bool Focus();
- bool DropTarget();
- bool Sunken();
- bool Flat();
- bool Raised();
- GView *GetParent();
- GView *GetNotify();
- bool Capture(bool c); // mouse capture
|
- Widgets (Most are XP - owner drawn)
- GEdit - Edit control (Win32: Native, Linux: GTextView3)
- GCheckBox - On/Off
- GText - Label
- GRadio/GRadioGroup - One of many.
- GCombo - Combo box
- GList - List control
- GTree - Tree control
- GBitmap - Bitmap
- GProgress - Progress meter
- GSlider - Slider control
- GSplitter - Split 2 panes
- GTabView - Tabbed control
- GTextView3 - Unicode text editor.
- GToolBox - Toolbar control.
- GStatusBar - Status bar.
- GMenu / GSubMenu / GMenuItem - Menu controls.
- GPopup
- Internally all text is Utf-8
- Unicode font support (GFont, GFontType). Tools for converting to/from
native OS text and other codepages are provided. iso-8859-x and
windows-12xx codepage support is native, other codepages supported via
the iconv library.
- Multi-threading (GThread, GSemaphore)
- Graphics library (GSurface, GMemDC, GScreenDC, GPrintDC)
- Supports internally, all the basic primitives: Line, Circle, Rect,
Blt, Flood, Polygon, Ellipse etc. No OS support required.
- Bit depth conversion for bitmaps and colours.
- Palette management.
- Alpha blending.
- Vector art library, anti-aliased rasterisation of primitives & text.
Includes TTF -> path capability.
- Graphic file format support (GIF, TIFF, JPEG(dll), PNG(dll), BMP, ICO).
- Recursive file search.
- Full file open/save dialog (ie. not from the OS libraries). There is also
support for the Win32 file open/save dialog - API compatible.
- Mime type detection/app lookup API.
- Platform independant XML resource file format for strings, dialogs and
menus. All fully multi-lingual.
LgiRes is a graphical
editor for this format.
- Cross-platform. Runs on Win32 (dep: '98 or better, may run on '95) and
Linux/X11 (dep: xlib, pthreads, xrender). There is a legacy port to BeOS
but that is unmaintained and won't work out of the box.
- Clipboard IO for text and bitmaps.
- Drag'n'drop events/API.
- Commonly used dialogs (GInput, MsgBox, GAlert, GFindReplace, GFileSelect).
- Date time handling (GDateTime). Date subtraction/addition, conversion
to/from native format, conversion to/from strings.
- Container classes (List<>, StringPipe).
- Network abstraction (GNetwork, GSocket).
- Network protocol client classes:
- FTP (IFtp)
- HTTP (IHttp)
- SMTP (MailSmtp)
- POP (MailPop3)
- IMAP (MailIMap)
- DNS (IDns)
- Xml parser (GXml - being deprecated), XML DOM parser (GXmlTree).
- String tokenization (GToken);
- 192k packed/zipping redistributable, 268k installed (at the time of writing this).
- Simple HTML control. Support for charsets, CSS classes/styles, tables (colspan etc),
Tags (p/ul/li/div/span/font/a/img/br/i/b/u/table/tr/td/meta/style).
Building LGI
- Download the latest source, unpack somewhere.
- For full graphics and charset support download (or check you already have)
iconv,
libpng,
zlib and
libjpeg;
then add their include paths to your compilers include paths. Or find the defineds
in Lgi.h for the various libraries and set them to 0.
- To build:
- Win32: Load Lgi/Lgi.dsp into Visual C++ and build it.
- Linux: make -f Lgi/Makefile.linux
- Cygwin: make -f Lgi/Makefile.win32
- Mac: Open Lgi.xcode in XCode and run the build command.
- Adding build folders so the OS can find the shared libraries:
- For Windows add these to your path:
- Lgi/Debug
- Lgi/Release
- Lgi/Gel/Debug
- Lgi/Gel/Release
- For Cygwin add these to your path:
- Lgi/DebugX
- Lgi/ReleaseX
- Lgi/Gel/DebugX
- Lgi/Gel/ReleaseX
On Linux, create symlinks in /usr/lib to the files:
- Lgi/DebugX/liblgid.so
- Lgi/ReleaseX/liblgi.so
- Lgi/Gel/DebugX/liblgiskind.so
- Lgi/Gel/ReleaseX/liblgiskin.so
- Find and build an application. I suggest i.Ftp as a good
starting point. However the documentation will help you get started from scratch if
you want to do it that way.
Any problems, just email
me.
M$ VC++ 6 Tip
Add this to your Common/MsDev98/Bin/AUTOEXP.DAT file to show various LGI types inline:
; LGI types
GRegion =x1=<x1> y1=<y1> x2=<x2> y2=<y2>
GMessage =msg=<Msg,wm> a=<a> b=<b>
GDateTime =<_Year>/<_Month>/<_Day> <_Hours>:<_Minutes>:<_Seconds>
History:
3.02 [Stable]
Changes:
- [Win32] Fixed enumerated font names not being converted from native cp properly.
- Updated scripting language to have proper scoping of variables, better expression evaluation and infix/postfix/prefix operator support.
- Fixed font selection dialog showing weird preview text on display bit depth other than 32.
- [Win32] Changed keyboard handling to not use WM_CHAR, which is corrupted in some cases (Vista, Romanian etc).