refactor source tree organization, switch to meson

This commit is contained in:
Mis012
2022-10-02 23:06:56 +02:00
parent 2f785e2a59
commit 449090143e
296 changed files with 171615 additions and 69 deletions

View File

@@ -0,0 +1,10 @@
package android.widget;
import android.view.View;
import android.content.Context;
public class EditText extends TextView {
public EditText(Context context){
super(context);
}
}

View File

@@ -0,0 +1,49 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.view.ViewGroup;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
public class FrameLayout extends ViewGroup {
public FrameLayout(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public FrameLayout(Context context) {
super(context);
native_constructor(context);
}
public native void native_constructor(AttributeSet attrs);
public native void native_constructor(Context context);
@Override
public native void addView(View child, int index, ViewGroup.LayoutParams params);
public void addView(View child, int index) {
addView(child, index, null);
}
public static class LayoutParams extends ViewGroup.LayoutParams {
public LayoutParams(int width, int height) {
super(width, height);
}
public LayoutParams(int width, int height, float weight) {
super(width, height, weight);
}
public LayoutParams(int width, int height, int gravity) {
this.width = width;
this.height = height;
this.gravity = gravity;
}
}
}

View File

@@ -0,0 +1,87 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.view.View;
public class ImageView extends View {
public ImageView(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public ImageView(Context context) {
super(context);
native_constructor(context);
}
private native void native_constructor(AttributeSet attrs);
private native void native_constructor(Context context);
public /*native*/ void setImageResource(final int resid) {}
public void setAdjustViewBounds(boolean adjustViewBounds) {}
public void setScaleType(ScaleType scaleType) {}
/**
* Options for scaling the bounds of an image to the bounds of this view.
*/
public enum ScaleType {
/**
* Scale using the image matrix when drawing. The image matrix can be set using
* {@link ImageView#setImageMatrix(Matrix)}. From XML, use this syntax:
* <code>android:scaleType="matrix"</code>.
*/
MATRIX (0),
/**
* Scale the image using {@link Matrix.ScaleToFit#FILL}.
* From XML, use this syntax: <code>android:scaleType="fitXY"</code>.
*/
FIT_XY (1),
/**
* Scale the image using {@link Matrix.ScaleToFit#START}.
* From XML, use this syntax: <code>android:scaleType="fitStart"</code>.
*/
FIT_START (2),
/**
* Scale the image using {@link Matrix.ScaleToFit#CENTER}.
* From XML, use this syntax:
* <code>android:scaleType="fitCenter"</code>.
*/
FIT_CENTER (3),
/**
* Scale the image using {@link Matrix.ScaleToFit#END}.
* From XML, use this syntax: <code>android:scaleType="fitEnd"</code>.
*/
FIT_END (4),
/**
* Center the image in the view, but perform no scaling.
* From XML, use this syntax: <code>android:scaleType="center"</code>.
*/
CENTER (5),
/**
* Scale the image uniformly (maintain the image's aspect ratio) so
* that both dimensions (width and height) of the image will be equal
* to or larger than the corresponding dimension of the view
* (minus padding). The image is then centered in the view.
* From XML, use this syntax: <code>android:scaleType="centerCrop"</code>.
*/
CENTER_CROP (6),
/**
* Scale the image uniformly (maintain the image's aspect ratio) so
* that both dimensions (width and height) of the image will be equal
* to or less than the corresponding dimension of the view
* (minus padding). The image is then centered in the view.
* From XML, use this syntax: <code>android:scaleType="centerInside"</code>.
*/
CENTER_INSIDE (7);
ScaleType(int ni) {
nativeInt = ni;
}
final int nativeInt;
}
}

View File

@@ -0,0 +1,48 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.view.ViewGroup;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
public class LinearLayout extends ViewGroup {
boolean orientation;
public LinearLayout(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public LinearLayout(Context context) {
super(context);
native_constructor(context);
}
private native void native_constructor(AttributeSet attrs);
private native void native_constructor(Context context);
@Override
public native void addView(View child, int index, ViewGroup.LayoutParams params);
@Override
public native void removeView(View view);
@Override
public native void removeAllViews();
public native void setOrientation(int orientation);
public void setWeightSum(float weightSum) {}
public static class LayoutParams extends ViewGroup.LayoutParams {
public LayoutParams(int width, int height) {
super(width, height);
}
public LayoutParams(int width, int height, float weight) {
super(width, height, weight);
}
}
}

View File

@@ -0,0 +1,6 @@
package android.widget;
public class MediaController {
public interface MediaPlayerControl {
}
}

View File

@@ -0,0 +1,25 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.view.View;
public class ProgressBar extends View {
public ProgressBar(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public ProgressBar(Context context) {
super(context);
// native_constructor(context);
}
private native void native_constructor(AttributeSet attrs);
private native void native_constructor(Context context);
public synchronized void setIndeterminate(boolean indeterminate) {}
}

View File

@@ -0,0 +1,44 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.view.ViewGroup;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
public class RelativeLayout extends ViewGroup {
boolean orientation;
public RelativeLayout(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public RelativeLayout(Context context) {
super(context);
native_constructor(context);
}
private native void native_constructor(AttributeSet attrs);
private native void native_constructor(Context context);
@Override
public native void addView(View child, int index, ViewGroup.LayoutParams params);
public static class LayoutParams extends ViewGroup.LayoutParams {
public LayoutParams(int width, int height) {
super(width, height);
}
public LayoutParams(int width, int height, float weight) {
super(width, height, weight);
}
public void addRule(int verb) {}
public void addRule(int verb, int anchor) {}
}
}

View File

@@ -0,0 +1,35 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.view.ViewGroup;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
public class ScrollView extends ViewGroup {
public ScrollView(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public ScrollView(Context context) {
super(context);
native_constructor(context);
}
private native void native_constructor(AttributeSet attrs);
private native void native_constructor(Context context);
@Override
public native void addView(View child, int index, LayoutParams params);
@Override
public native void removeView(View view);
@Override
public native void removeAllViews();
protected void onScrollChanged(int x, int y, int oldx, int oldy) {}
public void setFillViewport(boolean fillViewport) {}
}

View File

@@ -0,0 +1,79 @@
package android.widget;
import android.util.AttributeSet;
import android.content.Context;
import android.graphics.Typeface;
import android.content.res.ColorStateList;
import android.text.TextPaint;
import android.content.res.TypedArray;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.view.View;
public class TextView extends View {
public String text;
public TextView(int _id) { // FIXME
id = _id;
}
public TextView(AttributeSet attrs) {
super(attrs);
native_constructor(attrs);
}
public TextView(Context context) {
super(context);
native_constructor(context);
}
native void native_constructor(AttributeSet attrs);
native void native_constructor(Context context);
public final void setText(CharSequence text) {
if(text == null) {
native_setText("NULL");
return;
}
native_setText(text.toString());
if(text instanceof android.text.Spanned)
native_set_markup(1);
}
private native final void native_set_markup(int bool);
public native final void native_setText(String text);
public native void setTextSize(float size);
public void setTextColor(int color) {}
public void setTextColor(ColorStateList colors) {}
public void setTextSize(int unit, float size) {}
public void setTypeface(Typeface tf, int style) {}
public void setTypeface(Typeface tf) {}
public void setLineSpacing(float add, float mult) {}
public final void setLinksClickable(boolean whether) {}
public void setInputType(int type) {}
public void setFilters(InputFilter[] filters) {}
public void setCursorVisible(boolean visible) {}
public void setImeOptions(int imeOptions) {}
public final ColorStateList getTextColors() { return new ColorStateList(new int[][] { new int[0] }, new int[1]); }
public static ColorStateList getTextColors(Context context, TypedArray attrs) { return new ColorStateList(new int[][] { new int[0] }, new int[1]); }
public TextPaint getPaint() {
return new TextPaint();
}
public void addTextChangedListener(TextWatcher watcher) {}
public void setOnEditorActionListener (TextView.OnEditorActionListener l) {}
public static interface OnEditorActionListener {
}
}