CoreGTK 3.22.0 CoreGTK is an Objective-C language binding for the GTK+ widget toolkit

CGTKLevelBar.m
1 /*
2 * CGTKLevelBar.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2017 - Tyler Burton
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /*
23 * Modified by the CoreGTK Team, 2017. See the AUTHORS file for a
24 * list of people on the CoreGTK Team.
25 * See the ChangeLog files for a list of changes.
26 *
27 */
28
29 /*
30 * Objective-C imports
31 */
32 #import "CoreGTK/CGTKLevelBar.h"
33
34 @implementation CGTKLevelBar
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_level_bar_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(id)initForIntervalWithMinValue:(gdouble) minValue andMaxValue:(gdouble) maxValue
49 {
50 self = [super initWithGObject:(GObject *)gtk_level_bar_new_for_interval(minValue, maxValue)];
51
52 if(self)
53 {
54 //Do nothing
55 }
56
57 return self;
58 }
59
60 -(GtkLevelBar*)LEVELBAR
61 {
62 return GTK_LEVEL_BAR([self GOBJECT]);
63 }
64
65 -(void)addOffsetValueWithName:(NSString*) name andValue:(gdouble) value
66 {
67 gtk_level_bar_add_offset_value(GTK_LEVEL_BAR([self GOBJECT]), [name UTF8String], value);
68 }
69
70 -(BOOL)getInverted
71 {
72 return (gtk_level_bar_get_inverted(GTK_LEVEL_BAR([self GOBJECT])) ? YES : NO);
73 }
74
75 -(gdouble)getMaxValue
76 {
77 return gtk_level_bar_get_max_value(GTK_LEVEL_BAR([self GOBJECT]));
78 }
79
80 -(gdouble)getMinValue
81 {
82 return gtk_level_bar_get_min_value(GTK_LEVEL_BAR([self GOBJECT]));
83 }
84
85 -(GtkLevelBarMode)getMode
86 {
87 return gtk_level_bar_get_mode(GTK_LEVEL_BAR([self GOBJECT]));
88 }
89
90 -(BOOL)getOffsetValueWithName:(NSString*) name andValue:(gdouble*) value
91 {
92 return (gtk_level_bar_get_offset_value(GTK_LEVEL_BAR([self GOBJECT]), [name UTF8String], value) ? YES : NO);
93 }
94
95 -(gdouble)getValue
96 {
97 return gtk_level_bar_get_value(GTK_LEVEL_BAR([self GOBJECT]));
98 }
99
100 -(void)removeOffsetValue:(NSString*) name
101 {
102 gtk_level_bar_remove_offset_value(GTK_LEVEL_BAR([self GOBJECT]), [name UTF8String]);
103 }
104
105 -(void)setInverted:(BOOL) inverted
106 {
107 gtk_level_bar_set_inverted(GTK_LEVEL_BAR([self GOBJECT]), (inverted ? TRUE : FALSE));
108 }
109
110 -(void)setMaxValue:(gdouble) value
111 {
112 gtk_level_bar_set_max_value(GTK_LEVEL_BAR([self GOBJECT]), value);
113 }
114
115 -(void)setMinValue:(gdouble) value
116 {
117 gtk_level_bar_set_min_value(GTK_LEVEL_BAR([self GOBJECT]), value);
118 }
119
120 -(void)setMode:(GtkLevelBarMode) mode
121 {
122 gtk_level_bar_set_mode(GTK_LEVEL_BAR([self GOBJECT]), mode);
123 }
124
125 -(void)setValue:(gdouble) value
126 {
127 gtk_level_bar_set_value(GTK_LEVEL_BAR([self GOBJECT]), value);
128 }
129
130
131 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKLevelBar getValue]
gdouble getValue()
Definition: CGTKLevelBar.m:95
-[CGTKLevelBar getInverted]
BOOL getInverted()
Definition: CGTKLevelBar.m:70
-[CGTKLevelBar getMode]
GtkLevelBarMode getMode()
Definition: CGTKLevelBar.m:85
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKLevelBar getMinValue]
gdouble getMinValue()
Definition: CGTKLevelBar.m:80
-[CGTKLevelBar LEVELBAR]
GtkLevelBar * LEVELBAR()
Definition: CGTKLevelBar.m:60
-[CGTKLevelBar getMaxValue]
gdouble getMaxValue()
Definition: CGTKLevelBar.m:75
CGTKLevelBar
Definition: CGTKLevelBar.h:34
-[CGTKLevelBar init]
id init()
Definition: CGTKLevelBar.m:36