Re: XAppleWMFrameDraw(), CoreGraphics, TWM
Re: XAppleWMFrameDraw(), CoreGraphics, TWM
- Subject: Re: XAppleWMFrameDraw(), CoreGraphics, TWM
- From: Jeremy Huddleston <email@hidden>
- Date: Mon, 8 Aug 2011 11:37:55 -0700
On Aug 7, 2011, at 23:24, Eeri Kask wrote:
> Hello,
>
> Sorry for the huge attachment; over the weekend I edited the source
> code files of a popular window manager and added AppleWM support so
> the window titlebars' appearance visually better integrates into the
> overall Aqua GUI style on MacOSX, otherwise not affecting all its
> powerful features. In this regard I discovered some questions, if
> somebody savvy in XQuartz/AppleWM/Xplugin internals would shade some
> light it would be very great/helpful. :-)
>
>
> (1) In fact all was needed is the XAppleWMFrameDraw() function;
> though it seems /usr/X11/include/X11/extensions/applewm.h and
> /opt/X11/include/X11/extensions/applewm.h differ significantly in
> dealing with necessary parameters for this function, e.g.
> 'frame_class' and 'frame_attr'. The /opt/... variant says to look
> for the value definitions in the Xplugin header, the man-page seems
> treating constants 'AppleWMFrameClassDocument',
> 'AppleWMFrameActive', etc as part of the X-server extension protocol
> apparently, and not part of some Xplugin library API. It seems
> either the refactoring of AppleWM/Xplugin is work-in-progress, or
> otherwise how using of these constants is supposed to look like?
The libXplugin API is not a stable API (check out the comment at the top of Xplugin.h). I've tried to ensure that it is binary compatible as I've been refining it, and I've tried to make it as easy as possible to support multiple versions of the API as it has been refined. Please use the newer applewmproto and newer Xplugin.h. I'd advise editing configure.ac to require the latest versions of libAppleWM and applewmproto. If you want to support building with older libXplugin (recomended), you can add this block to do the translation for you:
#include <Xplugin.h>
#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION < 4
#warning "Old libXplugin version detected. Some features may not be supported."
typedef enum xp_frame_class_enum xp_frame_class;
typedef enum xp_frame_attr_enum xp_frame_attr;
#define XP_FRAME_CLASS_DECOR_LARGE XP_FRAME_CLASS_DOCUMENT
#define XP_FRAME_CLASS_DECOR_SMALL XP_FRAME_CLASS_UTILITY
#define XP_FRAME_CLASS_DECOR_NONE XP_FRAME_CLASS_SPLASH
#define XP_FRAME_CLASS_BEHAVIOR_MANAGED (1 << 15)
#define XP_FRAME_CLASS_BEHAVIOR_TRANSIENT (1 << 16)
#define XP_FRAME_CLASS_BEHAVIOR_STATIONARY (1 << 17)
#define XP_FRAME_ATTR_ACTIVE XP_FRAME_ACTIVE
#define XP_FRAME_ATTR_URGENT XP_FRAME_URGENT
#define XP_FRAME_ATTR_TITLE XP_FRAME_TITLE
#define XP_FRAME_ATTR_PRELIGHT XP_FRAME_PRELIGHT
#define XP_FRAME_ATTR_SHADED XP_FRAME_SHADED
#define XP_FRAME_ATTR_CLOSE_BOX XP_FRAME_CLOSE_BOX
#define XP_FRAME_ATTR_COLLAPSE XP_FRAME_COLLAPSE
#define XP_FRAME_ATTR_ZOOM XP_FRAME_ZOOM
#define XP_FRAME_ATTR_CLOSE_BOX_CLICKED XP_FRAME_CLOSE_BOX_CLICKED
#define XP_FRAME_ATTR_COLLAPSE_BOX_CLICKED XP_FRAME_COLLAPSE_BOX_CLICKED
#define XP_FRAME_ATTR_ZOOM_BOX_CLICKED XP_FRAME_ZOOM_BOX_CLICKED
#define XP_FRAME_ATTR_GROW_BOX XP_FRAME_GROW_BOX
#define XP_FRAME_ATTRS_ANY_BUTTON XP_FRAME_ANY_BUTTON
#define XP_FRAME_ATTRS_ANY_CLICKED XP_FRAME_ANY_CLICKED
#define XP_FRAME_ATTRS_POINTER XP_FRAME_POINTER_ATTRS
#endif
> (2) What good purpose does the 'XAppleWMNotifyEvent'
> (AppleWMControllerNotify, AppleWMActivationNotify, etc) offer?
> How to use the XAppleWMSelectInput() function? Is it supposed to
> work like XSelectInput()? Are these notify-events meant to be
> utilised by a WM at all?
Yes. It serves to pass along notifications from non-X11 sources for close, minimize, zoom, hide, and various other notifications that quartz-wm wants to know about. My advise to you at this point is to take a look in the server for what sends out those notifications and that'll hopefully help you understand them better.
Chances are you won't need all of them, and if you find you need one that isn't there, we can always add it to the protocol.
--Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden