mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
implement Window.setLayout()
This commit is contained in:
parent
1fd2638c57
commit
5150564a5b
3 changed files with 22 additions and 2 deletions
|
@ -46,3 +46,10 @@ JNIEXPORT void JNICALL Java_android_view_Window_take_1input_1queue(JNIEnv *env,
|
|||
g_object_set_data(G_OBJECT(window), "input_queue_callback", (gpointer)_REF(callback));
|
||||
g_object_set_data(G_OBJECT(window), "input_queue", (gpointer)_REF(queue));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_android_view_Window_set_1layout(JNIEnv *env, jobject this, jlong window, jint width, jint height)
|
||||
{
|
||||
GtkWindow *gtk_window = GTK_WINDOW(_PTR(window));
|
||||
if (width > 0 && height > 0)
|
||||
gtk_window_set_default_size(gtk_window, width, height);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,14 @@ JNIEXPORT void JNICALL Java_android_view_Window_set_1title
|
|||
JNIEXPORT void JNICALL Java_android_view_Window_take_1input_1queue
|
||||
(JNIEnv *, jobject, jlong, jobject, jobject);
|
||||
|
||||
/*
|
||||
* Class: android_view_Window
|
||||
* Method: set_layout
|
||||
* Signature: (JII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_android_view_Window_set_1layout
|
||||
(JNIEnv *, jobject, jlong, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -66,6 +66,7 @@ public class Window {
|
|||
private native void set_title(long native_window, String title);
|
||||
|
||||
public native void take_input_queue(long native_window, InputQueue.Callback callback, InputQueue queue);
|
||||
public native void set_layout(long native_window, int width, int height);
|
||||
|
||||
public void takeInputQueue(InputQueue.Callback callback) {
|
||||
take_input_queue(native_window, callback, new InputQueue());
|
||||
|
@ -91,7 +92,9 @@ public class Window {
|
|||
decorView.setBackgroundDrawable(drawable);
|
||||
}
|
||||
|
||||
public void setAttributes(WindowManager.LayoutParams params) {}
|
||||
public void setAttributes(WindowManager.LayoutParams params) {
|
||||
set_layout(native_window, params.width, params.height);
|
||||
}
|
||||
|
||||
public void takeSurface(SurfaceHolder.Callback2 callback) {}
|
||||
|
||||
|
@ -101,7 +104,9 @@ public class Window {
|
|||
|
||||
public void setFormat(int format) {}
|
||||
|
||||
public void setLayout(int dummy, int dummy2) {}
|
||||
public void setLayout(int width, int height) {
|
||||
set_layout(native_window, width, height);
|
||||
}
|
||||
|
||||
public WindowManager getWindowManager() {
|
||||
return new WindowManagerImpl();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue