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
AndroidLayout: implement get_request_mode
Also add stubs in Matrix and Paint class
This commit is contained in:
@@ -64,10 +64,24 @@ static void android_layout_allocate(GtkLayoutManager *layout_manager, GtkWidget
|
||||
(*env)->ExceptionDescribe(env);
|
||||
}
|
||||
|
||||
static GtkSizeRequestMode android_layout_get_request_mode(GtkLayoutManager *layout_manager, GtkWidget *widget)
|
||||
{
|
||||
AndroidLayout *layout = ATL_ANDROID_LAYOUT(layout_manager);
|
||||
|
||||
if (layout->height == WRAP_CONTENT) {
|
||||
return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
|
||||
} else if (layout->width == WRAP_CONTENT) {
|
||||
return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT;
|
||||
} else {
|
||||
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
static void android_layout_class_init(AndroidLayoutClass *klass)
|
||||
{
|
||||
klass->parent_class.measure = android_layout_measure;
|
||||
klass->parent_class.allocate = android_layout_allocate;
|
||||
klass->parent_class.get_request_mode = android_layout_get_request_mode;
|
||||
}
|
||||
|
||||
static void android_layout_init(AndroidLayout *self) {}
|
||||
|
||||
@@ -324,7 +324,8 @@ public class Matrix {
|
||||
* M' = M * T(dx, dy)
|
||||
*/
|
||||
public boolean preTranslate(float dx, float dy) {
|
||||
return native_preTranslate(native_instance, dx, dy);
|
||||
// return native_preTranslate(native_instance, dx, dy);
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Preconcats the matrix with the specified scale.
|
||||
@@ -630,7 +631,8 @@ public class Matrix {
|
||||
if (dst == null || src == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return native_mapRect(native_instance, dst, src);
|
||||
// return native_mapRect(native_instance, dst, src);
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Apply this matrix to the rectangle, and write the transformed rectangle
|
||||
|
||||
@@ -163,6 +163,8 @@ public class Paint {
|
||||
|
||||
public Xfermode setXfermode(Xfermode xfermode) { return xfermode; }
|
||||
|
||||
public void setLetterSpacing(float spacing) {}
|
||||
|
||||
public enum Cap {
|
||||
/**
|
||||
* The stroke ends with the path, and does not project beyond it.
|
||||
|
||||
Reference in New Issue
Block a user