Kaydet (Commit) f1e98339 authored tarafından Miklos Vajna's avatar Miklos Vajna

lokdocview: initial LOK_CALLBACK_GRAPHIC_SELECTION handling

No markers yet, but we're aware of the selection rectangle at least.

Change-Id: I92d3fc62d066e401ad19107fbbd414b1b9b26125
üst 233fdd99
...@@ -58,6 +58,7 @@ struct _LOKDocView ...@@ -58,6 +58,7 @@ struct _LOKDocView
GdkRectangle m_aTextSelectionStart; GdkRectangle m_aTextSelectionStart;
/// Position and size of the selection end. /// Position and size of the selection end.
GdkRectangle m_aTextSelectionEnd; GdkRectangle m_aTextSelectionEnd;
GdkRectangle m_aGraphicSelection;
/// @name Start/middle/end handle. /// @name Start/middle/end handle.
///@{ ///@{
......
...@@ -253,6 +253,7 @@ static void lok_docview_init( LOKDocView* pDocView ) ...@@ -253,6 +253,7 @@ static void lok_docview_init( LOKDocView* pDocView )
pDocView->m_pTextSelectionRectangles = NULL; pDocView->m_pTextSelectionRectangles = NULL;
memset(&pDocView->m_aTextSelectionStart, 0, sizeof(pDocView->m_aTextSelectionStart)); memset(&pDocView->m_aTextSelectionStart, 0, sizeof(pDocView->m_aTextSelectionStart));
memset(&pDocView->m_aTextSelectionEnd, 0, sizeof(pDocView->m_aTextSelectionEnd)); memset(&pDocView->m_aTextSelectionEnd, 0, sizeof(pDocView->m_aTextSelectionEnd));
memset(&pDocView->m_aGraphicSelection, 0, sizeof(pDocView->m_aGraphicSelection));
// Start/middle/end handle. // Start/middle/end handle.
pDocView->m_pHandleStart = NULL; pDocView->m_pHandleStart = NULL;
...@@ -420,6 +421,10 @@ static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpoint ...@@ -420,6 +421,10 @@ static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpoint
} }
} }
if (!lcl_isEmptyRectangle(&pDocView->m_aGraphicSelection))
{
}
cairo_destroy(pCairo); cairo_destroy(pCairo);
#endif #endif
return FALSE; return FALSE;
...@@ -606,6 +611,8 @@ static const gchar* lcl_LibreOfficeKitCallbackTypeToString(int nType) ...@@ -606,6 +611,8 @@ static const gchar* lcl_LibreOfficeKitCallbackTypeToString(int nType)
return "LOK_CALLBACK_TEXT_SELECTION_END"; return "LOK_CALLBACK_TEXT_SELECTION_END";
case LOK_CALLBACK_CURSOR_VISIBLE: case LOK_CALLBACK_CURSOR_VISIBLE:
return "LOK_CALLBACK_CURSOR_VISIBLE"; return "LOK_CALLBACK_CURSOR_VISIBLE";
case LOK_CALLBACK_GRAPHIC_SELECTION:
return "LOK_CALLBACK_GRAPHIC_SELECTION";
} }
return 0; return 0;
} }
...@@ -672,6 +679,15 @@ static gboolean lok_docview_callback(gpointer pData) ...@@ -672,6 +679,15 @@ static gboolean lok_docview_callback(gpointer pData)
pCallback->m_pDocView->m_bCursorVisible = strcmp(pCallback->m_pPayload, "true") == 0; pCallback->m_pDocView->m_bCursorVisible = strcmp(pCallback->m_pPayload, "true") == 0;
} }
break; 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: default:
break; break;
} }
......
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