[ilovegom commit] r67 - in trunk/gom: . include/gom/dom include/xpgom src/xpgom

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 1, 2008, 11:45:21 AM8/1/08
to gom-c...@googlegroups.com
Author: ja...@87k.net
Date: Fri Aug 1 08:44:40 2008
New Revision: 67

Added:
trunk/gom/src/xpgom/xpgom.js
Modified:
trunk/gom/ChangeLog
trunk/gom/include/gom/dom/gomattr.h
trunk/gom/include/gom/dom/gomcdatasection.h
trunk/gom/include/gom/dom/gomcharacterdata.h
trunk/gom/include/gom/dom/gomcomment.h
trunk/gom/include/gom/dom/gomdocumentfragment.h
trunk/gom/include/gom/dom/gomdocumenttype.h
trunk/gom/include/gom/dom/gomentityreference.h
trunk/gom/include/gom/dom/gomeventlistener.h
trunk/gom/include/gom/dom/gomnotation.h
trunk/gom/include/gom/dom/gomprocessinginstruction.h
trunk/gom/include/gom/dom/gomtext.h
trunk/gom/include/gom/dom/gomxmlhttprequest.h
trunk/gom/include/xpgom/Makefile.inc
trunk/gom/include/xpgom/xgDOMImplementation.hh
trunk/gom/src/xpgom/ (props changed)
trunk/gom/src/xpgom/Makefile.inc
trunk/gom/src/xpgom/xgDOMImplementation.cc
trunk/gom/src/xpgom/xgGomModule.cc

Log:
2008-08-01 jacob berkman <ja...@ilovegom.org>

* src/xpgom/xgGomModule.cc (xgGomRegistrationProc): try to
initialize Gtk

* src/xpgom/xgDOMImplementation.cc (xgDOMImplementation):
initialize gdom
(xgDOMImplementation): release gdom
(HasFeature): initial implementation

* include/xpgom/xgDOMImplementation.hh
(nsIDOMDOMImplementation): add a C object that we will proxy for

* src/xpgom/xpgom.js: a new Gom shell, written in JS

* include/gom/dom/*.h: add missing G_END_DECLS

Modified: trunk/gom/ChangeLog
==============================================================================
--- trunk/gom/ChangeLog (original)
+++ trunk/gom/ChangeLog Fri Aug 1 08:44:40 2008
@@ -1,3 +1,20 @@
+2008-08-01 jacob berkman <ja...@ilovegom.org>
+
+ * src/xpgom/xgGomModule.cc (xgGomRegistrationProc): try to
+ initialize Gtk
+
+ * src/xpgom/xgDOMImplementation.cc (xgDOMImplementation):
+ initialize gdom
+ (xgDOMImplementation): release gdom
+ (HasFeature): initial implementation
+
+ * include/xpgom/xgDOMImplementation.hh
+ (nsIDOMDOMImplementation): add a C object that we will proxy for
+
+ * src/xpgom/xpgom.js: a new Gom shell, written in JS
+
+ * include/gom/dom/*.h: add missing G_END_DECLS
+
2008-07-31 jacob berkman <ja...@ilovegom.org>

* configure.ac: turn libtool on again, for now, and use

Modified: trunk/gom/include/gom/dom/gomattr.h
==============================================================================
--- trunk/gom/include/gom/dom/gomattr.h (original)
+++ trunk/gom/include/gom/dom/gomattr.h Fri Aug 1 08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_attr_get_type (void);

+G_END_DECLS
+
#endif /* GOM_ATTR_H */

Modified: trunk/gom/include/gom/dom/gomcdatasection.h
==============================================================================
--- trunk/gom/include/gom/dom/gomcdatasection.h (original)
+++ trunk/gom/include/gom/dom/gomcdatasection.h Fri Aug 1 08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_cdata_section_get_type (void);

+G_END_DECLS
+
#endif /* GOM_CDATA_SECTION_H */

Modified: trunk/gom/include/gom/dom/gomcharacterdata.h
==============================================================================
--- trunk/gom/include/gom/dom/gomcharacterdata.h (original)
+++ trunk/gom/include/gom/dom/gomcharacterdata.h Fri Aug 1 08:44:40 2008
@@ -98,4 +98,6 @@
const char *arg,
GError **error);

+G_END_DECLS
+
#endif /* GOM_CHARACTER_DATA_H */

Modified: trunk/gom/include/gom/dom/gomcomment.h
==============================================================================
--- trunk/gom/include/gom/dom/gomcomment.h (original)
+++ trunk/gom/include/gom/dom/gomcomment.h Fri Aug 1 08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_comment_get_type (void);

+G_END_DECLS
+
#endif /* GOM_COMMENT_H */

Modified: trunk/gom/include/gom/dom/gomdocumentfragment.h
==============================================================================
--- trunk/gom/include/gom/dom/gomdocumentfragment.h (original)
+++ trunk/gom/include/gom/dom/gomdocumentfragment.h Fri Aug 1 08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_document_fragment_get_type (void);

+G_END_DECLS
+
#endif /* GOM_DOCUMENT_FRAGMENT_H */

Modified: trunk/gom/include/gom/dom/gomdocumenttype.h
==============================================================================
--- trunk/gom/include/gom/dom/gomdocumenttype.h (original)
+++ trunk/gom/include/gom/dom/gomdocumenttype.h Fri Aug 1 08:44:40 2008
@@ -51,4 +51,6 @@

GType gom_document_type_get_type (void);

+G_END_DECLS
+
#endif /* GOM_DOCUMENT_TYPE_H */

Modified: trunk/gom/include/gom/dom/gomentityreference.h
==============================================================================
--- trunk/gom/include/gom/dom/gomentityreference.h (original)
+++ trunk/gom/include/gom/dom/gomentityreference.h Fri Aug 1 08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_entity_reference_get_type (void);

+G_END_DECLS
+
#endif /* GOM_ENTITY_REFERENCE_H */

Modified: trunk/gom/include/gom/dom/gomeventlistener.h
==============================================================================
--- trunk/gom/include/gom/dom/gomeventlistener.h (original)
+++ trunk/gom/include/gom/dom/gomeventlistener.h Fri Aug 1 08:44:40 2008
@@ -60,4 +60,6 @@
void gom_event_listener_handle_event (GomEventListener *listener,
GomEvent *evt);

+G_END_DECLS
+
#endif /* GOM_EVENTLISTENER_H */

Modified: trunk/gom/include/gom/dom/gomnotation.h
==============================================================================
--- trunk/gom/include/gom/dom/gomnotation.h (original)
+++ trunk/gom/include/gom/dom/gomnotation.h Fri Aug 1 08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_notation_get_type (void);

+G_END_DECLS
+
#endif /* GOM_NOTATION_H */

Modified: trunk/gom/include/gom/dom/gomprocessinginstruction.h
==============================================================================
--- trunk/gom/include/gom/dom/gomprocessinginstruction.h (original)
+++ trunk/gom/include/gom/dom/gomprocessinginstruction.h Fri Aug 1
08:44:40 2008
@@ -50,4 +50,6 @@

GType gom_processing_instruction_get_type (void);

+G_END_DECLS
+
#endif /* GOM_PROCESSING_INSTRUCTION_H */

Modified: trunk/gom/include/gom/dom/gomtext.h
==============================================================================
--- trunk/gom/include/gom/dom/gomtext.h (original)
+++ trunk/gom/include/gom/dom/gomtext.h Fri Aug 1 08:44:40 2008
@@ -59,4 +59,6 @@

GomText *gom_text_split_text (GomText *text, gulong offset, GError **error);

+G_END_DECLS
+
#endif /* GOM_TEXT_H */

Modified: trunk/gom/include/gom/dom/gomxmlhttprequest.h
==============================================================================
--- trunk/gom/include/gom/dom/gomxmlhttprequest.h (original)
+++ trunk/gom/include/gom/dom/gomxmlhttprequest.h Fri Aug 1 08:44:40 2008
@@ -139,4 +139,6 @@
const char
*header,
GError **error);

+G_END_DECLS
+
#endif /* GOM_XML_HTTP_REQUEST_H */

Modified: trunk/gom/include/xpgom/Makefile.inc
==============================================================================
--- trunk/gom/include/xpgom/Makefile.inc (original)
+++ trunk/gom/include/xpgom/Makefile.inc Fri Aug 1 08:44:40 2008
@@ -1,6 +1,6 @@
# -*- Makefile -*-

-xpgomincludedir := $(includedir)/gom-0/xpgom
-xpgominclude_HEADERS :=
-xpgominclude_HEADERS += xgDOMImplementation.hh
+# xpgomincludedir := $(includedir)/gom-0/xpgom
+# xpgominclude_HEADERS :=
+noinst_HEADERS += xgDOMImplementation.hh


Modified: trunk/gom/include/xpgom/xgDOMImplementation.hh
==============================================================================
--- trunk/gom/include/xpgom/xgDOMImplementation.hh (original)
+++ trunk/gom/include/xpgom/xgDOMImplementation.hh Fri Aug 1 08:44:40 2008
@@ -25,6 +25,7 @@
#define XG_DOM_IMPLEMENTATION_HH

#include <nsIDOMDOMImplementation.h>
+#include "gom/dom/gomdomimplementation.h"

#define XG_DOMIMPLEMENTATION_CID_STR "4138BAA2-29BD-4D1C-9193-2D2254D4CA28"
#define XG_DOMIMPLEMENTATION_CID \
@@ -42,6 +43,7 @@
private:
~xgDOMImplementation();

+ GomDOMImplementation *gdom;
protected:
};


Modified: trunk/gom/src/xpgom/Makefile.inc
==============================================================================
--- trunk/gom/src/xpgom/Makefile.inc (original)
+++ trunk/gom/src/xpgom/Makefile.inc Fri Aug 1 08:44:40 2008
@@ -9,4 +9,4 @@
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
+libxpgom_la_LDFLAGS := -avoid-version -export-dynamic libgom.a $(XPGOM_LIBS)
\ No newline at end of file

Modified: trunk/gom/src/xpgom/xgDOMImplementation.cc
==============================================================================
--- trunk/gom/src/xpgom/xgDOMImplementation.cc (original)
+++ trunk/gom/src/xpgom/xgDOMImplementation.cc Fri Aug 1 08:44:40 2008
@@ -24,6 +24,7 @@
#include "config.h"

#include "xpgom/xgDOMImplementation.hh"
+#include "gom/gomdom.h"

#include <nsIClassInfoImpl.h>

@@ -31,14 +32,17 @@
#include <nsEmbedString.h>

xgDOMImplementation::xgDOMImplementation()
+ : gdom(GOM_DOM_IMPLEMENTATION (g_object_new (GOM_TYPE_DOM, NULL)))
{
+ g_object_add_weak_pointer (G_OBJECT (gdom), (gpointer *)&gdom);
}

xgDOMImplementation::~xgDOMImplementation()
{
+ g_object_unref (gdom);
}

-NS_IMPL_ISUPPORTS1_CI(xgDOMImplementation, nsIDOMDOMImplementation)
+NS_IMPL_ISUPPORTS1_CI(xgDOMImplementation, nsIDOMDOMImplementation);

/* boolean hasFeature (in DOMString feature, in DOMString version); */
NS_IMETHODIMP
@@ -46,7 +50,19 @@
const nsAString &version,
PRBool *_retval)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ nsCAutoString cfeature;
+ if (NS_FAILED (NS_UTF16ToCString (feature,
NS_CSTRING_ENCODING_UTF8, cfeature))) {
+ return NS_ERROR_INVALID_ARG;
+ }
+
+ nsCAutoString cversion;
+ if (NS_FAILED (NS_UTF16ToCString (version,
NS_CSTRING_ENCODING_UTF8, cversion))) {
+ return NS_ERROR_INVALID_ARG;
+ }
+
+ *_retval = gom_dom_implementation_has_feature (gdom,
cfeature.get(), cversion.get());
+
+ return NS_OK;
}

/* nsIDOMDocumentType createDocumentType (in DOMString qualifiedName,
in DOMString publicId, in DOMString systemId) raises (DOMException); */

Modified: trunk/gom/src/xpgom/xgGomModule.cc
==============================================================================
--- trunk/gom/src/xpgom/xgGomModule.cc (original)
+++ trunk/gom/src/xpgom/xgGomModule.cc Fri Aug 1 08:44:40 2008
@@ -25,12 +25,15 @@

#include "xpgom/xgDOMImplementation.hh"

+#include <gtk/gtkmain.h>
+
#include <nsIGenericFactory.h>
#include <nsIClassInfoImpl.h>
+#include <nsIFile.h>
+#include <nsStringAPI.h>

-NS_GENERIC_FACTORY_CONSTRUCTOR(xgDOMImplementation)
+NS_GENERIC_FACTORY_CONSTRUCTOR(xgDOMImplementation);

-#if 0
static NS_METHOD
xgGomRegistrationProc (nsIComponentManager *aCompMgr,
nsIFile *aPath,
@@ -38,9 +41,14 @@
const char *componentType,
const nsModuleComponentInfo *info)
{
+ if (!gtk_init_check (NULL, NULL)) {
+ g_warning ("Could not initialize Gtk; Gom module unavailable.");
+ return NS_ERROR_NOT_AVAILABLE;
+ }
return NS_OK;
}

+#if 0
static NS_METHOD
xgGomUnregistrationProc (nsIComponentManager *aCompMgr,
nsIFile *aPath,
@@ -58,7 +66,7 @@
"DOM Implementation",
XG_DOMIMPLEMENTATION_CID, XG_DOMIMPLEMENTATION_CONTRACTID,
xgDOMImplementationConstructor,
- NULL, NULL, NULL,
+ xgGomRegistrationProc, NULL, NULL,
NS_CI_INTERFACE_GETTER_NAME (xgDOMImplementation),
NULL,
&NS_CLASSINFO_NAME(xgDOMImplementation)

Added: trunk/gom/src/xpgom/xpgom.js
==============================================================================
--- (empty file)
+++ trunk/gom/src/xpgom/xpgom.js Fri Aug 1 08:44:40 2008
@@ -0,0 +1,4 @@
+(function () {
+ print (dom = Components.classes["@ilovegom.org/dom-implementation;1"].createInstance(Components.interfaces.nsIDOMDOMImplementation));
+ print (dom.hasFeature ("xml", "1.0"));
+})();

Reply all
Reply to author
Forward
0 new messages