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
69_UI_EXTERN const char *uiVersion(void);
70
71_UI_EXTERN const char *uiInit(uiInitOptions *options);
73_UI_EXTERN void uiFreeInitError(const char *err);
74
75_UI_EXTERN void uiMain(void);
77_UI_EXTERN int uiMainStep(int wait);
78_UI_EXTERN void uiQuit(void);
79
80_UI_EXTERN void uiQueueMain(void (*f)(void *data), void *data);
81
82// uiTimer() must be called on the main UI thread after uiInit() and before uiUninit().
83// milliseconds must be greater than 0, and f must not be NULL.
84// Timer callbacks run on the main UI thread. Return 0 from f to stop the timer;
85// return non-zero to keep it running. uiUninit() cancels any active timers.
86// Timer timing, including granularity and the first tick, is OS-defined.
87// GTK rearms repeating timers at idle priority, allowing pending redraws and
88// queued callbacks to run between ticks. Continuously ready higher-priority
89// sources can delay rearming indefinitely. Missed ticks are not replayed.
90// uiQueueMain() may be called from other threads. To quit from another thread,
91// queue uiQuit() with uiQueueMain() instead of calling uiQuit() directly.
92_UI_EXTERN void uiTimer(int milliseconds, int (*f)(void *data), void *data);
93
94_UI_EXTERN void uiOnShouldQuit(int (*f)(void *data), void *data);
95
96
108_UI_EXTERN void uiFreeText(char *text);
109
110
116typedef struct uiControl uiControl;
117struct uiControl {
118 uint32_t Signature;
119 uint32_t OSSignature;
121 void (*Destroy)(uiControl *);
122 uintptr_t (*Handle)(uiControl *);
123 uiControl *(*Parent)(uiControl *);
127 void (*Show)(uiControl *);
128 void (*Hide)(uiControl *);
130 void (*Enable)(uiControl *);
131 void (*Disable)(uiControl *);
132};
133// TODO add argument names to all arguments
134#define uiControl(this) ((uiControl *) (this))
135
152
168 void (*f)(uiControl *c, void *data), void *data);
169
178
187
197
206
215
223
232
243
251
259
280_UI_EXTERN void uiControlSetMinimumSize(uiControl *c, int width, int height);
281
291_UI_EXTERN uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr);
292
302
312
325
326// TODO Move this to private API? According to old/new.md this should be used by toplevel controls.
328
329
345typedef struct uiWindow uiWindow;
346#define uiWindow(this) ((uiWindow *) (this))
347
358
369_UI_EXTERN void uiWindowSetTitle(uiWindow *w, const char *title);
370
382_UI_EXTERN void uiWindowPosition(uiWindow *w, int *x, int *y);
383
396
411 void (*f)(uiWindow *sender, void *senderData), void *data);
412
422_UI_EXTERN void uiWindowContentSize(uiWindow *w, int *width, int *height);
423
434_UI_EXTERN void uiWindowSetContentSize(uiWindow *w, int width, int height);
435
444
454
469 void (*f)(uiWindow *sender, void *senderData), void *data);
470
487 int (*f)(uiWindow *sender, void *senderData), void *data);
488
502 void (*f)(uiWindow *sender, void *senderData), void *data);
503
512
521
531
540
549
560
569
579
592_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar);
593
594
602typedef struct uiButton uiButton;
603#define uiButton(this) ((uiButton *) (this))
604
615
625_UI_EXTERN void uiButtonSetText(uiButton *b, const char *text);
626
640 void (*f)(uiButton *sender, void *senderData), void *data);
641
651_UI_EXTERN uiButton *uiNewButton(const char *text);
652
653
666typedef struct uiBox uiBox;
667#define uiBox(this) ((uiBox *) (this))
668
680_UI_EXTERN void uiBoxAppend(uiBox *b, uiControl *child, int stretchy);
681
690
699_UI_EXTERN void uiBoxDelete(uiBox *b, int index);
700
711
722_UI_EXTERN void uiBoxSetPadded(uiBox *b, int padded);
723
733
743
744
752typedef struct uiCheckbox uiCheckbox;
753#define uiCheckbox(this) ((uiCheckbox *) (this))
754
765
775_UI_EXTERN void uiCheckboxSetText(uiCheckbox *c, const char *text);
776
791 void (*f)(uiCheckbox *sender, void *senderData), void *data);
792
801
810
821
822
830typedef struct uiEntry uiEntry;
831#define uiEntry(this) ((uiEntry *) (this))
832
843
853_UI_EXTERN void uiEntrySetText(uiEntry *e, const char *text);
854
868 void (*f)(uiEntry *sender, void *senderData), void *data);
869
878
886_UI_EXTERN void uiEntrySetReadOnly(uiEntry *e, int readonly);
887
895
905
916
917
925typedef struct uiLabel uiLabel;
926#define uiLabel(this) ((uiLabel *) (this))
927
938
948_UI_EXTERN void uiLabelSetText(uiLabel *l, const char *text);
949
959_UI_EXTERN uiLabel *uiNewLabel(const char *text);
960
961
972typedef struct uiTab uiTab;
973#define uiTab(this) ((uiTab *) (this))
974
983
994
1009 void (*f)(uiTab *sender, void *senderData), void *data);
1010
1021_UI_EXTERN void uiTabAppend(uiTab *t, const char *name, uiControl *c);
1022
1034_UI_EXTERN void uiTabInsertAt(uiTab *t, const char *name, int index, uiControl *c);
1035
1044_UI_EXTERN void uiTabDelete(uiTab *t, int index);
1045
1054
1063_UI_EXTERN int uiTabMargined(uiTab *t, int index);
1064
1075_UI_EXTERN void uiTabSetMargined(uiTab *t, int index, int margined);
1076
1084
1085
1099typedef struct uiGroup uiGroup;
1100#define uiGroup(this) ((uiGroup *) (this))
1101
1112
1122_UI_EXTERN void uiGroupSetTitle(uiGroup *g, const char *title);
1123
1132
1141
1152
1162_UI_EXTERN uiGroup *uiNewGroup(const char *title);
1163
1164
1180typedef struct uiSpinbox uiSpinbox;
1181#define uiSpinbox(this) ((uiSpinbox *) (this))
1182
1191
1201
1216 void (*f)(uiSpinbox *sender, void *senderData), void *data);
1217
1233
1234
1249typedef struct uiSlider uiSlider;
1250#define uiSlider(this) ((uiSlider *) (this))
1251
1260
1269
1278
1287
1302 void (*f)(uiSlider *sender, void *senderData), void *data);
1303
1317 void (*f)(uiSlider *sender, void *senderData), void *data);
1318
1330_UI_EXTERN void uiSliderSetRange(uiSlider *s, int min, int max);
1331
1347
1348
1359#define uiProgressBar(this) ((uiProgressBar *) (this))
1360
1369
1384
1392
1393
1402#define uiSeparator(this) ((uiSeparator *) (this))
1403
1411
1419
1420
1429typedef struct uiCombobox uiCombobox;
1430#define uiCombobox(this) ((uiCombobox *) (this))
1431
1441_UI_EXTERN void uiComboboxAppend(uiCombobox *c, const char *text);
1442
1453_UI_EXTERN void uiComboboxInsertAt(uiCombobox *c, int index, const char *text);
1454
1466
1474
1483
1492
1501
1517 void (*f)(uiCombobox *sender, void *senderData), void *data);
1518
1526
1527
1541#define uiEditableCombobox(this) ((uiEditableCombobox *) (this))
1542
1553
1567
1578
1579// TODO what do we call a function that sets the currently selected item and fills the text field with it?
1580// editable comboboxes have no consistent concept of selected item
1581
1596 void (*f)(uiEditableCombobox *sender, void *senderData), void *data);
1597
1605
1606
1615#define uiRadioButtons(this) ((uiRadioButtons *) (this))
1616
1627
1636
1645
1660 void (*f)(uiRadioButtons *sender, void *senderData), void *data);
1661
1669
1670struct tm;
1688#define uiDateTimePicker(this) ((uiDateTimePicker *) (this))
1689
1699
1710
1725 void (*f)(uiDateTimePicker *sender, void *senderData), void *data);
1726
1734
1742
1750
1751
1761#define uiMultilineEntry(this) ((uiMultilineEntry *) (this))
1762
1773
1784
1795
1811 void (*f)(uiMultilineEntry *sender, void *senderData), void *data);
1812
1821
1830
1838
1848
1849
1856typedef struct uiMenuItem uiMenuItem;
1857#define uiMenuItem(this) ((uiMenuItem *) (this))
1858
1866
1876
1891 void (*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data);
1892
1903
1914
1943typedef struct uiMenu uiMenu;
1944#define uiMenu(this) ((uiMenu *) (this))
1945
1957
1969
1979
1989
1999
2007
2019_UI_EXTERN uiMenu *uiNewMenu(const char *name);
2020
2021
2034
2047
2063
2078_UI_EXTERN void uiMsgBox(uiWindow *parent, const char *title, const char *description);
2079
2095_UI_EXTERN void uiMsgBoxError(uiWindow *parent, const char *title, const char *description);
2096
2103typedef struct uiArea uiArea;
2108
2110
2113 // Resizing causes a full redraw for non-scrolling areas; redraw behavior
2114 // for scrolling areas is implementation-defined.
2116 // TODO document that on first show if the mouse is already in the uiArea then one gets sent with left=0
2117 // TODO what about when the area is hidden and then shown again?
2118 void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left);
2121};
2122
2123// TODO RTL layouts?
2124// TODO reconcile edge and corner naming
2134 // TODO have one for keyboard resizes?
2135 // GDK doesn't seem to have any others, including for keyboards.
2136 // TODO way to bring up the system menu instead?
2137};
2138
2139#define uiArea(this) ((uiArea *) (this))
2140
2150_UI_EXTERN void uiAreaSetSize(uiArea *a, int width, int height);
2151
2159
2175_UI_EXTERN void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height);
2176// These functions can only be called within MouseEvent callbacks with Down != 0.
2177// TODO should these be allowed on scrolling areas?
2178// TODO what happens to events after calling this up to and including the next mouse up?
2183
2186
2187 // These fields are only defined for non-scrolling areas.
2190
2191 double ClipX;
2192 double ClipY;
2195};
2196
2197typedef struct uiDrawPath uiDrawPath;
2201
2203
2209};
2210
2215};
2216
2221};
2222
2223// this is the default for botoh cairo and Direct2D (in the latter case, from the C++ helper functions)
2224// Core Graphics doesn't explicitly specify a default, but NSBezierPath allows you to choose one, and this is the initial value
2225// so we're good to use it too!
2226#define uiDrawDefaultMiterLimit 10.0
2227
2231};
2232
2234 double M11;
2235 double M12;
2236 double M21;
2237 double M22;
2238 double M31;
2239 double M32;
2240};
2241
2244
2245 // solid brushes
2246 double R;
2247 double G;
2248 double B;
2249 double A;
2250
2251 // gradient brushes
2252 double X0; // linear: start X, radial: start X
2253 double Y0; // linear: start Y, radial: start Y
2254 double X1; // linear: end X, radial: outer circle center X
2255 double Y1; // linear: end Y, radial: outer circle center Y
2256 double OuterRadius; // radial gradients only
2258 size_t NumStops;
2259 // TODO extend mode
2260 // cairo: none, repeat, reflect, pad; no individual control
2261 // Direct2D: repeat, reflect, pad; no individual control
2262 // Core Graphics: none, pad; before and after individually
2263 // TODO cairo documentation is inconsistent about pad
2264
2265 // TODO images
2266
2267 // TODO transforms
2268};
2269
2271 double Pos;
2272 double R;
2273 double G;
2274 double B;
2275 double A;
2276};
2277
2281 // must be greater than 0
2284 // must not be NULL if NumDashes is greater than 0
2285 double *Dashes;
2286 // TODO what if this is 1 on Direct2D?
2287 // TODO what if a dash is 0 on Cairo or Quartz?
2290};
2291
2294
2295_UI_EXTERN void uiDrawPathNewFigure(uiDrawPath *p, double x, double y);
2296_UI_EXTERN void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2297_UI_EXTERN void uiDrawPathLineTo(uiDrawPath *p, double x, double y);
2298// notes: angles are both relative to 0 and go counterclockwise
2299// TODO is the initial line segment on cairo and OS X a proper join?
2300// TODO what if sweep < 0?
2301_UI_EXTERN void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2302_UI_EXTERN void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, double c2y, double endX, double endY);
2303// TODO quadratic bezier
2305
2306// TODO effect of these when a figure is already started
2307_UI_EXTERN void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height);
2308
2311
2314
2315// TODO primitives:
2316// - rounded rectangles
2317// - elliptical arcs
2318// - quadratic bezier curves
2319
2321_UI_EXTERN void uiDrawMatrixTranslate(uiDrawMatrix *m, double x, double y);
2322_UI_EXTERN void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x, double y);
2323_UI_EXTERN void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount);
2324_UI_EXTERN void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount);
2330
2332
2333// TODO add a uiDrawPathStrokeToFill() or something like that
2335
2338
2339// uiAttribute stores information about an attribute in a
2340// uiAttributedString.
2341//
2342// You do not create uiAttributes directly; instead, you create a
2343// uiAttribute of a given type using the specialized constructor
2344// functions. For every Unicode codepoint in the uiAttributedString,
2345// at most one value of each attribute type can be applied.
2346//
2347// uiAttributes are immutable and the uiAttributedString takes
2348// ownership of the uiAttribute object once assigned, copying its
2349// contents as necessary.
2350// TODO define whether all this, for both uiTableValue and uiAttribute, is undefined behavior or a caught error
2352
2353// @role uiAttribute destructor
2354// uiFreeAttribute() frees a uiAttribute. You generally do not need to
2355// call this yourself, as uiAttributedString does this for you. In fact,
2356// it is an error to call this function on a uiAttribute that has been
2357// given to a uiAttributedString. You can call this, however, if you
2358// created a uiAttribute that you aren't going to use later.
2360
2361// uiAttributeType holds the possible uiAttribute types that may be
2362// returned by uiAttributeGetType(). Refer to the documentation for
2363// each type's constructor function for details on each type.
2375};
2376
2377// uiAttributeGetType() returns the type of a.
2378// TODO I don't like this name
2380
2381// uiNewFamilyAttribute() creates a new uiAttribute that changes the
2382// font family of the text it is applied to. family is copied; you do not
2383// need to keep it alive after uiNewFamilyAttribute() returns. Font
2384// family names are case-insensitive.
2386
2387// uiAttributeFamily() returns the font family stored in a. The
2388// returned string is owned by a. It is an error to call this on a
2389// uiAttribute that does not hold a font family.
2391
2392// uiNewSizeAttribute() creates a new uiAttribute that changes the
2393// size of the text it is applied to, in typographical points.
2395
2396// uiAttributeSize() returns the font size stored in a. It is an error to
2397// call this on a uiAttribute that does not hold a font size.
2399
2400// uiTextWeight represents possible text weights. These roughly
2401// map to the OS/2 text weight field of TrueType and OpenType
2402// fonts, or to CSS weight numbers. The named constants are
2403// nominal values; the actual values may vary by font and by OS,
2404// though this isn't particularly likely. Any value between
2405// uiTextWeightMinimum and uiTextWeightMaximum, inclusive,
2406// is allowed.
2407//
2408// Note that due to restrictions in early versions of Windows, some
2409// fonts have "special" weights be exposed in many programs as
2410// separate font families. This is perhaps most notable with
2411// Arial Black. libui does not do this, even on Windows (because the
2412// DirectWrite API libui uses on Windows does not do this); to
2413// specify Arial Black, use family Arial and weight uiTextWeightBlack.
2428};
2429
2430// uiNewWeightAttribute() creates a new uiAttribute that changes the
2431// weight of the text it is applied to. It is an error to specify a weight
2432// outside the range [uiTextWeightMinimum,
2433// uiTextWeightMaximum].
2435
2436// uiAttributeWeight() returns the font weight stored in a. It is an error
2437// to call this on a uiAttribute that does not hold a font weight.
2439
2440// uiTextItalic represents possible italic modes for a font. Italic
2441// represents "true" italics where the slanted glyphs have custom
2442// shapes, whereas oblique represents italics that are merely slanted
2443// versions of the normal glyphs. Most fonts usually have one or the
2444// other.
2449};
2450
2451// uiNewItalicAttribute() creates a new uiAttribute that changes the
2452// italic mode of the text it is applied to. It is an error to specify an
2453// italic mode not specified in uiTextItalic.
2455
2456// uiAttributeItalic() returns the font italic mode stored in a. It is an
2457// error to call this on a uiAttribute that does not hold a font italic
2458// mode.
2460
2461// uiTextStretch represents possible stretches (also called "widths")
2462// of a font.
2463//
2464// Note that due to restrictions in early versions of Windows, some
2465// fonts have "special" stretches be exposed in many programs as
2466// separate font families. This is perhaps most notable with
2467// Arial Condensed. libui does not do this, even on Windows (because
2468// the DirectWrite API libui uses on Windows does not do this); to
2469// specify Arial Condensed, use family Arial and stretch
2470// uiTextStretchCondensed.
2481};
2482
2483// uiNewStretchAttribute() creates a new uiAttribute that changes the
2484// stretch of the text it is applied to. It is an error to specify a strech
2485// not specified in uiTextStretch.
2487
2488// uiAttributeStretch() returns the font stretch stored in a. It is an
2489// error to call this on a uiAttribute that does not hold a font stretch.
2491
2492// uiNewColorAttribute() creates a new uiAttribute that changes the
2493// color of the text it is applied to. It is an error to specify an invalid
2494// color.
2495_UI_EXTERN uiAttribute *uiNewColorAttribute(double r, double g, double b, double a);
2496
2497// uiAttributeColor() returns the text color stored in a. It is an
2498// error to call this on a uiAttribute that does not hold a text color.
2499_UI_EXTERN void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha);
2500
2501// uiNewBackgroundAttribute() creates a new uiAttribute that
2502// changes the background color of the text it is applied to. It is an
2503// error to specify an invalid color.
2504_UI_EXTERN uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a);
2505
2506// TODO reuse uiAttributeColor() for background colors, or make a new function...
2507
2508// uiUnderline specifies a type of underline to use on text.
2513 uiUnderlineSuggestion, // wavy or dotted underlines used for spelling/grammar checkers
2514};
2515
2516// uiNewUnderlineAttribute() creates a new uiAttribute that changes
2517// the type of underline on the text it is applied to. It is an error to
2518// specify an underline type not specified in uiUnderline.
2520
2521// uiAttributeUnderline() returns the underline type stored in a. It is
2522// an error to call this on a uiAttribute that does not hold an underline
2523// style.
2525
2526// uiUnderlineColor specifies the color of any underline on the text it
2527// is applied to, regardless of the type of underline. In addition to
2528// being able to specify a custom color, you can explicitly specify
2529// platform-specific colors for suggestion underlines; to use them
2530// correctly, pair them with uiUnderlineSuggestion (though they can
2531// be used on other types of underline as well).
2532//
2533// If an underline type is applied but no underline color is
2534// specified, the text color is used instead. If an underline color
2535// is specified without an underline type, the underline color
2536// attribute is ignored, but not removed from the uiAttributedString.
2541 uiUnderlineColorAuxiliary, // for instance, the color used by smart replacements on macOS or in Microsoft Office
2542};
2543
2544// uiNewUnderlineColorAttribute() creates a new uiAttribute that
2545// changes the color of the underline on the text it is applied to.
2546// It is an error to specify an underline color not specified in
2547// uiUnderlineColor.
2548//
2549// If the specified color type is uiUnderlineColorCustom, it is an
2550// error to specify an invalid color value. Otherwise, the color values
2551// are ignored and should be specified as zero.
2552_UI_EXTERN uiAttribute *uiNewUnderlineColorAttribute(uiUnderlineColor u, double r, double g, double b, double a);
2553
2554// uiAttributeUnderlineColor() returns the underline color stored in
2555// a. It is an error to call this on a uiAttribute that does not hold an
2556// underline color.
2557_UI_EXTERN void uiAttributeUnderlineColor(const uiAttribute *a, uiUnderlineColor *u, double *r, double *g, double *b, double *alpha);
2558
2559// uiOpenTypeFeatures represents a set of OpenType feature
2560// tag-value pairs, for applying OpenType features to text.
2561// OpenType feature tags are four-character codes defined by
2562// OpenType that cover things from design features like small
2563// caps and swashes to language-specific glyph shapes and
2564// beyond. Each tag may only appear once in any given
2565// uiOpenTypeFeatures instance. Each value is a 32-bit integer,
2566// often used as a Boolean flag, but sometimes as an index to choose
2567// a glyph shape to use.
2568//
2569// If a font does not support a certain feature, that feature will be
2570// ignored. (TODO verify this on all OSs)
2571//
2572// See the OpenType specification at
2573// https://www.microsoft.com/typography/otspec/featuretags.htm
2574// for the complete list of available features, information on specific
2575// features, and how to use them.
2576// TODO invalid features
2578
2579// uiOpenTypeFeaturesForEachFunc is the type of the function
2580// invoked by uiOpenTypeFeaturesForEach() for every OpenType
2581// feature in otf. Refer to that function's documentation for more
2582// details.
2583typedef uiForEach (*uiOpenTypeFeaturesForEachFunc)(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value, void *data);
2584
2585// @role uiOpenTypeFeatures constructor
2586// uiNewOpenTypeFeatures() returns a new uiOpenTypeFeatures
2587// instance, with no tags yet added.
2589
2590// @role uiOpenTypeFeatures destructor
2591// uiFreeOpenTypeFeatures() frees otf.
2593
2594// uiOpenTypeFeaturesClone() makes a copy of otf and returns it.
2595// Changing one will not affect the other.
2597
2598// uiOpenTypeFeaturesAdd() adds the given feature tag and value
2599// to otf. The feature tag is specified by a, b, c, and d. If there is
2600// already a value associated with the specified tag in otf, the old
2601// value is removed.
2602_UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);
2603
2604// uiOpenTypeFeaturesRemove() removes the given feature tag
2605// and value from otf. If the tag is not present in otf,
2606// uiOpenTypeFeaturesRemove() does nothing.
2607_UI_EXTERN void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d);
2608
2609// uiOpenTypeFeaturesGet() determines whether the given feature
2610// tag is present in otf. If it is, *value is set to the tag's value and
2611// nonzero is returned. Otherwise, zero is returned.
2612//
2613// Note that if uiOpenTypeFeaturesGet() returns zero, value isn't
2614// changed. This is important: if a feature is not present in a
2615// uiOpenTypeFeatures, the feature is NOT treated as if its
2616// value was zero anyway. Script-specific font shaping rules and
2617// font-specific feature settings may use a different default value
2618// for a feature. You should likewise not treat a missing feature as
2619// having a value of zero either. Instead, a missing feature should
2620// be treated as having some unspecified default value.
2621_UI_EXTERN int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value);
2622
2623// uiOpenTypeFeaturesForEach() executes f for every tag-value
2624// pair in otf. The enumeration order is unspecified. You cannot
2625// modify otf while uiOpenTypeFeaturesForEach() is running.
2627
2628// uiNewFeaturesAttribute() creates a new uiAttribute that changes
2629// the font family of the text it is applied to. otf is copied; you may
2630// free it after uiNewFeaturesAttribute() returns.
2632
2633// uiAttributeFeatures() returns the OpenType features stored in a.
2634// The returned uiOpenTypeFeatures object is owned by a. It is an
2635// error to call this on a uiAttribute that does not hold OpenType
2636// features.
2638
2639// uiAttributedString represents a string of UTF-8 text that can
2640// optionally be embellished with formatting attributes. libui
2641// provides the list of formatting attributes, which cover common
2642// formatting traits like boldface and color as well as advanced
2643// typographical features provided by OpenType like superscripts
2644// and small caps. These attributes can be combined in a variety of
2645// ways.
2646//
2647// Attributes are applied to runs of Unicode codepoints in the string.
2648// Zero-length runs are elided. Consecutive runs that have the same
2649// attribute type and value are merged. Each attribute is independent
2650// of each other attribute; overlapping attributes of different types
2651// do not split each other apart, but different values of the same
2652// attribute type do.
2653//
2654// The empty string can also be represented by uiAttributedString,
2655// but because of the no-zero-length-attribute rule, it will not have
2656// attributes.
2657//
2658// A uiAttributedString takes ownership of all attributes given to
2659// it, as it may need to duplicate or delete uiAttribute objects at
2660// any time. By extension, when you free a uiAttributedString,
2661// all uiAttributes within will also be freed. Each method will
2662// describe its own rules in more details.
2663//
2664// In addition, uiAttributedString provides facilities for moving
2665// between grapheme clusters, which represent a character
2666// from the point of view of the end user. The cursor of a text editor
2667// is always placed on a grapheme boundary, so you can use these
2668// features to move the cursor left or right by one "character".
2669// TODO does uiAttributedString itself need this
2670//
2671// uiAttributedString does not provide enough information to be able
2672// to draw itself onto a uiDrawContext or respond to user actions.
2673// In order to do that, you'll need to use a uiDrawTextLayout, which
2674// is built from the combination of a uiAttributedString and a set of
2675// layout-specific properties.
2677
2678// uiAttributedStringForEachAttributeFunc is the type of the function
2679// invoked by uiAttributedStringForEachAttribute() for every
2680// attribute in s. Refer to that function's documentation for more
2681// details.
2682typedef uiForEach (*uiAttributedStringForEachAttributeFunc)(const uiAttributedString *s, const uiAttribute *a, size_t start, size_t end, void *data);
2683
2684// @role uiAttributedString constructor
2685// uiNewAttributedString() creates a new uiAttributedString from
2686// initialString. The string will be entirely unattributed.
2688
2689// @role uiAttributedString destructor
2690// uiFreeAttributedString() destroys the uiAttributedString s.
2691// It will also free all uiAttributes within.
2693
2694// uiAttributedStringString() returns the textual content of s as a
2695// '\0'-terminated UTF-8 string. The returned pointer is valid until
2696// the next change to the textual content of s.
2698
2699// uiAttributedStringLength() returns the number of UTF-8 bytes in
2700// the textual content of s, excluding the terminating '\0'.
2702
2703// uiAttributedStringAppendUnattributed() adds the '\0'-terminated
2704// UTF-8 string str to the end of s. The new substring will be
2705// unattributed.
2707
2708// uiAttributedStringInsertAtUnattributed() adds the '\0'-terminated
2709// UTF-8 string str to s at the byte position specified by at. The new
2710// substring will be unattributed; existing attributes will be moved
2711// along with their text.
2713
2714// TODO add the Append and InsertAtExtendingAttributes functions
2715// TODO and add functions that take a string + length
2716
2717// uiAttributedStringDelete() deletes the characters and attributes of
2718// s in the byte range [start, end).
2719_UI_EXTERN void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end);
2720
2721// 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
2722
2723// uiAttributedStringSetAttribute() sets a in the byte range [start, end)
2724// of s. Any existing attributes in that byte range of the same type are
2725// removed. s takes ownership of a; you should not use it after
2726// uiAttributedStringSetAttribute() returns.
2728
2729// uiAttributedStringForEachAttribute() enumerates all the
2730// uiAttributes in s in an unspecified order. It is an error to modify s
2731// in f. Within f, s still owns the attribute; you can neither free it nor
2732// save it for later use.
2733// TODO reword the above for consistency and clarify the intended meaning
2735
2736// TODO const correct this somehow (the implementation needs to mutate the structure)
2738
2739// TODO const correct this somehow (the implementation needs to mutate the structure)
2741
2742// TODO const correct this somehow (the implementation needs to mutate the structure)
2744
2745// uiFontDescriptor provides a complete description of a font where
2746// one is needed. Currently, this means as the default font of a
2747// uiDrawTextLayout and as the data returned by uiFontButton.
2748// All the members operate like the respective uiAttributes.
2750
2752 // TODO const-correct this or figure out how to deal with this when getting a value
2753 char *Family;
2754 double Size;
2758};
2759
2769
2785
2786// uiDrawTextLayout is a concrete representation of a
2787// uiAttributedString that can be displayed in a uiDrawContext.
2788// It includes information important for the drawing of a block of
2789// text, including the bounding box to wrap the text within, the
2790// alignment of lines of text within that box, areas to mark as
2791// being selected, and other things.
2792//
2793// Unlike uiAttributedString, the content of a uiDrawTextLayout is
2794// immutable once it has been created.
2795//
2796// TODO talk about OS-specific differences with text drawing that libui can't account for...
2798
2799// uiDrawTextAlign specifies the alignment of lines of text in a
2800// uiDrawTextLayout.
2801// TODO should this really have Draw in the name?
2806};
2807
2808// uiDrawTextLayoutParams describes a uiDrawTextLayout.
2809// DefaultFont is used to render any text that is not attributed
2810// sufficiently in String. Width determines the width of the bounding
2811// box of the text; the height is determined automatically.
2813
2814// TODO const-correct this somehow
2818 double Width;
2820};
2821
2822// @role uiDrawTextLayout constructor
2823// uiDrawNewTextLayout() creates a new uiDrawTextLayout from
2824// the given parameters.
2825//
2826// TODO
2827// - allow creating a layout out of a substring
2828// - allow marking compositon strings
2829// - allow marking selections, even after creation
2830// - add the following functions:
2831// - uiDrawTextLayoutHeightForWidth() (returns the height that a layout would need to be to display the entire string at a given width)
2832// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
2833// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
2834// - some function to fix up a range (for text editing)
2836
2837// @role uiDrawFreeTextLayout destructor
2838// uiDrawFreeTextLayout() frees tl. The underlying
2839// uiAttributedString is not freed.
2841
2842// uiDrawText() draws tl in c with the top-left point of tl at (x, y).
2843_UI_EXTERN void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y);
2844
2845// uiDrawTextLayoutExtents() returns the width and height of tl
2846// in width and height. The returned width may be smaller than
2847// the width passed into uiDrawNewTextLayout() depending on
2848// how the text in tl is wrapped. Therefore, you can use this
2849// function to get the actual size of the text layout.
2850_UI_EXTERN void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height);
2851
2852// TODO metrics functions
2853
2854// TODO number of lines visible for clipping rect, range visible for clipping rect?
2855
2856
2868#define uiFontButton(this) ((uiFontButton *) (this))
2869
2881
2895 void (*f)(uiFontButton *sender, void *senderData), void *data);
2896
2906
2917
2927 uiModifierAlt = 1 << 1,
2930};
2931
2932// Mouse input is captured after a button press until all buttons are released.
2933// DragBroken is called if that capture is lost unexpectedly.
2935 // Coordinates in the area's drawing space, including the scroll offset for
2936 // scrolling areas.
2937 double X;
2938 double Y;
2939
2940 // These fields are only defined for non-scrolling areas.
2943
2944 int Down;
2945 int Up;
2946
2948
2950
2951 uint64_t Held1To64;
2952};
2953
2956 uiExtKeyInsert, // equivalent to "Help" on Apple keyboards
2966 uiExtKeyF1, // F1..F12 are guaranteed to be consecutive
2978 uiExtKeyN0, // numpad keys; independent of Num Lock state
2979 uiExtKeyN1, // N0..N9 are guaranteed to be consecutive
2994};
2995
2997 char Key;
3000
3002
3003 int Up;
3004};
3005
3006
3020#define uiColorButton(this) ((uiColorButton *) (this))
3021
3032_UI_EXTERN void uiColorButtonColor(uiColorButton *b, double *r, double *g, double *bl, double *a);
3033
3044_UI_EXTERN void uiColorButtonSetColor(uiColorButton *b, double r, double g, double bl, double a);
3045
3059 void (*f)(uiColorButton *sender, void *senderData), void *data);
3060
3068
3069
3085typedef struct uiForm uiForm;
3086#define uiForm(this) ((uiForm *) (this))
3087
3102_UI_EXTERN void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy);
3103
3111
3120_UI_EXTERN void uiFormDelete(uiForm *f, int index);
3121
3132
3143_UI_EXTERN void uiFormSetPadded(uiForm *f, int padded);
3144
3152
3153
3165};
3166
3178};
3179
3201typedef struct uiGrid uiGrid;
3202#define uiGrid(this) ((uiGrid *) (this))
3203
3219_UI_EXTERN void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3220
3236_UI_EXTERN void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3237
3246
3257
3268_UI_EXTERN void uiGridSetPadded(uiGrid *g, int padded);
3269
3277
3278
3299typedef struct uiImage uiImage;
3300
3314_UI_EXTERN uiImage *uiNewImage(double width, double height);
3315
3327_UI_EXTERN void uiImageGetSize(uiImage *i, double *width, double *height);
3328
3338
3354_UI_EXTERN void uiImageAppend(uiImage *i, const void *pixels, int pixelWidth, int pixelHeight, int byteStride);
3355
3405
3420
3433};
3434
3443
3454
3467
3484
3498
3512
3523
3534_UI_EXTERN uiTableValue *uiNewTableValueColor(double r, double g, double b, double a);
3535
3548_UI_EXTERN void uiTableValueColor(const uiTableValue *v, double *r, double *g, double *b, double *a);
3549
3550
3564
3587
3612
3620
3625
3638 uiTableValue *(*CellValue)(uiTableModelHandler *mh, uiTableModel *m, int row, int column);
3639
3653};
3654
3663
3675
3688
3700
3713// TODO reordering/moving
3714
3716#define uiTableModelColumnNeverEditable (-1)
3718#define uiTableModelColumnAlwaysEditable (-2)
3719
3737};
3738
3760};
3761
3783typedef struct uiTable uiTable;
3784#define uiTable(this) ((uiTable *) (this))
3785
3804 const char *name,
3805 int textModelColumn,
3806 int textEditableModelColumn,
3808
3824 const char *name,
3825 int imageModelColumn);
3826
3849 const char *name,
3850 int imageModelColumn,
3851 int textModelColumn,
3852 int textEditableModelColumn,
3854
3871 const char *name,
3872 int checkboxModelColumn,
3873 int checkboxEditableModelColumn);
3874
3899 const char *name,
3900 int checkboxModelColumn,
3901 int checkboxEditableModelColumn,
3902 int textModelColumn,
3903 int textEditableModelColumn,
3905
3922 const char *name,
3923 int progressModelColumn);
3924
3946 const char *name,
3947 int buttonModelColumn,
3948 int buttonClickableModelColumn);
3949
3958
3967
3976
3977
3992 void (*f)(uiTable *t, int row, void *data),
3993 void *data);
3994
4010 void (*f)(uiTable *t, int row, void *data),
4011 void *data);
4012
4026 int column,
4027 uiSortIndicator indicator);
4028
4038
4053 void (*f)(uiTable *sender, int column, void *senderData), void *data);
4054
4064
4082_UI_EXTERN void uiTableColumnSetWidth(uiTable *t, int column, int width);
4083
4107};
4108
4118
4130
4145_UI_EXTERN void uiTableOnSelectionChanged(uiTable *t, void (*f)(uiTable *t, void *data), void *data);
4146
4155{
4157 int *Rows;
4158};
4159
4171
4185
4193
4194#ifdef __cplusplus
4195}
4196#endif
4197
4198#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:4096
uiSortIndicator
Sort indicators.
Definition: ui.h:3559
Definition: ui.h:2184
double AreaWidth
Definition: ui.h:2188
double ClipWidth
Definition: ui.h:2193
double ClipHeight
Definition: ui.h:2194
double AreaHeight
Definition: ui.h:2189
double ClipY
Definition: ui.h:2192
uiDrawContext * Context
Definition: ui.h:2185
double ClipX
Definition: ui.h:2191
Definition: ui.h:2111
void(* DragBroken)(uiAreaHandler *, uiArea *)
Definition: ui.h:2119
int(* KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *)
Definition: ui.h:2120
void(* Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *)
Definition: ui.h:2112
void(* MouseCrossed)(uiAreaHandler *, uiArea *, int left)
Definition: ui.h:2118
void(* MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *)
Definition: ui.h:2115
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:2996
char Key
Definition: ui.h:2997
int Up
Definition: ui.h:3003
uiExtKey ExtKey
Definition: ui.h:2998
uiModifiers Modifier
Definition: ui.h:2999
uiModifiers Modifiers
Definition: ui.h:3001
Definition: ui.h:2934
int Count
Definition: ui.h:2947
double X
Definition: ui.h:2937
double AreaHeight
Definition: ui.h:2942
int Down
Definition: ui.h:2944
uint64_t Held1To64
Definition: ui.h:2951
int Up
Definition: ui.h:2945
uiModifiers Modifiers
Definition: ui.h:2949
double Y
Definition: ui.h:2938
double AreaWidth
Definition: ui.h:2941
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:117
int uiControlVisible(uiControl *c)
Returns whether or not the control is visible.
void uiControlSetMinimumSize(uiControl *c, int width, int height)
Overrides a control's minimum layout size.
void uiControlHide(uiControl *c)
Hides the control.
int(* Visible)(uiControl *)
Definition: ui.h:126
uint32_t OSSignature
Definition: ui.h:119
int(* Toplevel)(uiControl *)
Definition: ui.h:125
void(* SetParent)(uiControl *, uiControl *)
Definition: ui.h:124
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:131
void(* Show)(uiControl *)
Definition: ui.h:127
void(* Destroy)(uiControl *)
Definition: ui.h:121
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:128
void uiControlSetParent(uiControl *c, uiControl *parent)
Sets the control's parent.
uint32_t TypeSignature
Definition: ui.h:120
int(* Enabled)(uiControl *)
Definition: ui.h:129
uiControl * uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr)
Allocates a uiControl.
uint32_t Signature
Definition: ui.h:118
uiControl * uiControlParent(uiControl *c)
Returns the parent control.
uintptr_t(* Handle)(uiControl *)
Definition: ui.h:122
void(* Enable)(uiControl *)
Definition: ui.h:130
A control to enter a date and/or time.
Definition: ui.h:1670
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:2270
double R
Definition: ui.h:2272
double G
Definition: ui.h:2273
double Pos
Definition: ui.h:2271
double B
Definition: ui.h:2274
double A
Definition: ui.h:2275
Definition: ui.h:2242
double Y1
Definition: ui.h:2255
double B
Definition: ui.h:2248
size_t NumStops
Definition: ui.h:2258
double R
Definition: ui.h:2246
double Y0
Definition: ui.h:2253
double A
Definition: ui.h:2249
uiDrawBrushGradientStop * Stops
Definition: ui.h:2257
double X1
Definition: ui.h:2254
double X0
Definition: ui.h:2252
double OuterRadius
Definition: ui.h:2256
double G
Definition: ui.h:2247
uiDrawBrushType Type
Definition: ui.h:2243
Definition: ui.h:2233
double M32
Definition: ui.h:2239
double M11
Definition: ui.h:2234
double M22
Definition: ui.h:2237
double M31
Definition: ui.h:2238
double M21
Definition: ui.h:2236
double M12
Definition: ui.h:2235
Definition: ui.h:2278
size_t NumDashes
Definition: ui.h:2288
double DashPhase
Definition: ui.h:2289
double * Dashes
Definition: ui.h:2285
double Thickness
Definition: ui.h:2282
double MiterLimit
Definition: ui.h:2283
uiDrawLineJoin Join
Definition: ui.h:2280
uiDrawLineCap Cap
Definition: ui.h:2279
Definition: ui.h:2815
uiAttributedString * String
Definition: ui.h:2816
double Width
Definition: ui.h:2818
uiFontDescriptor * DefaultFont
Definition: ui.h:2817
uiDrawTextAlign Align
Definition: ui.h:2819
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)
Compatibility alias for uiFreeFontDescriptor().
Definition: ui.h:2751
uiTextItalic Italic
Definition: ui.h:2756
uiTextWeight Weight
Definition: ui.h:2755
char * Family
Definition: ui.h:2753
uiTextStretch Stretch
Definition: ui.h:2757
double Size
Definition: ui.h:2754
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.
void uiImageGetSize(uiImage *i, double *width, double *height)
Returns the image's logical dimensions in points.
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:3602
void(* SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const uiTableValue *)
Sets the cell value for (row, column).
Definition: ui.h:3652
int(* NumColumns)(uiTableModelHandler *, uiTableModel *)
Returns the number of columns in the uiTableModel.
Definition: ui.h:3611
uiTableValueType(* ColumnType)(uiTableModelHandler *, uiTableModel *, int column)
Returns the column type in for of a uiTableValueType.
Definition: ui.h:3619
int(* NumRows)(uiTableModelHandler *, uiTableModel *)
Returns the number of rows in the uiTableModel.
Definition: ui.h:3624
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:3746
int RowBackgroundColorModelColumn
uiTableModel column that defines background color for each row,
Definition: ui.h:3759
uiTableModel * Model
Model holding the data to be displayed.
Definition: ui.h:3750
Holds an array of selected row indices for a table.
Definition: ui.h:4155
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:4157
int NumRows
Non-negative number of selected rows.
Definition: ui.h:4156
Optional parameters to control the appearance of text columns.
Definition: ui.h:3727
int ColorModelColumn
uiTableModel column that defines the text color for each cell.
Definition: ui.h:3736
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:2125
@ uiWindowResizeEdgeTop
Definition: ui.h:2127
@ uiWindowResizeEdgeBottom
Definition: ui.h:2129
@ uiWindowResizeEdgeBottomLeft
Definition: ui.h:2132
@ uiWindowResizeEdgeLeft
Definition: ui.h:2126
@ uiWindowResizeEdgeRight
Definition: ui.h:2128
@ uiWindowResizeEdgeTopLeft
Definition: ui.h:2130
@ uiWindowResizeEdgeBottomRight
Definition: ui.h:2133
@ uiWindowResizeEdgeTopRight
Definition: ui.h:2131
const uiOpenTypeFeatures * uiAttributeFeatures(const uiAttribute *a)
uiTableValueType
uiTableValue types.
Definition: ui.h:3428
@ uiTableValueTypeImage
Definition: ui.h:3430
@ uiTableValueTypeInt
Definition: ui.h:3431
@ uiTableValueTypeColor
Definition: ui.h:3432
@ uiTableValueTypeString
Definition: ui.h:3429
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:3173
@ uiAtTop
Place above control.
Definition: ui.h:3175
@ uiAtLeading
Place before control.
Definition: ui.h:3174
@ uiAtBottom
Place below control.
Definition: ui.h:3177
@ uiAtTrailing
Place behind control.
Definition: ui.h:3176
void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)
struct uiAttributedString uiAttributedString
Definition: ui.h:2676
uiAttribute * uiNewSizeAttribute(double size)
void uiLoadControlFont(uiFontDescriptor *f)
Loads the platform's default control font.
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:2682
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:2445
@ uiTextItalicOblique
Definition: ui.h:2447
@ uiTextItalicItalic
Definition: ui.h:2448
@ uiTextItalicNormal
Definition: ui.h:2446
void uiDrawPathLineTo(uiDrawPath *p, double x, double y)
void uiDrawFreePath(uiDrawPath *p)
uiModifiers
Keyboard modifier keys.
Definition: ui.h:2925
@ uiModifierAlt
Alternate/Option key.
Definition: ui.h:2927
@ uiModifierSuper
Super/Command/Windows key.
Definition: ui.h:2929
@ uiModifierShift
Shift key.
Definition: ui.h:2928
@ uiModifierCtrl
Control key.
Definition: ui.h:2926
void uiFreeText(char *text)
Frees a non-NULL string owned by the caller when the returning function specifies uiFreeText() as its...
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:2802
@ uiDrawTextAlignCenter
Definition: ui.h:2804
@ uiDrawTextAlignLeft
Definition: ui.h:2803
@ uiDrawTextAlignRight
Definition: ui.h:2805
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:2583
struct uiAttribute uiAttribute
Definition: ui.h:2351
int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
struct uiDrawPath uiDrawPath
Definition: ui.h:2197
uiDrawTextLayout * uiDrawNewTextLayout(uiDrawTextLayoutParams *params)
uiAttributeType uiAttributeGetType(const uiAttribute *a)
uiTextWeight
Definition: ui.h:2414
@ uiTextWeightMaximum
Definition: ui.h:2427
@ uiTextWeightNormal
Definition: ui.h:2420
@ uiTextWeightBook
Definition: ui.h:2419
@ uiTextWeightMedium
Definition: ui.h:2421
@ uiTextWeightUltraLight
Definition: ui.h:2417
@ uiTextWeightBold
Definition: ui.h:2423
@ uiTextWeightUltraBold
Definition: ui.h:2424
@ uiTextWeightSemiBold
Definition: ui.h:2422
@ uiTextWeightUltraHeavy
Definition: ui.h:2426
@ uiTextWeightLight
Definition: ui.h:2418
@ uiTextWeightThin
Definition: ui.h:2416
@ uiTextWeightMinimum
Definition: ui.h:2415
@ uiTextWeightHeavy
Definition: ui.h:2425
struct uiDrawContext uiDrawContext
Definition: ui.h:2109
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:2364
@ uiAttributeTypeUnderline
Definition: ui.h:2372
@ uiAttributeTypeBackground
Definition: ui.h:2371
@ uiAttributeTypeFamily
Definition: ui.h:2365
@ uiAttributeTypeItalic
Definition: ui.h:2368
@ uiAttributeTypeColor
Definition: ui.h:2370
@ uiAttributeTypeUnderlineColor
Definition: ui.h:2373
@ uiAttributeTypeStretch
Definition: ui.h:2369
@ uiAttributeTypeSize
Definition: ui.h:2366
@ uiAttributeTypeFeatures
Definition: ui.h:2374
@ uiAttributeTypeWeight
Definition: ui.h:2367
void uiAreaBeginUserWindowMove(uiArea *a)
uiUnderline
Definition: ui.h:2509
@ uiUnderlineSuggestion
Definition: ui.h:2513
@ uiUnderlineSingle
Definition: ui.h:2511
@ uiUnderlineDouble
Definition: ui.h:2512
@ uiUnderlineNone
Definition: ui.h:2510
uiExtKey
Definition: ui.h:2954
@ uiExtKeyF8
Definition: ui.h:2973
@ uiExtKeyNSubtract
Definition: ui.h:2991
@ uiExtKeyF5
Definition: ui.h:2970
@ uiExtKeyF3
Definition: ui.h:2968
@ uiExtKeyN3
Definition: ui.h:2981
@ uiExtKeyPageUp
Definition: ui.h:2960
@ uiExtKeyF12
Definition: ui.h:2977
@ uiExtKeyF4
Definition: ui.h:2969
@ uiExtKeyRight
Definition: ui.h:2965
@ uiExtKeyNDot
Definition: ui.h:2988
@ uiExtKeyDelete
Definition: ui.h:2957
@ uiExtKeyNAdd
Definition: ui.h:2990
@ uiExtKeyN6
Definition: ui.h:2984
@ uiExtKeyNEnter
Definition: ui.h:2989
@ uiExtKeyDown
Definition: ui.h:2963
@ uiExtKeyF10
Definition: ui.h:2975
@ uiExtKeyN8
Definition: ui.h:2986
@ uiExtKeyN4
Definition: ui.h:2982
@ uiExtKeyInsert
Definition: ui.h:2956
@ uiExtKeyN0
Definition: ui.h:2978
@ uiExtKeyN5
Definition: ui.h:2983
@ uiExtKeyN1
Definition: ui.h:2979
@ uiExtKeyF11
Definition: ui.h:2976
@ uiExtKeyF1
Definition: ui.h:2966
@ uiExtKeyF2
Definition: ui.h:2967
@ uiExtKeyF6
Definition: ui.h:2971
@ uiExtKeyLeft
Definition: ui.h:2964
@ uiExtKeyUp
Definition: ui.h:2962
@ uiExtKeyEscape
Definition: ui.h:2955
@ uiExtKeyF7
Definition: ui.h:2972
@ uiExtKeyN7
Definition: ui.h:2985
@ uiExtKeyNDivide
Definition: ui.h:2993
@ uiExtKeyEnd
Definition: ui.h:2959
@ uiExtKeyN2
Definition: ui.h:2980
@ uiExtKeyHome
Definition: ui.h:2958
@ uiExtKeyF9
Definition: ui.h:2974
@ uiExtKeyPageDown
Definition: ui.h:2961
@ uiExtKeyN9
Definition: ui.h:2987
@ uiExtKeyNMultiply
Definition: ui.h:2992
#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:2217
@ uiDrawLineJoinRound
Definition: ui.h:2219
@ uiDrawLineJoinMiter
Definition: ui.h:2218
@ uiDrawLineJoinBevel
Definition: ui.h:2220
void uiFreeFontDescriptor(uiFontDescriptor *desc)
Frees resources owned by a uiFontDescriptor filled by libui.
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:2228
@ uiDrawFillModeWinding
Definition: ui.h:2229
@ uiDrawFillModeAlternate
Definition: ui.h:2230
uiDrawLineCap
Definition: ui.h:2211
@ uiDrawLineCapRound
Definition: ui.h:2213
@ uiDrawLineCapFlat
Definition: ui.h:2212
@ uiDrawLineCapSquare
Definition: ui.h:2214
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)
const char * uiVersion(void)
Returns the build's commit-* tag or Git hash, or unknown.
void uiDrawPathCloseFigure(uiDrawPath *p)
struct uiOpenTypeFeatures uiOpenTypeFeatures
Definition: ui.h:2577
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:2797
uiUnderlineColor
Definition: ui.h:2537
@ uiUnderlineColorCustom
Definition: ui.h:2538
@ uiUnderlineColorAuxiliary
Definition: ui.h:2541
@ uiUnderlineColorGrammar
Definition: ui.h:2540
@ uiUnderlineColorSpelling
Definition: ui.h:2539
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:3160
@ uiAlignStart
Place at start.
Definition: ui.h:3162
@ uiAlignEnd
Place at end.
Definition: ui.h:3164
@ uiAlignFill
Fill area.
Definition: ui.h:3161
@ uiAlignCenter
Place in center.
Definition: ui.h:3163
uiDrawBrushType
Definition: ui.h:2204
@ uiDrawBrushTypeImage
Definition: ui.h:2208
@ uiDrawBrushTypeSolid
Definition: ui.h:2205
@ uiDrawBrushTypeLinearGradient
Definition: ui.h:2206
@ uiDrawBrushTypeRadialGradient
Definition: ui.h:2207
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:2471
@ uiTextStretchSemiCondensed
Definition: ui.h:2475
@ uiTextStretchExpanded
Definition: ui.h:2478
@ uiTextStretchExtraExpanded
Definition: ui.h:2479
@ uiTextStretchUltraExpanded
Definition: ui.h:2480
@ uiTextStretchExtraCondensed
Definition: ui.h:2473
@ uiTextStretchCondensed
Definition: ui.h:2474
@ uiTextStretchSemiExpanded
Definition: ui.h:2477
@ uiTextStretchNormal
Definition: ui.h:2476
@ uiTextStretchUltraCondensed
Definition: ui.h:2472
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:4106
@ uiTableSelectionModeZeroOrOne
Allow zero or one row to be selected.
Definition: ui.h:4104
@ uiTableSelectionModeNone
Allow no row selection.
Definition: ui.h:4103
@ uiTableSelectionModeOne
Allow for exactly one row to be selected.
Definition: ui.h:4105
@ uiSortIndicatorNone
Definition: ui.h:3560
@ uiSortIndicatorDescending
Definition: ui.h:3562
@ uiSortIndicatorAscending
Definition: ui.h:3561