From ba23e4b69341e5f3f2dbcd824663e75ebe2a581f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 27 Nov 2006 15:35:18 +0000 Subject: Update project URL. svn path=/trunk/netsurf/; revision=3073 --- riscos/gui/progress_bar.c | 40 ++++++++++++++++++++-------------------- riscos/gui/progress_bar.h | 2 +- riscos/gui/status_bar.c | 36 ++++++++++++++++++------------------ riscos/gui/status_bar.h | 2 +- 4 files changed, 40 insertions(+), 40 deletions(-) (limited to 'riscos/gui') diff --git a/riscos/gui/progress_bar.c b/riscos/gui/progress_bar.c index 82829def7..0ca2d28b0 100644 --- a/riscos/gui/progress_bar.c +++ b/riscos/gui/progress_bar.c @@ -1,5 +1,5 @@ /* - * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * This file is part of NetSurf, http://netsurf-browser.org/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license * Copyright 2006 Richard Wilson @@ -276,25 +276,25 @@ void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height) schedule(20, ro_gui_progress_bar_animate, pb); pb->animating = true; } - + /* get old and new positions */ cur = pb->visible; pb->recalculate = true; ro_gui_progress_bar_calculate(pb, width, height); - + /* see if the progress bar hasn't moved. we don't need to consider * the left edge moving as this is handled by the icon setting * function */ if (cur.x1 == pb->visible.x1) return; - + /* if size has decreased then we must force a redraw */ if (cur.x1 > pb->visible.x1) { xwimp_force_redraw(pb->w, pb->visible.x1, pb->visible.y0, cur.x1, pb->visible.y1); return; } - + /* perform a minimal redraw update */ redraw.w = pb->w; redraw.box = pb->visible; @@ -342,14 +342,14 @@ void ro_gui_progress_bar_animate(void *p) { struct progress_bar *pb = p; if (!progress_icon) - return; + return; pb->offset -= 6; if (pb->offset < 0) pb->offset += progress_width * 2; - + if (pb->animating) schedule(20, ro_gui_progress_bar_animate, pb); - + redraw.w = pb->w; redraw.box = pb->visible; error = xwimp_update_window(&redraw, &more); @@ -372,12 +372,12 @@ void ro_gui_progress_bar_calculate(struct progress_bar *pb, int width, int heigh int icon_x0 = 0, icon_y0 = 0, progress_x0, progress_x1, progress_ymid = 0; osspriteop_header *icon = NULL; bool icon_redraw = false; - + /* try to use cached values */ if ((!pb->recalculate) && (pb->cur_width == width) && (pb->cur_height == height)) return; - + /* update cache status */ pb->recalculate = false; pb->cur_width = width; @@ -409,18 +409,18 @@ void ro_gui_progress_bar_calculate(struct progress_bar *pb, int width, int heigh } } } - + /* update the icon */ if ((pb->icon_obscured) || (icon_redraw)) { if (icon_x0 != pb->icon_x0) xwimp_force_redraw(pb->w, 0, 0, 32 + MARGIN, 65536); } - pb->icon_obscured = icon_redraw; - + pb->icon_obscured = icon_redraw; + progress_x1 = progress_x0; if ((pb->range > 0) && (width > 0)) progress_x1 += (width * pb->value) / pb->range; - + pb->visible.x0 = progress_x0; pb->visible.y0 = MARGIN; pb->visible.x1 = progress_x1; @@ -454,7 +454,7 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, struct progress_bar *p redraw->box.y1 - redraw->box.y0); progress_ymid = redraw->box.y0 + pb->visible.y0 + ((pb->visible.y1 - pb->visible.y0) >> 1); - + /* redraw the window */ while (more) { if (pb->icon) @@ -464,12 +464,12 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, struct progress_bar *p redraw->box.y0 + pb->icon_y0, tinct_ERROR_DIFFUSE); if (!pb->icon_obscured) { - clip_x0 = max(redraw->clip.x0, - redraw->box.x0 + pb->visible.x0) >> 1; + clip_x0 = max(redraw->clip.x0, + redraw->box.x0 + pb->visible.x0) >> 1; clip_y0 = -min(redraw->clip.y1, - redraw->box.y0 + pb->visible.y1) >> 1; + redraw->box.y0 + pb->visible.y1) >> 1; clip_x1 = min(redraw->clip.x1, - redraw->box.x0 + pb->visible.x1) >> 1; + redraw->box.x0 + pb->visible.x1) >> 1; clip_y1 = -max(redraw->clip.y0, redraw->box.y0 + pb->visible.y0) >> 1; if ((clip_x0 < clip_x1) && (clip_y0 < clip_y1)) { @@ -478,7 +478,7 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, struct progress_bar *p _swix(Tinct_Plot, _IN(2) | _IN(3) | _IN(4) | _IN(7), progress_icon, redraw->box.x0 - pb->offset, - progress_ymid - progress_height, + progress_ymid - progress_height, tinct_FILL_HORIZONTALLY); } else { plot.fill(clip_x0, clip_y0, clip_x1, clip_y1, diff --git a/riscos/gui/progress_bar.h b/riscos/gui/progress_bar.h index 454716b7d..b93a36d39 100644 --- a/riscos/gui/progress_bar.h +++ b/riscos/gui/progress_bar.h @@ -1,5 +1,5 @@ /* - * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * This file is part of NetSurf, http://netsurf-browser.org/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license * Copyright 2006 Richard Wilson diff --git a/riscos/gui/status_bar.c b/riscos/gui/status_bar.c index 132958a4d..84ce994c8 100644 --- a/riscos/gui/status_bar.c +++ b/riscos/gui/status_bar.c @@ -1,5 +1,5 @@ /* - * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * This file is part of NetSurf, http://netsurf-browser.org/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license * Copyright 2006 Richard Wilson @@ -48,7 +48,7 @@ wimp_WINDOW(1) status_bar_definition = { 0, 0, wimp_TOP, - wimp_WINDOW_NEW_FORMAT | wimp_WINDOW_MOVEABLE | + wimp_WINDOW_NEW_FORMAT | wimp_WINDOW_MOVEABLE | wimp_WINDOW_FURNITURE_WINDOW | wimp_WINDOW_IGNORE_XEXTENT, wimp_COLOUR_BLACK, @@ -106,7 +106,7 @@ struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width) { sb = calloc(1, sizeof(*sb)); if (!sb) return NULL; - + sb->pb = ro_gui_progress_bar_create(); if (!sb->pb) return NULL; @@ -151,9 +151,9 @@ void ro_gui_status_bar_destroy(struct status_bar *sb) { LOG(("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess)); } - + ro_gui_progress_bar_destroy(sb->pb); - + if (sb->text) free(sb->text); @@ -206,7 +206,7 @@ void ro_gui_status_bar_set_visible(struct status_bar *sb, bool visible) { if (error) { LOG(("xwimp_close_window: 0x%x:%s", error->errnum, error->errmess)); - } + } } } @@ -234,7 +234,7 @@ void ro_gui_status_bar_set_progress_value(struct status_bar *sb, unsigned int value) { assert(sb); - + ro_gui_status_bar_set_progress_range(sb, max(value, ro_gui_progress_bar_get_range(sb->pb))); ro_gui_progress_bar_set_value(sb->pb, value); @@ -253,10 +253,10 @@ void ro_gui_status_bar_set_progress_range(struct status_bar *sb, os_error *error; assert(sb); - + old_range = ro_gui_progress_bar_get_range(sb->pb); ro_gui_progress_bar_set_range(sb->pb, range); - + LOG(("Ranges are %i vs %i", old_range, range)); if ((old_range == 0) && (range != 0)) { ro_gui_status_position_progress_bar(sb); @@ -266,7 +266,7 @@ void ro_gui_status_bar_set_progress_range(struct status_bar *sb, if (error) { LOG(("xwimp_close_window: 0x%x:%s", error->errnum, error->errmess)); - } + } } } @@ -280,7 +280,7 @@ void ro_gui_status_bar_set_progress_range(struct status_bar *sb, void ro_gui_status_bar_set_progress_icon(struct status_bar *sb, const char *icon) { assert(sb); - + ro_gui_progress_bar_set_icon(sb->pb, icon); } @@ -293,7 +293,7 @@ void ro_gui_status_bar_set_progress_icon(struct status_bar *sb, void ro_gui_status_bar_set_text(struct status_bar *sb, const char *text) { assert(sb); - + /* check for no change */ if (sb->text) { /* strings match */ @@ -316,7 +316,7 @@ void ro_gui_status_bar_set_text(struct status_bar *sb, const char *text) { sb->text = strdup(text); else sb->text = NULL; - + /* redraw the window */ if (sb->visible) xwimp_force_redraw(sb->w, 0, 0, sb->width - WIDGET_WIDTH, 65536); @@ -409,7 +409,7 @@ void ro_gui_status_bar_resize(struct status_bar *sb) { error->errnum, error->errmess)); return; } - + redraw_left = min(status_width, sb->width) - WIDGET_WIDTH - 2; redraw_right = max(status_width, sb->width); xwimp_force_redraw(sb->w, redraw_left, 0, @@ -472,7 +472,7 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) { LOG(("rufl_paint: 0x%x", code)); } } - + /* separate the widget from the text with a line */ plot.fill((redraw->box.x0 + sb->width - WIDGET_WIDTH - 2) >> 1, -redraw->box.y0 >> 1, @@ -529,7 +529,7 @@ void ro_gui_status_bar_open(wimp_open *open) { int window_width, status_width; wimp_window_state state; os_error *error; - + /* get the parent width for scaling */ sb = (struct status_bar *)ro_gui_wimp_event_get_user_data(open->w); state.w = sb->parent; @@ -582,7 +582,7 @@ void ro_gui_status_position_progress_bar(struct status_bar *sb) { /* calculate the dimensions */ right = state.visible.x1 - WIDGET_WIDTH - 2; left = max(state.visible.x0, right - PROGRESS_WIDTH); - + /* re-open the nested window */ state.w = ro_gui_progress_bar_get_window(sb->pb); state.xscroll = 0; @@ -608,7 +608,7 @@ void ro_gui_status_position_progress_bar(struct status_bar *sb) { LOG(("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess)); } - + /* update the progress bar display on non-standard width */ if ((right - left) != PROGRESS_WIDTH) ro_gui_progress_bar_update(sb->pb, right - left, diff --git a/riscos/gui/status_bar.h b/riscos/gui/status_bar.h index b1c5baca4..dc8452456 100644 --- a/riscos/gui/status_bar.h +++ b/riscos/gui/status_bar.h @@ -1,5 +1,5 @@ /* - * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * This file is part of NetSurf, http://netsurf-browser.org/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license * Copyright 2006 Richard Wilson -- cgit v1.2.3