Bug 534644 - implement Qt ipc/chromium backend, first part. r=benjamin, r=jones.chris.g

This commit is contained in:
Oleg Romashin 2010-01-28 07:22:41 +02:00
parent 6836e30944
commit 9a4397fa5b
9 changed files with 39 additions and 25 deletions

View file

@ -123,4 +123,6 @@ endif
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(TK_CFLAGS)
DEFINES += -DFORCE_PR_LOG DEFINES += -DFORCE_PR_LOG

View file

@ -42,6 +42,11 @@
#if defined(MOZ_WIDGET_GTK2) #if defined(MOZ_WIDGET_GTK2)
# include <gdk/gdkx.h> # include <gdk/gdkx.h>
#elif defined(MOZ_WIDGET_QT)
// X11/X.h has #define CursorShape 0, but Qt's qnamespace.h defines
// enum CursorShape { ... }. Good times!
# undef CursorShape
# include <QX11Info>
#else #else
# error Implement me for your toolkit # error Implement me for your toolkit
#endif #endif
@ -114,18 +119,24 @@ private:
{ {
// TODO: get Display* from Window in |ev| // TODO: get Display* from Window in |ev|
// FIXME: do this using Xlib, don't use Gdk // FIXME: do this using Xlib
#if defined(MOZ_WIDGET_GTK2)
return GDK_DISPLAY(); return GDK_DISPLAY();
#elif defined(MOZ_WIDGET_QT)
return QX11Info::display();
#endif
} }
static Display* GetXDisplay(const XErrorEvent& ev) static Display* GetXDisplay(const XErrorEvent& ev)
{ {
// TODO: get Display* from Window in |ev| // TODO: get Display* from Window in |ev|
// FIXME: do this using Xlib, don't use Gdk // FIXME: do this using Xlib
#if defined(MOZ_WIDGET_GTK2)
return GDK_DISPLAY(); return GDK_DISPLAY();
#elif defined(MOZ_WIDGET_QT)
return QX11Info::display();
#endif
} }
static void SetXDisplay(XEvent& ev) static void SetXDisplay(XEvent& ev)

View file

@ -39,7 +39,7 @@
#include "mozilla/plugins/PluginModuleChild.h" #include "mozilla/plugins/PluginModuleChild.h"
#ifdef OS_LINUX #ifdef MOZ_WIDGET_GTK2
#include <gtk/gtk.h> #include <gtk/gtk.h>
#endif #endif
@ -234,7 +234,7 @@ bool
PluginModuleChild::InitGraphics() PluginModuleChild::InitGraphics()
{ {
// FIXME/cjones: is this the place for this? // FIXME/cjones: is this the place for this?
#if defined(OS_LINUX) #if defined(MOZ_WIDGET_GTK2)
gtk_init(0, 0); gtk_init(0, 0);
// GtkPlug is a static class so will leak anyway but this ref makes sure. // GtkPlug is a static class so will leak anyway but this ref makes sure.

View file

@ -246,14 +246,8 @@ CPPSRCS += \
file_util_linux.cc \ file_util_linux.cc \
file_version_info_linux.cc \ file_version_info_linux.cc \
idle_timer_none.cc \ idle_timer_none.cc \
message_pump_glib.cc \
process_util_linux.cc \ process_util_linux.cc \
time_posix.cc \ time_posix.cc \
chrome_paths_linux.cc \
owned_widget_gtk.cc \
platform_util_linux.cc \
transport_dib_linux.cc \
x11_util.cc \
$(NULL) $(NULL)
endif # } OS_LINUX endif # } OS_LINUX

View file

@ -19,7 +19,7 @@
#if defined(OS_POSIX) #if defined(OS_POSIX)
#include "base/message_pump_libevent.h" #include "base/message_pump_libevent.h"
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) && !defined(CHROMIUM_MOZILLA_BUILD)
#include "base/message_pump_glib.h" #include "base/message_pump_glib.h"
#endif #endif
@ -112,7 +112,7 @@ MessageLoop::MessageLoop(Type type)
if (type_ == TYPE_UI) { if (type_ == TYPE_UI) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
pump_ = base::MessagePumpMac::Create(); pump_ = base::MessagePumpMac::Create();
#elif defined(OS_LINUX) #elif defined(OS_LINUX) && !defined(CHROMIUM_MOZILLA_BUILD)
pump_ = new base::MessagePumpForUI(); pump_ = new base::MessagePumpForUI();
#endif // OS_LINUX #endif // OS_LINUX
} else if (type_ == TYPE_IO) { } else if (type_ == TYPE_IO) {

View file

@ -32,6 +32,7 @@ bool GetGearsPluginPathFromCommandLine(FilePath* path) {
} }
bool PathProvider(int key, FilePath* result) { bool PathProvider(int key, FilePath* result) {
#ifndef CHROMIUM_MOZILLA_BUILD
// Some keys are just aliases... // Some keys are just aliases...
switch (key) { switch (key) {
case chrome::DIR_APP: case chrome::DIR_APP:
@ -211,6 +212,7 @@ bool PathProvider(int key, FilePath* result) {
return false; return false;
*result = cur; *result = cur;
#endif
return true; return true;
} }

View file

@ -100,3 +100,7 @@ export:: $(ALL_IPDLSRCS)
--outcpp-dir=. \ --outcpp-dir=. \
$(IPDLDIRS:%=-I$(topsrcdir)/%) \ $(IPDLDIRS:%=-I$(topsrcdir)/%) \
$^ $^
# We #include some things in the dom/plugins/ directory that rely on
# toolkit libraries.
CXXFLAGS += $(TK_CFLAGS)

View file

@ -211,15 +211,10 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_JS_LIBS) \ $(MOZ_JS_LIBS) \
$(NULL) $(NULL)
ifdef MOZ_ENABLE_GTK2 EXTRA_DSO_LDOPTS += $(TK_LIBS)
EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) \
-lXrender \
$(NULL)
endif
ifdef MOZ_ENABLE_QT ifdef MOZ_ENABLE_GTK2
EXTRA_DSO_LDOPTS += $(MOZ_QT_LIBS) \ EXTRA_DSO_LDOPTS += -lXrender
$(NULL)
endif endif
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

View file

@ -125,8 +125,14 @@ DEFINES += -DGENERIC_MOTIF_REDEFINES
OS_CXXFLAGS += -Wc,warn=disa=NOSIMPINT OS_CXXFLAGS += -Wc,warn=disa=NOSIMPINT
endif endif
CXXFLAGS += $(TK_CFLAGS)
EXTRA_DSO_LDOPTS += $(TK_LIBS)
ifdef MOZ_ENABLE_GTK2 ifdef MOZ_ENABLE_GTK2
CXXFLAGS += $(MOZ_GTK2_CFLAGS) EXTRA_DSO_LDOPTS += -lgtkxtbin $(XLDFLAGS) $(XT_LIBS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS)
CFLAGS += $(MOZ_GTK2_CFLAGS)
EXTRA_DSO_LDOPTS += -lgtkxtbin $(XLDFLAGS) $(XT_LIBS) $(MOZ_GTK2_LIBS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS)
endif #MOZ_ENABLE_GTK2 endif #MOZ_ENABLE_GTK2
ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
EXTRA_DSO_LDOPTS += $(XEXT_LIBS) $(XCOMPOSITE_LIBS)
endif