summaryrefslogtreecommitdiff
path: root/packages/juce/files
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /packages/juce/files
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'packages/juce/files')
-rw-r--r--packages/juce/files/no-opengl.patch4477
-rw-r--r--packages/juce/files/remove-x86isms.patch2353
2 files changed, 0 insertions, 6830 deletions
diff --git a/packages/juce/files/no-opengl.patch b/packages/juce/files/no-opengl.patch
deleted file mode 100644
index dd379349f4..0000000000
--- a/packages/juce/files/no-opengl.patch
+++ /dev/null
@@ -1,4477 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- juce/demo/build/linux/JuceDemo.make~no-opengl
-+++ juce/demo/build/linux/JuceDemo.make
-@@ -13,7 +13,7 @@
- CPPFLAGS := -MD -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -I "/usr/include"
- CFLAGS += $(CPPFLAGS) -g -D_DEBUG -ggdb
- CXXFLAGS := $(CFLAGS)
-- LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -L "/usr/X11R6/lib/" -L "../../../bin" -lfreetype -lpthread -lX11 -lGL -lGLU -lXinerama -lasound -ljuce_debug
-+ LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -L "/usr/X11R6/lib/" -L "../../../bin" -lfreetype -lpthread -lX11 -lasound -ljuce_debug
- LDDEPS :=
- TARGET := jucedemo
- endif
-@@ -26,7 +26,7 @@
- CPPFLAGS := -MD -D "LINUX=1" -D "NDEBUG=1" -I "/usr/include"
- CFLAGS += $(CPPFLAGS) -O2
- CXXFLAGS := $(CFLAGS)
-- LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -s -L "/usr/X11R6/lib/" -L "../../../bin" -lfreetype -lpthread -lX11 -lGL -lGLU -lXinerama -lasound -ljuce
-+ LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -s -L "/usr/X11R6/lib/" -L "../../../bin" -lfreetype -lpthread -lX11 -lasound -ljuce
- LDDEPS :=
- TARGET := jucedemo
- endif
-@@ -39,7 +39,6 @@
- $(OBJDIR)/DragAndDropDemo.o \
- $(OBJDIR)/FontsAndTextDemo.o \
- $(OBJDIR)/InterprocessCommsDemo.o \
-- $(OBJDIR)/OpenGLDemo.o \
- $(OBJDIR)/PathsAndTransformsDemo.o \
- $(OBJDIR)/QuickTimeDemo.o \
- $(OBJDIR)/ThreadingDemo.o \
---- juce/platform_specific_code/juce_linux_Windowing.cpp
-+++ /dev/null
---- juce/linux/platform_specific_code/juce_linux_Windowing.cpp
-+++ /dev/null
---- juce/build/linux/platform_specific_code/juce_linux_Windowing.cpp~no-opengl
-+++ juce/build/linux/platform_specific_code/juce_linux_Windowing.cpp
-@@ -1,2218 +1,2219 @@
--/*
-- ==============================================================================
--
-- This file is part of the JUCE library - "Jules' Utility Class Extensions"
-- Copyright 2004-6 by Raw Material Software ltd.
--
-- ------------------------------------------------------------------------------
--
-- JUCE can be redistributed and/or modified under the terms of the
-- GNU General Public License, as published by the Free Software Foundation;
-- either version 2 of the License, or (at your option) any later version.
--
-- JUCE is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with JUCE; if not, visit www.gnu.org/licenses or write to the
-- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-- Boston, MA 02111-1307 USA
--
-- ------------------------------------------------------------------------------
--
-- If you'd like to release a closed-source product which uses JUCE, commercial
-- licenses are also available: visit www.rawmaterialsoftware.com/juce for
-- more information.
--
-- ==============================================================================
--*/
--
--#include "juce_Config.h"
--#if JUCE_BUILD_GUI_CLASSES
--
--#include "linuxincludes.h"
--#include <X11/Xlib.h>
--#include <X11/Xutil.h>
--#include <X11/Xatom.h>
--#include <X11/Xmd.h>
--#include <X11/keysym.h>
--#include <X11/cursorfont.h>
--
--#include "../../../juce_Config.h"
--
--#if JUCE_USE_XINERAMA
--#include <X11/extensions/Xinerama.h>
--#endif
--
--#if JUCE_OPENGL
--#include <X11/Xlib.h>
--#include <GL/glx.h>
--#endif
--
--#undef KeyPress
--
--#include "../../../src/juce_core/basics/juce_StandardHeader.h"
--
--BEGIN_JUCE_NAMESPACE
--
--#include "../../../src/juce_appframework/events/juce_Timer.h"
--#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h"
--#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPress.h"
--#include "../../../src/juce_appframework/application/juce_SystemClipboard.h"
--#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h"
--#include "../../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h"
--#include "../../../src/juce_appframework/gui/components/juce_Desktop.h"
--#include "../../../src/juce_appframework/events/juce_MessageManager.h"
--#include "../../../src/juce_appframework/gui/components/juce_RepaintManager.h"
--#include "../../../src/juce_appframework/gui/components/juce_ComponentDeletionWatcher.h"
--#include "../../../src/juce_appframework/gui/graphics/geometry/juce_RectangleList.h"
--#include "../../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.h"
--#include "../../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.h"
--#include "../../../src/juce_core/basics/juce_Logger.h"
--#include "../../../src/juce_core/threads/juce_Process.h"
--#include "../../../src/juce_core/misc/juce_PlatformUtilities.h"
--
--
--//==============================================================================
--static Atom wm_ChangeState = None;
--static Atom wm_State = None;
--static Atom wm_Protocols = None;
--static Atom wm_ProtocolList [2] = { None, None };
--static Atom wm_ActiveWin = None;
--static Atom repaintId = None;
--
--#define TAKE_FOCUS 0
--#define DELETE_WINDOW 1
--
--//==============================================================================
--static bool isActiveApplication = false;
--
--bool Process::isForegroundProcess()
--{
-- return isActiveApplication;
--}
--
--//==============================================================================
--// These are defined in juce_linux_Messages.cpp
--extern Display* display;
--extern XContext improbableNumber;
--
--const int juce_windowIsSemiTransparentFlag = (1 << 31); // also in component.cpp
--
--static const int eventMask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask
-- | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask
-- | ExposureMask | StructureNotifyMask | FocusChangeMask;
--
--//==============================================================================
--static int pointerMap[5];
--static int lastMousePosX = 0, lastMousePosY = 0;
--
--enum MouseButtons
--{
-- NoButton = 0,
-- LeftButton = 1,
-- MiddleButton = 2,
-- RightButton = 3,
-- WheelUp = 4,
-- WheelDown = 5
--};
--
--static void getMousePos (int& x, int& y, int& mouseMods)
--{
-- Window root, child;
-- int winx, winy;
-- unsigned int mask;
--
-- mouseMods = 0;
--
-- if (XQueryPointer (display,
-- RootWindow (display, DefaultScreen (display)),
-- &root, &child,
-- &x, &y, &winx, &winy, &mask) == False)
-- {
-- // Pointer not on the default screen
-- x = y = -1;
-- }
-- else
-- {
-- if ((mask & Button1Mask) != 0)
-- mouseMods |= ModifierKeys::leftButtonModifier;
--
-- if ((mask & Button2Mask) != 0)
-- mouseMods |= ModifierKeys::middleButtonModifier;
--
-- if ((mask & Button3Mask) != 0)
-- mouseMods |= ModifierKeys::rightButtonModifier;
-- }
--}
--
--//==============================================================================
--static int AltMask = 0;
--static int NumLockMask = 0;
--static bool numLock = 0;
--static bool capsLock = 0;
--static char keyStates [32];
--
--static void updateKeyStates (const int keycode, const bool press)
--{
-- const int keybyte = keycode >> 3;
-- const int keybit = (1 << (keycode & 7));
--
-- if (press)
-- keyStates [keybyte] |= keybit;
-- else
-- keyStates [keybyte] &= ~keybit;
--}
--
--static bool keyDown (const int keycode)
--{
-- const int keybyte = keycode >> 3;
-- const int keybit = (1 << (keycode & 7));
--
-- return (keyStates [keybyte] & keybit) != 0;
--}
--
--static const int nonAsciiModifier = 0x10000;
--
--bool KeyPress::isKeyCurrentlyDown (int keyCode)
--{
-- int keysym;
--
-- if (keyCode & nonAsciiModifier)
-- {
-- keysym = 0xff00 | (keyCode & 0xff);
-- }
-- else
-- {
-- keysym = keyCode;
--
-- if (keysym == (XK_Tab & 0xff)
-- || keysym == (XK_Return & 0xff)
-- || keysym == (XK_Escape & 0xff)
-- || keysym == (XK_BackSpace & 0xff))
-- {
-- keysym |= 0xff00;
-- }
-- }
--
-- return keyDown (XKeysymToKeycode (display, keysym));
--}
--
--//==============================================================================
--// Alt and Num lock are not defined by standard X
--// modifier constants: check what they're mapped to
--static void getModifierMapping()
--{
-- const int altLeftCode = XKeysymToKeycode (display, XK_Alt_L);
-- const int numLockCode = XKeysymToKeycode (display, XK_Num_Lock);
--
-- AltMask = 0;
-- NumLockMask = 0;
--
-- XModifierKeymap* mapping = XGetModifierMapping (display);
--
-- if (mapping)
-- {
-- for (int i = 0; i < 8; i++)
-- {
-- if (mapping->modifiermap [i << 1] == altLeftCode)
-- AltMask = 1 << i;
-- else if (mapping->modifiermap [i << 1] == numLockCode)
-- NumLockMask = 1 << i;
-- }
--
-- XFreeModifiermap (mapping);
-- }
--}
--
--static int currentModifiers = 0;
--
--void ModifierKeys::updateCurrentModifiers()
--{
-- currentModifierFlags = currentModifiers;
--}
--
--const ModifierKeys ModifierKeys::getCurrentModifiersRealtime()
--{
-- int x, y, mouseMods;
-- getMousePos (x, y, mouseMods);
--
-- currentModifiers &= ~ModifierKeys::allMouseButtonModifiers;
-- currentModifiers |= mouseMods;
--
-- return ModifierKeys (currentModifiers);
--}
--
--static void updateKeyModifiers (const int status)
--{
-- currentModifiers &= ~(ModifierKeys::shiftModifier
-- | ModifierKeys::ctrlModifier
-- | ModifierKeys::altModifier);
--
-- if (status & ShiftMask)
-- currentModifiers |= ModifierKeys::shiftModifier;
--
-- if (status & ControlMask)
-- currentModifiers |= ModifierKeys::ctrlModifier;
--
-- if (status & AltMask)
-- currentModifiers |= ModifierKeys::altModifier;
--
-- numLock = ((status & NumLockMask) != 0);
-- capsLock = ((status & LockMask) != 0);
--}
--
--static bool updateKeyModifiersFromSym (KeySym sym, const bool press)
--{
-- int modifier = 0;
-- bool isModifier = true;
--
-- switch (sym)
-- {
-- case XK_Shift_L:
-- case XK_Shift_R:
-- modifier = ModifierKeys::shiftModifier;
-- break;
--
-- case XK_Control_L:
-- case XK_Control_R:
-- modifier = ModifierKeys::ctrlModifier;
-- break;
--
-- case XK_Alt_L:
-- case XK_Alt_R:
-- modifier = ModifierKeys::altModifier;
-- break;
--
-- case XK_Num_Lock:
-- if (press)
-- numLock = ! numLock;
--
-- break;
--
-- case XK_Caps_Lock:
-- if (press)
-- capsLock = ! capsLock;
--
-- break;
--
-- case XK_Scroll_Lock:
-- break;
--
-- default:
-- isModifier = false;
-- break;
-- }
--
-- if (modifier != 0)
-- {
-- if (press)
-- currentModifiers |= modifier;
-- else
-- currentModifiers &= ~modifier;
-- }
--
-- return isModifier;
--}
--
--
--//==============================================================================
--class XBitmapImage : public Image
--{
--public:
-- //==============================================================================
-- XBitmapImage (const PixelFormat format_, const int w, const int h, const bool clearImage)
-- : Image (format_, w, h)
-- {
-- jassert (format_ == RGB || format_ == ARGB);
--
-- pixelStride = (format_ == RGB) ? 3 : 4;
-- lineStride = ((w * pixelStride + 3) & ~3);
-- imageData = (uint8*) juce_malloc (lineStride * h);
--
-- if (format_ == ARGB && clearImage)
-- zeromem (xImage->data, h * lineStride);
--
-- xImage = new XImage();
-- xImage->width = w;
-- xImage->height = h;
-- xImage->xoffset = 0;
-- xImage->format = ZPixmap;
-- xImage->data = (char*) imageData;
-- xImage->byte_order = ImageByteOrder (display);
-- xImage->bitmap_unit = BitmapUnit (display);
-- xImage->bitmap_bit_order = BitmapBitOrder (display);
-- xImage->bitmap_pad = 32;
-- xImage->depth = pixelStride * 8;
-- xImage->bytes_per_line = lineStride;
-- xImage->bits_per_pixel = pixelStride * 8;
-- xImage->red_mask = 0x00FF0000;
-- xImage->green_mask = 0x0000FF00;
-- xImage->blue_mask = 0x000000FF;
--
-- if (! XInitImage (xImage))
-- {
-- jassertfalse
-- }
-- }
--
-- ~XBitmapImage()
-- {
-- juce_free (xImage->data);
-- xImage->data = 0;
-- XDestroyImage (xImage);
-- imageData = 0; // to stop the base class freeing this
-- }
--
-- void blitToWindow (Window window, int dx, int dy, int dw, int dh, int sx, int sy)
-- {
-- static GC gc = 0;
--
-- if (gc == 0)
-- gc = DefaultGC (display, DefaultScreen (display));
--
-- // blit results to screen.
-- XPutImage (display, (Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh);
-- }
--
-- //==============================================================================
-- juce_UseDebuggingNewOperator
--
--private:
-- XImage* xImage;
--};
--
--
--//==============================================================================
--class LinuxComponentPeer : public ComponentPeer
--{
--public:
-- //==============================================================================
-- LinuxComponentPeer (Component* const component, const int windowStyleFlags)
-- : ComponentPeer (component, windowStyleFlags),
-- windowH (0),
-- wx (0),
-- wy (0),
-- ww (0),
-- wh (0),
-- fullScreen (false),
-- entered (false),
-- mapped (false)
-- {
-- repainter = new LinuxRepaintManager (this, component, 3000);
--
-- MessageManager::getInstance()
-- ->callFunctionOnMessageThread (&createWindowCallback, (void*) this);
--
-- setTitle (component->getName());
-- }
--
-- ~LinuxComponentPeer()
-- {
-- MessageManager::getInstance()
-- ->callFunctionOnMessageThread (&destroyWindowCallback, (void*) windowH);
--
-- windowH = 0;
-- delete repainter;
-- }
--
-- //==============================================================================
-- void* getNativeHandle() const
-- {
-- return (void*) windowH;
-- }
--
-- void setVisible (bool shouldBeVisible)
-- {
-- if (shouldBeVisible)
-- XMapWindow (display, windowH);
-- else
-- XUnmapWindow (display, windowH);
-- }
--
-- void setTitle (const String& title)
-- {
-- setWindowTitle (windowH, title);
-- }
--
-- void setPosition (int x, int y)
-- {
-- setBounds (x, y, ww, wh, false);
-- }
--
-- void setSize (int w, int h)
-- {
-- setBounds (wx, wy, w, h, false);
-- }
--
-- void setBounds (int x, int y, int w, int h, const bool isNowFullScreen)
-- {
-- fullScreen = isNowFullScreen;
--
-- if (windowH != 0)
-- {
-- const ComponentDeletionWatcher deletionChecker (component);
--
-- wx = x;
-- wy = y;
-- ww = jmax (1, w);
-- wh = jmax (1, h);
--
-- if (! mapped)
-- {
-- // Make sure the Window manager does what we want
-- XSizeHints* hints = XAllocSizeHints();
-- hints->flags = USSize | USPosition;
-- hints->width = ww + windowBorder.getLeftAndRight();
-- hints->height = wh + windowBorder.getTopAndBottom();
-- hints->x = wx - windowBorder.getLeft();
-- hints->y = wy - windowBorder.getTop();
-- XSetWMNormalHints (display, windowH, hints);
-- XFree (hints);
-- }
--
-- XMoveResizeWindow (display, windowH,
-- wx - windowBorder.getLeft(),
-- wy - windowBorder.getTop(),
-- ww + windowBorder.getLeftAndRight(),
-- wh + windowBorder.getTopAndBottom());
--
-- if (! deletionChecker.hasBeenDeleted())
-- {
-- updateBorderSize();
-- handleMovedOrResized();
-- }
-- }
-- }
--
-- void getBounds (int& x, int& y, int& w, int& h) const
-- {
-- x = wx;
-- y = wy;
-- w = ww;
-- h = wh;
-- }
--
-- int getScreenX() const
-- {
-- return wx;
-- }
--
-- int getScreenY() const
-- {
-- return wy;
-- }
--
-- void setMinimised (bool shouldBeMinimised)
-- {
-- if (shouldBeMinimised)
-- {
-- Window root = RootWindow (display, DefaultScreen (display));
--
-- XClientMessageEvent clientMsg;
-- clientMsg.display = display;
-- clientMsg.window = windowH;
-- clientMsg.type = ClientMessage;
-- clientMsg.format = 32;
-- clientMsg.message_type = wm_ChangeState;
-- clientMsg.data.l[0] = IconicState;
--
-- XSendEvent (display, root, false,
-- SubstructureRedirectMask | SubstructureNotifyMask,
-- (XEvent*) &clientMsg);
-- }
-- else
-- {
-- setVisible (true);
-- }
-- }
--
-- bool isMinimised() const
-- {
-- bool minimised = false;
--
-- CARD32* stateProp;
-- unsigned long nitems, bytesLeft;
-- Atom actualType;
-- int actualFormat;
--
-- if (XGetWindowProperty (display, windowH, wm_State, 0, 64, False,
-- wm_State, &actualType, &actualFormat, &nitems, &bytesLeft,
-- (unsigned char**) &stateProp) == Success
-- && actualType == wm_State
-- && actualFormat == 32
-- && nitems > 0)
-- {
-- if (stateProp[0] == IconicState)
-- minimised = true;
--
-- XFree (stateProp);
-- }
--
-- return minimised;
-- }
--
-- void setFullScreen (bool shouldBeFullScreen)
-- {
-- setMinimised (false);
--
-- if (fullScreen != shouldBeFullScreen)
-- {
-- Rectangle r (lastNonFullscreenBounds);
--
-- if (shouldBeFullScreen)
-- r = Desktop::getInstance().getMainMonitorArea();
--
-- if (! r.isEmpty())
-- setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen);
--
-- getComponent()->repaint();
-- }
-- }
--
-- bool isFullScreen() const
-- {
-- return fullScreen;
-- }
--
-- bool isChildWindowOf (Window possibleParent) const
-- {
-- Window* windowList = 0;
-- uint32 windowListSize = 0;
-- Window parent, root;
--
-- if (XQueryTree (display, windowH, &root, &parent, &windowList, &windowListSize) != 0)
-- {
-- if (windowList != 0)
-- XFree (windowList);
--
-- return parent == possibleParent;
-- }
--
-- return false;
-- }
--
-- bool contains (int x, int y, bool trueIfInAChildWindow) const
-- {
-- jassert (x >= 0 && y >= 0 && x < ww && y < wh); // should only be called for points that are actually inside the bounds
--
-- x += wx;
-- y += wy;
--
-- // the XQueryTree stuff later on is VERY slow, so if this call's just to check the mouse pos, it's
-- // much more efficient to cheat..
-- if (x == lastMousePosX && y == lastMousePosY)
-- {
-- Window root, child;
-- int winx, winy;
-- unsigned int mask;
--
-- if (XQueryPointer (display,
-- RootWindow (display, DefaultScreen (display)),
-- &root, &child,
-- &x, &y, &winx, &winy, &mask) != False)
-- {
-- return child == windowH
-- || (((styleFlags & windowHasTitleBar) != 0) && isChildWindowOf (child));
-- }
-- }
--
-- bool result = false;
--
-- Window* windowList = 0;
-- uint32 windowListSize = 0;
--
-- Window parent, root = RootWindow (display, DefaultScreen (display));
--
-- if (XQueryTree (display, root, &root, &parent, &windowList, &windowListSize) != 0)
-- {
-- for (int i = windowListSize; --i >= 0;)
-- {
-- XWindowAttributes atts;
--
-- if (windowList[i] == windowH
-- || (((styleFlags & windowHasTitleBar) != 0) && isChildWindowOf (windowList[i])))
-- {
-- result = true;
--
-- if (! trueIfInAChildWindow)
-- {
-- Window child;
-- int tempX, tempY;
--
-- result = XTranslateCoordinates (display, windowH, windowH,
-- x - wx - windowBorder.getLeft(),
-- y - wy - windowBorder.getTop(),
-- &tempX, &tempY,
-- &child)
-- && (child == None);
-- }
--
-- break;
-- }
-- else if (XGetWindowAttributes (display, windowList[i], &atts)
-- && atts.map_state == IsViewable
-- && x >= atts.x && y >= atts.y
-- && x < atts.x + atts.width
-- && y < atts.y + atts.height)
-- {
-- break;
-- }
-- }
-- }
--
-- if (windowList != 0)
-- XFree (windowList);
--
-- return result;
-- }
--
-- const BorderSize getFrameSize() const
-- {
-- return BorderSize();
-- }
--
-- bool setAlwaysOnTop (bool alwaysOnTop)
-- {
-- if (windowH != 0)
-- {
-- XSetWindowAttributes swa;
-- swa.override_redirect = getComponent()->isAlwaysOnTop() ? True : False;
--
-- XChangeWindowAttributes (display, windowH, CWOverrideRedirect, &swa);
-- }
--
-- return true;
-- }
--
-- void toFront (bool makeActive)
-- {
-- if (makeActive)
-- {
-- setVisible (true);
-- grabFocus();
-- }
--
-- XEvent ev;
-- ev.xclient.type = ClientMessage;
-- ev.xclient.serial = 0;
-- ev.xclient.send_event = True;
-- ev.xclient.message_type = wm_ActiveWin;
-- ev.xclient.window = windowH;
-- ev.xclient.format = 32;
-- ev.xclient.data.l[0] = 2;
-- ev.xclient.data.l[1] = CurrentTime;
-- ev.xclient.data.l[2] = 0;
-- ev.xclient.data.l[3] = 0;
-- ev.xclient.data.l[4] = 0;
--
-- XSendEvent (display, RootWindow (display, DefaultScreen (display)),
-- False,
-- SubstructureRedirectMask | SubstructureNotifyMask,
-- &ev);
--
-- XSync (display, False);
-- }
--
-- void toBehind (ComponentPeer* other)
-- {
-- LinuxComponentPeer* const otherPeer = dynamic_cast <LinuxComponentPeer*> (other);
-- jassert (otherPeer != 0); // wrong type of window?
--
-- if (otherPeer != 0)
-- {
-- setMinimised (false);
--
-- Window newStack[] = { otherPeer->windowH, windowH };
--
-- XRestackWindows (display, newStack, 2);
-- }
-- }
--
-- bool isFocused() const
-- {
-- int revert;
-- Window focus = 0;
-- XGetInputFocus (display, &focus, &revert);
--
-- if (focus == 0 || focus == None || focus == PointerRoot)
-- return 0;
--
-- ComponentPeer* focusedPeer = 0;
-- if (XFindContext (display, (XID) focus, improbableNumber, (XPointer*) &focusedPeer) != 0)
-- focusedPeer = 0;
--
-- return this == focusedPeer;
-- }
--
-- void grabFocus()
-- {
-- XWindowAttributes atts;
--
-- if (windowH != 0
-- && XGetWindowAttributes (display, windowH, &atts)
-- && atts.map_state == IsViewable)
-- {
-- XSetInputFocus (display, windowH, RevertToParent, CurrentTime);
--
-- if (! isActiveApplication)
-- {
-- isActiveApplication = true;
-- handleFocusGain();
-- }
-- }
-- }
--
-- void repaint (int x, int y, int w, int h)
-- {
-- repainter->invalidateCache (x, y, w, h);
-- repainter->repaint (x, y, w, h);
-- }
--
-- void performPendingRepaints()
-- {
-- repainter->performPendingRepaints();
-- }
--
-- //==============================================================================
-- void handleWindowMessage (XEvent* event)
-- {
-- switch (event->xany.type)
-- {
-- case 2: // 'KeyPress'
-- {
-- XKeyEvent* keyEvent = (XKeyEvent*) &event->xkey;
-- updateKeyStates (keyEvent->keycode, true);
--
-- int index = currentModifiers & ModifierKeys::shiftModifier ? 1 : 0;
-- KeySym sym = XKeycodeToKeysym (display, keyEvent->keycode, index);
--
-- const int oldMods = currentModifiers;
-- bool keyPressed = false;
--
-- const bool keyDownChange = (sym != NoSymbol) && ! updateKeyModifiersFromSym (sym, false);
--
-- if ((sym & 0xff00) == 0xff00)
-- {
-- // Translate keypad
-- if (sym == XK_KP_Divide)
-- sym = XK_slash;
-- else if (sym == XK_KP_Multiply)
-- sym = XK_asterisk;
-- else if (sym == XK_KP_Subtract)
-- sym = XK_hyphen;
-- else if (sym == XK_KP_Add)
-- sym = XK_plus;
-- else if (sym == XK_KP_Enter)
-- sym = XK_Return;
-- else if (sym == XK_KP_Decimal)
-- sym = numLock ? XK_period : XK_Delete;
-- else if (sym == XK_KP_0)
-- sym = numLock ? XK_0 : XK_Insert;
-- else if (sym == XK_KP_1)
-- sym = numLock ? XK_1 : XK_End;
-- else if (sym == XK_KP_2)
-- sym = numLock ? XK_2 : XK_Down;
-- else if (sym == XK_KP_3)
-- sym = numLock ? XK_3 : XK_Page_Down;
-- else if (sym == XK_KP_4)
-- sym = numLock ? XK_4 : XK_Left;
-- else if (sym == XK_KP_5)
-- sym = XK_5;
-- else if (sym == XK_KP_6)
-- sym = numLock ? XK_6 : XK_Right;
-- else if (sym == XK_KP_7)
-- sym = numLock ? XK_7 : XK_Home;
-- else if (sym == XK_KP_8)
-- sym = numLock ? XK_8 : XK_Up;
-- else if (sym == XK_KP_9)
-- sym = numLock ? XK_9 : XK_Page_Up;
--
-- switch (sym)
-- {
-- case XK_Left:
-- case XK_Right:
-- case XK_Up:
-- case XK_Down:
-- case XK_Page_Up:
-- case XK_Page_Down:
-- case XK_End:
-- case XK_Home:
-- case XK_Delete:
-- case XK_Insert:
-- keyPressed = true;
-- sym = (sym & 0xff) | nonAsciiModifier;
-- break;
-- case XK_Tab:
-- case XK_Return:
-- case XK_Escape:
-- case XK_BackSpace:
-- keyPressed = true;
-- sym &= 0xff;
-- break;
-- default:
-- {
-- if (sym >= XK_F1 && sym <= XK_F12)
-- {
-- keyPressed = true;
-- sym = (sym & 0xff) | nonAsciiModifier;
-- }
-- break;
-- }
-- }
-- }
--
-- if ((sym & 0xff00) == 0 && sym >= 8)
-- keyPressed = true;
--
-- if (capsLock && ((sym >= XK_A && sym <= XK_Z) || (sym >= XK_a && sym <= XK_z)))
-- {
-- index ^= 1;
-- sym = XKeycodeToKeysym (display, keyEvent->keycode, index);
-- }
--
-- if (oldMods != currentModifiers)
-- handleModifierKeysChange();
--
-- if (keyDownChange)
-- handleKeyUpOrDown();
--
-- if (keyPressed)
-- handleKeyPress (sym);
--
-- break;
-- }
--
-- case KeyRelease:
-- {
-- XKeyEvent* keyEvent = (XKeyEvent*) &event->xkey;
-- updateKeyStates (keyEvent->keycode, false);
--
-- KeySym sym = XKeycodeToKeysym (display, keyEvent->keycode, 0);
--
-- const int oldMods = currentModifiers;
-- const bool keyDownChange = (sym != NoSymbol) && ! updateKeyModifiersFromSym (sym, false);
--
-- if (oldMods != currentModifiers)
-- handleModifierKeysChange();
--
-- if (keyDownChange)
-- handleKeyUpOrDown();
--
-- break;
-- }
--
-- case ButtonPress:
-- {
-- XButtonPressedEvent* buttonPressEvent = (XButtonPressedEvent*) &event->xbutton;
--
-- bool buttonMsg = false;
-- bool wheelUpMsg = false;
-- bool wheelDownMsg = false;
--
-- const int map = pointerMap [buttonPressEvent->button - Button1];
--
-- if (map == LeftButton)
-- {
-- currentModifiers |= ModifierKeys::leftButtonModifier;
-- buttonMsg = true;
-- }
-- else if (map == RightButton)
-- {
-- currentModifiers |= ModifierKeys::rightButtonModifier;
-- buttonMsg = true;
-- }
-- else if (map == MiddleButton)
-- {
-- currentModifiers |= ModifierKeys::middleButtonModifier;
-- buttonMsg = true;
-- }
-- else if (map == WheelUp)
-- {
-- wheelUpMsg = true;
-- }
-- else if (map == WheelDown)
-- {
-- wheelDownMsg = true;
-- }
--
-- updateKeyModifiers (buttonPressEvent->state);
--
-- if (buttonMsg)
-- {
-- toFront (true);
-- handleMouseDown (buttonPressEvent->x, buttonPressEvent->y,
-- getEventTime (buttonPressEvent->time));
-- }
-- else if (wheelUpMsg || wheelDownMsg)
-- {
-- handleMouseWheel (wheelDownMsg ? -84 : 84,
-- getEventTime (buttonPressEvent->time));
-- }
--
-- lastMousePosX = lastMousePosY = 0x100000;
-- break;
-- }
--
-- case ButtonRelease:
-- {
-- XButtonReleasedEvent* buttonRelEvent = (XButtonReleasedEvent*) &event->xbutton;
--
-- const int oldModifiers = currentModifiers;
-- const int map = pointerMap [buttonRelEvent->button - Button1];
--
-- if (map == LeftButton)
-- currentModifiers &= ~ModifierKeys::leftButtonModifier;
-- else if (map == RightButton)
-- currentModifiers &= ~ModifierKeys::rightButtonModifier;
-- else if (map == MiddleButton)
--