diff options
-rw-r--r-- | desktop/browser.c | 35 | ||||
-rw-r--r-- | desktop/plotters.h | 3 | ||||
-rw-r--r-- | makefile | 2 | ||||
-rw-r--r-- | posix.mk | 13 |
4 files changed, 28 insertions, 25 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index d5fc888cc..08b277938 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1140,10 +1140,11 @@ void browser_window_textarea_click(struct browser_window *bw, /* below the bottom of the textarea: place caret at end */ text_box = inline_container->last; assert(text_box->type == BOX_INLINE); - assert(text_box->text && text_box->font); - nsfont_position_in_string(text_box->font, text_box->text, + assert(text_box->text); + /** \todo handle errors */ + nsfont_position_in_string(text_box->style, text_box->text, text_box->length, - (unsigned int)textarea->width, + textarea->width, &char_offset, &pixel_offset); } else { /* find the relevant text box */ @@ -1161,11 +1162,11 @@ void browser_window_textarea_click(struct browser_window *bw, /* past last text box */ text_box = inline_container->last; assert(text_box->type == BOX_INLINE); - assert(text_box->text && text_box->font); - nsfont_position_in_string(text_box->font, + assert(text_box->text); + nsfont_position_in_string(text_box->style, text_box->text, text_box->length, - (unsigned int)textarea->width, + textarea->width, &char_offset, &pixel_offset); } else { /* in a text box */ @@ -1174,8 +1175,8 @@ void browser_window_textarea_click(struct browser_window *bw, else if (y < text_box->y && text_box->prev) text_box = text_box->prev; assert(text_box->type == BOX_INLINE); - assert(text_box->text && text_box->font); - nsfont_position_in_string(text_box->font, + assert(text_box->text); + nsfont_position_in_string(text_box->style, text_box->text, text_box->length, (unsigned int)(x - text_box->x), @@ -1463,8 +1464,8 @@ void browser_window_textarea_callback(struct browser_window *bw, new_scroll_y = 0; box_y += textarea->scroll_y - new_scroll_y; - pixel_offset = nsfont_width(text_box->font, text_box->text, - char_offset); + nsfont_width(text_box->style, text_box->text, + char_offset, &pixel_offset); textarea->gadget->caret_inline_container = inline_container; textarea->gadget->caret_text_box = text_box; @@ -1506,7 +1507,7 @@ void browser_window_input_click(struct browser_window* bw, int uchars; unsigned int offset; - nsfont_position_in_string(text_box->font, text_box->text, + nsfont_position_in_string(text_box->style, text_box->text, text_box->length, x - text_box->x, &char_offset, &pixel_offset); assert(char_offset <= text_box->length); @@ -1636,8 +1637,8 @@ void browser_window_input_callback(struct browser_window *bw, box_offset += utf8keySize; free(utf8key); - text_box->width = nsfont_width(text_box->font, - text_box->text, text_box->length); + nsfont_width(text_box->style, text_box->text, text_box->length, + &text_box->width); changed = true; } else if (key == 8 || key == 127) { @@ -1671,8 +1672,8 @@ void browser_window_input_callback(struct browser_window *bw, text_box->length -= prev_offset - box_offset; text_box->text[text_box->length] = 0; - text_box->width = nsfont_width(text_box->font, - text_box->text, text_box->length); + nsfont_width(text_box->style, text_box->text, text_box->length, + &text_box->width); changed = true; @@ -1770,8 +1771,8 @@ void browser_window_input_callback(struct browser_window *bw, return; } - pixel_offset = nsfont_width(text_box->font, text_box->text, - box_offset); + nsfont_width(text_box->style, text_box->text, box_offset, + &pixel_offset); dx = text_box->x; text_box->x = 0; if (input->width < text_box->width && input->width / 2 < pixel_offset) { diff --git a/desktop/plotters.h b/desktop/plotters.h index 5cf94f39b..1f0e0f375 100644 --- a/desktop/plotters.h +++ b/desktop/plotters.h @@ -17,7 +17,6 @@ struct bitmap; -struct font_data; /** Set of target specific plotting functions. */ @@ -30,7 +29,7 @@ struct plotter_table { bool (*polygon)(int *p, unsigned int n, colour fill); bool (*fill)(int x0, int y0, int x1, int y1, colour c); bool (*clip)(int x0, int y0, int x1, int y1); - bool (*text)(int x, int y, struct font_data *font, const char *text, + bool (*text)(int x, int y, struct css_style *style, const char *text, size_t length, colour bg, colour c); bool (*disc)(int x, int y, int radius, colour c); bool (*bitmap)(int x, int y, int width, int height, @@ -34,7 +34,7 @@ OBJECTS_RISCOS += 401login.o bitmap.o buffer.o debugwin.o \ menus.o mouseactions.o plotters.o plugin.o print.o \ save.o save_complete.o save_draw.o save_text.o \ schedule.o search.o sprite.o textselection.o theme.o \ - theme_install.o thumbnail.o treeview.o ufont.o uri.o \ + theme_install.o thumbnail.o treeview.o uri.o \ url_complete.o url_protocol.o wimp.o window.o # riscos/ # OBJECTS_RISCOS += memdebug.o @@ -1,13 +1,16 @@ -CC = /riscos/bin/gcc +CC = /home/riscos/cross/bin/gcc CC_DEBUG = gcc -PLATFORM_CFLAGS_RISCOS = +PLATFORM_CFLAGS_RISCOS = -I/home/riscos/env/include \ + -I/home/riscos/env/include/libxml2 \ + -I/home/riscos/env/include/libmng PLATFORM_CFLAGS_DEBUG = -I/usr/include/libxml2 -I/riscos/src/OSLib \ -I/riscos/include/libjpeg -D_POSIX_C_SOURCE -LDFLAGS_RISCOS = -L/riscos/lib -lxml2 -lz -lcurl -lssl -lcrypto -lcares -lmng \ - -loslib -ljpeg -LDFLAGS_SMALL = -L/riscos/lib -lxml2 -lz -lucurl -lcares -lmng -loslib -ljpeg +LDFLAGS_RISCOS = -L/home/riscos/env/lib -lxml2 -lz -lcurl -lssl -lcrypto \ + -lcares -lmng -loslib -ljpeg -lrufl +LDFLAGS_SMALL = -L/riscos/lib -lxml2 -lz -lucurl -lcares -lmng -loslib -ljpeg \ + -lrufl LDFLAGS_DEBUG = -L/usr/lib -lxml2 -lz -lm -lcurl -lssl -lcrypto -ldl -lmng \ -ljpeg -llcms |