summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.sources2
-rw-r--r--framebuffer/fb_cursor.c31
-rw-r--r--framebuffer/fb_font.c2
-rw-r--r--framebuffer/fb_frontend_sdl.c39
-rw-r--r--framebuffer/fb_gui.c23
-rw-r--r--framebuffer/fb_image_data.c346
-rw-r--r--framebuffer/fb_image_data.h31
-rw-r--r--framebuffer/fb_plotters.c4
-rw-r--r--framebuffer/fb_rootwindow.c619
-rw-r--r--framebuffer/fb_rootwindow.h14
10 files changed, 696 insertions, 415 deletions
diff --git a/Makefile.sources b/Makefile.sources
index fa78b6f11..de730f785 100644
--- a/Makefile.sources
+++ b/Makefile.sources
@@ -99,7 +99,7 @@ S_FRAMEBUFFER := fb_gui.c tree.c history.c hotlist.c fb_schedule.c \
thumbnail.c misc.c fb_bitmap.c fb_font.c font_8x16.c \
fb_filetype.c login.c fb_cursor.c fb_plotters.c \
fb_8bpp_plotters.c fb_16bpp_plotters.c fb_32bpp_plotters.c \
- fb_findfile.c fb_rootwindow.c
+ fb_findfile.c fb_rootwindow.c fb_image_data.c
# fb_1bpp_plotters.c
ifeq ($(NETSURF_FB_FRONTEND),linux)
diff --git a/framebuffer/fb_cursor.c b/framebuffer/fb_cursor.c
index 71b8deeb5..97632caec 100644
--- a/framebuffer/fb_cursor.c
+++ b/framebuffer/fb_cursor.c
@@ -36,6 +36,7 @@
#include "framebuffer/fb_cursor.h"
#include "framebuffer/fb_frontend.h"
#include "framebuffer/fb_rootwindow.h"
+#include "framebuffer/fb_image_data.h"
struct fb_cursor_s {
int x;
@@ -50,36 +51,6 @@ struct fb_cursor_s {
uint8_t *savedata; /* save under area */
};
-static const struct {
- unsigned int width;
- unsigned int height;
- unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
- unsigned char pixel_data[11 * 15 * 4 + 1];
-} pointer_image = {
- 11, 15, 4,
- "\0\0\0'\0\0\0""8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0`\230\230\230\275\3\3\3D\0\0\0\1\0\0\0\4\0\0\0\1\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`\377\377\377\277\230\230\230"
- "\275\2\2\2N\0\0\0\37\0\0\0\23\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0`\377\377\377\277\377\377\377\277\224\224\224\302\2\2\2`\0\0\0$\0\0\0\24"
- "\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`\377\377\377\277\377\377\377\277\370"
- "\370\370\304\220\220\220\307\2\2\2`\0\0\0$\0\0\0\24\0\0\0\2\0\0\0\0\0\0\0"
- "\0\0\0\0`\377\377\377\277\377\377\377\277\370\370\370\304\362\362\362\311"
- "\220\220\220\307\2\2\2`\0\0\0$\0\0\0\24\0\0\0\2\0\0\0\0\0\0\0`\377\377\377"
- "\277\377\377\377\277\370\370\370\304\362\362\362\311\361\361\361\311]]]\307"
- "\0\0\0;\0\0\0$\0\0\0\24\0\0\0\2\0\0\0`\377\377\377\277\377\377\377\277\370"
- "\370\370\304\304\304\304\311222\245\0\0\0Z\0\0\0'\0\0\0&\0\0\0$\0\0\0\24"
- "\0\0\0`\334\334\334\277sss\273\277\277\277\304\340\340\340\311\16\16\16~"
- "\0\0\0&\0\0\0&\0\0\0&\0\0\0&\0\0\0#\0\0\0-\5\5\5T\0\0\0\21]]]\261\362\362"
- "\362\311ccc\276\0\0\0,\0\0\0&\0\0\0&\0\0\0#\0\0\0\26\0\0\0\0\0\0\0\0\0\0"
- "\0\0\11\11\11h\333\333\333\311\306\306\306\311\0\0\0g\0\0\0&\0\0\0&\0\0\0"
- "\31\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36ooo\304\212\212\212\305\15\15"
- "\15q\0\0\0&\0\0\0&\0\0\0!\0\0\0\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0""8"
- "\0\0\0\35\0\0\0\25\0\0\0&\0\0\0&\0\0\0%\0\0\0\21\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0#\0\0\0&\0\0\0%\0\0\0\24\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\24\0\0\0\34\0\0\0\22"
- "\0\0\0\4",
-};
static void fb_cursor_save(framebuffer_t *fb)
{
diff --git a/framebuffer/fb_font.c b/framebuffer/fb_font.c
index 0f416e865..aa81484d9 100644
--- a/framebuffer/fb_font.c
+++ b/framebuffer/fb_font.c
@@ -79,6 +79,8 @@ static bool nsfont_position_in_string(const struct css_style *style,
{
const struct fb_font_desc* fb_font = fb_get_font(style);
*char_offset = x / fb_font->width;
+ if (*char_offset > length)
+ *char_offset = length;
*actual_x = *char_offset * fb_font->width;
return true;
}
diff --git a/framebuffer/fb_frontend_sdl.c b/framebuffer/fb_frontend_sdl.c
index dd8ee2e06..16086c214 100644
--- a/framebuffer/fb_frontend_sdl.c
+++ b/framebuffer/fb_frontend_sdl.c
@@ -108,24 +108,24 @@ void fb_os_input(struct gui_window *g, bool active)
fb_window_scroll(g, 0, -g->height);
break;
- case SDLK_j:
+ case SDLK_DOWN:
fb_window_scroll(g, 0, 100);
break;
- case SDLK_k:
+ case SDLK_UP:
fb_window_scroll(g, 0, -100);
break;
- case SDLK_q:
+ case SDLK_ESCAPE:
browser_window_destroy(g->bw);
break;
- case SDLK_b:
+ case SDLK_LEFT:
if (history_back_available(g->bw->history))
history_back(g->bw, g->bw->history);
break;
- case SDLK_f:
+ case SDLK_RIGHT:
if (history_forward_available(g->bw->history))
history_forward(g->bw, g->bw->history);
break;
@@ -133,6 +133,7 @@ void fb_os_input(struct gui_window *g, bool active)
default:
printf("The %s key was pressed!\n",
SDL_GetKeyName(event.key.keysym.sym));
+ fb_rootwindow_input(g, event.key.keysym.sym);
break;
}
break;
@@ -147,15 +148,13 @@ void fb_os_input(struct gui_window *g, bool active)
switch (event.button.button) {
case SDL_BUTTON_LEFT:
- fb_rootwindow_click(g,
- BROWSER_MOUSE_CLICK_1,
+ fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_1,
fb_cursor_x(framebuffer),
fb_cursor_y(framebuffer));
break;
case SDL_BUTTON_RIGHT:
- fb_rootwindow_click(g,
- BROWSER_MOUSE_CLICK_2,
+ fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_2,
fb_cursor_x(framebuffer),
fb_cursor_y(framebuffer));
break;
@@ -176,6 +175,28 @@ void fb_os_input(struct gui_window *g, bool active)
}
break;
+ case SDL_MOUSEBUTTONUP:
+ switch (event.button.button) {
+
+ case SDL_BUTTON_LEFT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ case SDL_BUTTON_RIGHT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ default:
+ printf("Mouse button %d pressed at (%d,%d)\n",
+ event.button.button, event.button.x, event.button.y);
+
+ }
+ break;
+
case SDL_QUIT:
browser_window_destroy(g->bw);
}
diff --git a/framebuffer/fb_gui.c b/framebuffer/fb_gui.c
index a9c3ed136..786fcae16 100644
--- a/framebuffer/fb_gui.c
+++ b/framebuffer/fb_gui.c
@@ -279,13 +279,24 @@ void gui_quit(void)
#endif
}
+/* called back when click in browser window */
static int
fb_browser_window_click(struct gui_window *g, browser_mouse_state st, int x, int y)
{
+ LOG(("browser window clicked at %d,%d",x,y));
browser_window_mouse_click(g->bw,
st,
- x - g->x + g->scrollx,
- y - g->y + g->scrolly);
+ x + g->scrollx,
+ y + g->scrolly);
+ return 0;
+}
+
+static int
+fb_browser_window_input(fb_widget_t *widget, struct gui_window *g, int value)
+{
+ LOG(("got value %d",value));
+ if (value >= 0)
+ return browser_window_key_press(g->bw, value);
return 0;
}
@@ -308,9 +319,9 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
if (window_list == NULL) {
window_list = input_window = g;
- fb_add_window_widget(g, fb_browser_window_click);
+ fb_add_window_widget(g, 0, fb_browser_window_click, fb_browser_window_input);
} else {
- for(p = window_list; p->next != NULL; p = p->next);
+ for (p = window_list; p->next != NULL; p = p->next);
p->next = g;
g->prev = p;
}
@@ -456,8 +467,7 @@ void gui_window_update_extent(struct gui_window *g)
void gui_window_set_status(struct gui_window *g, const char *text)
{
- LOG(("g %p, text %s", g, text));
- fb_rootwindow_status(framebuffer, text);
+ fb_rootwindow_status(text);
}
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
@@ -470,6 +480,7 @@ void gui_window_hide_pointer(struct gui_window *g)
void gui_window_set_url(struct gui_window *g, const char *url)
{
+ fb_rootwindow_url(url);
}
void gui_window_start_throbber(struct gui_window *g)
diff --git a/framebuffer/fb_image_data.c b/framebuffer/fb_image_data.c
new file mode 100644
index 000000000..a38453d99
--- /dev/null
+++ b/framebuffer/fb_image_data.c
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "framebuffer/fb_image_data.h"
+
+const fb_widget_image_t pointer_image = {
+ 11, 15, 4,
+ "\0\0\0'\0\0\0""8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0`\230\230\230\275\3\3\3D\0\0\0\1\0\0\0\4\0\0\0\1\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`\377\377\377\277\230\230\230"
+ "\275\2\2\2N\0\0\0\37\0\0\0\23\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0`\377\377\377\277\377\377\377\277\224\224\224\302\2\2\2`\0\0\0$\0\0\0\24"
+ "\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`\377\377\377\277\377\377\377\277\370"
+ "\370\370\304\220\220\220\307\2\2\2`\0\0\0$\0\0\0\24\0\0\0\2\0\0\0\0\0\0\0"
+ "\0\0\0\0`\377\377\377\277\377\377\377\277\370\370\370\304\362\362\362\311"
+ "\220\220\220\307\2\2\2`\0\0\0$\0\0\0\24\0\0\0\2\0\0\0\0\0\0\0`\377\377\377"
+ "\277\377\377\377\277\370\370\370\304\362\362\362\311\361\361\361\311]]]\307"
+ "\0\0\0;\0\0\0$\0\0\0\24\0\0\0\2\0\0\0`\377\377\377\277\377\377\377\277\370"
+ "\370\370\304\304\304\304\311222\245\0\0\0Z\0\0\0'\0\0\0&\0\0\0$\0\0\0\24"
+ "\0\0\0`\334\334\334\277sss\273\277\277\277\304\340\340\340\311\16\16\16~"
+ "\0\0\0&\0\0\0&\0\0\0&\0\0\0&\0\0\0#\0\0\0-\5\5\5T\0\0\0\21]]]\261\362\362"
+ "\362\311ccc\276\0\0\0,\0\0\0&\0\0\0&\0\0\0#\0\0\0\26\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\11\11\11h\333\333\333\311\306\306\306\311\0\0\0g\0\0\0&\0\0\0&\0\0\0"
+ "\31\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36ooo\304\212\212\212\305\15\15"
+ "\15q\0\0\0&\0\0\0&\0\0\0!\0\0\0\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0""8"
+ "\0\0\0\35\0\0\0\25\0\0\0&\0\0\0&\0\0\0%\0\0\0\21\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0#\0\0\0&\0\0\0%\0\0\0\24\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\24\0\0\0\34\0\0\0\22"
+ "\0\0\0\4",
+};
+
+const fb_widget_image_t left_arrow = {
+ 22, 25, 4,
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\0\10\0\14\0\10\0\206\0\11\0\350\0\10\0.\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\0\10\0\1\0\10\0]\0\12\0\347\0\10\0\377\0\10\0\377\0\10\0W\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0""5\0\11\0\310\0\10"
+ "\0\377\0)\3\375\0|\12\377\0\10\0\377\0\10\0W\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\0\10\0\30\0\10\0\237\0\10\0\376\0\23\1\375\0\215\14\377\0\371\25\377"
+ "\0\301\20\377\0\10\0\377\0\10\0W\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\6\0\10\0u\0\12\0\364\0"
+ "\11\0\377\0d\10\377\0\350\24\377\0\377\26\377\0\377\26\377\0\301\20\377\0"
+ "\10\0\377\0\10\0V\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\0\10\0L\0\12\0\334\0\10\0\377\0<\5\376\0\313\21\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0V\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\0\10\0(\0\10\0\267\0\10\0\377\0\36\2\375"
+ "\0\244\16\377\0\376\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0V\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\17\0\10"
+ "\0\216\0\11\0\373\0\15\0\376\0|\12\377\0\363\25\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
+ "\20\377\0\10\0\377\0\10\0U\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\0\10\0\2\0\10\0e\0\12\0\354\0\10\0\377\0T\7\377\0\335\23\377\0"
+ "\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10"
+ "\0U\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0<\0\12\0\320\0\10\0\377"
+ "\0/\3\375\0\274\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0T\377\377\377\0\0\10\0\35"
+ "\0\10\0\247\0\10\0\377\0\26\1\375\0\223\14\377\0\373\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
+ "\20\377\0\10\0\377\0\10\0T\0\10\0m\0\12\0\367\0\11\0\376\0l\11\377\0\354"
+ "\24\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10"
+ "\0T\0\11\0\331\0\10\0\377\0=\5\377\0\340\23\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0S\0\10\0\21\0\10\0\222"
+ "\0\11\0\374\0\16\1\376\0\200\13\377\0\364\25\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
+ "\20\377\0\10\0\377\0\10\0S\377\377\377\0\377\377\377\0\0\10\0+\0\11\0\275"
+ "\0\10\0\377\0\40\2\375\0\250\16\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10"
+ "\0S\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0Q\0\12"
+ "\0\340\0\10\0\377\0@\5\376\0\316\22\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0R\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\10\0\10\0{\0\12\0"
+ "\366\0\11\0\376\0h\11\377\0\352\24\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
+ "\20\377\0\10\0\377\0\10\0R\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\33\0\10\0\245"
+ "\0\10\0\377\0\24\1\375\0\221\14\377\0\372\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0"
+ "\377\0\10\0R\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0"
+ ":\0\12\0\315\0\10\0\377\0,\3\375\0\270\20\377\0\377\26\377\0\377\26\377\0"
+ "\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0Q\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\2\0"
+ "\10\0c\0\12\0\353\0\10\0\377\0P\6\377\0\332\23\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0Q\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0"
+ "\10\0\17\0\10\0\215\0\11\0\373\0\15\0\376\0x\12\377\0\361\25\377\0\377\26"
+ "\377\0\301\20\377\0\10\0\377\0\10\0Q\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\0\10\0'\0\10\0\267\0\10\0\377\0\34\2\375\0\241\16\377\0\300"
+ "\20\377\0\10\0\377\0\10\0P\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\0\10\0L\0\12\0\334\0\10\0\377\0!\2\376\0\10"
+ "\0\377\0\10\0P\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\0\10\0\6\0\10\0v\0\12\0\364\0\10\0\377\0\10"
+ "\0N\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\30\0\10\0g\0\10\0"
+ "\6",
+};
+
+const fb_widget_image_t right_arrow = {
+ 22, 25, 4,
+ "\0\10\0""0\0\11\0\350\0\10\0\206\0\10\0\14\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\0\10\0W\0\10\0\377\0\10\0\377\0\13\0\347\0\10\0]\0\10\0\1\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0W\0"
+ "\10\0\377\0|\12\377\0)\3\375\0\10\0\377\0\12\0\311\0\10\0""6\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0W\0\10\0\377\0"
+ "\301\20\377\0\371\25\377\0\215\14\377\0\23\1\375\0\10\0\376\0\10\0\240\0"
+ "\10\0\31\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0V\0\10\0\377\0\301\20"
+ "\377\0\377\26\377\0\377\26\377\0\350\24\377\0d\10\377\0\11\0\377\0\12\0\364"
+ "\0\10\0w\0\10\0\6\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\0\10\0V\0\10\0\377\0\301\20\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\313\21\377\0<\5\376\0\10\0\377\0\12\0"
+ "\336\0\10\0N\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\0\10\0V\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\376\26\377\0\244\16\377\0\36\2\375\0\10"
+ "\0\377\0\11\0\273\0\10\0*\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0U\0"
+ "\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\363\25\377\0|\12\377\0\15\0\376"
+ "\0\11\0\374\0\10\0\221\0\10\0\21\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0U\0\10\0\377\0\301\20"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\335\23\377\0T\7\377\0\10"
+ "\0\377\0\12\0\355\0\10\0h\0\10\0\3\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\0\10\0T\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\274\20\377\0/\4\375\0\10\0"
+ "\377\0\12\0\322\0\10\0@\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0"
+ "T\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\373\26\377\0\223\14\377\0\26\1\375\0"
+ "\10\0\377\0\10\0\253\0\10\0\37\377\377\377\0\0\10\0T\0\10\0\377\0\301\20"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\354\24\377\0l\11\377\0\11\0\376"
+ "\0\11\0\370\0\10\0u\0\10\0S\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\340\23\377\0=\5\377\0\10\0\377\0\11\0\327\0"
+ "\10\0S\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\364\25\377\0\200\13"
+ "\377\0\16\1\376\0\11\0\375\0\10\0\227\0\10\0\23\0\10\0S\0\10\0\377\0\301"
+ "\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\250\16\377\0\40\2\375\0\10\0\377\0\11\0\301\0\10\0/\377"
+ "\377\377\0\377\377\377\0\0\10\0R\0\10\0\377\0\301\20\377\0\377\26\377\0\377"
+ "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\316\22\377\0@\5\376\0\10\0\377"
+ "\0\12\0\342\0\10\0U\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\0\10\0R\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377"
+ "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\352\24"
+ "\377\0h\11\377\0\11\0\376\0\12\0\367\0\10\0~\0\10\0\11\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0R\0\10\0\377\0"
+ "\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\372\26\377\0\221\14\377\0\24\1\375\0\10\0\377\0\10\0"
+ "\247\0\10\0\35\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\0\10\0Q\0\10\0\377\0\301\20\377\0"
+ "\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\270\20"
+ "\377\0,\3\375\0\10\0\377\0\12\0\317\0\10\0=\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\0\10\0Q\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26"
+ "\377\0\377\26\377\0\332\23\377\0P\6\377\0\10\0\377\0\12\0\354\0\10\0e\0\10"
+ "\0\2\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\0\10\0Q\0\10\0\377\0\301\20\377\0\377\26\377\0\361\25\377\0x\12\377\0\15"
+ "\0\376\0\11\0\374\0\10\0\217\0\10\0\17\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0P\0\10\0"
+ "\377\0\300\20\377\0\241\16\377\0\34\2\375\0\10\0\377\0\10\0\270\0\10\0(\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0P\0\10\0\377\0!\2\376"
+ "\0\10\0\377\0\12\0\335\0\10\0M\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\0\10\0K\0\10\0\377\0\12\0\364\0\10\0v"
+ "\0\10\0\6\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\0\10\0\10\0\10\0j\0\10\0\30\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0",
+};
+
+const fb_widget_image_t reload = {
+ 24, 25, 4,
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0"
+ "\36\0\10\0O\0\10\0H\0\10\0!\0\10\0\2\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\0\10\0\5\0\10\0r\0\10\0\271\0\10\0\353\0\10"
+ "\0\377\0\10\0\377\0\10\0\377\0\10\0\377\0\10\0\370\0\10\0\263\0\10\0""6\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\0\10\0.\0\10\0\317\0\10\0\377\0\10\0\341\0\10\0\255\0\10"
+ "\0z\0\10\0I\0\10\0Q\0\10\0v\0\10\0\241\0\10\0\366\0\10\0\377\0\10\0\267\0"
+ "\10\0\40\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0|\0"
+ "\10\0\372\0\10\0\361\0\10\0e\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0"
+ "\0\10\0\0\0\10\0\0\0\10\0\27\0\10\0\214\0\10\0\370\0\10\0\343\0\10\0&\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\0\10\0i\0\10\0\377\0\10\0\272\0\10\0\36\0\10\0\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\0\10\0\0\0\10\0\0\0\10\0D\0\10\0\365\0\10\0\350\0\10"
+ "\0)\377\377\377\0\377\377\377\0\0\0\0\"\377\377\377\0\377\377\377\0\0\10"
+ "\0\"\0\10\0\364\0\10\0\312\0\10\0\3\0\10\0\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\0\10\0\0\0\10\0>\0\10\0\366\0\7\0"
+ "\306\0\0\0n\0\0\0\330\0\0\0\366\377\377\377\0\0\10\0\2\0\10\0\301\0\10\0"
+ "\367\0\10\0)\0\10\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\0\0\0\6\0\0\0S\0\1\0\342\0\1\0\377\0\0\0\373"
+ "\0\0\0\377\0\0\0\333\377\377\377\0\0\10\0O\0\10\0\377\0\10\0u\0\10\0\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\0\0\0\2\0\0\0\267\0\0\0\366\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\260\377\377\377\0\0\10\0\207\0\10\0\377\0\10\0\25\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\0\0\0\0\0\0\0\7\0\0\0\261\0\0\0\357\0\0\0\377\0\0\0\377\0\0\0\375\0\0"
+ "\0t\377\377\377\0\0\10\0\272\0\10\0\341\0\10\0\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\204\0\0\0\354\0\0\0\377\0\0\0\355\0\0\0"
+ "C\377\377\377\0\0\10\0\354\0\10\0\254\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\0\0\0\0U\0\0\0\352\0\0\0"
+ "\356\0\0\0\26\0\10\0\40\0\10\0\377\0\10\0x\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\0\0\0\0"
+ """1\0\0\0\324\0\0\0\0\0\10\0\7\0\10\0C\0\10\0\"\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\0\0\0\0\0\0\0\10\377\377\377\0\0\10\0\0\0\0\0""8\0\0\0\6\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\0\10\0\13\0\10\0\266\0\10\0I\377\377\377\0\0\0\0\273"
+ "\0\0\0\322\0\0\0\24\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\0\10\0;\0\10\0\377\0\10\0\\\377\377"
+ "\377\0\0\0\0\340\0\0\0\375\0\0\0\341\0\0\0+\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0p\0\10\0\377\0\10\0*\0"
+ "\0\0\10\0\0\0\347\0\0\0\377\0\0\0\377\0\0\0\350\0\0\0L\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\244\0\10\0\364\0\10\0"
+ "\2\0\0\0""1\0\0\0\351\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\353\0\0\0x\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\333\0\10\0\304\0\10\0"
+ "\0\0\0\0_\0\0\0\370\0\0\0\377\0\0\0\377\0\0\0\374\0\0\0\352\0\0\0\301\0\0"
+ "\0\35\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\0\10\0d\0\10\0\377\0\10\0w\377\377\377\0\0\0"
+ "\0\232\0\0\0\376\0\0\0\353\0\1\0\367\0\4\0\367\0\4\0)\0\0\0\0\0\0\0\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\0\10\0\37\0\10\0\362\0\10\0\315\0\10\0\4\377\377\377\0\0\0\0\236\0\0\0"
+ "\217\0\0\0&\0\10\0>\0\10\0\376\0\10\0\320\0\10\0\25\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\12\0\10"
+ "\0\277\0\10\0\371\0\10\0,\0\10\0\0\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\10\0\0\0\10\0c\0\10\0\375\0\10\0\325\0\10\0\36\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\377\377\377\0\0\10\0<\0\10\0\333\0\10\0\377\0\10\0s\0\10\0"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
+ "\377\377\377\0\0\10\0\0\0\10\0Z\0\10\0\373\0\10\0\370\0\10\0\226\0\10\0\35"
+ "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\5\0\10\0"
+ """0\0\10\0\220\0\10\0\375\0\10\0\351\0\10\0S\0\10\0\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\0\10\0\0\0\10\0/\0\10\0\256\0\10\0\376\0\10\0\376\0\10\0"
+ "\341\0\10\0\274\0\10\0\242\0\10\0\312\0\10\0\370\0\10\0\377\0\10\0\377\0"
+ "\10\0\252\0\10\0\24\0\10\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
+ "\377\0\377\377\377\0\0\10\0\0\0\10\0\0\0\10\0.\0\10\0\215\0\10\0\265\0\10"
+ "\0\334\0\10\0\366\0\10\0\320\0\10\0\234\0\10\0i\0\10\0""1\0\10\0\0\0\10\0"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0",
+};
diff --git a/framebuffer/fb_image_data.h b/framebuffer/fb_image_data.h
new file mode 100644
index 000000000..f1ab46d34
--- /dev/null
+++ b/framebuffer/fb_image_data.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+struct fb_widget_image_s {
+ unsigned int width;
+ unsigned int height;
+ unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
+ unsigned char *pixel_data;
+};
+
+typedef struct fb_widget_image_s fb_widget_image_t;
+
+extern const fb_widget_image_t left_arrow;
+extern const fb_widget_image_t right_arrow;
+extern const fb_widget_image_t reload;
+extern const fb_widget_image_t pointer_image;
diff --git a/framebuffer/fb_plotters.c b/framebuffer/fb_plotters.c
index 72e892b8a..b4a3e09d5 100644
--- a/framebuffer/fb_plotters.c
+++ b/framebuffer/fb_plotters.c
@@ -200,9 +200,9 @@ bool fb_clip(int x0, int y0, int x1, int y1)
fb_plot_ctx.y1 = y1;
}
- LOG(("%d, %d - %d, %d clipped to %d, %d - %d, %d",
+ /*LOG(("%d, %d - %d, %d clipped to %d, %d - %d, %d",
x0,y0,x1,y1,
- fb_plot_ctx.x0, fb_plot_ctx.y0, fb_plot_ctx.x1, fb_plot_ctx.y1));
+ fb_plot_ctx.x0, fb_plot_ctx.y0, fb_plot_ctx.x1, fb_plot_ctx.y1)); */
return true;
}
diff --git a/framebuffer/fb_rootwindow.c b/framebuffer/fb_rootwindow.c
index a639d988f..ac86499e7 100644
--- a/framebuffer/fb_rootwindow.c
+++ b/framebuffer/fb_rootwindow.c
@@ -43,332 +43,169 @@
#include "framebuffer/fb_schedule.h"
#include "framebuffer/fb_cursor.h"
#include "framebuffer/fb_rootwindow.h"
+#include "framebuffer/fb_image_data.h"
-struct fb_widget_image_s {
- unsigned int width;
- unsigned int height;
- unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
- unsigned char *pixel_data;
+enum fb_widget_type_e {
+ FB_WIDGET_TYPE_NONE = 0,
+ FB_WIDGET_TYPE_BUTTON,
+ FB_WIDGET_TYPE_WINDOW,
+ FB_WIDGET_TYPE_TEXT,
};
-typedef struct fb_widget_image_s fb_widget_image_t;
-
-static const fb_widget_image_t left_arrow = {
- 22, 25, 4,
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\0\10\0\14\0\10\0\206\0\11\0\350\0\10\0.\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\0\10\0\1\0\10\0]\0\12\0\347\0\10\0\377\0\10\0\377\0\10\0W\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0""5\0\11\0\310\0\10"
- "\0\377\0)\3\375\0|\12\377\0\10\0\377\0\10\0W\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\0\10\0\30\0\10\0\237\0\10\0\376\0\23\1\375\0\215\14\377\0\371\25\377"
- "\0\301\20\377\0\10\0\377\0\10\0W\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\6\0\10\0u\0\12\0\364\0"
- "\11\0\377\0d\10\377\0\350\24\377\0\377\26\377\0\377\26\377\0\301\20\377\0"
- "\10\0\377\0\10\0V\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\0\10\0L\0\12\0\334\0\10\0\377\0<\5\376\0\313\21\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0V\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\0\10\0(\0\10\0\267\0\10\0\377\0\36\2\375"
- "\0\244\16\377\0\376\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0V\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\17\0\10"
- "\0\216\0\11\0\373\0\15\0\376\0|\12\377\0\363\25\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
- "\20\377\0\10\0\377\0\10\0U\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\0\10\0\2\0\10\0e\0\12\0\354\0\10\0\377\0T\7\377\0\335\23\377\0"
- "\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10"
- "\0U\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0<\0\12\0\320\0\10\0\377"
- "\0/\3\375\0\274\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0T\377\377\377\0\0\10\0\35"
- "\0\10\0\247\0\10\0\377\0\26\1\375\0\223\14\377\0\373\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
- "\20\377\0\10\0\377\0\10\0T\0\10\0m\0\12\0\367\0\11\0\376\0l\11\377\0\354"
- "\24\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10"
- "\0T\0\11\0\331\0\10\0\377\0=\5\377\0\340\23\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0S\0\10\0\21\0\10\0\222"
- "\0\11\0\374\0\16\1\376\0\200\13\377\0\364\25\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
- "\20\377\0\10\0\377\0\10\0S\377\377\377\0\377\377\377\0\0\10\0+\0\11\0\275"
- "\0\10\0\377\0\40\2\375\0\250\16\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10"
- "\0S\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0Q\0\12"
- "\0\340\0\10\0\377\0@\5\376\0\316\22\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0R\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\10\0\10\0{\0\12\0"
- "\366\0\11\0\376\0h\11\377\0\352\24\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301"
- "\20\377\0\10\0\377\0\10\0R\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\33\0\10\0\245"
- "\0\10\0\377\0\24\1\375\0\221\14\377\0\372\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0"
- "\377\0\10\0R\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0"
- ":\0\12\0\315\0\10\0\377\0,\3\375\0\270\20\377\0\377\26\377\0\377\26\377\0"
- "\377\26\377\0\377\26\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0Q\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\2\0"
- "\10\0c\0\12\0\353\0\10\0\377\0P\6\377\0\332\23\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\301\20\377\0\10\0\377\0\10\0Q\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0"
- "\10\0\17\0\10\0\215\0\11\0\373\0\15\0\376\0x\12\377\0\361\25\377\0\377\26"
- "\377\0\301\20\377\0\10\0\377\0\10\0Q\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\0\10\0'\0\10\0\267\0\10\0\377\0\34\2\375\0\241\16\377\0\300"
- "\20\377\0\10\0\377\0\10\0P\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\0\10\0L\0\12\0\334\0\10\0\377\0!\2\376\0\10"
- "\0\377\0\10\0P\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\0\10\0\6\0\10\0v\0\12\0\364\0\10\0\377\0\10"
- "\0N\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\30\0\10\0g\0\10\0"
- "\6",
-};
-
-static const fb_widget_image_t right_arrow = {
- 22, 25, 4,
- "\0\10\0""0\0\11\0\350\0\10\0\206\0\10\0\14\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\0\10\0W\0\10\0\377\0\10\0\377\0\13\0\347\0\10\0]\0\10\0\1\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0W\0"
- "\10\0\377\0|\12\377\0)\3\375\0\10\0\377\0\12\0\311\0\10\0""6\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0W\0\10\0\377\0"
- "\301\20\377\0\371\25\377\0\215\14\377\0\23\1\375\0\10\0\376\0\10\0\240\0"
- "\10\0\31\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0V\0\10\0\377\0\301\20"
- "\377\0\377\26\377\0\377\26\377\0\350\24\377\0d\10\377\0\11\0\377\0\12\0\364"
- "\0\10\0w\0\10\0\6\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\0\10\0V\0\10\0\377\0\301\20\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\313\21\377\0<\5\376\0\10\0\377\0\12\0"
- "\336\0\10\0N\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\0\10\0V\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\376\26\377\0\244\16\377\0\36\2\375\0\10"
- "\0\377\0\11\0\273\0\10\0*\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0U\0"
- "\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\363\25\377\0|\12\377\0\15\0\376"
- "\0\11\0\374\0\10\0\221\0\10\0\21\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0U\0\10\0\377\0\301\20"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\335\23\377\0T\7\377\0\10"
- "\0\377\0\12\0\355\0\10\0h\0\10\0\3\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\0\10\0T\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\274\20\377\0/\4\375\0\10\0"
- "\377\0\12\0\322\0\10\0@\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0"
- "T\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\373\26\377\0\223\14\377\0\26\1\375\0"
- "\10\0\377\0\10\0\253\0\10\0\37\377\377\377\0\0\10\0T\0\10\0\377\0\301\20"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\354\24\377\0l\11\377\0\11\0\376"
- "\0\11\0\370\0\10\0u\0\10\0S\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\340\23\377\0=\5\377\0\10\0\377\0\11\0\327\0"
- "\10\0S\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\364\25\377\0\200\13"
- "\377\0\16\1\376\0\11\0\375\0\10\0\227\0\10\0\23\0\10\0S\0\10\0\377\0\301"
- "\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\250\16\377\0\40\2\375\0\10\0\377\0\11\0\301\0\10\0/\377"
- "\377\377\0\377\377\377\0\0\10\0R\0\10\0\377\0\301\20\377\0\377\26\377\0\377"
- "\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\316\22\377\0@\5\376\0\10\0\377"
- "\0\12\0\342\0\10\0U\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\0\10\0R\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377"
- "\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\352\24"
- "\377\0h\11\377\0\11\0\376\0\12\0\367\0\10\0~\0\10\0\11\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0R\0\10\0\377\0"
- "\301\20\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\372\26\377\0\221\14\377\0\24\1\375\0\10\0\377\0\10\0"
- "\247\0\10\0\35\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\0\10\0Q\0\10\0\377\0\301\20\377\0"
- "\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\377\26\377\0\270\20"
- "\377\0,\3\375\0\10\0\377\0\12\0\317\0\10\0=\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\0\10\0Q\0\10\0\377\0\301\20\377\0\377\26\377\0\377\26"
- "\377\0\377\26\377\0\332\23\377\0P\6\377\0\10\0\377\0\12\0\354\0\10\0e\0\10"
- "\0\2\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\0\10\0Q\0\10\0\377\0\301\20\377\0\377\26\377\0\361\25\377\0x\12\377\0\15"
- "\0\376\0\11\0\374\0\10\0\217\0\10\0\17\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0P\0\10\0"
- "\377\0\300\20\377\0\241\16\377\0\34\2\375\0\10\0\377\0\10\0\270\0\10\0(\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0P\0\10\0\377\0!\2\376"
- "\0\10\0\377\0\12\0\335\0\10\0M\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\0\10\0K\0\10\0\377\0\12\0\364\0\10\0v"
- "\0\10\0\6\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\0\10\0\10\0\10\0j\0\10\0\30\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0",
-};
-
-static const fb_widget_image_t reload = {
- 24, 25, 4,
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0"
- "\36\0\10\0O\0\10\0H\0\10\0!\0\10\0\2\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\0\10\0\5\0\10\0r\0\10\0\271\0\10\0\353\0\10"
- "\0\377\0\10\0\377\0\10\0\377\0\10\0\377\0\10\0\370\0\10\0\263\0\10\0""6\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\0\10\0.\0\10\0\317\0\10\0\377\0\10\0\341\0\10\0\255\0\10"
- "\0z\0\10\0I\0\10\0Q\0\10\0v\0\10\0\241\0\10\0\366\0\10\0\377\0\10\0\267\0"
- "\10\0\40\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0|\0"
- "\10\0\372\0\10\0\361\0\10\0e\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0"
- "\0\10\0\0\0\10\0\0\0\10\0\27\0\10\0\214\0\10\0\370\0\10\0\343\0\10\0&\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\0\10\0i\0\10\0\377\0\10\0\272\0\10\0\36\0\10\0\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\0\10\0\0\0\10\0\0\0\10\0D\0\10\0\365\0\10\0\350\0\10"
- "\0)\377\377\377\0\377\377\377\0\0\0\0\"\377\377\377\0\377\377\377\0\0\10"
- "\0\"\0\10\0\364\0\10\0\312\0\10\0\3\0\10\0\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\0\10\0\0\0\10\0>\0\10\0\366\0\7\0"
- "\306\0\0\0n\0\0\0\330\0\0\0\366\377\377\377\0\0\10\0\2\0\10\0\301\0\10\0"
- "\367\0\10\0)\0\10\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\0\0\0\6\0\0\0S\0\1\0\342\0\1\0\377\0\0\0\373"
- "\0\0\0\377\0\0\0\333\377\377\377\0\0\10\0O\0\10\0\377\0\10\0u\0\10\0\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\0\0\0\2\0\0\0\267\0\0\0\366\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
- "\0\0\260\377\377\377\0\0\10\0\207\0\10\0\377\0\10\0\25\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\0\0\0\0\0\0\0\7\0\0\0\261\0\0\0\357\0\0\0\377\0\0\0\377\0\0\0\375\0\0"
- "\0t\377\377\377\0\0\10\0\272\0\10\0\341\0\10\0\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\204\0\0\0\354\0\0\0\377\0\0\0\355\0\0\0"
- "C\377\377\377\0\0\10\0\354\0\10\0\254\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\0\0\0\0U\0\0\0\352\0\0\0"
- "\356\0\0\0\26\0\10\0\40\0\10\0\377\0\10\0x\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\0\0\0\0"
- """1\0\0\0\324\0\0\0\0\0\10\0\7\0\10\0C\0\10\0\"\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\0\0\0\0\0\0\0\10\377\377\377\0\0\10\0\0\0\0\0""8\0\0\0\6\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\0\10\0\13\0\10\0\266\0\10\0I\377\377\377\0\0\0\0\273"
- "\0\0\0\322\0\0\0\24\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\0\10\0;\0\10\0\377\0\10\0\\\377\377"
- "\377\0\0\0\0\340\0\0\0\375\0\0\0\341\0\0\0+\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0p\0\10\0\377\0\10\0*\0"
- "\0\0\10\0\0\0\347\0\0\0\377\0\0\0\377\0\0\0\350\0\0\0L\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\244\0\10\0\364\0\10\0"
- "\2\0\0\0""1\0\0\0\351\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\353\0\0\0x\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\333\0\10\0\304\0\10\0"
- "\0\0\0\0_\0\0\0\370\0\0\0\377\0\0\0\377\0\0\0\374\0\0\0\352\0\0\0\301\0\0"
- "\0\35\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\0\10\0d\0\10\0\377\0\10\0w\377\377\377\0\0\0"
- "\0\232\0\0\0\376\0\0\0\353\0\1\0\367\0\4\0\367\0\4\0)\0\0\0\0\0\0\0\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\0\10\0\37\0\10\0\362\0\10\0\315\0\10\0\4\377\377\377\0\0\0\0\236\0\0\0"
- "\217\0\0\0&\0\10\0>\0\10\0\376\0\10\0\320\0\10\0\25\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\12\0\10"
- "\0\277\0\10\0\371\0\10\0,\0\10\0\0\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\10\0\0\0\10\0c\0\10\0\375\0\10\0\325\0\10\0\36\377\377\377\0\377\377\377"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\377\377\377\0\0\10\0<\0\10\0\333\0\10\0\377\0\10\0s\0\10\0"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
- "\377\377\377\0\0\10\0\0\0\10\0Z\0\10\0\373\0\10\0\370\0\10\0\226\0\10\0\35"
- "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\10\0\5\0\10\0"
- """0\0\10\0\220\0\10\0\375\0\10\0\351\0\10\0S\0\10\0\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
- "\0\377\377\377\0\0\10\0\0\0\10\0/\0\10\0\256\0\10\0\376\0\10\0\376\0\10\0"
- "\341\0\10\0\274\0\10\0\242\0\10\0\312\0\10\0\370\0\10\0\377\0\10\0\377\0"
- "\10\0\252\0\10\0\24\0\10\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
- "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
- "\377\0\377\377\377\0\0\10\0\0\0\10\0\0\0\10\0.\0\10\0\215\0\10\0\265\0\10"
- "\0\334\0\10\0\366\0\10\0\320\0\10\0\234\0\10\0i\0\10\0""1\0\10\0\0\0\10\0"
- "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0",
-};
-
-
-
struct fb_widget {
struct fb_widget *next;
+
+ /* properties */
+ enum fb_widget_type_e type;
int x;
int y;
int width;
int height;
+ colour bg;
+ colour fg;
+
+ /* handlers */
fb_widget_mouseclick_t click;
+ fb_widget_input_t input;
+
+ /* data */
struct bitmap *bitmap;
struct gui_window *g;
+ char* text;
};
static struct fb_widget *widget_list;
+/* widget for status */
+static struct fb_widget *status_widget;
+
+/* widget for url */
+static struct fb_widget *url_widget;
+
+/* widget with input focus */
+static struct fb_widget *inputfocus_widget;
+static int input_idx;
+
+struct gui_window *rootwindow;
+
+static void
+fb_redraw_widget(struct fb_widget *widget)
+{
+ bbox_t saved_plot_ctx;
+
+ /* set the clipping rectangle to the widget area */
+ saved_plot_ctx = fb_plot_ctx;
+
+ fb_plot_ctx.x0 = widget->x;
+ fb_plot_ctx.y0 = widget->y;
+ fb_plot_ctx.x1 = widget->x + widget->width;
+ fb_plot_ctx.y1 = widget->y + widget->height;
+
+ /* clear background */
+ if ((widget->bg & 0xFF000000) != 0) {
+ /* transparent polygon filling isnt working so fake it */
+ plot.fill(fb_plot_ctx.x0, fb_plot_ctx.y0,
+ fb_plot_ctx.x1, fb_plot_ctx.y1,
+ widget->bg);
+ }
+
+ /* do our drawing according to type*/
+
+ switch (widget->type) {
+
+ case FB_WIDGET_TYPE_BUTTON:
+ /* plot the image */
+ plot.bitmap(widget->x,
+ widget->y,
+ widget->width,
+ widget->height,
+ widget->bitmap,
+ 0, NULL);
+ break;
+
+ case FB_WIDGET_TYPE_WINDOW:
+ break;
+
+ case FB_WIDGET_TYPE_TEXT:
+ if (widget->text != NULL) {
+ plot.text(fb_plot_ctx.x0,
+ fb_plot_ctx.y0 + 15,
+ NULL,
+ widget->text,
+ strlen(widget->text),
+ widget->bg,
+ widget->fg);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ fb_os_redraw(&fb_plot_ctx);
+
+ /* restore clipping rectangle */
+ fb_plot_ctx = saved_plot_ctx;
+
+
+}
+
+/* inserts widget into head of list and issues a redraw request */
+static void
+fb_insert_widget(struct fb_widget *widget)
+{
+ widget->next = widget_list;
+ widget_list = widget;
+
+ fb_redraw_widget(widget);
+}
+
+/* generic input click focus handler */
+static void
+fb_change_input_focus(struct fb_widget *widget)
+{
+ LOG(("Changing input focus to %p", widget));
+
+ if (inputfocus_widget == widget)
+ return;
+
+ /* new widget gainig focus */
+ inputfocus_widget = widget;
+
+ /* tell it so */
+ widget->input(widget, NULL, -1);
+}
+
+static int
+fb_widget_url_input(struct fb_widget *widget, struct gui_window *g, int value)
+{
+
+ if (url_widget == NULL)
+ return 0;
+
+ if (value == -1) {
+ /* gain focus */
+ if (widget->text == NULL)
+ widget->text = calloc(1,1);
+ input_idx = strlen(widget->text);
+ } else {
+ if (value == '\b') {
+ if (input_idx <= 0)
+ return 0;
+ input_idx--;
+ widget->text[input_idx] = 0;
+ } else if (value == '\r') {
+ browser_window_go(g->bw, widget->text, 0, true);
+ } else {
+ widget->text = realloc(widget->text, input_idx + 2); /* allow for new character and null */
+ widget->text[input_idx] = value;
+ input_idx++;
+ }
+ fb_redraw_widget(url_widget);
+ }
+ return 0;
+}
+
static struct fb_widget *
fb_add_button_widget(int x,
int y,
@@ -376,16 +213,18 @@ fb_add_button_widget(int x,
fb_widget_mouseclick_t click_rtn)
{
struct fb_widget *new_widget;
- new_widget = malloc(sizeof(struct fb_widget));
+ new_widget = calloc(1, sizeof(struct fb_widget));
if (new_widget == NULL)
return NULL;
+ new_widget->type = FB_WIDGET_TYPE_BUTTON;
new_widget->x = x;
new_widget->y = y;
- new_widget->click = click_rtn;
new_widget->width = widget_image->width;
new_widget->height = widget_image->height;
+ new_widget->click = click_rtn;
+
new_widget->bitmap = bitmap_create(widget_image->width,
widget_image->height,
0);
@@ -396,44 +235,63 @@ fb_add_button_widget(int x,
widget_image->height *
widget_image->bytes_per_pixel);
+ fb_insert_widget(new_widget);
- new_widget->next = widget_list;
- widget_list = new_widget;
+ return new_widget;
+}
- /* plot the image */
- plot.bitmap(x, y,
- new_widget->width,
- new_widget->height,
- new_widget->bitmap,
- 0, NULL);
+static struct fb_widget *
+fb_add_text_widget(int x, int y, int width, int height, colour bg, fb_widget_input_t input_rtn)
+{
+ struct fb_widget *new_widget;
+ new_widget = calloc(1, sizeof(struct fb_widget));
+ if (new_widget == NULL)
+ return NULL;
+
+ new_widget->type = FB_WIDGET_TYPE_TEXT;
+ new_widget->x = x;
+ new_widget->y = y;
+ new_widget->width = width;
+ new_widget->height = height;
+ new_widget->bg = bg;
+ new_widget->fg = 0xFF000000;
+
+ new_widget->input = input_rtn;
+
+ fb_insert_widget(new_widget);
return new_widget;
}
struct fb_widget *
-fb_add_window_widget(struct gui_window *g,
- fb_widget_mouseclick_t click_rtn)
+fb_add_window_widget(struct gui_window *g,
+ colour bg,
+ fb_widget_mouseclick_t click_rtn,
+ fb_widget_input_t input_rtn)
{
struct fb_widget *new_widget;
- new_widget = malloc(sizeof(struct fb_widget));
+ new_widget = calloc(1, sizeof(struct fb_widget));
if (new_widget == NULL)
return NULL;
+ new_widget->type = FB_WIDGET_TYPE_WINDOW;
new_widget->x = g->x;
new_widget->y = g->y;
new_widget->width = g->width;
new_widget->height = g->height;
+ new_widget->bg = bg;
+
new_widget->click = click_rtn;
+ new_widget->input = input_rtn;
- new_widget->bitmap = NULL;
new_widget->g = g;
- new_widget->next = widget_list;
- widget_list = new_widget;
+ fb_insert_widget(new_widget);
return new_widget;
}
+
/* left icon click routine */
static int
fb_widget_leftarrow_click(struct gui_window *g, browser_mouse_state st, int x, int y)
@@ -454,79 +312,112 @@ fb_widget_rightarrow_click(struct gui_window *g, browser_mouse_state st, int x,
}
-void fb_rootwindow_status(framebuffer_t *fb, const char* text)
+
+/* update status widget */
+void fb_rootwindow_status(const char* text)
{
- bbox_t saved_plot_ctx;
-
- /* enlarge the clipping rectangle to the whole screen for plotting the
- * root window
- */
- saved_plot_ctx = fb_plot_ctx;
+ if (status_widget == NULL)
+ return;
- fb_plot_ctx.x0 = 0;
- fb_plot_ctx.y0 = fb->height - 20;
- fb_plot_ctx.x1 = fb->width;
- fb_plot_ctx.y1 = fb->height;
+ if (status_widget->text != NULL)
+ free(status_widget->text);
- /* do our drawing etc. */
- plot.fill(0, fb_plot_ctx.y0, fb_plot_ctx.x1, fb_plot_ctx.y1, 0xFFFFFFFF);
- plot.text(fb_plot_ctx.x0, fb_plot_ctx.y0 + 15, NULL, text, strlen(text), 0xffffffff, 0xFF000000);
+ status_widget->text = strdup(text);
- fb_os_redraw(&fb_plot_ctx);
+ fb_redraw_widget(status_widget);
+}
- /* restore clipping rectangle */
- fb_plot_ctx = saved_plot_ctx;
+/* update url widget */
+void fb_rootwindow_url(const char* text)
+{
+ if (url_widget == NULL)
+ return;
+
+ if (url_widget->text != NULL)
+ free(url_widget->text);
+
+ url_widget->text = strdup(text);
+ input_idx = strlen(text);
+
+ fb_redraw_widget(url_widget);
}
+
void fb_rootwindow_create(framebuffer_t *fb)
{
- bbox_t saved_plot_ctx;
struct fb_widget *newwidget;
+ /* empty widget list */
widget_list = NULL;
- /* enlarge the clipping rectangle to the whole screen for plotting the
- * root window
- */
- saved_plot_ctx = fb_plot_ctx;
-
- fb_plot_ctx.x0 = 0;
- fb_plot_ctx.y0 = 0;
- fb_plot_ctx.x1 = fb->width;
- fb_plot_ctx.y1 = fb->height;
+ /* no widget yet has input */
+ inputfocus_widget = NULL;
- /* do our drawing etc. */
- plot.fill(0, 0, fb->width, fb->height, 0xFFFFFFFF);
+ /* underlying root window, cannot take input and lowest in stack */
+ rootwindow = calloc(1, sizeof(struct gui_window));
+ rootwindow->x = 0;
+ rootwindow->y = 0;
+ rootwindow->width = fb->width;
+ rootwindow->height = fb->height;
+ fb_add_window_widget(rootwindow, 0xFFCCCCCC, NULL, NULL);
- newwidget = fb_add_button_widget(2, 2,
+ /* back button */
+ newwidget = fb_add_button_widget(5, 2,
&left_arrow,
fb_widget_leftarrow_click);
- newwidget = fb_add_button_widget(newwidget->x + newwidget->width + 2,
+ /* forward button */
+ newwidget = fb_add_button_widget(newwidget->x + newwidget->width + 5,
2,
&right_arrow,
fb_widget_rightarrow_click);
- fb_os_redraw(&fb_plot_ctx);
+ /* url widget */
+ url_widget = fb_add_text_widget(newwidget->x + newwidget->width + 5, 5,
+ fb->width - 200, 20,
+ 0xFFFFFFFF,
+ fb_widget_url_input);
- /* restore clipping rectangle */
- fb_plot_ctx = saved_plot_ctx;
+
+ /* add status area widget, width of framebuffer less some for
+ * scrollbar
+ */
+ status_widget = fb_add_text_widget(0, fb->height - 20,
+ fb->width - 200, 20,
+ 0xFFCCCCCC,
+ NULL);
+
+}
+
+void
+fb_rootwindow_input(struct gui_window *g, int value)
+{
+ if ((inputfocus_widget != NULL) &&
+ (inputfocus_widget->input != NULL)) {
+ inputfocus_widget->input(inputfocus_widget, g, value);
+ }
}
void
fb_rootwindow_click(struct gui_window *g, browser_mouse_state st, int x, int y)
{
struct fb_widget *widget;
- LOG(("Click in root window"));
widget = widget_list;
while (widget != NULL) {
- if ((widget->click != NULL) &&
- (x > widget->x) &&
+ if ((x > widget->x) &&
(y > widget->y) &&
(x < widget->x + widget->width) &&
(y < widget->y + widget->height)) {
- widget->click(g, st, x, y);
+ if (widget->click != NULL) {
+ widget->click(g, st,
+ x - widget->x, y - widget->y);
+ }
+
+ if (widget->input != NULL) {
+ fb_change_input_focus(widget);
+ }
+
break;
}
widget = widget->next;
diff --git a/framebuffer/fb_rootwindow.h b/framebuffer/fb_rootwindow.h
index 40b47f0ec..b6f17f0ae 100644
--- a/framebuffer/fb_rootwindow.h
+++ b/framebuffer/fb_rootwindow.h
@@ -16,11 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+typedef struct fb_widget fb_widget_t;
+
+typedef int (*fb_widget_input_t)(fb_widget_t *widget, struct gui_window *g,int value);
typedef int (*fb_widget_mouseclick_t)(struct gui_window *g, browser_mouse_state st, int x, int y);
-void fb_rootwindow_click(struct gui_window *g, browser_mouse_state st , int x, int y);
+void fb_rootwindow_click(struct gui_window *g,
+ browser_mouse_state st , int x, int y);
+void fb_rootwindow_input(struct gui_window *g, int value);
+void fb_rootwindow_status(const char* text);
+void fb_rootwindow_url(const char* text);
+
+
void fb_rootwindow_create(framebuffer_t *fb);
-struct fb_widget *fb_add_window_widget(struct gui_window *g, fb_widget_mouseclick_t click_rtn);
+struct fb_widget *fb_add_window_widget(struct gui_window *g, colour bg, fb_widget_mouseclick_t click_rtn, fb_widget_input_t input_rtn);
-void fb_rootwindow_status(framebuffer_t *fb, const char* text);