aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjasper@unix.geek.nz <jasper@unix.geek.nz@767c508d-d83b-0410-8cff-fd39cd899a2f>2008-05-25 05:46:32 +0000
committerjasper@unix.geek.nz <jasper@unix.geek.nz@767c508d-d83b-0410-8cff-fd39cd899a2f>2008-05-25 05:46:32 +0000
commit318cb436e5a47d01afd1623425a6b7b18e54fff3 (patch)
treeaf48ee12e3eaae83047c1beb39e587b6b02b71e1
parent0f975bc96af12bb74af463d49c58e5004a53c917 (diff)
downloadjuniper-browser-318cb436e5a47d01afd1623425a6b7b18e54fff3.tar.gz
juniper-browser-318cb436e5a47d01afd1623425a6b7b18e54fff3.tar.bz2
juniper-browser-318cb436e5a47d01afd1623425a6b7b18e54fff3.zip
* remove broken juniper-view-source module, will be replaced shortly
with a gtksourceview 2.0 based one * reverse NO_WEBKIT_NAVIGATION_ACTION define to a WEBKIT_NAVIGATION_ACTION one, since most people won't have this code
-rwxr-xr-xbuild.sh5
-rw-r--r--src/juniper-events.c4
-rw-r--r--src/juniper-events.h2
-rw-r--r--src/juniper-tabs.c2
-rw-r--r--src/juniper-view-source.c60
-rw-r--r--src/juniper-view-source.h17
-rw-r--r--src/juniper.c1
7 files changed, 6 insertions, 85 deletions
diff --git a/build.sh b/build.sh
index 00522c6..60eaa59 100755
--- a/build.sh
+++ b/build.sh
@@ -3,7 +3,7 @@ set -e
COMMON="-pipe -Wall -pedantic -Werror $@"
-DEPENDENCIES="libglade-2.0 gtk+-2.0 gtksourceview-1.0 webkit-1.0 sqlite3"
+DEPENDENCIES="libglade-2.0 gtk+-2.0 webkit-1.0 sqlite3"
CFLAGS="$COMMON $(pkg-config --cflags $DEPENDENCIES)"
LDFLAGS="$COMMON -Wl,-E"
@@ -28,12 +28,11 @@ gcc $CFLAGS -c juniper-prefs.c -o ../juniper-prefs.o
gcc $CFLAGS -c juniper-tabs.c -o ../juniper-tabs.o
gcc $CFLAGS -c juniper-ui.c -o ../juniper-ui.o
gcc $CFLAGS -c juniper-util.c -o ../juniper-util.o
-gcc $CFLAGS -c juniper-view-source.c -o ../juniper-view-source.o
cd ..
# Build dynamically-linked Juniper executable
-gcc $LDFLAGS -o juniper juniper.o juniper-bookmarks.o juniper-db.o juniper-events.o juniper-extensions.o juniper-fs.o juniper-history.o juniper-prefs.o juniper-tabs.o juniper-ui.o juniper-util.o juniper-view-source.o $LIBS
+gcc $LDFLAGS -o juniper juniper.o juniper-bookmarks.o juniper-db.o juniper-events.o juniper-extensions.o juniper-fs.o juniper-history.o juniper-prefs.o juniper-tabs.o juniper-ui.o juniper-util.o $LIBS
rm -f *.o
diff --git a/src/juniper-events.c b/src/juniper-events.c
index d1912e1..dbe63a8 100644
--- a/src/juniper-events.c
+++ b/src/juniper-events.c
@@ -6,7 +6,7 @@
#include "gdk/gdkkeysyms.h"
#include "webkit/webkitwebframe.h"
-#ifndef NO_WEBKIT_NAVIGATION_ACTION
+#ifdef WEBKIT_NAVIGATION_ACTION
#include "webkit/webkitnavigationaction.h"
#endif
@@ -68,7 +68,7 @@ void juniper_events_current_tab_changed(GtkNotebook * tabs, GtkNotebookPage * no
juniper_ui_set_window_title(juniper_tabs_get_title(juniper_tabs_nth(page_num)));
}
-#ifndef NO_WEBKIT_NAVIGATION_ACTION
+#ifdef WEBKIT_NAVIGATION_ACTION
WebKitNavigationResponse juniper_events_navigation_requested(WebKitWebView * page, WebKitNavigationAction * action, WebKitWebFrame * frame, WebKitNetworkRequest * request, GtkVBox * tab)
{
gint button, modifier_flags, navigation_type;
diff --git a/src/juniper-events.h b/src/juniper-events.h
index 07fe61c..90070ae 100644
--- a/src/juniper-events.h
+++ b/src/juniper-events.h
@@ -12,7 +12,7 @@ void juniper_events_address_bar_changed(GtkEntry * address_bar);
void juniper_events_page_title_changed(WebKitWebView * page, WebKitWebFrame * frame, const gchar * page_title, GtkVBox * tab);
void juniper_events_current_tab_changed(GtkNotebook * tabs, GtkNotebookPage * notebook_page, guint page_num);
-#ifndef NO_WEBKIT_NAVIGATION_ACTION
+#ifdef WEBKIT_NAVIGATION_ACTION
WebKitNavigationResponse juniper_events_navigation_requested(WebKitWebView * page, WebKitNavigationAction * action, WebKitWebFrame * frame, WebKitNetworkRequest * request, GtkVBox * tab);
#endif
diff --git a/src/juniper-tabs.c b/src/juniper-tabs.c
index f1f92f8..a416b34 100644
--- a/src/juniper-tabs.c
+++ b/src/juniper-tabs.c
@@ -205,7 +205,7 @@ void juniper_tabs_add_with_location(const gchar * location)
gtk_notebook_set_current_page(tabs, gtk_notebook_append_page(tabs, GTK_WIDGET(vbox), GTK_WIDGET(label)));
/* connect signal handlers */
-#ifndef NO_WEBKIT_NAVIGATION_ACTION
+#ifdef WEBKIT_NAVIGATION_ACTION
g_signal_connect(page, "navigation-requested", G_CALLBACK(juniper_events_navigation_requested), vbox);
#endif
g_signal_connect(page, "load-committed", G_CALLBACK(juniper_events_page_load_started), vbox);
diff --git a/src/juniper-view-source.c b/src/juniper-view-source.c
deleted file mode 100644
index 54a1a48..0000000
--- a/src/juniper-view-source.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "juniper-view-source.h"
-
-#include "gtksourceview/gtksourcelanguagesmanager.h"
-#include "webkit/webkitwebview.h"
-#include "webkit/webkitwebframe.h"
-
-#include "juniper-tabs.h"
-#include "juniper-util.h"
-
-void juniper_view_source_current_tab()
-{
- GtkWindow *view_source_window;
- GtkVBox *vertical_box;
- GtkScrolledWindow *scrolled_window;
- GtkSourceLanguagesManager *languages_manager;
- GtkSourceBuffer *source_buffer;
- GtkSourceView *source_view;
- GtkStatusbar *status_bar;
- WebKitWebView *page;
-
- page = juniper_tabs_page_for_tab(juniper_tabs_current());
-
- view_source_window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
- gtk_window_set_title(view_source_window, "View Source");
- gtk_window_set_destroy_with_parent(view_source_window, TRUE);
-
- vertical_box = GTK_VBOX(gtk_vbox_new(FALSE,0));
-
- scrolled_window = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(NULL, NULL));
- gtk_scrolled_window_set_policy(scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
- status_bar = GTK_STATUSBAR(gtk_statusbar_new());
- gtk_statusbar_set_has_resize_grip(status_bar, TRUE);
- gtk_statusbar_push(GTK_STATUSBAR(status_bar), 0, "0, 0");
-
- languages_manager = gtk_source_languages_manager_new();
- source_buffer = GTK_SOURCE_BUFFER(gtk_source_buffer_new_with_language(gtk_source_languages_manager_get_language_from_mime_type(languages_manager, "text/html")));
-/* gtk_text_buffer_set_text(GTK_TEXT_BUFFER(source_buffer), webkit_web_frame_get_markup(webkit_web_view_get_main_frame(page)), -1); */
-
- source_view = GTK_SOURCE_VIEW(gtk_source_view_new_with_buffer(source_buffer));
- g_signal_connect(GTK_TEXT_BUFFER(source_buffer), "mark-set", G_CALLBACK(juniper_view_source_mark_set), status_bar);
-
- gtk_container_add(GTK_CONTAINER(view_source_window), GTK_WIDGET(vertical_box));
- gtk_box_pack_start(GTK_BOX(vertical_box), GTK_WIDGET(scrolled_window), TRUE, TRUE, 0);
- gtk_container_add(GTK_CONTAINER(scrolled_window), GTK_WIDGET(source_view));
- gtk_box_pack_start(GTK_BOX(vertical_box), GTK_WIDGET(status_bar), FALSE, FALSE, 0);
-
-#ifdef DEBUG
- puts("Showing View Source window...");
-#endif
-
- gtk_widget_show_all(GTK_WIDGET(view_source_window));
-}
-
-void juniper_view_source_mark_set(GtkSourceView *source_view, GtkTextIter *location, GtkTextMark *mark, GtkStatusbar *status_bar) /* called when the caret is moved in the source view */
-{
- gtk_statusbar_pop(GTK_STATUSBAR(status_bar), 0);
- gtk_statusbar_push(GTK_STATUSBAR(status_bar), 0, juniper_util_sprintf("%i, %i", gtk_text_iter_get_line(location), gtk_text_iter_get_line_offset(location)));
-}
-
diff --git a/src/juniper-view-source.h b/src/juniper-view-source.h
deleted file mode 100644
index 3a59425..0000000
--- a/src/juniper-view-source.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef JUNIPER_VIEW_SOURCE
-#define JUNIPER_VIEW_SOURCE
-
-#include "gtk/gtk.h"
-#include "gtksourceview/gtksourceview.h"
-
-/**
- * Display a view source window for the source of the current tab.
- */
-void juniper_view_source_current_tab();
-
-/**
- * Update the status bar when the caret is moved in the gtksourceview.
- */
-void juniper_view_source_mark_set(GtkSourceView *source_view, GtkTextIter *location, GtkTextMark *mark, GtkStatusbar *status_bar);
-
-#endif
diff --git a/src/juniper.c b/src/juniper.c
index d5326ca..d6caa90 100644
--- a/src/juniper.c
+++ b/src/juniper.c
@@ -7,7 +7,6 @@
#include "juniper-events.h"
#include "juniper-history.h"
#include "juniper-tabs.h"
-#include "juniper-view-source.h"
#include "juniper-prefs.h"
#include "juniper-bookmarks.h"
#include "juniper-ui.h"