Flutter Engine
flutter::FlutterMain Class Reference

#include <flutter_main.h>

Public Member Functions

 ~FlutterMain ()
 
const flutter::SettingsGetSettings () const
 

Static Public Member Functions

static bool Register (JNIEnv *env)
 
static FlutterMainGet ()
 

Detailed Description

Definition at line 16 of file flutter_main.h.

Constructor & Destructor Documentation

◆ ~FlutterMain()

flutter::FlutterMain::~FlutterMain ( )
default

Member Function Documentation

◆ Get()

FlutterMain & flutter::FlutterMain::Get ( )
static

Definition at line 68 of file flutter_main.cc.

References FML_CHECK, and flutter::g_flutter_main.

Referenced by flutter::AttachJNI(), and flutter::GetIsSoftwareRendering().

68  {
69  FML_CHECK(g_flutter_main) << "ensureInitializationComplete must have already "
70  "been called.";
71  return *g_flutter_main;
72 }
static std::unique_ptr< FlutterMain > g_flutter_main
Definition: flutter_main.cc:66
#define FML_CHECK(condition)
Definition: logging.h:68

◆ GetSettings()

◆ Register()

bool flutter::FlutterMain::Register ( JNIEnv *  env)
static

Definition at line 202 of file flutter_main.cc.

References flutter::PrefetchDefaultFontManager(), and fml::size().

Referenced by JNI_OnLoad().

202  {
203  static const JNINativeMethod methods[] = {
204  {
205  .name = "nativeInit",
206  .signature = "(Landroid/content/Context;[Ljava/lang/String;Ljava/"
207  "lang/String;Ljava/lang/String;Ljava/lang/String;J)V",
208  .fnPtr = reinterpret_cast<void*>(&Init),
209  },
210  {
211  .name = "nativePrefetchDefaultFontManager",
212  .signature = "()V",
213  .fnPtr = reinterpret_cast<void*>(&PrefetchDefaultFontManager),
214  },
215  };
216 
217  jclass clazz = env->FindClass("io/flutter/embedding/engine/FlutterJNI");
218 
219  if (clazz == nullptr) {
220  return false;
221  }
222 
223  return env->RegisterNatives(clazz, methods, fml::size(methods)) == 0;
224 }
static void PrefetchDefaultFontManager(JNIEnv *env, jclass jcaller)
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

The documentation for this class was generated from the following files: