[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / platform / android / activity / JNIXBMCMainView.h
blobc709b13f7ce4d7203d662fd53b103ac78265208d
1 /*
2 * Copyright (C) 2017 Christian Browet
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "threads/Event.h"
12 #include "utils/Geometry.h"
14 #include <androidjni/Context.h>
15 #include <androidjni/JNIBase.h>
16 #include <androidjni/Surface.h>
17 #include <androidjni/SurfaceHolder.h>
19 class CJNIXBMCMainView : virtual public CJNIBase, public CJNISurfaceHolderCallback, public CJNIInterfaceImplem<CJNIXBMCMainView>
21 public:
22 CJNIXBMCMainView(CJNISurfaceHolderCallback* callback);
23 ~CJNIXBMCMainView() override = default;
25 static void RegisterNatives(JNIEnv* env);
27 // CJNISurfaceHolderCallback interface
28 void surfaceChanged(CJNISurfaceHolder holder, int format, int width, int height) override;
29 void surfaceCreated(CJNISurfaceHolder holder) override;
30 void surfaceDestroyed(CJNISurfaceHolder holder) override;
32 void attach(const jobject& thiz);
33 bool waitForSurface(unsigned int millis);
34 bool isActive() { return m_surfaceCreated.Signaled(); }
35 CJNISurface getSurface();
36 bool isCreated() const;
38 protected:
39 static CJNIXBMCMainView* m_instance;
40 CJNISurfaceHolderCallback* m_callback;
41 static CEvent m_surfaceCreated;
43 static void _attach(JNIEnv* env, jobject thiz);
44 static void _surfaceChanged(JNIEnv* env, jobject thiz, jobject holder, jint format, jint width, jint height);
45 static void _surfaceCreated(JNIEnv* env, jobject thiz, jobject holder);
46 static void _surfaceDestroyed(JNIEnv* env, jobject thiz, jobject holder);