diff options
Diffstat (limited to 'include/ui.h')
| -rw-r--r-- | include/ui.h | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/include/ui.h b/include/ui.h index 8570552..d8df105 100644 --- a/include/ui.h +++ b/include/ui.h | |||
| @@ -139,12 +139,7 @@ typedef struct uiWidgetEvent { | |||
| 139 | // ----------------------------------------------------------------------------- | 139 | // ----------------------------------------------------------------------------- |
| 140 | // Library. | 140 | // Library. |
| 141 | 141 | ||
| 142 | /// Initialize the UI library. | ||
| 143 | /// This should be called once during application startup. | ||
| 144 | bool uiInit(void); | 142 | bool uiInit(void); |
| 145 | |||
| 146 | /// Shutdown the UI library. | ||
| 147 | /// This should be called once during application shutdown. | ||
| 148 | void uiShutdown(void); | 143 | void uiShutdown(void); |
| 149 | 144 | ||
| 150 | // ----------------------------------------------------------------------------- | 145 | // ----------------------------------------------------------------------------- |
| @@ -164,65 +159,40 @@ uiTable* uiGetTablePtr(uiPtr ptr); | |||
| 164 | // Widget. | 159 | // Widget. |
| 165 | 160 | ||
| 166 | uiWidgetType uiWidgetGetType(const uiWidget*); | 161 | uiWidgetType uiWidgetGetType(const uiWidget*); |
| 167 | 162 | void uiWidgetSetParent(uiPtr child, uiPtr parent); | |
| 168 | void uiWidgetSetParent(uiPtr child, uiPtr parent); | ||
| 169 | 163 | ||
| 170 | // ----------------------------------------------------------------------------- | 164 | // ----------------------------------------------------------------------------- |
| 171 | // Button. | 165 | // Button. |
| 172 | 166 | ||
| 173 | /// Create a button. | ||
| 174 | uiButton* uiMakeButton(const char* text); | 167 | uiButton* uiMakeButton(const char* text); |
| 175 | 168 | ||
| 176 | // ----------------------------------------------------------------------------- | 169 | // ----------------------------------------------------------------------------- |
| 177 | // Frame. | 170 | // Frame. |
| 178 | 171 | ||
| 179 | /// Create a frame. | ||
| 180 | uiFrame* uiMakeFrame(void); | 172 | uiFrame* uiMakeFrame(void); |
| 181 | 173 | void uiDestroyFrame(uiFrame**); | |
| 182 | /// Destroy the frame. | 174 | void uiResizeFrame(uiFrame*, int width, int height); |
| 183 | void uiDestroyFrame(uiFrame**); | 175 | uiSize uiGetFrameSize(const uiFrame*); |
| 184 | |||
| 185 | /// Resize the frame. | ||
| 186 | void uiResizeFrame(uiFrame*, int width, int height); | ||
| 187 | |||
| 188 | /// Get the frame's dimensions. | ||
| 189 | uiSize uiGetFrameSize(const uiFrame*); | ||
| 190 | 176 | ||
| 191 | // ----------------------------------------------------------------------------- | 177 | // ----------------------------------------------------------------------------- |
| 192 | // Label. | 178 | // Label. |
| 193 | 179 | ||
| 194 | /// Create a label. | 180 | uiLabel* uiMakeLabel(const char* text); |
| 195 | uiLabel* uiMakeLabel(const char* text); | ||
| 196 | |||
| 197 | /// Return the label's text. | ||
| 198 | const char* uiLabelGetText(const uiLabel*); | 181 | const char* uiLabelGetText(const uiLabel*); |
| 199 | 182 | ||
| 200 | // ----------------------------------------------------------------------------- | 183 | // ----------------------------------------------------------------------------- |
| 201 | // Table. | 184 | // Table. |
| 202 | 185 | ||
| 203 | /// Create a table. | 186 | uiTable* uiMakeTable(int rows, int cols, const char** header); |
| 204 | uiTable* uiMakeTable(int rows, int cols, const char** header); | 187 | void uiTableClear(uiTable*); |
| 205 | 188 | void uiTableAddRow(uiTable*, const char** row); | |
| 206 | /// Clear the table. | 189 | void uiTableSet(uiTable*, int row, int col, uiPtr widget); |
| 207 | /// This clears the contents, but not the header. | ||
| 208 | void uiTableClear(uiTable*); | ||
| 209 | |||
| 210 | /// Add a row. | ||
| 211 | void uiTableAddRow(uiTable*, const char** row); | ||
| 212 | |||
| 213 | /// Set the table's cell. | ||
| 214 | void uiTableSet(uiTable*, int row, int col, uiPtr widget); | ||
| 215 | |||
| 216 | /// Get the table's cell. | ||
| 217 | const uiWidget* uiTableGet(const uiTable*, int row, int col); | 190 | const uiWidget* uiTableGet(const uiTable*, int row, int col); |
| 218 | 191 | uiWidget* uiTableGetMut(uiTable*, int row, int col); | |
| 219 | /// Get the table's cell. | ||
| 220 | uiWidget* uiTableGetMut(uiTable*, int row, int col); | ||
| 221 | 192 | ||
| 222 | // ----------------------------------------------------------------------------- | 193 | // ----------------------------------------------------------------------------- |
| 223 | // Rendering. | 194 | // Rendering. |
| 224 | 195 | ||
| 225 | /// Render the frame. | ||
| 226 | void uiRender(const uiFrame*, uiSurface*); | 196 | void uiRender(const uiFrame*, uiSurface*); |
| 227 | 197 | ||
| 228 | // ----------------------------------------------------------------------------- | 198 | // ----------------------------------------------------------------------------- |
