summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-07-26 12:25:27 +0200
committerOle Loots <ole@monochrom.net>2012-07-26 12:25:27 +0200
commit93f36a8c9bd283db8f8fd1cd5c092e4e7c9ee861 (patch)
tree1ab0de5f150d9575144b37a76df09bbb21ef4720
parent8307f62e23748546bd0de9f9f9753cbc93cd4e39 (diff)
downloadnetsurf-93f36a8c9bd283db8f8fd1cd5c092e4e7c9ee861.tar.gz
netsurf-93f36a8c9bd283db8f8fd1cd5c092e4e7c9ee861.tar.bz2
Implemented a new colour picker.
This colour picker allows to select the 216 web colors plus 15 shades of gray. Removed the color popup from the resource file.
-rwxr-xr-xatari/res/netsurf.rscbin34730 -> 34322 bytes
-rwxr-xr-xatari/res/netsurf.rsh130
-rwxr-xr-xatari/res/netsurf.rsm135
-rw-r--r--atari/settings.c174
4 files changed, 272 insertions, 167 deletions
diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc
index 9f3963080..de493636b 100755
--- a/atari/res/netsurf.rsc
+++ b/atari/res/netsurf.rsc
Binary files differ
diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh
index e099c953f..3c2353ede 100755
--- a/atari/res/netsurf.rsh
+++ b/atari/res/netsurf.rsh
@@ -140,78 +140,60 @@
#define CHOICES_EDIT_MIN_FONT_SIZE 16 /* FTEXT in tree CHOICES */
#define CHOICES_DEC_MIN_FONT_SIZE 17 /* BOXCHAR in tree CHOICES */
#define CHOICES_INC_MIN_FONT_SIZE 18 /* BOXCHAR in tree CHOICES */
-#define CHOICES_BT_TOOLBAR_BGCOLOR 21 /* BOXTEXT in tree CHOICES */
-#define CHOICES_BT_TOOLBAR_ICONSET 109 /* BUTTON in tree CHOICES */
-#define CHOICES_TAB_RENDER 24 /* BUTTON in tree CHOICES */
+#define CHOICES_BT_TOOLBAR_ICONSET 22 /* BUTTON in tree CHOICES */
+#define CHOICES_INPUT_TOOLBAR_BGCOLOR 24 /* FTEXT in tree CHOICES */
+#define CHOICES_TAB_RENDER 25 /* BUTTON in tree CHOICES */
/* Make sure that initial value is large enough! */
-#define CHOICES_BT_SEL_FONT_RENDERER 25 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_TRANSPARENCY 27 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_ENABLE_ANIMATION 29 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_MIN_GIF_DELAY 32 /* FTEXT in tree CHOICES */
-#define CHOICES_DEC_GIF_DELAY 33 /* BOXCHAR in tree CHOICES */
-#define CHOICES_INC_GIF_DELAY 34 /* BOXCHAR in tree CHOICES */
-#define CHOICES_CB_INCREMENTAL_REFLOW 36 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_MIN_REFLOW_PERIOD 38 /* FTEXT in tree CHOICES */
-#define CHOICES_DEC_INCREMENTAL_REFLOW 39 /* BOXCHAR in tree CHOICES */
-#define CHOICES_INC_INCREMENTAL_REFLOW 40 /* BOXCHAR in tree CHOICES */
-#define CHOICES_CB_ANTI_ALIASING 42 /* BUTTON in tree CHOICES */
-#define CHOICES_TAB_PATH 43 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_CA_CERTS_PATH 48 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_DOWNLOAD_PATH 49 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_HOTLIST_FILE 50 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_CA_BUNDLE 51 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_EDITOR 52 /* FTEXT in tree CHOICES */
-#define CHOICES_TAB_CACHE 54 /* BUTTON in tree CHOICES */
-#define CHOICES_INC_MEM_CACHE 58 /* BOXCHAR in tree CHOICES */
-#define CHOICES_DEC_MEM_CACHE 59 /* BOXCHAR in tree CHOICES */
-#define CHOICES_STR_MAX_MEM_CACHE 60 /* STRING in tree CHOICES */
-#define CHOICES_TAB_BROWSER 61 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_HIDE_ADVERTISEMENT 63 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_DISABLE_POPUP_WINDOWS 64 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_SEND_DO_NOT_TRACK 65 /* BUTTON in tree CHOICES */
-#define CHOICES_BT_SEL_LOCALE 67 /* BUTTON in tree CHOICES */
-#define CHOICES_BT_GUI_LANG 70 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_HISTORY_AGE 73 /* FTEXT in tree CHOICES */
-#define CHOICES_DEC_HISTORY_AGE 74 /* BOXCHAR in tree CHOICES */
-#define CHOICES_INC_HISTORY_AGE 75 /* BOXCHAR in tree CHOICES */
-#define CHOICES_CB_SEND_HTTP_REFERRER 79 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_HOMEPAGE 80 /* FTEXT in tree CHOICES */
-#define CHOICES_BT_CLEAR_HISTORY 81 /* BUTTON in tree CHOICES */
-#define CHOICES_TAB_NETWORK 82 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_USE_PROXY 84 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_PROXY_HOST 85 /* FTEXT in tree CHOICES */
-#define CHOICES_CB_PROXY_AUTH 86 /* BUTTON in tree CHOICES */
-#define CHOICES_EDIT_PROXY_USERNAME 87 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_PROXY_PASSWORD 88 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_PROXY_PORT 90 /* FTEXT in tree CHOICES */
-#define CHOICES_INC_MAX_FETCHERS_PER_HOST 95 /* BOXCHAR in tree CHOICES */
-#define CHOICES_INC_CACHED_CONNECTIONS 96 /* BOXCHAR in tree CHOICES */
-#define CHOICES_DEC_MAX_FETCHERS_PER_HOST 97 /* BOXCHAR in tree CHOICES */
-#define CHOICES_DEC_CACHED_CONNECTIONS 98 /* BOXCHAR in tree CHOICES */
-#define CHOICES_EDIT_MAX_FETCHERS_PER_HOST 99 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_MAX_CACHED_CONNECTIONS 100 /* FTEXT in tree CHOICES */
-#define CHOICES_EDIT_MAX_FETCHERS 102 /* FTEXT in tree CHOICES */
-#define CHOICES_DEC_MAX_FETCHERS 103 /* BOXCHAR in tree CHOICES */
-#define CHOICES_INC_MAX_FETCHERS 104 /* BOXCHAR in tree CHOICES */
-#define CHOICES_CB_FG_IMAGES 105 /* BUTTON in tree CHOICES */
-#define CHOICES_CB_BG_IMAGES 106 /* BUTTON in tree CHOICES */
-#define CHOICES_ABORT 107 /* BUTTON in tree CHOICES */
-#define CHOICES_OK 108 /* BUTTON in tree CHOICES */
-
-#define POP_COLOR 14 /* form/dial */
-#define POP_COLOR_WHITE 1 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_BLACK 2 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_RED 3 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_GREEN 4 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_BLUE 5 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_CYAN 6 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_YELLOW 7 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_MAGENTA 8 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_LWHITE 9 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DWHITE 10 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DRED 11 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DGREEN 12 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DBLUE 13 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DCYAN 14 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DYELLOW 15 /* BOXCHAR in tree POP_COLOR */
-#define POP_COLOR_DMAGENTA 16 /* BOXCHAR in tree POP_COLOR */
+#define CHOICES_BT_SEL_FONT_RENDERER 26 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_TRANSPARENCY 28 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_ENABLE_ANIMATION 30 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_MIN_GIF_DELAY 33 /* FTEXT in tree CHOICES */
+#define CHOICES_DEC_GIF_DELAY 34 /* BOXCHAR in tree CHOICES */
+#define CHOICES_INC_GIF_DELAY 35 /* BOXCHAR in tree CHOICES */
+#define CHOICES_CB_INCREMENTAL_REFLOW 37 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_MIN_REFLOW_PERIOD 39 /* FTEXT in tree CHOICES */
+#define CHOICES_DEC_INCREMENTAL_REFLOW 40 /* BOXCHAR in tree CHOICES */
+#define CHOICES_INC_INCREMENTAL_REFLOW 41 /* BOXCHAR in tree CHOICES */
+#define CHOICES_CB_ANTI_ALIASING 43 /* BUTTON in tree CHOICES */
+#define CHOICES_TAB_PATH 44 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_CA_CERTS_PATH 49 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_DOWNLOAD_PATH 50 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_HOTLIST_FILE 51 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_CA_BUNDLE 52 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_EDITOR 53 /* FTEXT in tree CHOICES */
+#define CHOICES_TAB_CACHE 55 /* BUTTON in tree CHOICES */
+#define CHOICES_INC_MEM_CACHE 59 /* BOXCHAR in tree CHOICES */
+#define CHOICES_DEC_MEM_CACHE 60 /* BOXCHAR in tree CHOICES */
+#define CHOICES_STR_MAX_MEM_CACHE 61 /* STRING in tree CHOICES */
+#define CHOICES_TAB_BROWSER 62 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_HIDE_ADVERTISEMENT 64 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_DISABLE_POPUP_WINDOWS 65 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_SEND_DO_NOT_TRACK 66 /* BUTTON in tree CHOICES */
+#define CHOICES_BT_SEL_LOCALE 68 /* BUTTON in tree CHOICES */
+#define CHOICES_BT_GUI_LANG 71 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_HISTORY_AGE 74 /* FTEXT in tree CHOICES */
+#define CHOICES_DEC_HISTORY_AGE 75 /* BOXCHAR in tree CHOICES */
+#define CHOICES_INC_HISTORY_AGE 76 /* BOXCHAR in tree CHOICES */
+#define CHOICES_CB_SEND_HTTP_REFERRER 80 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_HOMEPAGE 81 /* FTEXT in tree CHOICES */
+#define CHOICES_BT_CLEAR_HISTORY 82 /* BUTTON in tree CHOICES */
+#define CHOICES_TAB_NETWORK 83 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_USE_PROXY 85 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_PROXY_HOST 86 /* FTEXT in tree CHOICES */
+#define CHOICES_CB_PROXY_AUTH 87 /* BUTTON in tree CHOICES */
+#define CHOICES_EDIT_PROXY_USERNAME 88 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_PROXY_PASSWORD 89 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_PROXY_PORT 91 /* FTEXT in tree CHOICES */
+#define CHOICES_INC_MAX_FETCHERS_PER_HOST 96 /* BOXCHAR in tree CHOICES */
+#define CHOICES_INC_CACHED_CONNECTIONS 97 /* BOXCHAR in tree CHOICES */
+#define CHOICES_DEC_MAX_FETCHERS_PER_HOST 98 /* BOXCHAR in tree CHOICES */
+#define CHOICES_DEC_CACHED_CONNECTIONS 99 /* BOXCHAR in tree CHOICES */
+#define CHOICES_EDIT_MAX_FETCHERS_PER_HOST 100 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_MAX_CACHED_CONNECTIONS 101 /* FTEXT in tree CHOICES */
+#define CHOICES_EDIT_MAX_FETCHERS 103 /* FTEXT in tree CHOICES */
+#define CHOICES_DEC_MAX_FETCHERS 104 /* BOXCHAR in tree CHOICES */
+#define CHOICES_INC_MAX_FETCHERS 105 /* BOXCHAR in tree CHOICES */
+#define CHOICES_CB_FG_IMAGES 106 /* BUTTON in tree CHOICES */
+#define CHOICES_CB_BG_IMAGES 107 /* BUTTON in tree CHOICES */
+#define CHOICES_ABORT 108 /* BUTTON in tree CHOICES */
+#define CHOICES_OK 109 /* BUTTON in tree CHOICES */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm
index cfbb152cb..67af68f5c 100755
--- a/atari/res/netsurf.rsm
+++ b/atari/res/netsurf.rsm
@@ -1,9 +1,9 @@
ResourceMaster v3.65
-#C 15@0@0@0@
+#C 14@0@0@0@
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@1@1@
-#M 20010100@0@7728@602@
+#M 20010100@0@7728@603@
#T 0@1@MAINMENU@@62@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -131,77 +131,60 @@ ResourceMaster v3.65
#O 16@29@EDIT_MIN_FONT_SIZE@@
#O 17@27@DEC_MIN_FONT_SIZE@@
#O 18@27@INC_MIN_FONT_SIZE@@
-#O 21@22@BT_TOOLBAR_BGCOLOR@@
-#O 109@26@BT_TOOLBAR_ICONSET@@
-#O 24@26@TAB_RENDER@@
-#O 25@26@BT_SEL_FONT_RENDERER@Make sure that initial value is large enough!@
-#O 27@26@CB_TRANSPARENCY@@
-#O 29@26@CB_ENABLE_ANIMATION@@
-#O 32@29@EDIT_MIN_GIF_DELAY@@
-#O 33@27@DEC_GIF_DELAY@@
-#O 34@27@INC_GIF_DELAY@@
-#O 36@26@CB_INCREMENTAL_REFLOW@@
-#O 38@29@EDIT_MIN_REFLOW_PERIOD@@
-#O 39@27@DEC_INCREMENTAL_REFLOW@@
-#O 40@27@INC_INCREMENTAL_REFLOW@@
-#O 42@26@CB_ANTI_ALIASING@@
-#O 43@26@TAB_PATH@@
-#O 48@29@EDIT_CA_CERTS_PATH@@
-#O 49@29@EDIT_DOWNLOAD_PATH@@
-#O 50@29@EDIT_HOTLIST_FILE@@
-#O 51@29@EDIT_CA_BUNDLE@@
-#O 52@29@EDIT_EDITOR@@
-#O 54@26@TAB_CACHE@@
-#O 58@27@INC_MEM_CACHE@@
-#O 59@27@DEC_MEM_CACHE@@
-#O 60@28@STR_MAX_MEM_CACHE@@
-#O 61@26@TAB_BROWSER@@
-#O 63@26@CB_HIDE_ADVERTISEMENT@@
-#O 64@26@CB_DISABLE_POPUP_WINDOWS@@
-#O 65@26@CB_SEND_DO_NOT_TRACK@@
-#O 67@26@BT_SEL_LOCALE@@
-#O 70@26@BT_GUI_LANG@@
-#O 73@29@EDIT_HISTORY_AGE@@
-#O 74@27@DEC_HISTORY_AGE@@
-#O 75@27@INC_HISTORY_AGE@@
-#O 79@26@CB_SEND_HTTP_REFERRER@@
-#O 80@29@EDIT_HOMEPAGE@@
-#O 81@26@BT_CLEAR_HISTORY@@
-#O 82@26@TAB_NETWORK@@
-#O 84@26@CB_USE_PROXY@@
-#O 85@29@EDIT_PROXY_HOST@@
-#O 86@26@CB_PROXY_AUTH@@
-#O 87@29@EDIT_PROXY_USERNAME@@
-#O 88@29@EDIT_PROXY_PASSWORD@@
-#O 90@29@EDIT_PROXY_PORT@@
-#O 95@27@INC_MAX_FETCHERS_PER_HOST@@
-#O 96@27@INC_CACHED_CONNECTIONS@@
-#O 97@27@DEC_MAX_FETCHERS_PER_HOST@@
-#O 98@27@DEC_CACHED_CONNECTIONS@@
-#O 99@29@EDIT_MAX_FETCHERS_PER_HOST@@
-#O 100@29@EDIT_MAX_CACHED_CONNECTIONS@@
-#O 102@29@EDIT_MAX_FETCHERS@@
-#O 103@27@DEC_MAX_FETCHERS@@
-#O 104@27@INC_MAX_FETCHERS@@
-#O 105@26@CB_FG_IMAGES@@
-#O 106@26@CB_BG_IMAGES@@
-#O 107@26@ABORT@@
-#O 108@26@OK@@
-#T 14@2@POP_COLOR@@17@@
-#O 1@27@WHITE@@
-#O 2@27@BLACK@@
-#O 3@27@RED@@
-#O 4@27@GREEN@@
-#O 5@27@BLUE@@
-#O 6@27@CYAN@@
-#O 7@27@YELLOW@@
-#O 8@27@MAGENTA@@
-#O 9@27@LWHITE@@
-#O 10@27@DWHITE@@
-#O 11@27@DRED@@
-#O 12@27@DGREEN@@
-#O 13@27@DBLUE@@
-#O 14@27@DCYAN@@
-#O 15@27@DYELLOW@@
-#O 16@27@DMAGENTA@@
-#c 4056@
+#O 22@26@BT_TOOLBAR_ICONSET@@
+#O 24@29@INPUT_TOOLBAR_BGCOLOR@@
+#O 25@26@TAB_RENDER@@
+#O 26@26@BT_SEL_FONT_RENDERER@Make sure that initial value is large enough!@
+#O 28@26@CB_TRANSPARENCY@@
+#O 30@26@CB_ENABLE_ANIMATION@@
+#O 33@29@EDIT_MIN_GIF_DELAY@@
+#O 34@27@DEC_GIF_DELAY@@
+#O 35@27@INC_GIF_DELAY@@
+#O 37@26@CB_INCREMENTAL_REFLOW@@
+#O 39@29@EDIT_MIN_REFLOW_PERIOD@@
+#O 40@27@DEC_INCREMENTAL_REFLOW@@
+#O 41@27@INC_INCREMENTAL_REFLOW@@
+#O 43@26@CB_ANTI_ALIASING@@
+#O 44@26@TAB_PATH@@
+#O 49@29@EDIT_CA_CERTS_PATH@@
+#O 50@29@EDIT_DOWNLOAD_PATH@@
+#O 51@29@EDIT_HOTLIST_FILE@@
+#O 52@29@EDIT_CA_BUNDLE@@
+#O 53@29@EDIT_EDITOR@@
+#O 55@26@TAB_CACHE@@
+#O 59@27@INC_MEM_CACHE@@
+#O 60@27@DEC_MEM_CACHE@@
+#O 61@28@STR_MAX_MEM_CACHE@@
+#O 62@26@TAB_BROWSER@@
+#O 64@26@CB_HIDE_ADVERTISEMENT@@
+#O 65@26@CB_DISABLE_POPUP_WINDOWS@@
+#O 66@26@CB_SEND_DO_NOT_TRACK@@
+#O 68@26@BT_SEL_LOCALE@@
+#O 71@26@BT_GUI_LANG@@
+#O 74@29@EDIT_HISTORY_AGE@@
+#O 75@27@DEC_HISTORY_AGE@@
+#O 76@27@INC_HISTORY_AGE@@
+#O 80@26@CB_SEND_HTTP_REFERRER@@
+#O 81@29@EDIT_HOMEPAGE@@
+#O 82@26@BT_CLEAR_HISTORY@@
+#O 83@26@TAB_NETWORK@@
+#O 85@26@CB_USE_PROXY@@
+#O 86@29@EDIT_PROXY_HOST@@
+#O 87@26@CB_PROXY_AUTH@@
+#O 88@29@EDIT_PROXY_USERNAME@@
+#O 89@29@EDIT_PROXY_PASSWORD@@
+#O 91@29@EDIT_PROXY_PORT@@
+#O 96@27@INC_MAX_FETCHERS_PER_HOST@@
+#O 97@27@INC_CACHED_CONNECTIONS@@
+#O 98@27@DEC_MAX_FETCHERS_PER_HOST@@
+#O 99@27@DEC_CACHED_CONNECTIONS@@
+#O 100@29@EDIT_MAX_FETCHERS_PER_HOST@@
+#O 101@29@EDIT_MAX_CACHED_CONNECTIONS@@
+#O 103@29@EDIT_MAX_FETCHERS@@
+#O 104@27@DEC_MAX_FETCHERS@@
+#O 105@27@INC_MAX_FETCHERS@@
+#O 106@26@CB_FG_IMAGES@@
+#O 107@26@CB_BG_IMAGES@@
+#O 108@26@ABORT@@
+#O 109@26@OK@@
+#c 31683@
diff --git a/atari/settings.c b/atari/settings.c
index 0d95fb2ff..2106eb35c 100644
--- a/atari/settings.c
+++ b/atari/settings.c
@@ -10,10 +10,13 @@
#include <windom.h>
#include "desktop/options.h"
+#include "desktop/plot_style.h"
#include "atari/res/netsurf.rsh"
#include "atari/settings.h"
#include "atari/global_evnt.h"
#include "atari/misc.h"
+#include "atari/plot/plot.h"
+#include "atari/bitmap.h"
#include "atari/findfile.h"
extern char options[PATH_MAX];
@@ -30,7 +33,7 @@ static unsigned int tmp_option_min_reflow_period;
static unsigned int tmp_option_max_fetchers;
static unsigned int tmp_option_max_fetchers_per_host;
static unsigned int tmp_option_max_cached_fetch_handles;
-static unsigned int tmp_option_atari_toolbar_bg;
+static colour tmp_option_atari_toolbar_bg;
/* Tab forms and their buttons: */
static int frms[] = {
@@ -73,6 +76,7 @@ static int buts[] = {
#define LABEL_FONT_RENDERER_MAX_LEN 8
#define LABEL_PATH_MAX_LEN 43
#define LABEL_ICONSET_MAX_LEN 8
+#define INPUT_TOOLBAR_COLOR_MAX_LEN 6
static void toggle_objects( void );
static void display_settings( void );
@@ -87,6 +91,8 @@ static void __CDECL
static void __CDECL
clear_history( WINDOW *win, int index, int unused, void *unused2);
+
+
WINDOW * open_settings()
{
@@ -140,7 +146,7 @@ WINDOW * open_settings()
form_event, NULL);
ObjcAttachFormFunc( dlgwin, CHOICES_BT_SEL_LOCALE,
form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_TOOLBAR_BGCOLOR,
+ ObjcAttachFormFunc( dlgwin, CHOICES_INPUT_TOOLBAR_BGCOLOR,
form_event, NULL);
ObjcAttachFormFunc( dlgwin, CHOICES_BT_TOOLBAR_ICONSET,
form_event, NULL);
@@ -214,6 +220,142 @@ static void __CDECL clear_history( WINDOW *win, int index, int unused,
}
+
+static colour color_popup(int x, int y, colour current)
+{
+#define GRID_ROWS 9
+#define GRID_COLS 27
+ colour retval = current;
+ int boxwidth=6, boxheight=8;
+ struct bitmap *palette_img;
+ MFDB bg, screen;
+ GRECT bgarea = {x, y, GRID_COLS*boxwidth+4, GRID_ROWS*boxheight+4};
+ short web_std_colors[6] = {0, 51, 102, 153, 204, 255};
+ int r,g,b;
+ int xpos = 0, ypos = 0;
+ colour palette[216+8];
+ int i=0;
+
+ plot_style_t drawcolour = {
+ .stroke_type = PLOT_OP_TYPE_NONE,
+ .fill_type = PLOT_OP_TYPE_SOLID,
+ .fill_colour = 0
+ };
+
+ plot_style_t outline = {
+ .stroke_type = PLOT_OP_TYPE_SOLID,
+ .stroke_colour = 0xAAAAAA,
+ .stroke_width = 2,
+ .fill_type = PLOT_OP_TYPE_NONE,
+ .fill_colour = 0
+ };
+
+ /* create a palette array (web colors): */
+ for (r=0; r<6; r++) {
+ for (g=0; g<6; g++) {
+ for (b=0; b<6; b++) {
+ palette[i] = ((web_std_colors[b]<<16)
+ | (web_std_colors[g]<<8)
+ | web_std_colors[r]);
+ i++;
+ }
+ }
+ }
+
+ /* setup the gray color values: */
+ int z = 0;
+ colour grays[15] = {0x111111, 0x222222, 0x333333, 0x444444,
+ 0x555555, 0x666666, 0x777777, 0x888888,
+ 0x999999, 0x999999, 0xAAAAAA, 0xBBBBBB,
+ 0xCCCCCC, 0xDDDDDD, 0xEEEEEE};
+ for (z=0;i<243;i++) {
+ if (z<15)
+ palette[i] = grays[z];
+ else
+ palette[i] = 0x000000;
+ z++;
+ }
+
+ /* hide the mouse */
+ v_hide_c (app.graf.handle);
+
+ plot_set_dimensions(x, y,
+ (GRID_COLS*boxwidth)+4, (GRID_ROWS*boxheight)+4);
+ plot_lock();
+
+ // store background:
+ short pxy[8];
+ init_mfdb(app.nplanes, bgarea.g_w, bgarea.g_h, 0, &bg);
+ init_mfdb(0, bgarea.g_w, bgarea.g_h, 0, &screen);
+
+ pxy[0] = bgarea.g_x;
+ pxy[1] = bgarea.g_y;
+ pxy[2] = bgarea.g_x + bgarea.g_w - 1;
+ pxy[3] = bgarea.g_y + bgarea.g_h - 1;
+ pxy[4] = 0;
+ pxy[5] = 0;
+ pxy[6] = bgarea.g_w - 1;
+ pxy[7] = bgarea.g_h - 1;
+
+ /* copy screen image */
+ vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &bg);
+
+ /*
+ plot_rectangle(x+1, y+1, x+(GRID_COLS*boxwidth)+3,
+ y+(GRID_ROWS*boxheight)+3, &outline);
+
+ plot_line(x, y, x+(GRID_COLS*boxwidth)+2, y+(GRID_ROWS*boxheight)+2,
+ &outline);
+ */
+ plot_line(x, y, x+(GRID_COLS*boxwidth)+2, y,
+ &outline);
+
+ plot_line(x, y+(GRID_ROWS*boxheight)+2, x+(GRID_COLS*boxwidth)+2,
+ y+(GRID_ROWS*boxheight)+2,
+ &outline);
+
+ /* draw a 27*8 grid: */
+ for (i=0; i<243; i++){
+ drawcolour.fill_colour = palette[i];
+ plot_rectangle(xpos+2, ypos+2, xpos+boxwidth+2, ypos+boxheight+2,
+ &drawcolour);
+ xpos += boxwidth;
+ if (xpos >= GRID_COLS*boxwidth) {
+ xpos = 0;
+ ypos += boxheight;
+ }
+ }
+
+ /* restore the mouse */
+ v_show_c ( app.graf.handle, 1);
+
+ /* fetch mouse event: */
+ mt_EvntDisable(&app, dlgwin, WM_XBUTTON);
+ EvntWindom(MU_BUTTON);
+ mt_EvntEnable(&app, dlgwin, WM_XBUTTON);
+
+ /* calulate clicked grid coords: */
+ int row = ((evnt.my-y)/boxheight);
+ int col = ((evnt.mx-x)/boxwidth);
+
+ if (row >= 0 && row <= GRID_ROWS-1 && col >= 0 && col <= GRID_COLS-1) {
+ assert( (GRID_COLS*row)+(col) >= 0 );
+ assert( (GRID_COLS*row)+(col) < 243 );
+ retval = palette[(GRID_COLS*row)+(col)];
+ }
+
+ /* restore background: */
+ w_put_bkgr(&app, bgarea.g_x, bgarea.g_y, bgarea.g_w, bgarea.g_h, &bg);
+ free(bg.fd_addr);
+
+ plot_unlock();
+
+#undef GRID_COLS
+#undef GRID_ROWS
+
+ return(retval);
+}
+
/**
* Displays a popup to select available icon sets,
the returned string is no longer than 8 characters.
@@ -375,19 +517,16 @@ form_event( WINDOW *win, int index, int external, void *unused2)
ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
break;
- case CHOICES_BT_TOOLBAR_BGCOLOR:
- objc_offset( FORM(win), CHOICES_BT_TOOLBAR_BGCOLOR, &x, &y );
- choice = MenuPopUp( get_tree(POP_COLOR), x, y, -1,
- -1, -1, P_WNDW + P_CHCK );
- if( choice >= 0 && choice <= 15 ){
- snprintf( spare, 255, "%02d", choice-1 );
- tmp_option_atari_toolbar_bg = choice-1;
- ObjcStrCpy( dlgtree, CHOICES_BT_TOOLBAR_BGCOLOR,
+ case CHOICES_INPUT_TOOLBAR_BGCOLOR:
+ objc_offset( FORM(win), CHOICES_INPUT_TOOLBAR_BGCOLOR, &x, &y );
+ choice = color_popup(x, y, tmp_option_atari_toolbar_bg);
+ snprintf( spare, 255, "%06x", choice );
+ tmp_option_atari_toolbar_bg = choice;
+ ObjcStrCpy( dlgtree, CHOICES_INPUT_TOOLBAR_BGCOLOR,
spare );
-
- }
is_button = true;
ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
+ ObjcDrawParent(OC_FORM, dlgwin, CHOICES_INPUT_TOOLBAR_BGCOLOR, 2, 1 );
break;
case CHOICES_BT_TOOLBAR_ICONSET:
@@ -696,12 +835,13 @@ static void display_settings( void )
snprintf( spare, 255, "%3d", nsoption_int(font_size) );
set_text( CHOICES_EDIT_DEF_FONT_SIZE, spare , 3 );
- set_text(CHOICES_BT_TOOLBAR_ICONSET,
- nsoption_charp(atari_image_toolbar_folder), LABEL_ICONSET_MAX_LEN);
+ set_text(CHOICES_BT_TOOLBAR_ICONSET,
+ nsoption_charp(atari_image_toolbar_folder), LABEL_ICONSET_MAX_LEN);
tmp_option_atari_toolbar_bg = nsoption_int(atari_toolbar_bg);
- snprintf( spare, 255, "%2d", tmp_option_atari_toolbar_bg);
- set_text( CHOICES_BT_TOOLBAR_BGCOLOR, spare , 2 );
+ snprintf( spare, 255, "%06x", tmp_option_atari_toolbar_bg);
+ set_text(CHOICES_INPUT_TOOLBAR_BGCOLOR, spare,
+ INPUT_TOOLBAR_COLOR_MAX_LEN );
/* Only first tab is refreshed: */
ObjcDraw( OC_FORM, dlgwin, CHOICES_TAB_BROWSER, 4 );
@@ -741,7 +881,7 @@ static void apply_settings( void )
/* "Style" tab: */
nsoption_set_int(font_min_size, tmp_option_font_min_size);
nsoption_set_int(font_size, tmp_option_font_size);
- nsoption_set_int(atari_toolbar_bg, tmp_option_atari_toolbar_bg);
+ nsoption_set_colour(atari_toolbar_bg, tmp_option_atari_toolbar_bg);
nsoption_set_charp(atari_image_toolbar_folder,
ObjcString( dlgtree, CHOICES_BT_TOOLBAR_ICONSET, NULL)
);