1 |
|
/* |
2 |
|
* prefs_editor_amiga.cpp - Preferences editor, AmigaOS implementation (using gtlayout.library) |
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 |
27 |
|
#include <libraries/asl.h> |
28 |
|
#include <libraries/gtlayout.h> |
29 |
|
#include <libraries/Picasso96.h> |
30 |
+ |
#include <cybergraphx/cybergraphics.h> |
31 |
|
#include <graphics/displayinfo.h> |
32 |
|
#include <devices/ahi.h> |
33 |
|
#include <proto/exec.h> |
38 |
|
#include <proto/graphics.h> |
39 |
|
#include <proto/asl.h> |
40 |
|
#include <proto/Picasso96.h> |
41 |
+ |
#include <proto/cybergraphics.h> |
42 |
|
#include <proto/ahi.h> |
43 |
|
|
44 |
|
#include "sysdeps.h" |
67 |
|
const int GAD_CDROM_UNIT = 0x0305; |
68 |
|
const int GAD_BOOTDRIVER = 0x0306; |
69 |
|
const int GAD_NOCDROM = 0x0307; |
70 |
+ |
const int GAD_EXTFS = 0x0308; |
71 |
|
|
72 |
|
const int GAD_VOLUME_READONLY = 0x0310; // "Add/Edit Volume" window |
73 |
|
const int GAD_VOLUME_TYPE = 0x0311; |
145 |
|
* Locale hook - returns string for given ID |
146 |
|
*/ |
147 |
|
|
145 |
– |
#ifdef __GNUC__ |
148 |
|
static __saveds __attribute__((regparm(3))) const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) |
147 |
– |
#else |
148 |
– |
static __saveds __regargs const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) |
149 |
– |
#endif |
149 |
|
{ |
150 |
|
return GetString((uint32)id); |
151 |
|
} |
513 |
|
FreeAslRequest(dev_request); |
514 |
|
FreeAslRequest(file_request); |
515 |
|
|
516 |
+ |
// Delete menus |
517 |
+ |
LT_DisposeMenu(menu); |
518 |
+ |
|
519 |
|
// Delete handle |
520 |
|
LT_DeleteHandle(h); |
521 |
|
|
530 |
|
*/ |
531 |
|
|
532 |
|
static struct List disk_list; |
533 |
< |
static char cdrom_name[256]; |
533 |
> |
static char cdrom_name[256], extfs_name[256]; |
534 |
|
static ULONG cdrom_unit, cdrom_flags, cdrom_start, cdrom_size, cdrom_bsize; |
535 |
|
static BYTE bootdriver_num, nocdrom; |
536 |
|
|
565 |
|
} |
566 |
|
|
567 |
|
nocdrom = PrefsFindBool("nocdrom"); |
568 |
+ |
|
569 |
+ |
extfs_name[0] = 0; |
570 |
+ |
str = PrefsFindString("extfs"); |
571 |
+ |
if (str) |
572 |
+ |
strncpy(extfs_name, str, sizeof(extfs_name) - 1); |
573 |
|
} |
574 |
|
|
575 |
|
// Ghost/unghost "Edit" and "Remove" buttons |
876 |
|
} |
877 |
|
} while (!done); |
878 |
|
|
872 |
– |
// Delete handle |
873 |
– |
LT_DeleteHandle(h); |
874 |
– |
|
879 |
|
// Update preferences and list view |
880 |
|
if (ok_clicked) { |
881 |
|
char str[256]; |
913 |
|
LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, TAG_END); |
914 |
|
ghost_volumes_gadgets(h2); |
915 |
|
} |
916 |
+ |
|
917 |
+ |
// Delete handle |
918 |
+ |
LT_DeleteHandle(h); |
919 |
|
} |
920 |
|
|
921 |
|
// Remove volume from list |
961 |
|
PrefsRemoveItem("cdrom"); |
962 |
|
|
963 |
|
PrefsReplaceBool("nocdrom", nocdrom); |
964 |
+ |
|
965 |
+ |
if (strlen(extfs_name)) |
966 |
+ |
PrefsReplaceString("extfs", extfs_name); |
967 |
|
} |
968 |
|
|
969 |
|
// Create "Volumes" pane |
979 |
|
VGROUP; |
980 |
|
LT_New(h, LA_Type, LISTVIEW_KIND, |
981 |
|
LA_ID, GAD_DISK_LIST, |
982 |
+ |
LA_Chars, 20, |
983 |
|
GTLV_Labels, (ULONG)&disk_list, |
984 |
|
LALV_Lines, 6, |
985 |
|
LALV_Link, (ULONG)NIL_LINK, |
1047 |
|
TAG_END |
1048 |
|
); |
1049 |
|
ENDGROUP; |
1050 |
+ |
VGROUP; |
1051 |
+ |
LT_New(h, LA_Type, STRING_KIND, |
1052 |
+ |
LA_LabelID, STR_EXTFS_CTRL, |
1053 |
+ |
LA_ID, GAD_EXTFS, |
1054 |
+ |
LA_Chars, 20, |
1055 |
+ |
LA_STRPTR, (ULONG)extfs_name, |
1056 |
+ |
GTST_MaxChars, sizeof(extfs_name) - 1, |
1057 |
+ |
TAG_END |
1058 |
+ |
); |
1059 |
+ |
ENDGROUP; |
1060 |
|
ENDGROUP; |
1061 |
|
} |
1062 |
|
|
1244 |
|
// Show screen mode requester |
1245 |
|
static void screen_mode_req(struct Window *win, struct LayoutHandle *h) |
1246 |
|
{ |
1247 |
< |
if (P96Base == NULL) |
1247 |
> |
if (P96Base == NULL && CyberGfxBase == NULL) |
1248 |
|
return; |
1249 |
|
|
1250 |
|
LT_LockWindow(win); |
1251 |
< |
ULONG id = p96RequestModeIDTags( |
1252 |
< |
P96MA_MinDepth, 8, |
1253 |
< |
P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, |
1254 |
< |
TAG_END |
1255 |
< |
); |
1251 |
> |
|
1252 |
> |
ULONG id; |
1253 |
> |
|
1254 |
> |
if (P96Base) { |
1255 |
> |
id = p96RequestModeIDTags( |
1256 |
> |
P96MA_MinDepth, 8, |
1257 |
> |
P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, |
1258 |
> |
TAG_END |
1259 |
> |
); |
1260 |
> |
} else { |
1261 |
> |
UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0}; |
1262 |
> |
id = (ULONG) CModeRequestTags(NULL, |
1263 |
> |
CYBRMREQ_MinDepth, 8, |
1264 |
> |
CYBRMREQ_CModelArray, (ULONG)model_array, |
1265 |
> |
TAG_END |
1266 |
> |
); |
1267 |
> |
} |
1268 |
|
LT_UnlockWindow(win); |
1269 |
|
|
1270 |
|
if (id != INVALID_ID) { |