Author: rjw
Date: Sat Mar 3 19:46:20 2007
New Revision: 3191
URL:
http://svn.semichrome.net?rev=3191&view=rev
Log:
Dynamically update scale view (implement 1556975) and prevent double redraws.
Modified:
trunk/netsurf/content/content.c
trunk/netsurf/content/content.h
trunk/netsurf/riscos/dialog.c
trunk/netsurf/riscos/dialog.h
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/content/content.c
URL:
http://svn.semichrome.net/trunk/netsurf/content/content.c?rev=3191&r1...
==============================================================================
--- trunk/netsurf/content/content.c (original)
+++ trunk/netsurf/content/content.c Sat Mar 3 19:46:20 2007
@@ -485,6 +485,17 @@
}
return 0;
+}
+
+
+/**
+ * Get whether a content can reformat
+ *
+ * \param c content to check
+ * \return whether the content can reformat
+ */
+bool content_get_reformat(struct content *c) {
+ return (handler_map[c->type].reformat != NULL);
}
Modified: trunk/netsurf/content/content.h
URL:
http://svn.semichrome.net/trunk/netsurf/content/content.h?rev=3191&r1...
==============================================================================
--- trunk/netsurf/content/content.h (original)
+++ trunk/netsurf/content/content.h Sat Mar 3 19:46:20 2007
@@ -225,6 +225,7 @@
struct content * content_create(const char *url);
struct content * content_get(const char *url);
struct content * content_get_ready(const char *url);
+bool content_get_reformat(struct content *c);
bool content_set_type(struct content *c, content_type type,
const char *mime_type, const char *params[]);
void content_set_status(struct content *c, const char *status_message, ...);
Modified: trunk/netsurf/riscos/dialog.c
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/dialog.c?rev=3191&r1=3...
==============================================================================
--- trunk/netsurf/riscos/dialog.c (original)
+++ trunk/netsurf/riscos/dialog.c Sat Mar 3 19:46:20 2007
@@ -684,6 +684,16 @@
ro_gui_wimp_event_memorise(dialog_zoom);
}
+/**
+ * Update the Scale View dialog to reflect the current window settings
+ *
+ * \param g the gui_window to update for
+ */
+void ro_gui_dialog_update_zoom(struct gui_window *g) {
+ if (g == ro_gui_current_zoom_gui)
+ ro_gui_dialog_prepare_zoom(g);
+}
+
bool ro_gui_dialog_openurl_apply(wimp_w w) {
url_func_result res;
Modified: trunk/netsurf/riscos/dialog.h
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/dialog.h?rev=3191&r1=3...
==============================================================================
--- trunk/netsurf/riscos/dialog.h (original)
+++ trunk/netsurf/riscos/dialog.h Sat Mar 3 19:46:20 2007
@@ -39,6 +39,7 @@
void ro_gui_dialog_click(wimp_pointer *pointer);
void ro_gui_dialog_prepare_zoom(struct gui_window *g);
+void ro_gui_dialog_update_zoom(struct gui_window *g);
void ro_gui_dialog_prepare_open_url(void);
void ro_gui_save_options(void);
void ro_gui_dialog_open_config(void);
Modified: trunk/netsurf/riscos/window.c
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/window.c?rev=3191&r1=3...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Sat Mar 3 19:46:20 2007
@@ -518,27 +518,7 @@
*/
void gui_window_redraw_window(struct gui_window *g)
{
- wimp_window_info info;
- os_error *error;
-
- assert(g);
-
- info.w = g->window;
- error = xwimp_get_window_info_header_only(&info);
- if (error) {
- LOG(("xwimp_get_window_info_header_only: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return;
- }
-
- error = xwimp_force_redraw(g->window, info.extent.x0, info.extent.y0,
- info.extent.x1, info.extent.y1);
- if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- }
+ gui_window_redraw(g, 0, -8192, 8192, 8192);
}
@@ -1394,11 +1374,13 @@
g->option.scale = scale;
c = g->bw->current_content;
if (c) {
- /* todo: we should only call _update for contents that don't have a
- * reformat function and thus don't redraw themselves */
- browser_window_update(g->bw, false);
- g->reformat_pending = true;
- gui_reformat_pending = true;
+ ro_gui_dialog_update_zoom(g);
+ if (!content_get_reformat(c)) {
+ browser_window_update(g->bw, false);
+ } else {
+ g->reformat_pending = true;
+ gui_reformat_pending = true;
+ }
}
}