From 67d5a1dc989473f99b43e968ddec270803d978dc Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 21 Jun 2007 18:25:41 +0000 Subject: Finally put modal dialogs to work. --- (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 5afe7b3..15e63e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = \ $(MOZILLA_CFLAGS) \ -I$(MOZILLA_INCLUDE_ROOT)/docshell \ -I$(MOZILLA_INCLUDE_ROOT)/dom \ + -I$(MOZILLA_INCLUDE_ROOT)/js \ -I$(MOZILLA_INCLUDE_ROOT)/xulapp \ -I$(MOZILLA_INCLUDE_ROOT)/nspr \ -I$(MOZILLA_INCLUDE_ROOT)/pyxpcom \ @@ -11,6 +12,7 @@ INCLUDES = \ -I$(MOZILLA_INCLUDE_ROOT)/webbrwsr \ -I$(MOZILLA_INCLUDE_ROOT)/widget \ -I$(MOZILLA_INCLUDE_ROOT)/xpcom \ + -I$(MOZILLA_INCLUDE_ROOT)/xpconnect \ -DMOZILLA_HOME=\"$(MOZILLA_HOME)\" \ -DPLUGIN_PATH=\"$(libdir)/mozilla/plugins\" \ -DDATA_DIR=\"$(pkgdatadir)\" diff --git a/src/hulahop-web-view.cpp b/src/hulahop-web-view.cpp index 2eeebc6..286f3cf 100644 --- a/src/hulahop-web-view.cpp +++ b/src/hulahop-web-view.cpp @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -294,3 +296,20 @@ hulahop_web_view_grab_focus(HulahopWebView *web_view) gtk_widget_grab_focus(web_view->mozilla_widget); } } + +void +hulahop_web_view_push_js_context (HulahopWebView *web_view) +{ + nsCOMPtr stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1")); + nsresult rv = stack->Push(nsnull); + g_assert(NS_SUCCEEDED(rv)); +} + +void +hulahop_web_view_pop_js_context (HulahopWebView *web_view) +{ + nsCOMPtr stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1")); + nsresult rv = stack->Pop(nsnull); + g_assert(NS_SUCCEEDED(rv)); +} + diff --git a/src/hulahop-web-view.h b/src/hulahop-web-view.h index 7f56a63..40ea6e8 100644 --- a/src/hulahop-web-view.h +++ b/src/hulahop-web-view.h @@ -42,6 +42,9 @@ void hulahop_web_view_create_window (HulahopWebView *web_view); PyObject *hulahop_web_view_get_browser (HulahopWebView *web_view); PyObject *hulahop_web_view_get_window_root (HulahopWebView *web_view); +void hulahop_web_view_push_js_context (HulahopWebView *web_view); +void hulahop_web_view_pop_js_context (HulahopWebView *web_view); + G_END_DECLS #endif -- cgit v0.9.1