summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-21 23:21:00 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-21 23:21:00 +0000
commit66b5a5ab7249eff995f9927d8172f62081979437 (patch)
tree626c35b5bb447a9a2d371c588cfa80765992bcc9 /src/corelib/x11
parentad532a0858d4e362b96f543a2c1ffe4f47b5da05 (diff)
downloadfpGUI-66b5a5ab7249eff995f9927d8172f62081979437.tar.xz
* new method in Canvas class called ClipLine() which clips the coordinates
of a line based on a given clipping rectangle. This doesn't not use the Canvas's internal ClipRegion. It uses the well known Cohen-Sutherland line clipping algorithm, and performance is very good. * new method in Canvas class called DrawLineClipped() which uses the ClipLine method. * Converted some C headers for the Motif Window Manager hints support under X11. * Introduced a new Window Attribute type called waBorderless. This allows use create borderless windows that can handle keyboard input. Currently borderless windows are only implemented in X11. It past 01:15 here and I need sleep, so will tackle GDI support on Monday. * Extended some of the types to be used for the new Style/Theme Manager. * Fixed a bug where TfpgForm.OnClose event did not fire when you call .Close method.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpgfx_package.pas7
-rw-r--r--src/corelib/x11/gfx_x11.pas68
2 files changed, 71 insertions, 4 deletions
diff --git a/src/corelib/x11/fpgfx_package.pas b/src/corelib/x11/fpgfx_package.pas
index d7813dee..ea32e8cc 100644
--- a/src/corelib/x11/fpgfx_package.pas
+++ b/src/corelib/x11/fpgfx_package.pas
@@ -8,10 +8,9 @@ interface
uses
x11_xft, x11_keyconv, gfxbase, gfx_x11, fpgfx, gfx_stdimages, gfx_imgfmt_bmp,
- gfx_widget, gfx_UTF8utils, gfx_extinterpolation, gfx_cmdlineparams,
- gfx_utils, gfx_popupwindow, gfx_impl, gfx_command_intf, gfx_wuline,
- gfx_imagelist, gfx_constants, gfx_pofiles, gfx_translations,
- gfx_stringhashlist;
+ gfx_widget, gfx_UTF8utils, gfx_extinterpolation, gfx_cmdlineparams, gfx_utils,
+ gfx_popupwindow, gfx_impl, gfx_command_intf, gfx_wuline, gfx_imagelist,
+ gfx_constants, gfx_pofiles, gfx_translations, gfx_stringhashlist;
implementation
diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas
index 49b58825..7fea5804 100644
--- a/src/corelib/x11/gfx_x11.pas
+++ b/src/corelib/x11/gfx_x11.pas
@@ -12,6 +12,7 @@ uses
X,
Xlib,
XUtil,
+ ctypes,
x11_xft,
_netlayer,
gfxbase,
@@ -50,6 +51,45 @@ type
end;
PXdbeSwapInfo = ^TXdbeSwapInfo;
+ // MWM support
+ TMWMHints = record
+ flags: culong;
+ functions: culong;
+ decorations: culong;
+ input_mode: longint;
+ status: culong;
+ end;
+
+
+const
+// Motif window hints
+ MWM_HINTS_FUNCTIONS = 1 shl 0;
+ MWM_HINTS_DECORATIONS = 1 shl 1;
+ MWM_HINTS_INPUT_MODE = 1 shl 2;
+ MWM_HINTS_STATUS = 1 shl 3;
+// bit definitions for MwmHints.functions */
+ MWM_FUNC_ALL = 1 shl 0;
+ MWM_FUNC_RESIZE = 1 shl 1;
+ MWM_FUNC_MOVE = 1 shl 2;
+ MWM_FUNC_MINIMIZE = 1 shl 3;
+ MWM_FUNC_MAXIMIZE = 1 shl 4;
+ MWM_FUNC_CLOSE = 1 shl 5;
+// bit definitions for MwmHints.decorations */
+ MWM_DECOR_ALL = 1 shl 0;
+ MWM_DECOR_BORDER = 1 shl 1;
+ MWM_DECOR_RESIZEH = 1 shl 2;
+ MWM_DECOR_TITLE = 1 shl 3;
+ MWM_DECOR_MENU = 1 shl 4;
+ MWM_DECOR_MINIMIZE = 1 shl 5;
+ MWM_DECOR_MAXIMIZE = 1 shl 6;
+// bit definitions for MwmHints.inputMode */
+ MWM_INPUT_MODELESS = 0;
+ MWM_INPUT_PRIMARY_APPLICATION_MODAL = 1;
+ MWM_INPUT_SYSTEM_MODAL = 2;
+ MWM_INPUT_FULL_APPLICATION_MODAL = 3;
+ PROP_MWM_HINTS_ELEMENTS = 5;
+
+type
TXWindowStateFlag = (xwsfMapped);
TXWindowStateFlags = set of TXWindowStateFlag;
@@ -1266,6 +1306,9 @@ var
IconPixmap: TPixmap;
WMHints: PXWMHints;
+
+ prop: TAtom;
+ mwmhints: TMWMHints;
begin
if HandleIsValid then
Exit; //==>
@@ -1370,6 +1413,31 @@ begin
// we have a Splash screen
fpgApplication.netlayer.WindowSetType(FWinHandle, [nwtSplash]);
+ // process Borderless forms
+ if (FWindowType = wtWindow) and (waBorderless in FWindowAttributes) then
+ begin
+ prop := X.None;
+ prop := XInternAtom(xapplication.display, '_MOTIF_WM_INFO', longbool(0));
+ if prop = X.None then
+ begin
+ writeln('Window Manager does not support MWM hints. Bypassing window manager control for borderless window.');
+ // Set Override Redirect here!
+ mwmhints.flags := 0;
+ end
+ else
+ begin
+ mwmhints.flags := MWM_HINTS_DECORATIONS;
+ mwmhints.decorations := 0;
+
+ if xapplication.xia_motif_wm_hints <> X.None then
+ begin
+
+ prop := xapplication.xia_motif_wm_hints;
+ XChangeProperty(xapplication.display, FWinHandle, prop, prop, 32, PropModeReplace, @mwmhints, PROP_MWM_HINTS_ELEMENTS);
+ end;
+ end;
+ end;
+
{ TODO : We could optimise this for non-focusable widgets }
XSelectInput(xapplication.Display, wh, KeyPressMask or KeyReleaseMask or
ButtonPressMask or ButtonReleaseMask or