Some TODO resolution via documentation writing.

This commit is contained in:
Pietro Gagliardi 2017-06-08 00:59:17 -04:00
parent 39a8d1a07e
commit 20239df6f2
1 changed files with 41 additions and 11 deletions

View File

@ -19,23 +19,50 @@
// layout-specific properties. // layout-specific properties.
typedef struct uiAttributedString uiAttributedString; typedef struct uiAttributedString uiAttributedString;
// TODO just make a separate field for everything? // TODO just make a separate field in uiAttributeSpec for everything? or make attribute objects opaque instead?
_UI_ENUM(uiAttribute) { _UI_ENUM(uiAttribute) {
uiAttributeFamily, // use Family // uiAttributeFamily changes the font family of the text it is
uiAttributeSize, // use Double // applied to. Use the Family field of uiAttributeSpec.
// TODO case-sensitive?
uiAttributeFamily,
// uiAttributeSize changes the size of the text it is applied to,
// in typographical points. Use the Double field of
// uiAttributeSpec.
uiAttributeSize,
// uiAttributeWeight changes the weight of the text it is applied
// to. Use the Value field of uiAttributeSpec and the
// uiDrawTextWeight constants.
uiAttributeWeight, uiAttributeWeight,
// uiAttributeItalic changes the italicness of the text it is applied
// to. Use the Value field of uiAttributeSpec and the
// uiDrawTextItalic constants.
uiAttributeItalic, uiAttributeItalic,
// uiAttributeStretch changes the stretch of the text it is applied
// to. Use the Value field of uiAttributeSpec and the
// uiDrawTextStretch constants.
uiAttributeStretch, uiAttributeStretch,
uiAttributeColor, // use R, G, B, A // uiAttributeColor changes the color of the text it is applied to.
uiAttributeBackground, // use R, G, B, A // Use the R, G, B, and A fields of uiAttributeSpec.
uiAttributeColor,
// uiAttributeBackground changes the color of the text it is
// applied to. Use the R, G, B, and A fields of uiAttributeSpec.
uiAttributeBackground,
uiAttributeUnderline, // enum uiDrawUnderlineStyle // uiAttributeUnderline changes the underline style of the text
// TODO document that the color in the case we don't specify it is the text color // it is applied to. Use the Value field of uiAttributeSpec and the
uiAttributeUnderlineColor, // enum uiDrawUnderlineColor // uiDrawUnderlineStyle constants.
uiAttributeUnderline,
// uiAttributeUnderlineColor changes the color of any underline
// on the text it is applied to, regardless of the style. Use the
// Value field of uiAttributeSpec and the uiDrawUnderlineColor
// constants (refer to its documentation for more information).
//
// If an underline style is applied but no underline color is
// specified, the text color is used instead.
uiAttributeUnderlineColor,
// TODO note these are copied // uiAttributeFeatures changes the OpenType features of the
// TODO add a function to uiAttributedString to get an attribute's value at a specific index or in a specific range, so we can edit // text it is applied to. Use the Features field of uiAttributeSpec.
// (TODO related to above: what about memory?)
uiAttributeFeatures, // use Features uiAttributeFeatures, // use Features
}; };
@ -70,6 +97,9 @@ _UI_EXTERN int uiOpenTypeFeaturesEqual(const uiOpenTypeFeatures *a, const uiOpen
typedef struct uiAttributeSpec uiAttributeSpec; typedef struct uiAttributeSpec uiAttributeSpec;
// TODO note that pointers are copied
// TODO add a function to uiAttributedString to get an attribute's value at a specific index or in a specific range, so we can edit
// (TODO related to above: what about memory consumption during a read-modify-write cycle due to copying?)
struct uiAttributeSpec { struct uiAttributeSpec {
uiAttribute Type; uiAttribute Type;
const char *Family; const char *Family;