Kaydet (Commit) 9b367930 authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) Miklos Vajna

lokdocview, gtktiledviewer: Port to gtk3

Change-Id: I57f2d7b9383790e5c34fc517a905dd537519598f
üst 2a6bf436
...@@ -16,7 +16,14 @@ $(eval $(call gb_Executable_set_include,gtktiledviewer,\ ...@@ -16,7 +16,14 @@ $(eval $(call gb_Executable_set_include,gtktiledviewer,\
$(eval $(call gb_Executable_use_externals,gtktiledviewer,\ $(eval $(call gb_Executable_use_externals,gtktiledviewer,\
boost_headers \ boost_headers \
gtk \ ))
$(eval $(call gb_Executable_add_cxxflags,gtktiledviewer,\
$$(GTK3_CFLAGS) \
))
$(eval $(call gb_Executable_add_libs,gtktiledviewer,\
$(GTK3_LIBS) \
)) ))
$(eval $(call gb_Executable_use_libraries,gtktiledviewer,\ $(eval $(call gb_Executable_use_libraries,gtktiledviewer,\
......
...@@ -11,15 +11,19 @@ $(eval $(call gb_Library_Library,libreofficekitgtk)) ...@@ -11,15 +11,19 @@ $(eval $(call gb_Library_Library,libreofficekitgtk))
$(eval $(call gb_Library_use_sdk_api,libreofficekitgtk)) $(eval $(call gb_Library_use_sdk_api,libreofficekitgtk))
$(eval $(call gb_Library_use_externals,libreofficekitgtk,\
gtk \
))
$(eval $(call gb_Library_add_exception_objects,libreofficekitgtk,\ $(eval $(call gb_Library_add_exception_objects,libreofficekitgtk,\
libreofficekit/source/gtk/lokdocview \ libreofficekit/source/gtk/lokdocview \
libreofficekit/source/gtk/tilebuffer \ libreofficekit/source/gtk/tilebuffer \
)) ))
$(eval $(call gb_Library_add_cxxflags,libreofficekitgtk,\
$$(GTK3_CFLAGS) \
))
$(eval $(call gb_Library_add_libs,libreofficekitgtk,\
$(GTK3_LIBS) \
))
ifeq ($(OS),LINUX) ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,libreofficekitgtk,\ $(eval $(call gb_Library_add_libs,libreofficekitgtk,\
-ldl \ -ldl \
......
...@@ -15,7 +15,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,libreofficekit,\ ...@@ -15,7 +15,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,libreofficekit,\
CppunitTest_libreofficekit_tiledrendering \ CppunitTest_libreofficekit_tiledrendering \
)) ))
ifneq ($(ENABLE_GTK),) ifneq ($(ENABLE_GTK3),)
$(eval $(call gb_Module_add_targets,libreofficekit,\ $(eval $(call gb_Module_add_targets,libreofficekit,\
Library_libreofficekitgtk \ Library_libreofficekitgtk \
Executable_gtktiledviewer \ Executable_gtktiledviewer \
...@@ -24,7 +24,7 @@ $(eval $(call gb_Module_add_targets,libreofficekit,\ ...@@ -24,7 +24,7 @@ $(eval $(call gb_Module_add_targets,libreofficekit,\
$(eval $(call gb_Module_add_targets,libreofficekit,\ $(eval $(call gb_Module_add_targets,libreofficekit,\
Executable_tilebench \ Executable_tilebench \
)) ))
endif # ($(ENABLE_GTK),) endif # ($(ENABLE_GTK3),)
endif # ($(OS),LINUX) endif # ($(OS),LINUX)
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
#include <map> #include <map>
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h> #include <LibreOfficeKit/LibreOfficeKitGtk.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <LibreOfficeKit/LibreOfficeKitEnums.h>
...@@ -208,13 +206,13 @@ static gboolean signalFindbar(GtkWidget* /*pWidget*/, GdkEventKey* pEvent, gpoin ...@@ -208,13 +206,13 @@ static gboolean signalFindbar(GtkWidget* /*pWidget*/, GdkEventKey* pEvent, gpoin
gtk_label_set_text(GTK_LABEL(pFindbarLabel), ""); gtk_label_set_text(GTK_LABEL(pFindbarLabel), "");
switch(pEvent->keyval) switch(pEvent->keyval)
{ {
case GDK_Return: case GDK_KEY_Return:
{ {
// Search forward. // Search forward.
doSearch(/*bBackwards=*/false); doSearch(/*bBackwards=*/false);
return TRUE; return TRUE;
} }
case GDK_Escape: case GDK_KEY_Escape:
{ {
// Hide the findbar. // Hide the findbar.
gtk_widget_hide(pFindbar); gtk_widget_hide(pFindbar);
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <gdk/gdkkeysyms.h>
#include <com/sun/star/awt/Key.hpp> #include <com/sun/star/awt/Key.hpp>
#define LOK_USE_UNSTABLE_API #define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKit.h> #include <LibreOfficeKit/LibreOfficeKit.h>
...@@ -336,7 +334,7 @@ void LOKDocView_Impl::onExposedImpl(GdkEventExpose* event) ...@@ -336,7 +334,7 @@ void LOKDocView_Impl::onExposedImpl(GdkEventExpose* event)
guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels); guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels); guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
GdkRectangle aVisibleArea = event->area; GdkRectangle aVisibleArea = event->area;
cairo_t *pcairo = gdk_cairo_create(GTK_WIDGET(m_pDocView)->window); cairo_t *pcairo = gdk_cairo_create(gtk_widget_get_window(GTK_WIDGET(m_pDocView)));
aVisibleArea.x = pixelToTwip (aVisibleArea.x, m_fZoom); aVisibleArea.x = pixelToTwip (aVisibleArea.x, m_fZoom);
aVisibleArea.y = pixelToTwip (aVisibleArea.y, m_fZoom); aVisibleArea.y = pixelToTwip (aVisibleArea.y, m_fZoom);
...@@ -401,33 +399,33 @@ void LOKDocView_Impl::signalKey(GdkEventKey* pEvent) ...@@ -401,33 +399,33 @@ void LOKDocView_Impl::signalKey(GdkEventKey* pEvent)
switch (pEvent->keyval) switch (pEvent->keyval)
{ {
case GDK_BackSpace: case GDK_KEY_BackSpace:
nKeyCode = com::sun::star::awt::Key::BACKSPACE; nKeyCode = com::sun::star::awt::Key::BACKSPACE;
break; break;
case GDK_Return: case GDK_KEY_Return:
nKeyCode = com::sun::star::awt::Key::RETURN; nKeyCode = com::sun::star::awt::Key::RETURN;
break; break;
case GDK_Escape: case GDK_KEY_Escape:
nKeyCode = com::sun::star::awt::Key::ESCAPE; nKeyCode = com::sun::star::awt::Key::ESCAPE;
break; break;
case GDK_Tab: case GDK_KEY_Tab:
nKeyCode = com::sun::star::awt::Key::TAB; nKeyCode = com::sun::star::awt::Key::TAB;
break; break;
case GDK_Down: case GDK_KEY_Down:
nKeyCode = com::sun::star::awt::Key::DOWN; nKeyCode = com::sun::star::awt::Key::DOWN;
break; break;
case GDK_Up: case GDK_KEY_Up:
nKeyCode = com::sun::star::awt::Key::UP; nKeyCode = com::sun::star::awt::Key::UP;
break; break;
case GDK_Left: case GDK_KEY_Left:
nKeyCode = com::sun::star::awt::Key::LEFT; nKeyCode = com::sun::star::awt::Key::LEFT;
break; break;
case GDK_Right: case GDK_KEY_Right:
nKeyCode = com::sun::star::awt::Key::RIGHT; nKeyCode = com::sun::star::awt::Key::RIGHT;
break; break;
default: default:
if (pEvent->keyval >= GDK_F1 && pEvent->keyval <= GDK_F26) if (pEvent->keyval >= GDK_KEY_F1 && pEvent->keyval <= GDK_KEY_F26)
nKeyCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_F1); nKeyCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_KEY_F1);
else else
nCharCode = gdk_keyval_to_unicode(pEvent->keyval); nCharCode = gdk_keyval_to_unicode(pEvent->keyval);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment