summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-02-18 14:47:21 +0000
committerVincent Sanders <vince@netsurf-browser.org>2013-02-18 14:47:21 +0000
commit869c7245f5a5afe4c35fd06ad8076652627d43a2 (patch)
tree3d9005182b27b41e63262e75dbdea01d2aa85eaf
parent15d39c6ebf2180e422f8bd381333043903cfd45b (diff)
downloadnetsurf-869c7245f5a5afe4c35fd06ad8076652627d43a2.tar.gz
netsurf-869c7245f5a5afe4c35fd06ad8076652627d43a2.tar.bz2
clean out useless outdated #if 0 blocks they serve no purpose and keep causing confusion in core refactors. Better examples are available in other frontends or in teh revision control system if strictly necessary
-rw-r--r--beos/about.cpp15
-rw-r--r--beos/bitmap.cpp10
-rw-r--r--beos/font.cpp4
-rw-r--r--beos/gui.cpp221
-rw-r--r--beos/gui.h7
-rw-r--r--beos/gui_options.h3
-rw-r--r--beos/plotters.cpp233
-rw-r--r--beos/plotters.h8
-rw-r--r--beos/scaffolding.cpp696
-rw-r--r--beos/scaffolding.h6
-rw-r--r--beos/window.cpp359
11 files changed, 4 insertions, 1558 deletions
diff --git a/beos/about.cpp b/beos/about.cpp
index e5d79df4d..bfe836e62 100644
--- a/beos/about.cpp
+++ b/beos/about.cpp
@@ -122,20 +122,7 @@ void nsbeos_about(struct gui_window *gui)
add_section(tv, "artists", artists);
add_section(tv, "documenters", documenters);
add_section(tv, url_label, url);
-#if 0
- BView *p = tv->Parent();
- //tv->MakeSelectable(true);
-
- //tv->ResizeBy(-B_V_SCROLL_BAR_WIDTH, 0);
- //tv->ResizeBy(-B_V_SCROLL_BAR_WIDTH, 0);
- if (p && p->RemoveChild(tv)) {
- BScrollView *sv = new BScrollView("sv", tv, B_FOLLOW_ALL, 0,
- false, true, B_NO_BORDER);
- p->AddChild(sv);
- }
-
- //tv->ResizeToPreferred();
-#endif
+
// make space for controls
alert->ResizeBy(200, 500);
alert->MoveTo(alert->AlertPosition(alert->Frame().Width() + 1,
diff --git a/beos/bitmap.cpp b/beos/bitmap.cpp
index 02724a047..93a184356 100644
--- a/beos/bitmap.cpp
+++ b/beos/bitmap.cpp
@@ -267,16 +267,6 @@ bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
if (roster->Translate(&stream, NULL, NULL, &file, type) < B_OK)
return false;
-#if 0 /* GTK */
- GError *err = NULL;
-
- gdk_pixbuf_save(bitmap->primary, path, "png", &err, NULL);
-
- if (err == NULL)
- /* TODO: report an error here */
- return false;
-
-#endif
return true;
}
diff --git a/beos/font.cpp b/beos/font.cpp
index 7d04c6857..c2d5e7b9b 100644
--- a/beos/font.cpp
+++ b/beos/font.cpp
@@ -257,10 +257,6 @@ bool nsfont_paint(const plot_font_style_t *fstyle,
oldbg = view->LowColor();
drawing_mode oldmode = view->DrawingMode();
-#if 0
- if (oldbg != background)
- view->SetLowColor(background);
-#endif
view->SetLowColor(B_TRANSPARENT_32_BIT);
//view->SetScale() XXX
diff --git a/beos/gui.cpp b/beos/gui.cpp
index b8e5822e3..a5833365a 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -112,16 +112,6 @@ static BMessage *gFirstRefsReceived = NULL;
static int sEventPipe[2];
-#if 0 /* GTK */
-static void nsbeos_create_ssl_verify_window(struct browser_window *bw,
- hlcache_handle *c, const struct ssl_cert_info *certs,
- unsigned long num);
-static void nsbeos_ssl_accept(BButton *w, gpointer data);
-static void nsbeos_ssl_reject(BButton *w, gpointer data);
-static void nsbeos_select_menu_clicked(BCheckMenuItem *checkmenuitem,
- gpointer user_data);
-#endif
-
// #pragma mark - class NSBrowserFrameView
@@ -216,59 +206,6 @@ NSBrowserApplication::QuitRequested()
// #pragma mark - implementation
-// XXX doesn't work
-#if 0
-static char *generate_default_css()
-{
- BString text;
- rgb_color colBg = { 255, 255, 255, 255 };
- rgb_color colFg = { 0, 0, 0, 255 };
- rgb_color colControlBg = { 255, 255, 255, 255 };
- rgb_color colControlFg = { 0, 0, 0, 255 };
- const char *url = "file://beosdefault.css";
-
- text << "/*\n";
- text << " * This file is part of NetSurf, http://netsurf-browser.org/\n";
- text << " */\n";
- text << "\n";
- text << "/* Load base stylesheet. */\n";
- text << "\n";
- text << "@import \"default.css\";\n";
- text << "\n";
- text << "/* Apply BeOS specific rules. */\n";
- text << "\n";
- text << "\n";
- text << "\n";
- text << "\n";
-
- text << "input { font-size: 95%; border: medium inset #ddd; }\n";
- text << "input[type=button], input[type=reset], input[type=submit], button {\n";
- text << " background-color: #ddd; border: medium outset #ddd; }\n";
- text << "input[type=checkbox], input[type=radio] { font-size: 105%; }\n";
- text << "input[type=file] { background-color: #ddd; border: medium inset #ddd; }\n";
- text << "\n";
- text << "select { background-color: #ddd; border: medium inset #ddd; font-size: 95%; }\n";
- text << "select:after { border-left:4px ridge #ddd; }\n";
- text << "\n";
- text << "textarea { font-size: 95%; border: medium inset #ddd; }\n";
-
- struct content *c;
- c = content_create(url);
- if (c == NULL)
- return NULL;
-
- const char *params[] = { 0 };
- if (!content_set_type(c, CONTENT_CSS, "text/css", params, NULL))
- return NULL;
-
- if (!content_process_data(c, text.String(), text.Length()))
- return NULL;
-
- content_set_done(c);
-
- return strdup(url);
-}
-#endif
/* realpath fallback on R5 */
#if !defined(__HAIKU__) && !defined(B_BEOS_VERSION_DANO)
@@ -572,11 +509,6 @@ void gui_init(int argc, char** argv)
#undef STROF
}
-#if 0
- find_resource(buf, "throbber.gif", "./beos/res/throbber.gif");
- nsbeos_throbber_initialise_from_gif(buf);
-#endif
-
if (nsbeos_throbber == NULL)
die("Unable to load throbber image.\n");
@@ -614,14 +546,6 @@ void gui_init(int argc, char** argv)
SETFONTDEFAULT(font_mono, "Bitstream Vera Sans Mono");
SETFONTDEFAULT(font_cursive, "Bitstream Vera Serif");
SETFONTDEFAULT(font_fantasy, "Bitstream Vera Serif");
-#if 0
- SETFONTDEFAULT(font_sans, "Swis721 BT");
- SETFONTDEFAULT(font_serif, "Dutch801 Rm BT");
- //SETFONTDEFAULT(font_mono, "Monospac821 BT");
- SETFONTDEFAULT(font_mono, "Courier10 BT");
- SETFONTDEFAULT(font_cursive, "Swis721 BT");
- SETFONTDEFAULT(font_fantasy, "Swis721 BT");
-#endif
#endif
nsbeos_options_init();
@@ -663,21 +587,6 @@ void gui_init(int argc, char** argv)
if (!replicated)
be_app->Unlock();
-#if 0 /* GTK */
- wndAbout = beos_WINDOW(glade_xml_get_widget(gladeWindows, "wndAbout"));
- beos_label_set_text(beos_LABEL(
- glade_xml_get_widget(gladeWindows, "labelVersion")),
- netsurf_version);
- beos_image_set_from_file(beos_IMAGE(
- glade_xml_get_widget(gladeWindows, "imageLogo")),
- find_resource(buf, "netsurf-logo.png", "netsurf-logo.png"));
- fontdesc = pango_font_description_from_string("Monospace 8");
- beos_widget_modify_font(beos_WIDGET(
- glade_xml_get_widget(gladeWindows, "textviewGPL")), fontdesc);
-
- wndWarning = beos_WINDOW(glade_xml_get_widget(gladeWindows, "wndWarning"));
- wndOpenFile = beos_DIALOG(glade_xml_get_widget(gladeWindows, "wndOpenFile"));
-#endif
}
@@ -803,57 +712,11 @@ void gui_quit(void)
}
-#if 0 /* GTK */
-static void nsbeos_select_menu_clicked(BCheckMenuItem *checkmenuitem,
- gpointer user_data)
-{
- form_select_process_selection(select_menu_bw->current_content,
- select_menu_control, (intptr_t)user_data);
-}
-#endif
void gui_create_form_select_menu(struct browser_window *bw,
struct form_control *control)
{
CALLED();
-#if 0 /* GTK */
-
- intptr_t i;
- struct form_option *option;
-
- beosWidget *menu_item;
-
- /* control->data.select.multiple is true if multiple selections
- * are allowable. We ignore this, as the core handles it for us.
- * Yay. \o/
- */
-
- if (select_menu != NULL)
- beos_widget_destroy(select_menu);
-
- select_menu = beos_menu_new();
- select_menu_bw = bw;
- select_menu_control = control;
-
- for (i = 0, option = control->data.select.items; option;
- i++, option = option->next) {
- menu_item = beos_check_menu_item_new_with_label(option->text);
- if (option->selected)
- beos_check_menu_item_set_active(
- beos_CHECK_MENU_ITEM(menu_item), TRUE);
-
- g_signal_connect(menu_item, "toggled",
- G_CALLBACK(nsbeos_select_menu_clicked), (gpointer)i);
-
- beos_menu_shell_append(beos_MENU_SHELL(select_menu), menu_item);
- }
-
- beos_widget_show_all(select_menu);
-
- beos_menu_popup(beos_MENU(select_menu), NULL, NULL, NULL,
- NULL /* data */, 0, beos_get_current_event_time());
-
-#endif
}
void
@@ -928,21 +791,6 @@ void nsbeos_gui_view_source(struct hlcache_handle *content, struct selection *se
BMessage m(B_REFS_RECEIVED);
m.AddRef("refs", &ref);
-#if 0
- if (selection && selection->defined) {
- int32 line = -1;
- if (content_get_type(content) == CONTENT_HTML) {
- // XXX: use selection, find line in source code
- }
- if (content_get_type(content) == CONTENT_TEXTPLAIN) {
- line = MAKELINE_FROM_IDX(start_idx);
- }
- // not CSS!
-
- if (line > -1)
- message.AddInt32("be:line", line);
- }
-#endif
// apps to try
const char *editorSigs[] = {
@@ -1011,16 +859,11 @@ void warn_user(const char *warning, const char *detail)
BString text(warning);
if (detail)
text << ":\n" << detail;
-#if 0
- alert = new BAlert("NetSurf Warning", text.String(), "Ok", NULL, NULL,
- B_WIDTH_AS_USUAL, B_WARNING_ALERT);
- alert->Go();
-#else
+
alert = new BAlert("NetSurf Warning", text.String(), "Debug", "Ok", NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
if (alert->Go() < 1)
debugger("warn_user");
-#endif
}
void die(const char * const error)
@@ -1029,16 +872,12 @@ void die(const char * const error)
BAlert *alert;
BString text("Cannot continue:\n");
text << error;
-#if 0
- alert = new BAlert("NetSurf Error", text.String(), "Ok", NULL, NULL,
- B_WIDTH_AS_USUAL, B_STOP_ALERT);
- alert->Go();
-#else
+
alert = new BAlert("NetSurf Error", text.String(), "Debug", "Ok", NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT);
if (alert->Go() < 1)
debugger("die");
-#endif
+
exit(EXIT_FAILURE);
}
@@ -1047,9 +886,6 @@ void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void *cbpw)
{
CALLED();
-#if 0 /* GTK */
- nsbeos_create_ssl_verify_window(bw, c, certs, num);
-#endif
}
static void nsbeos_create_ssl_verify_window(struct browser_window *bw,
@@ -1057,59 +893,8 @@ static void nsbeos_create_ssl_verify_window(struct browser_window *bw,
unsigned long num)
{
CALLED();
-#if 0 /* GTK */
- GladeXML *x = glade_xml_new(glade_file_location, NULL, NULL);
- beosWindow *wnd = beos_WINDOW(glade_xml_get_widget(x, "wndSSLProblem"));
- beosButton *accept, *reject;
- void **session = calloc(sizeof(void *), 4);
-
- session[0] = bw;
- session[1] = strdup(c->url);
- session[2] = x;
- session[3] = wnd;
-
- accept = beos_BUTTON(glade_xml_get_widget(x, "sslaccept"));
- reject = beos_BUTTON(glade_xml_get_widget(x, "sslreject"));
-
- g_signal_connect(G_OBJECT(accept), "clicked",
- G_CALLBACK(nsbeos_ssl_accept), (gpointer)session);
- g_signal_connect(G_OBJECT(reject), "clicked",
- G_CALLBACK(nsbeos_ssl_reject), (gpointer)session);
-
- beos_widget_show(beos_WIDGET(wnd));
-#endif
}
-#if 0 /* GTK */
-static void nsbeos_ssl_accept(beosButton *w, gpointer data)
-{
- void **session = data;
- struct browser_window *bw = session[0];
- char *url = session[1];
- GladeXML *x = session[2];
- beosWindow *wnd = session[3];
-
- urldb_set_cert_permissions(url, true);
- browser_window_navigate(bw, url, 0, true);
-
- beos_widget_destroy(beos_WIDGET(wnd));
- g_object_unref(G_OBJECT(x));
- free(url);
- free(session);
-}
-
-static void nsbeos_ssl_reject(beosButton *w, gpointer data)
-{
- void **session = data;
- GladeXML *x = session[2];
- beosWindow *wnd = session[3];
-
- beos_widget_destroy(beos_WIDGET(wnd));
- g_object_unref(G_OBJECT(x));
- free(session[1]);
- free(session);
-}
-#endif
utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
char **result)
diff --git a/beos/gui.h b/beos/gui.h
index af35677f1..6f158ca2f 100644
--- a/beos/gui.h
+++ b/beos/gui.h
@@ -33,10 +33,6 @@ extern bool replicated;
int gui_init_replicant(int argc, char** argv);
-#if 0 /* GTK */
-//extern GladeXML *gladeWindows;
-//extern char *glade_file_location;
-#endif
extern char *options_file_location;
class NSBrowserApplication : public BApplication {
@@ -58,9 +54,6 @@ extern void schedule_run(void);
extern BWindow *wndAbout;
extern BWindow *wndTooltip;
-#if 0 /* GTK */
-//extern GtkLabel *labelTooltip;
-#endif
extern BFilePanel *wndOpenFile;
diff --git a/beos/gui_options.h b/beos/gui_options.h
index 38aaf866a..e5c91a797 100644
--- a/beos/gui_options.h
+++ b/beos/gui_options.h
@@ -22,9 +22,6 @@
#include <Window.h>
-#if 0 /* GTK */
-extern GtkWindow *wndPreferences;
-#endif
extern BWindow *wndPreferences;
void nsbeos_options_init(void); /** Init options and load window */
diff --git a/beos/plotters.cpp b/beos/plotters.cpp
index 186627783..aabf30200 100644
--- a/beos/plotters.cpp
+++ b/beos/plotters.cpp
@@ -47,15 +47,6 @@ extern "C" {
#warning MAKE ME static
/*static*/ BView *current_view;
-#if 0 /* GTK */
-GtkWidget *current_widget;
-GdkDrawable *current_drawable;
-GdkGC *current_gc;
-#ifdef CAIRO_VERSION
-cairo_t *current_cr;
-#endif
-#endif
-
/*
* NOTE: BeOS rects differ from NetSurf ones:
* the right-bottom pixel is actually part of the BRect!
@@ -76,9 +67,6 @@ static bool nsbeos_plot_bitmap(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bitmap_flags_t flags);
-#if 0 /* GTK */
-static GdkRectangle cliprect;
-#endif
#warning make patterns nicer
static const pattern kDottedPattern = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa };
@@ -151,20 +139,6 @@ bool nsbeos_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *s
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
- nsbeos_set_colour(style->fill_colour);
- nsbeos_set_solid();
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo)) {
- cairo_set_line_width(current_cr, 0);
- cairo_rectangle(current_cr, x0, y0, x1 - x0, y1 - y0);
- cairo_fill(current_cr);
- cairo_stroke(current_cr);
- } else
-#endif
- gdk_draw_rectangle(current_drawable, current_gc,
- TRUE, x0, y0, x1 - x0, y1 - y0);
-#endif
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
@@ -204,21 +178,6 @@ bool nsbeos_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *s
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo)) {
- if (line_width == 0)
- line_width = 1;
-
- cairo_set_line_width(current_cr, line_width);
- cairo_rectangle(current_cr, x0, y0, width, height);
- cairo_stroke(current_cr);
- } else
-#endif
- gdk_draw_rectangle(current_drawable, current_gc,
- FALSE, x0, y0, width, height);
- return true;
-#endif
}
return true;
@@ -265,21 +224,6 @@ bool nsbeos_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo)) {
- if (width == 0)
- width = 1;
-
- cairo_set_line_width(current_cr, width);
- cairo_move_to(current_cr, x0, y0 - 0.5);
- cairo_line_to(current_cr, x1, y1 - 0.5);
- cairo_stroke(current_cr);
- } else
-#endif
- gdk_draw_line(current_drawable, current_gc,
- x0, y0, x1, y1);
-#endif
return true;
}
@@ -335,21 +279,6 @@ bool nsbeos_plot_clip(const struct rect *ns_clip)
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo)) {
- cairo_reset_clip(current_cr);
- cairo_rectangle(current_cr, clip->x0, clip->y0,
- clip->x1 - clip->x0, clip->y1 - clip->y0);
- cairo_clip(current_cr);
- }
-#endif
- cliprect.x = clip->x0;
- cliprect.y = clip->y0;
- cliprect.width = clip->x1 - clip->x0;
- cliprect.height = clip->y1 - clip->y0;
- gdk_gc_set_clip_rectangle(current_gc, &cliprect);
-#endif
return true;
}
@@ -381,31 +310,6 @@ bool nsbeos_plot_disc(int x, int y, int radius, const plot_style_t *style)
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
- nsbeos_set_colour(c);
- nsbeos_set_solid();
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo)) {
- if (filled)
- cairo_set_line_width(current_cr, 0);
- else
- 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,
- radius * 2, radius * 2,
- 0,
- 360 * 64);
-
-#endif
return true;
}
@@ -428,24 +332,6 @@ bool nsbeos_plot_arc(int x, int y, int radius, int angle1, int angle2, const plo
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
- nsbeos_set_colour(style->fill_colour);
- nsbeos_set_solid();
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo)) {
- cairo_set_line_width(current_cr, 1);
- cairo_arc(current_cr, x, y, radius,
- (angle1 + 90) * (M_PI / 180),
- (angle2 + 90) * (M_PI / 180));
- cairo_stroke(current_cr);
- } else
-#endif
- gdk_draw_arc(current_drawable, current_gc,
- FALSE, x - (radius), y - radius,
- radius * 2, radius * 2,
- angle1 * 64, angle2 * 64);
-
-#endif
return true;
}
@@ -495,43 +381,6 @@ static bool nsbeos_plot_bbitmap(int x, int y, int width, int height,
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
- /* XXX: This currently ignores the background colour supplied.
- * Does this matter?
- */
-
- 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,
- pixbuf,
- 0, 0,
- x, y,
- width, height,
- GDK_RGB_DITHER_MAX, 0, 0);
-
- } else {
- GdkPixbuf *scaled;
- scaled = gdk_pixbuf_scale_simple(pixbuf,
- width, height,
- nsoption_bool(render_resample) ? GDK_INTERP_BILINEAR
- : GDK_INTERP_NEAREST);
- if (!scaled)
- return false;
-
- gdk_draw_pixbuf(current_drawable, current_gc,
- scaled,
- 0, 0,
- x, y,
- width, height,
- GDK_RGB_DITHER_MAX, 0, 0);
-
- g_object_unref(scaled);
- }
-
-#endif
return true;
}
@@ -605,51 +454,6 @@ bool nsbeos_plot_bitmap(int x, int y, int width, int height,
}
#warning WRITEME
-#if 0 /* GTK */
- int doneheight = 0, donewidth = 0;
- GdkPixbuf *primary;
- GdkPixbuf *pretiled;
-
- if (!(repeat_x || repeat_y)) {
- /* Not repeating at all, so just pass it on */
- return nsbeos_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)
- pretiled = gtk_bitmap_get_pretile_xy(bitmap);
- if (!repeat_x && repeat_y)
- pretiled = gtk_bitmap_get_pretile_y(bitmap);
- primary = gtk_bitmap_get_primary(bitmap);
- /* use the primary and pretiled widths to scale the w/h provided */
- width *= gdk_pixbuf_get_width(pretiled);
- width /= gdk_pixbuf_get_width(primary);
- height *= gdk_pixbuf_get_height(pretiled);
- height /= gdk_pixbuf_get_height(primary);
-
- 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);
- else
- donewidth = x;
- while (donewidth < (cliprect.x + cliprect.width)) {
- nsbeos_plot_pixbuf(donewidth, doneheight,
- width, height, pretiled, bg);
- donewidth += width;
- if (!repeat_x) break;
- }
- doneheight += height;
- if (!repeat_y) break;
- }
-
-
-#endif
return true;
}
@@ -755,28 +559,6 @@ void nsbeos_set_colour(colour c)
rgb_color color = nsbeos_rgb_colour(c);
BView *view = nsbeos_current_gc();
view->SetHighColor(color);
-#if 0 /* GTK */
- int r, g, b;
- GdkColor colour;
-
- r = c & 0xff;
- g = (c & 0xff00) >> 8;
- b = (c & 0xff0000) >> 16;
-
- colour.red = r | (r << 8);
- colour.green = g | (g << 8);
- colour.blue = b | (b << 8);
- colour.pixel = (r << 16) | (g << 8) | b;
-
- gdk_color_alloc(gdk_colormap_get_system(),
- &colour);
- gdk_gc_set_foreground(current_gc, &colour);
-#ifdef CAIRO_VERSION
- if (nsoption_bool(render_cairo))
- cairo_set_source_rgba(current_cr, r / 255.0,
- g / 255.0, b / 255.0, 1.0);
-#endif
-#endif
}
/** Plot a caret. It is assumed that the plotters have been set up. */
@@ -800,21 +582,6 @@ void nsbeos_plot_caret(int x, int y, int h)
//nsbeos_current_gc_unlock();
-#if 0 /* GTK */
- GdkColor colour;
-
- colour.red = 0;
- colour.green = 0;
- colour.blue = 0;
- colour.pixel = 0;
- 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);
-#endif
}
#ifdef TEST_PLOTTERS
diff --git a/beos/plotters.h b/beos/plotters.h
index 15b97a89e..523f3c7c6 100644
--- a/beos/plotters.h
+++ b/beos/plotters.h
@@ -35,14 +35,6 @@ extern const struct plotter_table nsbeos_plotters;
#include <View.h>
extern BView *current_view;
-#if 0 /* GTK */
-extern GtkWidget *current_widget;
-extern GdkDrawable *current_drawable;
-extern GdkGC *current_gc;
-#ifdef CAIRO_VERSION
-extern cairo_t *current_cr;
-#endif
-#endif
extern BView *nsbeos_current_gc(void);
extern BView *nsbeos_current_gc_lock(void);
diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp
index bdda729dd..da83d5898 100644
--- a/beos/scaffolding.cpp
+++ b/beos/scaffolding.cpp
@@ -112,19 +112,7 @@ struct beos_scaffolding {
BStringView *status_bar;
BScrollView *scroll_view;
-#warning XXX
-#if 0 /* GTK */
- GtkEntryCompletion *url_bar_completion;
- GtkMenuBar *menu_bar;
- GtkMenuItem *back_menu;
- GtkMenuItem *forward_menu;
- GtkMenuItem *stop_menu;
- GtkMenuItem *reload_menu;
-
- GladeXML *popup_xml;
- GtkMenu *popup_menu;
-#endif
struct beos_history_window *history_window;
int throb_frame;
@@ -138,20 +126,10 @@ struct beos_history_window {
struct beos_scaffolding *g;
BWindow *window;
-#warning XXX
-#if 0 /* GTK */
- GtkWindow *window;
- GtkScrolledWindow *scrolled;
- GtkDrawingArea *drawing_area;
-#endif
};
struct menu_events {
const char *widget;
-#warning XXX
-#if 0 /* GTK */
- GCallback handler;
-#endif
};
// passed to the replicant main thread
@@ -177,116 +155,6 @@ extern int main(int argc, char** argv);
// in fetch_rsrc.cpp
extern BResources *gAppResources;
-
-#warning XXX
-#if 0 /* GTK */
-static gboolean nsbeos_window_url_activate_event(beosWidget *, gpointer);
-static gboolean nsbeos_window_url_changed(beosWidget *, GdkEventKey *, gpointer);
-
-static gboolean nsbeos_history_expose_event(beosWidget *, GdkEventExpose *,
- gpointer);
-static gboolean nsbeos_history_button_press_event(beosWidget *, GdkEventButton *,
- gpointer);
-
-static void nsbeos_attach_menu_handlers(GladeXML *, gpointer);
-
-gboolean nsbeos_openfile_open(beosWidget *widget, gpointer data);
-
-#define MENUEVENT(x) { #x, G_CALLBACK(nsbeos_on_##x##_activate) }
-#define MENUPROTO(x) static gboolean nsbeos_on_##x##_activate( \
- beosMenuItem *widget, gpointer g)
-/* prototypes for menu handlers */
-/* file menu */
-MENUPROTO(new_window);
-MENUPROTO(open_location);
-MENUPROTO(open_file);
-MENUPROTO(close_window);
-MENUPROTO(quit);
-
-/* edit menu */
-MENUPROTO(preferences);
-
-/* view menu */
-MENUPROTO(stop);
-MENUPROTO(reload);
-MENUPROTO(zoom_in);
-MENUPROTO(normal_size);
-MENUPROTO(zoom_out);
-MENUPROTO(full_screen);
-MENUPROTO(menu_bar);
-MENUPROTO(tool_bar);
-MENUPROTO(status_bar);
-MENUPROTO(downloads);
-MENUPROTO(save_window_size);
-MENUPROTO(toggle_debug_rendering);
-MENUPROTO(save_box_tree);
-
-/* navigate menu */
-MENUPROTO(back);
-MENUPROTO(forward);
-MENUPROTO(home);
-MENUPROTO(local_history);
-MENUPROTO(global_history);
-
-/* help menu */
-MENUPROTO(about);
-
-/* structure used by nsbeos_attach_menu_handlers to connect menu items to
- * their handling functions.
- */
-static struct menu_events menu_events[] = {
- /* file menu */
- MENUEVENT(new_window),
- MENUEVENT(open_location),
- MENUEVENT(open_file),
- MENUEVENT(close_window),
- MENUEVENT(quit),
-
- /* edit menu */
- MENUEVENT(preferences),
-
- /* view menu */
- MENUEVENT(stop),
- MENUEVENT(reload),
- MENUEVENT(zoom_in),
- MENUEVENT(normal_size),
- MENUEVENT(zoom_out),
- MENUEVENT(full_screen),
- MENUEVENT(menu_bar),
- MENUEVENT(tool_bar),
- MENUEVENT(status_bar),
- MENUEVENT(downloads),
- MENUEVENT(save_window_size),
- MENUEVENT(toggle_debug_rendering),
- MENUEVENT(save_box_tree),
-
- /* navigate menu */
- MENUEVENT(back),
- MENUEVENT(forward),
- MENUEVENT(home),
- MENUEVENT(local_history),
- MENUEVENT(global_history),
-
- /* help menu */
- MENUEVENT(about),
-
- /* sentinel */
- { NULL, NULL }
-};
-
-void nsbeos_attach_menu_handlers(GladeXML *xml, gpointer g)
-{
- struct menu_events *event = menu_events;
-
- while (event->widget != NULL)
- {
- beosWidget *w = glade_xml_get_widget(xml, event->widget);
- g_signal_connect(G_OBJECT(w), "activate", event->handler, g);
- event++;
- }
-}
-#endif
-
// #pragma mark - class NSThrobber
class NSThrobber : public BView {
@@ -1179,26 +1047,6 @@ void nsbeos_window_update_back_forward(struct beos_scaffolding *g)
g->top_view->UnlockLooper();
-#warning XXX
-#if 0 /* GTK */
- beos_widget_set_sensitive(beos_WIDGET(g->back_button),
- history_back_available(bw->history));
- beos_widget_set_sensitive(beos_WIDGET(g->forward_button),
- history_forward_available(bw->history));
-
- beos_widget_set_sensitive(beos_WIDGET(g->back_menu),
- history_back_available(bw->history));
- beos_widget_set_sensitive(beos_WIDGET(g->forward_menu),
- history_forward_available(bw->history));
-
- /* update the local history window, as well as queuing a redraw
- * for it.
- */
- history_size(bw->history, &width, &height);
- beos_widget_set_size_request(beos_WIDGET(g->history_window->drawing_area),
- width, height);
- beos_widget_queue_draw(beos_WIDGET(g->history_window->drawing_area));
-#endif
}
void nsbeos_throb(void *p)
@@ -1213,10 +1061,6 @@ void nsbeos_throb(void *p)
if (!g->top_view->LockLooper())
return;
-#if 0
- g->throbber->SetViewBitmap(nsbeos_throbber->framedata[g->throb_frame],
- B_FOLLOW_RIGHT | B_FOLLOW_TOP);
-#endif
g->throbber->SetBitmap(nsbeos_throbber->framedata[g->throb_frame]);
g->throbber->Invalidate();
@@ -1226,360 +1070,6 @@ void nsbeos_throb(void *p)
}
-#warning XXX
-#if 0 /* GTK */
-
-gboolean nsbeos_openfile_open(beosWidget *widget, gpointer data)
-{
- struct browser_window *bw = nsbeos_get_browser_for_gui(
- current_model->top_level);
- char *filename = beos_file_chooser_get_filename(
- beos_FILE_CHOOSER(wndOpenFile));
- char *url = malloc(strlen(filename) + sizeof("file://"));
-
- sprintf(url, "file://%s", filename);
-
- browser_window_navigate(bw, url, 0, true);
-
- g_free(filename);
- free(url);
-
- return TRUE;
-}
-#endif
-
-#warning XXX
-#if 0 /* GTK */
-/* signal handlers for menu entries */
-#define MENUHANDLER(x) gboolean nsbeos_on_##x##_activate(beosMenuItem *widget, \
- gpointer g)
-
-MENUHANDLER(new_window)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
- struct browser_window *bw = nsbeos_get_browser_for_gui(gw->top_level);
- const char *url = beos_entry_get_text(beos_ENTRY(gw->url_bar));
-
- browser_window_create(url, bw, NULL, false);
-
- return TRUE;
-}
-
-MENUHANDLER(open_location)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- beos_widget_grab_focus(beos_WIDGET(gw->url_bar));
-
- return TRUE;
-}
-
-MENUHANDLER(open_file)
-{
- current_model = (struct beos_scaffolding *)g;
- beos_dialog_run(wndOpenFile);
-
- return TRUE;
-}
-
-MENUHANDLER(close_window)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- beos_widget_destroy(beos_WIDGET(gw->window));
-
- return TRUE;
-}
-
-MENUHANDLER(quit)
-{
- netsurf_quit = true;
- return TRUE;
-}
-
-MENUHANDLER(preferences)
-{
- beos_widget_show(beos_WIDGET(wndPreferences));
-
- return TRUE;
-}
-
-MENUHANDLER(zoom_in)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
- struct browser_window *bw = nsbeos_get_browser_for_gui(gw->top_level);
- float old_scale = nsbeos_get_scale_for_gui(gw->top_level);
-
- browser_window_set_scale(bw, old_scale + 0.05, true);
-
- return TRUE;
-}
-
-MENUHANDLER(normal_size)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
- struct browser_window *bw = nsbeos_get_browser_for_gui(gw->top_level);
-
- browser_window_set_scale(bw, 1.0, true);
-
- return TRUE;
-}
-
-MENUHANDLER(zoom_out)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
- struct browser_window *bw = nsbeos_get_browser_for_gui(gw->top_level);
- float old_scale = nsbeos_get_scale_for_gui(gw->top_level);
-
- browser_window_set_scale(bw, old_scale - 0.05, true);
-
- return TRUE;
-}
-
-MENUHANDLER(full_screen)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- if (gw->fullscreen) {
- beos_window_unfullscreen(gw->window);
- } else {
- beos_window_fullscreen(gw->window);
- }
-
- gw->fullscreen = !gw->fullscreen;
-
- return TRUE;
-}
-
-MENUHANDLER(menu_bar)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- if (beos_check_menu_item_get_active(beos_CHECK_MENU_ITEM(widget))) {
- beos_widget_show(beos_WIDGET(gw->menu_bar));
- } else {
- beos_widget_hide(beos_WIDGET(gw->menu_bar));
- }
-
- return TRUE;
-}
-
-MENUHANDLER(tool_bar)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- if (beos_check_menu_item_get_active(beos_CHECK_MENU_ITEM(widget))) {
- beos_widget_show(beos_WIDGET(gw->tool_bar));
- } else {
- beos_widget_hide(beos_WIDGET(gw->tool_bar));
- }
-
- return TRUE;
-}
-
-MENUHANDLER(status_bar)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- if (beos_check_menu_item_get_active(beos_CHECK_MENU_ITEM(widget))) {
- beos_widget_show(beos_WIDGET(gw->status_bar));
- } else {
- beos_widget_hide(beos_WIDGET(gw->status_bar));
- }
-
- return TRUE;
-}
-
-MENUHANDLER(downloads)
-{
- nsbeos_download_show();
-
- return TRUE;
-}
-
-MENUHANDLER(save_window_size)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
- int x,y,w,h;
-
- nsoption_set_int(toolbar_status_width,
- beos_paned_get_position(gw->status_pane));
- beos_window_get_position(gw->window, &x, &y);
- beos_window_get_size(gw->window, &w, &h);
-
- nsoption_set_int(window_x, x);
- nsoption_set_int(window_y, y);
- nsoption_set_int(window_width, w);
- nsoption_set_int(window_height, h);
-
- nsoption_write(options_file_location);
-
- return TRUE;
-}
-
-MENUHANDLER(toggle_debug_rendering)
-{
- html_redraw_debug = !html_redraw_debug;
- nsbeos_reflow_all_windows();
- return TRUE;
-}
-
-MENUHANDLER(save_box_tree)
-{
- beosWidget *save_dialog;
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- save_dialog = beos_file_chooser_dialog_new("Save File", gw->window,
- beos_FILE_CHOOSER_ACTION_SAVE,
- beos_STOCK_CANCEL, beos_RESPONSE_CANCEL,
- beos_STOCK_SAVE, beos_RESPONSE_ACCEPT,
- NULL);
-
- beos_file_chooser_set_current_folder(beos_FILE_CHOOSER(save_dialog),
- getenv("HOME") ? getenv("HOME") : "/");
-
- beos_file_chooser_set_current_name(beos_FILE_CHOOSER(save_dialog),
- "boxtree.txt");
-
- if (beos_dialog_run(beos_DIALOG(save_dialog)) == beos_RESPONSE_ACCEPT) {
- char *filename = beos_file_chooser_get_filename(
- beos_FILE_CHOOSER(save_dialog));
- FILE *fh;
- LOG(("Saving box tree dump to %s...\n", filename));
-
- fh = fopen(filename, "w");
- if (fh == NULL) {
- warn_user("Error saving box tree dump.",
- "Unable to open file for writing.");
- } else {
- struct browser_window *bw;
- bw = nsbeos_get_browser_window(gw->top_level);
-
- browser_window_debug_dump(bw, f);
-
- fclose(fh);
- }
-
- g_free(filename);
- }
-
- beos_widget_destroy(save_dialog);
-}
-
-MENUHANDLER(stop)
-{
- return nsbeos_window_stop_button_clicked(beos_WIDGET(widget), g);
-}
-
-MENUHANDLER(reload)
-{
- return nsbeos_window_reload_button_clicked(beos_WIDGET(widget), g);
-}
-
-MENUHANDLER(back)
-{
- return nsbeos_window_back_button_clicked(beos_WIDGET(widget), g);
-}
-
-MENUHANDLER(forward)
-{
- return nsbeos_window_forward_button_clicked(beos_WIDGET(widget), g);
-}
-
-MENUHANDLER(home)
-{
- return nsbeos_window_home_button_clicked(beos_WIDGET(widget), g);
-}
-
-MENUHANDLER(local_history)
-{
- struct beos_scaffolding *gw = (struct beos_scaffolding *)g;
-
- beos_widget_show(beos_WIDGET(gw->history_window->window));
- gdk_window_raise(beos_WIDGET(gw->history_window->window)->window);
-
- return TRUE;
-}
-
-MENUHANDLER(global_history)
-{
- beos_widget_show(beos_WIDGET(wndHistory));
- gdk_window_raise(beos_WIDGET(wndHistory)->window);
-
- return TRUE;
-}
-
-MENUHANDLER(about)
-{
- beos_widget_show(beos_WIDGET(wndAbout));
- gdk_window_raise(beos_WIDGET(wndAbout)->window);
- return TRUE;
-}
-
-/* signal handler functions for the local history window */
-gboolean nsbeos_history_expose_event(beosWidget *widget,
- GdkEventExpose *event, gpointer g)
-{
- struct beos_history_window *hw = (struct beos_history_window *)g;
- struct browser_window *bw = nsbeos_get_browser_for_gui(hw->g->top_level);
-
- struct redraw_context ctx = {
- .interactive = true,
- .background_images = true,
- .plot = &nsbeos_plotters
- };
-
- current_widget = widget;
- current_drawable = widget->window;
- current_gc = gdk_gc_new(current_drawable);
-#ifdef CAIRO_VERSION
- current_cr = gdk_cairo_create(current_drawable);
-#endif
- plot = nsbeos_plotters;
-
- history_redraw(bw->history, &ctx);
-
- g_object_unref(current_gc);
-#ifdef CAIRO_VERSION
- cairo_destroy(current_cr);
-#endif
- return FALSE;
-}
-
-gboolean nsbeos_history_button_press_event(beosWidget *widget,
- GdkEventButton *event, gpointer g)
-{
- struct beos_history_window *hw = (struct beos_history_window *)g;
- struct browser_window *bw = nsbeos_get_browser_for_gui(hw->g->top_level);
-
- LOG(("X=%g, Y=%g", event->x, event->y));
-
- history_click(bw, bw->history,
- event->x, event->y, false);
-
- return TRUE;
-}
-
-#define GET_WIDGET(x) glade_xml_get_widget(g->xml, (x))
-
-static gboolean do_scroll_event(beosWidget *widget, GdkEvent *ev,
- gpointer data)
-{
- switch (((GdkEventScroll *)ev)->direction)
- {
- case GDK_SCROLL_UP:
- case GDK_SCROLL_DOWN:
- beos_widget_event(g_object_get_data(
- G_OBJECT(widget), "vScroll"), ev);
- break;
- default:
- beos_widget_event(g_object_get_data(
- G_OBJECT(widget), "hScroll"), ev);
- }
-
- return TRUE;
-}
-#endif
NSBrowserWindow *nsbeos_find_last_window(void)
{
@@ -1731,33 +1221,6 @@ void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
}
-#warning XXX
-#if 0 /* GTK */
- beosWidget *scrollbar;
-
- /* Insert the viewport into the right part of our table */
- beosTable *table = beos_TABLE(GET_WIDGET("centreTable"));
- LOG(("Attaching viewport to scaffolding %p", g));
- beos_table_attach_defaults(table, beos_WIDGET(vp), 0, 1, 0, 1);
-
- /* connect our scrollbars to the viewport */
- scrollbar = GET_WIDGET("coreScrollHorizontal");
- beos_viewport_set_hadjustment(vp,
- beos_range_get_adjustment(beos_RANGE(scrollbar)));
- g_object_set_data(G_OBJECT(vp), "hScroll", scrollbar);
- scrollbar = GET_WIDGET("coreScrollVertical");
- beos_viewport_set_vadjustment(vp,
- beos_range_get_adjustment(beos_RANGE(scrollbar)));
- g_object_set_data(G_OBJECT(vp), "vScroll", scrollbar);
- g_signal_connect(G_OBJECT(vp), "scroll_event",
- G_CALLBACK(do_scroll_event), NULL);
-
- gdk_window_set_accept_focus (beos_WIDGET(vp)->window, TRUE);
-
- /* And set the size-request to zero to cause it to get its act together */
- beos_widget_set_size_request(beos_WIDGET(vp), 0, 0);
-
-#endif
}
static BMenuItem *make_menu_item(const char *name, BMessage *message)
@@ -2374,157 +1837,6 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
replicant_view = NULL;
-#warning XXX
-#if 0 /* GTK */
- /* load the window template from the glade xml file, and extract
- * widget references from it for later use.
- */
- g->xml = glade_xml_new(glade_file_location, "wndBrowser", NULL);
- glade_xml_signal_autoconnect(g->xml);
- g->window = beos_WINDOW(GET_WIDGET("wndBrowser"));
- g->url_bar = beos_ENTRY(GET_WIDGET("URLBar"));
- g->menu_bar = beos_MENU_BAR(GET_WIDGET("menubar"));
- g->status_bar = beos_LABEL(GET_WIDGET("statusBar"));
- g->tool_bar = beos_TOOLBAR(GET_WIDGET("toolbar"));
- g->back_button = beos_TOOL_BUTTON(GET_WIDGET("toolBack"));
- g->forward_button = beos_TOOL_BUTTON(GET_WIDGET("toolForward"));
- g->stop_button = beos_TOOL_BUTTON(GET_WIDGET("toolStop"));
- g->reload_button = beos_TOOL_BUTTON(GET_WIDGET("toolReload"));
- g->back_menu = beos_MENU_ITEM(GET_WIDGET("back"));
- g->forward_menu = beos_MENU_ITEM(GET_WIDGET("forward"));
- g->stop_menu = beos_MENU_ITEM(GET_WIDGET("stop"));
- g->reload_menu = beos_MENU_ITEM(GET_WIDGET("reload"));
- g->throbber = beos_IMAGE(GET_WIDGET("throbber"));
- g->status_pane = beos_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.
- */
- if (nsoption_int(window_width) > 0) {
- beos_window_move(g->window, nsoption_int(window_x), nsoption_int(window_y));
- beos_window_resize(g->window, nsoption_int(window_width),
- nsoption_int(window_height));
- } else {
- beos_window_set_default_size(g->window, 600, 600);
- }
-
- /* set the size of the hpane with status bar and h scrollbar */
- beos_paned_set_position(g->status_pane, nsoption_int(toolbar_status_width));
-
- /* set the URL entry box to expand, as we can't do this from within
- * glade because of the way it emulates toolbars.
- */
- beos_tool_item_set_expand(beos_TOOL_ITEM(GET_WIDGET("toolURLBar")), TRUE);
-
- /* disable toolbar buttons that make no sense initially. */
- beos_widget_set_sensitive(beos_WIDGET(g->back_button), FALSE);
- beos_widget_set_sensitive(beos_WIDGET(g->forward_button), FALSE);
- beos_widget_set_sensitive(beos_WIDGET(g->stop_button), FALSE);
-
- /* create the local history window to be assoicated with this browser */
- g->history_window = malloc(sizeof(struct beos_history_window));
- g->history_window->g = g;
- g->history_window->window = beos_WINDOW(
- beos_window_new(beos_WINDOW_TOPLEVEL));
- beos_window_set_transient_for(g->history_window->window, g->window);
- beos_window_set_default_size(g->history_window->window, 400, 400);
- beos_window_set_title(g->history_window->window, "NetSurf History");
- beos_window_set_type_hint(g->history_window->window,
- GDK_WINDOW_TYPE_HINT_UTILITY);
- g->history_window->scrolled = beos_SCROLLED_WINDOW(
- beos_scrolled_window_new(0, 0));
- beos_container_add(beos_CONTAINER(g->history_window->window),
- beos_WIDGET(g->history_window->scrolled));
-
- beos_widget_show(beos_WIDGET(g->history_window->scrolled));
- g->history_window->drawing_area = beos_DRAWING_AREA(
- beos_drawing_area_new());
-
- beos_widget_set_events(beos_WIDGET(g->history_window->drawing_area),
- GDK_EXPOSURE_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK);
- beos_widget_modify_bg(beos_WIDGET(g->history_window->drawing_area),
- beos_STATE_NORMAL,
- &((GdkColor) { 0, 0xffff, 0xffff, 0xffff } ));
- beos_scrolled_window_add_with_viewport(g->history_window->scrolled,
- beos_WIDGET(g->history_window->drawing_area));
- beos_widget_show(beos_WIDGET(g->history_window->drawing_area));
-
- /* set up URL bar completion */
- g->url_bar_completion = beos_entry_completion_new();
- beos_entry_set_completion(g->url_bar, g->url_bar_completion);
- beos_entry_completion_set_match_func(g->url_bar_completion,
- nsbeos_completion_match, NULL, NULL);
- beos_entry_completion_set_model(g->url_bar_completion,
- beos_TREE_MODEL(nsbeos_completion_list));
- beos_entry_completion_set_text_column(g->url_bar_completion, 0);
- beos_entry_completion_set_minimum_key_length(g->url_bar_completion, 1);
- beos_entry_completion_set_popup_completion(g->url_bar_completion, TRUE);
- g_object_set(G_OBJECT(g->url_bar_completion),
- "popup-set-width", TRUE,
- "popup-single-match", TRUE,
- NULL);
-
- /* set up the throbber. */
- beos_image_set_from_pixbuf(g->throbber, nsbeos_throbber->framedata[0]);
- g->throb_frame = 0;
-
-#define CONNECT(obj, sig, 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",
- nsbeos_history_expose_event, g->history_window);
-// CONNECT(g->history_window->drawing_area, "motion_notify_event",
-// nsbeos_history_motion_notify_event, g->history_window);
- CONNECT(g->history_window->drawing_area, "button_press_event",
- nsbeos_history_button_press_event, g->history_window);
- CONNECT(g->history_window->window, "delete_event",
- beos_widget_hide_on_delete, NULL);
-
- /* connect signals to handlers. */
- CONNECT(g->window, "destroy", nsbeos_window_destroy_event, g);
-
- /* toolbar and URL bar signal handlers */
- CONNECT(g->back_button, "clicked", nsbeos_window_back_button_clicked, g);
- CONNECT(g->forward_button, "clicked",
- nsbeos_window_forward_button_clicked, g);
- CONNECT(g->stop_button, "clicked", nsbeos_window_stop_button_clicked, g);
- CONNECT(g->reload_button, "clicked",
- nsbeos_window_reload_button_clicked, g);
- CONNECT(GET_WIDGET("toolHome"), "clicked",
- nsbeos_window_home_button_clicked, g);
- CONNECT(g->url_bar, "activate", nsbeos_window_url_activate_event, g);
- CONNECT(g->url_bar, "changed", nsbeos_window_url_changed, g);
-
- /* set up the menu signal handlers */
- nsbeos_attach_menu_handlers(g->xml, g);
-
- g->being_destroyed = 0;
-
- g->fullscreen = false;
-
- /* create the popup version of the menu */
- g->popup_xml = glade_xml_new(glade_file_location, "menuPopup", NULL);
- g->popup_menu = beos_MENU(glade_xml_get_widget(g->popup_xml, "menuPopup"));
-
-#define POPUP_ATTACH(x, y) beos_menu_item_set_submenu( \
- beos_MENU_ITEM(glade_xml_get_widget(g->popup_xml, x)),\
- beos_WIDGET(glade_xml_get_widget(g->xml, y)))
-
- POPUP_ATTACH("menupopup_file", "menumain_file");
- POPUP_ATTACH("menupopup_edit", "menumain_edit");
- POPUP_ATTACH("menupopup_view", "menumain_view");
- POPUP_ATTACH("menupopup_navigate", "menumain_navigate");
- POPUP_ATTACH("menupopup_help", "menumain_help");
-
-#undef POPUP_ATTACH
-
- /* finally, show the window. */
- beos_widget_show(beos_WIDGET(g->window));
-
-#endif
return g;
}
@@ -2639,14 +1951,6 @@ void gui_window_set_search_ico(hlcache_handle *ico)
{
}
-#warning XXX
-#if 0 /* GTK */
-gboolean nsbeos_scaffolding_is_busy(nsbeos_scaffolding *scaffold)
-{
- /* We are considered "busy" if the stop button is sensitive */
- return beos_WIDGET_SENSITIVE((beos_WIDGET(scaffold->stop_button)));
-}
-#endif
void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where)
{
diff --git a/beos/scaffolding.h b/beos/scaffolding.h
index bd13230e7..7b7080322 100644
--- a/beos/scaffolding.h
+++ b/beos/scaffolding.h
@@ -187,9 +187,6 @@ bool nsbeos_scaffolding_is_busy(nsbeos_scaffolding *scaffold);
void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view);
-#if 0 /* GTK */
-void nsbeos_attach_toplevel_viewport(nsbeos_scaffolding *g, GtkViewport *vp);
-#endif
void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *message);
@@ -200,8 +197,5 @@ void nsbeos_scaffolding_destroy(nsbeos_scaffolding *scaffold);
void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where);
-#if 0 /* GTK */
-void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, guint button);
-#endif
#endif /* NETSURF_BEOS_SCAFFOLDING_H */
diff --git a/beos/window.cpp b/beos/window.cpp
index d187e333b..e2921bd23 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -86,20 +86,6 @@ struct gui_window {
//volatile BMessage *lastRedraw;
// UNUSED YET
BRect pendingRedraw;
-#if 0 /* GTK */
- /* Within GTK, a gui_window is a scrolled window
- * with a viewport inside
- * with a gtkfixed in that
- * with a drawing area in that
- * The scrolled window is optional and only chosen
- * for frames which need it. Otherwise we just use
- * a viewport.
- */
- GtkScrolledWindow *scrolledwindow;
- GtkViewport *viewport;
- GtkFixed *fixed;
- GtkDrawingArea *drawing_area;
-#endif
/* Keep gui_windows in a list for cleanup later */
struct gui_window *next, *prev;
@@ -122,9 +108,6 @@ static void nsbeos_window_moved_event(BView *view, gui_window *g, BMessage *even
/* Other useful bits */
static void nsbeos_redraw_caret(struct gui_window *g);
-#if 0 /* GTK */
-static GdkCursor *nsbeos_create_menu_cursor(void);
-#endif
// #pragma mark - class NSBrowserFrameView
@@ -269,18 +252,6 @@ NSBrowserFrameView::Draw(BRect updateRect)
}
-#if 0
-void
-NSBrowserFrameView::FrameMoved(BPoint new_location)
-{
- BMessage *message = Window()->DetachCurrentMessage();
- // discard any other pending resize,
- // so we don't end up processing them all, the last one matters.
- //atomic_add(&fGuiWindow->pending_resizes, 1);
- nsbeos_pipe_message(message, this, fGuiWindow);
- BView::FrameMoved(new_location);
-}
-#endif
void
NSBrowserFrameView::FrameResized(float new_width, float new_height)
@@ -430,78 +401,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Attach our viewport into the scaffold */
nsbeos_attach_toplevel_view(g->scaffold, g->view);
-#warning WRITEME
-#if 0 /* GTK */
- GtkPolicyType scrollpolicy;
-
- /* Construct our primary elements */
- g->fixed = GTK_FIXED(gtk_fixed_new());
- g->drawing_area = GTK_DRAWING_AREA(gtk_drawing_area_new());
- gtk_fixed_put(g->fixed, GTK_WIDGET(g->drawing_area), 0, 0);
- gtk_container_set_border_width(GTK_CONTAINER(g->fixed), 0);
-
- g->scrolledwindow = 0;
- g->viewport = GTK_VIEWPORT(gtk_viewport_new(NULL, NULL)); /* Need to attach adjustments */
- gtk_container_add(GTK_CONTAINER(g->viewport), GTK_WIDGET(g->fixed));
-
- /* Attach our viewport into the scaffold */
- nsbeos_attach_toplevel_viewport(g->scaffold, g->viewport);
-
- gtk_container_set_border_width(GTK_CONTAINER(g->viewport), 0);
- gtk_viewport_set_shadow_type(g->viewport, GTK_SHADOW_NONE);
- if (g->scrolledwindow)
- gtk_widget_show(GTK_WIDGET(g->scrolledwindow));
- /* And enable visibility from our viewport down */
- gtk_widget_show(GTK_WIDGET(g->viewport));
- gtk_widget_show(GTK_WIDGET(g->fixed));
- gtk_widget_show(GTK_WIDGET(g->drawing_area));
-
- switch(bw->scrolling) {
- case SCROLLING_NO:
- scrollpolicy = GTK_POLICY_NEVER;
- break;
- case SCROLLING_YES:
- scrollpolicy = GTK_POLICY_ALWAYS;
- break;
- case SCROLLING_AUTO:
- default:
- scrollpolicy = GTK_POLICY_AUTOMATIC;
- break;
- };
-
-
- if (g->scrolledwindow)
- gtk_scrolled_window_set_policy(g->scrolledwindow,
- scrollpolicy, scrollpolicy);
-
- /* set the events we're interested in receiving from the browser's
- * drawing area.
- */
- gtk_widget_add_events(GTK_WIDGET(g->drawing_area),
- GDK_EXPOSURE_MASK |
- GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_KEY_PRESS_MASK |
- GDK_KEY_RELEASE_MASK);
- GTK_WIDGET_SET_FLAGS(GTK_WIDGET(g->drawing_area), GTK_CAN_FOCUS);
-
- /* 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 } ));
-
-#define CONNECT(obj, sig, callback, ptr) \
- g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
- CONNECT(g->drawing_area, "expose_event", nsgtk_window_expose_event, g);
- CONNECT(g->drawing_area, "motion_notify_event",
- nsgtk_window_motion_notify_event, g);
- CONNECT(g->drawing_area, "button_press_event",
- nsgtk_window_button_press_event, g);
- CONNECT(g->drawing_area, "key_press_event",
- nsgtk_window_keypress_event, g);
- CONNECT(g->viewport, "size_allocate",
- nsgtk_window_size_allocate_event, g);
-#endif
return g;
}
@@ -973,108 +872,6 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
g->view->UnlockLooper();
}
-#warning WRITEME
-#if 0 /* GTK */
-gboolean nsbeos_window_keypress_event(GtkWidget *widget, GdkEventKey *event,
- gpointer data)
-{
- struct gui_window *g = data;
- uint32_t nskey = gdkkey_to_nskey(event);
-
- if (browser_window_key_press(g->bw, nskey))
- return TRUE;
-
- if (event->state == 0) {
- double value;
- GtkAdjustment *vscroll = gtk_viewport_get_vadjustment(g->viewport);
-
- GtkAdjustment *hscroll = gtk_viewport_get_hadjustment(g->viewport);
-
- GtkAdjustment *scroll;
-
- const GtkAllocation *const alloc =
- &GTK_WIDGET(g->viewport)->allocation;
-
- switch (event->keyval) {
- default:
- return TRUE;
-
- case GDK_Home:
- case GDK_KP_Home:
- scroll = vscroll;
- value = scroll->lower;
- break;
-
- case GDK_End:
- case GDK_KP_End:
- scroll = vscroll;
- value = scroll->upper - alloc->height;
- if (value < scroll->lower)
- value = scroll->lower;
- break;
-
- case GDK_Left:
- case GDK_KP_Left:
- scroll = hscroll;
- value = gtk_adjustment_get_value(scroll) -
- scroll->step_increment;
- if (value < scroll->lower)
- value = scroll->lower;
- break;
-
- case GDK_Up:
- case GDK_KP_Up:
- scroll = vscroll;
- value = gtk_adjustment_get_value(scroll) -
- scroll->step_increment;
- if (value < scroll->lower)
- value = scroll->lower;
- break;
-
- case GDK_Right:
- case GDK_KP_Right:
- scroll = hscroll;
- value = gtk_adjustment_get_value(scroll) +
- scroll->step_increment;
- if (value > scroll->upper - alloc->width)
- value = scroll->upper - alloc->width;
- break;
-
- case GDK_Down:
- case GDK_KP_Down:
- scroll = vscroll;
- value = gtk_adjustment_get_value(scroll) +
- scroll->step_increment;
- if (value > scroll->upper - alloc->height)
- value = scroll->upper - alloc->height;
- break;
-
- case GDK_Page_Up:
- case GDK_KP_Page_Up:
- scroll = vscroll;
- value = gtk_adjustment_get_value(scroll) -
- scroll->page_increment;
- if (value < scroll->lower)
- value = scroll->lower;
- break;
-
- case GDK_Page_Down:
- case GDK_KP_Page_Down:
- scroll = vscroll;
- value = gtk_adjustment_get_value(scroll) +
- scroll->page_increment;
- if (value > scroll->upper - alloc->height)
- value = scroll->upper - alloc->height;
- break;
- }
-
- gtk_adjustment_set_value(scroll, value);
- }
-
- return TRUE;
-}
-
-#endif
void nsbeos_window_resize_event(BView *view, gui_window *g, BMessage *event)
{
@@ -1083,10 +880,8 @@ void nsbeos_window_resize_event(BView *view, gui_window *g, BMessage *event)
int32 height;
// drop this event if we have at least 2 resize pending
-#if 1
if (atomic_add(&g->pending_resizes, -1) > 1)
return;
-#endif
if (event->FindInt32("width", &width) < B_OK)
width = -1;
@@ -1096,29 +891,6 @@ void nsbeos_window_resize_event(BView *view, gui_window *g, BMessage *event)
height++;
-#if 0
- hlcache_handle *content;
-
- content = g->bw->current_content;
-
- /* reformat or change extent if necessary */
- if ((content) && (g->old_width != width || g->old_height != height)) {
- /* Ctrl-resize of a top-level window scales the content size */
-#if 0
- if ((g->old_width > 0) && (g->old_width != width) && (!g->bw->parent) &&
- (ro_gui_ctrl_pressed()))
- new_scale = (g->bw->scale * width) / g->old_width;
-#endif
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
- }
- if (g->update_extent || g->old_width != width || g->old_height != height) {
- g->old_width = width;
- g->old_height = height;
- g->update_extent = false;
- gui_window_set_extent(g, width, height);
- }
-#endif
g->bw->reformat_pending = true;
browser_reformat_pending = true;
@@ -1178,19 +950,6 @@ void nsbeos_window_process_reformats(void)
bounds.Height() + 1);
}
-#warning WRITEME
-#if 0 /* GTK */
- for (g = window_list; g; g = g->next) {
- GtkWidget *widget = GTK_WIDGET(g->viewport);
- if (!g->bw->reformat_pending)
- continue;
- g->bw->reformat_pending = false;
- browser_window_reformat(g->bw,
- false,
- widget->allocation.width - 2,
- widget->allocation.height);
- }
-#endif
}
@@ -1238,17 +997,6 @@ void gui_window_destroy(struct gui_window *g)
//XXX
//looper->Unlock();
-#warning FIXME
-
-#if 0 /* GTK */
- /* If we're a top-level gui_window, destroy our scaffold */
- if (g->scrolledwindow == NULL) {
- gtk_widget_destroy(GTK_WIDGET(g->viewport));
- nsgtk_scaffolding_destroy(g->scaffold);
- } else {
- gtk_widget_destroy(GTK_WIDGET(g->scrolledwindow));
- }
-#endif
free(g);
@@ -1325,18 +1073,6 @@ bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
*sy = (int)g->view->ScrollBar(B_VERTICAL)->Value();
g->view->UnlockLooper();
-#warning WRITEME
-#if 0 /* GTK */
- GtkAdjustment *vadj = gtk_viewport_get_vadjustment(g->viewport);
- GtkAdjustment *hadj = gtk_viewport_get_hadjustment(g->viewport);
-
- assert(vadj);
- assert(hadj);
-
- *sy = (int)(gtk_adjustment_get_value(vadj));
- *sx = (int)(gtk_adjustment_get_value(hadj));
-
-#endif
return true;
}
@@ -1355,30 +1091,6 @@ void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
g->view->ScrollBar(B_VERTICAL)->SetValue(sy);
g->view->UnlockLooper();
-#warning WRITEME
-#if 0 /* GTK */
- GtkAdjustment *vadj = gtk_viewport_get_vadjustment(g->viewport);
- GtkAdjustment *hadj = gtk_viewport_get_hadjustment(g->viewport);
- gdouble vlower, vpage, vupper, hlower, hpage, hupper, x = (double)sx, y = (double)sy;
-
- assert(vadj);
- assert(hadj);
-
- g_object_get(vadj, "page-size", &vpage, "lower", &vlower, "upper", &vupper, NULL);
- g_object_get(hadj, "page-size", &hpage, "lower", &hlower, "upper", &hupper, NULL);
-
- if (x < hlower)
- x = hlower;
- if (x > (hupper - hpage))
- x = hupper - hpage;
- if (y < vlower)
- y = vlower;
- if (y > (vupper - vpage))
- y = vupper - vpage;
-
- gtk_adjustment_set_value(vadj, y);
- gtk_adjustment_set_value(hadj, x);
-#endif
}
@@ -1411,22 +1123,8 @@ void gui_window_update_extent(struct gui_window *g)
g->view->ScrollBar(B_VERTICAL)->SetSteps(10, 50);
}
-#if 0
- g->view->ResizeTo(
- g->bw->current_content->width * g->bw->scale /* - 1*/,
- g->bw->current_content->height * g->bw->scale /* - 1*/);
-#endif
g->view->UnlockLooper();
-
-#warning WRITEME
-#if 0 /* GTK */
- gtk_widget_set_size_request(GTK_WIDGET(g->drawing_area),
- g->bw->current_content->width * g->bw->scale,
- g->bw->current_content->height * g->bw->scale);
-
- gtk_widget_set_size_request(GTK_WIDGET(g->viewport), 0, 0);
-#endif
}
/* some cursors like those in Firefox */
@@ -1492,11 +1190,6 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
case GUI_POINTER_POINT:
cursor = new BCursor(kLinkCursorBits);
allocated = true;
-#if 0 // it's ugly anyway
-#ifdef B_ZETA_VERSION
- cursor = (BCursor *)B_CURSOR_LINK;
-#endif
-#endif
break;
case GUI_POINTER_CARET:
cursor = (BCursor *)B_CURSOR_I_BEAM;
@@ -1509,58 +1202,6 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
cursor = new BCursor(kWatch2CursorBits);
allocated = true;
break;
-#if 0 /* GTK */
- case GUI_POINTER_UP:
- cursortype = GDK_TOP_SIDE;
- break;
- case GUI_POINTER_DOWN:
- cursortype = GDK_BOTTOM_SIDE;
- break;
- case GUI_POINTER_LEFT:
- cursortype = GDK_LEFT_SIDE;
- break;
- case GUI_POINTER_RIGHT:
- cursortype = GDK_RIGHT_SIDE;
- break;
- case GUI_POINTER_LD:
- cursortype = GDK_BOTTOM_LEFT_CORNER;
- break;
- case GUI_POINTER_RD:
- cursortype = GDK_BOTTOM_RIGHT_CORNER;
- break;
- case GUI_POINTER_LU:
- cursortype = GDK_TOP_LEFT_CORNER;
- break;
- case GUI_POINTER_RU:
- cursortype = GDK_TOP_RIGHT_CORNER;
- break;
- case GUI_POINTER_CROSS:
- cursortype = GDK_CROSS;
- break;
- case GUI_POINTER_MOVE:
- cursortype = GDK_FLEUR;
- break;
- case GUI_POINTER_WAIT:
- cursortype = GDK_WATCH;
- break;
- case GUI_POINTER_HELP:
- cursortype = GDK_QUESTION_ARROW;
- break;
- case GUI_POINTER_MENU:
- cursor = nsbeos_create_menu_cursor();
- nullcursor = true;
- break;
- case GUI_POINTER_PROGRESS:
- /* In reality, this needs to be the funky left_ptr_watch
- * which we can't do easily yet.
- */
- cursortype = GDK_WATCH;
- break;
- /* The following we're not sure about */
- case GUI_POINTER_NO_DROP:
- case GUI_POINTER_NOT_ALLOWED:
- case GUI_POINTER_DEFAULT:
-#endif
default:
cursor = (BCursor *)B_CURSOR_SYSTEM_DEFAULT;
allocated = false;