libui-ng
A portable GUI library for C
ui.h
Go to the documentation of this file.
1// 6 april 2015
2
3// TODO add a uiVerifyControlType() function that can be used by control implementations to verify controls
4
5// TODOs
6// - make getters that return whether something exists accept a NULL pointer to discard the value (and thus only return that the thing exists?)
7// - const-correct everything
8// - normalize documentation between typedefs and structs
9
20#ifndef __LIBUI_UI_H__
21#define __LIBUI_UI_H__
22
23#include <stddef.h>
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30// this macro is defined by the build system
31#ifdef libui_EXPORTS
32#ifdef _WIN32
33#define _UI_EXTERN __declspec(dllexport) extern
34#else
35#define _UI_EXTERN __attribute__((visibility("default"))) extern
36#endif
37#else
38// TODO add __declspec(dllimport) on windows, but only if not static
39#define _UI_EXTERN extern
40#endif
41
42// C++ is really really really really really really dumb about enums, so screw that and just make them anonymous
43// This has the advantage of being ABI-able should we ever need an ABI...
44#define _UI_ENUM(s) typedef unsigned int s; enum
45
46// This constant is provided because M_PI is nonstandard.
47// This comes from Go's math.Pi, which in turn comes from http://oeis.org/A000796.
48#define uiPi 3.14159265358979323846264338327950288419716939937510582097494459
49
50// TODO uiBool?
51
52// uiForEach represents the return value from one of libui's various ForEach functions.
56};
57
59
61 size_t Size;
62};
63
64_UI_EXTERN const char *uiInit(uiInitOptions *options);
66_UI_EXTERN void uiFreeInitError(const char *err);
67
68_UI_EXTERN void uiMain(void);
70_UI_EXTERN int uiMainStep(int wait);
71_UI_EXTERN void uiQuit(void);
72
73_UI_EXTERN void uiQueueMain(void (*f)(void *data), void *data);
74
75// uiTimer() must be called on the main UI thread after uiInit() and before uiUninit().
76// milliseconds must be greater than 0, and f must not be NULL.
77// Timer callbacks run on the main UI thread. Return 0 from f to stop the timer;
78// return non-zero to keep it running. uiUninit() cancels any active timers.
79// Timer timing, including granularity and the first tick, is OS-defined.
80// uiQueueMain() may be called from other threads. To quit from another thread,
81// queue uiQuit() with uiQueueMain() instead of calling uiQuit() directly.
82_UI_EXTERN void uiTimer(int milliseconds, int (*f)(void *data), void *data);
83
84_UI_EXTERN void uiOnShouldQuit(int (*f)(void *data), void *data);
85
86
96_UI_EXTERN void uiFreeText(char *text);
97
98
104typedef struct uiControl uiControl;
105struct uiControl {
106 uint32_t Signature;
107 uint32_t OSSignature;
109 void (*Destroy)(uiControl *);
110 uintptr_t (*Handle)(uiControl *);
111 uiControl *(*Parent)(uiControl *);
115 void (*Show)(uiControl *);
116 void (*Hide)(uiControl *);
118 void (*Enable)(uiControl *);
119 void (*Disable)(uiControl *);
120};
121// TOOD add argument names to all arguments
122#define uiControl(this) ((uiControl *) (this))
123
136
145
154
164
173
182
190
199
210
218
226
236_UI_EXTERN uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr);
237
247
258
271
272// TODO Move this to private API? According to old/new.md this should be used by toplevel controls.
274
275
291typedef struct uiWindow uiWindow;
292#define uiWindow(this) ((uiWindow *) (this))
293
304
315_UI_EXTERN void uiWindowSetTitle(uiWindow *w, const char *title);
316
328_UI_EXTERN void uiWindowPosition(uiWindow *w, int *x, int *y);
329
342
357 void (*f)(uiWindow *sender, void *senderData), void *data);
358
368_UI_EXTERN void uiWindowContentSize(uiWindow *w, int *width, int *height);
369
380_UI_EXTERN void uiWindowSetContentSize(uiWindow *w, int width, int height);
381
390
400
415 void (*f)(uiWindow *sender, void *senderData), void *data);
416
433 int (*f)(uiWindow *sender, void *senderData), void *data);
434
448 void (*f)(uiWindow *sender, void *senderData), void *data);
449
458
467
477
486
495
506
515
525
538_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar);
539
540
548typedef struct uiButton uiButton;
549#define uiButton(this) ((uiButton *) (this))
550
561
571_UI_EXTERN void uiButtonSetText(uiButton *b, const char *text);
572
586 void (*f)(uiButton *sender, void *senderData), void *data);
587
597_UI_EXTERN uiButton *uiNewButton(const char *text);
598
599
610typedef struct uiBox uiBox;
611#define uiBox(this) ((uiBox *) (this))
612
624_UI_EXTERN void uiBoxAppend(uiBox *b, uiControl *child, int stretchy);
625
634
643_UI_EXTERN void uiBoxDelete(uiBox *b, int index);
644
655
666_UI_EXTERN void uiBoxSetPadded(uiBox *b, int padded);
667
677
687
688
696typedef struct uiCheckbox uiCheckbox;
697#define uiCheckbox(this) ((uiCheckbox *) (this))
698
709
719_UI_EXTERN void uiCheckboxSetText(uiCheckbox *c, const char *text);
720
735 void (*f)(uiCheckbox *sender, void *senderData), void *data);
736
745
754
765
766
774typedef struct uiEntry uiEntry;
775#define uiEntry(this) ((uiEntry *) (this))
776
787
797_UI_EXTERN void uiEntrySetText(uiEntry *e, const char *text);
798
812 void (*f)(uiEntry *sender, void *senderData), void *data);
813
822
830_UI_EXTERN void uiEntrySetReadOnly(uiEntry *e, int readonly);
831
839
849
860
861
869typedef struct uiLabel uiLabel;
870#define uiLabel(this) ((uiLabel *) (this))
871
882
892_UI_EXTERN void uiLabelSetText(uiLabel *l, const char *text);
893
903_UI_EXTERN uiLabel *uiNewLabel(const char *text);
904
905
916typedef struct uiTab uiTab;
917#define uiTab(this) ((uiTab *) (this))
918
927
938
953 void (*f)(uiTab *sender, void *senderData), void *data);
954
965_UI_EXTERN void uiTabAppend(uiTab *t, const char *name, uiControl *c);
966
978_UI_EXTERN void uiTabInsertAt(uiTab *t, const char *name, int index, uiControl *c);
979
988_UI_EXTERN void uiTabDelete(uiTab *t, int index);
989
998
1007_UI_EXTERN int uiTabMargined(uiTab *t, int index);
1008
1019_UI_EXTERN void uiTabSetMargined(uiTab *t, int index, int margined);
1020
1028
1029
1043typedef struct uiGroup uiGroup;
1044#define uiGroup(this) ((uiGroup *) (this))
1045
1056
1066_UI_EXTERN void uiGroupSetTitle(uiGroup *g, const char *title);
1067
1076
1085
1096
1106_UI_EXTERN uiGroup *uiNewGroup(const char *title);
1107
1108
1124typedef struct uiSpinbox uiSpinbox;
1125#define uiSpinbox(this) ((uiSpinbox *) (this))
1126
1135
1145
1160 void (*f)(uiSpinbox *sender, void *senderData), void *data);
1161
1177
1178
1193typedef struct uiSlider uiSlider;
1194#define uiSlider(this) ((uiSlider *) (this))
1195
1204
1213
1222
1231
1246 void (*f)(uiSlider *sender, void *senderData), void *data);
1247
1261 void (*f)(uiSlider *sender, void *senderData), void *data);
1262
1273_UI_EXTERN void uiSliderSetRange(uiSlider *s, int min, int max);
1274
1290
1291
1302#define uiProgressBar(this) ((uiProgressBar *) (this))
1303
1312
1327
1335
1336
1345#define uiSeparator(this) ((uiSeparator *) (this))
1346
1354
1362
1363
1372typedef struct uiCombobox uiCombobox;
1373#define uiCombobox(this) ((uiCombobox *) (this))
1374
1384_UI_EXTERN void uiComboboxAppend(uiCombobox *c, const char *text);
1385
1396_UI_EXTERN void uiComboboxInsertAt(uiCombobox *c, int index, const char *text);
1397
1409
1417
1426
1435
1444
1460 void (*f)(uiCombobox *sender, void *senderData), void *data);
1461
1469
1470
1484#define uiEditableCombobox(this) ((uiEditableCombobox *) (this))
1485
1496
1510
1521
1522// TODO what do we call a function that sets the currently selected item and fills the text field with it?
1523// editable comboboxes have no consistent concept of selected item
1524
1539 void (*f)(uiEditableCombobox *sender, void *senderData), void *data);
1540
1548
1549
1558#define uiRadioButtons(this) ((uiRadioButtons *) (this))
1559
1570
1579
1588
1603 void (*f)(uiRadioButtons *sender, void *senderData), void *data);
1604
1612
1613struct tm;
1631#define uiDateTimePicker(this) ((uiDateTimePicker *) (this))
1632
1642
1653
1668 void (*f)(uiDateTimePicker *sender, void *senderData), void *data);
1669
1677
1685
1693
1694
1704#define uiMultilineEntry(this) ((uiMultilineEntry *) (this))
1705
1716
1727
1738
1754 void (*f)(uiMultilineEntry *sender, void *senderData), void *data);
1755
1764
1773
1781
1791
1792
1799typedef struct uiMenuItem uiMenuItem;
1800#define uiMenuItem(this) ((uiMenuItem *) (this))
1801
1809
1819
1834 void (*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data);
1835
1846
1857
1886typedef struct uiMenu uiMenu;
1887#define uiMenu(this) ((uiMenu *) (this))
1888
1900
1912
1922
1932
1942
1950
1962_UI_EXTERN uiMenu *uiNewMenu(const char *name);
1963
1964
1977
1990
2006
2021_UI_EXTERN void uiMsgBox(uiWindow *parent, const char *title, const char *description);
2022
2038_UI_EXTERN void uiMsgBoxError(uiWindow *parent, const char *title, const char *description);
2039
2040typedef struct uiArea uiArea;
2045
2047
2050 // TODO document that resizes cause a full redraw for non-scrolling areas; implementation-defined for scrolling areas
2052 // TODO document that on first show if the mouse is already in the uiArea then one gets sent with left=0
2053 // TODO what about when the area is hidden and then shown again?
2054 void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left);
2057};
2058
2059// TODO RTL layouts?
2060// TODO reconcile edge and corner naming
2070 // TODO have one for keyboard resizes?
2071 // TODO GDK doesn't seem to have any others, including for keyboards...
2072 // TODO way to bring up the system menu instead?
2073};
2074
2075#define uiArea(this) ((uiArea *) (this))
2076// TODO give a better name
2077// TODO document the types of width and height
2078_UI_EXTERN void uiAreaSetSize(uiArea *a, int width, int height);
2079// TODO uiAreaQueueRedraw()
2081_UI_EXTERN void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height);
2082// TODO document these can only be called within Mouse() handlers
2083// TODO should these be allowed on scrolling areas?
2084// TODO decide which mouse events should be accepted; Down is the only one guaranteed to work right now
2085// TODO what happens to events after calling this up to and including the next mouse up?
2086// TODO release capture?
2091
2094
2095 // TODO document that this is only defined for nonscrolling areas
2098
2099 double ClipX;
2100 double ClipY;
2103};
2104
2105typedef struct uiDrawPath uiDrawPath;
2109
2111
2117};
2118
2123};
2124
2129};
2130
2131// this is the default for botoh cairo and Direct2D (in the latter case, from the C++ helper functions)
2132// Core Graphics doesn't explicitly specify a default, but NSBezierPath allows you to choose one, and this is the initial value
2133// so we're good to use it too!
2134#define uiDrawDefaultMiterLimit 10.0
2135
2139};
2140
2142 double M11;
2143 double M12;
2144 double M21;
2145 double M22;
2146 double M31;
2147 double M32;
2148};
2149
2152
2153 // solid brushes
2154 double R;
2155 double G;
2156 double B;
2157 double A;
2158
2159 // gradient brushes
2160 double X0; // linear: start X, radial: start X
2161 double Y0; // linear: start Y, radial: start Y
2162 double X1; // linear: end X, radial: outer circle center X
2163 double Y1; // linear: end Y, radial: outer circle center Y
2164 double OuterRadius; // radial gradients only
2166 size_t NumStops;
2167 // TODO extend mode
2168 // cairo: none, repeat, reflect, pad; no individual control
2169 // Direct2D: repeat, reflect, pad; no individual control
2170 // Core Graphics: none, pad; before and after individually
2171 // TODO cairo documentation is inconsistent about pad
2172
2173 // TODO images
2174
2175 // TODO transforms
2176};
2177
2179 double Pos;
2180 double R;
2181 double G;
2182 double B;
2183 double A;
2184};
2185
2189 // TODO what if this is 0? on windows there will be a crash with dashing
2192 double *Dashes;
2193 // TOOD what if this is 1 on Direct2D?
2194 // TODO what if a dash is 0 on Cairo or Quartz?
2197};
2198
2201
2202_UI_EXTERN void uiDrawPathNewFigure(uiDrawPath *p, double x, double y);
2203_UI_EXTERN void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2204_UI_EXTERN void uiDrawPathLineTo(uiDrawPath *p, double x, double y);
2205// notes: angles are both relative to 0 and go counterclockwise
2206// TODO is the initial line segment on cairo and OS X a proper join?
2207// TODO what if sweep < 0?
2208_UI_EXTERN void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2209_UI_EXTERN void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, double c2y, double endX, double endY);
2210// TODO quadratic bezier
2212
2213// TODO effect of these when a figure is already started
2214_UI_EXTERN void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height);
2215
2218
2221
2222// TODO primitives:
2223// - rounded rectangles
2224// - elliptical arcs
2225// - quadratic bezier curves
2226
2228_UI_EXTERN void uiDrawMatrixTranslate(uiDrawMatrix *m, double x, double y);
2229_UI_EXTERN void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x, double y);
2230_UI_EXTERN void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount);
2231_UI_EXTERN void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount);
2237
2239
2240// TODO add a uiDrawPathStrokeToFill() or something like that
2242
2245
2246// uiAttribute stores information about an attribute in a
2247// uiAttributedString.
2248//
2249// You do not create uiAttributes directly; instead, you create a
2250// uiAttribute of a given type using the specialized constructor
2251// functions. For every Unicode codepoint in the uiAttributedString,
2252// at most one value of each attribute type can be applied.
2253//
2254// uiAttributes are immutable and the uiAttributedString takes
2255// ownership of the uiAttribute object once assigned, copying its
2256// contents as necessary.
2257// TODO define whether all this, for both uiTableValue and uiAttribute, is undefined behavior or a caught error
2259
2260// @role uiAttribute destructor
2261// uiFreeAttribute() frees a uiAttribute. You generally do not need to
2262// call this yourself, as uiAttributedString does this for you. In fact,
2263// it is an error to call this function on a uiAttribute that has been
2264// given to a uiAttributedString. You can call this, however, if you
2265// created a uiAttribute that you aren't going to use later.
2267
2268// uiAttributeType holds the possible uiAttribute types that may be
2269// returned by uiAttributeGetType(). Refer to the documentation for
2270// each type's constructor function for details on each type.
2282};
2283
2284// uiAttributeGetType() returns the type of a.
2285// TODO I don't like this name
2287
2288// uiNewFamilyAttribute() creates a new uiAttribute that changes the
2289// font family of the text it is applied to. family is copied; you do not
2290// need to keep it alive after uiNewFamilyAttribute() returns. Font
2291// family names are case-insensitive.
2293
2294// uiAttributeFamily() returns the font family stored in a. The
2295// returned string is owned by a. It is an error to call this on a
2296// uiAttribute that does not hold a font family.
2298
2299// uiNewSizeAttribute() creates a new uiAttribute that changes the
2300// size of the text it is applied to, in typographical points.
2302
2303// uiAttributeSize() returns the font size stored in a. It is an error to
2304// call this on a uiAttribute that does not hold a font size.
2306
2307// uiTextWeight represents possible text weights. These roughly
2308// map to the OS/2 text weight field of TrueType and OpenType
2309// fonts, or to CSS weight numbers. The named constants are
2310// nominal values; the actual values may vary by font and by OS,
2311// though this isn't particularly likely. Any value between
2312// uiTextWeightMinimum and uiTextWeightMaximum, inclusive,
2313// is allowed.
2314//
2315// Note that due to restrictions in early versions of Windows, some
2316// fonts have "special" weights be exposed in many programs as
2317// separate font families. This is perhaps most notable with
2318// Arial Black. libui does not do this, even on Windows (because the
2319// DirectWrite API libui uses on Windows does not do this); to
2320// specify Arial Black, use family Arial and weight uiTextWeightBlack.
2335};
2336
2337// uiNewWeightAttribute() creates a new uiAttribute that changes the
2338// weight of the text it is applied to. It is an error to specify a weight
2339// outside the range [uiTextWeightMinimum,
2340// uiTextWeightMaximum].
2342
2343// uiAttributeWeight() returns the font weight stored in a. It is an error
2344// to call this on a uiAttribute that does not hold a font weight.
2346
2347// uiTextItalic represents possible italic modes for a font. Italic
2348// represents "true" italics where the slanted glyphs have custom
2349// shapes, whereas oblique represents italics that are merely slanted
2350// versions of the normal glyphs. Most fonts usually have one or the
2351// other.
2356};
2357
2358// uiNewItalicAttribute() creates a new uiAttribute that changes the
2359// italic mode of the text it is applied to. It is an error to specify an
2360// italic mode not specified in uiTextItalic.
2362
2363// uiAttributeItalic() returns the font italic mode stored in a. It is an
2364// error to call this on a uiAttribute that does not hold a font italic
2365// mode.
2367
2368// uiTextStretch represents possible stretches (also called "widths")
2369// of a font.
2370//
2371// Note that due to restrictions in early versions of Windows, some
2372// fonts have "special" stretches be exposed in many programs as
2373// separate font families. This is perhaps most notable with
2374// Arial Condensed. libui does not do this, even on Windows (because
2375// the DirectWrite API libui uses on Windows does not do this); to
2376// specify Arial Condensed, use family Arial and stretch
2377// uiTextStretchCondensed.
2388};
2389
2390// uiNewStretchAttribute() creates a new uiAttribute that changes the
2391// stretch of the text it is applied to. It is an error to specify a strech
2392// not specified in uiTextStretch.
2394
2395// uiAttributeStretch() returns the font stretch stored in a. It is an
2396// error to call this on a uiAttribute that does not hold a font stretch.
2398
2399// uiNewColorAttribute() creates a new uiAttribute that changes the
2400// color of the text it is applied to. It is an error to specify an invalid
2401// color.
2402_UI_EXTERN uiAttribute *uiNewColorAttribute(double r, double g, double b, double a);
2403
2404// uiAttributeColor() returns the text color stored in a. It is an
2405// error to call this on a uiAttribute that does not hold a text color.
2406_UI_EXTERN void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha);
2407
2408// uiNewBackgroundAttribute() creates a new uiAttribute that
2409// changes the background color of the text it is applied to. It is an
2410// error to specify an invalid color.
2411_UI_EXTERN uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a);
2412
2413// TODO reuse uiAttributeColor() for background colors, or make a new function...
2414
2415// uiUnderline specifies a type of underline to use on text.
2420 uiUnderlineSuggestion, // wavy or dotted underlines used for spelling/grammar checkers
2421};
2422
2423// uiNewUnderlineAttribute() creates a new uiAttribute that changes
2424// the type of underline on the text it is applied to. It is an error to
2425// specify an underline type not specified in uiUnderline.
2427
2428// uiAttributeUnderline() returns the underline type stored in a. It is
2429// an error to call this on a uiAttribute that does not hold an underline
2430// style.
2432
2433// uiUnderlineColor specifies the color of any underline on the text it
2434// is applied to, regardless of the type of underline. In addition to
2435// being able to specify a custom color, you can explicitly specify
2436// platform-specific colors for suggestion underlines; to use them
2437// correctly, pair them with uiUnderlineSuggestion (though they can
2438// be used on other types of underline as well).
2439//
2440// If an underline type is applied but no underline color is
2441// specified, the text color is used instead. If an underline color
2442// is specified without an underline type, the underline color
2443// attribute is ignored, but not removed from the uiAttributedString.
2448 uiUnderlineColorAuxiliary, // for instance, the color used by smart replacements on macOS or in Microsoft Office
2449};
2450
2451// uiNewUnderlineColorAttribute() creates a new uiAttribute that
2452// changes the color of the underline on the text it is applied to.
2453// It is an error to specify an underline color not specified in
2454// uiUnderlineColor.
2455//
2456// If the specified color type is uiUnderlineColorCustom, it is an
2457// error to specify an invalid color value. Otherwise, the color values
2458// are ignored and should be specified as zero.
2459_UI_EXTERN uiAttribute *uiNewUnderlineColorAttribute(uiUnderlineColor u, double r, double g, double b, double a);
2460
2461// uiAttributeUnderlineColor() returns the underline color stored in
2462// a. It is an error to call this on a uiAttribute that does not hold an
2463// underline color.
2464_UI_EXTERN void uiAttributeUnderlineColor(const uiAttribute *a, uiUnderlineColor *u, double *r, double *g, double *b, double *alpha);
2465
2466// uiOpenTypeFeatures represents a set of OpenType feature
2467// tag-value pairs, for applying OpenType features to text.
2468// OpenType feature tags are four-character codes defined by
2469// OpenType that cover things from design features like small
2470// caps and swashes to language-specific glyph shapes and
2471// beyond. Each tag may only appear once in any given
2472// uiOpenTypeFeatures instance. Each value is a 32-bit integer,
2473// often used as a Boolean flag, but sometimes as an index to choose
2474// a glyph shape to use.
2475//
2476// If a font does not support a certain feature, that feature will be
2477// ignored. (TODO verify this on all OSs)
2478//
2479// See the OpenType specification at
2480// https://www.microsoft.com/typography/otspec/featuretags.htm
2481// for the complete list of available features, information on specific
2482// features, and how to use them.
2483// TODO invalid features
2485
2486// uiOpenTypeFeaturesForEachFunc is the type of the function
2487// invoked by uiOpenTypeFeaturesForEach() for every OpenType
2488// feature in otf. Refer to that function's documentation for more
2489// details.
2490typedef uiForEach (*uiOpenTypeFeaturesForEachFunc)(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value, void *data);
2491
2492// @role uiOpenTypeFeatures constructor
2493// uiNewOpenTypeFeatures() returns a new uiOpenTypeFeatures
2494// instance, with no tags yet added.
2496
2497// @role uiOpenTypeFeatures destructor
2498// uiFreeOpenTypeFeatures() frees otf.
2500
2501// uiOpenTypeFeaturesClone() makes a copy of otf and returns it.
2502// Changing one will not affect the other.
2504
2505// uiOpenTypeFeaturesAdd() adds the given feature tag and value
2506// to otf. The feature tag is specified by a, b, c, and d. If there is
2507// already a value associated with the specified tag in otf, the old
2508// value is removed.
2509_UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);
2510
2511// uiOpenTypeFeaturesRemove() removes the given feature tag
2512// and value from otf. If the tag is not present in otf,
2513// uiOpenTypeFeaturesRemove() does nothing.
2514_UI_EXTERN void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d);
2515
2516// uiOpenTypeFeaturesGet() determines whether the given feature
2517// tag is present in otf. If it is, *value is set to the tag's value and
2518// nonzero is returned. Otherwise, zero is returned.
2519//
2520// Note that if uiOpenTypeFeaturesGet() returns zero, value isn't
2521// changed. This is important: if a feature is not present in a
2522// uiOpenTypeFeatures, the feature is NOT treated as if its
2523// value was zero anyway. Script-specific font shaping rules and
2524// font-specific feature settings may use a different default value
2525// for a feature. You should likewise not treat a missing feature as
2526// having a value of zero either. Instead, a missing feature should
2527// be treated as having some unspecified default value.
2528_UI_EXTERN int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value);
2529
2530// uiOpenTypeFeaturesForEach() executes f for every tag-value
2531// pair in otf. The enumeration order is unspecified. You cannot
2532// modify otf while uiOpenTypeFeaturesForEach() is running.
2534
2535// uiNewFeaturesAttribute() creates a new uiAttribute that changes
2536// the font family of the text it is applied to. otf is copied; you may
2537// free it after uiNewFeaturesAttribute() returns.
2539
2540// uiAttributeFeatures() returns the OpenType features stored in a.
2541// The returned uiOpenTypeFeatures object is owned by a. It is an
2542// error to call this on a uiAttribute that does not hold OpenType
2543// features.
2545
2546// uiAttributedString represents a string of UTF-8 text that can
2547// optionally be embellished with formatting attributes. libui
2548// provides the list of formatting attributes, which cover common
2549// formatting traits like boldface and color as well as advanced
2550// typographical features provided by OpenType like superscripts
2551// and small caps. These attributes can be combined in a variety of
2552// ways.
2553//
2554// Attributes are applied to runs of Unicode codepoints in the string.
2555// Zero-length runs are elided. Consecutive runs that have the same
2556// attribute type and value are merged. Each attribute is independent
2557// of each other attribute; overlapping attributes of different types
2558// do not split each other apart, but different values of the same
2559// attribute type do.
2560//
2561// The empty string can also be represented by uiAttributedString,
2562// but because of the no-zero-length-attribute rule, it will not have
2563// attributes.
2564//
2565// A uiAttributedString takes ownership of all attributes given to
2566// it, as it may need to duplicate or delete uiAttribute objects at
2567// any time. By extension, when you free a uiAttributedString,
2568// all uiAttributes within will also be freed. Each method will
2569// describe its own rules in more details.
2570//
2571// In addition, uiAttributedString provides facilities for moving
2572// between grapheme clusters, which represent a character
2573// from the point of view of the end user. The cursor of a text editor
2574// is always placed on a grapheme boundary, so you can use these
2575// features to move the cursor left or right by one "character".
2576// TODO does uiAttributedString itself need this
2577//
2578// uiAttributedString does not provide enough information to be able
2579// to draw itself onto a uiDrawContext or respond to user actions.
2580// In order to do that, you'll need to use a uiDrawTextLayout, which
2581// is built from the combination of a uiAttributedString and a set of
2582// layout-specific properties.
2584
2585// uiAttributedStringForEachAttributeFunc is the type of the function
2586// invoked by uiAttributedStringForEachAttribute() for every
2587// attribute in s. Refer to that function's documentation for more
2588// details.
2589typedef uiForEach (*uiAttributedStringForEachAttributeFunc)(const uiAttributedString *s, const uiAttribute *a, size_t start, size_t end, void *data);
2590
2591// @role uiAttributedString constructor
2592// uiNewAttributedString() creates a new uiAttributedString from
2593// initialString. The string will be entirely unattributed.
2595
2596// @role uiAttributedString destructor
2597// uiFreeAttributedString() destroys the uiAttributedString s.
2598// It will also free all uiAttributes within.
2600
2601// uiAttributedStringString() returns the textual content of s as a
2602// '\0'-terminated UTF-8 string. The returned pointer is valid until
2603// the next change to the textual content of s.
2605
2606// uiAttributedStringLength() returns the number of UTF-8 bytes in
2607// the textual content of s, excluding the terminating '\0'.
2609
2610// uiAttributedStringAppendUnattributed() adds the '\0'-terminated
2611// UTF-8 string str to the end of s. The new substring will be
2612// unattributed.
2614
2615// uiAttributedStringInsertAtUnattributed() adds the '\0'-terminated
2616// UTF-8 string str to s at the byte position specified by at. The new
2617// substring will be unattributed; existing attributes will be moved
2618// along with their text.
2620
2621// TODO add the Append and InsertAtExtendingAttributes functions
2622// TODO and add functions that take a string + length
2623
2624// uiAttributedStringDelete() deletes the characters and attributes of
2625// s in the byte range [start, end).
2626_UI_EXTERN void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end);
2627
2628// 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
2629
2630// uiAttributedStringSetAttribute() sets a in the byte range [start, end)
2631// of s. Any existing attributes in that byte range of the same type are
2632// removed. s takes ownership of a; you should not use it after
2633// uiAttributedStringSetAttribute() returns.
2635
2636// uiAttributedStringForEachAttribute() enumerates all the
2637// uiAttributes in s. It is an error to modify s in f. Within f, s still
2638// owns the attribute; you can neither free it nor save it for later
2639// use.
2640// TODO reword the above for consistency (TODO and find out what I meant by that)
2641// TODO define an enumeration order (or mark it as undefined); also define how consecutive runs of identical attributes are handled here and sync with the definition of uiAttributedString itself
2643
2644// TODO const correct this somehow (the implementation needs to mutate the structure)
2646
2647// TODO const correct this somehow (the implementation needs to mutate the structure)
2649
2650// TODO const correct this somehow (the implementation needs to mutate the structure)
2652
2653// uiFontDescriptor provides a complete description of a font where
2654// one is needed. Currently, this means as the default font of a
2655// uiDrawTextLayout and as the data returned by uiFontButton.
2656// All the members operate like the respective uiAttributes.
2658
2660 // TODO const-correct this or figure out how to deal with this when getting a value
2661 char *Family;
2662 double Size;
2666};
2667
2670
2671// uiDrawTextLayout is a concrete representation of a
2672// uiAttributedString that can be displayed in a uiDrawContext.
2673// It includes information important for the drawing of a block of
2674// text, including the bounding box to wrap the text within, the
2675// alignment of lines of text within that box, areas to mark as
2676// being selected, and other things.
2677//
2678// Unlike uiAttributedString, the content of a uiDrawTextLayout is
2679// immutable once it has been created.
2680//
2681// TODO talk about OS-specific differences with text drawing that libui can't account for...
2683
2684// uiDrawTextAlign specifies the alignment of lines of text in a
2685// uiDrawTextLayout.
2686// TODO should this really have Draw in the name?
2691};
2692
2693// uiDrawTextLayoutParams describes a uiDrawTextLayout.
2694// DefaultFont is used to render any text that is not attributed
2695// sufficiently in String. Width determines the width of the bounding
2696// box of the text; the height is determined automatically.
2698
2699// TODO const-correct this somehow
2703 double Width;
2705};
2706
2707// @role uiDrawTextLayout constructor
2708// uiDrawNewTextLayout() creates a new uiDrawTextLayout from
2709// the given parameters.
2710//
2711// TODO
2712// - allow creating a layout out of a substring
2713// - allow marking compositon strings
2714// - allow marking selections, even after creation
2715// - add the following functions:
2716// - uiDrawTextLayoutHeightForWidth() (returns the height that a layout would need to be to display the entire string at a given width)
2717// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
2718// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
2719// - some function to fix up a range (for text editing)
2721
2722// @role uiDrawFreeTextLayout destructor
2723// uiDrawFreeTextLayout() frees tl. The underlying
2724// uiAttributedString is not freed.
2726
2727// uiDrawText() draws tl in c with the top-left point of tl at (x, y).
2728_UI_EXTERN void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y);
2729
2730// uiDrawTextLayoutExtents() returns the width and height of tl
2731// in width and height. The returned width may be smaller than
2732// the width passed into uiDrawNewTextLayout() depending on
2733// how the text in tl is wrapped. Therefore, you can use this
2734// function to get the actual size of the text layout.
2735_UI_EXTERN void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height);
2736
2737// TODO metrics functions
2738
2739// TODO number of lines visible for clipping rect, range visible for clipping rect?
2740
2741
2753#define uiFontButton(this) ((uiFontButton *) (this))
2754
2765
2779 void (*f)(uiFontButton *sender, void *senderData), void *data);
2780
2790
2804
2814 uiModifierAlt = 1 << 1,
2817};
2818
2819// TODO document drag captures
2821 // TODO document what these mean for scrolling areas
2822 double X;
2823 double Y;
2824
2825 // TODO see draw above
2828
2829 int Down;
2830 int Up;
2831
2833
2835
2836 uint64_t Held1To64;
2837};
2838
2841 uiExtKeyInsert, // equivalent to "Help" on Apple keyboards
2851 uiExtKeyF1, // F1..F12 are guaranteed to be consecutive
2863 uiExtKeyN0, // numpad keys; independent of Num Lock state
2864 uiExtKeyN1, // N0..N9 are guaranteed to be consecutive
2879};
2880
2882 char Key;
2885
2887
2888 int Up;
2889};
2890
2891
2905#define uiColorButton(this) ((uiColorButton *) (this))
2906
2917_UI_EXTERN void uiColorButtonColor(uiColorButton *b, double *r, double *g, double *bl, double *a);
2918
2929_UI_EXTERN void uiColorButtonSetColor(uiColorButton *b, double r, double g, double bl, double a);
2930
2944 void (*f)(uiColorButton *sender, void *senderData), void *data);
2945
2953
2954
2970typedef struct uiForm uiForm;
2971#define uiForm(this) ((uiForm *) (this))
2972
2987_UI_EXTERN void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy);
2988
2996
3005_UI_EXTERN void uiFormDelete(uiForm *f, int index);
3006
3017
3028_UI_EXTERN void uiFormSetPadded(uiForm *f, int padded);
3029
3037
3038
3050};
3051
3063};
3064
3086typedef struct uiGrid uiGrid;
3087#define uiGrid(this) ((uiGrid *) (this))
3088
3104_UI_EXTERN void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3105
3121_UI_EXTERN void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3122
3133
3144_UI_EXTERN void uiGridSetPadded(uiGrid *g, int padded);
3145
3153
3154
3175typedef struct uiImage uiImage;
3176
3188_UI_EXTERN uiImage *uiNewImage(double width, double height);
3189
3197
3214_UI_EXTERN void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int byteStride);
3215
3265
3280
3293};
3294
3303
3314
3327
3343
3357
3371
3382
3393_UI_EXTERN uiTableValue *uiNewTableValueColor(double r, double g, double b, double a);
3394
3407_UI_EXTERN void uiTableValueColor(const uiTableValue *v, double *r, double *g, double *b, double *a);
3408
3409
3423
3446
3471
3479
3484
3497 uiTableValue *(*CellValue)(uiTableModelHandler *mh, uiTableModel *m, int row, int column);
3498
3512};
3513
3522
3532
3545
3557
3570// TODO reordering/moving
3571
3573#define uiTableModelColumnNeverEditable (-1)
3575#define uiTableModelColumnAlwaysEditable (-2)
3576
3594};
3595
3617};
3618
3640typedef struct uiTable uiTable;
3641#define uiTable(this) ((uiTable *) (this))
3642
3661 const char *name,
3662 int textModelColumn,
3663 int textEditableModelColumn,
3665
3681 const char *name,
3682 int imageModelColumn);
3683
3706 const char *name,
3707 int imageModelColumn,
3708 int textModelColumn,
3709 int textEditableModelColumn,
3711
3728 const char *name,
3729 int checkboxModelColumn,
3730 int checkboxEditableModelColumn);
3731
3756 const char *name,
3757 int checkboxModelColumn,
3758 int checkboxEditableModelColumn,
3759 int textModelColumn,
3760 int textEditableModelColumn,
3762
3779 const char *name,
3780 int progressModelColumn);
3781
3803 const char *name,
3804 int buttonModelColumn,
3805 int buttonClickableModelColumn);
3806
3815
3824
3833
3834
3849 void (*f)(uiTable *t, int row, void *data),
3850 void *data);
3851
3867 void (*f)(uiTable *t, int row, void *data),
3868 void *data);
3869
3883 int column,
3884 uiSortIndicator indicator);
3885
3895
3910 void (*f)(uiTable *sender, int column, void *senderData), void *data);
3911
3921
3935_UI_EXTERN void uiTableColumnSetWidth(uiTable *t, int column, int width);
3936
3960};
3961
3971
3983
3998_UI_EXTERN void uiTableOnSelectionChanged(uiTable *t, void (*f)(uiTable *t, void *data), void *data);
3999
4008{
4010 int *Rows;
4011};
4012
4024
4037
4045
4046#ifdef __cplusplus
4047}
4048#endif
4049
4050#endif
char * uiOpenFolder(uiWindow *parent)
Folder chooser dialog window to select a single folder.
char * uiSaveFile(uiWindow *parent)
Save file dialog window.
char * uiOpenFile(uiWindow *parent)
File chooser dialog window to select a single file.
void uiMsgBoxError(uiWindow *parent, const char *title, const char *description)
Error message box dialog window.
void uiMsgBox(uiWindow *parent, const char *title, const char *description)
Message box dialog window.
uiTableSelectionMode
Table selection modes.
Definition: ui.h:3949
uiSortIndicator
Sort indicators.
Definition: ui.h:3418
Definition: ui.h:2092
double AreaWidth
Definition: ui.h:2096
double ClipWidth
Definition: ui.h:2101
double ClipHeight
Definition: ui.h:2102
double AreaHeight
Definition: ui.h:2097
double ClipY
Definition: ui.h:2100
uiDrawContext * Context
Definition: ui.h:2093
double ClipX
Definition: ui.h:2099
Definition: ui.h:2048
void(* DragBroken)(uiAreaHandler *, uiArea *)
Definition: ui.h:2055
int(* KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *)
Definition: ui.h:2056
void(* Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *)
Definition: ui.h:2049
void(* MouseCrossed)(uiAreaHandler *, uiArea *, int left)
Definition: ui.h:2054
void(* MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *)
Definition: ui.h:2051
Definition: ui.h:2881
char Key
Definition: ui.h:2882
int Up
Definition: ui.h:2888
uiExtKey ExtKey
Definition: ui.h:2883
uiModifiers Modifier
Definition: ui.h:2884
uiModifiers Modifiers
Definition: ui.h:2886
Definition: ui.h:2820
int Count
Definition: ui.h:2832
double X
Definition: ui.h:2822
double AreaHeight
Definition: ui.h:2827
int Down
Definition: ui.h:2829
uint64_t Held1To64
Definition: ui.h:2836
int Up
Definition: ui.h:2830
uiModifiers Modifiers
Definition: ui.h:2834
double Y
Definition: ui.h:2823
double AreaWidth
Definition: ui.h:2826
A boxlike container that holds a group of controls.
void uiBoxDelete(uiBox *b, int index)
Removes the control at index from the box.
uiBox * uiNewHorizontalBox(void)
Creates a new horizontal box.
void uiBoxSetPadded(uiBox *b, int padded)
Sets whether or not controls within the box are padded.
int uiBoxNumChildren(uiBox *b)
Returns the number of controls contained within the box.
void uiBoxAppend(uiBox *b, uiControl *child, int stretchy)
Appends a control to the box.
uiBox * uiNewVerticalBox(void)
Creates a new vertical box.
int uiBoxPadded(uiBox *b)
Returns whether or not controls within the box are padded.
A control that visually represents a button to be clicked by the user to trigger an action.
char * uiButtonText(uiButton *b)
Returns the button label text.
void uiButtonOnClicked(uiButton *b, void(*f)(uiButton *sender, void *senderData), void *data)
Registers a callback for when the button is clicked.
void uiButtonSetText(uiButton *b, const char *text)
Sets the button label text.
uiButton * uiNewButton(const char *text)
Creates a new button.
A control with a user checkable box accompanied by a text label.
void uiCheckboxSetChecked(uiCheckbox *c, int checked)
Sets whether or not the checkbox is checked.
uiCheckbox * uiNewCheckbox(const char *text)
Creates a new checkbox.
char * uiCheckboxText(uiCheckbox *c)
Returns the checkbox label text.
int uiCheckboxChecked(uiCheckbox *c)
Returns whether or the checkbox is checked.
void uiCheckboxOnToggled(uiCheckbox *c, void(*f)(uiCheckbox *sender, void *senderData), void *data)
Registers a callback for when the checkbox is toggled by the user.
void uiCheckboxSetText(uiCheckbox *c, const char *text)
Sets the checkbox label text.
A control with a color indicator that opens a color chooser when clicked.
uiColorButton * uiNewColorButton(void)
Creates a new color button.
void uiColorButtonOnChanged(uiColorButton *b, void(*f)(uiColorButton *sender, void *senderData), void *data)
Registers a callback for when the color is changed.
void uiColorButtonColor(uiColorButton *b, double *r, double *g, double *bl, double *a)
Returns the color button color.
void uiColorButtonSetColor(uiColorButton *b, double r, double g, double bl, double a)
Sets the color button color.
A control to select one item from a predefined list of items via a drop down menu.
void uiComboboxInsertAt(uiCombobox *c, int index, const char *text)
Inserts an item at index to the combo box.
void uiComboboxDelete(uiCombobox *c, int index)
Deletes an item at index from the combo box.
void uiComboboxClear(uiCombobox *c)
Deletes all items from the combo box.
void uiComboboxOnSelected(uiCombobox *c, void(*f)(uiCombobox *sender, void *senderData), void *data)
Registers a callback for when a combo box item is selected.
void uiComboboxAppend(uiCombobox *c, const char *text)
Appends an item to the combo box.
uiCombobox * uiNewCombobox(void)
Creates a new combo box.
void uiComboboxSetSelected(uiCombobox *c, int index)
Sets the item selected.
int uiComboboxSelected(uiCombobox *c)
Returns the index of the item selected.
int uiComboboxNumItems(uiCombobox *c)
Returns the number of items contained within the combo box.
Base class for GUI controls providing common methods.
Definition: ui.h:105
int uiControlVisible(uiControl *c)
Returns whether or not the control is visible.
void uiControlHide(uiControl *c)
Hides the control.
int(* Visible)(uiControl *)
Definition: ui.h:114
uint32_t OSSignature
Definition: ui.h:107
int(* Toplevel)(uiControl *)
Definition: ui.h:113
void(* SetParent)(uiControl *, uiControl *)
Definition: ui.h:112
int uiControlEnabledToUser(uiControl *c)
Returns whether or not the control can be interacted with by the user.
void uiControlDisable(uiControl *c)
Disables the control.
void uiControlDestroy(uiControl *c)
Dispose and free all allocated resources.
void uiControlEnable(uiControl *c)
Enables the control.
void(* Disable)(uiControl *)
Definition: ui.h:119
void(* Show)(uiControl *)
Definition: ui.h:115
void(* Destroy)(uiControl *)
Definition: ui.h:109
int uiControlEnabled(uiControl *c)
Returns whether or not the control is enabled.
uintptr_t uiControlHandle(uiControl *c)
Returns the control's OS-level handle.
void uiControlShow(uiControl *c)
Shows the control.
void uiFreeControl(uiControl *c)
Frees the memory associated with the control reference.
void uiControlVerifySetParent(uiControl *c, uiControl *parent)
Makes sure the control's parent can be set to parent.
int uiControlToplevel(uiControl *c)
Returns whether or not the control is a top level control.
void(* Hide)(uiControl *)
Definition: ui.h:116
void uiControlSetParent(uiControl *c, uiControl *parent)
Sets the control's parent.
uint32_t TypeSignature
Definition: ui.h:108
int(* Enabled)(uiControl *)
Definition: ui.h:117
uiControl * uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr)
Allocates a uiControl.
uint32_t Signature
Definition: ui.h:106
uiControl * uiControlParent(uiControl *c)
Returns the parent control.
uintptr_t(* Handle)(uiControl *)
Definition: ui.h:110
void(* Enable)(uiControl *)
Definition: ui.h:118
A control to enter a date and/or time.
Definition: ui.h:1613
uiDateTimePicker * uiNewDateTimePicker(void)
Creates a new date picker.
void uiDateTimePickerOnChanged(uiDateTimePicker *d, void(*f)(uiDateTimePicker *sender, void *senderData), void *data)
Registers a callback for when the date time picker value is changed by the user.
void uiDateTimePickerSetTime(uiDateTimePicker *d, const struct tm *time)
Sets date and time of the data time picker.
uiDateTimePicker * uiNewTimePicker(void)
Creates a new date and time picker.
uiDateTimePicker * uiNewDatePicker(void)
Creates a new time picker.
void uiDateTimePickerTime(uiDateTimePicker *d, struct tm *time)
Returns date and time stored in the data time picker.
Definition: ui.h:2178
double R
Definition: ui.h:2180
double G
Definition: ui.h:2181
double Pos
Definition: ui.h:2179
double B
Definition: ui.h:2182
double A
Definition: ui.h:2183
Definition: ui.h:2150
double Y1
Definition: ui.h:2163
double B
Definition: ui.h:2156
size_t NumStops
Definition: ui.h:2166
double R
Definition: ui.h:2154
double Y0
Definition: ui.h:2161
double A
Definition: ui.h:2157
uiDrawBrushGradientStop * Stops
Definition: ui.h:2165
double X1
Definition: ui.h:2162
double X0
Definition: ui.h:2160
double OuterRadius
Definition: ui.h:2164
double G
Definition: ui.h:2155
uiDrawBrushType Type
Definition: ui.h:2151
Definition: ui.h:2141
double M32
Definition: ui.h:2147
double M11
Definition: ui.h:2142
double M22
Definition: ui.h:2145
double M31
Definition: ui.h:2146
double M21
Definition: ui.h:2144
double M12
Definition: ui.h:2143
Definition: ui.h:2186
size_t NumDashes
Definition: ui.h:2195
double DashPhase
Definition: ui.h:2196
double * Dashes
Definition: ui.h:2192
double Thickness
Definition: ui.h:2190
double MiterLimit
Definition: ui.h:2191
uiDrawLineJoin Join
Definition: ui.h:2188
uiDrawLineCap Cap
Definition: ui.h:2187
Definition: ui.h:2700
uiAttributedString * String
Definition: ui.h:2701
double Width
Definition: ui.h:2703
uiFontDescriptor * DefaultFont
Definition: ui.h:2702
uiDrawTextAlign Align
Definition: ui.h:2704
A control to select one item from a predefined list of items or enter ones own.
uiEditableCombobox * uiNewEditableCombobox(void)
Creates a new editable combo box.
void uiEditableComboboxOnChanged(uiEditableCombobox *c, void(*f)(uiEditableCombobox *sender, void *senderData), void *data)
Registers a callback for when an editable combo box item is selected or user text changed.
void uiEditableComboboxSetText(uiEditableCombobox *c, const char *text)
Sets the editable combo box text.
char * uiEditableComboboxText(uiEditableCombobox *c)
Returns the text of the editable combo box.
void uiEditableComboboxAppend(uiEditableCombobox *c, const char *text)
Appends an item to the editable combo box.
A control with a single line text entry field.
uiEntry * uiNewEntry(void)
Creates a new entry.
void uiEntryOnChanged(uiEntry *e, void(*f)(uiEntry *sender, void *senderData), void *data)
Registers a callback for when the user changes the entry's text.
char * uiEntryText(uiEntry *e)
Returns the entry's text.
void uiEntrySetText(uiEntry *e, const char *text)
Sets the entry's text.
uiEntry * uiNewPasswordEntry(void)
Creates a new entry suitable for sensitive inputs like passwords.
void uiEntrySetReadOnly(uiEntry *e, int readonly)
Sets whether or not the entry's text is read only.
uiEntry * uiNewSearchEntry(void)
Creates a new entry suitable for search.
int uiEntryReadOnly(uiEntry *e)
Returns whether or not the entry's text can be changed.
A button-like control that opens a font chooser when clicked.
void uiFontButtonOnChanged(uiFontButton *b, void(*f)(uiFontButton *sender, void *senderData), void *data)
Registers a callback for when the font is changed.
void uiFontButtonFont(uiFontButton *b, uiFontDescriptor *desc)
Returns the selected font.
uiFontButton * uiNewFontButton(void)
Creates a new font button.
void uiFreeFontButtonFont(uiFontDescriptor *desc)
Frees a uiFontDescriptor previously filled by uiFontButtonFont().
Definition: ui.h:2659
uiTextItalic Italic
Definition: ui.h:2664
uiTextWeight Weight
Definition: ui.h:2663
char * Family
Definition: ui.h:2661
uiTextStretch Stretch
Definition: ui.h:2665
double Size
Definition: ui.h:2662
A container control to organize contained controls as labeled fields.
void uiFormSetPadded(uiForm *f, int padded)
Sets whether or not controls within the box are padded.
int uiFormPadded(uiForm *f)
Returns whether or not controls within the form are padded.
void uiFormDelete(uiForm *f, int index)
Removes the control at index from the form.
void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy)
Appends a control with a label to the form.
uiForm * uiNewForm(void)
Creates a new form.
int uiFormNumChildren(uiForm *f)
Returns the number of controls contained within the form.
A control container to arrange containing controls in a grid.
void uiGridSetPadded(uiGrid *g, int padded)
Sets whether or not controls within the grid are padded.
int uiGridPadded(uiGrid *g)
Returns whether or not controls within the grid are padded.
void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
Appends a control to the grid.
uiGrid * uiNewGrid(void)
Creates a new grid.
void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
Inserts a control positioned in relation to another control within the grid.
A control container that adds a label to the contained child control.
void uiGroupSetTitle(uiGroup *g, const char *title)
Sets the group title.
uiGroup * uiNewGroup(const char *title)
Creates a new group.
void uiGroupSetChild(uiGroup *g, uiControl *c)
Sets the group's child.
char * uiGroupTitle(uiGroup *g)
Returns the group title.
void uiGroupSetMargined(uiGroup *g, int margined)
Sets whether or not the group has a margin.
int uiGroupMargined(uiGroup *g)
Returns whether or not the group has a margin.
A container for an image to be displayed on screen.
uiImage * uiNewImage(double width, double height)
Creates a new image container.
void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int byteStride)
Appends a new image representation.
void uiFreeImage(uiImage *i)
Frees the image container and all associated resources.
Definition: ui.h:60
size_t Size
Definition: ui.h:61
A control that displays non interactive text.
char * uiLabelText(uiLabel *l)
Returns the label text.
uiLabel * uiNewLabel(const char *text)
Creates a new label.
void uiLabelSetText(uiLabel *l, const char *text)
Sets the label text.
An application level menu bar.
uiMenuItem * uiMenuAppendAboutItem(uiMenu *m)
Appends a new About menu item.
uiMenuItem * uiMenuAppendItem(uiMenu *m, const char *name)
Appends a generic menu item.
uiMenuItem * uiMenuAppendQuitItem(uiMenu *m)
Appends a new Quit menu item.
uiMenuItem * uiMenuAppendPreferencesItem(uiMenu *m)
Appends a new Preferences menu item.
void uiMenuAppendSeparator(uiMenu *m)
Appends a new separator.
uiMenuItem * uiMenuAppendCheckItem(uiMenu *m, const char *name)
Appends a generic menu item with a checkbox.
uiMenu * uiNewMenu(const char *name)
Creates a new menu.
A menu item used in conjunction with uiMenu.
void uiMenuItemDisable(uiMenuItem *m)
Disables the menu item.
int uiMenuItemChecked(uiMenuItem *m)
Returns whether or not the menu item's checkbox is checked.
void uiMenuItemOnClicked(uiMenuItem *m, void(*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data)
Registers a callback for when the menu item is clicked.
void uiMenuItemEnable(uiMenuItem *m)
Enables the menu item.
void uiMenuItemSetChecked(uiMenuItem *m, int checked)
Sets whether or not the menu item's checkbox is checked.
A control with a multi line text entry field.
void uiMultilineEntryOnChanged(uiMultilineEntry *e, void(*f)(uiMultilineEntry *sender, void *senderData), void *data)
Registers a callback for when the user changes the multi line entry's text.
void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text)
Appends text to the multi line entry's text.
void uiMultilineEntrySetReadOnly(uiMultilineEntry *e, int readonly)
Sets whether or not the multi line entry's text is read only.
uiMultilineEntry * uiNewMultilineEntry(void)
Creates a new multi line entry that visually wraps text when lines overflow.
void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text)
Sets the multi line entry's text.
uiMultilineEntry * uiNewNonWrappingMultilineEntry(void)
Creates a new multi line entry that scrolls horizontally when lines overflow.
char * uiMultilineEntryText(uiMultilineEntry *e)
Returns the multi line entry's text.
int uiMultilineEntryReadOnly(uiMultilineEntry *e)
Returns whether or not the multi line entry's text can be changed.
A control that visualizes the progress of a task via the fill level of a horizontal bar.
uiProgressBar * uiNewProgressBar(void)
Creates a new progress bar.
void uiProgressBarSetValue(uiProgressBar *p, int n)
Sets the progress bar value.
int uiProgressBarValue(uiProgressBar *p)
Returns the progress bar value.
A multiple choice control of check buttons from which only one can be selected at a time.
void uiRadioButtonsSetSelected(uiRadioButtons *r, int index)
Sets the item selected.
void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
Appends a radio button.
int uiRadioButtonsSelected(uiRadioButtons *r)
Returns the index of the item selected.
void uiRadioButtonsOnSelected(uiRadioButtons *r, void(*f)(uiRadioButtons *sender, void *senderData), void *data)
Registers a callback for when radio button is selected.
uiRadioButtons * uiNewRadioButtons(void)
Creates a new radio buttons instance.
A control to visually separate controls, horizontally or vertically.
uiSeparator * uiNewHorizontalSeparator(void)
Creates a new horizontal separator to separate controls being stacked vertically.
uiSeparator * uiNewVerticalSeparator(void)
Creates a new vertical separator to separate controls being stacked horizontally.
A control to display and modify integer values via a user draggable slider.
void uiSliderOnReleased(uiSlider *s, void(*f)(uiSlider *sender, void *senderData), void *data)
Registers a callback for when the slider is released from dragging.
uiSlider * uiNewSlider(int min, int max)
Creates a new slider.
int uiSliderHasToolTip(uiSlider *s)
Returns whether or not the slider has a tool tip.
int uiSliderValue(uiSlider *s)
Returns the slider value.
void uiSliderSetValue(uiSlider *s, int value)
Sets the slider value.
void uiSliderOnChanged(uiSlider *s, void(*f)(uiSlider *sender, void *senderData), void *data)
Registers a callback for when the slider value is changed by the user.
void uiSliderSetHasToolTip(uiSlider *s, int hasToolTip)
Sets whether or not the slider has a tool tip.
void uiSliderSetRange(uiSlider *s, int min, int max)
Sets the slider range.
A control to display and modify integer values via a text field or +/- buttons.
void uiSpinboxOnChanged(uiSpinbox *s, void(*f)(uiSpinbox *sender, void *senderData), void *data)
Registers a callback for when the spinbox value is changed by the user.
void uiSpinboxSetValue(uiSpinbox *s, int value)
Sets the spinbox value.
uiSpinbox * uiNewSpinbox(int min, int max)
Creates a new spinbox.
int uiSpinboxValue(uiSpinbox *s)
Returns the spinbox value.
A multi page control interface that displays one page at a time.
void uiTabAppend(uiTab *t, const char *name, uiControl *c)
Appends a control in form of a page/tab with label.
void uiTabSetMargined(uiTab *t, int index, int margined)
Sets whether or not the page/tab at index has a margin.
void uiTabOnSelected(uiTab *t, void(*f)(uiTab *sender, void *senderData), void *data)
Registers a callback for when a tab is selected.
int uiTabNumPages(uiTab *t)
Returns the number of pages contained.
void uiTabSetSelected(uiTab *t, int index)
Sets the tab selected.
int uiTabMargined(uiTab *t, int index)
Returns whether or not the page/tab at index has a margin.
int uiTabSelected(uiTab *t)
Returns the index of the tab selected.
void uiTabInsertAt(uiTab *t, const char *name, int index, uiControl *c)
Inserts a control in form of a page/tab with label at index.
void uiTabDelete(uiTab *t, int index)
Removes the control at index.
uiTab * uiNewTab(void)
Creates a new tab container.
A control to display data in a tabular fashion.
void uiTableAppendButtonColumn(uiTable *t, const char *name, int buttonModelColumn, int buttonClickableModelColumn)
Appends a column to the table containing a button.
void uiTableOnRowDoubleClicked(uiTable *t, void(*f)(uiTable *t, int row, void *data), void *data)
Registers a callback for when the user double clicks a table row.
uiTableSelection * uiTableGetSelection(uiTable *t)
Returns the current table selection.
void uiTableOnRowClicked(uiTable *t, void(*f)(uiTable *t, int row, void *data), void *data)
Registers a callback for when the user single clicks a table row.
void uiTableColumnSetWidth(uiTable *t, int column, int width)
Sets the table column width.
uiSortIndicator uiTableHeaderSortIndicator(uiTable *t, int column)
Returns the column's sort indicator displayed in the table header.
int uiTableHeaderVisible(uiTable *t)
Returns whether or not the table header is visible.
void uiTableAppendImageTextColumn(uiTable *t, const char *name, int imageModelColumn, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)
Appends a column to the table that displays both an image and text.
void uiTableAppendCheckboxTextColumn(uiTable *t, const char *name, int checkboxModelColumn, int checkboxEditableModelColumn, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)
Appends a column to the table containing a checkbox and text.
int uiTableColumnWidth(uiTable *t, int column)
Returns the table column width.
void uiTableAppendTextColumn(uiTable *t, const char *name, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)
Appends a text column to the table.
void uiTableSetSelectionMode(uiTable *t, uiTableSelectionMode mode)
Sets the table selection mode.
void uiTableSetSelection(uiTable *t, uiTableSelection *sel)
Sets the current table selection clearing any previous selection.
uiTable * uiNewTable(uiTableParams *params)
Creates a new table.
void uiTableOnSelectionChanged(uiTable *t, void(*f)(uiTable *t, void *data), void *data)
Registers a callback for when the table selection changed.
void uiTableHeaderOnClicked(uiTable *t, void(*f)(uiTable *sender, int column, void *senderData), void *data)
Registers a callback for when a table column header is clicked.
void uiTableAppendCheckboxColumn(uiTable *t, const char *name, int checkboxModelColumn, int checkboxEditableModelColumn)
Appends a column to the table containing a checkbox.
void uiTableHeaderSetSortIndicator(uiTable *t, int column, uiSortIndicator indicator)
Sets the column's sort indicator displayed in the table header.
uiTableSelectionMode uiTableGetSelectionMode(uiTable *t)
Returns the table selection mode.
void uiTableAppendImageColumn(uiTable *t, const char *name, int imageModelColumn)
Appends an image column to the table.
void uiTableHeaderSetVisible(uiTable *t, int visible)
Sets whether or not the table header is visible.
void uiTableAppendProgressBarColumn(uiTable *t, const char *name, int progressModelColumn)
Appends a column to the table containing a progress bar.
Developer defined methods for data retrieval and setting.
Definition: ui.h:3461
void(* SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const uiTableValue *)
Sets the cell value for (row, column).
Definition: ui.h:3511
int(* NumColumns)(uiTableModelHandler *, uiTableModel *)
Returns the number of columns in the uiTableModel.
Definition: ui.h:3470
uiTableValueType(* ColumnType)(uiTableModelHandler *, uiTableModel *, int column)
Returns the column type in for of a uiTableValueType.
Definition: ui.h:3478
int(* NumRows)(uiTableModelHandler *, uiTableModel *)
Returns the number of rows in the uiTableModel.
Definition: ui.h:3483
Table model delegate to retrieve data and inform about model changes.
uiTableModel * uiNewTableModel(uiTableModelHandler *mh)
Creates a new table model.
void uiTableModelRowChanged(uiTableModel *m, int index)
Informs all associated uiTable views that a row has been changed.
void uiFreeTableModel(uiTableModel *m)
Frees the table model.
void uiTableModelRowInserted(uiTableModel *m, int newIndex)
Informs all associated uiTable views that a new row has been added.
void uiTableModelRowDeleted(uiTableModel *m, int oldIndex)
Informs all associated uiTable views that a row has been deleted.
Table parameters passed to uiNewTable().
Definition: ui.h:3603
int RowBackgroundColorModelColumn
uiTableModel column that defines background color for each row,
Definition: ui.h:3616
uiTableModel * Model
Model holding the data to be displayed.
Definition: ui.h:3607
Holds an array of selected row indices for a table.
Definition: ui.h:4008
void uiFreeTableSelection(uiTableSelection *s)
Frees the given uiTableSelection and all it's resources.
int * Rows
Array containing selected row indices, NULL on empty selection.
Definition: ui.h:4010
int NumRows
Number of selected rows.
Definition: ui.h:4009
Optional parameters to control the appearance of text columns.
Definition: ui.h:3584
int ColorModelColumn
uiTableModel column that defines the text color for each cell.
Definition: ui.h:3593
Container to store values used in container related methods.
int uiTableValueInt(const uiTableValue *v)
Returns the integer value held internally.
void uiTableValueColor(const uiTableValue *v, double *r, double *g, double *b, double *a)
Returns the color value held internally.
void uiFreeTableValue(uiTableValue *v)
Frees the uiTableValue.
uiTableValue * uiNewTableValueImage(uiImage *img)
Creates a new table value to store an image.
uiTableValueType uiTableValueGetType(const uiTableValue *v)
Gets the uiTableValue type.
uiTableValue * uiNewTableValueString(const char *str)
Creates a new table value to store a text string.
const char * uiTableValueString(const uiTableValue *v)
Returns the string value held internally.
uiTableValue * uiNewTableValueInt(int i)
Creates a new table value to store an integer.
uiTableValue * uiNewTableValueColor(double r, double g, double b, double a)
Creates a new table value to store a color in.
uiImage * uiTableValueImage(const uiTableValue *v)
Returns a reference to the image contained.
A control that represents a top-level window.
int uiWindowFocused(uiWindow *w)
Returns whether or not the window is focused.
void uiWindowPosition(uiWindow *w, int *x, int *y)
Gets the window position.
void uiWindowSetContentSize(uiWindow *w, int width, int height)
Sets the window content size.
void uiWindowSetResizeable(uiWindow *w, int resizeable)
Sets whether or not the window is user resizeable.
void uiWindowOnClosing(uiWindow *w, int(*f)(uiWindow *sender, void *senderData), void *data)
Registers a callback for when the window is to be closed.
int uiWindowBorderless(uiWindow *w)
Returns whether or not the window is borderless.
int uiWindowMargined(uiWindow *w)
Returns whether or not the window has a margin.
void uiWindowOnContentSizeChanged(uiWindow *w, void(*f)(uiWindow *sender, void *senderData), void *data)
Registers a callback for when the window content size is changed.
int uiWindowFullscreen(uiWindow *w)
Returns whether or not the window is full screen.
void uiWindowSetBorderless(uiWindow *w, int borderless)
Sets whether or not the window is borderless.
int uiWindowResizeable(uiWindow *w)
Returns whether or not the window is user resizeable.
char * uiWindowTitle(uiWindow *w)
Returns the window title.
void uiWindowSetTitle(uiWindow *w, const char *title)
Sets the window title.
void uiWindowSetChild(uiWindow *w, uiControl *child)
Sets the window's child.
void uiWindowSetFullscreen(uiWindow *w, int fullscreen)
Sets whether or not the window is full screen.
void uiWindowSetPosition(uiWindow *w, int x, int y)
Moves the window to the specified position.
void uiWindowOnPositionChanged(uiWindow *w, void(*f)(uiWindow *sender, void *senderData), void *data)
Registers a callback for when the window moved.
void uiWindowContentSize(uiWindow *w, int *width, int *height)
Gets the window content size.
void uiWindowOnFocusChanged(uiWindow *w, void(*f)(uiWindow *sender, void *senderData), void *data)
Registers a callback for when the window focus changes.
void uiWindowSetMargined(uiWindow *w, int margined)
Sets whether or not the window has a margin.
uiWindow * uiNewWindow(const char *title, int width, int height, int hasMenubar)
Creates a new uiWindow.
void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)
uiAttribute * uiNewUnderlineAttribute(uiUnderline u)
void uiFreeAttributedString(uiAttributedString *s)
uiWindowResizeEdge
Definition: ui.h:2061
@ uiWindowResizeEdgeTop
Definition: ui.h:2063
@ uiWindowResizeEdgeBottom
Definition: ui.h:2065
@ uiWindowResizeEdgeBottomLeft
Definition: ui.h:2068
@ uiWindowResizeEdgeLeft
Definition: ui.h:2062
@ uiWindowResizeEdgeRight
Definition: ui.h:2064
@ uiWindowResizeEdgeTopLeft
Definition: ui.h:2066
@ uiWindowResizeEdgeBottomRight
Definition: ui.h:2069
@ uiWindowResizeEdgeTopRight
Definition: ui.h:2067
const uiOpenTypeFeatures * uiAttributeFeatures(const uiAttribute *a)
uiTableValueType
uiTableValue types.
Definition: ui.h:3288
@ uiTableValueTypeImage
Definition: ui.h:3290
@ uiTableValueTypeInt
Definition: ui.h:3291
@ uiTableValueTypeColor
Definition: ui.h:3292
@ uiTableValueTypeString
Definition: ui.h:3289
uiOpenTypeFeatures * uiNewOpenTypeFeatures(void)
#define _UI_ENUM(s)
Definition: ui.h:44
void uiDrawSave(uiDrawContext *c)
void uiDrawFreeTextLayout(uiDrawTextLayout *tl)
void uiOpenTypeFeaturesForEach(const uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEachFunc f, void *data)
uiAttributedString * uiNewAttributedString(const char *initialString)
uiAt
Placement specifier to define placement in relation to another control.
Definition: ui.h:3058
@ uiAtTop
Place above control.
Definition: ui.h:3060
@ uiAtLeading
Place before control.
Definition: ui.h:3059
@ uiAtBottom
Place below control.
Definition: ui.h:3062
@ uiAtTrailing
Place behind control.
Definition: ui.h:3061
void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)
struct uiAttributedString uiAttributedString
Definition: ui.h:2583
uiAttribute * uiNewSizeAttribute(double size)
void uiLoadControlFont(uiFontDescriptor *f)
const char * uiInit(uiInitOptions *options)
void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height)
size_t uiAttributedStringByteIndexToGrapheme(uiAttributedString *s, size_t pos)
size_t uiAttributedStringGraphemeToByteIndex(uiAttributedString *s, size_t pos)
uiForEach(* uiAttributedStringForEachAttributeFunc)(const uiAttributedString *s, const uiAttribute *a, size_t start, size_t end, void *data)
Definition: ui.h:2589
void uiMainSteps(void)
void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end)
void uiDrawFill(uiDrawContext *c, uiDrawPath *path, uiDrawBrush *b)
uiArea * uiNewScrollingArea(uiAreaHandler *ah, int width, int height)
void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha)
uiTextItalic
Definition: ui.h:2352
@ uiTextItalicOblique
Definition: ui.h:2354
@ uiTextItalicItalic
Definition: ui.h:2355
@ uiTextItalicNormal
Definition: ui.h:2353
void uiDrawPathLineTo(uiDrawPath *p, double x, double y)
void uiDrawFreePath(uiDrawPath *p)
uiModifiers
Keyboard modifier keys.
Definition: ui.h:2812
@ uiModifierAlt
Alternate/Option key.
Definition: ui.h:2814
@ uiModifierSuper
Super/Command/Windows key.
Definition: ui.h:2816
@ uiModifierShift
Shift key.
Definition: ui.h:2815
@ uiModifierCtrl
Control key.
Definition: ui.h:2813
void uiFreeText(char *text)
Free the memory of a returned string.
void uiAttributeUnderlineColor(const uiAttribute *a, uiUnderlineColor *u, double *r, double *g, double *b, double *alpha)
uiOpenTypeFeatures * uiOpenTypeFeaturesClone(const uiOpenTypeFeatures *otf)
void uiTimer(int milliseconds, int(*f)(void *data), void *data)
void uiMain(void)
uiDrawTextAlign
Definition: ui.h:2687
@ uiDrawTextAlignCenter
Definition: ui.h:2689
@ uiDrawTextAlignLeft
Definition: ui.h:2688
@ uiDrawTextAlignRight
Definition: ui.h:2690
void uiFreeInitError(const char *err)
uiForEach(* uiOpenTypeFeaturesForEachFunc)(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value, void *data)
Definition: ui.h:2490
struct uiAttribute uiAttribute
Definition: ui.h:2258
int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
struct uiDrawPath uiDrawPath
Definition: ui.h:2105
uiDrawTextLayout * uiDrawNewTextLayout(uiDrawTextLayoutParams *params)
uiAttributeType uiAttributeGetType(const uiAttribute *a)
uiTextWeight
Definition: ui.h:2321
@ uiTextWeightMaximum
Definition: ui.h:2334
@ uiTextWeightNormal
Definition: ui.h:2327
@ uiTextWeightBook
Definition: ui.h:2326
@ uiTextWeightMedium
Definition: ui.h:2328
@ uiTextWeightUltraLight
Definition: ui.h:2324
@ uiTextWeightBold
Definition: ui.h:2330
@ uiTextWeightUltraBold
Definition: ui.h:2331
@ uiTextWeightSemiBold
Definition: ui.h:2329
@ uiTextWeightUltraHeavy
Definition: ui.h:2333
@ uiTextWeightLight
Definition: ui.h:2325
@ uiTextWeightThin
Definition: ui.h:2323
@ uiTextWeightMinimum
Definition: ui.h:2322
@ uiTextWeightHeavy
Definition: ui.h:2332
struct uiDrawContext uiDrawContext
Definition: ui.h:2046
int uiDrawMatrixInvertible(uiDrawMatrix *m)
void uiQuit(void)
void uiAreaQueueRedrawAll(uiArea *a)
uiAttribute * uiNewFamilyAttribute(const char *family)
void uiUninit(void)
uiTextStretch uiAttributeStretch(const uiAttribute *a)
void uiAttributedStringAppendUnattributed(uiAttributedString *s, const char *str)
uiAttribute * uiNewColorAttribute(double r, double g, double b, double a)
void uiDrawMatrixTranslate(uiDrawMatrix *m, double x, double y)
const char * uiAttributedStringString(const uiAttributedString *s)
void uiDrawPathEnd(uiDrawPath *p)
void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y)
void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d)
void uiAttributedStringInsertAtUnattributed(uiAttributedString *s, const char *str, size_t at)
uiAttribute * uiNewFeaturesAttribute(const uiOpenTypeFeatures *otf)
void uiDrawClip(uiDrawContext *c, uiDrawPath *path)
uiUnderline uiAttributeUnderline(const uiAttribute *a)
void uiQueueMain(void(*f)(void *data), void *data)
uiTextWeight uiAttributeWeight(const uiAttribute *a)
double uiAttributeSize(const uiAttribute *a)
void uiDrawTransform(uiDrawContext *c, uiDrawMatrix *m)
uiAttribute * uiNewWeightAttribute(uiTextWeight weight)
uiAttribute * uiNewBackgroundAttribute(double r, double g, double b, double a)
uiAttributeType
Definition: ui.h:2271
@ uiAttributeTypeUnderline
Definition: ui.h:2279
@ uiAttributeTypeBackground
Definition: ui.h:2278
@ uiAttributeTypeFamily
Definition: ui.h:2272
@ uiAttributeTypeItalic
Definition: ui.h:2275
@ uiAttributeTypeColor
Definition: ui.h:2277
@ uiAttributeTypeUnderlineColor
Definition: ui.h:2280
@ uiAttributeTypeStretch
Definition: ui.h:2276
@ uiAttributeTypeSize
Definition: ui.h:2273
@ uiAttributeTypeFeatures
Definition: ui.h:2281
@ uiAttributeTypeWeight
Definition: ui.h:2274
void uiAreaBeginUserWindowMove(uiArea *a)
uiUnderline
Definition: ui.h:2416
@ uiUnderlineSuggestion
Definition: ui.h:2420
@ uiUnderlineSingle
Definition: ui.h:2418
@ uiUnderlineDouble
Definition: ui.h:2419
@ uiUnderlineNone
Definition: ui.h:2417
uiExtKey
Definition: ui.h:2839
@ uiExtKeyF8
Definition: ui.h:2858
@ uiExtKeyNSubtract
Definition: ui.h:2876
@ uiExtKeyF5
Definition: ui.h:2855
@ uiExtKeyF3
Definition: ui.h:2853
@ uiExtKeyN3
Definition: ui.h:2866
@ uiExtKeyPageUp
Definition: ui.h:2845
@ uiExtKeyF12
Definition: ui.h:2862
@ uiExtKeyF4
Definition: ui.h:2854
@ uiExtKeyRight
Definition: ui.h:2850
@ uiExtKeyNDot
Definition: ui.h:2873
@ uiExtKeyDelete
Definition: ui.h:2842
@ uiExtKeyNAdd
Definition: ui.h:2875
@ uiExtKeyN6
Definition: ui.h:2869
@ uiExtKeyNEnter
Definition: ui.h:2874
@ uiExtKeyDown
Definition: ui.h:2848
@ uiExtKeyF10
Definition: ui.h:2860
@ uiExtKeyN8
Definition: ui.h:2871
@ uiExtKeyN4
Definition: ui.h:2867
@ uiExtKeyInsert
Definition: ui.h:2841
@ uiExtKeyN0
Definition: ui.h:2863
@ uiExtKeyN5
Definition: ui.h:2868
@ uiExtKeyN1
Definition: ui.h:2864
@ uiExtKeyF11
Definition: ui.h:2861
@ uiExtKeyF1
Definition: ui.h:2851
@ uiExtKeyF2
Definition: ui.h:2852
@ uiExtKeyF6
Definition: ui.h:2856
@ uiExtKeyLeft
Definition: ui.h:2849
@ uiExtKeyUp
Definition: ui.h:2847
@ uiExtKeyEscape
Definition: ui.h:2840
@ uiExtKeyF7
Definition: ui.h:2857
@ uiExtKeyN7
Definition: ui.h:2870
@ uiExtKeyNDivide
Definition: ui.h:2878
@ uiExtKeyEnd
Definition: ui.h:2844
@ uiExtKeyN2
Definition: ui.h:2865
@ uiExtKeyHome
Definition: ui.h:2843
@ uiExtKeyF9
Definition: ui.h:2859
@ uiExtKeyPageDown
Definition: ui.h:2846
@ uiExtKeyN9
Definition: ui.h:2872
@ uiExtKeyNMultiply
Definition: ui.h:2877
#define _UI_EXTERN
Definition: ui.h:39
uiForEach
Definition: ui.h:53
@ uiForEachStop
Definition: ui.h:55
@ uiForEachContinue
Definition: ui.h:54
void uiAreaBeginUserWindowResize(uiArea *a, uiWindowResizeEdge edge)
void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height)
size_t uiAttributedStringLen(const uiAttributedString *s)
uiDrawPath * uiDrawNewPath(uiDrawFillMode fillMode)
uiAttribute * uiNewUnderlineColorAttribute(uiUnderlineColor u, double r, double g, double b, double a)
int uiDrawPathEnded(uiDrawPath *p)
void uiDrawPathNewFigure(uiDrawPath *p, double x, double y)
void uiDrawStroke(uiDrawContext *c, uiDrawPath *path, uiDrawBrush *b, uiDrawStrokeParams *p)
size_t uiAttributedStringNumGraphemes(uiAttributedString *s)
uiDrawLineJoin
Definition: ui.h:2125
@ uiDrawLineJoinRound
Definition: ui.h:2127
@ uiDrawLineJoinMiter
Definition: ui.h:2126
@ uiDrawLineJoinBevel
Definition: ui.h:2128
void uiFreeFontDescriptor(uiFontDescriptor *desc)
const char * uiAttributeFamily(const uiAttribute *a)
void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)
uiDrawFillMode
Definition: ui.h:2136
@ uiDrawFillModeWinding
Definition: ui.h:2137
@ uiDrawFillModeAlternate
Definition: ui.h:2138
uiDrawLineCap
Definition: ui.h:2119
@ uiDrawLineCapRound
Definition: ui.h:2121
@ uiDrawLineCapFlat
Definition: ui.h:2120
@ uiDrawLineCapSquare
Definition: ui.h:2122
void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)
void uiDrawMatrixTransformSize(uiDrawMatrix *m, double *x, double *y)
void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf)
uiTextItalic uiAttributeItalic(const uiAttribute *a)
void uiDrawMatrixSetIdentity(uiDrawMatrix *m)
void uiAreaSetSize(uiArea *a, int width, int height)
void uiDrawPathCloseFigure(uiDrawPath *p)
struct uiOpenTypeFeatures uiOpenTypeFeatures
Definition: ui.h:2484
void uiAttributedStringSetAttribute(uiAttributedString *s, uiAttribute *a, size_t start, size_t end)
struct uiArea uiArea
Definition: ui.h:2040
void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
uiAttribute * uiNewItalicAttribute(uiTextItalic italic)
int uiDrawMatrixInvert(uiDrawMatrix *m)
void uiUserBugCannotSetParentOnToplevel(const char *type)
struct uiDrawTextLayout uiDrawTextLayout
Definition: ui.h:2682
uiUnderlineColor
Definition: ui.h:2444
@ uiUnderlineColorCustom
Definition: ui.h:2445
@ uiUnderlineColorAuxiliary
Definition: ui.h:2448
@ uiUnderlineColorGrammar
Definition: ui.h:2447
@ uiUnderlineColorSpelling
Definition: ui.h:2446
void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height)
void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x, double y)
uiAlign
Alignment specifiers to define placement within the reserved area.
Definition: ui.h:3045
@ uiAlignStart
Place at start.
Definition: ui.h:3047
@ uiAlignEnd
Place at end.
Definition: ui.h:3049
@ uiAlignFill
Fill area.
Definition: ui.h:3046
@ uiAlignCenter
Place in center.
Definition: ui.h:3048
uiDrawBrushType
Definition: ui.h:2112
@ uiDrawBrushTypeImage
Definition: ui.h:2116
@ uiDrawBrushTypeSolid
Definition: ui.h:2113
@ uiDrawBrushTypeLinearGradient
Definition: ui.h:2114
@ uiDrawBrushTypeRadialGradient
Definition: ui.h:2115
void uiOnShouldQuit(int(*f)(void *data), void *data)
uiArea * uiNewArea(uiAreaHandler *ah)
void uiDrawRestore(uiDrawContext *c)
void uiDrawMatrixTransformPoint(uiDrawMatrix *m, double *x, double *y)
void uiAttributedStringForEachAttribute(const uiAttributedString *s, uiAttributedStringForEachAttributeFunc f, void *data)
void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, double c2y, double endX, double endY)
uiTextStretch
Definition: ui.h:2378
@ uiTextStretchSemiCondensed
Definition: ui.h:2382
@ uiTextStretchExpanded
Definition: ui.h:2385
@ uiTextStretchExtraExpanded
Definition: ui.h:2386
@ uiTextStretchUltraExpanded
Definition: ui.h:2387
@ uiTextStretchExtraCondensed
Definition: ui.h:2380
@ uiTextStretchCondensed
Definition: ui.h:2381
@ uiTextStretchSemiExpanded
Definition: ui.h:2384
@ uiTextStretchNormal
Definition: ui.h:2383
@ uiTextStretchUltraCondensed
Definition: ui.h:2379
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
void uiFreeAttribute(uiAttribute *a)
uiAttribute * uiNewStretchAttribute(uiTextStretch stretch)
int uiMainStep(int wait)
@ uiTableSelectionModeZeroOrMany
Allow zero or many (multiple) rows to be selected.
Definition: ui.h:3959
@ uiTableSelectionModeZeroOrOne
Allow zero or one row to be selected.
Definition: ui.h:3957
@ uiTableSelectionModeNone
Allow no row selection.
Definition: ui.h:3956
@ uiTableSelectionModeOne
Allow for exactly one row to be selected.
Definition: ui.h:3958
@ uiSortIndicatorNone
Definition: ui.h:3419
@ uiSortIndicatorDescending
Definition: ui.h:3421
@ uiSortIndicatorAscending
Definition: ui.h:3420