Bug 622063 - Make Fennec-Gtk compiling on Maemo6 r=dougt a=approval2.0
authorOleg Romashin <romaxa@gmail.com>
Wed, 05 Jan 2011 15:48:16 +0200
changeset 60009 b05a6acdf62f70c12474dc2d04376a8ff273a645
parent 60008 4553b507e03a6e07791d36bcf68c439481b38d41
child 60010 0c83bdaae49da6363fa88339fa7174a462d877ec
push idunknown
push userunknown
push dateunknown
reviewersdougt, approval2
bugs622063
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 622063 - Make Fennec-Gtk compiling on Maemo6 r=dougt a=approval2.0
toolkit/xre/nsNativeAppSupportUnix.cpp
widget/src/gtk2/nsFilePicker.cpp
widget/src/gtk2/nsGtkIMModule.cpp
--- a/toolkit/xre/nsNativeAppSupportUnix.cpp
+++ b/toolkit/xre/nsNativeAppSupportUnix.cpp
@@ -66,17 +66,17 @@
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
 #ifdef MOZ_X11
 #include <gdk/gdkx.h>
 #include <X11/Xatom.h>
 #endif
 
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
 struct DBusMessage;  /* libosso.h references internals of dbus */
 
 #include <dbus/dbus.h>
 #include <dbus/dbus-protocol.h>
 #include <libosso.h>
 
 // These come from <mce/dbus-names.h> (maemo sdk 5+)
 #define MCE_SERVICE "com.nokia.mce"
@@ -173,28 +173,28 @@ void die_cb(GnomeClient *client, gpointe
 class nsNativeAppSupportUnix : public nsNativeAppSupportBase
 {
 public:
   NS_IMETHOD Start(PRBool* aRetVal);
   NS_IMETHOD Stop(PRBool *aResult);
   NS_IMETHOD Enable();
 
 private:
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
   osso_context_t *m_osso_context;    
   /* A note about why we need to have m_hw_state:
      the osso hardware callback does not tell us what changed, just
      that something has changed.  We need to keep track of state so
      that we can determine what has changed.
   */  
   osso_hw_state_t m_hw_state;
 #endif
 };
 
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
 static nsresult
 GetMostRecentWindow(const PRUnichar* aType, nsIDOMWindowInternal** aWindow)
 {
   nsCOMPtr<nsIWindowMediator> wm = do_GetService("@mozilla.org/appshell/window-mediator;1");
   if (wm)
     return wm->GetMostRecentWindow(aType, aWindow);
   return NS_ERROR_FAILURE;
 }
@@ -446,17 +446,17 @@ nsNativeAppSupportUnix::Start(PRBool *aR
                      gtk_minor_version,
                      MIN_GTK_MAJOR_VERSION,
                      MIN_GTK_MINOR_VERSION);
     gtk_dialog_run(GTK_DIALOG(versionErrDialog));
     gtk_widget_destroy(versionErrDialog);
     exit(0);
   }
 
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
   /* zero state out. */
   memset(&m_hw_state, 0, sizeof(osso_hw_state_t));
 
   /* Initialize maemo application
      
      The initalization name will be of the form "Vendor.Name".
      If a Vendor isn't given, then we will just use "Name".
      
@@ -595,17 +595,17 @@ nsNativeAppSupportUnix::Start(PRBool *aR
 }
 
 NS_IMETHODIMP
 nsNativeAppSupportUnix::Stop(PRBool *aResult)
 {
   NS_ENSURE_ARG(aResult);
   *aResult = PR_TRUE;
 
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
   if (m_osso_context) {
     // Disable the accelerometer when closing
     OssoRequestAccelerometer(m_osso_context, PR_FALSE);
 
     // Remove the MCE callback filter
     DBusConnection *connnection = (DBusConnection*)osso_get_sys_dbus_connection(m_osso_context);
     dbus_connection_remove_filter(connnection, OssoModeControlCallback, nsnull);
 
@@ -616,17 +616,17 @@ nsNativeAppSupportUnix::Stop(PRBool *aRe
   }
 #endif
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeAppSupportUnix::Enable()
 {
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
   // Enable the accelerometer for orientation support
   if (OssoIsScreenOn(m_osso_context))
       OssoRequestAccelerometer(m_osso_context, PR_TRUE);
 #endif
   return NS_OK;
 }
 
 nsresult
--- a/widget/src/gtk2/nsFilePicker.cpp
+++ b/widget/src/gtk2/nsFilePicker.cpp
@@ -51,17 +51,17 @@
 #include "mozcontainer.h"
 
 #include "prmem.h"
 #include "prlink.h"
 
 #include "nsFilePicker.h"
 #include "nsAccessibilityHelper.h"
 
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
 #include <hildon-fm-2/hildon/hildon-file-chooser-dialog.h>
 #endif
 
 #define MAX_PREVIEW_SIZE 180
 
 nsILocalFile *nsFilePicker::mPrevDisplayDirectory = nsnull;
 
 // XXXdholbert -- this function is duplicated in nsPrintDialogGTK.cpp
@@ -429,17 +429,17 @@ nsFilePicker::Show(PRInt16 *aReturn)
   nsXPIDLCString title;
   title.Adopt(ToNewUTF8String(mTitle));
 
   GtkWindow *parent_widget = get_gtk_window_for_nsiwidget(mParentWidget);
 
   GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
   const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
                                ? GTK_STOCK_SAVE : GTK_STOCK_OPEN;
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
   GtkWidget *file_chooser =
     hildon_file_chooser_dialog_new_with_properties(parent_widget,
                                                    "action", action,
                                                    "open-button-text", accept_button,
                                                    NULL);
   gtk_window_set_title(GTK_WINDOW(file_chooser), title);
 #else
   GtkWidget *file_chooser =
--- a/widget/src/gtk2/nsGtkIMModule.cpp
+++ b/widget/src/gtk2/nsGtkIMModule.cpp
@@ -553,17 +553,17 @@ nsGtkIMModule::SetInputMode(nsWindow* aC
     mIMEContext = *aContext;
 
     // Even when aState is not enabled state, we need to set IME focus.
     // Because some IMs are updating the status bar of them at this time.
     // Be aware, don't use aWindow here because this method shouldn't move
     // focus actually.
     Focus();
 
-#ifdef MOZ_PLATFORM_MAEMO
+#if (MOZ_PLATFORM_MAEMO == 5)
     GtkIMContext *im = GetContext();
     if (im) {
         if (IsEnabled()) {
             // It is not desired that the hildon's autocomplete mechanism displays
             // user previous entered passwds, so lets make completions invisible
             // in these cases.
             int mode;
             g_object_get(G_OBJECT(im), "hildon-input-mode", &mode, NULL);