Added:
trunk/gom/include/xpgom/
trunk/gom/include/xpgom/Makefile.inc
trunk/gom/include/xpgom/xgDOMImplementation.hh
trunk/gom/src/xpgom/
trunk/gom/src/xpgom/Makefile.inc
trunk/gom/src/xpgom/xgDOMImplementation.cc
trunk/gom/src/xpgom/xgGomModule.cc
Modified:
trunk/gom/ChangeLog
trunk/gom/Makefile.am
trunk/gom/configure.ac
Log:
2008-07-31 jacob berkman <ja...@ilovegom.org>
* configure.ac: turn libtool on again, for now, and use
correct flags for building xpcom components
* src/xpgom/xgGomModule.cc: register our xpcom components
* src/xpgom/xgDOMImplementation.cc:
* include/xpgom/xgDOMImplementation.hh
(nsIDOMDOMImplementation): XPCOM-based DOMImplementation
object
Modified: trunk/gom/ChangeLog
==============================================================================
--- trunk/gom/ChangeLog (original)
+++ trunk/gom/ChangeLog Thu Jul 31 23:29:49 2008
@@ -1,3 +1,15 @@
+2008-07-31 jacob berkman <ja...@ilovegom.org>
+
+ * configure.ac: turn libtool on again, for now, and use
+ correct flags for building xpcom components
+
+ * src/xpgom/xgGomModule.cc: register our xpcom components
+
+ * src/xpgom/xgDOMImplementation.cc:
+ * include/xpgom/xgDOMImplementation.hh
+ (nsIDOMDOMImplementation): XPCOM-based DOMImplementation
+ object
+
2008-07-27 jacob berkman <ja...@ilovegom.org>
* configure.ac: port to using xulrunner sdk rather than
Modified: trunk/gom/Makefile.am
==============================================================================
--- trunk/gom/Makefile.am (original)
+++ trunk/gom/Makefile.am Thu Jul 31 23:29:49 2008
@@ -75,9 +75,11 @@
include examples/Makefile.inc
include include/gom/Makefile.inc
include include/gom/dom/Makefile.inc
+include include/xpgom/Makefile.inc
include src/gom/Makefile.inc
include src/libgom/Makefile.inc
include src/schema/Makefile.inc
+include src/xpgom/Makefile.inc
include tests/Makefile.inc
update-makefiles:
Modified: trunk/gom/configure.ac
==============================================================================
--- trunk/gom/configure.ac (original)
+++ trunk/gom/configure.ac Thu Jul 31 23:29:49 2008
@@ -40,7 +40,8 @@
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
-AC_PROG_RANLIB
+# AC_PROG_RANLIB
+AC_PROG_LIBTOOL
# Make libtool use --silent when --silent is passed to make
changequote(,)dnl
@@ -70,15 +71,16 @@
])
GOM_CFLAGS="$GOM_CFLAGS $js_cppflags"
-xulrunner_cppflags="-I$xulrunnersdk/sdk/include -DXPCOMGLUE=1"
+xulrunner_cppflags="-I$xulrunnersdk/sdk/include -DMOZILLA_STRICT_API"
CPPFLAGS="$CPPFLAGS_save $xulrunner_cppflags"
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([nsXPCOM.h nsIIOService.h],[],[
AC_MSG_ERROR([$xulrunnersdk is missing XPCOM headers.])
])
AC_LANG_POP([C++])
-GOM_CFLAGS="$GOM_CFLAGS $xulrunner_cppflags"
-
+XPGOM_CFLAGS="$GOM_CFLAGS $xulrunner_cppflags"
+GOM_CFLAGS="$GOM_CFLAGS $xulrunner_cppflags -DXPCOMGLUE=1"
+
CPPFLAGS=$CPPFLAGS_save
# Checks for typedefs, structures, and compiler characteristics.
@@ -94,11 +96,26 @@
AC_CHECK_LIB([xpcomglue],[XPCOMGlueStartup],[],[
AC_MSG_ERROR([$xulrunnersdk is missing XPCOM libraries.])
])
+case $host_os in
+ darwin*)
+ xplibpath="-Wl,-executable_path,$xulrunnersdk/bin"
+ ;;
+ linux*)
+ xplibpath="-Wl,-rpath-link,$xulrunnersdk/bin"
+ ;;
+ *)
+ AC_MSG_ERROR([I don't know how to link components on $host_os])
+ ;;
+esac
+XPGOM_LIBS="$GOM_LIBS $xulrunner_libs -L$xulrunnersdk/bin $xplibpath
-lxpcomglue_s -lmozjs -lxpcom -lnspr4"
GOM_LIBS="$GOM_LIBS $xulrunner_libs -lxpcomglue -lmozjs"
LIBS=$LIBS_save
rm -rf a.out.dSYM
+
+AC_SUBST(XPGOM_CFLAGS)
+AC_SUBST(XPGOM_LIBS)
AC_CONFIG_FILES([
gom-0.pc
Added: trunk/gom/include/xpgom/Makefile.inc
==============================================================================
--- (empty file)
+++ trunk/gom/include/xpgom/Makefile.inc Thu Jul 31 23:29:49 2008
@@ -0,0 +1,6 @@
+# -*- Makefile -*-
+
+xpgomincludedir := $(includedir)/gom-0/xpgom
+xpgominclude_HEADERS :=
+xpgominclude_HEADERS += xgDOMImplementation.hh
+
Added: trunk/gom/include/xpgom/xgDOMImplementation.hh
==============================================================================
--- (empty file)
+++ trunk/gom/include/xpgom/xgDOMImplementation.hh Thu Jul 31 23:29:49 2008
@@ -0,0 +1,48 @@
+/*
+The MIT License
+
+Copyright (c) 2008 jacob berkman <ja...@ilovegom.org>
+
+Permission is hereby granted, free of charge, to any person obtaining
a copy
+of this software and associated documentation files (the "Software"),
to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+#ifndef XG_DOM_IMPLEMENTATION_HH
+#define XG_DOM_IMPLEMENTATION_HH
+
+#include <nsIDOMDOMImplementation.h>
+
+#define XG_DOMIMPLEMENTATION_CID_STR "4138BAA2-29BD-4D1C-9193-2D2254D4CA28"
+#define XG_DOMIMPLEMENTATION_CID \
+{ 0x4138BAA2, 0x29BD, 0x4D1C, { 0x91, 0x93, 0x2D, 0x22, 0x54, 0xD4,
0xCA, 0x28 } }
+#define XG_DOMIMPLEMENTATION_CONTRACTID "@ilovegom.org/dom-implementation;1"
+
+class xgDOMImplementation : public nsIDOMDOMImplementation
+{
+public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIDOMDOMIMPLEMENTATION
+
+ xgDOMImplementation();
+
+private:
+ ~xgDOMImplementation();
+
+protected:
+};
+
+#endif /* XG_DOM_IMPLEMENTATION_HH */
Added: trunk/gom/src/xpgom/Makefile.inc
==============================================================================
--- (empty file)
+++ trunk/gom/src/xpgom/Makefile.inc Thu Jul 31 23:29:49 2008
@@ -0,0 +1,12 @@
+# -*- Makefile -*-
+
+lib_LTLIBRARIES += libxpgom.la
+
+libxpgom_la_SOURCES :=
+libxpgom_la_SOURCES += src/xpgom/xgDOMImplementation.cc
+libxpgom_la_SOURCES += src/xpgom/xgGomModule.cc
+
+libxpgom_la_CPPFLAGS = -I$(top_builddir)/include
-I$(top_srcdir)/include $(XPGOM_CFLAGS)
+libxpgom_la_CXXFLAGS = -fshort-wchar
+libxpgom_la_LIBDADD :=
+libxpgom_la_LDFLAGS := -avoid-version -export-dynamic $(XPGOM_LIBS)
\ No newline at end of file
Added: trunk/gom/src/xpgom/xgDOMImplementation.cc
==============================================================================
--- (empty file)
+++ trunk/gom/src/xpgom/xgDOMImplementation.cc Thu Jul 31 23:29:49 2008
@@ -0,0 +1,70 @@
+/*
+The MIT License
+
+Copyright (c) 2008 jacob berkman <ja...@ilovegom.org>
+
+Permission is hereby granted, free of charge, to any person obtaining
a copy
+of this software and associated documentation files (the "Software"),
to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+#include "config.h"
+
+#include "xpgom/xgDOMImplementation.hh"
+
+#include <nsIClassInfoImpl.h>
+
+#include <nsMemory.h>
+#include <nsEmbedString.h>
+
+xgDOMImplementation::xgDOMImplementation()
+{
+}
+
+xgDOMImplementation::~xgDOMImplementation()
+{
+}
+
+NS_IMPL_ISUPPORTS1_CI(xgDOMImplementation, nsIDOMDOMImplementation)
+
+/* boolean hasFeature (in DOMString feature, in DOMString version); */
+NS_IMETHODIMP
+xgDOMImplementation::HasFeature (const nsAString &feature,
+ const nsAString &version,
+ PRBool *_retval)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIDOMDocumentType createDocumentType (in DOMString qualifiedName,
in DOMString publicId, in DOMString systemId) raises (DOMException); */
+NS_IMETHODIMP
+xgDOMImplementation::CreateDocumentType (const nsAString &qualifiedName,
+ const nsAString &publicId,
+ const nsAString &systemId,
+ nsIDOMDocumentType **_retval)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIDOMDocument createDocument (in DOMString namespaceURI, in
DOMString qualifiedName, in nsIDOMDocumentType doctype) raises
(DOMException); */
+NS_IMETHODIMP
+xgDOMImplementation::CreateDocument (const nsAString &namespaceURI,
+ const nsAString &qualifiedName,
+ nsIDOMDocumentType *doctype,
+ nsIDOMDocument **_retval)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
Added: trunk/gom/src/xpgom/xgGomModule.cc
==============================================================================
--- (empty file)
+++ trunk/gom/src/xpgom/xgGomModule.cc Thu Jul 31 23:29:49 2008
@@ -0,0 +1,70 @@
+/*
+The MIT License
+
+Copyright (c) 2008 jacob berkman <ja...@ilovegom.org>
+
+Permission is hereby granted, free of charge, to any person obtaining
a copy
+of this software and associated documentation files (the "Software"),
to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+#include "config.h"
+
+#include "xpgom/xgDOMImplementation.hh"
+
+#include <nsIGenericFactory.h>
+#include <nsIClassInfoImpl.h>
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(xgDOMImplementation)
+
+#if 0
+static NS_METHOD
+xgGomRegistrationProc (nsIComponentManager *aCompMgr,
+ nsIFile *aPath,
+ const char *registryLocation,
+ const char *componentType,
+ const nsModuleComponentInfo *info)
+{
+ return NS_OK;
+}
+
+static NS_METHOD
+xgGomUnregistrationProc (nsIComponentManager *aCompMgr,
+ nsIFile *aPath,
+ const char *registryLocation,
+ const nsModuleComponentInfo *info)
+{
+ return NS_OK;
+}
+#endif
+
+NS_DECL_CLASSINFO(xgDOMImplementation)
+
+static const nsModuleComponentInfo components[] = {
+ {
+ "DOM Implementation",
+ XG_DOMIMPLEMENTATION_CID, XG_DOMIMPLEMENTATION_CONTRACTID,
+ xgDOMImplementationConstructor,
+ NULL, NULL, NULL,
+ NS_CI_INTERFACE_GETTER_NAME (xgDOMImplementation),
+ NULL,
+ &NS_CLASSINFO_NAME(xgDOMImplementation)
+ }
+};
+
+NS_IMPL_NSGETMODULE(nsGomModule, components)
+
+