ObjectivelyMVC
0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Sources
ObjectivelyMVC
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
26
#include <
ObjectivelyMVC/ImageView.h
>
27
#include <
ObjectivelyMVC/Label.h
>
28
34
typedef
struct
ProgressBarDelegate
ProgressBarDelegate
;
35
36
typedef
struct
ProgressBar
ProgressBar
;
37
typedef
struct
ProgressBarInterface ProgressBarInterface;
38
42
struct
ProgressBarDelegate
{
43
47
ident
self
;
48
54
void (*
didSetValue
)(
ProgressBar
*progressBar,
double
value);
55
};
56
61
struct
ProgressBar
{
62
66
View
view
;
67
72
ProgressBarInterface *
interface
;
73
78
ImageView
*
background
;
79
83
ProgressBarDelegate
delegate
;
84
89
ImageView
*
foreground
;
90
94
Text
*
label
;
95
99
char
*
labelFormat
;
100
104
double
min
,
max
;
105
109
double
value
;
110
};
111
115
struct
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
173
OBJECTIVELYMVC_EXPORT
Class *
_ProgressBar
(
void
);
ImageView.h
ImageViews render an Image in the context of a View hierarchy.
Label.h
The Label type.
setValue
static void setValue(ProgressBar *self, double value)
Definition:
ProgressBar.c:159
progress
static double progress(const ProgressBar *self)
Definition:
ProgressBar.c:137
setLabelFormat
static void setLabelFormat(ProgressBar *self, const char *labelFormat)
Definition:
ProgressBar.c:145
formatLabel
static void formatLabel(ProgressBar *self)
Definition:
ProgressBar.c:90
OBJECTIVELYMVC_EXPORT
#define OBJECTIVELYMVC_EXPORT
Definition:
Types.h:39
ImageView
ImageViews render an Image in the context of a View hierarchy.
Definition:
ImageView.h:43
ProgressBarDelegate
The ProgressBar delegate protocol.
Definition:
ProgressBar.h:42
ProgressBarDelegate::self
ident self
The delegate self-reference.
Definition:
ProgressBar.h:47
ProgressBarDelegate::didSetValue
void(* didSetValue)(ProgressBar *progressBar, double value)
Delegate callback for ProgressBar value modification.
Definition:
ProgressBar.h:54
ProgressBar
The ProgressBar type.
Definition:
ProgressBar.h:61
ProgressBar::min
double min
The progress bounds.
Definition:
ProgressBar.h:104
ProgressBar::value
double value
The progress value.
Definition:
ProgressBar.h:109
ProgressBar::label
Text * label
The progress Text.
Definition:
ProgressBar.h:94
ProgressBar::background
ImageView * background
The background ImageView.
Definition:
ProgressBar.h:78
ProgressBar::foreground
ImageView * foreground
The foreground ImageView.
Definition:
ProgressBar.h:89
ProgressBar::delegate
ProgressBarDelegate delegate
The delegate.
Definition:
ProgressBar.h:83
ProgressBar::interface
ProgressBarInterface * interface
The interface.
Definition:
ProgressBar.h:72
ProgressBar::_ProgressBar
Class * _ProgressBar(void)
The ProgressBar archetype.
Definition:
ProgressBar.c:204
ProgressBar::labelFormat
char * labelFormat
The Label format, e.g. "%0.0lf".
Definition:
ProgressBar.h:99
ProgressBar::view
View view
The superclass.
Definition:
ProgressBar.h:66
ProgressBar::max
double max
Definition:
ProgressBar.h:104
Text
Text rendered with TrueType fonts.
Definition:
Text.h:41
View
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition:
View.h:133
Generated on Mon Aug 29 2022 09:32:58 for ObjectivelyMVC by
1.9.3