diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-05 11:57:25 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-09 10:16:14 +0100 |
commit | f1e98339844c7b9e8f6af601f317a48eef505abd (patch) | |
tree | 66432ca6406fed84bd915f08bfcc92216fe2944d /libreofficekit | |
parent | 233fdd99f27ccdb1e31561b4093c68007549a5b5 (diff) |
lokdocview: initial LOK_CALLBACK_GRAPHIC_SELECTION handling
No markers yet, but we're aware of the selection rectangle at least.
Change-Id: I92d3fc62d066e401ad19107fbbd414b1b9b26125
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 16 |
1 files changed, 16 insertions, 0 deletions
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; } |