Add menu item to toggle debug rendering to nsgtk

svn path=/trunk/netsurf/; revision=3047
This commit is contained in:
Rob Kendrick 2006-11-11 12:57:22 +00:00
parent d83dbbdebb
commit d9137f99f7
2 changed files with 36 additions and 17 deletions

View File

@ -31,6 +31,7 @@
#include "netsurf/render/box.h" #include "netsurf/render/box.h"
#include "netsurf/render/font.h" #include "netsurf/render/font.h"
#include "netsurf/render/form.h" #include "netsurf/render/form.h"
#include "netsurf/render/html.h"
#include "netsurf/utils/messages.h" #include "netsurf/utils/messages.h"
#include "netsurf/utils/utils.h" #include "netsurf/utils/utils.h"
#include "netsurf/utils/log.h" #include "netsurf/utils/log.h"
@ -148,6 +149,7 @@ MENUPROTO(zoom_in);
MENUPROTO(normal_size); MENUPROTO(normal_size);
MENUPROTO(zoom_out); MENUPROTO(zoom_out);
MENUPROTO(save_window_size); MENUPROTO(save_window_size);
MENUPROTO(toggle_debug_rendering);
/* navigate menu */ /* navigate menu */
MENUPROTO(back); MENUPROTO(back);
@ -178,6 +180,7 @@ static struct menu_events menu_events[] = {
MENUEVENT(normal_size), MENUEVENT(normal_size),
MENUEVENT(zoom_out), MENUEVENT(zoom_out),
MENUEVENT(save_window_size), MENUEVENT(save_window_size),
MENUEVENT(toggle_debug_rendering),
/* navigate menu */ /* navigate menu */
MENUEVENT(back), MENUEVENT(back),
@ -601,6 +604,14 @@ MENUHANDLER(save_window_size)
return TRUE; return TRUE;
} }
MENUHANDLER(toggle_debug_rendering)
{
html_redraw_debug = !html_redraw_debug;
gui_window_redraw_window(g);
return TRUE;
}
MENUHANDLER(stop) MENUHANDLER(stop)
{ {
return nsgtk_window_stop_button_clicked(GTK_WIDGET(widget), g); return nsgtk_window_stop_button_clicked(GTK_WIDGET(widget), g);

View File

@ -48,7 +48,7 @@
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image465"> <widget class="GtkImage" id="image501">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-new</property> <property name="stock">gtk-new</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -82,7 +82,7 @@
<accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image466"> <widget class="GtkImage" id="image502">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-open</property> <property name="stock">gtk-open</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -104,7 +104,7 @@
<accelerator key="W" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/> <accelerator key="W" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image467"> <widget class="GtkImage" id="image503">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-close</property> <property name="stock">gtk-close</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -133,7 +133,7 @@
<accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image468"> <widget class="GtkImage" id="image504">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-save-as</property> <property name="stock">gtk-save-as</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -203,7 +203,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image469"> <widget class="GtkImage" id="image505">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-print-preview</property> <property name="stock">gtk-print-preview</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -226,7 +226,7 @@
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image470"> <widget class="GtkImage" id="image506">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-print</property> <property name="stock">gtk-print</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -350,7 +350,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image471"> <widget class="GtkImage" id="image507">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-preferences</property> <property name="stock">gtk-preferences</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -384,7 +384,7 @@
<accelerator key="Escape" modifiers="0" signal="activate"/> <accelerator key="Escape" modifiers="0" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image472"> <widget class="GtkImage" id="image508">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-stop</property> <property name="stock">gtk-stop</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -405,7 +405,7 @@
<accelerator key="F5" modifiers="0" signal="activate"/> <accelerator key="F5" modifiers="0" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image473"> <widget class="GtkImage" id="image509">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-refresh</property> <property name="stock">gtk-refresh</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -433,7 +433,7 @@
<accelerator key="F11" modifiers="0" signal="activate"/> <accelerator key="F11" modifiers="0" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image474"> <widget class="GtkImage" id="image510">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-zoom-in</property> <property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -455,7 +455,7 @@
<accelerator key="plus" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="plus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image475"> <widget class="GtkImage" id="image511">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-zoom-in</property> <property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -476,7 +476,7 @@
<accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image476"> <widget class="GtkImage" id="image512">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-zoom-100</property> <property name="stock">gtk-zoom-100</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -497,7 +497,7 @@
<accelerator key="minus" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="minus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image477"> <widget class="GtkImage" id="image513">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-zoom-out</property> <property name="stock">gtk-zoom-out</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -628,6 +628,14 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
</widget> </widget>
</child> </child>
<child>
<widget class="GtkMenuItem" id="toggle_debug_rendering">
<property name="visible">True</property>
<property name="label" translatable="yes">Toggle debug rendering</property>
<property name="use_underline">True</property>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -650,7 +658,7 @@
<accelerator key="Left" modifiers="GDK_MOD1_MASK" signal="activate"/> <accelerator key="Left" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image478"> <widget class="GtkImage" id="image514">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-go-back</property> <property name="stock">gtk-go-back</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -671,7 +679,7 @@
<accelerator key="Right" modifiers="GDK_MOD1_MASK" signal="activate"/> <accelerator key="Right" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image479"> <widget class="GtkImage" id="image515">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-go-forward</property> <property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -692,7 +700,7 @@
<accelerator key="Home" modifiers="GDK_MOD1_MASK" signal="activate"/> <accelerator key="Home" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image480"> <widget class="GtkImage" id="image516">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-home</property> <property name="stock">gtk-home</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -781,7 +789,7 @@
<accelerator key="F1" modifiers="0" signal="activate"/> <accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image481"> <widget class="GtkImage" id="image517">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-help</property> <property name="stock">gtk-help</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>