webkit-fix-compilation-on-DirectFB.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. From 91a2bf4c3a21720a27223ba293ba90f58c349959 Mon Sep 17 00:00:00 2001
  2. From: Lionel Landwerlin <llandwerlin@gmail.com>
  3. Date: Sun, 11 Apr 2010 14:38:57 +0200
  4. Subject: [PATCH] Fix compilation with DirectFB
  5. Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
  6. ---
  7. GNUmakefile.am | 2 ++
  8. WebCore/plugins/PluginView.h | 6 +++---
  9. WebCore/plugins/gtk/PluginViewGtk.cpp | 17 ++++++++---------
  10. 3 files changed, 13 insertions(+), 12 deletions(-)
  11. diff --git a/GNUmakefile.am b/GNUmakefile.am
  12. index 3bdfe53..8626bbb 100644
  13. --- a/GNUmakefile.am
  14. +++ b/GNUmakefile.am
  15. @@ -122,8 +122,10 @@ corekit_cppflags += \
  16. # For the Gtk port we want to use XP_UNIX both in X11 and Mac
  17. if !TARGET_WIN32
  18. +if !TARGET_DIRECTFB
  19. corekit_cppflags += -DXP_UNIX
  20. endif
  21. +endif
  22. # Default compiler flags
  23. global_cflags += \
  24. diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
  25. index 21a25f6..8116864 100644
  26. --- a/WebCore/plugins/PluginView.h
  27. +++ b/WebCore/plugins/PluginView.h
  28. @@ -22,7 +22,7 @@
  29. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  30. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. #ifndef PluginView_h
  36. @@ -312,7 +312,7 @@ namespace WebCore {
  37. bool m_haveInitialized;
  38. bool m_isWaitingToStart;
  39. -#if defined(XP_UNIX)
  40. +#if defined(XP_UNIX) || PLATFORM(DIRECTFB)
  41. bool m_needsXEmbed;
  42. #endif
  43. @@ -340,7 +340,7 @@ public:
  44. private:
  45. -#if defined(XP_UNIX) || OS(SYMBIAN)
  46. +#if defined(XP_UNIX) || OS(SYMBIAN) || PLATFORM(DIRECTFB)
  47. void setNPWindowIfNeeded();
  48. #elif defined(XP_MACOSX)
  49. NP_CGContext m_npCgContext;
  50. diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
  51. index 8de63e0..039a845 100644
  52. --- a/WebCore/plugins/gtk/PluginViewGtk.cpp
  53. +++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
  54. @@ -23,7 +23,7 @@
  55. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  56. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  57. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  58. - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  59. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  60. */
  61. #include "config.h"
  62. @@ -45,6 +45,7 @@
  63. #include "Image.h"
  64. #include "KeyboardEvent.h"
  65. #include "MouseEvent.h"
  66. +#include "NotImplemented.h"
  67. #include "Page.h"
  68. #include "PlatformKeyboardEvent.h"
  69. #include "PlatformMouseEvent.h"
  70. @@ -137,7 +138,7 @@ void PluginView::updatePluginWidget()
  71. if (!m_isWindowed) {
  72. if (m_drawable)
  73. XFreePixmap(GDK_DISPLAY(), m_drawable);
  74. -
  75. +
  76. m_drawable = XCreatePixmap(GDK_DISPLAY(), getRootWindow(m_parentFrame.get()),
  77. m_windowRect.width(), m_windowRect.height(),
  78. ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
  79. @@ -571,7 +572,7 @@ NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const c
  80. //FIXME - read the file data into buffer
  81. FILE* fileHandle = fopen((filename.utf8()).data(), "r");
  82. -
  83. +
  84. if (fileHandle == 0)
  85. return NPERR_FILE_NOT_FOUND;
  86. @@ -706,6 +707,7 @@ void PluginView::forceRedraw()
  87. gtk_widget_queue_draw(m_parentFrame->view()->hostWindow()->platformPageClient());
  88. }
  89. +#if defined(XP_UNIX)
  90. static Display* getPluginDisplay()
  91. {
  92. // The plugin toolkit might have a different X connection open. Since we're
  93. @@ -713,14 +715,9 @@ static Display* getPluginDisplay()
  94. // plugins, so we can return that. We might want to add other implementations here
  95. // later.
  96. -#if defined(XP_UNIX)
  97. return GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
  98. -#else
  99. - return 0;
  100. -#endif
  101. }
  102. -#if defined(XP_UNIX)
  103. static void getVisualAndColormap(int depth, Visual** visual, Colormap* colormap)
  104. {
  105. *visual = 0;
  106. @@ -794,9 +791,9 @@ bool PluginView::platformStart()
  107. }
  108. if (m_isWindowed) {
  109. -#if defined(XP_UNIX)
  110. GtkWidget* pageClient = m_parentFrame->view()->hostWindow()->platformPageClient();
  111. +#if defined(XP_UNIX)
  112. if (m_needsXEmbed) {
  113. // If our parent is not anchored the startup process will
  114. // fail miserably for XEmbed plugins a bit later on when
  115. @@ -817,7 +814,9 @@ bool PluginView::platformStart()
  116. #endif
  117. } else {
  118. setPlatformWidget(0);
  119. +#if defined(XP_UNIX)
  120. m_pluginDisplay = getPluginDisplay();
  121. +#endif
  122. }
  123. show();
  124. --
  125. 1.7.0.4