Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/yabause/src/gtk/yuipage.c
2 views
1
/* Copyright 2006 Guillaume Duhamel
2
3
This file is part of Yabause.
4
5
Yabause is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
10
Yabause is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with Yabause; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
20
#include <gtk/gtk.h>
21
22
#include "yuifileentry.h"
23
#include "yuirange.h"
24
#include "yuiresolution.h"
25
#include "yuipage.h"
26
#include "../core.h"
27
28
static void yui_page_class_init (YuiPageClass * klass);
29
static void yui_page_init (YuiPage * yfe);
30
31
GType yui_page_get_type (void) {
32
static GType yfe_type = 0;
33
34
if (!yfe_type)
35
{
36
static const GTypeInfo yfe_info =
37
{
38
sizeof (YuiPageClass),
39
NULL, /* base_init */
40
NULL, /* base_finalize */
41
(GClassInitFunc) yui_page_class_init,
42
NULL, /* class_finalize */
43
NULL, /* class_data */
44
sizeof (YuiPage),
45
0,
46
(GInstanceInitFunc) yui_page_init,
47
NULL,
48
};
49
50
yfe_type = g_type_register_static(GTK_TYPE_VBOX, "YuiPage", &yfe_info, 0);
51
}
52
53
return yfe_type;
54
}
55
56
static void yui_page_class_init (UNUSED YuiPageClass * klass) {
57
}
58
59
static void yui_page_init (UNUSED YuiPage * yp) {
60
}
61
62
GtkWidget * yui_page_new(GKeyFile * keyfile) {
63
GtkWidget * widget;
64
YuiPage * yp;
65
66
widget = GTK_WIDGET(g_object_new(yui_page_get_type(), NULL));
67
yp = YUI_PAGE(widget);
68
69
yp->keyfile = keyfile;
70
71
return widget;
72
}
73
74
GtkWidget * yui_page_add(YuiPage * yp, const gchar * name) {
75
GtkWidget * label;
76
GtkWidget * frame;
77
GtkWidget * box;
78
gchar buffer[1024];
79
80
frame = gtk_frame_new(NULL);
81
82
gtk_box_pack_start(GTK_BOX(yp), frame, FALSE, TRUE, 0);
83
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE);
84
85
box = gtk_vbox_new(FALSE, 0);
86
gtk_container_add(GTK_CONTAINER(frame), box);
87
88
sprintf(buffer, "<b>%s</b>", name);
89
90
label = gtk_label_new(buffer);
91
gtk_frame_set_label_widget(GTK_FRAME(frame), label);
92
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
93
94
return box;
95
}
96
97