1 /** \file c128machinetypewidget.c
2 * \brief C128 machine type widget
3 *
4 * \author Bas Wassink <b.wassink@ziggo.nl>
5 */
6
7 /*
8 * $VICERES MachineType x128
9 */
10
11 /*
12 * This file is part of VICE, the Versatile Commodore Emulator.
13 * See README for copyright notice.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 * 02111-1307 USA.
29 *
30 */
31
32 #include "vice.h"
33
34 #include <gtk/gtk.h>
35
36 #include "basewidgets.h"
37 #include "widgethelpers.h"
38 #include "debug_gtk3.h"
39 #include "resources.h"
40 #include "c128.h"
41
42 #include "c128machinetypewidget.h"
43
44 /** \brief List of C128 machine types
45 */
46 static const vice_gtk3_radiogroup_entry_t machine_types[] = {
47 { "International", C128_MACHINE_INT },
48 /* any of these cause a KERNAL corrupted message from c128mem */
49 { "Finish", C128_MACHINE_FINNISH },
50 { "French", C128_MACHINE_FRENCH },
51 { "German", C128_MACHINE_GERMAN },
52 { "Italian", C128_MACHINE_ITALIAN },
53 { "Norwegian", C128_MACHINE_NORWEGIAN },
54 { "Swedish", C128_MACHINE_SWEDISH },
55 { "Swiss", C128_MACHINE_SWISS },
56 { NULL, -1 }
57 };
58
59
60 /** \brief Create C128 machine type widget
61 *
62 * \return GtkGrid
63 */
c128_machine_type_widget_create(void)64 GtkWidget * c128_machine_type_widget_create(void)
65 {
66 GtkWidget *grid;
67 GtkWidget *radio_group;
68
69 grid = uihelpers_create_grid_with_label("Machine type", 1);
70 radio_group = vice_gtk3_resource_radiogroup_new(
71 "MachineType", machine_types, GTK_ORIENTATION_VERTICAL);
72 g_object_set(radio_group, "margin-left", 16, NULL);
73 gtk_grid_attach(GTK_GRID(grid), radio_group, 0, 1, 1, 1);
74 gtk_widget_show_all(grid);
75 return grid;
76 }
77