diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-06 07:46:48 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-06 07:46:48 +0000 |
commit | bcb7e78e59a3ca139256d47ba00c7badf97dd696 (patch) | |
tree | 1f881bd67d9a2c15818661c51f696473e333defa | |
parent | 52a134ce72ead30e85f59fd13c2ec6acab861c73 (diff) | |
download | fpGUI-bcb7e78e59a3ca139256d47ba00c7badf97dd696.tar.xz |
* fpgfx and fpgui packages now have the -B compiler parameter to always compile all units. Before it Lazarus didn't detect changes in include files.
* X11: minor optimization of the KeyPress/KeyRelease event handling. This needs to improve even more.
-rw-r--r-- | src/corelib/x11/fpgfx_package.lpk | 1 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 33 | ||||
-rw-r--r-- | src/gui/fpgui_package.lpk | 9 |
3 files changed, 33 insertions, 10 deletions
diff --git a/src/corelib/x11/fpgfx_package.lpk b/src/corelib/x11/fpgfx_package.lpk index 786dd522..72f628c2 100644 --- a/src/corelib/x11/fpgfx_package.lpk +++ b/src/corelib/x11/fpgfx_package.lpk @@ -16,6 +16,7 @@ </Optimizations> </CodeGeneration> <Other> + <CustomOptions Value="-B"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index 3a0499a3..94c86a88 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -153,7 +153,7 @@ type TfpgApplicationImpl = class(TfpgApplicationBase) private FComposeBuffer: String[32]; - FComposeStatus: TXComposeStatus; + FComposeStatus: TStatus; function ConvertShiftState(AState: Cardinal): TShiftState; function KeySymToKeycode(KeySym: TKeySym): Word; function StartComposing(const Event: TXEvent): TKeySym; @@ -745,6 +745,7 @@ var xfd: integer; KeySym: TKeySym; Popup: TfpgWidget; + status: TStatus; // debug purposes only procedure PrintKeyEvent(const event: TXEvent); @@ -768,7 +769,6 @@ var writeln('not a key event '); end; end; -// length := XLookupString(@event, @s[1], 9, @keysym, @compose_status); length := Xutf8LookupString(InputContext, @event.xkey, @s[1], 9, @keysym, @compose_status); SetLength(s, length); if((length > 0) and (length <=9)) then @@ -802,7 +802,7 @@ begin Exit; // no event received. end; XNextEvent(display, @ev); - until (not XFilterEvent(@ev, 0)); + until (not XFilterEvent(@ev, X.None)); blockmsg := False; fillchar(msgp, sizeof(msgp), 0); @@ -825,9 +825,32 @@ begin X.KeyPress, X.KeyRelease: begin - KeySym := StartComposing(ev); if ev._type = X.KeyPress then + begin + KeySym := StartComposing(ev); + { TODO -oGG : Move some code into the case statement } + case FComposeStatus of + XLookupNone: + begin +// writeln('KeyPress - XLookupNone'); + Exit; + end; + XLookupChars: + begin +// writeln('KeyPress - XLookupChars'); + // do nothing + end; + XLookupKeySymVal: + begin +// writeln('KeyPress - XLookupKeySymVal'); + end; + XLookupBoth: + begin +// writeln('KeyPress - XLookupBoth'); + end; + end; FLastKeySym := KeySym // save it for KeyRelease event + end else KeySym := FLastKeySym; // restore saved KeySym @@ -848,8 +871,6 @@ begin begin fpgPostMessage(nil, w, FPGM_KEYPRESS, msgp); - // Revision 203 used scancodes and XmbLookupString compared to XLookupString. - // Maybe in the future we can switch to XmbLookupString again. if (ev.xkey.state and (ControlMask or Mod1Mask)) = 0 then begin for i := 1 to UTF8Length(FComposeBuffer) do diff --git a/src/gui/fpgui_package.lpk b/src/gui/fpgui_package.lpk index 06e68ea5..d61f9d2b 100644 --- a/src/gui/fpgui_package.lpk +++ b/src/gui/fpgui_package.lpk @@ -23,6 +23,7 @@ </Debugging> </Linking> <Other> + <CustomOptions Value="-B"/> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> @@ -152,12 +153,12 @@ <LazDoc Paths="../../docs/xml/gui/"/> <RequiredPkgs Count="2"> <Item1> - <PackageName Value="fpgfx_package"/> - <MinVersion Minor="6" Release="1" Valid="True"/> - </Item1> - <Item2> <PackageName Value="FCL"/> <MinVersion Major="1" Valid="True"/> + </Item1> + <Item2> + <PackageName Value="fpgfx_package"/> + <MinVersion Minor="6" Release="1" Valid="True"/> </Item2> </RequiredPkgs> <UsageOptions> |