libui
A portable GUI library for C
Loading...
Searching...
No Matches
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
19
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 generated by cmake
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.
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// TODO standardize the looping behavior return type, either with some enum or something, and the test expressions throughout the code
76// TODO figure out what to do about looping and the exact point that the timer is rescheduled so we can document it; see https://github.com/andlabs/libui/pull/277
77// TODO (also in the above link) document that this cannot be called from any thread, unlike uiQueueMain()
78// TODO document that the minimum exact timing, either accuracy (timer burst, etc.) or granularity (15ms on Windows, etc.), is OS-defined
79// TODO also figure out how long until the initial tick is registered on all platforms to document
80// TODO also add a comment about how useful this could be in bindings, depending on the language being bound to
81_UI_EXTERN void uiTimer(int milliseconds, int (*f)(void *data), void *data);
82
83_UI_EXTERN void uiOnShouldQuit(int (*f)(void *data), void *data);
84
85
95_UI_EXTERN void uiFreeText(char *text);
96
97
103typedef struct uiControl uiControl;
104struct uiControl {
105 uint32_t Signature;
106 uint32_t OSSignature;
108 void (*Destroy)(uiControl *);
109 uintptr_t (*Handle)(uiControl *);
110 uiControl *(*Parent)(uiControl *);
114 void (*Show)(uiControl *);
115 void (*Hide)(uiControl *);
117 void (*Enable)(uiControl *);
118 void (*Disable)(uiControl *);
119};
120// TOOD add argument names to all arguments
121#define uiControl(this) ((uiControl *) (this))
122
135
144
153
163
172
181
189
198
209
217
225
235_UI_EXTERN uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr);
236
246
257
270
271// TODO Move this to private API? According to old/new.md this should be used by toplevel controls.
273
274
290typedef struct uiWindow uiWindow;
291#define uiWindow(this) ((uiWindow *) (this))
292
303
314_UI_EXTERN void uiWindowSetTitle(uiWindow *w, const char *title);
315
327_UI_EXTERN void uiWindowPosition(uiWindow *w, int *x, int *y);
328
341
356 void (*f)(uiWindow *sender, void *senderData), void *data);
357
367_UI_EXTERN void uiWindowContentSize(uiWindow *w, int *width, int *height);
368
379_UI_EXTERN void uiWindowSetContentSize(uiWindow *w, int width, int height);
380
389
399
414 void (*f)(uiWindow *sender, void *senderData), void *data);
415
432 int (*f)(uiWindow *sender, void *senderData), void *data);
433
447 void (*f)(uiWindow *sender, void *senderData), void *data);
448
457
466
476
485
494
505
514
524
537_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar);
538
539
547typedef struct uiButton uiButton;
548#define uiButton(this) ((uiButton *) (this))
549
560
570_UI_EXTERN void uiButtonSetText(uiButton *b, const char *text);
571
585 void (*f)(uiButton *sender, void *senderData), void *data);
586
596_UI_EXTERN uiButton *uiNewButton(const char *text);
597
598
609typedef struct uiBox uiBox;
610#define uiBox(this) ((uiBox *) (this))
611
623_UI_EXTERN void uiBoxAppend(uiBox *b, uiControl *child, int stretchy);
624
633
642_UI_EXTERN void uiBoxDelete(uiBox *b, int index);
643
654
665_UI_EXTERN void uiBoxSetPadded(uiBox *b, int padded);
666
676
686
687
695typedef struct uiCheckbox uiCheckbox;
696#define uiCheckbox(this) ((uiCheckbox *) (this))
697
708
718_UI_EXTERN void uiCheckboxSetText(uiCheckbox *c, const char *text);
719
734 void (*f)(uiCheckbox *sender, void *senderData), void *data);
735
744
753
764
765
773typedef struct uiEntry uiEntry;
774#define uiEntry(this) ((uiEntry *) (this))
775
786
796_UI_EXTERN void uiEntrySetText(uiEntry *e, const char *text);
797
811 void (*f)(uiEntry *sender, void *senderData), void *data);
812
821
829_UI_EXTERN void uiEntrySetReadOnly(uiEntry *e, int readonly);
830
841
852_UI_EXTERN void uiEntrySetPlaceholder(uiEntry *e, const char *text);
853
861
871
882
883
891typedef struct uiLabel uiLabel;
892#define uiLabel(this) ((uiLabel *) (this))
893
904
914_UI_EXTERN void uiLabelSetText(uiLabel *l, const char *text);
915
925_UI_EXTERN uiLabel *uiNewLabel(const char *text);
926
927
938typedef struct uiTab uiTab;
939#define uiTab(this) ((uiTab *) (this))
940
949
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
1293_UI_EXTERN void uiSliderSetRange(uiSlider *s, int min, int max);
1294
1310
1311
1322#define uiProgressBar(this) ((uiProgressBar *) (this))
1323
1332
1347
1355
1356
1365#define uiSeparator(this) ((uiSeparator *) (this))
1366
1374
1382
1383
1392typedef struct uiCombobox uiCombobox;
1393#define uiCombobox(this) ((uiCombobox *) (this))
1394
1404_UI_EXTERN void uiComboboxAppend(uiCombobox *c, const char *text);
1405
1416_UI_EXTERN void uiComboboxInsertAt(uiCombobox *c, int index, const char *text);
1417
1429
1437
1446
1455
1464
1480 void (*f)(uiCombobox *sender, void *senderData), void *data);
1481
1489
1490
1504#define uiEditableCombobox(this) ((uiEditableCombobox *) (this))
1505
1516
1530
1541
1542// TODO what do we call a function that sets the currently selected item and fills the text field with it?
1543// editable comboboxes have no consistent concept of selected item
1544
1559 void (*f)(uiEditableCombobox *sender, void *senderData), void *data);
1560
1571
1582
1590
1591
1600#define uiRadioButtons(this) ((uiRadioButtons *) (this))
1601
1612
1621
1630
1645 void (*f)(uiRadioButtons *sender, void *senderData), void *data);
1646
1654
1655struct tm;
1673#define uiDateTimePicker(this) ((uiDateTimePicker *) (this))
1674
1684
1695
1710 void (*f)(uiDateTimePicker *sender, void *senderData), void *data);
1711
1719
1727
1735
1736
1746#define uiMultilineEntry(this) ((uiMultilineEntry *) (this))
1747
1758
1769
1780
1796 void (*f)(uiMultilineEntry *sender, void *senderData), void *data);
1797
1806
1815
1823
1833
1834
1841typedef struct uiMenuItem uiMenuItem;
1842#define uiMenuItem(this) ((uiMenuItem *) (this))
1843
1851
1861
1876 void (*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data);
1877
1888
1899
1928typedef struct uiMenu uiMenu;
1929#define uiMenu(this) ((uiMenu *) (this))
1930
1942
1954
1964
1974
1984
1992
2004_UI_EXTERN uiMenu *uiNewMenu(const char *name);
2005
2006
2019
2032
2048
2063_UI_EXTERN void uiMsgBox(uiWindow *parent, const char *title, const char *description);
2064
2080_UI_EXTERN void uiMsgBoxError(uiWindow *parent, const char *title, const char *description);
2081
2082typedef struct uiArea uiArea;
2087
2089
2092 // TODO document that resizes cause a full redraw for non-scrolling areas; implementation-defined for scrolling areas
2094 // TODO document that on first show if the mouse is already in the uiArea then one gets sent with left=0
2095 // TODO what about when the area is hidden and then shown again?
2096 void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left);
2099};
2100
2101// TODO RTL layouts?
2102// TODO reconcile edge and corner naming
2112 // TODO have one for keyboard resizes?
2113 // TODO GDK doesn't seem to have any others, including for keyboards...
2114 // TODO way to bring up the system menu instead?
2115};
2116
2117#define uiArea(this) ((uiArea *) (this))
2118// TODO give a better name
2119// TODO document the types of width and height
2120_UI_EXTERN void uiAreaSetSize(uiArea *a, int width, int height);
2121// TODO uiAreaQueueRedraw()
2123_UI_EXTERN void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height);
2124// TODO document these can only be called within Mouse() handlers
2125// TODO should these be allowed on scrolling areas?
2126// TODO decide which mouse events should be accepted; Down is the only one guaranteed to work right now
2127// TODO what happens to events after calling this up to and including the next mouse up?
2128// TODO release capture?
2133
2136
2137 // TODO document that this is only defined for nonscrolling areas
2140
2141 double ClipX;
2142 double ClipY;
2145};
2146
2147typedef struct uiDrawPath uiDrawPath;
2151
2153
2155
2162
2168
2174
2175// this is the default for botoh cairo and Direct2D (in the latter case, from the C++ helper functions)
2176// Core Graphics doesn't explicitly specify a default, but NSBezierPath allows you to choose one, and this is the initial value
2177// so we're good to use it too!
2178#define uiDrawDefaultMiterLimit 10.0
2179
2184
2186 double M11;
2187 double M12;
2188 double M21;
2189 double M22;
2190 double M31;
2191 double M32;
2192};
2193
2196
2197 // solid brushes
2198 double R;
2199 double G;
2200 double B;
2201 double A;
2202
2203 // gradient brushes
2204 double X0; // linear: start X, radial: start X
2205 double Y0; // linear: start Y, radial: start Y
2206 double X1; // linear: end X, radial: outer circle center X
2207 double Y1; // linear: end Y, radial: outer circle center Y
2208 double OuterRadius; // radial gradients only
2210 size_t NumStops;
2211 // TODO extend mode
2212 // cairo: none, repeat, reflect, pad; no individual control
2213 // Direct2D: repeat, reflect, pad; no individual control
2214 // Core Graphics: none, pad; before and after individually
2215 // TODO cairo documentation is inconsistent about pad
2216
2217 // TODO images
2218
2219 // TODO transforms
2220};
2221
2223 double Pos;
2224 double R;
2225 double G;
2226 double B;
2227 double A;
2228};
2229
2233 // TODO what if this is 0? on windows there will be a crash with dashing
2236 double *Dashes;
2237 // TOOD what if this is 1 on Direct2D?
2238 // TODO what if a dash is 0 on Cairo or Quartz?
2241};
2242
2243struct uiRect {
2244 int X;
2245 int Y;
2248};
2249
2250typedef struct uiRect uiRect;
2251
2254
2255_UI_EXTERN void uiDrawPathNewFigure(uiDrawPath *p, double x, double y);
2256_UI_EXTERN void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2257_UI_EXTERN void uiDrawPathLineTo(uiDrawPath *p, double x, double y);
2258// notes: angles are both relative to 0 and go counterclockwise
2259// TODO is the initial line segment on cairo and OS X a proper join?
2260// TODO what if sweep < 0?
2261_UI_EXTERN void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative);
2262_UI_EXTERN void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, double c2y, double endX, double endY);
2263// TODO quadratic bezier
2265
2266// TODO effect of these when a figure is already started
2267_UI_EXTERN void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height);
2268
2271
2274
2275// TODO primitives:
2276// - rounded rectangles
2277// - elliptical arcs
2278// - quadratic bezier curves
2279
2281_UI_EXTERN void uiDrawMatrixTranslate(uiDrawMatrix *m, double x, double y);
2282_UI_EXTERN void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x, double y);
2283_UI_EXTERN void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount);
2284_UI_EXTERN void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount);
2290
2292
2293// TODO add a uiDrawPathStrokeToFill() or something like that
2295
2298
2299// bitmap API
2301_UI_EXTERN void uiDrawBitmapUpdate(uiDrawBitmap* bmp, const void* data);
2302_UI_EXTERN void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, int filter);
2304
2305// uiAttribute stores information about an attribute in a
2306// uiAttributedString.
2307//
2308// You do not create uiAttributes directly; instead, you create a
2309// uiAttribute of a given type using the specialized constructor
2310// functions. For every Unicode codepoint in the uiAttributedString,
2311// at most one value of each attribute type can be applied.
2312//
2313// uiAttributes are immutable and the uiAttributedString takes
2314// ownership of the uiAttribute object once assigned, copying its
2315// contents as necessary.
2316// TODO define whether all this, for both uiTableValue and uiAttribute, is undefined behavior or a caught error
2318
2319// @role uiAttribute destructor
2320// uiFreeAttribute() frees a uiAttribute. You generally do not need to
2321// call this yourself, as uiAttributedString does this for you. In fact,
2322// it is an error to call this function on a uiAttribute that has been
2323// given to a uiAttributedString. You can call this, however, if you
2324// created a uiAttribute that you aren't going to use later.
2326
2327// uiAttributeType holds the possible uiAttribute types that may be
2328// returned by uiAttributeGetType(). Refer to the documentation for
2329// each type's constructor function for details on each type.
2342
2343// uiAttributeGetType() returns the type of a.
2344// TODO I don't like this name
2346
2347// uiNewFamilyAttribute() creates a new uiAttribute that changes the
2348// font family of the text it is applied to. family is copied; you do not
2349// need to keep it alive after uiNewFamilyAttribute() returns. Font
2350// family names are case-insensitive.
2352
2353// uiAttributeFamily() returns the font family stored in a. The
2354// returned string is owned by a. It is an error to call this on a
2355// uiAttribute that does not hold a font family.
2357
2358// uiNewSizeAttribute() creates a new uiAttribute that changes the
2359// size of the text it is applied to, in typographical points.
2361
2362// uiAttributeSize() returns the font size stored in a. It is an error to
2363// call this on a uiAttribute that does not hold a font size.
2365
2366// uiTextWeight represents possible text weights. These roughly
2367// map to the OS/2 text weight field of TrueType and OpenType
2368// fonts, or to CSS weight numbers. The named constants are
2369// nominal values; the actual values may vary by font and by OS,
2370// though this isn't particularly likely. Any value between
2371// uiTextWeightMinimum and uiTextWeightMaximum, inclusive,
2372// is allowed.
2373//
2374// Note that due to restrictions in early versions of Windows, some
2375// fonts have "special" weights be exposed in many programs as
2376// separate font families. This is perhaps most notable with
2377// Arial Black. libui does not do this, even on Windows (because the
2378// DirectWrite API libui uses on Windows does not do this); to
2379// specify Arial Black, use family Arial and weight uiTextWeightBlack.
2395
2396// uiNewWeightAttribute() creates a new uiAttribute that changes the
2397// weight of the text it is applied to. It is an error to specify a weight
2398// outside the range [uiTextWeightMinimum,
2399// uiTextWeightMaximum].
2401
2402// uiAttributeWeight() returns the font weight stored in a. It is an error
2403// to call this on a uiAttribute that does not hold a font weight.
2405
2406// uiTextItalic represents possible italic modes for a font. Italic
2407// represents "true" italics where the slanted glyphs have custom
2408// shapes, whereas oblique represents italics that are merely slanted
2409// versions of the normal glyphs. Most fonts usually have one or the
2410// other.
2416
2417// uiNewItalicAttribute() creates a new uiAttribute that changes the
2418// italic mode of the text it is applied to. It is an error to specify an
2419// italic mode not specified in uiTextItalic.
2421
2422// uiAttributeItalic() returns the font italic mode stored in a. It is an
2423// error to call this on a uiAttribute that does not hold a font italic
2424// mode.
2426
2427// uiTextStretch represents possible stretches (also called "widths")
2428// of a font.
2429//
2430// Note that due to restrictions in early versions of Windows, some
2431// fonts have "special" stretches be exposed in many programs as
2432// separate font families. This is perhaps most notable with
2433// Arial Condensed. libui does not do this, even on Windows (because
2434// the DirectWrite API libui uses on Windows does not do this); to
2435// specify Arial Condensed, use family Arial and stretch
2436// uiTextStretchCondensed.
2448
2449// uiNewStretchAttribute() creates a new uiAttribute that changes the
2450// stretch of the text it is applied to. It is an error to specify a strech
2451// not specified in uiTextStretch.
2453
2454// uiAttributeStretch() returns the font stretch stored in a. It is an
2455// error to call this on a uiAttribute that does not hold a font stretch.
2457
2458// uiNewColorAttribute() creates a new uiAttribute that changes the
2459// color of the text it is applied to. It is an error to specify an invalid
2460// color.
2461_UI_EXTERN uiAttribute *uiNewColorAttribute(double r, double g, double b, double a);
2462
2463// uiAttributeColor() returns the text color stored in a. It is an
2464// error to call this on a uiAttribute that does not hold a text color.
2465_UI_EXTERN void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha);
2466
2467// uiNewBackgroundAttribute() creates a new uiAttribute that
2468// changes the background color of the text it is applied to. It is an
2469// error to specify an invalid color.
2470_UI_EXTERN uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a);
2471
2472// TODO reuse uiAttributeColor() for background colors, or make a new function...
2473
2474// uiUnderline specifies a type of underline to use on text.
2479 uiUnderlineSuggestion, // wavy or dotted underlines used for spelling/grammar checkers
2480};
2481
2482// uiNewUnderlineAttribute() creates a new uiAttribute that changes
2483// the type of underline on the text it is applied to. It is an error to
2484// specify an underline type not specified in uiUnderline.
2486
2487// uiAttributeUnderline() returns the underline type stored in a. It is
2488// an error to call this on a uiAttribute that does not hold an underline
2489// style.
2491
2492// uiUnderlineColor specifies the color of any underline on the text it
2493// is applied to, regardless of the type of underline. In addition to
2494// being able to specify a custom color, you can explicitly specify
2495// platform-specific colors for suggestion underlines; to use them
2496// correctly, pair them with uiUnderlineSuggestion (though they can
2497// be used on other types of underline as well).
2498//
2499// If an underline type is applied but no underline color is
2500// specified, the text color is used instead. If an underline color
2501// is specified without an underline type, the underline color
2502// attribute is ignored, but not removed from the uiAttributedString.
2507 uiUnderlineColorAuxiliary, // for instance, the color used by smart replacements on macOS or in Microsoft Office
2508};
2509
2510// uiNewUnderlineColorAttribute() creates a new uiAttribute that
2511// changes the color of the underline on the text it is applied to.
2512// It is an error to specify an underline color not specified in
2513// uiUnderlineColor.
2514//
2515// If the specified color type is uiUnderlineColorCustom, it is an
2516// error to specify an invalid color value. Otherwise, the color values
2517// are ignored and should be specified as zero.
2518_UI_EXTERN uiAttribute *uiNewUnderlineColorAttribute(uiUnderlineColor u, double r, double g, double b, double a);
2519
2520// uiAttributeUnderlineColor() returns the underline color stored in
2521// a. It is an error to call this on a uiAttribute that does not hold an
2522// underline color.
2523_UI_EXTERN void uiAttributeUnderlineColor(const uiAttribute *a, uiUnderlineColor *u, double *r, double *g, double *b, double *alpha);
2524
2525// uiOpenTypeFeatures represents a set of OpenType feature
2526// tag-value pairs, for applying OpenType features to text.
2527// OpenType feature tags are four-character codes defined by
2528// OpenType that cover things from design features like small
2529// caps and swashes to language-specific glyph shapes and
2530// beyond. Each tag may only appear once in any given
2531// uiOpenTypeFeatures instance. Each value is a 32-bit integer,
2532// often used as a Boolean flag, but sometimes as an index to choose
2533// a glyph shape to use.
2534//
2535// If a font does not support a certain feature, that feature will be
2536// ignored. (TODO verify this on all OSs)
2537//
2538// See the OpenType specification at
2539// https://www.microsoft.com/typography/otspec/featuretags.htm
2540// for the complete list of available features, information on specific
2541// features, and how to use them.
2542// TODO invalid features
2544
2545// uiOpenTypeFeaturesForEachFunc is the type of the function
2546// invoked by uiOpenTypeFeaturesForEach() for every OpenType
2547// feature in otf. Refer to that function's documentation for more
2548// details.
2549typedef uiForEach (*uiOpenTypeFeaturesForEachFunc)(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value, void *data);
2550
2551// @role uiOpenTypeFeatures constructor
2552// uiNewOpenTypeFeatures() returns a new uiOpenTypeFeatures
2553// instance, with no tags yet added.
2555
2556// @role uiOpenTypeFeatures destructor
2557// uiFreeOpenTypeFeatures() frees otf.
2559
2560// uiOpenTypeFeaturesClone() makes a copy of otf and returns it.
2561// Changing one will not affect the other.
2563
2564// uiOpenTypeFeaturesAdd() adds the given feature tag and value
2565// to otf. The feature tag is specified by a, b, c, and d. If there is
2566// already a value associated with the specified tag in otf, the old
2567// value is removed.
2568_UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);
2569
2570// uiOpenTypeFeaturesRemove() removes the given feature tag
2571// and value from otf. If the tag is not present in otf,
2572// uiOpenTypeFeaturesRemove() does nothing.
2573_UI_EXTERN void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d);
2574
2575// uiOpenTypeFeaturesGet() determines whether the given feature
2576// tag is present in otf. If it is, *value is set to the tag's value and
2577// nonzero is returned. Otherwise, zero is returned.
2578//
2579// Note that if uiOpenTypeFeaturesGet() returns zero, value isn't
2580// changed. This is important: if a feature is not present in a
2581// uiOpenTypeFeatures, the feature is NOT treated as if its
2582// value was zero anyway. Script-specific font shaping rules and
2583// font-specific feature settings may use a different default value
2584// for a feature. You should likewise not treat a missing feature as
2585// having a value of zero either. Instead, a missing feature should
2586// be treated as having some unspecified default value.
2587_UI_EXTERN int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value);
2588
2589// uiOpenTypeFeaturesForEach() executes f for every tag-value
2590// pair in otf. The enumeration order is unspecified. You cannot
2591// modify otf while uiOpenTypeFeaturesForEach() is running.
2593
2594// uiNewFeaturesAttribute() creates a new uiAttribute that changes
2595// the font family of the text it is applied to. otf is copied; you may
2596// free it after uiNewFeaturesAttribute() returns.
2598
2599// uiAttributeFeatures() returns the OpenType features stored in a.
2600// The returned uiOpenTypeFeatures object is owned by a. It is an
2601// error to call this on a uiAttribute that does not hold OpenType
2602// features.
2604
2605// uiAttributedString represents a string of UTF-8 text that can
2606// optionally be embellished with formatting attributes. libui
2607// provides the list of formatting attributes, which cover common
2608// formatting traits like boldface and color as well as advanced
2609// typographical features provided by OpenType like superscripts
2610// and small caps. These attributes can be combined in a variety of
2611// ways.
2612//
2613// Attributes are applied to runs of Unicode codepoints in the string.
2614// Zero-length runs are elided. Consecutive runs that have the same
2615// attribute type and value are merged. Each attribute is independent
2616// of each other attribute; overlapping attributes of different types
2617// do not split each other apart, but different values of the same
2618// attribute type do.
2619//
2620// The empty string can also be represented by uiAttributedString,
2621// but because of the no-zero-length-attribute rule, it will not have
2622// attributes.
2623//
2624// A uiAttributedString takes ownership of all attributes given to
2625// it, as it may need to duplicate or delete uiAttribute objects at
2626// any time. By extension, when you free a uiAttributedString,
2627// all uiAttributes within will also be freed. Each method will
2628// describe its own rules in more details.
2629//
2630// In addition, uiAttributedString provides facilities for moving
2631// between grapheme clusters, which represent a character
2632// from the point of view of the end user. The cursor of a text editor
2633// is always placed on a grapheme boundary, so you can use these
2634// features to move the cursor left or right by one "character".
2635// TODO does uiAttributedString itself need this
2636//
2637// uiAttributedString does not provide enough information to be able
2638// to draw itself onto a uiDrawContext or respond to user actions.
2639// In order to do that, you'll need to use a uiDrawTextLayout, which
2640// is built from the combination of a uiAttributedString and a set of
2641// layout-specific properties.
2643
2644// uiAttributedStringForEachAttributeFunc is the type of the function
2645// invoked by uiAttributedStringForEachAttribute() for every
2646// attribute in s. Refer to that function's documentation for more
2647// details.
2648typedef uiForEach (*uiAttributedStringForEachAttributeFunc)(const uiAttributedString *s, const uiAttribute *a, size_t start, size_t end, void *data);
2649
2650// @role uiAttributedString constructor
2651// uiNewAttributedString() creates a new uiAttributedString from
2652// initialString. The string will be entirely unattributed.
2654
2655// @role uiAttributedString destructor
2656// uiFreeAttributedString() destroys the uiAttributedString s.
2657// It will also free all uiAttributes within.
2659
2660// uiAttributedStringString() returns the textual content of s as a
2661// '\0'-terminated UTF-8 string. The returned pointer is valid until
2662// the next change to the textual content of s.
2664
2665// uiAttributedStringLength() returns the number of UTF-8 bytes in
2666// the textual content of s, excluding the terminating '\0'.
2668
2669// uiAttributedStringAppendUnattributed() adds the '\0'-terminated
2670// UTF-8 string str to the end of s. The new substring will be
2671// unattributed.
2673
2674// uiAttributedStringInsertAtUnattributed() adds the '\0'-terminated
2675// UTF-8 string str to s at the byte position specified by at. The new
2676// substring will be unattributed; existing attributes will be moved
2677// along with their text.
2679
2680// TODO add the Append and InsertAtExtendingAttributes functions
2681// TODO and add functions that take a string + length
2682
2683// uiAttributedStringDelete() deletes the characters and attributes of
2684// s in the byte range [start, end).
2685_UI_EXTERN void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end);
2686
2687// 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
2688
2689// uiAttributedStringSetAttribute() sets a in the byte range [start, end)
2690// of s. Any existing attributes in that byte range of the same type are
2691// removed. s takes ownership of a; you should not use it after
2692// uiAttributedStringSetAttribute() returns.
2694
2695// uiAttributedStringForEachAttribute() enumerates all the
2696// uiAttributes in s. It is an error to modify s in f. Within f, s still
2697// owns the attribute; you can neither free it nor save it for later
2698// use.
2699// TODO reword the above for consistency (TODO and find out what I meant by that)
2700// TODO define an enumeration order (or mark it as undefined); also define how consecutive runs of identical attributes are handled here and sync with the definition of uiAttributedString itself
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// TODO const correct this somehow (the implementation needs to mutate the structure)
2711
2712// uiFontDescriptor provides a complete description of a font where
2713// one is needed. Currently, this means as the default font of a
2714// uiDrawTextLayout and as the data returned by uiFontButton.
2715// All the members operate like the respective uiAttributes.
2717
2719 // TODO const-correct this or figure out how to deal with this when getting a value
2720 char *Family;
2721 double Size;
2725};
2726
2729
2730// uiDrawTextLayout is a concrete representation of a
2731// uiAttributedString that can be displayed in a uiDrawContext.
2732// It includes information important for the drawing of a block of
2733// text, including the bounding box to wrap the text within, the
2734// alignment of lines of text within that box, areas to mark as
2735// being selected, and other things.
2736//
2737// Unlike uiAttributedString, the content of a uiDrawTextLayout is
2738// immutable once it has been created.
2739//
2740// TODO talk about OS-specific differences with text drawing that libui can't account for...
2742
2743// uiDrawTextAlign specifies the alignment of lines of text in a
2744// uiDrawTextLayout.
2745// TODO should this really have Draw in the name?
2751
2752// uiDrawTextLayoutParams describes a uiDrawTextLayout.
2753// DefaultFont is used to render any text that is not attributed
2754// sufficiently in String. Width determines the width of the bounding
2755// box of the text; the height is determined automatically.
2757
2758// TODO const-correct this somehow
2765
2766// @role uiDrawTextLayout constructor
2767// uiDrawNewTextLayout() creates a new uiDrawTextLayout from
2768// the given parameters.
2769//
2770// TODO
2771// - allow creating a layout out of a substring
2772// - allow marking compositon strings
2773// - allow marking selections, even after creation
2774// - add the following functions:
2775// - uiDrawTextLayoutHeightForWidth() (returns the height that a layout would need to be to display the entire string at a given width)
2776// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
2777// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
2778// - some function to fix up a range (for text editing)
2780
2781// @role uiDrawFreeTextLayout destructor
2782// uiDrawFreeTextLayout() frees tl. The underlying
2783// uiAttributedString is not freed.
2785
2786// uiDrawText() draws tl in c with the top-left point of tl at (x, y).
2787_UI_EXTERN void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y);
2788
2789// uiDrawTextLayoutExtents() returns the width and height of tl
2790// in width and height. The returned width may be smaller than
2791// the width passed into uiDrawNewTextLayout() depending on
2792// how the text in tl is wrapped. Therefore, you can use this
2793// function to get the actual size of the text layout.
2794_UI_EXTERN void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height);
2795
2796// TODO metrics functions
2797
2798// TODO number of lines visible for clipping rect, range visible for clipping rect?
2799
2800
2812#define uiFontButton(this) ((uiFontButton *) (this))
2813
2824
2838 void (*f)(uiFontButton *sender, void *senderData), void *data);
2839
2849
2863
2877
2878// TODO document drag captures
2880 // TODO document what these mean for scrolling areas
2881 double X;
2882 double Y;
2883
2884 // TODO see draw above
2887
2888 int Down;
2889 int Up;
2890
2892
2894
2895 uint64_t Held1To64;
2896};
2897
2939
2949
2950
2964#define uiColorButton(this) ((uiColorButton *) (this))
2965
2976_UI_EXTERN void uiColorButtonColor(uiColorButton *b, double *r, double *g, double *bl, double *a);
2977
2988_UI_EXTERN void uiColorButtonSetColor(uiColorButton *b, double r, double g, double bl, double a);
2989
3003 void (*f)(uiColorButton *sender, void *senderData), void *data);
3004
3012
3013
3029typedef struct uiForm uiForm;
3030#define uiForm(this) ((uiForm *) (this))
3031
3046_UI_EXTERN void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy);
3047
3055
3064_UI_EXTERN void uiFormDelete(uiForm *f, int index);
3065
3076
3087_UI_EXTERN void uiFormSetPadded(uiForm *f, int padded);
3088
3096
3097
3110
3123
3145typedef struct uiGrid uiGrid;
3146#define uiGrid(this) ((uiGrid *) (this))
3147
3163_UI_EXTERN void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3164
3180_UI_EXTERN void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
3181
3192
3203_UI_EXTERN void uiGridSetPadded(uiGrid *g, int padded);
3204
3212
3213
3234typedef struct uiImage uiImage;
3235
3247_UI_EXTERN uiImage *uiNewImage(double width, double height);
3248
3256
3273_UI_EXTERN void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int byteStride);
3274
3308
3324
3339
3353
3362
3373
3386
3402
3416
3430
3441
3452_UI_EXTERN uiTableValue *uiNewTableValueColor(double r, double g, double b, double a);
3453
3466_UI_EXTERN void uiTableValueColor(const uiTableValue *v, double *r, double *g, double *b, double *a);
3467
3468
3482
3505
3572
3581
3591
3604
3616
3629// TODO reordering/moving
3630
3632#define uiTableModelColumnNeverEditable (-1)
3634#define uiTableModelColumnAlwaysEditable (-2)
3635
3654
3677
3699typedef struct uiTable uiTable;
3700#define uiTable(this) ((uiTable *) (this))
3701
3720 const char *name,
3721 int textModelColumn,
3722 int textEditableModelColumn,
3724
3740 const char *name,
3741 int imageModelColumn);
3742
3765 const char *name,
3766 int imageModelColumn,
3767 int textModelColumn,
3768 int textEditableModelColumn,
3770
3787 const char *name,
3788 int checkboxModelColumn,
3789 int checkboxEditableModelColumn);
3790
3815 const char *name,
3816 int checkboxModelColumn,
3817 int checkboxEditableModelColumn,
3818 int textModelColumn,
3819 int textEditableModelColumn,
3821
3838 const char *name,
3839 int progressModelColumn);
3840
3862 const char *name,
3863 int buttonModelColumn,
3864 int buttonClickableModelColumn);
3865
3874
3883
3892
3893
3908 void (*f)(uiTable *t, int row, void *data),
3909 void *data);
3910
3928 void (*f)(uiTable *t, int row, void *data),
3929 void *data);
3930
3944 int column,
3945 uiSortIndicator indicator);
3946
3956
3971 void (*f)(uiTable *sender, int column, void *senderData), void *data);
3972
3982
3996_UI_EXTERN void uiTableColumnSetWidth(uiTable *t, int column, int width);
3997
4022
4032
4044
4059_UI_EXTERN void uiTableOnSelectionChanged(uiTable *t, void (*f)(uiTable *t, void *data), void *data);
4060
4069{
4071 int *Rows;
4072};
4073
4085
4098
4106
4117_UI_EXTERN void uiControlSetTooltip(uiControl *c, const char *tooltip);
4118
4119// Set an icon from an ICO icon buffer.
4120_UI_EXTERN void uiWindowSetIcon(uiWindow *w, const void *data, size_t length);
4121
4122// WIP - not supported on all platforms yet
4123typedef struct uiScroll uiScroll;
4126
4127// Experimental - use uiAttribute API on normal widgets
4129
4133#define uiOpenGLArea(this) ((uiOpenGLArea *) (this))
4134
4143
4151
4153 // The default value is either listed explicitly or the first of the given possible values
4154
4155 // Desired bit depths of the default framebuffer (integer number of bits).
4162
4163 // Stereoscopic rendering (boolean, 0 or 1).
4165
4166 // Number of samples to use for multisampling (integer number of samples).
4168
4169 // Whether the framebuffer should be sRGB capable (boolean, 0 or 1) - ignored on macOS.
4171
4172 // Whether the framebuffer should be double-buffered (boolean, 1 or 0).
4174
4175 // Whether to use OpenGL ES; if false, OpenGL is used (0 or 1) - ignored on macOS.
4177
4178 // Major and minor versions of OpenGL/OpenGL ES (integer version number).
4181
4182 // Whether the OpenGL context should be forward-compatible, with no deprecated functionality;
4183 // OpenGL 3.0+ only (boolean, 0 or 1) - ignored on macOS and generally dicouraged.
4185
4186 // Whether to create a debug context (boolean, 0 or 1) - ignored on macOS.
4188
4189 // Whether to use the Compatibility Profile; if false, the Core Profile is used (boolean, 0 or
4190 // 1) - on macOS the Core Profile is always used
4192
4193 // Whether to use Robustness (boolean, 0 or 1) - ignored on macOS.
4195};
4196
4200
4202void uiSetAppMetadata(const char *name, const char *version, const char *package);
4203
4204#ifdef __cplusplus
4205}
4206#endif
4207
4208#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:4010
uiSortIndicator
Sort indicators.
Definition ui.h:3477
Definition ui.h:2134
double AreaWidth
Definition ui.h:2138
double ClipWidth
Definition ui.h:2143
double ClipHeight
Definition ui.h:2144
double AreaHeight
Definition ui.h:2139
double ClipY
Definition ui.h:2142
uiDrawContext * Context
Definition ui.h:2135
double ClipX
Definition ui.h:2141
Definition ui.h:2090
void(* DragBroken)(uiAreaHandler *, uiArea *)
Definition ui.h:2097
int(* KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *)
Definition ui.h:2098
void(* Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *)
Definition ui.h:2091
void(* MouseCrossed)(uiAreaHandler *, uiArea *, int left)
Definition ui.h:2096
void(* MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *)
Definition ui.h:2093
Definition ui.h:2940
char Key
Definition ui.h:2941
int Up
Definition ui.h:2947
uiExtKey ExtKey
Definition ui.h:2942
uiModifiers Modifier
Definition ui.h:2943
uiModifiers Modifiers
Definition ui.h:2945
Definition ui.h:2879
int Count
Definition ui.h:2891
double X
Definition ui.h:2881
double AreaHeight
Definition ui.h:2886
int Down
Definition ui.h:2888
uint64_t Held1To64
Definition ui.h:2895
int Up
Definition ui.h:2889
uiModifiers Modifiers
Definition ui.h:2893
double Y
Definition ui.h:2882
double AreaWidth
Definition ui.h:2885
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.
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.
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.
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.
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.
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:113
uint32_t OSSignature
Definition ui.h:106
int(* Toplevel)(uiControl *)
Definition ui.h:112
void(* SetParent)(uiControl *, uiControl *)
Definition ui.h:111
void uiControlSetTooltip(uiControl *c, const char *tooltip)
Sets the control tooltip.
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:118
void(* Show)(uiControl *)
Definition ui.h:114
void(* Destroy)(uiControl *)
Definition ui.h:108
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:115
void uiControlSetParent(uiControl *c, uiControl *parent)
Sets the control's parent.
uint32_t TypeSignature
Definition ui.h:107
int(* Enabled)(uiControl *)
Definition ui.h:116
uiControl * uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr)
Allocates a uiControl.
uint32_t Signature
Definition ui.h:105
uiControl * uiControlParent(uiControl *c)
Returns the parent control.
uintptr_t(* Handle)(uiControl *)
Definition ui.h:109
void(* Enable)(uiControl *)
Definition ui.h:117
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:2222
double R
Definition ui.h:2224
double G
Definition ui.h:2225
double Pos
Definition ui.h:2223
double B
Definition ui.h:2226
double A
Definition ui.h:2227
Definition ui.h:2194
double Y1
Definition ui.h:2207
double B
Definition ui.h:2200
size_t NumStops
Definition ui.h:2210
double R
Definition ui.h:2198
double Y0
Definition ui.h:2205
double A
Definition ui.h:2201
uiDrawBrushGradientStop * Stops
Definition ui.h:2209
double X1
Definition ui.h:2206
double X0
Definition ui.h:2204
double OuterRadius
Definition ui.h:2208
double G
Definition ui.h:2199
uiDrawBrushType Type
Definition ui.h:2195
Definition ui.h:2185
double M32
Definition ui.h:2191
double M11
Definition ui.h:2186
double M22
Definition ui.h:2189
double M31
Definition ui.h:2190
double M21
Definition ui.h:2188
double M12
Definition ui.h:2187
Definition ui.h:2230
size_t NumDashes
Definition ui.h:2239
double DashPhase
Definition ui.h:2240
double * Dashes
Definition ui.h:2236
double Thickness
Definition ui.h:2234
double MiterLimit
Definition ui.h:2235
uiDrawLineJoin Join
Definition ui.h:2232
uiDrawLineCap Cap
Definition ui.h:2231
Definition ui.h:2759
uiAttributedString * String
Definition ui.h:2760
double Width
Definition ui.h:2762
uiFontDescriptor * DefaultFont
Definition ui.h:2761
uiDrawTextAlign Align
Definition ui.h:2763
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 uiEditableComboboxSetPlaceholder(uiEditableCombobox *c, const char *text)
Sets text to be displayed in the editable combo box when it is empty.
void uiEditableComboboxSetText(uiEditableCombobox *c, const char *text)
Sets the editable combo box text.
char * uiEditableComboboxPlaceholder(uiEditableCombobox *c)
Returns the editable combo box's placeholder.
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.
void uiEntrySetPlaceholder(uiEntry *e, const char *text)
Sets text to be displayed in the entry when it is empty.
uiEntry * uiNewEntry(void)
Creates a new entry.
char * uiEntryPlaceholder(uiEntry *e)
Returns the entry's placeholder.
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.
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:2718
uiTextItalic Italic
Definition ui.h:2723
uiTextWeight Weight
Definition ui.h:2722
char * Family
Definition ui.h:2720
uiTextStretch Stretch
Definition ui.h:2724
double Size
Definition ui.h:2721
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.
void uiGridSetPadded(uiGrid *g, int padded)
Sets whether or not controls within the grid are padded.
int uiGridPadded(uiGrid *g)
Returns whether or not controls within the grid are padded.
void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
Appends a control to the grid.
uiGrid * uiNewGrid(void)
Creates a new grid.
void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
Inserts a control positioned in relation to another control within the grid.
void uiGroupSetTitle(uiGroup *g, const char *title)
Sets the group title.
uiGroup * uiNewGroup(const char *title)
Creates a new group.
void uiGroupSetChild(uiGroup *g, uiControl *c)
Sets the group's child.
char * uiGroupTitle(uiGroup *g)
Returns the group title.
void uiGroupSetMargined(uiGroup *g, int margined)
Sets whether or not the group has a margin.
int uiGroupMargined(uiGroup *g)
Returns whether or not the group has a margin.
A container for an image to be displayed on screen.
uiImage * uiNewImage(double width, double height)
Creates a new image container.
void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int byteStride)
Appends a new image representation.
void uiFreeImage(uiImage *i)
Frees the image container and all associated resources.
Definition ui.h:60
size_t Size
Definition ui.h:61
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.
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.
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.
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.
Definition ui.h:4135
void(* DrawGL)(uiOpenGLAreaHandler *, uiOpenGLArea *, double width, double height)
Definition ui.h:4136
int(* KeyEvent)(uiOpenGLAreaHandler *, uiOpenGLArea *, uiAreaKeyEvent *)
Definition ui.h:4140
void(* MouseCrossed)(uiOpenGLAreaHandler *, uiOpenGLArea *, int left)
Definition ui.h:4138
void(* DragBroken)(uiOpenGLAreaHandler *, uiOpenGLArea *)
Definition ui.h:4139
void(* InitGL)(uiOpenGLAreaHandler *, uiOpenGLArea *)
Definition ui.h:4141
void(* MouseEvent)(uiOpenGLAreaHandler *, uiOpenGLArea *, uiAreaMouseEvent *)
Definition ui.h:4137
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.
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.
Definition ui.h:2243
int X
Definition ui.h:2244
int Height
Definition ui.h:2247
int Width
Definition ui.h:2246
int Y
Definition ui.h:2245
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.
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.
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.
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.
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:3520
void(* SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const uiTableValue *)
Sets the cell value for (row, column).
Definition ui.h:3570
int(* NumColumns)(uiTableModelHandler *, uiTableModel *)
Returns the number of columns in the uiTableModel.
Definition ui.h:3529
uiTableValueType(* ColumnType)(uiTableModelHandler *, uiTableModel *, int column)
Returns the column type in for of a uiTableValueType.
Definition ui.h:3537
int(* NumRows)(uiTableModelHandler *, uiTableModel *)
Returns the number of rows in the uiTableModel.
Definition ui.h:3542
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:3662
int RowBackgroundColorModelColumn
uiTableModel column that defines background color for each row,
Definition ui.h:3675
uiTableModel * Model
Model holding the data to be displayed.
Definition ui.h:3666
Holds an array of selected row indices for a table.
Definition ui.h:4069
void uiFreeTableSelection(uiTableSelection *s)
Frees the given uiTableSelection and all it's resources.
int * Rows
Array containing selected row indices, NULL on empty selection.
Definition ui.h:4071
int NumRows
Number of selected rows.
Definition ui.h:4070
Optional parameters to control the appearance of text columns.
Definition ui.h:3643
int ColorModelColumn
uiTableModel column that defines the text color for each cell.
Definition ui.h:3652
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.
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.
struct uiScroll uiScroll
Definition ui.h:4123
#define uiFontButton(this)
Definition ui.h:2812
uiOpenGLAttributes * uiNewOpenGLAttributes()
#define uiSlider(this)
Definition ui.h:1214
void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)
uiAttribute * uiNewUnderlineAttribute(uiUnderline u)
void uiFreeAttributedString(uiAttributedString *s)
struct uiOpenGLAttributes uiOpenGLAttributes
Definition ui.h:4132
uiWindowResizeEdge
Definition ui.h:2103
@ uiWindowResizeEdgeTop
Definition ui.h:2105
@ uiWindowResizeEdgeBottom
Definition ui.h:2107
@ uiWindowResizeEdgeBottomLeft
Definition ui.h:2110
@ uiWindowResizeEdgeLeft
Definition ui.h:2104
@ uiWindowResizeEdgeRight
Definition ui.h:2106
@ uiWindowResizeEdgeTopLeft
Definition ui.h:2108
@ uiWindowResizeEdgeBottomRight
Definition ui.h:2111
@ uiWindowResizeEdgeTopRight
Definition ui.h:2109
const uiOpenTypeFeatures * uiAttributeFeatures(const uiAttribute *a)
uiTableValueType
uiTableValue types.
Definition ui.h:3347
@ uiTableValueTypeImage
Definition ui.h:3349
@ uiTableValueTypeInt
Definition ui.h:3350
@ uiTableValueTypeColor
Definition ui.h:3351
@ uiTableValueTypeString
Definition ui.h:3348
uiOpenTypeFeatures * uiNewOpenTypeFeatures(void)
#define uiDateTimePicker(this)
Definition ui.h:1673
#define _UI_ENUM(s)
Definition ui.h:44
void uiFreeOpenGLAttributes(uiOpenGLAttributes *attribs)
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:3117
@ uiAtTop
Place above control.
Definition ui.h:3119
@ uiAtLeading
Place before control.
Definition ui.h:3118
@ uiAtBottom
Place below control.
Definition ui.h:3121
@ uiAtTrailing
Place behind control.
Definition ui.h:3120
#define uiMultilineEntry(this)
Definition ui.h:1746
void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)
struct uiAttributedString uiAttributedString
Definition ui.h:2642
uiAttribute * uiNewSizeAttribute(double size)
#define uiGroup(this)
Definition ui.h:1064
void uiLoadControlFont(uiFontDescriptor *f)
const char * uiInit(uiInitOptions *options)
void uiLabelSetAttribute(uiLabel *label, uiAttribute *attr)
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)
#define uiProgressBar(this)
Definition ui.h:1322
uiForEach(* uiAttributedStringForEachAttributeFunc)(const uiAttributedString *s, const uiAttribute *a, size_t start, size_t end, void *data)
Definition ui.h:2648
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 uiOpenGLAreaBeginUserWindowResize(uiOpenGLArea *a, uiWindowResizeEdge edge)
#define uiSeparator(this)
Definition ui.h:1365
void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha)
uiTextItalic
Definition ui.h:2411
@ uiTextItalicOblique
Definition ui.h:2413
@ uiTextItalicItalic
Definition ui.h:2414
@ uiTextItalicNormal
Definition ui.h:2412
void uiDrawPathLineTo(uiDrawPath *p, double x, double y)
void uiDrawFreePath(uiDrawPath *p)
void uiOpenGLAreaSetVSync(uiOpenGLArea *a, int v)
void uiDrawBitmapUpdate(uiDrawBitmap *bmp, const void *data)
uiModifiers
Keyboard modifier keys.
Definition ui.h:2871
@ uiModifierAlt
Alternate/Option key.
Definition ui.h:2873
@ uiModifierSuper
Super/Command/Windows key.
Definition ui.h:2875
@ uiModifierShift
Shift key.
Definition ui.h:2874
@ uiModifierCtrl
Control key.
Definition ui.h:2872
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)
uiOpenGLArea * uiNewOpenGLArea(uiOpenGLAreaHandler *ah, uiOpenGLAttributes *attribs)
uiDrawTextAlign
Definition ui.h:2746
@ uiDrawTextAlignCenter
Definition ui.h:2748
@ uiDrawTextAlignLeft
Definition ui.h:2747
@ uiDrawTextAlignRight
Definition ui.h:2749
void uiFreeInitError(const char *err)
#define uiArea(this)
Definition ui.h:2117
void uiOpenGLAreaSwapBuffers(uiOpenGLArea *a)
void uiOpenGLAttributesSetAttribute(uiOpenGLAttributes *attribs, uiOpenGLAttribute attribute, int value)
uiForEach(* uiOpenTypeFeaturesForEachFunc)(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value, void *data)
Definition ui.h:2549
struct uiAttribute uiAttribute
Definition ui.h:2317
int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
#define uiMenuItem(this)
Definition ui.h:1842
struct uiDrawPath uiDrawPath
Definition ui.h:2147
struct uiTableValue uiTableValue
Definition ui.h:3323
uiDrawTextLayout * uiDrawNewTextLayout(uiDrawTextLayoutParams *params)
uiAttributeType uiAttributeGetType(const uiAttribute *a)
struct uiTableModel uiTableModel
Definition ui.h:3504
uiTextWeight
Definition ui.h:2380
@ uiTextWeightMaximum
Definition ui.h:2393
@ uiTextWeightNormal
Definition ui.h:2386
@ uiTextWeightBook
Definition ui.h:2385
@ uiTextWeightMedium
Definition ui.h:2387
@ uiTextWeightUltraLight
Definition ui.h:2383
@ uiTextWeightBold
Definition ui.h:2389
@ uiTextWeightUltraBold
Definition ui.h:2390
@ uiTextWeightSemiBold
Definition ui.h:2388
@ uiTextWeightUltraHeavy
Definition ui.h:2392
@ uiTextWeightLight
Definition ui.h:2384
@ uiTextWeightThin
Definition ui.h:2382
@ uiTextWeightMinimum
Definition ui.h:2381
@ uiTextWeightHeavy
Definition ui.h:2391
struct uiDrawContext uiDrawContext
Definition ui.h:2088
int uiDrawMatrixInvertible(uiDrawMatrix *m)
void uiQuit(void)
void uiAreaQueueRedrawAll(uiArea *a)
struct uiDrawBitmap uiDrawBitmap
Definition ui.h:2154
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 uiWindowSetIcon(uiWindow *w, const void *data, size_t length)
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)
uiOpenGLAttribute
Definition ui.h:4152
@ uiOpenGLAttributeMinorVersion
Definition ui.h:4180
@ uiOpenGLAttributeDebugContext
Definition ui.h:4187
@ uiOpenGLAttributeDoubleBuffer
Definition ui.h:4173
@ uiOpenGLAttributeMajorVersion
Definition ui.h:4179
@ uiOpenGLAttributeSamples
Definition ui.h:4167
@ uiOpenGLAttributeUseOpenGLES
Definition ui.h:4176
@ uiOpenGLAttributeStencilBits
Definition ui.h:4161
@ uiOpenGLAttributeGreenBits
Definition ui.h:4157
@ uiOpenGLAttributeStereo
Definition ui.h:4164
@ uiOpenGLAttributeSRGBCapable
Definition ui.h:4170
@ uiOpenGLAttributeDepthBits
Definition ui.h:4160
@ uiOpenGLAttributeBlueBits
Definition ui.h:4158
@ uiOpenGLAttributeCompatProfile
Definition ui.h:4191
@ uiOpenGLAttributeRobustness
Definition ui.h:4194
@ uiOpenGLAttributeAlphaBits
Definition ui.h:4159
@ uiOpenGLAttributeRedBits
Definition ui.h:4156
@ uiOpenGLAttributeForwardCompat
Definition ui.h:4184
#define uiLabel(this)
Definition ui.h:892
uiAttribute * uiNewFeaturesAttribute(const uiOpenTypeFeatures *otf)
void uiDrawClip(uiDrawContext *c, uiDrawPath *path)
uiUnderline uiAttributeUnderline(const uiAttribute *a)
#define uiControl(this)
Definition ui.h:121
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)
#define uiRadioButtons(this)
Definition ui.h:1600
uiAttributeType
Definition ui.h:2330
@ uiAttributeTypeUnderline
Definition ui.h:2338
@ uiAttributeTypeBackground
Definition ui.h:2337
@ uiAttributeTypeFamily
Definition ui.h:2331
@ uiAttributeTypeItalic
Definition ui.h:2334
@ uiAttributeTypeColor
Definition ui.h:2336
@ uiAttributeTypeUnderlineColor
Definition ui.h:2339
@ uiAttributeTypeStretch
Definition ui.h:2335
@ uiAttributeTypeSize
Definition ui.h:2332
@ uiAttributeTypeFeatures
Definition ui.h:2340
@ uiAttributeTypeWeight
Definition ui.h:2333
void uiAreaBeginUserWindowMove(uiArea *a)
void uiSetAppMetadata(const char *name, const char *version, const char *package)
Sets metadata for this application context, call before uiInit.
uiUnderline
Definition ui.h:2475
@ uiUnderlineSuggestion
Definition ui.h:2479
@ uiUnderlineSingle
Definition ui.h:2477
@ uiUnderlineDouble
Definition ui.h:2478
@ uiUnderlineNone
Definition ui.h:2476
#define uiWindow(this)
Definition ui.h:291
uiExtKey
Definition ui.h:2898
@ uiExtKeyF8
Definition ui.h:2917
@ uiExtKeyNSubtract
Definition ui.h:2935
@ uiExtKeyF5
Definition ui.h:2914
@ uiExtKeyF3
Definition ui.h:2912
@ uiExtKeyN3
Definition ui.h:2925
@ uiExtKeyPageUp
Definition ui.h:2904
@ uiExtKeyF12
Definition ui.h:2921
@ uiExtKeyF4
Definition ui.h:2913
@ uiExtKeyRight
Definition ui.h:2909
@ uiExtKeyNDot
Definition ui.h:2932
@ uiExtKeyDelete
Definition ui.h:2901
@ uiExtKeyNAdd
Definition ui.h:2934
@ uiExtKeyN6
Definition ui.h:2928
@ uiExtKeyNEnter
Definition ui.h:2933
@ uiExtKeyDown
Definition ui.h:2907
@ uiExtKeyF10
Definition ui.h:2919
@ uiExtKeyN8
Definition ui.h:2930
@ uiExtKeyN4
Definition ui.h:2926
@ uiExtKeyInsert
Definition ui.h:2900
@ uiExtKeyN0
Definition ui.h:2922
@ uiExtKeyN5
Definition ui.h:2927
@ uiExtKeyN1
Definition ui.h:2923
@ uiExtKeyF11
Definition ui.h:2920
@ uiExtKeyF1
Definition ui.h:2910
@ uiExtKeyF2
Definition ui.h:2911
@ uiExtKeyF6
Definition ui.h:2915
@ uiExtKeyLeft
Definition ui.h:2908
@ uiExtKeyUp
Definition ui.h:2906
@ uiExtKeyEscape
Definition ui.h:2899
@ uiExtKeyF7
Definition ui.h:2916
@ uiExtKeyN7
Definition ui.h:2929
@ uiExtKeyNDivide
Definition ui.h:2937
@ uiExtKeyEnd
Definition ui.h:2903
@ uiExtKeyN2
Definition ui.h:2924
@ uiExtKeyHome
Definition ui.h:2902
@ uiExtKeyF9
Definition ui.h:2918
@ uiExtKeyPageDown
Definition ui.h:2905
@ uiExtKeyN9
Definition ui.h:2931
@ uiExtKeyNMultiply
Definition ui.h:2936
#define uiForm(this)
Definition ui.h:3030
#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)
void uiOpenGLAreaMakeCurrent(uiOpenGLArea *a)
#define uiButton(this)
Definition ui.h:548
uiDrawLineJoin
Definition ui.h:2169
@ uiDrawLineJoinRound
Definition ui.h:2171
@ uiDrawLineJoinMiter
Definition ui.h:2170
@ uiDrawLineJoinBevel
Definition ui.h:2172
void uiFreeFontDescriptor(uiFontDescriptor *desc)
void uiDrawBitmapDraw(uiDrawContext *c, uiDrawBitmap *bmp, uiRect *srcrect, uiRect *dstrect, int filter)
#define uiCombobox(this)
Definition ui.h:1393
const char * uiAttributeFamily(const uiAttribute *a)
void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)
#define uiMenu(this)
Definition ui.h:1929
uiDrawFillMode
Definition ui.h:2180
@ uiDrawFillModeWinding
Definition ui.h:2181
@ uiDrawFillModeAlternate
Definition ui.h:2182
void uiOpenGLAreaQueueRedrawAll(uiOpenGLArea *a)
uiDrawLineCap
Definition ui.h:2163
@ uiDrawLineCapRound
Definition ui.h:2165
@ uiDrawLineCapFlat
Definition ui.h:2164
@ uiDrawLineCapSquare
Definition ui.h:2166
void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)
#define uiSpinbox(this)
Definition ui.h:1145
void uiOpenGLAreaBeginUserWindowMove(uiOpenGLArea *a)
void uiDrawMatrixTransformSize(uiDrawMatrix *m, double *x, double *y)
void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf)
uiTextItalic uiAttributeItalic(const uiAttribute *a)
void uiDrawMatrixSetIdentity(uiDrawMatrix *m)
#define uiCheckbox(this)
Definition ui.h:696
void uiAreaSetSize(uiArea *a, int width, int height)
void uiDrawPathCloseFigure(uiDrawPath *p)
uiScroll * uiNewScroll(void)
#define uiTable(this)
Definition ui.h:3700
struct uiOpenTypeFeatures uiOpenTypeFeatures
Definition ui.h:2543
void uiAttributedStringSetAttribute(uiAttributedString *s, uiAttribute *a, size_t start, size_t end)
#define uiGrid(this)
Definition ui.h:3146
uiDrawBitmap * uiDrawNewBitmap(uiDrawContext *c, int width, int height)
void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
uiAttribute * uiNewItalicAttribute(uiTextItalic italic)
int uiDrawMatrixInvert(uiDrawMatrix *m)
#define uiBox(this)
Definition ui.h:610
void uiUserBugCannotSetParentOnToplevel(const char *type)
struct uiDrawTextLayout uiDrawTextLayout
Definition ui.h:2741
void uiScrollSetChild(uiScroll *scroll, uiControl *ctl)
#define uiTab(this)
Definition ui.h:939
#define uiEditableCombobox(this)
Definition ui.h:1504
uiUnderlineColor
Definition ui.h:2503
@ uiUnderlineColorCustom
Definition ui.h:2504
@ uiUnderlineColorAuxiliary
Definition ui.h:2507
@ uiUnderlineColorGrammar
Definition ui.h:2506
@ uiUnderlineColorSpelling
Definition ui.h:2505
void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height)
#define uiOpenGLArea(this)
Definition ui.h:4133
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:3104
@ uiAlignStart
Place at start.
Definition ui.h:3106
@ uiAlignEnd
Place at end.
Definition ui.h:3108
@ uiAlignFill
Fill area.
Definition ui.h:3105
@ uiAlignCenter
Place in center.
Definition ui.h:3107
uiDrawBrushType
Definition ui.h:2156
@ uiDrawBrushTypeImage
Definition ui.h:2160
@ uiDrawBrushTypeSolid
Definition ui.h:2157
@ uiDrawBrushTypeLinearGradient
Definition ui.h:2158
@ uiDrawBrushTypeRadialGradient
Definition ui.h:2159
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:2437
@ uiTextStretchSemiCondensed
Definition ui.h:2441
@ uiTextStretchExpanded
Definition ui.h:2444
@ uiTextStretchExtraExpanded
Definition ui.h:2445
@ uiTextStretchUltraExpanded
Definition ui.h:2446
@ uiTextStretchExtraCondensed
Definition ui.h:2439
@ uiTextStretchCondensed
Definition ui.h:2440
@ uiTextStretchSemiExpanded
Definition ui.h:2443
@ uiTextStretchNormal
Definition ui.h:2442
@ uiTextStretchUltraCondensed
Definition ui.h:2438
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
void uiFreeAttribute(uiAttribute *a)
void uiDrawFreeBitmap(uiDrawBitmap *bmp)
uiAttribute * uiNewStretchAttribute(uiTextStretch stretch)
int uiMainStep(int wait)
#define uiEntry(this)
Definition ui.h:774
#define uiColorButton(this)
Definition ui.h:2964
@ uiTableSelectionModeZeroOrMany
Allow zero or many (multiple) rows to be selected.
Definition ui.h:4020
@ uiTableSelectionModeZeroOrOne
Allow zero or one row to be selected.
Definition ui.h:4018
@ uiTableSelectionModeNone
Allow no row selection.
Definition ui.h:4017
@ uiTableSelectionModeOne
Allow for exactly one row to be selected.
Definition ui.h:4019
@ uiSortIndicatorNone
Definition ui.h:3478
@ uiSortIndicatorDescending
Definition ui.h:3480
@ uiSortIndicatorAscending
Definition ui.h:3479