You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
start implementing Drawable using underlying GdkPaintable
This commit is contained in:
@@ -92,6 +92,8 @@ void wrapper_widget_allocate(GtkWidget *widget, int width, int height, int basel
|
||||
gtk_widget_size_allocate(wrapper->child, &allocation, baseline);
|
||||
if (wrapper->sk_area)
|
||||
gtk_widget_size_allocate(wrapper->sk_area, &allocation, baseline);
|
||||
if (wrapper->background)
|
||||
gtk_widget_size_allocate(wrapper->background, &allocation, baseline);
|
||||
}
|
||||
|
||||
static void wrapper_widget_class_init(WrapperWidgetClass *class)
|
||||
@@ -172,3 +174,12 @@ void wrapper_widget_set_layout_params(WrapperWidget *wrapper, int width, int hei
|
||||
wrapper->layout_width = width;
|
||||
wrapper->layout_height = height;
|
||||
}
|
||||
|
||||
void wrapper_widget_set_background(WrapperWidget *wrapper, GdkPaintable *paintable)
|
||||
{
|
||||
if (!wrapper->background) {
|
||||
wrapper->background = gtk_picture_new();
|
||||
gtk_widget_insert_after(wrapper->background, GTK_WIDGET(wrapper), NULL);
|
||||
}
|
||||
gtk_picture_set_paintable(GTK_PICTURE(wrapper->background), paintable);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ struct _WrapperWidget
|
||||
GtkWidget parent_instance;
|
||||
GtkWidget *child;
|
||||
GtkWidget *sk_area;
|
||||
GtkWidget *background;
|
||||
JavaVM *jvm;
|
||||
jobject jobj;
|
||||
jobject canvas;
|
||||
@@ -31,6 +32,7 @@ void wrapper_widget_set_child(WrapperWidget *parent, GtkWidget *child);
|
||||
void wrapper_widget_set_jobject(WrapperWidget *wrapper, JNIEnv *env, jobject jobj);
|
||||
void wrapper_widget_queue_draw(WrapperWidget *wrapper);
|
||||
void wrapper_widget_set_layout_params(WrapperWidget *wrapper, int width, int height);
|
||||
void wrapper_widget_set_background(WrapperWidget *wrapper, GdkPaintable *paintable);
|
||||
|
||||
void _setOnTouchListener(JNIEnv *env, jobject this, GtkWidget *widget, jobject on_touch_listener);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user