mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
TextEditor and Colour fixes.
This commit is contained in:
parent
3bacbe2a8c
commit
413e00631b
14 changed files with 683 additions and 249 deletions
|
|
@ -27,80 +27,6 @@
|
|||
// compiled on its own).
|
||||
#if JUCE_INCLUDED_FILE
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
extern JUCE_NAMESPACE::JUCEApplication* juce_CreateApplication(); // (from START_JUCE_APPLICATION)
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
//==============================================================================
|
||||
class AndroidJavaCallbacks
|
||||
{
|
||||
public:
|
||||
AndroidJavaCallbacks() : env (0)
|
||||
{
|
||||
}
|
||||
|
||||
void initialise (JNIEnv* env_, jobject activity)
|
||||
{
|
||||
env = env_;
|
||||
activityClass = (jclass) env->NewGlobalRef (env->GetObjectClass (activity));
|
||||
|
||||
printToConsole = env->GetStaticMethodID (activityClass, "printToConsole", "(Ljava/lang/String;)V");
|
||||
jassert (printToConsole != 0);
|
||||
}
|
||||
|
||||
void shutdown()
|
||||
{
|
||||
if (env != 0)
|
||||
{
|
||||
env->DeleteGlobalRef (activityClass);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
JNIEnv* env;
|
||||
|
||||
jclass activityClass;
|
||||
jmethodID printToConsole;
|
||||
};
|
||||
|
||||
static AndroidJavaCallbacks androidEnv;
|
||||
|
||||
//==============================================================================
|
||||
#define JUCE_JNI_CALLBACK(className, methodName, returnType, params) \
|
||||
extern "C" __attribute__ ((visibility("default"))) returnType Java_com_juce_launch_ ## className ## _ ## methodName params
|
||||
|
||||
//==============================================================================
|
||||
JUCE_JNI_CALLBACK (JuceAppActivity, launchApp, void, (JNIEnv* env, jobject activity))
|
||||
{
|
||||
androidEnv.initialise (env, activity);
|
||||
|
||||
JUCEApplication::createInstance = &juce_CreateApplication;
|
||||
|
||||
initialiseJuce_GUI();
|
||||
|
||||
if (! JUCEApplication::createInstance()->initialiseApp (String::empty))
|
||||
exit (0);
|
||||
}
|
||||
|
||||
JUCE_JNI_CALLBACK (JuceAppActivity, quitApp, void, (JNIEnv* env, jobject activity))
|
||||
{
|
||||
JUCEApplication::appWillTerminateByForce();
|
||||
|
||||
androidEnv.shutdown();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void PlatformUtilities::beep()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void Logger::outputDebugString (const String& text)
|
||||
{
|
||||
androidEnv.env->CallStaticVoidMethod (androidEnv.activityClass, androidEnv.printToConsole,
|
||||
androidEnv.env->NewStringUTF (text.toUTF8()));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue