ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
ProgressBar.h
Go to the documentation of this file.
1/*
2 * ObjectivelyMVC: Object oriented MVC framework for OpenGL, SDL2 and GNU C.
3 * Copyright (C) 2014 Jay Dolan <jay@jaydolan.com>
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source distribution.
22 */
23
24#pragma once
25
28
35
36typedef struct ProgressBar ProgressBar;
37typedef struct ProgressBarInterface ProgressBarInterface;
38
43
47 ident self;
48
54 void (*didSetValue)(ProgressBar *progressBar, double value);
55};
56
62
67
72 ProgressBarInterface *interface;
73
79
84
90
95
100
104 double min, max;
105
109 double value;
110};
111
115struct ProgressBarInterface {
116
120 ViewInterface viewInterface;
121
128 void (*formatLabel)(ProgressBar *self);
129
138 ProgressBar *(*initWithFrame)(ProgressBar *self, const SDL_Rect *frame);
139
146 double (*progress)(const ProgressBar *self);
147
155 void (*setLabelFormat)(ProgressBar *self, const char *labelFormat);
156
164 void (*setValue)(ProgressBar *self, double value);
165};
166
ImageViews render an Image in the context of a View hierarchy.
The Label type.
static void setValue(ProgressBar *self, double value)
Definition: ProgressBar.c:159
static double progress(const ProgressBar *self)
Definition: ProgressBar.c:137
static void setLabelFormat(ProgressBar *self, const char *labelFormat)
Definition: ProgressBar.c:145
static void formatLabel(ProgressBar *self)
Definition: ProgressBar.c:90
#define OBJECTIVELYMVC_EXPORT
Definition: Types.h:39
ImageViews render an Image in the context of a View hierarchy.
Definition: ImageView.h:43
The ProgressBar delegate protocol.
Definition: ProgressBar.h:42
ident self
The delegate self-reference.
Definition: ProgressBar.h:47
void(* didSetValue)(ProgressBar *progressBar, double value)
Delegate callback for ProgressBar value modification.
Definition: ProgressBar.h:54
The ProgressBar type.
Definition: ProgressBar.h:61
double min
The progress bounds.
Definition: ProgressBar.h:104
double value
The progress value.
Definition: ProgressBar.h:109
Text * label
The progress Text.
Definition: ProgressBar.h:94
ImageView * background
The background ImageView.
Definition: ProgressBar.h:78
ImageView * foreground
The foreground ImageView.
Definition: ProgressBar.h:89
ProgressBarDelegate delegate
The delegate.
Definition: ProgressBar.h:83
ProgressBarInterface * interface
The interface.
Definition: ProgressBar.h:72
Class * _ProgressBar(void)
The ProgressBar archetype.
Definition: ProgressBar.c:204
char * labelFormat
The Label format, e.g. "%0.0lf".
Definition: ProgressBar.h:99
View view
The superclass.
Definition: ProgressBar.h:66
double max
Definition: ProgressBar.h:104
Text rendered with TrueType fonts.
Definition: Text.h:41
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition: View.h:133