r2921 jmb - in /trunk/netsurf/gtk: gtk_plotters.c gtk_plotters.h gtk_window.c
by netsurf@semichrome.net
Author: jmb
Date: Wed Sep 6 12:29:14 2006
New Revision: 2921
URL: http://svn.semichrome.net?rev=2921&view=rev
Log:
Make GTK build compile again (don't expect frames to work, however)
Squash warnings in GTK plotters.
Modified:
trunk/netsurf/gtk/gtk_plotters.c
trunk/netsurf/gtk/gtk_plotters.h
trunk/netsurf/gtk/gtk_window.c
Modified: trunk/netsurf/gtk/gtk_plotters.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_plotters.c?rev=2921&r1=29...
==============================================================================
--- trunk/netsurf/gtk/gtk_plotters.c (original)
+++ trunk/netsurf/gtk/gtk_plotters.c Wed Sep 6 12:29:14 2006
@@ -69,6 +69,7 @@
nsgtk_plot_bitmap,
nsgtk_plot_bitmap_tile,
NULL,
+ NULL,
NULL
};
@@ -82,7 +83,7 @@
int line_width, colour c, bool dotted, bool dashed)
{
nsgtk_set_colour(c);
- if (dotted)
+ if (dotted)
nsgtk_set_dotted();
else if (dashed)
nsgtk_set_dashed();
@@ -187,7 +188,7 @@
#ifdef CAIRO_VERSION
if (option_render_cairo) {
cairo_reset_clip(current_cr);
- cairo_rectangle(current_cr, clip_x0 - 1, clip_y0 - 1,
+ cairo_rectangle(current_cr, clip_x0 - 1, clip_y0 - 1,
clip_x1 - clip_x0 + 1, clip_y1 - clip_y0 + 1);
cairo_clip(current_cr);
}
@@ -220,19 +221,19 @@
cairo_set_line_width(current_cr, 1);
cairo_arc(current_cr, x, y, radius, 0, M_PI * 2);
-
+
if (filled)
cairo_fill(current_cr);
-
+
cairo_stroke(current_cr);
} else
#endif
gdk_draw_arc(current_drawable, current_gc,
- filled ? TRUE : FALSE, x - (radius), y - radius,
+ filled ? TRUE : FALSE, x - (radius), y - radius,
radius * 2, radius * 2,
0,
360 * 64);
-
+
return true;
}
@@ -243,8 +244,8 @@
#ifdef CAIRO_VERSION
if (option_render_cairo) {
cairo_set_line_width(current_cr, 1);
- cairo_arc(current_cr, x, y, radius,
- (angle1 + 90) * (M_PI / 180),
+ cairo_arc(current_cr, x, y, radius,
+ (angle1 + 90) * (M_PI / 180),
(angle2 + 90) * (M_PI / 180));
cairo_stroke(current_cr);
} else
@@ -253,7 +254,7 @@
FALSE, x - (radius), y - radius,
radius * 2, radius * 2,
angle1 * 64, angle2 * 64);
-
+
return true;
}
@@ -266,7 +267,7 @@
if (width == 0 || height == 0)
return true;
-
+
if (gdk_pixbuf_get_width(pixbuf) == width &&
gdk_pixbuf_get_height(pixbuf) == height) {
gdk_draw_pixbuf(current_drawable, current_gc,
@@ -302,7 +303,7 @@
struct bitmap *bitmap, colour bg)
{
GdkPixbuf *pixbuf = gtk_bitmap_get_primary(bitmap);
- nsgtk_plot_pixbuf(x, y, width, height, pixbuf, bg);
+ return nsgtk_plot_pixbuf(x, y, width, height, pixbuf, bg);
}
bool nsgtk_plot_bitmap_tile(int x, int y, int width, int height,
@@ -312,12 +313,12 @@
int doneheight = 0, donewidth = 0;
GdkPixbuf *primary;
GdkPixbuf *pretiled;
-
+
if (!(repeat_x || repeat_y)) {
/* Not repeating at all, so just pass it on */
return nsgtk_plot_bitmap(x,y,width,height,bitmap,bg);
}
-
+
if (repeat_x && !repeat_y)
pretiled = gtk_bitmap_get_pretile_x(bitmap);
if (repeat_x && repeat_y)
@@ -330,12 +331,12 @@
width /= gdk_pixbuf_get_width(primary);
height *= gdk_pixbuf_get_height(pretiled);
height /= gdk_pixbuf_get_height(primary);
-
- if (y > cliprect.y)
+
+ if (y > cliprect.y)
doneheight = (cliprect.y - height) + ((y - cliprect.y) % height);
else
doneheight = y;
-
+
while (doneheight < (cliprect.y + cliprect.height)) {
if (x > cliprect.x)
donewidth = (cliprect.x - width) + ((x - cliprect.x) % width);
@@ -351,7 +352,7 @@
if (!repeat_y) break;
}
-
+
return true;
}
Modified: trunk/netsurf/gtk/gtk_plotters.h
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_plotters.h?rev=2921&r1=29...
==============================================================================
--- trunk/netsurf/gtk/gtk_plotters.h (original)
+++ trunk/netsurf/gtk/gtk_plotters.h Wed Sep 6 12:29:14 2006
@@ -11,5 +11,5 @@
struct plotter_table;
-const struct plotter_table nsgtk_plotters;
+extern const struct plotter_table nsgtk_plotters;
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_window.c?rev=2921&r1=2920...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Wed Sep 6 12:29:14 2006
@@ -67,7 +67,7 @@
struct gtk_history_window *history_window;
int last_x, last_y;
-
+
struct gui_window *next, *prev;
};
@@ -168,10 +168,10 @@
MENUEVENT(new_window),
MENUEVENT(close_window),
MENUEVENT(quit),
-
+
/* edit menu */
MENUEVENT(choices),
-
+
/* view menu */
MENUEVENT(stop),
MENUEVENT(reload),
@@ -179,17 +179,17 @@
MENUEVENT(normal_size),
MENUEVENT(zoom_out),
MENUEVENT(save_window_size),
-
+
/* navigate menu */
MENUEVENT(back),
MENUEVENT(forward),
MENUEVENT(home),
MENUEVENT(local_history),
MENUEVENT(global_history),
-
+
/* help menu */
MENUEVENT(about),
-
+
/* sentinel */
{ NULL, NULL }
};
@@ -197,7 +197,7 @@
void nsgtk_reflow_all_windows(void)
{
struct gui_window *g = window_list;
-
+
while (g != NULL) {
nsgtk_perform_deferred_resize(g);
g = g->next;
@@ -207,7 +207,7 @@
void nsgtk_attach_menu_handlers(GladeXML *xml, gpointer g)
{
struct menu_events *event = menu_events;
-
+
while (event->widget != NULL)
{
GtkWidget *w = glade_xml_get_widget(xml, event->widget);
@@ -259,7 +259,7 @@
void nsgtk_window_destroy_event(GtkWidget *widget, gpointer data)
{
struct gui_window *g = data;
-
+
gui_window_destroy(g);
}
@@ -267,7 +267,7 @@
void nsgtk_plot_caret(int x, int y, int h)
{
GdkColor colour;
-
+
colour.red = 0;
colour.green = 0;
colour.blue = 0;
@@ -275,7 +275,7 @@
gdk_color_alloc(gdk_colormap_get_system(),
&colour);
gdk_gc_set_foreground(current_gc, &colour);
-
+
gdk_draw_line(current_drawable, current_gc,
x, y,
x, y + h - 1);
@@ -338,7 +338,7 @@
{
struct gui_window *g = data;
int button = BROWSER_MOUSE_CLICK_1;
-
+
if (event->button == 2) /* 2 == middle button on X */
button = BROWSER_MOUSE_CLICK_2;
@@ -400,17 +400,17 @@
void nsgtk_window_update_back_forward(struct gui_window *g)
{
int width, height;
-
+
gtk_widget_set_sensitive(GTK_WIDGET(g->back_button),
history_back_available(g->bw->history));
gtk_widget_set_sensitive(GTK_WIDGET(g->forward_button),
history_forward_available(g->bw->history));
-
+
gtk_widget_set_sensitive(GTK_WIDGET(g->back_menu),
history_back_available(g->bw->history));
gtk_widget_set_sensitive(GTK_WIDGET(g->forward_menu),
history_forward_available(g->bw->history));
-
+
/* update the local history window, as well as queuing a redraw
* for it.
*/
@@ -428,7 +428,7 @@
g->throb_frame = 1;
else
g->throb_frame++;
-
+
gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[
g->throb_frame]);
@@ -449,43 +449,43 @@
{
struct gui_window *g = data;
- if (!history_back_available(g->bw->history))
+ if (!history_back_available(g->bw->history))
return TRUE;
-
+
history_back(g->bw, g->bw->history);
nsgtk_window_update_back_forward(g);
-
+
return TRUE;
}
gboolean nsgtk_window_forward_button_clicked(GtkWidget *widget, gpointer data)
{
struct gui_window *g = data;
-
+
if (!history_forward_available(g->bw->history))
return TRUE;
history_forward(g->bw, g->bw->history);
nsgtk_window_update_back_forward(g);
-
+
return TRUE;
}
gboolean nsgtk_window_stop_button_clicked(GtkWidget *widget, gpointer data)
{
struct gui_window *g = data;
-
+
browser_window_stop(g->bw);
-
+
return TRUE;
}
gboolean nsgtk_window_reload_button_clicked(GtkWidget *widget, gpointer data)
{
struct gui_window *g = data;
-
+
browser_window_reload(g->bw, true);
-
+
return TRUE;
}
@@ -498,7 +498,7 @@
addr = option_homepage_url;
browser_window_go(g->bw, addr, 0, true);
-
+
return TRUE;
}
@@ -521,7 +521,7 @@
gpointer data)
{
const char *prefix;
-
+
prefix = gtk_entry_get_text(GTK_ENTRY(widget));
nsgtk_completion_update(prefix);
@@ -543,7 +543,7 @@
struct gui_window *gw = (struct gui_window *)g;
gtk_widget_destroy(GTK_WIDGET(gw->window));
-
+
return TRUE;
}
@@ -556,17 +556,16 @@
MENUHANDLER(choices)
{
gtk_widget_show(GTK_WIDGET(wndChoices));
-
+
return TRUE;
}
void nsgtk_window_change_scale(struct gui_window *g, float scale)
{
g->scale = scale;
-
+
if (g->bw->current_content != NULL)
- gui_window_set_extent(g, g->bw->current_content->width,
- g->bw->current_content->height);
+ gui_window_update_extent(g);
gtk_widget_queue_draw(GTK_WIDGET(g->drawing_area));
}
@@ -576,40 +575,40 @@
struct gui_window *gw = g;
nsgtk_window_change_scale(gw, gw->scale + 0.05);
-
+
return TRUE;
}
MENUHANDLER(normal_size)
{
struct gui_window *gw = g;
-
+
nsgtk_window_change_scale(gw, 1.00);
-
+
return TRUE;
}
MENUHANDLER(zoom_out)
{
struct gui_window *gw = g;
-
+
nsgtk_window_change_scale(gw, gw->scale - 0.05);
-
+
return TRUE;
}
MENUHANDLER(save_window_size)
{
struct gui_window *gw = g;
-
+
option_toolbar_status_width = gtk_paned_get_position(gw->status_pane);
gtk_window_get_position(gw->window, &option_window_x, &option_window_y);
gtk_window_get_size(gw->window, &option_window_width,
&option_window_height);
-
-
+
+
options_write(options_file_location);
-
+
return TRUE;
}
@@ -641,10 +640,10 @@
MENUHANDLER(local_history)
{
struct gui_window *gw = (struct gui_window *)g;
-
+
gtk_widget_show(GTK_WIDGET(gw->history_window->window));
gdk_window_raise(GDK_WINDOW(gw->history_window->window));
-
+
return TRUE;
}
@@ -652,7 +651,7 @@
{
gtk_widget_show(GTK_WIDGET(wndHistory));
gdk_window_raise(GDK_WINDOW(wndHistory));
-
+
return TRUE;
}
@@ -666,7 +665,7 @@
GdkEventExpose *event, gpointer g)
{
struct gtk_history_window *hw = g;
-
+
current_widget = widget;
current_drawable = widget->window;
current_gc = gdk_gc_new(current_drawable);
@@ -708,7 +707,7 @@
struct browser_window *clone)
{
struct gui_window *g; /**< what we're creating to return */
-
+
g = malloc(sizeof(*g));
g->bw = bw;
@@ -717,17 +716,17 @@
g->scale = clone->window->scale;
else
g->scale = 1.0;
-
+
g->careth = 0;
- /* add the window to the list of open windows. */
+ /* add the window to the list of open windows. */
g->prev = 0;
g->next = window_list;
-
+
if (window_list)
window_list->prev = g;
window_list = g;
-
+
open_windows++;
/* load the window template from the glade xml file, and extract
@@ -750,7 +749,7 @@
g->throbber = GTK_IMAGE(GET_WIDGET("throbber"));
g->viewport = GTK_VIEWPORT(GET_WIDGET("viewport1"));
g->status_pane = GTK_PANED(GET_WIDGET("hpaned1"));
-
+
/* set this window's size and position to what's in the options, or
* or some sensible default if they're not set yet.
*/
@@ -761,10 +760,10 @@
} else {
gtk_window_set_default_size(g->window, 600, 600);
}
-
+
/* set the size of the hpane with status bar and h scrollbar */
gtk_paned_set_position(g->status_pane, option_toolbar_status_width);
-
+
/* connect our scrollbars to the viewport */
gtk_viewport_set_hadjustment(g->viewport,
gtk_range_get_adjustment(GTK_RANGE(GET_WIDGET("hscrollbar1"))));
@@ -792,7 +791,7 @@
/* set the default background colour of the drawing area to white. */
gtk_widget_modify_bg(GTK_WIDGET(g->drawing_area), GTK_STATE_NORMAL,
&((GdkColor) { 0, 0xffff, 0xffff, 0xffff } ));
-
+
/* disable toolbar buttons that make no sense initially. */
gtk_widget_set_sensitive(GTK_WIDGET(g->back_button), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(g->forward_button), FALSE);
@@ -816,7 +815,7 @@
gtk_widget_show(GTK_WIDGET(g->history_window->scrolled));
g->history_window->drawing_area = GTK_DRAWING_AREA(
gtk_drawing_area_new());
-
+
gtk_widget_set_events(GTK_WIDGET(g->history_window->drawing_area),
GDK_EXPOSURE_MASK |
GDK_POINTER_MOTION_MASK |
@@ -827,7 +826,7 @@
gtk_scrolled_window_add_with_viewport(g->history_window->scrolled,
GTK_WIDGET(g->history_window->drawing_area));
gtk_widget_show(GTK_WIDGET(g->history_window->drawing_area));
-
+
/* set up URL bar completion */
g->url_bar_completion = gtk_entry_completion_new();
gtk_entry_set_completion(g->url_bar, g->url_bar_completion);
@@ -842,13 +841,13 @@
"popup-set-width", TRUE,
"popup-single-match", TRUE,
NULL);
-
+
/* set up the throbber. */
gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[0]);
g->throb_frame = 0;
#define CONNECT(obj, sig, callback, ptr) \
- g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
+ g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
/* connect history window signals to their handlers */
CONNECT(g->history_window->drawing_area, "expose_event",
@@ -871,7 +870,7 @@
nsgtk_window_keypress_event, g);
CONNECT(GET_WIDGET("viewport1"), "size_allocate",
nsgtk_window_size_allocate_event, g);
-
+
/* toolbar and URL bar signal handlers */
CONNECT(g->back_button, "clicked", nsgtk_window_back_button_clicked, g);
CONNECT(g->forward_button, "clicked",
@@ -905,7 +904,7 @@
gtk_widget_destroy(GTK_WIDGET(g->history_window->window));
gtk_widget_destroy(GTK_WIDGET(g->window));
-
+
free(g);
if (--open_windows == 0)
@@ -916,11 +915,11 @@
{
static char suffix[] = " - NetSurf";
char nt[strlen(title) + strlen(suffix) + 1];
-
+
if (title == NULL || title[0] == '\0')
{
gtk_window_set_title(g->window, "NetSurf");
-
+
}
else
{
@@ -976,10 +975,14 @@
return GTK_WIDGET(g->drawing_area)->allocation.height;
}
-void gui_window_set_extent(struct gui_window *g, int width, int height)
-{
+void gui_window_update_extent(struct gui_window *g)
+{
+ if (!g->bw->current_content)
+ return;
+
gtk_widget_set_size_request(GTK_WIDGET(g->drawing_area),
- width * g->scale, height * g->scale);
+ g->bw->current_content->width * g->scale,
+ g->bw->current_content->height * g->scale);
gtk_widget_set_size_request(GTK_WIDGET(g->viewport), 0, 0);
}
@@ -993,12 +996,12 @@
GdkCursor *cursor = NULL;
GdkCursorType cursortype;
bool nullcursor = false;
-
+
if (g->current_pointer == shape)
return;
-
+
g->current_pointer = shape;
-
+
switch (shape) {
case GUI_POINTER_POINT:
cursortype = GDK_HAND1;
@@ -1062,10 +1065,10 @@
if (!nullcursor)
cursor = gdk_cursor_new_for_display(
gtk_widget_get_display(
- GTK_WIDGET(g->drawing_area)),
+ GTK_WIDGET(g->drawing_area)),
cursortype);
gdk_window_set_cursor(GTK_WIDGET(g->drawing_area)->window, cursor);
-
+
if (!nullcursor)
gdk_cursor_unref(cursor);
}
@@ -1087,9 +1090,9 @@
gtk_widget_set_sensitive(GTK_WIDGET(g->reload_button), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(g->stop_menu), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(g->reload_button), FALSE);
-
+
nsgtk_window_update_back_forward(g);
-
+
schedule(10, nsgtk_throb, g);
}
@@ -1099,11 +1102,11 @@
gtk_widget_set_sensitive(GTK_WIDGET(g->reload_button), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(g->stop_menu), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(g->reload_menu), TRUE);
-
+
nsgtk_window_update_back_forward(g);
-
+
schedule_remove(nsgtk_throb, g);
-
+
gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[0]);
// Issue a final reflow so that the content object reports its size correctly
schedule(5, nsgtk_perform_deferred_resize, g);
@@ -1125,7 +1128,7 @@
void gui_window_remove_caret(struct gui_window *g)
{
int oh = g->careth;
-
+
if (oh == 0)
return;
@@ -1194,3 +1197,17 @@
}
+void gui_window_get_dimensions(struct gui_window *g, int *width, int *height)
+{
+ *width = 1;
+ *height = 1;
+}
+
+void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1)
+{
+}
+
+bool gui_window_frame_resize_start(struct gui_window *g)
+{
+ return true;
+}
17 years, 3 months
r2920 jmb - in /trunk/netsurf: desktop/browser.c render/imagemap.c render/imagemap.h
by netsurf@semichrome.net
Author: jmb
Date: Wed Sep 6 01:15:10 2006
New Revision: 2920
URL: http://svn.semichrome.net?rev=2920&view=rev
Log:
Add frame target support to imagemaps.
Modified:
trunk/netsurf/desktop/browser.c
trunk/netsurf/render/imagemap.c
trunk/netsurf/render/imagemap.h
Modified: trunk/netsurf/desktop/browser.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/browser.c?rev=2920&r1=291...
==============================================================================
--- trunk/netsurf/desktop/browser.c (original)
+++ trunk/netsurf/desktop/browser.c Wed Sep 6 01:15:10 2006
@@ -78,7 +78,7 @@
static void browser_window_destroy_children(struct browser_window *bw);
static void browser_window_destroy_internal(struct browser_window *bw);
static struct browser_window *browser_window_find_target(struct browser_window *bw, const char *target);
-static void browser_window_find_target_internal(struct browser_window *bw, const char *target,
+static void browser_window_find_target_internal(struct browser_window *bw, const char *target,
int depth, struct browser_window *page, int *rdepth, struct browser_window **bw_target);
static void browser_window_mouse_action_html(struct browser_window *bw,
browser_mouse_state mouse, int x, int y);
@@ -145,7 +145,7 @@
bw->scrolling = SCROLLING_YES;
bw->border = true;
bw->no_resize = true;
-
+
/* gui window */
if ((bw->window = gui_create_browser_window(bw, clone)) == NULL) {
browser_window_destroy(bw);
@@ -168,10 +168,10 @@
/* an iframe's parent is just the parent window */
if (bw->browser_window_type == BROWSER_WINDOW_IFRAME)
return bw->parent;
-
+
/* the parent of a frameset is either a NORMAL window or an IFRAME */
while (bw->parent) {
- switch (bw->browser_window_type) {
+ switch (bw->browser_window_type) {
case BROWSER_WINDOW_NORMAL:
case BROWSER_WINDOW_IFRAME:
return bw;
@@ -198,7 +198,7 @@
struct content_html_iframe *cur;
int iframes = 0;
int index;
-
+
for (cur = iframe; cur; cur = cur->next)
iframes++;
bw->iframes = calloc(iframes, sizeof(*bw));
@@ -214,7 +214,7 @@
window->history = history_create();
window->sel = selection_create(window);
window->refresh_interval = -1;
-
+
/* window characteristics */
window->drag_type = DRAGGING_NONE;
window->browser_window_type = BROWSER_WINDOW_IFRAME;
@@ -226,11 +226,11 @@
window->margin_height = cur->margin_height;
if (cur->name)
window->name = strdup(cur->name);
-
+
/* linking */
window->box = cur->box;
window->parent = bw;
-
+
/* gui window */
window->window = gui_create_browser_window(window, bw);
}
@@ -253,7 +253,7 @@
*
* \param bw The browser window to reposition iframes for
*/
-
+
void browser_window_recalculate_iframes(struct browser_window *bw) {
struct browser_window *window;
struct rect rect;
@@ -261,7 +261,7 @@
int index;
assert(bw);
-
+
/* update window dimensions */
gui_window_get_dimensions(bw->window, &bw_width, &bw_height);
if (!bw->parent) {
@@ -270,13 +270,13 @@
bw->x1 = bw_width;
bw->y1 = bw_height;
}
-
+
for (index = 0; index < bw->iframe_count; index++) {
window = &(bw->iframes[index]);
box_bounds(window->box, &rect);
gui_window_position_frame(window->window, rect.x0, rect.y0,
- rect.x1, rect.y1);
- }
+ rect.x1, rect.y1);
+ }
}
@@ -300,7 +300,7 @@
/* create children */
assert(bw->children == NULL);
assert(frameset->cols + frameset->rows != 0);
-
+
bw->children = calloc((frameset->cols * frameset->rows), sizeof(*bw));
if (!bw->children)
return;
@@ -311,7 +311,7 @@
index = (row * bw->cols) + col;
frame = &frameset->children[index];
window = &bw->children[index];
-
+
/* content */
window->history = history_create();
window->sel = selection_create(window);
@@ -336,18 +336,18 @@
/* linking */
window->parent = bw;
-
+
/* gui window */
window->window = gui_create_browser_window(window, bw);
if (frame->children)
browser_window_create_frameset(window, frame);
}
}
-
+
/* calculate dimensions */
gui_window_update_extent(bw->window);
browser_window_recalculate_frameset(bw);
-
+
/* launch content */
for (row = 0; row < bw->rows; row++) {
for (col = 0; col < bw->cols; col++) {
@@ -367,7 +367,7 @@
*
* \param bw The browser window to reposition framesets for
*/
-
+
void browser_window_recalculate_frameset(struct browser_window *bw) {
int widths[bw->cols][bw->rows];
int heights[bw->cols][bw->rows];
@@ -380,7 +380,7 @@
int x, y;
assert(bw);
-
+
/* window dimensions */
if (!bw->parent) {
gui_window_get_dimensions(bw->window, &bw_width, &bw_height);
@@ -423,7 +423,7 @@
}
avail_width -= widths[col][row];
}
-
+
/* try to distribute remainder to relative values in preference */
if ((relative > 0) && (avail_width > 0)) {
for (col = 0; col < bw->cols; col++) {
@@ -443,7 +443,7 @@
for (col = 0; col < bw->cols; col++) {
index = (row * bw->cols) + col;
window = &bw->children[index];
-
+
if (col == bw->cols - 1) {
widths[col][row] = bw_width;
} else {
@@ -508,7 +508,7 @@
for (row = 0; row < bw->rows; row++) {
index = (row * bw->cols) + col;
window = &bw->children[index];
-
+
if (row == bw->rows - 1) {
heights[col][row] = bw_height;
} else {
@@ -533,7 +533,7 @@
y+= heights[col][row2];
gui_window_position_frame(window->window, x, y,
x + widths[col][row] - 1,
- y + heights[col][row] - 1);
+ y + heights[col][row] - 1);
x += widths[col][row];
if (window->children)
browser_window_recalculate_frameset(window);
@@ -547,13 +547,13 @@
*
* \param bw The browser window to resize
*/
-
+
void browser_window_resize_frame(struct browser_window *bw, int x, int y) {
struct browser_window *parent;
struct browser_window *sibling;
int col = -1, row = -1, i;
bool change = false;
-
+
parent = bw->parent;
assert(parent);
@@ -565,7 +565,7 @@
}
}
assert((col >= 0) && (row >= 0));
-
+
sibling = NULL;
if (bw->drag_resize_left)
sibling = &parent->children[row * parent->cols + (col - 1)];
@@ -573,7 +573,7 @@
sibling = &parent->children[row * parent->cols + (col + 1)];
if (sibling)
change |= browser_window_resolve_frame_dimension(bw, sibling, x, y, true, false);
-
+
sibling = NULL;
if (bw->drag_resize_up)
sibling = &parent->children[(row - 1) * parent->cols + col];
@@ -596,7 +596,7 @@
int frame_size;
assert(!(width && height));
-
+
/* extend/shrink the box to the pointer */
if (width) {
if (bw->drag_resize_left)
@@ -620,7 +620,7 @@
frame_size = bw->parent->y1 - bw->parent->y0;
}
sibling_dimension = bw_pixels + sibling_pixels - bw_dimension;
-
+
/* check for no change or no frame size*/
if ((bw_dimension == bw_pixels) || (frame_size == 0))
return false;
@@ -678,11 +678,11 @@
bw_d->value = (bw_d->value * sibling_pixels) / sibling_dimension;
else
bw_d->value = (bw_d->value * bw_dimension) / bw_pixels;
-
+
/* todo: the availble resize may have changed, update the drag box */
return true;
}
-
+
/* finally we have a pixel/percentage mix. unlike relative values, percentages
* can easily be backwards-calculated as they can simply be scaled like pixel
* values
@@ -755,7 +755,7 @@
LOG(("bw %p, url %s", bw, url));
assert(bw);
assert(url);
-
+
/* don't allow massively nested framesets */
for (cur = bw; cur->parent; cur = cur->parent)
depth++;
@@ -1137,10 +1137,10 @@
void browser_window_stop_throbber(struct browser_window *bw)
{
bw->throbbing = false;
-
+
while (bw->parent)
bw = bw->parent;
-
+
if (!browser_window_check_throbber(bw))
gui_window_stop_throbber(bw->window);
}
@@ -1148,10 +1148,10 @@
bool browser_window_check_throbber(struct browser_window *bw)
{
int children, index;
-
+
if (bw->throbbing)
return true;
-
+
if (bw->children) {
children = bw->rows * bw->cols;
for (index = 0; index < children; index++) {
@@ -1216,7 +1216,7 @@
void browser_window_stop(struct browser_window *bw)
{
int children, index;
-
+
if (bw->loading_content) {
content_remove_user(bw->loading_content,
browser_window_callback, (intptr_t) bw, 0);
@@ -1231,7 +1231,7 @@
}
schedule_remove(browser_window_refresh, bw);
-
+
if (bw->children) {
children = bw->rows * bw->cols;
for (index = 0; index < children; index++)
@@ -1400,14 +1400,14 @@
* \param bw the browser_window to search all relatives of
* \param target the target to locate
*/
-
+
struct browser_window *browser_window_find_target(struct browser_window *bw, const char *target)
{
struct browser_window *bw_target;
struct browser_window *top;
struct content *c;
int rdepth;
-
+
/* use the base target if we don't have one */
c = bw->current_content;
if (!target && c && c->data.html.base_target)
@@ -1438,13 +1438,13 @@
return bw;
return bw_target;
}
-
+
/* find frame according to B.8, ie using the following priorities:
*
* 1) current frame
* 2) closest to front
*/
-
+
rdepth = -1;
bw_target = bw;
for (top = bw; top->parent; top = top->parent);
@@ -1452,11 +1452,11 @@
return bw_target;
}
-void browser_window_find_target_internal(struct browser_window *bw, const char *target,
+void browser_window_find_target_internal(struct browser_window *bw, const char *target,
int depth, struct browser_window *page, int *rdepth, struct browser_window **bw_target)
{
int i;
-
+
if ((bw->name) && (!strcasecmp(bw->name, target))) {
if ((bw == page) || (depth > *rdepth)) {
*rdepth = depth;
@@ -1466,7 +1466,7 @@
if ((!bw->children) && (!bw->iframes))
return;
-
+
depth++;
for (i = 0; i < (bw->cols * bw->rows); i++) {
if ((bw->children[i].name) && (!strcasecmp(bw->children[i].name, target))) {
@@ -1591,7 +1591,7 @@
{
char *base_url = 0;
char *title = 0;
- char *url = 0;
+ const char *url = 0;
const char *target = 0;
char status_buffer[200];
const char *status = 0;
@@ -1643,7 +1643,7 @@
if (box->usemap)
url = imagemap_get(content, box->usemap,
- box_x, box_y, x, y);
+ box_x, box_y, x, y, &target);
if (box->gadget) {
gadget_content = content;
@@ -1864,14 +1864,14 @@
} else {
bool done = false;
-
+
/* frame resizing */
if (bw->parent) {
struct browser_window *parent;
for (parent = bw->parent; parent->parent; parent = parent->parent);
browser_window_resize_frames(parent, mouse, x + bw->x0, y + bw->y0,
&pointer, &status, &done);
- }
+ }
/* if clicking in the main page, remove the selection from any text areas */
if (!done) {
@@ -1906,7 +1906,7 @@
}
}
}
-
+
if (!done) {
if (title)
status = title;
@@ -1948,10 +1948,10 @@
gui_pointer_shape *pointer, const char **status, bool *action) {
bool left, right, up, down;
int i, resize_margin;
-
+
if ((x < bw->x0) || (x > bw->x1) || (y < bw->y0) || (y > bw->y1))
return false;
-
+
if ((!bw->no_resize) && (bw->parent)) {
resize_margin = FRAME_RESIZE;
if (resize_margin * 2 > (bw->x1 - bw->x0))
@@ -1963,7 +1963,7 @@
resize_margin = (bw->y1 - bw->y0) / 2;
up = (y < bw->y0 + resize_margin);
down = (y > bw->y1 - resize_margin);
-
+
/* check if the edges can actually be moved */
if (left || right || up || down) {
int row = -1, col = -1;
@@ -1984,7 +1984,7 @@
}
}
assert((row >= 0) && (col >= 0));
-
+
left &= (col > 0);
right &= (col < bw->parent->cols - 1) & (!left);
up &= (row > 0);
@@ -2042,7 +2042,7 @@
}
return false;
}
-
+
Modified: trunk/netsurf/render/imagemap.c
URL: http://svn.semichrome.net/trunk/netsurf/render/imagemap.c?rev=2920&r1=291...
==============================================================================
--- trunk/netsurf/render/imagemap.c (original)
+++ trunk/netsurf/render/imagemap.c Wed Sep 6 01:15:10 2006
@@ -28,6 +28,7 @@
struct mapentry {
imagemap_entry_type type; /**< type of shape */
char *url; /**< absolute url to go to */
+ char *target; /**< target frame (if any) */
union {
struct {
int x; /**< x coordinate of centre */
@@ -71,9 +72,9 @@
/**
* Add an imagemap to the hashtable, creating it if it doesn't exist
*
- * @param c The containing content
- * @param key The name of the imagemap
- * @param list List of map regions
+ * \param c The containing content
+ * \param key The name of the imagemap
+ * \param list List of map regions
* \return true on succes, false otherwise
*/
bool imagemap_add(struct content *c, const char *key, struct mapentry *list)
@@ -108,7 +109,7 @@
/**
* Create hashtable of imagemaps
*
- * @param c The containing content
+ * \param c The containing content
* \return true on success, false otherwise
*/
bool imagemap_create(struct content *c)
@@ -130,7 +131,7 @@
/**
* Destroy hashtable of imagemaps
*
- * @param c The containing content
+ * \param c The containing content
*/
void imagemap_destroy(struct content *c)
{
@@ -160,7 +161,7 @@
/**
* Dump imagemap data to the log
*
- * @param c The containing content
+ * \param c The containing content
*/
void imagemap_dump(struct content *c)
{
@@ -219,8 +220,8 @@
/**
* Extract all imagemaps from a document tree
*
- * @param node Root node of tree
- * @param c The containing content
+ * \param node Root node of tree
+ * \param c The containing content
* \return false on memory exhaustion, true otherwise
*/
bool imagemap_extract(xmlNode *node, struct content *c)
@@ -314,7 +315,7 @@
*/
bool imagemap_addtolist(xmlNode *n, char *base_url, struct mapentry **entry)
{
- char *shape, *coords = 0, *href, *val;
+ char *shape, *coords = 0, *href, *val, *target = 0;
int num;
struct mapentry *new_map, *temp;
@@ -332,6 +333,9 @@
if ((href = (char*)xmlGetProp(n, (const xmlChar*)"href")) == NULL) {
return true;
}
+
+ target = (char *)xmlGetProp(n, (const xmlChar *)"target");
+
/* no shape -> shape is a rectangle */
if ((shape = (char*)xmlGetProp(n, (const xmlChar*)"shape")) == NULL) {
shape = (char*)xmlMemStrdup("rect");
@@ -339,6 +343,8 @@
if (strcasecmp(shape, "default") != 0) {
/* no coords -> ignore */
if ((coords = (char*)xmlGetProp(n, (const xmlChar*)"coords")) == NULL) {
+ if (target)
+ xmlFree(target);
xmlFree(href);
xmlFree(shape);
return true;
@@ -347,6 +353,12 @@
new_map = calloc(1, sizeof(*new_map));
if (!new_map) {
+ if (target)
+ xmlFree(target);
+ xmlFree(href);
+ xmlFree(shape);
+ if (coords)
+ xmlFree(coords);
return false;
}
@@ -367,27 +379,53 @@
}
else { /* unknown shape -> bail */
free(new_map);
+ if (target)
+ xmlFree(target);
xmlFree(href);
xmlFree(shape);
- xmlFree(coords);
+ if (coords)
+ xmlFree(coords);
return true;
}
if (!box_extract_link(href, base_url, &new_map->url)) {
free(new_map);
+ if (target)
+ xmlFree(target);
xmlFree(href);
xmlFree(shape);
- xmlFree(coords);
+ if (coords)
+ xmlFree(coords);
return false;
}
if (!new_map->url) {
/* non-fatal error -> ignore this entry */
free(new_map);
+ if (target)
+ xmlFree(target);
xmlFree(href);
xmlFree(shape);
- xmlFree(coords);
+ if (coords)
+ xmlFree(coords);
return true;
+ }
+
+ if (target) {
+ new_map->target = strdup(target);
+ if (!new_map->target) {
+ free(new_map->url);
+ free(new_map);
+ xmlFree(target);
+ xmlFree(href);
+ xmlFree(shape);
+ if (coords)
+ xmlFree(coords);
+ return false;
+ }
+
+ /* no longer needed */
+ xmlFree(target);
}
if (new_map->type != IMAGEMAP_DEFAULT) {
@@ -439,6 +477,20 @@
new_map->bounds.poly.xcoords =
calloc(0, sizeof(*new_map->bounds.poly.xcoords));
if (!new_map->bounds.poly.xcoords) {
+ free(new_map->target);
+ free(new_map->url);
+ free(new_map);
+ xmlFree(href);
+ xmlFree(shape);
+ if (coords)
+ xmlFree(coords);
+ return false;
+ }
+ new_map->bounds.poly.ycoords =
+ calloc(0, sizeof(*new_map->bounds.poly.ycoords));
+ if (!new_map->bounds.poly.ycoords) {
+ free(new_map->bounds.poly.xcoords);
+ free(new_map->target);
free(new_map->url);
free(new_map);
xmlFree(href);
@@ -446,17 +498,6 @@
xmlFree(coords);
return false;
}
- new_map->bounds.poly.ycoords =
- calloc(0, sizeof(*new_map->bounds.poly.ycoords));
- if (!new_map->bounds.poly.ycoords) {
- free(new_map->bounds.poly.xcoords);
- free(new_map->url);
- free(new_map);
- xmlFree(href);
- xmlFree(shape);
- xmlFree(coords);
- return false;
- }
int x, y;
float *xcoords, *ycoords;
while (val) {
@@ -471,6 +512,7 @@
if (!xcoords) {
free(new_map->bounds.poly.ycoords);
free(new_map->bounds.poly.xcoords);
+ free(new_map->target);
free(new_map->url);
free(new_map);
xmlFree(href);
@@ -483,6 +525,7 @@
if (!ycoords) {
free(new_map->bounds.poly.ycoords);
free(new_map->bounds.poly.xcoords);
+ free(new_map->target);
free(new_map->url);
free(new_map);
xmlFree(href);
@@ -522,7 +565,8 @@
xmlFree(href);
xmlFree(shape);
- xmlFree(coords);
+ if (coords)
+ xmlFree(coords);
return true;
}
@@ -530,7 +574,7 @@
/**
* Free list of imagemap entries
*
- * @param list Pointer to head of list
+ * \param list Pointer to head of list
*/
void imagemap_freelist(struct mapentry *list)
{
@@ -543,6 +587,8 @@
while (entry != 0) {
prev = entry;
free(entry->url);
+ if (entry->target)
+ free(entry->target);
if (entry->type == IMAGEMAP_POLY) {
free(entry->bounds.poly.xcoords);
free(entry->bounds.poly.ycoords);
@@ -555,17 +601,19 @@
/**
* Retrieve url associated with imagemap entry
*
- * @param c The containing content
- * @param key The map name to search for
- * @param x The left edge of the containing box
- * @param y The top edge of the containing box
- * @param click_x The horizontal location of the click
- * @param click_y The vertical location of the click
- * @return The url associated with this area, or NULL if not found
- */
-char *imagemap_get(struct content *c, const char *key, unsigned long x,
- unsigned long y, unsigned long click_x,
- unsigned long click_y)
+ * \param c The containing content
+ * \param key The map name to search for
+ * \param x The left edge of the containing box
+ * \param y The top edge of the containing box
+ * \param click_x The horizontal location of the click
+ * \param click_y The vertical location of the click
+ * \param target Pointer to location to receive target pointer (if any)
+ * \return The url associated with this area, or NULL if not found
+ */
+const char *imagemap_get(struct content *c, const char *key,
+ unsigned long x, unsigned long y,
+ unsigned long click_x, unsigned long click_y,
+ const char **target)
{
unsigned int slot = 0;
struct imagemap *map;
@@ -590,6 +638,8 @@
switch (entry->type) {
case IMAGEMAP_DEFAULT:
/* just return the URL. no checks required */
+ if (target)
+ *target = entry->target;
return entry->url;
break;
case IMAGEMAP_RECT:
@@ -597,6 +647,8 @@
click_x <= x + entry->bounds.rect.x1 &&
click_y >= y + entry->bounds.rect.y0 &&
click_y <= y + entry->bounds.rect.y1) {
+ if (target)
+ *target = entry->target;
return entry->url;
}
break;
@@ -606,6 +658,8 @@
if ((cx * cx + cy * cy) <=
(unsigned long)(entry->bounds.circle.r *
entry->bounds.circle.r)) {
+ if (target)
+ *target = entry->target;
return entry->url;
}
break;
@@ -614,20 +668,25 @@
entry->bounds.poly.xcoords,
entry->bounds.poly.ycoords, x, y,
click_x, click_y)) {
+ if (target)
+ *target = entry->target;
return entry->url;
}
break;
}
}
+ if (target)
+ *target = NULL;
+
return NULL;
}
/**
* Hash function
*
- * @param key The key to hash
- * @return The hashed value
+ * \param key The key to hash
+ * \return The hashed value
*/
unsigned int imagemap_hash(const char *key)
{
@@ -646,14 +705,14 @@
* Test if a point lies within an arbitrary polygon
* Modified from comp.graphics.algorithms FAQ 2.03
*
- * @param num Number of vertices
- * @param xpt Array of x coordinates
- * @param ypt Array of y coordinates
- * @param x Left hand edge of containing box
- * @param y Top edge of containing box
- * @param click_x X coordinate of click
- * @param click_y Y coordinate of click
- * @return 1 if point is in polygon, 0 if outside. 0 or 1 if on boundary
+ * \param num Number of vertices
+ * \param xpt Array of x coordinates
+ * \param ypt Array of y coordinates
+ * \param x Left hand edge of containing box
+ * \param y Top edge of containing box
+ * \param click_x X coordinate of click
+ * \param click_y Y coordinate of click
+ * \return 1 if point is in polygon, 0 if outside. 0 or 1 if on boundary
*/
int imagemap_point_in_poly(int num, float *xpt, float *ypt, unsigned long x,
unsigned long y, unsigned long click_x,
Modified: trunk/netsurf/render/imagemap.h
URL: http://svn.semichrome.net/trunk/netsurf/render/imagemap.h?rev=2920&r1=291...
==============================================================================
--- trunk/netsurf/render/imagemap.h (original)
+++ trunk/netsurf/render/imagemap.h Wed Sep 6 01:15:10 2006
@@ -15,7 +15,9 @@
void imagemap_destroy(struct content *c);
void imagemap_dump(struct content *c);
bool imagemap_extract(xmlNode *node, struct content *c);
-char *imagemap_get(struct content *c, const char *key, unsigned long x,
- unsigned long y, unsigned long click_x, unsigned long click_y);
+const char *imagemap_get(struct content *c, const char *key,
+ unsigned long x, unsigned long y,
+ unsigned long click_x, unsigned long click_y,
+ const char **target);
#endif
17 years, 3 months
r2918 rjw - /trunk/netsurf/desktop/browser.c
by netsurf@semichrome.net
Author: rjw
Date: Tue Sep 5 18:59:29 2006
New Revision: 2918
URL: http://svn.semichrome.net?rev=2918&view=rev
Log:
Limit maximum frame nesting level.
Modified:
trunk/netsurf/desktop/browser.c
Modified: trunk/netsurf/desktop/browser.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/browser.c?rev=2918&r1=291...
==============================================================================
--- trunk/netsurf/desktop/browser.c (original)
+++ trunk/netsurf/desktop/browser.c Tue Sep 5 18:59:29 2006
@@ -50,6 +50,9 @@
/** maximum frame resize margin */
#define FRAME_RESIZE 6
+
+/** maximum frame depth */
+#define FRAME_DEPTH 8
/** browser window which is being redrawn. Valid only during redraw. */
struct browser_window *current_redraw_browser;
@@ -746,10 +749,20 @@
char *hash;
url_func_result res;
char url_buf[256];
+ int depth = 0;
+ struct browser_window *cur;
LOG(("bw %p, url %s", bw, url));
assert(bw);
assert(url);
+
+ /* don't allow massively nested framesets */
+ for (cur = bw; cur->parent; cur = cur->parent)
+ depth++;
+ if (depth > FRAME_DEPTH) {
+ LOG(("frame depth too high."));
+ return;
+ }
res = url_normalize(url, &url2);
if (res != URL_FUNC_OK) {
17 years, 3 months
r2917 rjw - /trunk/netsurf/riscos/window.c
by netsurf@semichrome.net
Author: rjw
Date: Tue Sep 5 18:34:30 2006
New Revision: 2917
URL: http://svn.semichrome.net?rev=2917&view=rev
Log:
Improve caret handling.
Modified:
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/riscos/window.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/window.c?rev=2917&r1=2916&...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Tue Sep 5 18:34:30 2006
@@ -339,25 +339,7 @@
}
ro_gui_window_open(g, (wimp_open*)&state);
- /* Set the caret position to the URL bar
- */
- if (g->toolbar && g->toolbar->display_url) {
- error = xwimp_set_caret_position(
- g->toolbar->toolbar_handle,
- ICON_TOOLBAR_URL, -1, -1, -1, 0);
- ro_gui_url_complete_start(g);
- } else
- error = xwimp_set_caret_position(g->window,
- wimp_ICON_WINDOW, -100, -100, 32, -1);
-
- if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return g;
- }
-
- /* and register event handlers */
+ /* Register event handlers */
ro_gui_wimp_event_register_keypress(g->window,
ro_gui_window_keypress);
if (g->toolbar)
@@ -366,6 +348,21 @@
ro_gui_wimp_event_register_mouse_click(g->window,
ro_gui_window_click);
+ /* Claim the caret position for top-level windows */
+ if (bw->browser_window_type == BROWSER_WINDOW_NORMAL) {
+ if (g->toolbar && g->toolbar->display_url) {
+ error = xwimp_set_caret_position(
+ g->toolbar->toolbar_handle,
+ ICON_TOOLBAR_URL, -1, -1, -1, 0);
+ ro_gui_url_complete_start(g);
+ if (error) {
+ LOG(("xwimp_set_caret_position: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("WimpError", error->errmess);
+ }
+ } else
+ gui_window_place_caret(g, -100, -100, 0);
+ }
return g;
}
@@ -1878,16 +1875,8 @@
/* set input focus */
if (pointer->buttons == wimp_CLICK_SELECT ||
- pointer->buttons == wimp_CLICK_ADJUST) {
- error = xwimp_set_caret_position(state.w, -1,
- -100, -100, 32, -1);
- if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return false;
- }
- }
+ pointer->buttons == wimp_CLICK_ADJUST)
+ gui_window_place_caret(g, -100, -100, 0);
if (pointer->buttons == wimp_CLICK_MENU)
ro_gui_menu_create(browser_menu, pointer->pos.x,
@@ -1987,14 +1976,7 @@
return;
/* hide caret, but keep input focus */
- error = xwimp_set_caret_position(g->window, -1,
- -100, -100, 32, -1);
- if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return;
- }
+ gui_window_place_caret(g, -100, -100, 0);
}
17 years, 3 months
r2916 rjw - /trunk/netsurf/riscos/menus.c
by netsurf@semichrome.net
Author: rjw
Date: Tue Sep 5 15:56:18 2006
New Revision: 2916
URL: http://svn.semichrome.net?rev=2916&view=rev
Log:
Fix 1528364.
Modified:
trunk/netsurf/riscos/menus.c
Modified: trunk/netsurf/riscos/menus.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/menus.c?rev=2916&r1=2915&r...
==============================================================================
--- trunk/netsurf/riscos/menus.c (original)
+++ trunk/netsurf/riscos/menus.c Tue Sep 5 15:56:18 2006
@@ -1449,7 +1449,7 @@
return false;
data = urldb_get_url_data(c->url);
if (data) {
- node = tree_create_URL_node(hotlist_tree->root, c->url, data, NULL);
+ node = tree_create_URL_node(hotlist_tree->root, c->url, data, data->title);
if (node) {
tree_redraw_area(hotlist_tree,
node->box.x - NODE_INSTEP, 0,
17 years, 3 months
r2915 rjw - /trunk/netsurf/riscos/window.c
by netsurf@semichrome.net
Author: rjw
Date: Tue Sep 5 02:09:05 2006
New Revision: 2915
URL: http://svn.semichrome.net?rev=2915&view=rev
Log:
Fix initial frame stack placement (fix www.theabar.co.uk and others)
Modified:
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/riscos/window.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/window.c?rev=2915&r1=2914&...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Tue Sep 5 02:09:05 2006
@@ -328,10 +328,7 @@
/* Open the window at the top/back of the stack
*/
- if (bw->browser_window_type == BROWSER_WINDOW_NORMAL)
- state.next = wimp_TOP;
- else
- state.next = wimp_HIDDEN;
+ state.next = wimp_TOP;
if (bw->parent) {
top = browser_window_owner(bw);
error = xwimp_open_window_nested((wimp_open *)&state, top->window->window,
17 years, 3 months
r2913 rjw - /trunk/netsurf/riscos/window.c
by netsurf@semichrome.net
Author: rjw
Date: Tue Sep 5 01:24:17 2006
New Revision: 2913
URL: http://svn.semichrome.net?rev=2913&view=rev
Log:
Don't force iframe windows 'onto screen' when opening (fix 1551632)
Modified:
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/riscos/window.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/window.c?rev=2913&r1=2912&...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Tue Sep 5 01:24:17 2006
@@ -253,8 +253,9 @@
wimp_WINDOW_HSCROLL);
window.title_fg = 0xff;
break;
+ case BROWSER_WINDOW_IFRAME:
+ window.flags |= wimp_WINDOW_NO_BOUNDS;
case BROWSER_WINDOW_FRAME:
- case BROWSER_WINDOW_IFRAME:
if (bw->scrolling == SCROLLING_NO)
window.flags &= ~(wimp_WINDOW_VSCROLL |
wimp_WINDOW_HSCROLL);
@@ -1002,15 +1003,15 @@
/* store position for children */
if (parent->browser_window_type == BROWSER_WINDOW_IFRAME) {
- x0 = bw->x0 = x0;
- y0 = bw->y0 = y0;
- x1 = bw->x1 = x1;
- y1 = bw->y1 = y1;
+ bw->x0 = x0;
+ bw->y0 = y0;
+ bw->x1 = x1;
+ bw->y1 = y1;
} else {
- x0 = bw->x0 = parent->x0 + x0;
- y0 = bw->y0 = parent->y0 + y0;
- x1 = bw->x1 = parent->x0 + x1;
- y1 = bw->y1 = parent->y0 + y1;
+ bw->x0 = x0 = parent->x0 + x0;
+ bw->y0 = y0 = parent->y0 + y0;
+ bw->x1 = x1 = parent->x0 + x1;
+ bw->y1 = y1 = parent->y0 + y1;
}
/* get the position of the top level window */
@@ -1060,8 +1061,7 @@
state.visible.x0 = px0 + x0 * 2;
state.visible.y0 = py1 - y1;
state.visible.x1 = px0 + x1;
- state.visible.y1 = py1 - y0 * 2;
-
+ state.visible.y1 = py1 - y0 * 2;
ro_gui_window_open(g, (wimp_open *)&state);
}
17 years, 3 months
r2912 rjw - /trunk/netsurf/desktop/browser.c
by netsurf@semichrome.net
Author: rjw
Date: Mon Sep 4 22:09:11 2006
New Revision: 2912
URL: http://svn.semichrome.net?rev=2912&view=rev
Log:
Make frame border width external to frame.
Modified:
trunk/netsurf/desktop/browser.c
Modified: trunk/netsurf/desktop/browser.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/browser.c?rev=2912&r1=291...
==============================================================================
--- trunk/netsurf/desktop/browser.c (original)
+++ trunk/netsurf/desktop/browser.c Mon Sep 4 22:09:11 2006
@@ -403,6 +403,12 @@
switch (window->frame_width.unit) {
case FRAME_DIMENSION_PIXELS:
widths[col][row] = window->frame_width.value;
+ if (window->border) {
+ if (col != 0)
+ widths[col][row] += 1;
+ if (col != bw->cols - 1)
+ widths[col][row] += 1;
+ }
break;
case FRAME_DIMENSION_PERCENT:
widths[col][row] = bw_width * window->frame_width.value / 100;
@@ -458,6 +464,12 @@
switch (window->frame_height.unit) {
case FRAME_DIMENSION_PIXELS:
heights[col][row] = window->frame_height.value;
+ if (window->border) {
+ if (row != 0)
+ heights[col][row] += 1;
+ if (row != bw->rows - 1)
+ heights[col][row] += 1;
+ }
break;
case FRAME_DIMENSION_PERCENT:
heights[col][row] = bw_height *
17 years, 3 months