diff options
author | Christian Persch <chpe@src.gnome.org> | 2007-09-13 21:09:13 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2007-09-13 21:09:13 +0800 |
commit | 4fe73188e1d1acf72a346d939a86691c73bb6ebd (patch) | |
tree | 459738eb5c4db5b52ffcfce7afec7f5c5a6a9b58 /embed | |
parent | 0651f74cfd3a68649a96c2f2b70a93c48451c010 (diff) | |
download | gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.tar gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.tar.gz gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.tar.bz2 gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.tar.lz gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.tar.xz gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.tar.zst gsoc2013-epiphany-4fe73188e1d1acf72a346d939a86691c73bb6ebd.zip |
Move AutoJSContextStack and AutoWindowModalState helpers to
embed/xulrunner/utils instead of having two copies of it in src
and embed.
svn path=/trunk/; revision=7424
Diffstat (limited to 'embed')
-rw-r--r-- | embed/xulrunner/embed/AutoJSContextStack.cpp | 47 | ||||
-rw-r--r-- | embed/xulrunner/embed/AutoJSContextStack.h | 41 | ||||
-rw-r--r-- | embed/xulrunner/embed/Makefile.am | 5 | ||||
-rw-r--r-- | embed/xulrunner/src/AutoWindowModalState.cpp | 39 | ||||
-rw-r--r-- | embed/xulrunner/src/AutoWindowModalState.h | 38 | ||||
-rw-r--r-- | embed/xulrunner/src/Makefile.am | 5 | ||||
-rw-r--r-- | embed/xulrunner/utils/AutoJSContextStack.cpp (renamed from embed/xulrunner/src/AutoJSContextStack.cpp) | 0 | ||||
-rw-r--r-- | embed/xulrunner/utils/AutoJSContextStack.h (renamed from embed/xulrunner/src/AutoJSContextStack.h) | 0 | ||||
-rw-r--r-- | embed/xulrunner/utils/AutoWindowModalState.cpp (renamed from embed/xulrunner/embed/AutoWindowModalState.cpp) | 0 | ||||
-rw-r--r-- | embed/xulrunner/utils/AutoWindowModalState.h (renamed from embed/xulrunner/embed/AutoWindowModalState.h) | 0 | ||||
-rw-r--r-- | embed/xulrunner/utils/Makefile.am | 32 |
11 files changed, 34 insertions, 173 deletions
diff --git a/embed/xulrunner/embed/AutoJSContextStack.cpp b/embed/xulrunner/embed/AutoJSContextStack.cpp deleted file mode 100644 index 2dc435625..000000000 --- a/embed/xulrunner/embed/AutoJSContextStack.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright © 2006 Christian Persch - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $Id$ - */ - -#include <xpcom-config.h> -#include "config.h" - -#include <nsServiceManagerUtils.h> - -#include "AutoJSContextStack.h" - -AutoJSContextStack::~AutoJSContextStack() -{ - if (mStack) - { - JSContext* cx; - mStack->Pop (&cx); - - NS_ASSERTION(cx == nsnull, "We pushed a null context but popped a non-null context!?"); - } -} - -nsresult -AutoJSContextStack::Init() -{ - nsresult rv; - mStack = do_GetService ("@mozilla.org/js/xpc/ContextStack;1", &rv); - if (NS_FAILED (rv)) return rv; - - return mStack->Push (nsnull); -} diff --git a/embed/xulrunner/embed/AutoJSContextStack.h b/embed/xulrunner/embed/AutoJSContextStack.h deleted file mode 100644 index 0db423a64..000000000 --- a/embed/xulrunner/embed/AutoJSContextStack.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright © 2006 Christian Persch - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $Id$ - */ - -#ifndef AUTO_JSCONTEXTSTACK_H -#define AUTO_JSCONTEXTSTACK_H - -struct JSContext; - -#include <nsCOMPtr.h> -#include <nsIJSContextStack.h> - -class AutoJSContextStack -{ - public: - AutoJSContextStack () { } - ~AutoJSContextStack (); - - nsresult Init (); - - private: - nsCOMPtr<nsIJSContextStack> mStack; -}; - -#endif diff --git a/embed/xulrunner/embed/Makefile.am b/embed/xulrunner/embed/Makefile.am index 5158bd45a..2c8d7d4f3 100644 --- a/embed/xulrunner/embed/Makefile.am +++ b/embed/xulrunner/embed/Makefile.am @@ -1,10 +1,6 @@ noinst_LTLIBRARIES = libephyxulrunnerembed.la libephyxulrunnerembed_la_SOURCES = \ - AutoJSContextStack.cpp \ - AutoJSContextStack.h \ - AutoWindowModalState.cpp \ - AutoWindowModalState.h \ ContentHandler.cpp \ ContentHandler.h \ EphyAboutModule.cpp \ @@ -99,6 +95,7 @@ libephyxulrunnerembed_la_CPPFLAGS = \ -I$(top_srcdir)/embed \ -I$(top_srcdir) \ -I$(top_srcdir)/embed/xulrunner/src \ + -I$(top_srcdir)/embed/xulrunner/utils \ -I$(top_builddir)/embed/xulrunner/src \ -DSHARE_DIR=\"$(pkgdatadir)\" \ -DPLUGINDIR=\"$(libdir)/epiphany/$(EPIPHANY_MAJOR)/plugins\" \ diff --git a/embed/xulrunner/src/AutoWindowModalState.cpp b/embed/xulrunner/src/AutoWindowModalState.cpp deleted file mode 100644 index 5f38acec5..000000000 --- a/embed/xulrunner/src/AutoWindowModalState.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright © 2006 Christian Persch - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#include <xpcom-config.h> -#include "config.h" - -#include "AutoWindowModalState.h" - -AutoWindowModalState::AutoWindowModalState (nsIDOMWindow *aWindow) -{ - mWindow = do_QueryInterface (aWindow); - if (mWindow) { - mWindow->EnterModalState (); - } -} - -AutoWindowModalState::~AutoWindowModalState() -{ - if (mWindow) { - mWindow->LeaveModalState (); - } -} diff --git a/embed/xulrunner/src/AutoWindowModalState.h b/embed/xulrunner/src/AutoWindowModalState.h deleted file mode 100644 index bccefede2..000000000 --- a/embed/xulrunner/src/AutoWindowModalState.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright © 2006 Christian Persch - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#ifndef AUTO_WINDOWMODALSTATE_H -#define AUTO_WINDOWMODALSTATE_H - -#include <nsCOMPtr.h> -#include <nsPIDOMWindow.h> - -class AutoWindowModalState -{ - public: - AutoWindowModalState (nsIDOMWindow *); - ~AutoWindowModalState (); - - private: - - nsCOMPtr<nsPIDOMWindow> mWindow; -}; - -#endif diff --git a/embed/xulrunner/src/Makefile.am b/embed/xulrunner/src/Makefile.am index a0d82d551..4dd581aae 100644 --- a/embed/xulrunner/src/Makefile.am +++ b/embed/xulrunner/src/Makefile.am @@ -79,10 +79,6 @@ libgnomegeckoembed_la_SOURCES = \ gecko-init.h \ gecko-init-internal.h \ gecko-init-private.h \ - AutoJSContextStack.cpp \ - AutoJSContextStack.h \ - AutoWindowModalState.cpp \ - AutoWindowModalState.h \ EmbedContentListener.cpp \ EmbedContentListener.h \ EmbedEventListener.cpp \ @@ -104,6 +100,7 @@ libgnomegeckoembed_la_SOURCES = \ $(NULL) libgnomegeckoembed_la_CPPFLAGS = \ + -I$(top_srcdir)/embed/xulrunner/utils \ $(LIBXUL_CXXCPPFLAGS) \ $(LIBXUL_INCLUDES) \ $(AM_CPPFLAGS) diff --git a/embed/xulrunner/src/AutoJSContextStack.cpp b/embed/xulrunner/utils/AutoJSContextStack.cpp index 9c918fc3b..9c918fc3b 100644 --- a/embed/xulrunner/src/AutoJSContextStack.cpp +++ b/embed/xulrunner/utils/AutoJSContextStack.cpp diff --git a/embed/xulrunner/src/AutoJSContextStack.h b/embed/xulrunner/utils/AutoJSContextStack.h index 5294e7d4e..5294e7d4e 100644 --- a/embed/xulrunner/src/AutoJSContextStack.h +++ b/embed/xulrunner/utils/AutoJSContextStack.h diff --git a/embed/xulrunner/embed/AutoWindowModalState.cpp b/embed/xulrunner/utils/AutoWindowModalState.cpp index 79fb2c15a..79fb2c15a 100644 --- a/embed/xulrunner/embed/AutoWindowModalState.cpp +++ b/embed/xulrunner/utils/AutoWindowModalState.cpp diff --git a/embed/xulrunner/embed/AutoWindowModalState.h b/embed/xulrunner/utils/AutoWindowModalState.h index 557865799..557865799 100644 --- a/embed/xulrunner/embed/AutoWindowModalState.h +++ b/embed/xulrunner/utils/AutoWindowModalState.h diff --git a/embed/xulrunner/utils/Makefile.am b/embed/xulrunner/utils/Makefile.am index e69de29bb..5d6fe699d 100644 --- a/embed/xulrunner/utils/Makefile.am +++ b/embed/xulrunner/utils/Makefile.am @@ -0,0 +1,32 @@ +NULL = + +noinst_LTLIBRARIES = libephyxulrunnerutils.la + +libephyxulrunnerutils_la_SOURCES = \ + AutoJSContextStack.cpp \ + AutoJSContextStack.h \ + AutoWindowModalState.cpp \ + AutoWindowModalState.h \ + $(NULL) + +libephyxulrunnerutils_la_CPPFLAGS = \ + $(LIBXUL_CXXCPPFLAGS) \ + $(LIBXUL_INCLUDES) \ + $(AM_CPPFLAGS) + +libephyxulrunnerutils_la_CXXFLAGS = \ + $(LIBXUL_CXXFLAGS) \ + $(GTK_CFLAGS) \ + $(AM_CXXFLAGS) + +libephyxulrunnerutils_la_LDFLAGS = \ + $(AM_LDFLAGS) + +libephyxulrunnerutils_la_LIBADD = \ + $(LIBXUL_LIBS) + +CLEANFILES = + $(NULL) + +EXTRA_DIST = \ + $(NULL) |