Author: andreia
Date: 2008-01-18 06:08:46 -0500 (Fri, 18 Jan 2008)
New Revision: 93242

Modified:
   trunk/gluezilla/src/BrowserWindow.cpp
   trunk/gluezilla/src/ChangeLog
   trunk/gluezilla/src/Widget.h
   trunk/gluezilla/src/gluezilla.cpp
   trunk/gluezilla/src/gluezilla.h
   trunk/gluezilla/src/interfaces.h
Log:
* gluezilla.cpp, gluezilla.h, Widget.h: add platform support
* BrowserWindow.cpp, interfaces.h: Use specific widget define instead
of generic os define to detect gtk

2008-01-18  Andreia Gaita <[EMAIL PROTECTED]>

Modified: trunk/gluezilla/src/BrowserWindow.cpp
===================================================================
--- trunk/gluezilla/src/BrowserWindow.cpp       2008-01-18 11:03:09 UTC (rev 
93241)
+++ trunk/gluezilla/src/BrowserWindow.cpp       2008-01-18 11:08:46 UTC (rev 
93242)
@@ -18,7 +18,7 @@
 
 // for getting the native mozilla drawing handle
 
-#ifdef NS_UNIX
+#ifdef MOZ_WIDGET_GTK2
 #include "gtkWidget.h"
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>

Modified: trunk/gluezilla/src/ChangeLog
===================================================================
--- trunk/gluezilla/src/ChangeLog       2008-01-18 11:03:09 UTC (rev 93241)
+++ trunk/gluezilla/src/ChangeLog       2008-01-18 11:08:46 UTC (rev 93242)
@@ -1,3 +1,9 @@
+2008-01-18  Andreia Gaita <[EMAIL PROTECTED]>
+
+       * gluezilla.cpp, gluezilla.h, Widget.h: add platform support
+       * BrowserWindow.cpp, interfaces.h: Use specific widget define instead
+       of generic os define to detect gtk
+
 2008-01-10  Wade Berrier  <[EMAIL PROTECTED]>
 
        * Makefile.am: include *.manifest in EXTRA_DIST

Modified: trunk/gluezilla/src/Widget.h
===================================================================
--- trunk/gluezilla/src/Widget.h        2008-01-18 11:03:09 UTC (rev 93241)
+++ trunk/gluezilla/src/Widget.h        2008-01-18 11:08:46 UTC (rev 93242)
@@ -255,6 +255,8 @@
                
                PRUint32 width;
                PRUint32 height;
+
+               Platform platform;
        
                // the appshell we have created
                nsIAppShell *appShell;

Modified: trunk/gluezilla/src/gluezilla.cpp
===================================================================
--- trunk/gluezilla/src/gluezilla.cpp   2008-01-18 11:03:09 UTC (rev 93241)
+++ trunk/gluezilla/src/gluezilla.cpp   2008-01-18 11:08:46 UTC (rev 93242)
@@ -12,7 +12,7 @@
 #include "gluezilla.h"
 #include "Widget.h"
 
-#ifdef NS_UNIX
+#ifdef MOZ_WIDGET_GTK2
 #include "gtkWidget.h"
 GThread    *ui_thread_id;
 GAsyncQueue *queuein;
@@ -25,17 +25,22 @@
 }
 
 NS_METHOD_(Handle*)
-gluezilla_init (CallbackBin *events, const char * startDir, const char * 
dataDir)
+gluezilla_init (Platform platform, CallbackBin *events, const char * startDir, 
const char * dataDir, Platform * mozPlatform)
 {
-#ifdef NS_UNIX
-       g_type_init();  
-       if (!g_thread_supported ()) g_thread_init (NULL);
+#ifdef MOZ_WIDGET_GTK2
+       if (platform == Winforms) {
+               g_type_init();  
+               if (!g_thread_supported ()) g_thread_init (NULL);
 
-       queuein = g_async_queue_new ();
-       queueout = g_async_queue_new ();
-       
-       ui_thread_id = g_thread_create (gtk_startup, NULL, TRUE, NULL);
-       g_async_queue_pop (queueout);
+               queuein = g_async_queue_new ();
+               queueout = g_async_queue_new ();
+               
+               ui_thread_id = g_thread_create (gtk_startup, NULL, TRUE, NULL);
+               g_async_queue_pop (queueout);
+       }
+       *mozPlatform = Gtk;
+#else ifdef XP_WIN32
+       *mozPlatform = Winforms;
 #endif
 
        Widget *widget = new Widget (strdup(startDir), strdup(dataDir));
@@ -44,6 +49,7 @@
        p->name = "init";
        p->instance = widget;
        p->events = events;
+       p->platform = platform;
 
        nsresult result = widget->BeginInvoke (p);
        if (p)

Modified: trunk/gluezilla/src/gluezilla.h
===================================================================
--- trunk/gluezilla/src/gluezilla.h     2008-01-18 11:03:09 UTC (rev 93241)
+++ trunk/gluezilla/src/gluezilla.h     2008-01-18 11:08:46 UTC (rev 93242)
@@ -21,7 +21,7 @@
 #define STDCALL 
 #endif
 
-#ifdef NS_UNIX
+#ifdef MOZ_WIDGET_GTK2
        #ifdef DEBUG
                #define PRINT(str)      \
                        g_print(str)
@@ -124,8 +124,12 @@
                STD_OK_CANCEL_BUTTONS   = 513
        } DialogButtonFlags;
 
+       typedef enum
+       {
+               Winforms = 1,
+               Gtk = 2
+       } Platform;
 
-
        typedef struct _CallbackBin
        {
                void (STDCALL *OnWidgetLoaded)          ();
@@ -204,7 +208,7 @@
        // initialization
        NS_EXPORT_(void) gluezilla_debug_startup ();
        
-       NS_EXPORT_(Handle *) gluezilla_init (CallbackBin *events, const char * 
startDir, const char * dataDir);
+       NS_EXPORT_(Handle *) gluezilla_init (Platform platform, CallbackBin 
*events, const char * startDir, const char * dataDir, Platform * mozPlatform);
        NS_EXPORT_(int) gluezilla_createBrowserWindow (Handle *instance, Handle 
*hwnd, PRInt32 width, PRInt32 height);
 
        // layout
@@ -250,6 +254,7 @@
 
        const char * name;
        Widget * instance;
+       
        union {
                struct {
                        char * uri;
@@ -261,6 +266,7 @@
                };
                struct {
                        CallbackBin *events;
+                       Platform platform;
                };
                struct {
                        ReloadOption option;

Modified: trunk/gluezilla/src/interfaces.h
===================================================================
--- trunk/gluezilla/src/interfaces.h    2008-01-18 11:03:09 UTC (rev 93241)
+++ trunk/gluezilla/src/interfaces.h    2008-01-18 11:08:46 UTC (rev 93242)
@@ -84,6 +84,9 @@
 /* XRE API */
 //#include "xulapp/nsXULAppAPI.h" 
 
+// Mozilla configuration to get compile settings
+#include "mozilla-config.h"
+
 #define NS_FROZENCALL
 #define XRE_API(type, name, params) \
   typedef type (NS_FROZENCALL * name##Type) params; \

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to