From f1e98339844c7b9e8f6af601f317a48eef505abd Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 5 Mar 2015 11:57:25 +0100 Subject: lokdocview: initial LOK_CALLBACK_GRAPHIC_SELECTION handling No markers yet, but we're aware of the selection rectangle at least. Change-Id: I92d3fc62d066e401ad19107fbbd414b1b9b26125 --- libreofficekit/source/gtk/lokdocview.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libreofficekit/source/gtk') diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index 93ed764b8cf0..9b4ebbc45ebb 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -253,6 +253,7 @@ static void lok_docview_init( LOKDocView* pDocView ) pDocView->m_pTextSelectionRectangles = NULL; memset(&pDocView->m_aTextSelectionStart, 0, sizeof(pDocView->m_aTextSelectionStart)); memset(&pDocView->m_aTextSelectionEnd, 0, sizeof(pDocView->m_aTextSelectionEnd)); + memset(&pDocView->m_aGraphicSelection, 0, sizeof(pDocView->m_aGraphicSelection)); // Start/middle/end handle. pDocView->m_pHandleStart = NULL; @@ -420,6 +421,10 @@ static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpoint } } + if (!lcl_isEmptyRectangle(&pDocView->m_aGraphicSelection)) + { + } + cairo_destroy(pCairo); #endif return FALSE; @@ -606,6 +611,8 @@ static const gchar* lcl_LibreOfficeKitCallbackTypeToString(int nType) return "LOK_CALLBACK_TEXT_SELECTION_END"; case LOK_CALLBACK_CURSOR_VISIBLE: return "LOK_CALLBACK_CURSOR_VISIBLE"; + case LOK_CALLBACK_GRAPHIC_SELECTION: + return "LOK_CALLBACK_GRAPHIC_SELECTION"; } return 0; } @@ -672,6 +679,15 @@ static gboolean lok_docview_callback(gpointer pData) pCallback->m_pDocView->m_bCursorVisible = strcmp(pCallback->m_pPayload, "true") == 0; } break; + case LOK_CALLBACK_GRAPHIC_SELECTION: + { + if (strcmp(pCallback->m_pPayload, "EMPTY") != 0) + pCallback->m_pDocView->m_aGraphicSelection = lcl_payloadToRectangle(pCallback->m_pPayload); + else + memset(&pCallback->m_pDocView->m_aGraphicSelection, 0, sizeof(pCallback->m_pDocView->m_aGraphicSelection)); + gtk_widget_queue_draw(GTK_WIDGET(pCallback->m_pDocView->pEventBox)); + } + break; default: break; } -- cgit