More TODO and documentation cleanup, including removing redundant or now-pointless TODOs.

This commit is contained in:
Pietro Gagliardi 2017-02-24 12:26:04 -05:00
parent 0df8346bff
commit 0db03e5f44
2 changed files with 9 additions and 11 deletions

View File

@ -15,3 +15,5 @@ https://www.w3.org/TR/REC-CSS2/notes.html
TODO indicate where in the attributes.c file that block of code should go (or drop it entirely for the reasons listed above)
TODO same for ui.h
TODO vertical carets

View File

@ -276,7 +276,6 @@ _UI_ENUM(uiDrawTextStretch) {
struct uiDrawFontDescriptor {
char *Family;
// TODO rename to PointSize?
double Size;
uiDrawTextWeight Weight;
uiDrawTextItalic Italic;
@ -301,9 +300,15 @@ struct uiDrawTextLayoutParams {
uiDrawTextLayoutAlign Align;
};
// Height will equal ParagraphSpacingBefore + LineHeightSpace + Ascent + Descent + Leading + LineSpacing + ParagraphSpacing.
// The above values are listed in vertical order, from top to bottom.
// Ascent + Descent + Leading will give you the typographic bounds
// of the text. BaselineY is the boundary between Ascent and Descent.
// X, Y, and BaselineY are all in the layout's coordinate system, so the
// start point of the baseline will be at (X, BaselineY). All values are
// nonnegative.
struct uiDrawTextLayoutLineMetrics {
// This describes the overall bounding box of the line.
// TODO figure out if X is correct regardless of both alignment and writing direction
double X;
double Y;
double Width;
@ -322,13 +327,6 @@ struct uiDrawTextLayoutLineMetrics {
double LineSpacing;
double ParagraphSpacing;
// Height should equal ParagraphSpacingBefore + LineHeightSpace + Ascent + Descent + Leading + LineSpacing + ParagraphSpacing.
// The above values are listed in vertical order, from top to bottom.
// Ascent + Descent + Leading will give you the typographic bounds of the text.
// BaselineY will be the boundary between Ascent and Descent.
// X, Y, and BaselineY are all in the layout's coordinate system, so the start point of the baseline will be at (X, BaselineY).
// All values will be nonnegative.
// TODO trailing whitespace?
};
@ -375,13 +373,11 @@ _UI_EXTERN void uiDrawTextLayoutHitTest(uiDrawTextLayout *tl, double x, double y
// TODO make sure this works right for right-aligned and center-aligned lines and justified lines and RTL text
_UI_EXTERN double uiDrawTextLayoutByteLocationInLine(uiDrawTextLayout *tl, size_t pos, int line);
// TODO vertical carets
_UI_EXTERN void uiDrawCaret(uiDrawContext *c, double x, double y, uiDrawTextLayout *layout, size_t pos, int *line);
// TODO allow blinking
typedef struct uiFontButton uiFontButton;
#define uiFontButton(this) ((uiFontButton *) (this))
// TODO document this returns a new font
_UI_EXTERN void uiFontButtonFont(uiFontButton *b, uiDrawFontDescriptor *desc);
// TOOD SetFont, mechanics
_UI_EXTERN void uiFontButtonOnChanged(uiFontButton *b, void (*f)(uiFontButton *, void *), void *data);