mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
Added an initial set of Android stub files.
This commit is contained in:
parent
e235912ae5
commit
9ea6fb4cd1
29 changed files with 2907 additions and 136 deletions
114
src/native/android/juce_android_Messaging.cpp
Normal file
114
src/native/android/juce_android_Messaging.cpp
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
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_android_NativeCode.cpp, rather than being
|
||||
// compiled on its own).
|
||||
#if JUCE_INCLUDED_FILE
|
||||
|
||||
|
||||
//==============================================================================
|
||||
void MessageManager::doPlatformSpecificInitialisation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MessageManager::doPlatformSpecificShutdown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages)
|
||||
{
|
||||
// TODO
|
||||
|
||||
/*
|
||||
The idea here is that this will check the system message queue, pull off a
|
||||
message if there is one, deliver it, and return true if a message was delivered.
|
||||
If the queue's empty, return false.
|
||||
|
||||
If the message is one of our special ones (i.e. a Message object being delivered,
|
||||
this must call MessageManager::getInstance()->deliverMessage() to deliver it
|
||||
|
||||
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool juce_postMessageToSystemQueue (Message* message)
|
||||
{
|
||||
// TODO
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class AsyncFunctionCaller : public AsyncUpdater
|
||||
{
|
||||
public:
|
||||
static void* call (MessageCallbackFunction* func_, void* parameter_)
|
||||
{
|
||||
if (MessageManager::getInstance()->isThisTheMessageThread())
|
||||
return func_ (parameter_);
|
||||
|
||||
AsyncFunctionCaller caller (func_, parameter_);
|
||||
caller.triggerAsyncUpdate();
|
||||
caller.finished.wait();
|
||||
return caller.result;
|
||||
}
|
||||
|
||||
void handleAsyncUpdate()
|
||||
{
|
||||
result = (*func) (parameter);
|
||||
finished.signal();
|
||||
}
|
||||
|
||||
private:
|
||||
WaitableEvent finished;
|
||||
MessageCallbackFunction* func;
|
||||
void* parameter;
|
||||
void* volatile result;
|
||||
|
||||
AsyncFunctionCaller (MessageCallbackFunction* func_, void* parameter_)
|
||||
: result (0), func (func_), parameter (parameter_)
|
||||
{}
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (AsyncFunctionCaller);
|
||||
};
|
||||
|
||||
void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func, void* parameter)
|
||||
{
|
||||
return AsyncFunctionCaller::call (func, parameter);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void MessageManager::broadcastMessage (const String&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue