1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Added an initial set of Android stub files.

This commit is contained in:
Julian Storer 2011-01-27 22:09:47 +00:00
parent e235912ae5
commit 9ea6fb4cd1
29 changed files with 2907 additions and 136 deletions

View file

@ -0,0 +1,389 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-10 by Raw Material Software Ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the GNU General
Public License (Version 2), as published by the Free Software Foundation.
A copy of the license is included in the JUCE distribution, or can be found
online at www.gnu.org/licenses.
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.rawmaterialsoftware.com/juce for more information.
==============================================================================
*/
// (This file gets included by juce_win32_NativeCode.cpp, rather than being
// compiled on its own).
#if JUCE_INCLUDED_FILE
//==============================================================================
class AndroidComponentPeer : public ComponentPeer
{
public:
//==============================================================================
AndroidComponentPeer (Component* const component, const int windowStyleFlags)
: ComponentPeer (component, windowStyleFlags)
{
// TODO
}
~AndroidComponentPeer()
{
}
void* getNativeHandle() const
{
return 0; // TODO
}
void setVisible (bool shouldBeVisible)
{
}
void setTitle (const String& title)
{
}
void setPosition (int x, int y)
{
// TODO
}
void setSize (int w, int h)
{
}
void setBounds (int x, int y, int w, int h, bool isNowFullScreen)
{
// TODO
}
const Rectangle<int> getBounds() const
{
// TODO
return Rectangle<int>();
}
const Point<int> getScreenPosition() const
{
// TODO
return Point<int>();
}
const Point<int> localToGlobal (const Point<int>& relativePosition)
{
// TODO
return relativePosition + getScreenPosition();
}
const Point<int> globalToLocal (const Point<int>& screenPosition)
{
// TODO
return screenPosition - getScreenPosition();
}
void setMinimised (bool shouldBeMinimised)
{
// TODO
}
bool isMinimised() const
{
}
void setFullScreen (bool shouldBeFullScreen)
{
// TODO
}
bool isFullScreen() const
{
// TODO
return false;
}
void setIcon (const Image& newIcon)
{
// TODO
}
bool contains (const Point<int>& position, bool trueIfInAChildWindow) const
{
// TODO
return isPositiveAndBelow (position.getX(), component->getWidth())
&& isPositiveAndBelow (position.getY(), component->getHeight());
}
const BorderSize<int> getFrameSize() const
{
// TODO
return BorderSize<int>();
}
bool setAlwaysOnTop (bool alwaysOnTop)
{
// TODO
return false;
}
void toFront (bool makeActive)
{
// TODO
}
void toBehind (ComponentPeer* other)
{
// TODO
}
//==============================================================================
bool isFocused() const
{
// TODO
return false;
}
void grabFocus()
{
// TODO
}
void textInputRequired (const Point<int>& position)
{
// TODO
}
//==============================================================================
void repaint (const Rectangle<int>& area)
{
// TODO
}
void performAnyPendingRepaintsNow()
{
// TODO
}
void setAlpha (float newAlpha)
{
// TODO
}
private:
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidComponentPeer);
};
ComponentPeer* Component::createNewPeer (int styleFlags, void*)
{
return new AndroidComponentPeer (this, styleFlags);
}
//==============================================================================
bool Desktop::canUseSemiTransparentWindows() throw()
{
return true; // TODO
}
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
{
// TODO
return upright;
}
void Desktop::createMouseInputSources()
{
// This creates a mouse input source for each possible finger
for (int i = 0; i < 10; ++i)
mouseSources.add (new MouseInputSource (i, false));
}
const Point<int> MouseInputSource::getCurrentMousePosition()
{
// TODO
return Point<int>();
}
void Desktop::setMousePosition (const Point<int>& newPosition)
{
// not needed
}
//==============================================================================
bool KeyPress::isKeyCurrentlyDown (const int keyCode)
{
// TODO
return false;
}
void ModifierKeys::updateCurrentModifiers() throw()
{
// not needed
}
const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw()
{
// TODO
return ModifierKeys();
}
//==============================================================================
bool Process::isForegroundProcess()
{
return true; // TODO
}
//==============================================================================
bool AlertWindow::showNativeDialogBox (const String& title,
const String& bodyText,
bool isOkCancel)
{
// TODO
}
//==============================================================================
Image::SharedImage* Image::SharedImage::createNativeImage (PixelFormat format, int width, int height, bool clearImage)
{
return createSoftwareImage (format, width, height, clearImage);
}
void Desktop::setScreenSaverEnabled (const bool isEnabled)
{
// TODO
}
bool Desktop::isScreenSaverEnabled()
{
return true;
}
//==============================================================================
void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool /*allowMenusAndBars*/)
{
}
//==============================================================================
void juce_updateMultiMonitorInfo (Array <Rectangle<int> >& monitorCoords, const bool clipToWorkArea)
{
// TODO
monitorCoords.add (Rectangle<int> (0, 0, 640, 480));
}
//==============================================================================
const Image juce_createIconForFile (const File& file)
{
Image image;
// TODO
return image;
}
//==============================================================================
void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY)
{
return 0;
}
void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard)
{
}
void* MouseCursor::createStandardMouseCursor (const MouseCursor::StandardCursorType type)
{
return 0;
}
//==============================================================================
void MouseCursor::showInWindow (ComponentPeer*) const {}
void MouseCursor::showInAllWindows() const {}
//==============================================================================
bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMove)
{
return false;
}
bool DragAndDropContainer::performExternalDragDropOfText (const String& text)
{
return false;
}
//==============================================================================
const int extendedKeyModifier = 0x10000;
const int KeyPress::spaceKey = ' ';
const int KeyPress::returnKey = 0x0d;
const int KeyPress::escapeKey = 0x1b;
const int KeyPress::backspaceKey = 0x7f;
const int KeyPress::leftKey = extendedKeyModifier + 1;
const int KeyPress::rightKey = extendedKeyModifier + 2;
const int KeyPress::upKey = extendedKeyModifier + 3;
const int KeyPress::downKey = extendedKeyModifier + 4;
const int KeyPress::pageUpKey = extendedKeyModifier + 5;
const int KeyPress::pageDownKey = extendedKeyModifier + 6;
const int KeyPress::endKey = extendedKeyModifier + 7;
const int KeyPress::homeKey = extendedKeyModifier + 8;
const int KeyPress::deleteKey = extendedKeyModifier + 9;
const int KeyPress::insertKey = -1;
const int KeyPress::tabKey = 9;
const int KeyPress::F1Key = extendedKeyModifier + 10;
const int KeyPress::F2Key = extendedKeyModifier + 11;
const int KeyPress::F3Key = extendedKeyModifier + 12;
const int KeyPress::F4Key = extendedKeyModifier + 13;
const int KeyPress::F5Key = extendedKeyModifier + 14;
const int KeyPress::F6Key = extendedKeyModifier + 16;
const int KeyPress::F7Key = extendedKeyModifier + 17;
const int KeyPress::F8Key = extendedKeyModifier + 18;
const int KeyPress::F9Key = extendedKeyModifier + 19;
const int KeyPress::F10Key = extendedKeyModifier + 20;
const int KeyPress::F11Key = extendedKeyModifier + 21;
const int KeyPress::F12Key = extendedKeyModifier + 22;
const int KeyPress::F13Key = extendedKeyModifier + 23;
const int KeyPress::F14Key = extendedKeyModifier + 24;
const int KeyPress::F15Key = extendedKeyModifier + 25;
const int KeyPress::F16Key = extendedKeyModifier + 26;
const int KeyPress::numberPad0 = extendedKeyModifier + 27;
const int KeyPress::numberPad1 = extendedKeyModifier + 28;
const int KeyPress::numberPad2 = extendedKeyModifier + 29;
const int KeyPress::numberPad3 = extendedKeyModifier + 30;
const int KeyPress::numberPad4 = extendedKeyModifier + 31;
const int KeyPress::numberPad5 = extendedKeyModifier + 32;
const int KeyPress::numberPad6 = extendedKeyModifier + 33;
const int KeyPress::numberPad7 = extendedKeyModifier + 34;
const int KeyPress::numberPad8 = extendedKeyModifier + 35;
const int KeyPress::numberPad9 = extendedKeyModifier + 36;
const int KeyPress::numberPadAdd = extendedKeyModifier + 37;
const int KeyPress::numberPadSubtract = extendedKeyModifier + 38;
const int KeyPress::numberPadMultiply = extendedKeyModifier + 39;
const int KeyPress::numberPadDivide = extendedKeyModifier + 40;
const int KeyPress::numberPadSeparator = extendedKeyModifier + 41;
const int KeyPress::numberPadDecimalPoint = extendedKeyModifier + 42;
const int KeyPress::numberPadEquals = extendedKeyModifier + 43;
const int KeyPress::numberPadDelete = extendedKeyModifier + 44;
const int KeyPress::playKey = extendedKeyModifier + 45;
const int KeyPress::stopKey = extendedKeyModifier + 46;
const int KeyPress::fastForwardKey = extendedKeyModifier + 47;
const int KeyPress::rewindKey = extendedKeyModifier + 48;
#endif