Backout a07e9d98a7c6 (Bug 627699) due to build bustage.

This commit is contained in:
Ryan VanderMeulen 2012-06-21 20:56:10 -04:00
parent 8a6d5f1515
commit 7990326241
11 changed files with 51 additions and 66 deletions

View File

@ -50,7 +50,7 @@
#include "nsIMarkupDocumentViewer.h"
#include "nsClientRect.h"
#if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK)
#if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK2)
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#endif
@ -213,8 +213,8 @@ nsDOMWindowUtils::Redraw(PRUint32 aCount, PRUint32 *aDurationOut)
for (PRUint32 i = 0; i < aCount; i++)
rootFrame->InvalidateWithFlags(r, nsIFrame::INVALIDATE_IMMEDIATE);
#if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK)
XSync(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False);
#if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK2)
XSync(GDK_DISPLAY(), False);
#endif
*aDurationOut = PR_IntervalToMilliseconds(PR_IntervalNow() - iStart);

View File

@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
#include <gtk/gtk.h>
#endif
@ -218,7 +218,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
base::ProcessHandle aParentHandle,
IPC::Channel* aChannel)
{
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
// sigh
gtk_init(NULL, NULL);
#endif

View File

@ -56,13 +56,11 @@
#endif
// needed for nppdf plugin
#if (MOZ_WIDGET_GTK)
#ifdef MOZ_WIDGET_GTK2
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#if (MOZ_WIDGET_GTK == 2)
#include "gtk2xtbin.h"
#endif
#endif
#ifdef XP_OS2
#define INCL_DOS
@ -2015,7 +2013,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
}
case NPNVToolkit: {
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
*((NPNToolkitType*)result) = NPNVGtk2;
#endif
@ -2030,7 +2028,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
}
case NPNVSupportsXEmbedBool: {
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
*(NPBool*)result = true;
#elif defined(MOZ_WIDGET_QT)
// Desktop Flash fail to initialize if browser does not support NPNVSupportsXEmbedBool
@ -2057,7 +2055,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
case NPNVSupportsWindowless: {
#if defined(XP_WIN) || defined(XP_MACOSX) || \
(defined(MOZ_X11) && (defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)))
(defined(MOZ_X11) && (defined(MOZ_WIDGET_GTK2) || defined(MOZ_WIDGET_QT)))
*(NPBool*)result = true;
#else
*(NPBool*)result = false;

View File

@ -734,7 +734,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetNetscapeWindow(void *value)
}
return rv;
#elif (defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)) && defined(MOZ_X11)
#elif (defined(MOZ_WIDGET_GTK2) || defined(MOZ_WIDGET_QT)) && defined(MOZ_X11)
// X11 window managers want the toplevel window for WM_TRANSIENT_FOR.
nsIWidget* win = mObjectFrame->GetNearestWidget();
if (!win)
@ -2432,7 +2432,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
nsIntPoint rootPoint(-1,-1);
if (widget)
rootPoint = anEvent.refPoint + widget->WidgetToScreenOffset();
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
Window root = GDK_ROOT_WINDOW();
#elif defined(MOZ_WIDGET_QT)
Window root = RootWindowOfScreen(DefaultScreenOfDisplay(mozilla::DefaultXDisplay()));
@ -2520,7 +2520,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
if (anEvent.pluginEvent)
{
XKeyEvent &event = pluginEvent.xkey;
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
event.root = GDK_ROOT_WINDOW();
event.time = anEvent.time;
const GdkEventKey* gdkEvent =
@ -3046,11 +3046,17 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext,
aContext->Translate(pluginRect.TopLeft());
Renderer renderer(window, this, pluginSize, pluginDirtyRect);
#ifdef MOZ_WIDGET_GTK2
// This is the visual used by the widgets, 24-bit if available.
GdkVisual* gdkVisual = gdk_rgb_get_visual();
Visual* visual = gdk_x11_visual_get_xvisual(gdkVisual);
Screen* screen =
gdk_x11_screen_get_xscreen(gdk_visual_get_screen(gdkVisual));
#else
Display* dpy = mozilla::DefaultXDisplay();
Screen* screen = DefaultScreenOfDisplay(dpy);
Visual* visual = DefaultVisualOfScreen(screen);
#endif
renderer.Draw(aContext, nsIntSize(window->width, window->height),
rendererFlags, screen, visual, nsnull);
}

View File

@ -16,7 +16,6 @@
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#include "gtk2compat.h"
#include "gtk2xtbin.h"
class nsPluginNativeWindowGtk2 : public nsPluginNativeWindow {
@ -148,8 +147,8 @@ nsresult nsPluginNativeWindowGtk2::CallSetWindow(nsRefPtr<nsNPAPIPluginInstance>
nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow() {
NS_ASSERTION(!mSocketWidget,"Already created a socket widget!");
GdkDisplay *display = gdk_display_get_default();
GdkWindow *parent_win = gdk_x11_window_lookup_for_display(display, (XID)window);
GdkWindow *parent_win = gdk_window_lookup((XID)window);
mSocketWidget = gtk_socket_new();
//attach the socket to the container widget
@ -180,10 +179,7 @@ nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow() {
// background and this would happen immediately (before the plug is
// created). Setting the background to None prevents the server from
// painting this window, avoiding flicker.
// TODO GTK3
#if (MOZ_WIDGET_GTK == 2)
gdk_window_set_back_pixmap(gtk_widget_get_window(mSocketWidget), NULL, FALSE);
#endif
gdk_window_set_back_pixmap(mSocketWidget->window, NULL, FALSE);
// Resize before we show
SetAllocation();
@ -200,17 +196,11 @@ nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow() {
return NS_ERROR_FAILURE;
mWsInfo.display = GDK_WINDOW_XDISPLAY(gdkWindow);
#if (MOZ_WIDGET_GTK == 2)
mWsInfo.colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(gdkWindow));
GdkVisual* gdkVisual = gdk_drawable_get_visual(gdkWindow);
mWsInfo.depth = gdkVisual->depth;
#else
mWsInfo.colormap = None;
GdkVisual* gdkVisual = gdk_window_get_visual(gdkWindow);
mWsInfo.depth = gdk_visual_get_depth(gdkVisual);
#endif
mWsInfo.visual = GDK_VISUAL_XVISUAL(gdkVisual);
mWsInfo.depth = gdkVisual->depth;
return NS_OK;
}
@ -233,8 +223,7 @@ nsresult nsPluginNativeWindowGtk2::CreateXtWindow() {
printf("About to create new xtbin of %i X %i from %p...\n",
width, height, (void*)window);
#endif
GdkDisplay *display = gdk_display_get_default();
GdkWindow *gdkWindow = gdk_x11_window_lookup_for_display(display, (XID)window);
GdkWindow *gdkWindow = gdk_window_lookup((XID)window);
mSocketWidget = gtk_xtbin_new(gdkWindow, 0);
// Check to see if creating the xtbin failed for some reason.
// if it did, we can't go any further.
@ -281,9 +270,8 @@ socket_unrealize_cb(GtkWidget *widget, gpointer data)
{
// Unmap and reparent any child windows that GDK does not yet know about.
// (See bug 540114 comment 10.)
GdkWindow* socket_window = gtk_widget_get_window(widget);
GdkDisplay* gdkDisplay = gdk_display_get_default();
Display* display = GDK_DISPLAY_XDISPLAY(gdkDisplay);
GdkWindow* socket_window = widget->window;
Display* display = GDK_DISPLAY();
// Ignore X errors that may happen if windows get destroyed (possibly
// requested by the plugin) between XQueryTree and when we operate on them.
@ -292,13 +280,13 @@ socket_unrealize_cb(GtkWidget *widget, gpointer data)
Window root, parent;
Window* children;
unsigned int nchildren;
if (!XQueryTree(display, gdk_x11_window_get_xid(socket_window),
if (!XQueryTree(display, gdk_x11_drawable_get_xid(socket_window),
&root, &parent, &children, &nchildren))
return;
for (unsigned int i = 0; i < nchildren; ++i) {
Window child = children[i];
if (!gdk_x11_window_lookup_for_display(gdkDisplay, child)) {
if (!gdk_window_lookup(child)) {
// This window is not known to GDK.
XUnmapWindow(display, child);
XReparentWindow(display, child, DefaultRootWindow(display), 0, 0);

View File

@ -44,12 +44,9 @@ using mozilla::ipc::ProcessChild;
using namespace mozilla::plugins;
using namespace std;
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
#include <gtk/gtk.h>
#if (MOZ_WIDGET_GTK == 3)
#include <gtk/gtkx.h>
#endif
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#include "gtk2xtbin.h"

View File

@ -36,7 +36,7 @@ extern const PRUnichar* kOOPPPluginFocusEventId;
UINT gOOPPPluginFocusEvent =
RegisterWindowMessage(kOOPPPluginFocusEventId);
extern const PRUnichar* kFlashFullscreenClass;
#elif defined(MOZ_WIDGET_GTK)
#elif defined(MOZ_WIDGET_GTK2)
#include <gdk/gdk.h>
#elif defined(XP_MACOSX)
#include <ApplicationServices/ApplicationServices.h>
@ -1268,7 +1268,7 @@ PluginInstanceParent::NPP_HandleEvent(void* event)
// Release any active pointer grab so that the plugin X client can
// grab the pointer if it wishes.
Display *dpy = DefaultXDisplay();
# ifdef MOZ_WIDGET_GTK
# ifdef MOZ_WIDGET_GTK2
// GDK attempts to (asynchronously) track whether there is an active
// grab so ungrab through GDK.
gdk_pointer_ungrab(npevent->xbutton.time);

View File

@ -17,12 +17,8 @@
#include "mozilla/ipc/SyncChannel.h"
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
#include <gtk/gtk.h>
#if (MOZ_WIDGET_GTK == 3)
#include <gtk/gtkx.h>
#endif
#include "gtk2compat.h"
#endif
#include "nsIFile.h"
@ -94,7 +90,7 @@ PluginModuleChild::PluginModuleChild()
, mInitializeFunc(0)
#if defined(OS_WIN) || defined(OS_MACOSX)
, mGetEntryPointsFunc(0)
#elif defined(MOZ_WIDGET_GTK)
#elif defined(MOZ_WIDGET_GTK2)
, mNestedLoopTimerId(0)
#elif defined(MOZ_WIDGET_QT)
, mNestedLoopTimerObject(0)
@ -233,7 +229,7 @@ PluginModuleChild::Init(const std::string& aPluginFilename,
return true;
}
#if defined(MOZ_WIDGET_GTK)
#if defined(MOZ_WIDGET_GTK2)
typedef void (*GObjectDisposeFn)(GObject*);
typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
@ -273,16 +269,16 @@ wrap_gtk_plug_dispose(GObject* object) {
static gboolean
gtk_plug_scroll_event(GtkWidget *widget, GdkEventScroll *gdk_event)
{
if (!gtk_widget_is_toplevel(widget)) // in same process as its GtkSocket
if (!GTK_WIDGET_TOPLEVEL(widget)) // in same process as its GtkSocket
return FALSE; // event not handled; propagate to GtkSocket
GdkWindow* socket_window = gtk_plug_get_socket_window(GTK_PLUG(widget));
GdkWindow* socket_window = GTK_PLUG(widget)->socket_window;
if (!socket_window)
return FALSE;
// Propagate the event to the embedder.
GdkScreen* screen = gdk_window_get_screen(socket_window);
GdkWindow* plug_window = gtk_widget_get_window(widget);
GdkScreen* screen = gdk_drawable_get_screen(socket_window);
GdkWindow* plug_window = widget->window;
GdkWindow* event_window = gdk_event->window;
gint x = gdk_event->x;
gint y = gdk_event->y;
@ -328,9 +324,9 @@ gtk_plug_scroll_event(GtkWidget *widget, GdkEventScroll *gdk_event)
memset(&xevent, 0, sizeof(xevent));
xevent.xbutton.type = ButtonPress;
xevent.xbutton.window = gdk_x11_window_get_xid(socket_window);
xevent.xbutton.root = gdk_x11_window_get_xid(gdk_screen_get_root_window(screen));
xevent.xbutton.subwindow = gdk_x11_window_get_xid(plug_window);
xevent.xbutton.window = GDK_WINDOW_XWINDOW(socket_window);
xevent.xbutton.root = GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen));
xevent.xbutton.subwindow = GDK_WINDOW_XWINDOW(plug_window);
xevent.xbutton.time = gdk_event->time;
xevent.xbutton.x = x;
xevent.xbutton.y = y;
@ -358,7 +354,7 @@ gtk_plug_scroll_event(GtkWidget *widget, GdkEventScroll *gdk_event)
static void
wrap_gtk_plug_embedded(GtkPlug* plug) {
GdkWindow* socket_window = gtk_plug_get_socket_window(plug);
GdkWindow* socket_window = plug->socket_window;
if (socket_window) {
if (gtk_check_version(2,18,7) != NULL // older
&& g_object_get_data(G_OBJECT(socket_window),
@ -501,7 +497,7 @@ PluginModuleChild::ShouldContinueFromReplyTimeout()
bool
PluginModuleChild::InitGraphics()
{
#if defined(MOZ_WIDGET_GTK)
#if defined(MOZ_WIDGET_GTK2)
// Work around plugins that don't interact well with GDK
// client-side windows.
PR_SetEnv("GDK_NATIVE_WINDOWS=1");
@ -1076,7 +1072,7 @@ _getvalue(NPP aNPP,
switch (aVariable) {
// Copied from nsNPAPIPlugin.cpp
case NPNVToolkit:
#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
#if defined(MOZ_WIDGET_GTK2) || defined(MOZ_WIDGET_QT)
*static_cast<NPNToolkitType*>(aValue) = NPNVGtk2;
return NPERR_NO_ERROR;
#endif

View File

@ -306,7 +306,7 @@ private:
void InitQuirksModes(const nsCString& aMimeType);
bool InitGraphics();
void DeinitGraphics();
#if defined(MOZ_WIDGET_GTK)
#if defined(MOZ_WIDGET_GTK2)
static gboolean DetectNestedEventLoop(gpointer data);
static gboolean ProcessBrowserEvents(gpointer data);
@ -340,7 +340,7 @@ private:
NPPluginFuncs mFunctions;
NPSavedData mSavedData;
#if defined(MOZ_WIDGET_GTK)
#if defined(MOZ_WIDGET_GTK2)
// If a plugin spins a nested glib event loop in response to a
// synchronous IPC message from the browser, the loop might break
// only after the browser responds to a request sent by the

View File

@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_WIDGET_GTK2
#include <glib.h>
#elif XP_MACOSX
#include "PluginInterposeOSX.h"
@ -964,7 +964,7 @@ PluginModuleParent::AnswerProcessSomeEvents()
return true;
}
#elif !defined(MOZ_WIDGET_GTK)
#elif !defined(MOZ_WIDGET_GTK2)
bool
PluginModuleParent::AnswerProcessSomeEvents()
{

View File

@ -3221,7 +3221,7 @@ hangPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount,
return true;
}
#if defined(MOZ_WIDGET_GTK)
#if defined(MOZ_WIDGET_GTK2)
bool
getClipboardText(NPObject* npobj, const NPVariant* args, uint32_t argCount,
NPVariant* result)