Bug 1256988 - Fix #endif comments for MOZ_WIDGET_GTK draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 13:54:15 +0900
changeset 341008 3d297aad19b8ba42bc658cbc909f83d2fe8c2142
parent 341007 e930152af66aa9ff58a9265208647dafbf61b53e
child 341009 e4f1342e73f7bb5de70110fd47b8cf698b9063e3
push id13117
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 11:04:10 +0000
bugs1256988
milestone48.0a1
Bug 1256988 - Fix #endif comments for MOZ_WIDGET_GTK
dom/plugins/base/nsPluginsDirUnix.cpp
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFontconfigFonts.cpp
toolkit/mozapps/downloads/nsHelperAppDlg.js
widget/gtk/nsWindow.cpp
--- a/dom/plugins/base/nsPluginsDirUnix.cpp
+++ b/dom/plugins/base/nsPluginsDirUnix.cpp
@@ -199,17 +199,17 @@ static void LoadExtraSharedLibs()
                 // otherwise it'll decrease performance by calling popen() in SearchForSoname
                 // every time for each bogus name
                 prefs->SetCharPref(PREF_PLUGINS_SONAME, (const char *)sonameListToSave);
             }
             PL_strfree(sonameList);
         }
     }
 }
-#endif //MOZ_WIDGET_GTK2
+#endif //MOZ_WIDGET_GTK == 2
 
 /* nsPluginsDir implementation */
 
 bool nsPluginsDir::IsPluginFile(nsIFile* file)
 {
     nsAutoCString filename;
     if (NS_FAILED(file->GetNativeLeafName(filename)))
         return false;
@@ -297,17 +297,17 @@ nsresult nsPluginFile::LoadPlugin(PRLibr
         if (!pLibrary) {
             DisplayPR_LoadLibraryErrorMessage(libSpec.value.pathname);
             return NS_ERROR_FAILURE;
         }
     }
 #else
     *outLibrary = PR_LoadLibraryWithFlags(libSpec, 0);
     pLibrary = *outLibrary;
-#endif  // MOZ_WIDGET_GTK2
+#endif  // MOZ_WIDGET_GTK == 2
 
 #ifdef DEBUG
     printf("LoadPlugin() %s returned %lx\n", 
            libSpec.value.pathname, (unsigned long)pLibrary);
 #endif
 
     if (!pLibrary) {
         return NS_ERROR_FAILURE;
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1674,9 +1674,9 @@ static void
 ApplyGdkScreenFontOptions(FcPattern *aPattern)
 {
     const cairo_font_options_t *options =
         gdk_screen_get_font_options(gdk_screen_get_default());
 
     cairo_ft_font_options_substitute(options, aPattern);
 }
 
-#endif // MOZ_WIDGET_GTK2
+#endif // MOZ_WIDGET_GTK
--- a/gfx/thebes/gfxFontconfigFonts.cpp
+++ b/gfx/thebes/gfxFontconfigFonts.cpp
@@ -2257,17 +2257,17 @@ static void
 ApplyGdkScreenFontOptions(FcPattern *aPattern)
 {
     const cairo_font_options_t *options =
         gdk_screen_get_font_options(gdk_screen_get_default());
 
     cairo_ft_font_options_substitute(options, aPattern);
 }
 
-#endif // MOZ_WIDGET_GTK2
+#endif // MOZ_WIDGET_GTK
 
 #ifdef USE_SKIA
 already_AddRefed<mozilla::gfx::GlyphRenderingOptions>
 gfxFcFont::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams)
 {
   cairo_scaled_font_t *scaled_font = CairoScaledFont();
   cairo_font_options_t *options = cairo_font_options_create();
   cairo_scaled_font_get_font_options(scaled_font, options);
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -1095,17 +1095,17 @@ nsUnknownContentTypeDialog.prototype = {
       if (fp.show() == nsIFilePicker.returnOK && fp.file) {
         // Remember the file they chose to run.
         var localHandlerApp =
           Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
                      createInstance(Components.interfaces.nsILocalHandlerApp);
         localHandlerApp.executable = fp.file;
         this.chosenApp = localHandlerApp;
       }
-#endif // MOZ_WIDGET_GTK3
+#endif // MOZ_WIDGET_GTK == 3
     }
     this.finishChooseApp();
   },
 
   // Turn this on to get debugging messages.
   debug: false,
 
   // Dump text (if debug is on).
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -747,17 +747,17 @@ nsWindow::Destroy(void)
         gFocusWindow = nullptr;
     }
 
 #if (MOZ_WIDGET_GTK == 2) && defined(MOZ_X11)
     // make sure that we remove ourself as the plugin focus window
     if (gPluginFocusWindow == this) {
         gPluginFocusWindow->LoseNonXEmbedPluginFocus();
     }
-#endif /* MOZ_X11 && MOZ_WIDGET_GTK2 */
+#endif /* MOZ_X11 && MOZ_WIDGET_GTK == 2 && defined(MOZ_X11) */
 
     GtkWidget *owningWidget = GetMozContainerWidget();
     if (mShell) {
         gtk_widget_destroy(mShell);
         mShell = nullptr;
         mContainer = nullptr;
         MOZ_ASSERT(!mGdkWindow,
                    "mGdkWindow should be NULL when mContainer is destroyed");
@@ -2593,17 +2593,17 @@ nsWindow::OnMotionNotifyEvent(GdkEventMo
             XNextEvent (GDK_WINDOW_XDISPLAY(aEvent->window), &xevent);
         }
 #if (MOZ_WIDGET_GTK == 2)
         // if plugins still keeps the focus, get it back
         if (gPluginFocusWindow && gPluginFocusWindow != this) {
             RefPtr<nsWindow> kungFuDeathGrip = gPluginFocusWindow;
             gPluginFocusWindow->LoseNonXEmbedPluginFocus();
         }
-#endif /* MOZ_WIDGET_GTK2 */
+#endif /* MOZ_WIDGET_GTK == 2 */
     }
 #endif /* MOZ_X11 */
 
     WidgetMouseEvent event(true, eMouseMove, this, WidgetMouseEvent::eReal);
 
     gdouble pressure = 0;
     gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure);
     // Sometime gdk generate 0 pressure value between normal values
@@ -2921,17 +2921,17 @@ nsWindow::OnContainerFocusOutEvent(GdkEv
     }
 
 #if (MOZ_WIDGET_GTK == 2) && defined(MOZ_X11)
     // plugin lose focus
     if (gPluginFocusWindow) {
         RefPtr<nsWindow> kungFuDeathGrip = gPluginFocusWindow;
         gPluginFocusWindow->LoseNonXEmbedPluginFocus();
     }
-#endif /* MOZ_X11 && MOZ_WIDGET_GTK2 */
+#endif /* MOZ_X11 && MOZ_WIDGET_GTK == 2 */
 
     if (gFocusWindow) {
         RefPtr<nsWindow> kungFuDeathGrip = gFocusWindow;
         if (gFocusWindow->mIMContext) {
             gFocusWindow->mIMContext->OnBlurWindow(gFocusWindow);
         }
         gFocusWindow = nullptr;
     }
@@ -4506,17 +4506,17 @@ nsWindow::ApplyTransparencyBitmap()
                                                      GetBitmapStride(mTransparencyBitmapWidth));
     if (!maskBitmap)
         return;
 
     cairo_region_t * maskRegion = gdk_cairo_region_create_from_surface(maskBitmap);
     gtk_widget_shape_combine_region(mShell, maskRegion);
     cairo_region_destroy(maskRegion);
     cairo_surface_destroy(maskBitmap);
-#endif // MOZ_WIDGET_GTK2
+#endif // MOZ_WIDGET_GTK == 2
 #endif // MOZ_X11
 }
 
 void
 nsWindow::ClearTransparencyBitmap()
 {
     if (!mTransparencyBitmap)
         return;
@@ -5497,17 +5497,17 @@ expose_event_cb(GtkWidget *widget, cairo
         [](gpointer data) -> gboolean {
             g_object_unref(data);
             return G_SOURCE_REMOVE;
         },
         widget);
 
     return FALSE;
 }
-#endif //MOZ_WIDGET_GTK2
+#endif //MOZ_WIDGET_GTK == 2
 
 static gboolean
 configure_event_cb(GtkWidget *widget,
                    GdkEventConfigure *event)
 {
     RefPtr<nsWindow> window = get_window_for_gtk_widget(widget);
     if (!window)
         return FALSE;