Major architectural milestone: WINGs Wayland-only files now have ZERO
transitive X11 header dependency at the preprocessor level (verified by
gcc -E grep: 0 mentions of X11/Xlib.h after preprocessing).
Changes:
1. WUtil.h, WINGs.h: stop including <X11/Xlib.h>. wnative.h provides
forward declarations for Display, GC, XftDraw, XftFont; opaque
pointer-only typedefs that don't conflict with Xlib.h's actual
definitions when the X11 backend later includes it.
2. WINGsP.h.in: stop including <X11/Xlib.h>, <X11/Xutil.h>. Drop or
re-route every X11-typed prototype:
- W_HandleDNDClientMessage / W_DragSourceStateHandler /
W_DragDestinationStoreEnterMsgInfo / etc.
→ moved to new private header WINGs/WINGsX11.h
- W_HandleSelectionEvent → moved
- W_LookupString / W_KeycodeToKeysym → moved
- W_DndState typedef → moved (renamed to W_X11DndState)
- XClientMessageEvent / XEvent / XKeyPressedEvent in prototypes
→ use void * in shared protos, cast in WINGsX11.h
3. W_View struct: replaces XSetWindowAttributes by-value field with a
small backend-neutral 'attribs' struct holding only the fields
wmaker/WPrefs actually use (background_pixmap, background_pixel,
border_pixel, colormap, cursor, override_redirect, save_under,
event_mask, do_not_propagate_mask). The X11 view backend
translates to XSetWindowAttributes when calling XCreateWindow.
XIC xic field replaced with void *xic.
4. W_Color struct: replaces XColor by-value with a same-layout
anonymous struct (pixel/red/green/blue/flags/pad). X11 backend
uses memcpy to populate from XColor.
5. WINGs/WINGsX11.h (new): private header for X11 backend. Includes
<X11/Xlib.h>, declares X11-typed internal prototypes used by drag*,
selection, IME, x11_backend, KeyboardShortcuts. Required by every
*_x11.c file plus a handful of cross-component callers
(KeyboardShortcuts.c, MouseSettings.c, xmodifier.c, wmiv.c,
x11_backend.c).
6. wraster.h.in: gain a WRASTER_NO_XLIB compile-time switch. When
defined the header skips <X11/Xlib.h> and provides forward decls
for Display/Visual/XImage/GC/XftFont/etc. All Wayland-only WINGs
files (wclient_wl.c, w*_wl.c) define WRASTER_NO_XLIB on line 1.
7. wfont.c: adds W_ParseXLFDToFcPattern (a hand-written XLFD parser)
replacing XftXlfdParse. Removes <X11/Xft/Xft.h> include from the
shared font dispatcher (and from wfontpanel.c too).
Verification:
$ for f in WINGs/.libs/{*_wl.o,wclient_wl.o}; do
nm $f | awk '$1=="U"{print $2}' | grep -cE '^X[A-Z][a-z]'
done
0 for every Wayland file
$ for f in WINGs/.libs/*.o; do
case $f in *_x11.o|*_wl.o|wclient_wl.o) continue;; esac
c=$(nm $f | awk '$1=="U"{print $2}' | grep -cE '^X[A-Z][a-z]')
[ $c -gt 0 ] && echo "$c $f"
done
(empty — no shared file leaks an X11 symbol either)
$ gcc -E ... wclient_wl.c | grep -c X11/Xlib.h
0 (no transitive Xlib include)
The library still pulls libX11 through the *_x11.c files when those are
linked in. A future configure flag --disable-x11-backend will exclude
*_x11.c entirely; at that point libWINGs will be a pure-Wayland library
with zero libX11 dependency.
WINGs - WINGs Is Not GNUstep
by
Alfredo Kengi Kojima
kojima@windowmaker.info
WINGs is a small widget set with the N*XTSTEP look and feel. Its API
is inspired in OpenStep and its implementation borrows some ideas
from Tk. It has a reasonable set of widgets, sufficient for building
small applications (like a CDPlayer or hacking something like rxvt). It
also has other functions that are usefull for applications, like a
User Defaults alike configuration manager and a notification system.
The library is limited and its design is a little sloppy,
so it's not intended to build large or complex applications, like
anything more complex than a CDPlayer. GNUstep should be used for such
applications.
Since WINGs is written in C and is sort of low-level it is small
and faster than say, Motif or even Athena. Knowing Xlib will help you to
workaround some of its limitations, although you'll probably be able to
write something like a trivial tic-tac-toe game without knowing much Xlib.
Some of its functions are designed to support the Window Maker window
manager (see http://windowmaker.info) In fact, its primary role is to
support Window Maker. All other uses of it are just an added bonus.
It will help you to understand the API if you read the ApplicationKit
reference manual, distributed as a PDF by Apple. The function names,
structs and most of the intrinsics are very close to OpenStep classes.
Internationalization:
---------------------
Change ~/GNUstep/Defaults/WMGLOBAL to set the desired font set and
set MultiByteText = YES; to enable support for multibyte text.
Widgets provided by WINGs:
--------------------------
- button (command button, radio, switch etc. - all buttons defined in OpenStep)
- label
- textfield
- frame
- window
- popup menu button
- scroller
- selection list
- browser
- slider
- scrollable view
- color well
- split view
- tabbed view
- progress indicator
- selection (make pasteboard like?)
- drag&drop
- input box
- file panel
- color panel
- alert panel
- font panel
If you think you can code the following, please do. They are needed by
WPrefs.app, but the number of other things I have to do is huge.
- input method support (XIM). I have no idea of how to code it. People who use
different characters than ASCII will have trouble editing menus without it...
Wish list: (I don't have the know-how or time to do them)
---------------------------------------------------------
- text (with support for RTF)
- matrix (like NSMatrix)
- font manager (like NSFontManager)
- finish other wigets
- optimize list scrolling (XCopyArea() the area that's already drawn)
- InterfaceMaker?
- use XSetWMName and XSetWMIconName for the window/icon title setting.
This requires transforming the received text to a text property with
the proper encoding.
Copyright
---------
WINGs is copyright (c) Alfredo K. Kojima and is licensed through the GNU
Library General Public License (LGPL).