r6659 rjek - /trunk/netsurf/gtk/gtk_scaffolding.c
by netsurf@semichrome.net
Author: rjek
Date: Sat Feb 28 14:02:09 2009
New Revision: 6659
URL: http://source.netsurf-browser.org?rev=6659&view=rev
Log:
Select the text in the URL bar on Ctrl-A if the widget has the focus, rather
than the document text.
Thanks to Paweł Blokus <pblokus(a)gmail.com> for the patch.
Modified:
trunk/netsurf/gtk/gtk_scaffolding.c
Modified: trunk/netsurf/gtk/gtk_scaffolding.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_scaffolding.c?rev...
==============================================================================
--- trunk/netsurf/gtk/gtk_scaffolding.c (original)
+++ trunk/netsurf/gtk/gtk_scaffolding.c Sat Feb 28 14:02:09 2009
@@ -777,9 +777,14 @@
struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
struct browser_window *bw = nsgtk_get_browser_for_gui(gw->top_level);
- LOG(("Selecting all text"));
- selection_select_all(bw->sel);
-
+ if (GTK_WIDGET_HAS_FOCUS(gw->url_bar)) {
+ LOG(("Selecting all URL bar text"));
+ gtk_editable_select_region(GTK_EDITABLE(gw->url_bar), 0, -1);
+ } else {
+ LOG(("Selecting all document text"));
+ selection_select_all(bw->sel);
+ }
+
return TRUE;
}
14 years, 7 months
r6658 vince - /trunk/netsurf/framebuffer/fb_rootwindow.c
by netsurf@semichrome.net
Author: vince
Date: Fri Feb 27 06:15:28 2009
New Revision: 6658
URL: http://source.netsurf-browser.org?rev=6658&view=rev
Log:
only perform navigation actions on release of button 1
Modified:
trunk/netsurf/framebuffer/fb_rootwindow.c
Modified: trunk/netsurf/framebuffer/fb_rootwindow.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_rootwindow...
==============================================================================
--- trunk/netsurf/framebuffer/fb_rootwindow.c (original)
+++ trunk/netsurf/framebuffer/fb_rootwindow.c Fri Feb 27 06:15:28 2009
@@ -307,8 +307,10 @@
static int
fb_widget_leftarrow_click(struct gui_window *g, browser_mouse_state st, int x, int y)
{
- if (history_back_available(g->bw->history))
- history_back(g->bw, g->bw->history);
+ if (st == BROWSER_MOUSE_CLICK_1) {
+ if (history_back_available(g->bw->history))
+ history_back(g->bw, g->bw->history);
+ }
return 0;
}
@@ -317,8 +319,10 @@
static int
fb_widget_rightarrow_click(struct gui_window *g, browser_mouse_state st, int x, int y)
{
- if (history_forward_available(g->bw->history))
- history_forward(g->bw, g->bw->history);
+ if (st == BROWSER_MOUSE_CLICK_1) {
+ if (history_forward_available(g->bw->history))
+ history_forward(g->bw, g->bw->history);
+ }
return 0;
}
14 years, 7 months
r6657 vince - in /trunk/netsurf/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c fb_frontend_sdl.c fb_plotters.h
by netsurf@semichrome.net
Author: vince
Date: Fri Feb 27 05:36:18 2009
New Revision: 6657
URL: http://source.netsurf-browser.org?rev=6657&view=rev
Log:
Unroll some fill loops, enable adrianl improved ablend function
Modified:
trunk/netsurf/framebuffer/fb_16bpp_plotters.c
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
trunk/netsurf/framebuffer/fb_frontend_sdl.c
trunk/netsurf/framebuffer/fb_plotters.h
Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Fri Feb 27 05:36:18 2009
@@ -191,7 +191,28 @@
pvid32 = (uint32_t *)pvid16;
while (height-- > 0) {
- for (w = width; w > 0; w--) *pvid32++ = ent32;
+ w = width;
+ while (w >= 16) {
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ w-=16;
+ }
+ while (w >= 4) {
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ *pvid32++ = ent32; *pvid32++ = ent32;
+ w-=4;
+ }
+ while (w > 0) {
+ *pvid32++ = ent32;
+ w--;
+ }
+ // for (w = width; w > 0; w--) *pvid32++ = ent32;
pvid32 += llen;
}
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Fri Feb 27 05:36:18 2009
@@ -189,30 +189,27 @@
pvid = fb_32bpp_get_xy_loc(x0, y0);
while (height-- > 0) {
-#if 1
- for (w = width; w > 0; w--) *pvid++ = ent;
-#else
- uint32_t *evid = pvid + width;
- while (pvid <= evid - 16) {
+ w = width;
+ while (w >= 16) {
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ w-=16;
+ }
+ while (w >= 4) {
+ *pvid++ = ent; *pvid++ = ent;
+ *pvid++ = ent; *pvid++ = ent;
+ w-=4;
+ }
+ while (w > 0) {
*pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- *pvid++ = ent;
- }
- while (pvid < evid) *pvid++ = ent;
-#endif
+ w--;
+ }
pvid += llen;
}
Modified: trunk/netsurf/framebuffer/fb_frontend_sdl.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_frontend_s...
==============================================================================
--- trunk/netsurf/framebuffer/fb_frontend_sdl.c (original)
+++ trunk/netsurf/framebuffer/fb_frontend_sdl.c Fri Feb 27 05:36:18 2009
@@ -184,8 +184,8 @@
case SDL_BUTTON_MIDDLE:
default:
- printf("Mouse button %d pressed at (%d,%d)\n",
- event.button.button, event.button.x, event.button.y);
+ LOG(("Mouse button %d pressed at (%d,%d)\n",
+ event.button.button, event.button.x, event.button.y));
}
break;
@@ -206,8 +206,8 @@
break;
default:
- printf("Mouse button %d pressed at (%d,%d)\n",
- event.button.button, event.button.x, event.button.y);
+ LOG(("Mouse button %d pressed at (%d,%d)\n",
+ event.button.button, event.button.x, event.button.y));
}
break;
Modified: trunk/netsurf/framebuffer/fb_plotters.h
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.h...
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.h (original)
+++ trunk/netsurf/framebuffer/fb_plotters.h Fri Feb 27 05:36:18 2009
@@ -50,7 +50,7 @@
/* alpha blend two pixels together */
static inline colour fb_plotters_ablend(colour pixel, colour scrpixel)
{
-#if 1
+#if 0
int opacity = (pixel >> 24) & 0xFF;
int r,g,b;
@@ -74,7 +74,7 @@
g = ((pixel & 0x00FF00) * opacity +
(scrpixel & 0x00FF00) * transp) >> 8;
- return (rb & 0xFF0FF) | (g & 0xFF00);
+ return (rb & 0xFF00FF) | (g & 0xFF00);
#endif
}
14 years, 7 months
r6656 vince - in /trunk/netsurf/framebuffer: fb_font_freetype.c fb_options.h
by netsurf@semichrome.net
Author: vince
Date: Fri Feb 27 05:35:06 2009
New Revision: 6656
URL: http://source.netsurf-browser.org?rev=6656&view=rev
Log:
make font face locations configurable options
Modified:
trunk/netsurf/framebuffer/fb_font_freetype.c
trunk/netsurf/framebuffer/fb_options.h
Modified: trunk/netsurf/framebuffer/fb_font_freetype.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_font_freet...
==============================================================================
--- trunk/netsurf/framebuffer/fb_font_freetype.c (original)
+++ trunk/netsurf/framebuffer/fb_font_freetype.c Fri Feb 27 05:35:06 2009
@@ -24,12 +24,15 @@
#include "css/css.h"
#include "render/font.h"
-#include "desktop/options.h"
#include "utils/utf8.h"
#include "utils/log.h"
#include "framebuffer/fb_gui.h"
#include "framebuffer/fb_font.h"
+#include "framebuffer/fb_options.h"
+#include "framebuffer/fb_findfile.h"
+
+#define VERA_PATH "/usr/share/fonts/truetype/ttf-bitstream-vera/"
static FT_Library library;
static FTC_Manager ft_cmanager;
@@ -45,13 +48,20 @@
int cidx; /* character map index for unicode */
} fb_faceid_t;
-
-static fb_faceid_t *fb_face_sans_serif; /* global default face */
-static fb_faceid_t *fb_face_sans_serif_bold; /* bold sans face */
-static fb_faceid_t *fb_face_sans_serif_italic; /* bold sans face */
-static fb_faceid_t *fb_face_sans_serif_italic_bold; /* bold sans face */
-static fb_faceid_t *fb_face_monospace; /* monospace face */
-static fb_faceid_t *fb_face_serif; /* serif face */
+/* defines for accesing the faces */
+#define FB_FACE_DEFAULT 0
+
+#define FB_FACE_SANS_SERIF 0
+#define FB_FACE_SANS_SERIF_BOLD 1
+#define FB_FACE_SANS_SERIF_ITALIC 2
+#define FB_FACE_SANS_SERIF_ITALIC_BOLD 3
+#define FB_FACE_MONOSPACE 4
+#define FB_FACE_SERIF 5
+#define FB_FACE_SERIF_BOLD 6
+
+#define FB_FACE_COUNT 7
+
+static fb_faceid_t *fb_faces[FB_FACE_COUNT];
utf8_convert_ret utf8_to_local_encoding(const char *string,
@@ -92,20 +102,27 @@
/* create new framebuffer face and cause it to be loaded to check its ok */
static fb_faceid_t *
-fb_new_face(const char *fontfile)
+fb_new_face(const char *option, const char *resname, const char *fontfile)
{
fb_faceid_t *newf;
FT_Error error;
FT_Face aface;
+ char buf[PATH_MAX];
newf = calloc(1, sizeof(fb_faceid_t));
- newf->fontfile = strdup(fontfile);
+
+ if (option != NULL) {
+ newf->fontfile = strdup(option);
+ } else {
+ fb_find_resource(buf, resname, fontfile);
+ newf->fontfile = strdup(buf);
+ }
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface);
if (error) {
LOG(("Could not find font face %s (code %d)\n", fontfile, error));
free(newf);
- newf = fb_face_sans_serif; /* use default */
+ newf = fb_faces[FB_FACE_DEFAULT]; /* use default */
}
return newf;
@@ -145,28 +162,53 @@
error = FTC_ImageCache_New(ft_cmanager, &ft_image_cache);
- fb_face_sans_serif = NULL;
- fb_face_sans_serif = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf");
- if (fb_face_sans_serif == NULL) {
+ fb_faces[FB_FACE_SANS_SERIF] = NULL;
+ fb_faces[FB_FACE_SANS_SERIF] =
+ fb_new_face(option_fb_face_sans_serif,
+ "sans_serif.ttf",
+ VERA_PATH"Vera.ttf");
+ if (fb_faces[FB_FACE_SANS_SERIF] == NULL) {
LOG(("Could not find default font (code %d)\n", error));
FTC_Manager_Done(ft_cmanager );
FT_Done_FreeType(library);
return false;
}
- fb_face_monospace = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMono.ttf");
-
- fb_face_serif = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSe.ttf");
-
- fb_face_sans_serif_bold = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf");
-
- fb_face_sans_serif_italic = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/VeraIt.ttf");
-
- fb_face_sans_serif_italic_bold = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBI.ttf");
+ fb_faces[FB_FACE_SANS_SERIF_BOLD] =
+ fb_new_face(option_fb_face_sans_serif_bold,
+ "sans_serif_bold.ttf",
+ VERA_PATH"VeraBd.ttf");
+
+ fb_faces[FB_FACE_SANS_SERIF_ITALIC] =
+ fb_new_face(option_fb_face_sans_serif_italic,
+ "sans_serif_italic.ttf",
+ VERA_PATH"VeraIt.ttf");
+
+ fb_faces[FB_FACE_SANS_SERIF_ITALIC_BOLD] =
+ fb_new_face(option_fb_face_sans_serif_italic_bold,
+ "sans_serif_italic_bold.ttf",
+ VERA_PATH"VeraBI.ttf");
+
+ fb_faces[FB_FACE_MONOSPACE] =
+ fb_new_face(option_fb_face_monospace,
+ "monospace.ttf",
+ VERA_PATH"VeraMono.ttf");
+
+ fb_faces[FB_FACE_SERIF] =
+ fb_new_face(option_fb_face_serif,
+ "serif.ttf",
+ VERA_PATH"VeraSe.ttf");
+
+ fb_faces[FB_FACE_SERIF_BOLD] =
+ fb_new_face(option_fb_face_serif_bold,
+ "serif_bold.ttf",
+ VERA_PATH"VeraSeBd.ttf");
/* set the default render mode */
- //ft_load_type = FT_LOAD_MONOCHROME; /* faster but less pretty */
- ft_load_type = 0;
+ if (option_fb_font_monochrome == true)
+ ft_load_type = FT_LOAD_MONOCHROME; /* faster but less pretty */
+ else
+ ft_load_type = 0;
return true;
}
@@ -180,6 +222,8 @@
static void fb_fill_scalar(const struct css_style *style, FTC_Scaler srec)
{
+ int selected_face = FB_FACE_DEFAULT;
+
switch (style->font_family) {
/*
case CSS_FONT_FAMILY_CURSIVE:
@@ -188,11 +232,24 @@
break;
*/
case CSS_FONT_FAMILY_SERIF:
- srec->face_id = (FTC_FaceID)fb_face_serif;
+ switch (style->font_weight) {
+ case CSS_FONT_WEIGHT_700:
+ case CSS_FONT_WEIGHT_800:
+ case CSS_FONT_WEIGHT_900:
+ case CSS_FONT_WEIGHT_BOLD:
+ selected_face = FB_FACE_SERIF_BOLD;
+ break;
+
+ case CSS_FONT_WEIGHT_NORMAL:
+ default:
+ selected_face = FB_FACE_SERIF;
+ break;
+ }
+
break;
case CSS_FONT_FAMILY_MONOSPACE:
- srec->face_id = (FTC_FaceID)fb_face_monospace;
+ selected_face = FB_FACE_MONOSPACE;
break;
case CSS_FONT_FAMILY_SANS_SERIF:
@@ -204,12 +261,12 @@
case CSS_FONT_WEIGHT_800:
case CSS_FONT_WEIGHT_900:
case CSS_FONT_WEIGHT_BOLD:
- srec->face_id = (FTC_FaceID)fb_face_sans_serif_italic_bold;
+ selected_face = FB_FACE_SANS_SERIF_ITALIC_BOLD;
break;
case CSS_FONT_WEIGHT_NORMAL:
default:
- srec->face_id = (FTC_FaceID)fb_face_sans_serif_italic;
+ selected_face = FB_FACE_SANS_SERIF_ITALIC;
break;
}
break;
@@ -220,17 +277,19 @@
case CSS_FONT_WEIGHT_800:
case CSS_FONT_WEIGHT_900:
case CSS_FONT_WEIGHT_BOLD:
- srec->face_id = (FTC_FaceID)fb_face_sans_serif_bold;
+ selected_face = FB_FACE_SANS_SERIF_BOLD;
break;
case CSS_FONT_WEIGHT_NORMAL:
default:
- srec->face_id = (FTC_FaceID)fb_face_sans_serif;
+ selected_face = FB_FACE_SANS_SERIF;
break;
}
break;
}
}
+
+ srec->face_id = (FTC_FaceID)fb_faces[selected_face];
if (style->font_size.value.length.unit == CSS_UNIT_PX) {
srec->width = srec->height = style->font_size.value.length.value;
Modified: trunk/netsurf/framebuffer/fb_options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_options.h?...
==============================================================================
--- trunk/netsurf/framebuffer/fb_options.h (original)
+++ trunk/netsurf/framebuffer/fb_options.h Fri Feb 27 05:35:06 2009
@@ -23,22 +23,46 @@
extern int option_fb_depth;
extern int option_fb_refresh;
+extern bool option_fb_font_monochrome; /* render font monochrome */
extern char *option_fb_device;
extern char *option_fb_input_devpath;
extern char *option_fb_input_glob;
+extern char *option_fb_face_sans_serif; /* default sans face */
+extern char *option_fb_face_sans_serif_bold; /* bold sans face */
+extern char *option_fb_face_sans_serif_italic; /* bold sans face */
+extern char *option_fb_face_sans_serif_italic_bold; /* bold sans face */
+extern char *option_fb_face_monospace; /* monospace face */
+extern char *option_fb_face_serif; /* serif face */
+extern char *option_fb_face_serif_bold; /* bold serif face */
#define EXTRA_OPTION_DEFINE \
int option_fb_depth = 32; \
int option_fb_refresh = 70; \
+ bool option_fb_font_monochrome = false; \
char *option_fb_device = 0; \
char *option_fb_input_devpath = 0; \
- char *option_fb_input_glob = 0;
+ char *option_fb_input_glob = 0; \
+ char *option_fb_face_sans_serif; \
+ char *option_fb_face_sans_serif_bold; \
+ char *option_fb_face_sans_serif_italic; \
+ char *option_fb_face_sans_serif_italic_bold; \
+ char *option_fb_face_monospace; \
+ char *option_fb_face_serif; \
+ char *option_fb_face_serif_bold;
#define EXTRA_OPTION_TABLE \
{ "fb_depth", OPTION_INTEGER, &option_fb_depth }, \
{ "fb_refresh", OPTION_INTEGER, &option_fb_refresh }, \
{ "fb_device", OPTION_STRING, &option_fb_device }, \
{ "fb_input_devpath", OPTION_STRING, &option_fb_input_devpath }, \
- { "fb_input_glob", OPTION_STRING, &option_fb_input_glob },
+ { "fb_input_glob", OPTION_STRING, &option_fb_input_glob }, \
+ { "fb_font_monochrome", OPTION_BOOL, &option_fb_font_monochrome }, \
+ { "fb_face_sans_serif", OPTION_STRING, &option_fb_face_sans_serif }, \
+ { "fb_face_sans_serif_bold", OPTION_STRING, &option_fb_face_sans_serif_bold }, \
+ { "fb_face_sans_serif_italic", OPTION_STRING, &option_fb_face_sans_serif_italic }, \
+ { "fb_face_sans_serif_italic_bold", OPTION_STRING, &option_fb_face_sans_serif_italic_bold }, \
+ { "fb_face_monospace", OPTION_STRING, &option_fb_face_monospace }, \
+ { "fb_face_serif", OPTION_STRING, &option_fb_face_serif }, \
+ { "fb_serif_bold", OPTION_STRING, &option_fb_face_serif_bold }
#endif
14 years, 7 months
r6655 vince - in /trunk/netsurf: Makefile framebuffer/fb_font_freetype.c framebuffer/fb_gui.c
by netsurf@semichrome.net
Author: vince
Date: Fri Feb 27 03:56:02 2009
New Revision: 6655
URL: http://source.netsurf-browser.org?rev=6655&view=rev
Log:
Improve freetype build integration (from hiyuh)
Improve error checking on font initialization
Modified:
trunk/netsurf/Makefile
trunk/netsurf/framebuffer/fb_font_freetype.c
trunk/netsurf/framebuffer/fb_gui.c
Modified: trunk/netsurf/Makefile
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile?rev=6655&r1=6654...
==============================================================================
--- trunk/netsurf/Makefile (original)
+++ trunk/netsurf/Makefile Fri Feb 27 03:56:02 2009
@@ -470,8 +470,8 @@
$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG support))
ifeq ($(NETSURF_FB_FONTLIB),freetype)
- CFLAGS += -DFB_USE_FREETYPE -I/usr/include/freetype2
- LDFLAGS += -lfreetype
+ CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
+ LDFLAGS += $(shell freetype-config --libs)
endif
# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
Modified: trunk/netsurf/framebuffer/fb_font_freetype.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_font_freet...
==============================================================================
--- trunk/netsurf/framebuffer/fb_font_freetype.c (original)
+++ trunk/netsurf/framebuffer/fb_font_freetype.c Fri Feb 27 03:56:02 2009
@@ -99,7 +99,7 @@
FT_Face aface;
newf = calloc(1, sizeof(fb_faceid_t));
- newf->fontfile=strdup(fontfile);
+ newf->fontfile = strdup(fontfile);
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface);
if (error) {
@@ -149,6 +149,7 @@
fb_face_sans_serif = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf");
if (fb_face_sans_serif == NULL) {
LOG(("Could not find default font (code %d)\n", error));
+ FTC_Manager_Done(ft_cmanager );
FT_Done_FreeType(library);
return false;
}
Modified: trunk/netsurf/framebuffer/fb_gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_gui.c?rev=...
==============================================================================
--- trunk/netsurf/framebuffer/fb_gui.c (original)
+++ trunk/netsurf/framebuffer/fb_gui.c Fri Feb 27 03:56:02 2009
@@ -260,12 +260,13 @@
default:
LOG(("Unsupported bit depth (%d)", framebuffer->bpp));
- exit(1);
+ die("Unsupported bit depth");
}
framebuffer->cursor = fb_cursor_init(framebuffer, &pointer_image);
- fb_font_init();
+ if (fb_font_init() == false)
+ die("Unable to initialise the font system");
}
14 years, 7 months
r6653 adrianl - in /trunk/netsurf/framebuffer: fb_32bpp_plotters.c fb_plotters.h
by netsurf@semichrome.net
Author: adrianl
Date: Thu Feb 26 20:29:59 2009
New Revision: 6653
URL: http://source.netsurf-browser.org?rev=6653&view=rev
Log:
Fix silly oversights; still disabled for now
Modified:
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
trunk/netsurf/framebuffer/fb_plotters.h
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Thu Feb 26 20:29:59 2009
@@ -193,25 +193,24 @@
for (w = width; w > 0; w--) *pvid++ = ent;
#else
uint32_t *evid = pvid + width;
- while ((pvid += 16) <= evid) {
- pvid[0] = ent;
- pvid[1] = ent;
- pvid[2] = ent;
- pvid[3] = ent;
- pvid[4] = ent;
- pvid[5] = ent;
- pvid[6] = ent;
- pvid[7] = ent;
- pvid[8] = ent;
- pvid[9] = ent;
- pvid[10] = ent;
- pvid[11] = ent;
- pvid[12] = ent;
- pvid[13] = ent;
- pvid[14] = ent;
- pvid[15] = ent;
- }
- pvid -= 16;
+ while (pvid <= evid - 16) {
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ *pvid++ = ent;
+ }
while (pvid < evid) *pvid++ = ent;
#endif
pvid += llen;
Modified: trunk/netsurf/framebuffer/fb_plotters.h
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.h...
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.h (original)
+++ trunk/netsurf/framebuffer/fb_plotters.h Thu Feb 26 20:29:59 2009
@@ -50,7 +50,7 @@
/* alpha blend two pixels together */
static inline colour fb_plotters_ablend(colour pixel, colour scrpixel)
{
-#if 1
+#if 0
int opacity = (pixel >> 24) & 0xFF;
int r,g,b;
@@ -74,7 +74,7 @@
g = ((pixel & 0x00FF00) * opacity +
(scrpixel & 0x00FF00) * transp) >> 8;
- return rb | g;
+ return (rb & 0xFF0FF) | (g & 0xFF00);
#endif
}
14 years, 7 months
r6652 adrianl - in /trunk/netsurf/framebuffer: fb_32bpp_plotters.c fb_plotters.h
by netsurf@semichrome.net
Author: adrianl
Date: Thu Feb 26 19:14:04 2009
New Revision: 6652
URL: http://source.netsurf-browser.org?rev=6652&view=rev
Log:
Sketch of possible optimisations; disabled pending testing and fixing
Modified:
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
trunk/netsurf/framebuffer/fb_plotters.h
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Thu Feb 26 19:14:04 2009
@@ -41,15 +41,13 @@
#if __BYTE_ORDER == __BIG_ENDIAN
static inline colour fb_32bpp_to_colour(uint32_t pixel)
{
- return ((pixel & 0xFF00) >> 8) |
- ((pixel & 0xFF0000) >> 8) |
- ((pixel & 0xFF000000) >> 8);
+ return (pixel >> 8) & ~0xFF000000U;
}
/* convert a colour value to a 32bpp pixel value ready for screen output */
static inline uint32_t fb_colour_to_pixel(colour c)
{
- return ((c & 0xff0000) << 8) | (c & 0xff00) << 8 | ((c & 0xff) << 8);
+ return (c << 8);
}
#else
static inline colour fb_32bpp_to_colour(uint32_t pixel)
@@ -191,7 +189,31 @@
pvid = fb_32bpp_get_xy_loc(x0, y0);
while (height-- > 0) {
- for (w = width; w > 0; w--) *pvid++ = ent;
+#if 1
+ for (w = width; w > 0; w--) *pvid++ = ent;
+#else
+ uint32_t *evid = pvid + width;
+ while ((pvid += 16) <= evid) {
+ pvid[0] = ent;
+ pvid[1] = ent;
+ pvid[2] = ent;
+ pvid[3] = ent;
+ pvid[4] = ent;
+ pvid[5] = ent;
+ pvid[6] = ent;
+ pvid[7] = ent;
+ pvid[8] = ent;
+ pvid[9] = ent;
+ pvid[10] = ent;
+ pvid[11] = ent;
+ pvid[12] = ent;
+ pvid[13] = ent;
+ pvid[14] = ent;
+ pvid[15] = ent;
+ }
+ pvid -= 16;
+ while (pvid < evid) *pvid++ = ent;
+#endif
pvid += llen;
}
@@ -483,7 +505,7 @@
{
uint32_t *pvideo;
colour *pixel = (colour *)bitmap->pixdata;
- colour abpixel; /* alphablended pixel */
+ colour abpixel = 0; /* alphablended pixel */
int xloop, yloop;
int x0,y0,x1,y1;
int xoff, yoff; /* x and y offset into image */
@@ -525,6 +547,7 @@
pvideo = fb_32bpp_get_xy_loc(x0, y0);
for (yloop = yoff; yloop < height; yloop += bitmap->width) {
+#if 1
for (xloop = 0; xloop < width; xloop++) {
abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
@@ -536,6 +559,25 @@
*(pvideo + xloop) = fb_colour_to_pixel(abpixel);
}
}
+#else
+ uint32_t *pvid = pvideo;
+ colour *pix = &pixel[yloop + xoff];
+ colour *epix = pix + width;
+ do {
+ colour *spix = pix;
+ while (pix < epix && !((abpixel = *pix) & 0xFF000000U)) pix++;
+ if (pix < epix) {
+ pvid += pix++ - spix;
+ do {
+ if ((abpixel & 0xFF000000) != 0xFF000000) {
+ abpixel = fb_plotters_ablend(abpixel,
+ fb_32bpp_to_colour(*pvid));
+ }
+ *pvid++ = fb_colour_to_pixel(abpixel);
+ } while (pix < epix && ((abpixel = *pix++) & 0xFF000000U));
+ }
+ } while (pix < epix);
+#endif
pvideo += (framebuffer->linelen >> 2);
}
Modified: trunk/netsurf/framebuffer/fb_plotters.h
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.h...
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.h (original)
+++ trunk/netsurf/framebuffer/fb_plotters.h Thu Feb 26 19:14:04 2009
@@ -50,6 +50,7 @@
/* alpha blend two pixels together */
static inline colour fb_plotters_ablend(colour pixel, colour scrpixel)
{
+#if 1
int opacity = (pixel >> 24) & 0xFF;
int r,g,b;
@@ -63,6 +64,18 @@
((((scrpixel & 0xFF0000) >> 16) * (0xFF - opacity)) >> 8);
return r | (g << 8) | (b << 16);
+#else
+ int opacity = pixel >> 24;
+ int transp = 0x100 - opacity;
+ uint32_t rb, g;
+
+ rb = ((pixel & 0xFF00FF) * opacity +
+ (scrpixel & 0xFF00FF) * transp) >> 8;
+ g = ((pixel & 0x00FF00) * opacity +
+ (scrpixel & 0x00FF00) * transp) >> 8;
+
+ return rb | g;
+#endif
}
14 years, 7 months
r6651 jmb - /trunk/netsurfweb/developers/gsoc/2009ideas.en
by netsurf@semichrome.net
Author: jmb
Date: Thu Feb 26 18:50:28 2009
New Revision: 6651
URL: http://source.netsurf-browser.org?rev=6651&view=rev
Log:
Minor changes
Modified:
trunk/netsurfweb/developers/gsoc/2009ideas.en
Modified: trunk/netsurfweb/developers/gsoc/2009ideas.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/gsoc/2009id...
==============================================================================
--- trunk/netsurfweb/developers/gsoc/2009ideas.en (original)
+++ trunk/netsurfweb/developers/gsoc/2009ideas.en Thu Feb 26 18:50:28 2009
@@ -83,12 +83,12 @@
<p>Please <a href="/contact/">get in touch</a> if any of these ideas appeal to you or if you have your own idea for either <a href="/">NetSurf</a> or one of NetSurf's <a href="/projects/">sub-projects</a>. Come and chat to the developers in the NetSurf IRC channel or post to the developer mailing list.</p>
-<p>All these ideas require knowledge of C, as NetSurf is entirely written in C.</p>
+<p><strong>All these ideas require knowledge of C</strong>, as NetSurf is entirely written in C.</p>
<p>See the <a href="http://sourceforge.net/tracker/?func=browse&group_id=51719&atid=4...">Feature Requests</a> tracker for more ideas.</p>
<h2>Native Windows or Mac OS X port</h2>
-<p>NetSurf currently has user-interface layers for several systems including the RISC OS, GTK (on Linux, FreeBSD, etc.), AmigaOS and BeOS. The GTK interface works on Windows or Mac OS X, but a native interface for these systems would give a better experience.</p>
+<p>NetSurf currently has user-interface layers for several systems including RISC OS, GTK (on Linux, FreeBSD, etc.), AmigaOS and BeOS. The GTK interface works on Windows or Mac OS X, but a native interface for these systems would give a better experience.</p>
<p>The existing front end implementations can be used as examples. Of these, the framebuffer front end is very self contained and the debug front end is the most minimal. For the rendering of NetSurf's content area, a set of plotters needs to be implemented for drawing primitives such as rectangles, plotting bitmaps and text.</p>
<p><strong>Skills required:</strong> C, Windows UI development or Mac OS X UI development</p>
<p><strong>Difficulty:</strong> Medium</p>
@@ -123,7 +123,7 @@
<li>Stacking order</li>
<li>Fixed position boxes</li>
<li>Fixed backgrounds</li>
-<li>Table stuff (various issues with row style)</li>
+<li>Table stuff (various issues with row style) <strong>??? What is this? ???</strong></li>
<li>Vertical alignment</li>
<li>Handling of whitespace</li>
</ul>
@@ -135,8 +135,8 @@
<h2>LibDOM</h2>
<p>LibDOM is an implementation of the W3C DOM. It currently implements a large proportion of DOM Level 3 Core. It is a work in progress and requires a fairly large number of fixes and additions before it can be integrated into NetSurf. Things that need doing include:</p>
<ul>
-<li>Fixing so it compiles</li>
-<li>Sort out the mess that is dom_string</li>
+<li>Make it compile again</li>
+<li>Rationalise the dom_string structure into a pointer + length pair</li>
<li>Use vtables rather than known function names + switching on node type</li>
<li>Test suite</li>
<li>Write a binding to Hubbub</li>
@@ -144,12 +144,12 @@
<ul>
<li>Events</li>
<li>HTML</li>
-<li>The rest</li>
+<li>Everything else</li>
</ul>
</li>
<li>Integration with NetSurf</li>
</ul>
-<p><strong>Skills required:</strong> DOM</p>
+<p><strong>Skills required:</strong> C, DOM</p>
<p><strong>Difficulty:</strong> Medium – Hard</p>
<p><strong>Existing code:</strong> <a href="http://source.netsurf-browser.org/trunk/libdom/">LibDOM sources</a></p>
<p><strong>References:</strong> <a href="http://www.w3.org/DOM/DOMTR">DOM specifications</a></p>
14 years, 7 months
r6650 tlsa - in /trunk/netsurf/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c
by netsurf@semichrome.net
Author: tlsa
Date: Thu Feb 26 18:12:22 2009
New Revision: 6650
URL: http://source.netsurf-browser.org?rev=6650&view=rev
Log:
Fixed version of r6647.
Modified:
trunk/netsurf/framebuffer/fb_16bpp_plotters.c
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Thu Feb 26 18:12:22 2009
@@ -462,14 +462,15 @@
width = (x1 - x0);
xoff = x0 - x;
- yoff = y0 - y;
+ yoff = (y0 - y) * bitmap->width;
+ height = height * bitmap->width + yoff;
/* plot the image */
pvideo = fb_16bpp_get_xy_loc(x0, y0);
- for (yloop = 0; yloop < height; yloop++) {
+ for (yloop = yoff; yloop < height; yloop += bitmap->width) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
+ abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
abpixel = fb_plotters_ablend(abpixel,
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Thu Feb 26 18:12:22 2009
@@ -518,14 +518,15 @@
width = (x1 - x0);
xoff = x0 - x;
- yoff = y0 - y;
+ yoff = (y0 - y) * bitmap->width;
+ height = height * bitmap->width + yoff;
/* plot the image */
pvideo = fb_32bpp_get_xy_loc(x0, y0);
- for (yloop = 0; yloop < height; yloop++) {
+ for (yloop = yoff; yloop < height; yloop += bitmap->width) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
+ abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
abpixel = fb_plotters_ablend(abpixel,
14 years, 7 months