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
src/api-impl: fix up code style, mainly for code imported from AOSP
used the following (plus manual edits):
`clang-format --style="{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0}`
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -35,12 +35,12 @@ public class Paint {
|
||||
* Geometry and text drawn with this style will be filled, ignoring all
|
||||
* stroke-related settings in the paint.
|
||||
*/
|
||||
FILL (0),
|
||||
FILL(0),
|
||||
/**
|
||||
* Geometry and text drawn with this style will be stroked, respecting
|
||||
* the stroke-related fields on the paint.
|
||||
*/
|
||||
STROKE (1),
|
||||
STROKE(1),
|
||||
/**
|
||||
* Geometry and text drawn with this style will be both filled and
|
||||
* stroked at the same time, respecting the stroke-related fields on
|
||||
@@ -48,8 +48,8 @@ public class Paint {
|
||||
* is oriented counter-clockwise. This restriction does not apply to
|
||||
* either FILL or STROKE.
|
||||
*/
|
||||
FILL_AND_STROKE (2);
|
||||
|
||||
FILL_AND_STROKE(2);
|
||||
|
||||
Style(int nativeInt) {
|
||||
this.nativeInt = nativeInt;
|
||||
}
|
||||
@@ -58,46 +58,47 @@ public class Paint {
|
||||
|
||||
public static class FontMetrics {
|
||||
/**
|
||||
* The maximum distance above the baseline for the tallest glyph in
|
||||
* The maximum distance above the baseline for the tallest glyph in
|
||||
* the font at a given text size.
|
||||
*/
|
||||
public float top;
|
||||
public float top;
|
||||
/**
|
||||
* The recommended distance above the baseline for singled spaced text.
|
||||
*/
|
||||
public float ascent;
|
||||
public float ascent;
|
||||
/**
|
||||
* The recommended distance below the baseline for singled spaced text.
|
||||
*/
|
||||
public float descent;
|
||||
public float descent;
|
||||
/**
|
||||
* The maximum distance below the baseline for the lowest glyph in
|
||||
* The maximum distance below the baseline for the lowest glyph in
|
||||
* the font at a given text size.
|
||||
*/
|
||||
public float bottom;
|
||||
public float bottom;
|
||||
/**
|
||||
* The recommended additional space to add between lines of text.
|
||||
*/
|
||||
public float leading;
|
||||
public float leading;
|
||||
}
|
||||
|
||||
public static class FontMetricsInt {
|
||||
public int top;
|
||||
public int ascent;
|
||||
public int descent;
|
||||
public int bottom;
|
||||
public int leading;
|
||||
public int top;
|
||||
public int ascent;
|
||||
public int descent;
|
||||
public int bottom;
|
||||
public int leading;
|
||||
|
||||
@Override public String toString() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FontMetricsInt: top=" + top + " ascent=" + ascent +
|
||||
" descent=" + descent + " bottom=" + bottom +
|
||||
" leading=" + leading;
|
||||
" descent=" + descent + " bottom=" + bottom +
|
||||
" leading=" + leading;
|
||||
}
|
||||
}
|
||||
|
||||
public /*native*/ int getFlags() {return 0;}
|
||||
public /*native*/ int getFlags() { return 0; }
|
||||
|
||||
public /*native*/ int getHinting() {return 0;}
|
||||
public /*native*/ int getHinting() { return 0; }
|
||||
public /*native*/ void setHinting(int mode) {}
|
||||
|
||||
public /*native*/ void setDither(boolean dither) {}
|
||||
@@ -107,43 +108,42 @@ public class Paint {
|
||||
public /*native*/ void setStrikeThruText(boolean strikeThruText) {}
|
||||
public /*native*/ void setFakeBoldText(boolean fakeBoldText) {}
|
||||
|
||||
public /*native*/ int getAlpha() {return 0;}
|
||||
public /*native*/ int getAlpha() { return 0; }
|
||||
public /*native*/ void setAlpha(int a) {}
|
||||
public /*native*/ float getStrokeWidth() {return 0;}
|
||||
public /*native*/ float getStrokeWidth() { return 0; }
|
||||
|
||||
public /*native*/ float getStrokeMiter() {return 0;}
|
||||
public /*native*/ float getStrokeMiter() { return 0; }
|
||||
public /*native*/ void setStrokeMiter(float miter) {}
|
||||
public /*native*/ float getTextSize() {return 0;}
|
||||
public /*native*/ float getTextSize() { return 0; }
|
||||
|
||||
public /*native*/ float getTextScaleX() {return 0;}
|
||||
public /*native*/ float getTextScaleX() { return 0; }
|
||||
public /*native*/ void setTextScaleX(float scaleX) {}
|
||||
public /*native*/ float getTextSkewX() {return 0;}
|
||||
public /*native*/ float getTextSkewX() { return 0; }
|
||||
public /*native*/ void setTextSkewX(float skewX) {}
|
||||
|
||||
public /*native*/ float descent() {return 0;}
|
||||
public /*native*/ float getFontMetrics(FontMetrics metrics) {return 0;}
|
||||
public /*native*/ int getFontMetricsInt(FontMetricsInt fmi) {return 0;}
|
||||
public /*native*/ float descent() { return 0; }
|
||||
public /*native*/ float getFontMetrics(FontMetrics metrics) { return 0; }
|
||||
public /*native*/ int getFontMetricsInt(FontMetricsInt fmi) { return 0; }
|
||||
|
||||
public void setShadowLayer(float radius, float dx, float dy, int color) {}
|
||||
|
||||
public Xfermode setXfermode(Xfermode xfermode) {return xfermode;}
|
||||
public Xfermode setXfermode(Xfermode xfermode) { return xfermode; }
|
||||
|
||||
public enum Cap {
|
||||
/**
|
||||
* The stroke ends with the path, and does not project beyond it.
|
||||
*/
|
||||
BUTT (0),
|
||||
BUTT(0),
|
||||
/**
|
||||
* The stroke projects out as a semicircle, with the center at the
|
||||
* end of the path.
|
||||
*/
|
||||
ROUND (1),
|
||||
ROUND(1),
|
||||
/**
|
||||
* The stroke projects out as a square, with the center at the end
|
||||
* of the path.
|
||||
*/
|
||||
SQUARE (2);
|
||||
|
||||
SQUARE(2);
|
||||
|
||||
private Cap(int nativeInt) {}
|
||||
}
|
||||
@@ -152,20 +152,20 @@ public class Paint {
|
||||
/**
|
||||
* The outer edges of a join meet at a sharp angle
|
||||
*/
|
||||
MITER (0),
|
||||
MITER(0),
|
||||
/**
|
||||
* The outer edges of a join meet in a circular arc.
|
||||
*/
|
||||
ROUND (1),
|
||||
ROUND(1),
|
||||
/**
|
||||
* The outer edges of a join meet with a straight line
|
||||
*/
|
||||
BEVEL (2);
|
||||
BEVEL(2);
|
||||
|
||||
private Join(int nativeInt) {}
|
||||
}
|
||||
|
||||
public void setStrokeCap(Cap cap) {}
|
||||
public void setStrokeCap(Cap cap) {}
|
||||
|
||||
public void setStrokeJoin(Join join) {}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,46 +18,80 @@ package android.graphics;
|
||||
|
||||
public class PorterDuff {
|
||||
|
||||
// these value must match their native equivalents. See SkPorterDuff.h
|
||||
public enum Mode {
|
||||
/** [0, 0] */
|
||||
CLEAR (0),
|
||||
/** [Sa, Sc] */
|
||||
SRC (1),
|
||||
/** [Da, Dc] */
|
||||
DST (2),
|
||||
/** [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] */
|
||||
SRC_OVER (3),
|
||||
/** [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc] */
|
||||
DST_OVER (4),
|
||||
/** [Sa * Da, Sc * Da] */
|
||||
SRC_IN (5),
|
||||
/** [Sa * Da, Sa * Dc] */
|
||||
DST_IN (6),
|
||||
/** [Sa * (1 - Da), Sc * (1 - Da)] */
|
||||
SRC_OUT (7),
|
||||
/** [Da * (1 - Sa), Dc * (1 - Sa)] */
|
||||
DST_OUT (8),
|
||||
/** [Da, Sc * Da + (1 - Sa) * Dc] */
|
||||
SRC_ATOP (9),
|
||||
/** [Sa, Sa * Dc + Sc * (1 - Da)] */
|
||||
DST_ATOP (10),
|
||||
/** [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc] */
|
||||
XOR (11),
|
||||
/** [Sa + Da - Sa*Da,
|
||||
Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)] */
|
||||
DARKEN (12),
|
||||
/** [Sa + Da - Sa*Da,
|
||||
Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] */
|
||||
LIGHTEN (13),
|
||||
/** [Sa * Da, Sc * Dc] */
|
||||
MULTIPLY (14),
|
||||
/** [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] */
|
||||
SCREEN (15),
|
||||
/** Saturate(S + D) */
|
||||
ADD (16),
|
||||
OVERLAY (17);
|
||||
// these value must match their native equivalents. See SkPorterDuff.h
|
||||
public enum Mode {
|
||||
/**
|
||||
* [0, 0]
|
||||
*/
|
||||
CLEAR(0),
|
||||
/**
|
||||
* [Sa, Sc]
|
||||
*/
|
||||
SRC(1),
|
||||
/**
|
||||
* [Da, Dc]
|
||||
*/
|
||||
DST(2),
|
||||
/**
|
||||
* [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc]
|
||||
*/
|
||||
SRC_OVER(3),
|
||||
/**
|
||||
* [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc]
|
||||
*/
|
||||
DST_OVER(4),
|
||||
/**
|
||||
* [Sa * Da, Sc * Da]
|
||||
*/
|
||||
SRC_IN(5),
|
||||
/**
|
||||
* [Sa * Da, Sa * Dc]
|
||||
*/
|
||||
DST_IN(6),
|
||||
/**
|
||||
* [Sa * (1 - Da), Sc * (1 - Da)]
|
||||
*/
|
||||
SRC_OUT(7),
|
||||
/**
|
||||
* [Da * (1 - Sa), Dc * (1 - Sa)]
|
||||
*/
|
||||
DST_OUT(8),
|
||||
/**
|
||||
* [Da, Sc * Da + (1 - Sa) * Dc]
|
||||
*/
|
||||
SRC_ATOP(9),
|
||||
/**
|
||||
* [Sa, Sa * Dc + Sc * (1 - Da)]
|
||||
*/
|
||||
DST_ATOP(10),
|
||||
/**
|
||||
* [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc]
|
||||
*/
|
||||
XOR(11),
|
||||
/**
|
||||
[Sa + Da - Sa*Da,
|
||||
Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)]
|
||||
*/
|
||||
DARKEN(12),
|
||||
/**
|
||||
[Sa + Da - Sa*Da,
|
||||
Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)]
|
||||
*/
|
||||
LIGHTEN(13),
|
||||
/**
|
||||
* [Sa * Da, Sc * Dc]
|
||||
*/
|
||||
MULTIPLY(14),
|
||||
/**
|
||||
* [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc]
|
||||
*/
|
||||
SCREEN(15),
|
||||
/**
|
||||
* Saturate(S + D)
|
||||
*/
|
||||
ADD(16),
|
||||
OVERLAY(17);
|
||||
|
||||
Mode(int nativeInt) {}
|
||||
}
|
||||
Mode(int nativeInt) {}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -4,26 +4,34 @@ import android.content.res.AssetManager;
|
||||
|
||||
public class Typeface {
|
||||
|
||||
/** The default NORMAL typeface object */
|
||||
public static final Typeface DEFAULT = new Typeface();
|
||||
/**
|
||||
* The default BOLD typeface object. Note: this may be not actually be
|
||||
* bold, depending on what fonts are installed. Call getStyle() to know
|
||||
* for sure.
|
||||
*/
|
||||
public static final Typeface DEFAULT_BOLD = new Typeface();
|
||||
/** The NORMAL style of the default sans serif typeface. */
|
||||
public static final Typeface SANS_SERIF = new Typeface();
|
||||
/** The NORMAL style of the default serif typeface. */
|
||||
public static final Typeface SERIF = new Typeface();
|
||||
/** The NORMAL style of the default monospace typeface. */
|
||||
public static final Typeface MONOSPACE = new Typeface();
|
||||
/**
|
||||
* The default NORMAL typeface object
|
||||
*/
|
||||
public static final Typeface DEFAULT = new Typeface();
|
||||
/**
|
||||
* The default BOLD typeface object. Note: this may be not actually be
|
||||
* bold, depending on what fonts are installed. Call getStyle() to know
|
||||
* for sure.
|
||||
*/
|
||||
public static final Typeface DEFAULT_BOLD = new Typeface();
|
||||
/**
|
||||
* The NORMAL style of the default sans serif typeface.
|
||||
*/
|
||||
public static final Typeface SANS_SERIF = new Typeface();
|
||||
/**
|
||||
* The NORMAL style of the default serif typeface.
|
||||
*/
|
||||
public static final Typeface SERIF = new Typeface();
|
||||
/**
|
||||
* The NORMAL style of the default monospace typeface.
|
||||
*/
|
||||
public static final Typeface MONOSPACE = new Typeface();
|
||||
|
||||
// Style
|
||||
public static final int NORMAL = 0;
|
||||
public static final int BOLD = 1;
|
||||
public static final int ITALIC = 2;
|
||||
public static final int BOLD_ITALIC = 3;
|
||||
// Style
|
||||
public static final int NORMAL = 0;
|
||||
public static final int BOLD = 1;
|
||||
public static final int ITALIC = 2;
|
||||
public static final int BOLD_ITALIC = 3;
|
||||
|
||||
public static Typeface createFromAsset(AssetManager mgr, String path) {
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package android.graphics;
|
||||
|
||||
public class Xfermode {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user