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// TODO add argument names to all arguments
122#define uiControl(this) ((uiControl *) (this))
123
140
156 void (*f)(uiControl *c, void *data), void *data);
157
166
175
185
194
203
211
220
231
239
247
257_UI_EXTERN uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr);
258
268
278
291
292// TODO Move this to private API? According to old/new.md this should be used by toplevel controls.
294
295
311typedef struct uiWindow uiWindow;
312#define uiWindow(this) ((uiWindow *) (this))
313
324
335_UI_EXTERN void uiWindowSetTitle(uiWindow *w, const char *title);
336
348_UI_EXTERN void uiWindowPosition(uiWindow *w, int *x, int *y);
349
362
377 void (*f)(uiWindow *sender, void *senderData), void *data);
378
388_UI_EXTERN void uiWindowContentSize(uiWindow *w, int *width, int *height);
389
400_UI_EXTERN void uiWindowSetContentSize(uiWindow *w, int width, int height);
401
410
420
435 void (*f)(uiWindow *sender, void *senderData), void *data);
436
453 int (*f)(uiWindow *sender, void *senderData), void *data);
454
468 void (*f)(uiWindow *sender, void *senderData), void *data);
469
478
487
497
506
515
526
535
545
558_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar);
559
560
568typedef struct uiButton uiButton;
569#define uiButton(this) ((uiButton *) (this))
570
581
591_UI_EXTERN void uiButtonSetText(uiButton *b, const char *text);
592
606 void (*f)(uiButton *sender, void *senderData), void *data);
607
617_UI_EXTERN uiButton *uiNewButton(const char *text);
618
619
630typedef struct uiBox uiBox;
631#define uiBox(this) ((uiBox *) (this))
632
644_UI_EXTERN void uiBoxAppend(uiBox *b, uiControl *child, int stretchy);
645
654
663_UI_EXTERN void uiBoxDelete(uiBox *b, int index);
664
675
686_UI_EXTERN void uiBoxSetPadded(uiBox *b, int padded);
687
697
707
708
716typedef struct uiCheckbox uiCheckbox;
717#define uiCheckbox(this) ((uiCheckbox *) (this))
718
729
739_UI_EXTERN void uiCheckboxSetText(uiCheckbox *c, const char *text);
740
755 void (*f)(uiCheckbox *sender, void *senderData), void *data);
756
765
774
785
786
794typedef struct uiEntry uiEntry;
795#define uiEntry(this) ((uiEntry *) (this))
796
807
817_UI_EXTERN void uiEntrySetText(uiEntry *e, const char *text);
818
832 void (*f)(uiEntry *sender, void *senderData), void *data);
833
842
850_UI_EXTERN void uiEntrySetReadOnly(uiEntry *e, int readonly);
851
859
869
880
881
889typedef struct uiLabel uiLabel;
890#define uiLabel(this) ((uiLabel *) (this))
891
902
912_UI_EXTERN void uiLabelSetText(uiLabel *l, const char *text);
913
923_UI_EXTERN uiLabel *uiNewLabel(const char *text);
924
925
936typedef struct uiTab uiTab;
937#define uiTab(this) ((uiTab *) (this))
938
947
958
973 void (*f)(uiTab *sender, void *senderData), void *data);
974
985_UI_EXTERN void uiTabAppend(uiTab *t, const char *name, uiControl *c);
986
998_UI_EXTERN void uiTabInsertAt(uiTab *t, const char *name, int index, uiControl *c);
999
1008_UI_EXTERN void uiTabDelete(uiTab *t, int index);
1009
1018
1027_UI_EXTERN int uiTabMargined(uiTab *t, int index);
1028
1039_UI_EXTERN void uiTabSetMargined(uiTab *t, int index, int margined);
1040
1048
1049
1063typedef struct uiGroup uiGroup;
1064#define uiGroup(this) ((uiGroup *) (this))
1065
1076
1086_UI_EXTERN void uiGroupSetTitle(uiGroup *g, const char *title);
1087
1096
1105
1116
1126_UI_EXTERN uiGroup *uiNewGroup(const char *title);
1127
1128
1144typedef struct uiSpinbox uiSpinbox;
1145#define uiSpinbox(this) ((uiSpinbox *) (this))
1146
1155
1165
1180 void (*f)(uiSpinbox *sender, void *senderData), void *data);
1181
1197
1198
1213typedef struct uiSlider uiSlider;
1214#define uiSlider(this) ((uiSlider *) (this))
1215
1224
1233
1242
1251
1266 void (*f)(uiSlider *sender, void *senderData), void *data);
1267
1281 void (*f)(uiSlider *sender, void *senderData), void *data);
1282
1294_UI_EXTERN void uiSliderSetRange(uiSlider *s, int min, int max);
1295
1311
1312
1323#define uiProgressBar(this) ((uiProgressBar *) (this))
1324
1333
1348
1356
1357
1366#define uiSeparator(this) ((uiSeparator *) (this))
1367
1375
1383
1384
1393typedef struct uiCombobox uiCombobox;
1394#define uiCombobox(this) ((uiCombobox *) (this))
1395
1405_UI_EXTERN void uiComboboxAppend(uiCombobox *c, const char *text);
1406
1417_UI_EXTERN void uiComboboxInsertAt(uiCombobox *c, int index, const char *text);
1418
1430
1438
1447
1456
1465
1481 void (*f)(uiCombobox *sender, void *senderData), void *data);
1482
1490
1491
1505#define uiEditableCombobox(this) ((uiEditableCombobox *) (this))
1506
1517
1531
1542
1543// TODO what do we call a function that sets the currently selected item and fills the text field with it?
1544// editable comboboxes have no consistent concept of selected item
1545
1560 void (*f)(uiEditableCombobox *sender, void *senderData), void *data);
1561
1569
1570
1579#define uiRadioButtons(this) ((uiRadioButtons *) (this))
1580
1591
1600
1609
1624 void (*f)(uiRadioButtons *sender, void *senderData), void *data);
1625
1633
1634struct tm;
1652#define uiDateTimePicker(this) ((uiDateTimePicker *) (this))
1653
1663
1674
1689 void (*f)(uiDateTimePicker *sender, void *senderData), void *data);
1690
1698
1706
1714
1715
1725#define uiMultilineEntry(this) ((uiMultilineEntry *) (this))
1726
1737
1748
1759
1775 void (*f)(uiMultilineEntry *sender, void *senderData), void *data);
1776
1785
1794
1802
1812
1813
1820typedef struct uiMenuItem uiMenuItem;
1821#define uiMenuItem(this) ((uiMenuItem *) (this))
1822
1830
1840
1855 void (*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data);
1856
1867
1878
1907typedef struct uiMenu uiMenu;
1908#define uiMenu(this) ((uiMenu *) (this))
1909
1921
1933
1943
1953
1963
1971
1983_UI_EXTERN uiMenu *uiNewMenu(const char *name);
1984
1985
1998
2011
2027
2042_UI_EXTERN void uiMsgBox(uiWindow *parent, const char *title, const char *description);
2043
2059_UI_EXTERN void uiMsgBoxError(uiWindow *parent, const char *title, const char *description);
2060
2067typedef struct uiArea uiArea;
2072
2074
2077 // Resizing causes a full redraw for non-scrolling areas; redraw behavior
2078 // for scrolling areas is implementation-defined.
2080 // TODO document that on first show if the mouse is already in the uiArea then one gets sent with left=0
2081 // TODO what about when the area is hidden and then shown again?
2082 void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left);
2085};
2086
2087// TODO RTL layouts?
2088// TODO reconcile edge and corner naming
2098 // TODO have one for keyboard resizes?
2099 // GDK doesn't seem to have any others, including for keyboards.
2100 // TODO way to bring up the system menu instead?
2101};
2102
2103#define uiArea(this) ((uiArea *) (this))
2104
2114_UI_EXTERN void uiAreaSetSize(uiArea *a, int width, int height);
2115
2123
2139_UI_EXTERN void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height);
2140// These functions can only be called within MouseEvent callbacks with Down != 0.
2141// TODO should these be allowed on scrolling areas?
2142// TODO what happens to events after calling this up to and including the next mouse up?
2147
2150
2151 // These fields are only defined for non-scrolling areas.
2154
2155 double ClipX;
2156 double ClipY;
2159};
2160
2161typedef struct uiDrawPath uiDrawPath;
2165
2167
2173};
2174
2179};
2180
2185};
2186
2187// this is the default for botoh cairo and Direct2D (in the latter case, from the C++ helper functions)
2188// Core Graphics doesn't explicitly specify a default, but NSBezierPath allows you to choose one, and this is the initial value
2189// so we're good to use it too!
2190#define uiDrawDefaultMiterLimit 10.0
2191
2195};
2196
2198 double M11;
2199 double M12;
2200 double M21;
2201 double M22;
2202 double M31;
2203 double M32;
2204};
2205
2208
2209 // solid brushes
2210 double R;
2211 double G;
2212 double B;
2213 double A;
2214
2215 // gradient brushes
2216 double X0; // linear: start X, radial: start X
2217 double Y0; // linear: start Y, radial: start Y
2218 double X1; // linear: end X, radial: outer circle center X
2219 double Y1; // linear: end Y, radial: outer circle center Y
2220 double OuterRadius; // radial gradients only
2222 size_t NumStops;
2223 // TODO extend mode
2224 // cairo: none, repeat, reflect, pad; no individual control
2225 // Direct2D: repeat, reflect, pad; no individual control
2226 // Core Graphics: none, pad; before and after individually
2227 // TODO cairo documentation is inconsistent about pad
2228
2229 // TODO images
2230
2231 // TODO transforms
2232};
2233
2235 double Pos;
2236 double R;
2237 double G;
2238 double B;
2239 double A;
2240};
2241
2245 // must be greater than 0
2248 // must not be NULL if NumDashes is greater than 0
2249 double *Dashes;
2250 // TODO what if this is 1 on Direct2D?
2251 // TODO what if a dash is 0 on Cairo or Quartz?
2254};
2255
2258
2259_UI_EXTERN void uiDrawPathNewFigure(uiDrawPath *p, double x, double y);
2260_UI_EXTERN void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2261_UI_EXTERN void uiDrawPathLineTo(uiDrawPath *p, double x, double y);
2262// notes: angles are both relative to 0 and go counterclockwise
2263// TODO is the initial line segment on cairo and OS X a proper join?
2264// TODO what if sweep < 0?
2265_UI_EXTERN void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2266_UI_EXTERN void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, double c2y, double endX, double endY);
2267// TODO quadratic bezier
2269
2270// TODO effect of these when a figure is already started
2271_UI_EXTERN void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height);
2272
2275
2278
2279// TODO primitives:
2280// - rounded rectangles
2281// - elliptical arcs
2282// - quadratic bezier curves
2283
2285_UI_EXTERN void uiDrawMatrixTranslate(uiDrawMatrix *m, double x, double y);
2286_UI_EXTERN void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x, double y);
2287_UI_EXTERN void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount);
2288_UI_EXTERN void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount);
2294
2296
2297// TODO add a uiDrawPathStrokeToFill() or something like that
2299
2302
2303// uiAttribute stores information about an attribute in a
2304// uiAttributedString.
2305//
2306// You do not create uiAttributes directly; instead, you create a
2307// uiAttribute of a given type using the specialized constructor
2308// functions. For every Unicode codepoint in the uiAttributedString,
2309// at most one value of each attribute type can be applied.
2310//
2311// uiAttributes are immutable and the uiAttributedString takes
2312// ownership of the uiAttribute object once assigned, copying its
2313// contents as necessary.
2314// TODO define whether all this, for both uiTableValue and uiAttribute, is undefined behavior or a caught error
2316
2317// @role uiAttribute destructor
2318// uiFreeAttribute() frees a uiAttribute. You generally do not need to
2319// call this yourself, as uiAttributedString does this for you. In fact,
2320// it is an error to call this function on a uiAttribute that has been
2321// given to a uiAttributedString. You can call this, however, if you
2322// created a uiAttribute that you aren't going to use later.
2324
2325// uiAttributeType holds the possible uiAttribute types that may be
2326// returned by uiAttributeGetType(). Refer to the documentation for
2327// each type's constructor function for details on each type.
2339};
2340
2341// uiAttributeGetType() returns the type of a.
2342// TODO I don't like this name
2344
2345// uiNewFamilyAttribute() creates a new uiAttribute that changes the
2346// font family of the text it is applied to. family is copied; you do not
2347// need to keep it alive after uiNewFamilyAttribute() returns. Font
2348// family names are case-insensitive.
2350
2351// uiAttributeFamily() returns the font family stored in a. The
2352// returned string is owned by a. It is an error to call this on a
2353// uiAttribute that does not hold a font family.
2355
2356// uiNewSizeAttribute() creates a new uiAttribute that changes the
2357// size of the text it is applied to, in typographical points.
2359
2360// uiAttributeSize() returns the font size stored in a. It is an error to
2361// call this on a uiAttribute that does not hold a font size.
2363
2364// uiTextWeight represents possible text weights. These roughly
2365// map to the OS/2 text weight field of TrueType and OpenType
2366// fonts, or to CSS weight numbers. The named constants are
2367// nominal values; the actual values may vary by font and by OS,
2368// though this isn't particularly likely. Any value between
2369// uiTextWeightMinimum and uiTextWeightMaximum, inclusive,
2370// is allowed.
2371//
2372// Note that due to restrictions in early versions of Windows, some
2373// fonts have "special" weights be exposed in many programs as
2374// separate font families. This is perhaps most notable with
2375// Arial Black. libui does not do this, even on Windows (because the
2376// DirectWrite API libui uses on Windows does not do this); to
2377// specify Arial Black, use family Arial and weight uiTextWeightBlack.
2392};
2393
2394// uiNewWeightAttribute() creates a new uiAttribute that changes the
2395// weight of the text it is applied to. It is an error to specify a weight
2396// outside the range [uiTextWeightMinimum,
2397// uiTextWeightMaximum].
2399
2400// uiAttributeWeight() returns the font weight stored in a. It is an error
2401// to call this on a uiAttribute that does not hold a font weight.
2403
2404// uiTextItalic represents possible italic modes for a font. Italic
2405// represents "true" italics where the slanted glyphs have custom
2406// shapes, whereas oblique represents italics that are merely slanted
2407// versions of the normal glyphs. Most fonts usually have one or the
2408// other.
2413};
2414
2415// uiNewItalicAttribute() creates a new uiAttribute that changes the
2416// italic mode of the text it is applied to. It is an error to specify an
2417// italic mode not specified in uiTextItalic.
2419
2420// uiAttributeItalic() returns the font italic mode stored in a. It is an
2421// error to call this on a uiAttribute that does not hold a font italic
2422// mode.
2424
2425// uiTextStretch represents possible stretches (also called "widths")
2426// of a font.
2427//
2428// Note that due to restrictions in early versions of Windows, some
2429// fonts have "special" stretches be exposed in many programs as
2430// separate font families. This is perhaps most notable with
2431// Arial Condensed. libui does not do this, even on Windows (because
2432// the DirectWrite API libui uses on Windows does not do this); to
2433// specify Arial Condensed, use family Arial and stretch
2434// uiTextStretchCondensed.
2445};
2446
2447// uiNewStretchAttribute() creates a new uiAttribute that changes the
2448// stretch of the text it is applied to. It is an error to specify a strech
2449// not specified in uiTextStretch.
2451
2452// uiAttributeStretch() returns the font stretch stored in a. It is an
2453// error to call this on a uiAttribute that does not hold a font stretch.
2455
2456// uiNewColorAttribute() creates a new uiAttribute that changes the
2457// color of the text it is applied to. It is an error to specify an invalid
2458// color.
2459_UI_EXTERN uiAttribute *uiNewColorAttribute(double r, double g, double b, double a);
2460
2461// uiAttributeColor() returns the text color stored in a. It is an
2462// error to call this on a uiAttribute that does not hold a text color.
2463_UI_EXTERN void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha);
2464
2465// uiNewBackgroundAttribute() creates a new uiAttribute that
2466// changes the background color of the text it is applied to. It is an
2467// error to specify an invalid color.
2468_UI_EXTERN uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a);
2469
2470// TODO reuse uiAttributeColor() for background colors, or make a new function...
2471
2472// uiUnderline specifies a type of underline to use on text.
2477 uiUnderlineSuggestion, // wavy or dotted underlines used for spelling/grammar checkers
2478};
2479
2480// uiNewUnderlineAttribute() creates a new uiAttribute that changes
2481// the type of underline on the text it is applied to. It is an error to
2482// specify an underline type not specified in uiUnderline.
2484
2485// uiAttributeUnderline() returns the underline type stored in a. It is
2486// an error to call this on a uiAttribute that does not hold an underline
2487// style.
2489
2490// uiUnderlineColor specifies the color of any underline on the text it
2491// is applied to, regardless of the type of underline. In addition to
2492// being able to specify a custom color, you can explicitly specify
2493// platform-specific colors for suggestion underlines; to use them
2494// correctly, pair them with uiUnderlineSuggestion (though they can
2495// be used on other types of underline as well).
2496//
2497// If an underline type is applied but no underline color is
2498// specified, the text color is used instead. If an underline color
2499// is specified without an underline type, the underline color
2500// attribute is ignored, but not removed from the uiAttributedString.
2505 uiUnderlineColorAuxiliary, // for instance, the color used by smart replacements on macOS or in Microsoft Office
2506};
2507
2508// uiNewUnderlineColorAttribute() creates a new uiAttribute that
2509// changes the color of the underline on the text it is applied to.
2510// It is an error to specify an underline color not specified in
2511// uiUnderlineColor.
2512//
2513// If the specified color type is uiUnderlineColorCustom, it is an
2514// error to specify an invalid color value. Otherwise, the color values
2515// are ignored and should be specified as zero.
2516_UI_EXTERN uiAttribute *uiNewUnderlineColorAttribute(uiUnderlineColor u, double r, double g, double b, double a);
2517
2518// uiAttributeUnderlineColor() returns the underline color stored in
2519// a. It is an error to call this on a uiAttribute that does not hold an
2520// underline color.
2521_UI_EXTERN void uiAttributeUnderlineColor(const uiAttribute *a, uiUnderlineColor *u, double *r, double *g, double *b, double *alpha);
2522
2523// uiOpenTypeFeatures represents a set of OpenType feature
2524// tag-value pairs, for applying OpenType features to text.
2525// OpenType feature tags are four-character codes defined by
2526// OpenType that cover things from design features like small
2527// caps and swashes to language-specific glyph shapes and
2528// beyond. Each tag may only appear once in any given
2529// uiOpenTypeFeatures instance. Each value is a 32-bit integer,
2530// often used as a Boolean flag, but sometimes as an index to choose
2531// a glyph shape to use.
2532//
2533// If a font does not support a certain feature, that feature will be
2534// ignored. (TODO verify this on all OSs)
2535//
2536// See the OpenType specification at
2537// https://www.microsoft.com/typography/otspec/featuretags.htm
2538// for the complete list of available features, information on specific
2539// features, and how to use them.
2540// TODO invalid features
2542
2543// uiOpenTypeFeaturesForEachFunc is the type of the function
2544// invoked by uiOpenTypeFeaturesForEach() for every OpenType
2545// feature in otf. Refer to that function's documentation for more
2546// details.
2547typedef uiForEach (*uiOpenTypeFeaturesForEachFunc)(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value, void *data);
2548
2549// @role uiOpenTypeFeatures constructor
2550// uiNewOpenTypeFeatures() returns a new uiOpenTypeFeatures
2551// instance, with no tags yet added.
2553
2554// @role uiOpenTypeFeatures destructor
2555// uiFreeOpenTypeFeatures() frees otf.
2557
2558// uiOpenTypeFeaturesClone() makes a copy of otf and returns it.
2559// Changing one will not affect the other.
2561
2562// uiOpenTypeFeaturesAdd() adds the given feature tag and value
2563// to otf. The feature tag is specified by a, b, c, and d. If there is
2564// already a value associated with the specified tag in otf, the old
2565// value is removed.
2566_UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);
2567
2568// uiOpenTypeFeaturesRemove() removes the given feature tag
2569// and value from otf. If the tag is not present in otf,
2570// uiOpenTypeFeaturesRemove() does nothing.
2571_UI_EXTERN void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d);
2572
2573// uiOpenTypeFeaturesGet() determines whether the given feature
2574// tag is present in otf. If it is, *value is set to the tag's value and
2575// nonzero is returned. Otherwise, zero is returned.
2576//
2577// Note that if uiOpenTypeFeaturesGet() returns zero, value isn't
2578// changed. This is important: if a feature is not present in a
2579// uiOpenTypeFeatures, the feature is NOT treated as if its
2580// value was zero anyway. Script-specific font shaping rules and
2581// font-specific feature settings may use a different default value
2582// for a feature. You should likewise not treat a missing feature as
2583// having a value of zero either. Instead, a missing feature should
2584// be treated as having some unspecified default value.
2585_UI_EXTERN int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value);
2586
2587// uiOpenTypeFeaturesForEach() executes f for every tag-value
2588// pair in otf. The enumeration order is unspecified. You cannot
2589// modify otf while uiOpenTypeFeaturesForEach() is running.
2591
2592// uiNewFeaturesAttribute() creates a new uiAttribute that changes
2593// the font family of the text it is applied to. otf is copied; you may
2594// free it after uiNewFeaturesAttribute() returns.
2596
2597// uiAttributeFeatures() returns the OpenType features stored in a.
2598// The returned uiOpenTypeFeatures object is owned by a. It is an
2599// error to call this on a uiAttribute that does not hold OpenType
2600// features.
2602
2603// uiAttributedString represents a string of UTF-8 text that can
2604// optionally be embellished with formatting attributes. libui
2605// provides the list of formatting attributes, which cover common
2606// formatting traits like boldface and color as well as advanced
2607// typographical features provided by OpenType like superscripts
2608// and small caps. These attributes can be combined in a variety of
2609// ways.
2610//
2611// Attributes are applied to runs of Unicode codepoints in the string.
2612// Zero-length runs are elided. Consecutive runs that have the same
2613// attribute type and value are merged. Each attribute is independent
2614// of each other attribute; overlapping attributes of different types
2615// do not split each other apart, but different values of the same
2616// attribute type do.
2617//
2618// The empty string can also be represented by uiAttributedString,
2619// but because of the no-zero-length-attribute rule, it will not have
2620// attributes.
2621//
2622// A uiAttributedString takes ownership of all attributes given to
2623// it, as it may need to duplicate or delete uiAttribute objects at
2624// any time. By extension, when you free a uiAttributedString,
2625// all uiAttributes within will also be freed. Each method will
2626// describe its own rules in more details.
2627//
2628// In addition, uiAttributedString provides facilities for moving
2629// between grapheme clusters, which represent a character
2630// from the point of view of the end user. The cursor of a text editor
2631// is always placed on a grapheme boundary, so you can use these
2632// features to move the cursor left or right by one "character".
2633// TODO does uiAttributedString itself need this
2634//
2635// uiAttributedString does not provide enough information to be able
2636// to draw itself onto a uiDrawContext or respond to user actions.
2637// In order to do that, you'll need to use a uiDrawTextLayout, which
2638// is built from the combination of a uiAttributedString and a set of
2639// layout-specific properties.
2641
2642// uiAttributedStringForEachAttributeFunc is the type of the function
2643// invoked by uiAttributedStringForEachAttribute() for every
2644// attribute in s. Refer to that function's documentation for more
2645// details.
2646typedef uiForEach (*uiAttributedStringForEachAttributeFunc)(const uiAttributedString *s, const uiAttribute *a, size_t start, size_t end, void *data);
2647
2648// @role uiAttributedString constructor
2649// uiNewAttributedString() creates a new uiAttributedString from
2650// initialString. The string will be entirely unattributed.
2652
2653// @role uiAttributedString destructor
2654// uiFreeAttributedString() destroys the uiAttributedString s.
2655// It will also free all uiAttributes within.
2657
2658// uiAttributedStringString() returns the textual content of s as a
2659// '\0'-terminated UTF-8 string. The returned pointer is valid until
2660// the next change to the textual content of s.
2662
2663// uiAttributedStringLength() returns the number of UTF-8 bytes in
2664// the textual content of s, excluding the terminating '\0'.
2666
2667// uiAttributedStringAppendUnattributed() adds the '\0'-terminated
2668// UTF-8 string str to the end of s. The new substring will be
2669// unattributed.
2671
2672// uiAttributedStringInsertAtUnattributed() adds the '\0'-terminated
2673// UTF-8 string str to s at the byte position specified by at. The new
2674// substring will be unattributed; existing attributes will be moved
2675// along with their text.
2677
2678// TODO add the Append and InsertAtExtendingAttributes functions
2679// TODO and add functions that take a string + length
2680
2681// uiAttributedStringDelete() deletes the characters and attributes of
2682// s in the byte range [start, end).
2683_UI_EXTERN void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end);
2684
2685// 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
2686
2687// uiAttributedStringSetAttribute() sets a in the byte range [start, end)
2688// of s. Any existing attributes in that byte range of the same type are
2689// removed. s takes ownership of a; you should not use it after
2690// uiAttributedStringSetAttribute() returns.
2692
2693// uiAttributedStringForEachAttribute() enumerates all the
2694// uiAttributes in s in an unspecified order. It is an error to modify s
2695// in f. Within f, s still owns the attribute; you can neither free it nor
2696// save it for later use.
2697// TODO reword the above for consistency and clarify the intended meaning
2699
2700// TODO const correct this somehow (the implementation needs to mutate the structure)
2702
2703// TODO const correct this somehow (the implementation needs to mutate the structure)
2705
2706// TODO const correct this somehow (the implementation needs to mutate the structure)
2708
2709// uiFontDescriptor provides a complete description of a font where
2710// one is needed. Currently, this means as the default font of a
2711// uiDrawTextLayout and as the data returned by uiFontButton.
2712// All the members operate like the respective uiAttributes.
2714
2716 // TODO const-correct this or figure out how to deal with this when getting a value
2717 char *Family;
2718 double Size;
2722};
2723
2726
2727// uiDrawTextLayout is a concrete representation of a
2728// uiAttributedString that can be displayed in a uiDrawContext.
2729// It includes information important for the drawing of a block of
2730// text, including the bounding box to wrap the text within, the
2731// alignment of lines of text within that box, areas to mark as
2732// being selected, and other things.
2733//
2734// Unlike uiAttributedString, the content of a uiDrawTextLayout is
2735// immutable once it has been created.
2736//
2737// TODO talk about OS-specific differences with text drawing that libui can't account for...
2739
2740// uiDrawTextAlign specifies the alignment of lines of text in a
2741// uiDrawTextLayout.
2742// TODO should this really have Draw in the name?
2747};
2748
2749// uiDrawTextLayoutParams describes a uiDrawTextLayout.
2750// DefaultFont is used to render any text that is not attributed
2751// sufficiently in String. Width determines the width of the bounding
2752// box of the text; the height is determined automatically.
2754
2755// TODO const-correct this somehow
2759 double Width;
2761};
2762
2763// @role uiDrawTextLayout constructor
2764// uiDrawNewTextLayout() creates a new uiDrawTextLayout from
2765// the given parameters.
2766//
2767// TODO
2768// - allow creating a layout out of a substring
2769// - allow marking compositon strings
2770// - allow marking selections, even after creation
2771// - add the following functions:
2772// - uiDrawTextLayoutHeightForWidth() (returns the height that a layout would need to be to display the entire string at a given width)
2773// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
2774// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
2775// - some function to fix up a range (for text editing)
2777
2778// @role uiDrawFreeTextLayout destructor
2779// uiDrawFreeTextLayout() frees tl. The underlying
2780// uiAttributedString is not freed.
2782
2783// uiDrawText() draws tl in c with the top-left point of tl at (x, y).
2784_UI_EXTERN void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y);
2785
2786// uiDrawTextLayoutExtents() returns the width and height of tl
2787// in width and height. The returned width may be smaller than
2788// the width passed into uiDrawNewTextLayout() depending on
2789// how the text in tl is wrapped. Therefore, you can use this
2790// function to get the actual size of the text layout.
2791_UI_EXTERN void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height);
2792
2793// TODO metrics functions
2794
2795// TODO number of lines visible for clipping rect, range visible for clipping rect?
2796
2797
2809#define uiFontButton(this) ((uiFontButton *) (this))
2810
2821
2835 void (*f)(uiFontButton *sender, void *senderData), void *data);
2836
2846
2860
2870 uiModifierAlt = 1 << 1,
2873};
2874
2875// Mouse input is captured after a button press until all buttons are released.
2876// DragBroken is called if that capture is lost unexpectedly.
2878 // Coordinates in the area's drawing space, including the scroll offset for
2879 // scrolling areas.
2880 double X;
2881 double Y;
2882
2883 // These fields are only defined for non-scrolling areas.
2886
2887 int Down;
2888 int Up;
2889
2891
2893
2894 uint64_t Held1To64;
2895};
2896
2899 uiExtKeyInsert, // equivalent to "Help" on Apple keyboards
2909 uiExtKeyF1, // F1..F12 are guaranteed to be consecutive
2921 uiExtKeyN0, // numpad keys; independent of Num Lock state
2922 uiExtKeyN1, // N0..N9 are guaranteed to be consecutive
2937};
2938
2940 char Key;
2943
2945
2946 int Up;
2947};
2948
2949
2963#define uiColorButton(this) ((uiColorButton *) (this))
2964
2975_UI_EXTERN void uiColorButtonColor(uiColorButton *b, double *r, double *g, double *bl, double *a);
2976
2987_UI_EXTERN void uiColorButtonSetColor(uiColorButton *b, double r, double g, double bl, double a);
2988
3002 void (*f)(uiColorButton *sender, void *senderData), void *data);
3003
3011
3012
3028typedef struct uiForm uiForm;
3029#define uiForm(this) ((uiForm *) (this))
3030
3045_UI_EXTERN void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy);
3046
3054
3063_UI_EXTERN void uiFormDelete(uiForm *f, int index);
3064
3075
3086_UI_EXTERN void uiFormSetPadded(uiForm *f, int padded);
3087
3095
3096
3108};
3109
3121};
3122
3144typedef struct uiGrid uiGrid;
3145#define uiGrid(this) ((uiGrid *) (this))
3146
3162_UI_EXTERN void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3163
3179_UI_EXTERN void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3180
3189
3200
3211_UI_EXTERN void uiGridSetPadded(uiGrid *g, int padded);
3212
3220
3221
3242typedef struct uiImage uiImage;
3243
3257_UI_EXTERN uiImage *uiNewImage(double width, double height);
3258
3268
3284_UI_EXTERN void uiImageAppend(uiImage *i, const void *pixels, int pixelWidth, int pixelHeight, int byteStride);
3285
3335
3350
3363};
3364
3373
3384
3397
3414
3428
3442
3453
3464_UI_EXTERN uiTableValue *uiNewTableValueColor(double r, double g, double b, double a);
3465
3478_UI_EXTERN void uiTableValueColor(const uiTableValue *v, double *r, double *g, double *b, double *a);
3479
3480
3494
3517
3542
3550
3555
3568 uiTableValue *(*CellValue)(uiTableModelHandler *mh, uiTableModel *m, int row, int column);
3569
3583};
3584
3593
3605
3618
3630
3643// TODO reordering/moving
3644
3646#define uiTableModelColumnNeverEditable (-1)
3648#define uiTableModelColumnAlwaysEditable (-2)
3649
3667};
3668
3690};
3691
3713typedef struct uiTable uiTable;
3714#define uiTable(this) ((uiTable *) (this))
3715
3734 const char *name,
3735 int textModelColumn,
3736 int textEditableModelColumn,
3738
3754 const char *name,
3755 int imageModelColumn);
3756
3779 const char *name,
3780 int imageModelColumn,
3781 int textModelColumn,
3782 int textEditableModelColumn,
3784
3801 const char *name,
3802 int checkboxModelColumn,
3803 int checkboxEditableModelColumn);
3804
3829 const char *name,
3830 int checkboxModelColumn,
3831 int checkboxEditableModelColumn,
3832 int textModelColumn,
3833 int textEditableModelColumn,
3835
3852 const char *name,
3853 int progressModelColumn);
3854
3876 const char *name,
3877 int buttonModelColumn,
3878 int buttonClickableModelColumn);
3879
3888
3897
3906
3907
3922 void (*f)(uiTable *t, int row, void *data),
3923 void *data);
3924
3940 void (*f)(uiTable *t, int row, void *data),
3941 void *data);
3942
3956 int column,
3957 uiSortIndicator indicator);
3958
3968
3983 void (*f)(uiTable *sender, int column, void *senderData), void *data);
3984
3994
4012_UI_EXTERN void uiTableColumnSetWidth(uiTable *t, int column, int width);
4013
4037};
4038
4048
4060
4075_UI_EXTERN void uiTableOnSelectionChanged(uiTable *t, void (*f)(uiTable *t, void *data), void *data);
4076
4085{
4087 int *Rows;
4088};
4089
4101
4115
4123
4124#ifdef __cplusplus
4125}
4126#endif
4127
4128#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:4026
uiSortIndicator
Sort indicators.
Definition: ui.h:3489
Definition: ui.h:2148
double AreaWidth
Definition: ui.h:2152
double ClipWidth
Definition: ui.h:2157
double ClipHeight
Definition: ui.h:2158
double AreaHeight
Definition: ui.h:2153
double ClipY
Definition: ui.h:2156
uiDrawContext * Context
Definition: ui.h:2149
double ClipX
Definition: ui.h:2155
Definition: ui.h:2075
void(* DragBroken)(uiAreaHandler *, uiArea *)
Definition: ui.h:2083
int(* KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *)
Definition: ui.h:2084
void(* Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *)
Definition: ui.h:2076
void(* MouseCrossed)(uiAreaHandler *, uiArea *, int left)
Definition: ui.h:2082
void(* MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *)
Definition: ui.h:2079
Custom drawing control that receives drawing and input events through a uiAreaHandler.
void uiAreaQueueRedrawAll(uiArea *a)
Queues the entire area for redraw.
void uiAreaSetSize(uiArea *a, int width, int height)
Changes the size of a scrolling area's drawing space.
void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height)
Scrolls the minimum distance needed to make a rectangle visible.
Definition: ui.h:2939
char Key
Definition: ui.h:2940
int Up
Definition: ui.h:2946
uiExtKey ExtKey
Definition: ui.h:2941
uiModifiers Modifier
Definition: ui.h:2942
uiModifiers Modifiers
Definition: ui.h:2944
Definition: ui.h:2877
int Count
Definition: ui.h:2890
double X
Definition: ui.h:2880
double AreaHeight
Definition: ui.h:2885
int Down
Definition: ui.h:2887
uint64_t Held1To64
Definition: ui.h:2894
int Up
Definition: ui.h:2888
uiModifiers Modifiers
Definition: ui.h:2892
double Y
Definition: ui.h:2881
double AreaWidth
Definition: ui.h:2884
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
void uiControlOnDestroyed(uiControl *c, void(*f)(uiControl *c, void *data), void *data)
Registers a function to be called when the control is destroyed.
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:1634
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:2234
double R
Definition: ui.h:2236
double G
Definition: ui.h:2237
double Pos
Definition: ui.h:2235
double B
Definition: ui.h:2238
double A
Definition: ui.h:2239
Definition: ui.h:2206
double Y1
Definition: ui.h:2219
double B
Definition: ui.h:2212
size_t NumStops
Definition: ui.h:2222
double R
Definition: ui.h:2210
double Y0
Definition: ui.h:2217
double A
Definition: ui.h:2213
uiDrawBrushGradientStop * Stops
Definition: ui.h:2221
double X1
Definition: ui.h:2218
double X0
Definition: ui.h:2216
double OuterRadius
Definition: ui.h:2220
double G
Definition: ui.h:2211
uiDrawBrushType Type
Definition: ui.h:2207
Definition: ui.h:2197
double M32
Definition: ui.h:2203
double M11
Definition: ui.h:2198
double M22
Definition: ui.h:2201
double M31
Definition: ui.h:2202
double M21
Definition: ui.h:2200
double M12
Definition: ui.h:2199
Definition: ui.h:2242
size_t NumDashes
Definition: ui.h:2252
double DashPhase
Definition: ui.h:2253
double * Dashes
Definition: ui.h:2249
double Thickness
Definition: ui.h:2246
double MiterLimit
Definition: ui.h:2247
uiDrawLineJoin Join
Definition: ui.h:2244
uiDrawLineCap Cap
Definition: ui.h:2243
Definition: ui.h:2756
uiAttributedString * String
Definition: ui.h:2757
double Width
Definition: ui.h:2759
uiFontDescriptor * DefaultFont
Definition: ui.h:2758
uiDrawTextAlign Align
Definition: ui.h:2760
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:2715
uiTextItalic Italic
Definition: ui.h:2720
uiTextWeight Weight
Definition: ui.h:2719
char * Family
Definition: ui.h:2717
uiTextStretch Stretch
Definition: ui.h:2721
double Size
Definition: ui.h:2718
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.
void uiGridDelete(uiGrid *g, uiControl *c)
Removes a control from the grid without destroying it.
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.
void uiImageAppend(uiImage *i, const void *pixels, int pixelWidth, int pixelHeight, int byteStride)
Appends a new image representation.
uiImage * uiNewImage(double width, double height)
Creates a new image container.
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:3532
void(* SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const uiTableValue *)
Sets the cell value for (row, column).
Definition: ui.h:3582
int(* NumColumns)(uiTableModelHandler *, uiTableModel *)
Returns the number of columns in the uiTableModel.
Definition: ui.h:3541
uiTableValueType(* ColumnType)(uiTableModelHandler *, uiTableModel *, int column)
Returns the column type in for of a uiTableValueType.
Definition: ui.h:3549
int(* NumRows)(uiTableModelHandler *, uiTableModel *)
Returns the number of rows in the uiTableModel.
Definition: ui.h:3554
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:3676
int RowBackgroundColorModelColumn
uiTableModel column that defines background color for each row,
Definition: ui.h:3689
uiTableModel * Model
Model holding the data to be displayed.
Definition: ui.h:3680
Holds an array of selected row indices for a table.
Definition: ui.h:4085
void uiFreeTableSelection(uiTableSelection *s)
Frees the given uiTableSelection and all it's resources.
int * Rows
Array containing valid row indices, NULL on empty selection.
Definition: ui.h:4087
int NumRows
Non-negative number of selected rows.
Definition: ui.h:4086
Optional parameters to control the appearance of text columns.
Definition: ui.h:3657
int ColorModelColumn
uiTableModel column that defines the text color for each cell.
Definition: ui.h:3666
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:2089
@ uiWindowResizeEdgeTop
Definition: ui.h:2091
@ uiWindowResizeEdgeBottom
Definition: ui.h:2093
@ uiWindowResizeEdgeBottomLeft
Definition: ui.h:2096
@ uiWindowResizeEdgeLeft
Definition: ui.h:2090
@ uiWindowResizeEdgeRight
Definition: ui.h:2092
@ uiWindowResizeEdgeTopLeft
Definition: ui.h:2094
@ uiWindowResizeEdgeBottomRight
Definition: ui.h:2097
@ uiWindowResizeEdgeTopRight
Definition: ui.h:2095
const uiOpenTypeFeatures * uiAttributeFeatures(const uiAttribute *a)
uiTableValueType
uiTableValue types.
Definition: ui.h:3358
@ uiTableValueTypeImage
Definition: ui.h:3360
@ uiTableValueTypeInt
Definition: ui.h:3361
@ uiTableValueTypeColor
Definition: ui.h:3362
@ uiTableValueTypeString
Definition: ui.h:3359
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:3116
@ uiAtTop
Place above control.
Definition: ui.h:3118
@ uiAtLeading
Place before control.
Definition: ui.h:3117
@ uiAtBottom
Place below control.
Definition: ui.h:3120
@ uiAtTrailing
Place behind control.
Definition: ui.h:3119
void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)
struct uiAttributedString uiAttributedString
Definition: ui.h:2640
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:2646
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:2409
@ uiTextItalicOblique
Definition: ui.h:2411
@ uiTextItalicItalic
Definition: ui.h:2412
@ uiTextItalicNormal
Definition: ui.h:2410
void uiDrawPathLineTo(uiDrawPath *p, double x, double y)
void uiDrawFreePath(uiDrawPath *p)
uiModifiers
Keyboard modifier keys.
Definition: ui.h:2868
@ uiModifierAlt
Alternate/Option key.
Definition: ui.h:2870
@ uiModifierSuper
Super/Command/Windows key.
Definition: ui.h:2872
@ uiModifierShift
Shift key.
Definition: ui.h:2871
@ uiModifierCtrl
Control key.
Definition: ui.h:2869
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:2743
@ uiDrawTextAlignCenter
Definition: ui.h:2745
@ uiDrawTextAlignLeft
Definition: ui.h:2744
@ uiDrawTextAlignRight
Definition: ui.h:2746
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:2547
struct uiAttribute uiAttribute
Definition: ui.h:2315
int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
struct uiDrawPath uiDrawPath
Definition: ui.h:2161
uiDrawTextLayout * uiDrawNewTextLayout(uiDrawTextLayoutParams *params)
uiAttributeType uiAttributeGetType(const uiAttribute *a)
uiTextWeight
Definition: ui.h:2378
@ uiTextWeightMaximum
Definition: ui.h:2391
@ uiTextWeightNormal
Definition: ui.h:2384
@ uiTextWeightBook
Definition: ui.h:2383
@ uiTextWeightMedium
Definition: ui.h:2385
@ uiTextWeightUltraLight
Definition: ui.h:2381
@ uiTextWeightBold
Definition: ui.h:2387
@ uiTextWeightUltraBold
Definition: ui.h:2388
@ uiTextWeightSemiBold
Definition: ui.h:2386
@ uiTextWeightUltraHeavy
Definition: ui.h:2390
@ uiTextWeightLight
Definition: ui.h:2382
@ uiTextWeightThin
Definition: ui.h:2380
@ uiTextWeightMinimum
Definition: ui.h:2379
@ uiTextWeightHeavy
Definition: ui.h:2389
struct uiDrawContext uiDrawContext
Definition: ui.h:2073
int uiDrawMatrixInvertible(uiDrawMatrix *m)
void uiQuit(void)
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:2328
@ uiAttributeTypeUnderline
Definition: ui.h:2336
@ uiAttributeTypeBackground
Definition: ui.h:2335
@ uiAttributeTypeFamily
Definition: ui.h:2329
@ uiAttributeTypeItalic
Definition: ui.h:2332
@ uiAttributeTypeColor
Definition: ui.h:2334
@ uiAttributeTypeUnderlineColor
Definition: ui.h:2337
@ uiAttributeTypeStretch
Definition: ui.h:2333
@ uiAttributeTypeSize
Definition: ui.h:2330
@ uiAttributeTypeFeatures
Definition: ui.h:2338
@ uiAttributeTypeWeight
Definition: ui.h:2331
void uiAreaBeginUserWindowMove(uiArea *a)
uiUnderline
Definition: ui.h:2473
@ uiUnderlineSuggestion
Definition: ui.h:2477
@ uiUnderlineSingle
Definition: ui.h:2475
@ uiUnderlineDouble
Definition: ui.h:2476
@ uiUnderlineNone
Definition: ui.h:2474
uiExtKey
Definition: ui.h:2897
@ uiExtKeyF8
Definition: ui.h:2916
@ uiExtKeyNSubtract
Definition: ui.h:2934
@ uiExtKeyF5
Definition: ui.h:2913
@ uiExtKeyF3
Definition: ui.h:2911
@ uiExtKeyN3
Definition: ui.h:2924
@ uiExtKeyPageUp
Definition: ui.h:2903
@ uiExtKeyF12
Definition: ui.h:2920
@ uiExtKeyF4
Definition: ui.h:2912
@ uiExtKeyRight
Definition: ui.h:2908
@ uiExtKeyNDot
Definition: ui.h:2931
@ uiExtKeyDelete
Definition: ui.h:2900
@ uiExtKeyNAdd
Definition: ui.h:2933
@ uiExtKeyN6
Definition: ui.h:2927
@ uiExtKeyNEnter
Definition: ui.h:2932
@ uiExtKeyDown
Definition: ui.h:2906
@ uiExtKeyF10
Definition: ui.h:2918
@ uiExtKeyN8
Definition: ui.h:2929
@ uiExtKeyN4
Definition: ui.h:2925
@ uiExtKeyInsert
Definition: ui.h:2899
@ uiExtKeyN0
Definition: ui.h:2921
@ uiExtKeyN5
Definition: ui.h:2926
@ uiExtKeyN1
Definition: ui.h:2922
@ uiExtKeyF11
Definition: ui.h:2919
@ uiExtKeyF1
Definition: ui.h:2909
@ uiExtKeyF2
Definition: ui.h:2910
@ uiExtKeyF6
Definition: ui.h:2914
@ uiExtKeyLeft
Definition: ui.h:2907
@ uiExtKeyUp
Definition: ui.h:2905
@ uiExtKeyEscape
Definition: ui.h:2898
@ uiExtKeyF7
Definition: ui.h:2915
@ uiExtKeyN7
Definition: ui.h:2928
@ uiExtKeyNDivide
Definition: ui.h:2936
@ uiExtKeyEnd
Definition: ui.h:2902
@ uiExtKeyN2
Definition: ui.h:2923
@ uiExtKeyHome
Definition: ui.h:2901
@ uiExtKeyF9
Definition: ui.h:2917
@ uiExtKeyPageDown
Definition: ui.h:2904
@ uiExtKeyN9
Definition: ui.h:2930
@ uiExtKeyNMultiply
Definition: ui.h:2935
#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:2181
@ uiDrawLineJoinRound
Definition: ui.h:2183
@ uiDrawLineJoinMiter
Definition: ui.h:2182
@ uiDrawLineJoinBevel
Definition: ui.h:2184
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:2192
@ uiDrawFillModeWinding
Definition: ui.h:2193
@ uiDrawFillModeAlternate
Definition: ui.h:2194
uiDrawLineCap
Definition: ui.h:2175
@ uiDrawLineCapRound
Definition: ui.h:2177
@ uiDrawLineCapFlat
Definition: ui.h:2176
@ uiDrawLineCapSquare
Definition: ui.h:2178
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 uiDrawPathCloseFigure(uiDrawPath *p)
struct uiOpenTypeFeatures uiOpenTypeFeatures
Definition: ui.h:2541
void uiAttributedStringSetAttribute(uiAttributedString *s, uiAttribute *a, size_t start, size_t end)
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:2738
uiUnderlineColor
Definition: ui.h:2501
@ uiUnderlineColorCustom
Definition: ui.h:2502
@ uiUnderlineColorAuxiliary
Definition: ui.h:2505
@ uiUnderlineColorGrammar
Definition: ui.h:2504
@ uiUnderlineColorSpelling
Definition: ui.h:2503
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:3103
@ uiAlignStart
Place at start.
Definition: ui.h:3105
@ uiAlignEnd
Place at end.
Definition: ui.h:3107
@ uiAlignFill
Fill area.
Definition: ui.h:3104
@ uiAlignCenter
Place in center.
Definition: ui.h:3106
uiDrawBrushType
Definition: ui.h:2168
@ uiDrawBrushTypeImage
Definition: ui.h:2172
@ uiDrawBrushTypeSolid
Definition: ui.h:2169
@ uiDrawBrushTypeLinearGradient
Definition: ui.h:2170
@ uiDrawBrushTypeRadialGradient
Definition: ui.h:2171
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:2435
@ uiTextStretchSemiCondensed
Definition: ui.h:2439
@ uiTextStretchExpanded
Definition: ui.h:2442
@ uiTextStretchExtraExpanded
Definition: ui.h:2443
@ uiTextStretchUltraExpanded
Definition: ui.h:2444
@ uiTextStretchExtraCondensed
Definition: ui.h:2437
@ uiTextStretchCondensed
Definition: ui.h:2438
@ uiTextStretchSemiExpanded
Definition: ui.h:2441
@ uiTextStretchNormal
Definition: ui.h:2440
@ uiTextStretchUltraCondensed
Definition: ui.h:2436
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:4036
@ uiTableSelectionModeZeroOrOne
Allow zero or one row to be selected.
Definition: ui.h:4034
@ uiTableSelectionModeNone
Allow no row selection.
Definition: ui.h:4033
@ uiTableSelectionModeOne
Allow for exactly one row to be selected.
Definition: ui.h:4035
@ uiSortIndicatorNone
Definition: ui.h:3490
@ uiSortIndicatorDescending
Definition: ui.h:3492
@ uiSortIndicatorAscending
Definition: ui.h:3491