1 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/aqua/inc/salframe.h vcl/aqua/inc/salframe.h
2 --- vcl.clean/aqua/inc/salframe.h 2008-01-14 11:13:04.000000000 -0500
3 +++ vcl/aqua/inc/salframe.h 2008-02-28 12:57:14.000000000 -0500
4 @@ -146,6 +146,8 @@ public:
5 virtual void Beep( SoundType eSoundType );
6 virtual const SystemEnvData* GetSystemData() const;
7 virtual SalPointerState GetPointerState();
8 + virtual SalIndicatorState GetIndicatorState();
9 + virtual void SimulateKeyPress( USHORT nKeyCode );
10 virtual void SetParent( SalFrame* pNewParent );
11 virtual bool SetPluginParent( SystemParentData* pNewParent );
12 virtual void SetExtendedFrameStyle( SalExtStyle );
13 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx
14 --- vcl.clean/aqua/source/window/salframe.cxx 2008-01-14 11:18:51.000000000 -0500
15 +++ vcl/aqua/source/window/salframe.cxx 2008-02-28 12:57:39.000000000 -0500
16 @@ -1197,6 +1197,17 @@ SalPointerState AquaSalFrame::GetPointer
20 +SalFrame::SalIndicatorState AquaSalFrame::GetIndicatorState()
22 + SalIndicatorState aState;
27 +void AquaSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
31 bool AquaSalFrame::SetPluginParent( SystemParentData* pNewParent )
33 // plugin parent may be killed unexpectedly by
35 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/keycodes.hxx vcl/inc/vcl/keycodes.hxx
36 --- vcl.clean/inc/vcl/keycodes.hxx 2008-01-14 11:20:04.000000000 -0500
37 +++ vcl/inc/vcl/keycodes.hxx 2008-02-28 14:28:37.000000000 -0500
39 #define KEY_TILDE ((USHORT)::com::sun::star::awt::Key::TILDE)
40 #define KEY_QUOTELEFT ((USHORT)::com::sun::star::awt::Key::QUOTELEFT)
42 +#define KEY_CAPSLOCK ((USHORT)::com::sun::star::awt::Key::CAPSLOCK)
43 +#define KEY_NUMLOCK ((USHORT)::com::sun::star::awt::Key::NUMLOCK)
44 +#define KEY_SCROLLLOCK ((USHORT)::com::sun::star::awt::Key::SCROLLLOCK)
46 #define KEY_CODE ((USHORT)0x0FFF)
50 #define MOUSE_MIDDLE ((USHORT)0x0002)
51 #define MOUSE_RIGHT ((USHORT)0x0004)
53 +// -------------------
54 +// - Indicator-Types -
55 +// -------------------
57 +#define INDICATOR_CAPSLOCK 0x0001
58 +#define INDICATOR_NUMLOCK 0x0002
59 +#define INDICATOR_SCROLLLOCK 0x0004
61 #endif // _SV_KEYCODES_HXX
62 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx
63 --- vcl.clean/inc/vcl/salframe.hxx 2007-10-09 11:17:45.000000000 -0400
64 +++ vcl/inc/vcl/salframe.hxx 2008-02-28 11:21:03.000000000 -0500
65 @@ -272,6 +272,15 @@ public:
67 virtual SalPointerState GetPointerState() = 0;
69 + struct SalIndicatorState
74 + virtual SalIndicatorState GetIndicatorState() = 0;
76 + virtual void SimulateKeyPress( USHORT nKeyCode ) = 0;
78 // set new parent window
79 virtual void SetParent( SalFrame* pNewParent ) = 0;
80 // reparent window to act as a plugin; implementation
81 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/window.hxx vcl/inc/vcl/window.hxx
82 --- vcl.clean/inc/vcl/window.hxx 2008-01-14 08:04:14.000000000 -0500
83 +++ vcl/inc/vcl/window.hxx 2008-02-28 02:11:44.000000000 -0500
84 @@ -1121,6 +1121,22 @@ public:
85 /* mark Window for deletion in top of event queue
89 + //-------------------------------------
90 + // Keyboard access functions
91 + //-------------------------------------
93 + /** Query the states of keyboard indicators - Caps Lock, Num Lock and
94 + Scroll Lock. Use the following mask to retrieve the state of each
99 + INDICATOR_SCROLL_LOCK
101 + USHORT GetIndicatorState() const;
103 + void SimulateKeyPress( USHORT nKeyCode ) const;
105 virtual XubString GetSurroundingText() const;
106 virtual Selection GetSurroundingTextSelection() const;
107 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/os2/inc/salframe.h vcl/os2/inc/salframe.h
108 --- vcl.clean/os2/inc/salframe.h 2007-11-02 08:44:25.000000000 -0400
109 +++ vcl/os2/inc/salframe.h 2008-02-28 13:00:17.000000000 -0500
110 @@ -168,6 +168,8 @@ public:
111 virtual void Beep( SoundType eSoundType );
112 virtual const SystemEnvData* GetSystemData() const;
113 virtual SalPointerState GetPointerState();
114 + virtual SalIndicatorState GetIndicatorState();
115 + virtual void SimulateKeyPress( USHORT nKeyCode );
116 virtual void SetParent( SalFrame* pNewParent );
117 virtual bool SetPluginParent( SystemParentData* pNewParent );
118 virtual void SetBackgroundBitmap( SalBitmap* );
119 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/os2/source/window/salframe.cxx vcl/os2/source/window/salframe.cxx
120 --- vcl.clean/os2/source/window/salframe.cxx 2007-11-02 08:51:30.000000000 -0400
121 +++ vcl/os2/source/window/salframe.cxx 2008-02-28 13:01:25.000000000 -0500
122 @@ -2335,6 +2335,19 @@ SalFrame::SalPointerState Os2SalFrame::G
124 // -----------------------------------------------------------------------
126 +SalFrame::SalIndicatorState Os2SalFrame::GetIndicatorState()
128 + SalIndicatorState aState;
129 + aState.mnState = 0;
133 +void Os2SalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
137 +// -----------------------------------------------------------------------
139 void Os2SalFrame::SetBackgroundBitmap( SalBitmap* )
142 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/source/window/window.cxx vcl/source/window/window.cxx
143 --- vcl.clean/source/window/window.cxx 2008-01-29 11:18:41.000000000 -0500
144 +++ vcl/source/window/window.cxx 2008-02-28 14:00:43.000000000 -0500
145 @@ -4797,6 +4797,16 @@ void Window::doLazyDelete()
146 vcl::LazyDeletor<Window>::Delete( this );
149 +USHORT Window::GetIndicatorState() const
151 + return mpWindowImpl->mpFrame->GetIndicatorState().mnState;
154 +void Window::SimulateKeyPress( USHORT nKeyCode ) const
156 + mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode);
159 // -----------------------------------------------------------------------
161 void Window::MouseMove( const MouseEvent& rMEvt )
162 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkframe.cxx
163 --- vcl.clean/unx/gtk/window/gtkframe.cxx 2008-01-29 11:21:11.000000000 -0500
164 +++ vcl/unx/gtk/window/gtkframe.cxx 2008-02-28 14:02:01.000000000 -0500
165 @@ -2068,6 +2068,18 @@ SalFrame::SalPointerState GtkSalFrame::G
169 +SalFrame::SalIndicatorState GtkSalFrame::GetIndicatorState()
171 + SalIndicatorState aState;
172 + aState.mnState = GetX11SalData()->GetDisplay()->GetIndicatorState();
176 +void GtkSalFrame::SimulateKeyPress( USHORT nKeyCode )
178 + GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
181 void GtkSalFrame::SetInputContext( SalInputContext* pContext )
184 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/headless/svpframe.cxx vcl/unx/headless/svpframe.cxx
185 --- vcl.clean/unx/headless/svpframe.cxx 2007-08-03 10:09:51.000000000 -0400
186 +++ vcl/unx/headless/svpframe.cxx 2008-02-28 11:27:06.000000000 -0500
187 @@ -396,6 +396,17 @@ SalFrame::SalPointerState SvpSalFrame::G
191 +SalFrame::SalIndicatorState SvpSalFrame::GetIndicatorState()
193 + SalIndicatorState aState;
194 + aState.mnState = 0;
198 +void SvpSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
202 void SvpSalFrame::SetParent( SalFrame* pNewParent )
205 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/headless/svpframe.hxx vcl/unx/headless/svpframe.hxx
206 --- vcl.clean/unx/headless/svpframe.hxx 2007-07-24 06:27:17.000000000 -0400
207 +++ vcl/unx/headless/svpframe.hxx 2008-02-28 11:26:40.000000000 -0500
208 @@ -119,6 +119,8 @@ public:
209 virtual void Beep( SoundType eSoundType );
210 virtual const SystemEnvData* GetSystemData() const;
211 virtual SalPointerState GetPointerState();
212 + virtual SalIndicatorState GetIndicatorState();
213 + virtual void SimulateKeyPress( USHORT nKeyCode );
214 virtual void SetParent( SalFrame* pNewParent );
215 virtual bool SetPluginParent( SystemParentData* pNewParent );
216 virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
217 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/plugins/gtk/gtkframe.hxx vcl/unx/inc/plugins/gtk/gtkframe.hxx
218 --- vcl.clean/unx/inc/plugins/gtk/gtkframe.hxx 2008-01-29 11:21:43.000000000 -0500
219 +++ vcl/unx/inc/plugins/gtk/gtkframe.hxx 2008-02-28 11:22:22.000000000 -0500
220 @@ -364,6 +364,10 @@ public:
221 // get current modifier and button mask
222 virtual SalPointerState GetPointerState();
224 + virtual SalIndicatorState GetIndicatorState();
226 + virtual void SimulateKeyPress( USHORT nKeyCode );
228 // set new parent window
229 virtual void SetParent( SalFrame* pNewParent );
230 // reparent window to act as a plugin; implementation
231 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/prex.h vcl/unx/inc/prex.h
232 --- vcl.clean/unx/inc/prex.h 2007-04-26 06:40:23.000000000 -0400
233 +++ vcl/unx/inc/prex.h 2008-02-29 09:50:58.000000000 -0500
234 @@ -64,6 +64,12 @@ extern "C" {
235 #define __XKeyboardExtension__ 0
238 +#if defined(LINUX) || defined(SOLARIS) || defined(FREEBSD)
239 +#define __XTestExtension__ 1
241 +#define __XTestExtension__ 0
245 #include <X11/Xlib.h>
246 #include <X11/Xutil.h>
247 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/saldisp.hxx vcl/unx/inc/saldisp.hxx
248 --- vcl.clean/unx/inc/saldisp.hxx 2008-01-29 11:21:27.000000000 -0500
249 +++ vcl/unx/inc/saldisp.hxx 2008-02-28 10:16:38.000000000 -0500
250 @@ -457,6 +457,8 @@ public:
253 void ModifierMapping();
254 + void SimulateKeyPress( USHORT nKeyCode );
255 + USHORT GetIndicatorState() const;
256 String GetKeyNameFromKeySym( KeySym keysym ) const;
257 XubString GetKeyName( USHORT nKeyCode ) const;
258 USHORT GetKeyCode( KeySym keysym, char*pcPrintable ) const;
259 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/salframe.h vcl/unx/inc/salframe.h
260 --- vcl.clean/unx/inc/salframe.h 2007-08-30 09:56:30.000000000 -0400
261 +++ vcl/unx/inc/salframe.h 2008-02-28 11:25:36.000000000 -0500
262 @@ -272,6 +272,8 @@ public:
263 virtual void Beep( SoundType eSoundType );
264 virtual const SystemEnvData* GetSystemData() const;
265 virtual SalPointerState GetPointerState();
266 + virtual SalIndicatorState GetIndicatorState();
267 + virtual void SimulateKeyPress( USHORT nKeyCode );
268 virtual void SetParent( SalFrame* pNewParent );
269 virtual bool SetPluginParent( SystemParentData* pNewParent );
270 virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
271 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/source/app/saldisp.cxx vcl/unx/source/app/saldisp.cxx
272 --- vcl.clean/unx/source/app/saldisp.cxx 2008-01-29 11:22:34.000000000 -0500
273 +++ vcl/unx/source/app/saldisp.cxx 2008-03-01 22:26:55.000000000 -0500
274 @@ -86,6 +86,12 @@ Status XineramaGetInfo(Display*, int, XR
278 +#if __XTestExtension__
279 +#include <X11/extensions/XTest.h>
280 +#include <X11/extensions/XKB.h>
281 +#include <X11/XKBlib.h>
287 @@ -1074,6 +1078,35 @@ void SalDisplay::Beep() const
290 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
292 +void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
294 +#if __XTestExtension__
295 + if (nKeyCode == KEY_CAPSLOCK)
297 + XLIB_KeyCode keyCaps = XKeysymToKeycode(GetDisplay(), XK_Caps_Lock);
298 + if (XTestFakeKeyEvent(GetDisplay(), keyCaps, true, CurrentTime))
299 + XTestFakeKeyEvent(GetDisplay(), keyCaps, false, CurrentTime);
304 +USHORT SalDisplay::GetIndicatorState() const
306 + unsigned int _state = 0;
308 + XkbGetIndicatorState(pDisp_, XkbUseCoreKbd, &_state);
310 + if ((_state & 0x00000001))
311 + nState |= INDICATOR_CAPSLOCK;
312 + if ((_state & 0x00000002))
313 + nState |= INDICATOR_NUMLOCK;
314 + if ((_state & 0x00000004))
315 + nState |= INDICATOR_SCROLLLOCK;
320 String SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const
323 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/source/window/salframe.cxx vcl/unx/source/window/salframe.cxx
324 --- vcl.clean/unx/source/window/salframe.cxx 2008-01-30 04:12:30.000000000 -0500
325 +++ vcl/unx/source/window/salframe.cxx 2008-02-28 11:26:21.000000000 -0500
326 @@ -2757,6 +2757,18 @@ SalFrame::SalPointerState X11SalFrame::G
330 +SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState()
332 + SalIndicatorState aState;
333 + aState.mnState = GetX11SalData()->GetDisplay()->GetIndicatorState();
337 +void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
339 + GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
342 long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
344 SalMouseEvent aMouseEvt;
345 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/win/inc/salframe.h vcl/win/inc/salframe.h
346 --- vcl.clean/win/inc/salframe.h 2007-07-24 06:33:22.000000000 -0400
347 +++ vcl/win/inc/salframe.h 2008-02-28 12:58:19.000000000 -0500
348 @@ -149,6 +149,8 @@ public:
349 virtual void Beep( SoundType eSoundType );
350 virtual const SystemEnvData* GetSystemData() const;
351 virtual SalPointerState GetPointerState();
352 + virtual SalIndicatorState GetIndicatorState();
353 + virtual void SimulateKeyPress( USHORT nKeyCode );
354 virtual void SetParent( SalFrame* pNewParent );
355 virtual bool SetPluginParent( SystemParentData* pNewParent );
356 virtual void SetBackgroundBitmap( SalBitmap* );
357 --- vcl.clean/win/source/window/salframe.cxx 2008-01-15 08:25:15.000000000 -0500
358 +++ vcl/win/source/window/salframe.cxx 2008-03-01 21:12:23.000000000 -0500
359 @@ -3177,6 +3177,41 @@ SalFrame::SalPointerState WinSalFrame::G
361 // -----------------------------------------------------------------------
363 +SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
365 + SalIndicatorState aState;
366 + aState.mnState = 0;
367 + if (::GetKeyState(VK_CAPITAL))
368 + aState.mnState |= INDICATOR_CAPSLOCK;
370 + if (::GetKeyState(VK_NUMLOCK))
371 + aState.mnState |= INDICATOR_NUMLOCK;
373 + if (::GetKeyState(VK_SCROLL))
374 + aState.mnState |= INDICATOR_SCROLLLOCK;
379 +void WinSalFrame::SimulateKeyPress( USHORT nKeyCode )
385 + nVKey = VK_CAPITAL;
389 + if (nVKey > 0 && nVKey < 255)
391 + ::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
392 + ::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP, 0);
396 +// -----------------------------------------------------------------------
398 void WinSalFrame::SetBackgroundBitmap( SalBitmap* )
401 --- vcl/util/makefile.mk 29 Jan 2008 16:23:55 -0000 1.104
402 +++ vcl/util/makefile.mk 3 Mar 2008 15:06:27 -0000
405 .IF "$(GUIBASE)"=="unx"
407 -SHL2STDLIBS += -lXext -lSM -lICE -lX11
408 +SHL2STDLIBS += -lXext -lXtst -lSM -lICE -lX11
409 .IF "$(OS)"!="MACOSX" && "$(OS)"!="FREEBSD"
410 # needed by salprnpsp.cxx