1 |
|
/* |
2 |
|
* prefs_editor_gtk.cpp - Preferences editor, Unix implementation using GTK+ |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2000 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
525 |
|
static int display_type; |
526 |
|
static int dis_width, dis_height; |
527 |
|
|
528 |
< |
#if ENABLE_FBDEV_DGA |
528 |
> |
#ifdef ENABLE_FBDEV_DGA |
529 |
|
static GtkWidget *w_fbdev_name, *w_fbdevice_file; |
530 |
|
static GtkWidget *l_fbdev_name, *l_fbdevice_file; |
531 |
|
static char fbdev_name[256]; |
537 |
|
switch (display_type) { |
538 |
|
case DISPLAY_WINDOW: |
539 |
|
gtk_widget_show(w_frameskip); gtk_widget_show(l_frameskip); |
540 |
< |
#if ENABLE_FBDEV_DGA |
540 |
> |
#ifdef ENABLE_FBDEV_DGA |
541 |
|
gtk_widget_show(w_display_x); gtk_widget_show(l_display_x); |
542 |
|
gtk_widget_show(w_display_y); gtk_widget_show(l_display_y); |
543 |
|
gtk_widget_hide(w_fbdev_name); gtk_widget_hide(l_fbdev_name); |
545 |
|
break; |
546 |
|
case DISPLAY_SCREEN: |
547 |
|
gtk_widget_hide(w_frameskip); gtk_widget_hide(l_frameskip); |
548 |
< |
#if ENABLE_FBDEV_DGA |
548 |
> |
#ifdef ENABLE_FBDEV_DGA |
549 |
|
gtk_widget_hide(w_display_x); gtk_widget_hide(l_display_x); |
550 |
|
gtk_widget_hide(w_display_y); gtk_widget_hide(l_display_y); |
551 |
|
gtk_widget_show(w_fbdev_name); gtk_widget_show(l_fbdev_name); |
588 |
|
display_type = DISPLAY_WINDOW; |
589 |
|
dis_width = 512; |
590 |
|
dis_height = 384; |
591 |
< |
#if ENABLE_FBDEV_DGA |
591 |
> |
#ifdef ENABLE_FBDEV_DGA |
592 |
|
fbdev_name[0] = 0; |
593 |
|
#endif |
594 |
|
|
596 |
|
if (str) { |
597 |
|
if (sscanf(str, "win/%d/%d", &dis_width, &dis_height) == 2) |
598 |
|
display_type = DISPLAY_WINDOW; |
599 |
< |
#if ENABLE_FBDEV_DGA |
599 |
> |
#ifdef ENABLE_FBDEV_DGA |
600 |
|
else if (sscanf(str, "dga/%255s", fbdev_name) == 1) |
601 |
|
#else |
602 |
|
else if (sscanf(str, "dga/%d/%d", &dis_width, &dis_height) == 2) |
622 |
|
sprintf(pref, "win/%d/%d", dis_width, dis_height); |
623 |
|
break; |
624 |
|
case DISPLAY_SCREEN: |
625 |
< |
#if ENABLE_FBDEV_DGA |
625 |
> |
#ifdef ENABLE_FBDEV_DGA |
626 |
|
str = gtk_entry_get_text(GTK_ENTRY(w_fbdev_name)); |
627 |
|
sprintf(pref, "dga/%s", str); |
628 |
|
#else |
746 |
|
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); |
747 |
|
w_display_y = GTK_COMBO(combo)->entry; |
748 |
|
|
749 |
< |
#if ENABLE_FBDEV_DGA |
749 |
> |
#ifdef ENABLE_FBDEV_DGA |
750 |
|
l_fbdev_name = gtk_label_new(GetString(STR_FBDEV_NAME_CTRL)); |
751 |
|
gtk_widget_show(l_fbdev_name); |
752 |
|
gtk_table_attach(GTK_TABLE(table), l_fbdev_name, 0, 1, 4, 5, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
933 |
|
static void mn_modelid_5(...) {PrefsReplaceInt32("modelid", 5);} |
934 |
|
static void mn_modelid_14(...) {PrefsReplaceInt32("modelid", 14);} |
935 |
|
|
936 |
< |
// "FPU Emulation" button toggled |
937 |
< |
static void tb_fpu(GtkWidget *widget) |
938 |
< |
{ |
939 |
< |
PrefsReplaceBool("fpu", GTK_TOGGLE_BUTTON(widget)->active); |
940 |
< |
} |
936 |
> |
// CPU/FPU type |
937 |
> |
static void mn_cpu_68020(...) {PrefsReplaceInt32("cpu", 2); PrefsReplaceBool("fpu", false);} |
938 |
> |
static void mn_cpu_68020_fpu(...) {PrefsReplaceInt32("cpu", 2); PrefsReplaceBool("fpu", true);} |
939 |
> |
static void mn_cpu_68030(...) {PrefsReplaceInt32("cpu", 3); PrefsReplaceBool("fpu", false);} |
940 |
> |
static void mn_cpu_68030_fpu(...) {PrefsReplaceInt32("cpu", 3); PrefsReplaceBool("fpu", true);} |
941 |
> |
static void mn_cpu_68040(...) {PrefsReplaceInt32("cpu", 4); PrefsReplaceBool("fpu", true);} |
942 |
|
|
943 |
|
// "Use Raw Keycodes" button toggled |
944 |
|
static void tb_keycodes(GtkWidget *widget) |
1009 |
|
gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
1010 |
|
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
1011 |
|
|
1012 |
< |
static const opt_desc options[] = { |
1012 |
> |
static const opt_desc model_options[] = { |
1013 |
|
{STR_MODELID_5_LAB, GTK_SIGNAL_FUNC(mn_modelid_5)}, |
1014 |
|
{STR_MODELID_14_LAB, GTK_SIGNAL_FUNC(mn_modelid_14)}, |
1015 |
|
{0, NULL} |
1019 |
|
case 5: active = 0; break; |
1020 |
|
case 14: active = 1; break; |
1021 |
|
} |
1022 |
< |
menu = make_option_menu(box, STR_MODELID_CTRL, options, active); |
1022 |
> |
make_option_menu(box, STR_MODELID_CTRL, model_options, active); |
1023 |
|
|
1024 |
< |
w_rom_file = make_entry(box, STR_ROM_FILE_CTRL, "rom"); |
1024 |
> |
#if EMULATED_68K |
1025 |
> |
static const opt_desc cpu_options[] = { |
1026 |
> |
{STR_CPU_68020_LAB, GTK_SIGNAL_FUNC(mn_cpu_68020)}, |
1027 |
> |
{STR_CPU_68020_FPU_LAB, GTK_SIGNAL_FUNC(mn_cpu_68020_fpu)}, |
1028 |
> |
{STR_CPU_68030_LAB, GTK_SIGNAL_FUNC(mn_cpu_68030)}, |
1029 |
> |
{STR_CPU_68030_FPU_LAB, GTK_SIGNAL_FUNC(mn_cpu_68030_fpu)}, |
1030 |
> |
{STR_CPU_68040_LAB, GTK_SIGNAL_FUNC(mn_cpu_68040)}, |
1031 |
> |
{0, NULL} |
1032 |
> |
}; |
1033 |
> |
int cpu = PrefsFindInt32("cpu"); |
1034 |
> |
bool fpu = PrefsFindBool("fpu"); |
1035 |
> |
active = 0; |
1036 |
> |
switch (cpu) { |
1037 |
> |
case 2: active = fpu ? 1 : 0; break; |
1038 |
> |
case 3: active = fpu ? 3 : 2; break; |
1039 |
> |
case 4: active = 4; |
1040 |
> |
} |
1041 |
> |
make_option_menu(box, STR_CPU_CTRL, cpu_options, active); |
1042 |
> |
#endif |
1043 |
|
|
1044 |
< |
make_checkbox(box, STR_FPU_CTRL, "fpu", GTK_SIGNAL_FUNC(tb_fpu)); |
1044 |
> |
w_rom_file = make_entry(box, STR_ROM_FILE_CTRL, "rom"); |
1045 |
|
|
1046 |
|
make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes)); |
1047 |
|
w_keycode_file = make_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile"); |