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 49 of file flutter_main.cc.

References FML_CHECK, and flutter::g_flutter_main.

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

49  {
50  FML_CHECK(g_flutter_main) << "ensureInitializationComplete must have already "
51  "been called.";
52  return *g_flutter_main;
53 }
static std::unique_ptr< FlutterMain > g_flutter_main
Definition: flutter_main.cc:47
#define FML_CHECK(condition)
Definition: logging.h:68

◆ GetSettings()

◆ Register()

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

Definition at line 164 of file flutter_main.cc.

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

Referenced by JNI_OnLoad().

164  {
165  static const JNINativeMethod methods[] = {
166  {
167  .name = "nativeInit",
168  .signature = "(Landroid/content/Context;[Ljava/lang/String;Ljava/"
169  "lang/String;Ljava/lang/String;Ljava/lang/String;J)V",
170  .fnPtr = reinterpret_cast<void*>(&Init),
171  },
172  {
173  .name = "nativePrefetchDefaultFontManager",
174  .signature = "()V",
175  .fnPtr = reinterpret_cast<void*>(&PrefetchDefaultFontManager),
176  },
177  };
178 
179  jclass clazz = env->FindClass("io/flutter/embedding/engine/FlutterJNI");
180 
181  if (clazz == nullptr) {
182  return false;
183  }
184 
185  return env->RegisterNatives(clazz, methods, fml::size(methods)) == 0;
186 }
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: