diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-26 14:29:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-02 08:51:01 +0100 |
commit | 135bc56f87c563ce5bb2c5d2a7faf35e7ecfec59 (patch) | |
tree | 9becf1556955dc3a7b54c3f33d1d33dd704212f2 /libreofficekit | |
parent | a2446dca88b53462025777d8b468d2b0d5aea737 (diff) |
libreofficekit: pretty-print LibreOfficeKitCallbackType
Change-Id: I15a6b265c6fa0d0c62277814fa119d20b311625b
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index ce81eb802ccd..525bf8449527 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -589,6 +589,24 @@ static GList* lcl_payloadToRectangles(const char* pPayload) return pRet; } +static const gchar* lcl_LibreOfficeKitCallbackTypeToString(int nType) +{ + switch (nType) + { + case LOK_CALLBACK_INVALIDATE_TILES: + return "LOK_CALLBACK_INVALIDATE_TILES"; + case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: + return "LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR"; + case LOK_CALLBACK_TEXT_SELECTION: + return "LOK_CALLBACK_TEXT_SELECTION"; + case LOK_CALLBACK_TEXT_SELECTION_START: + return "LOK_CALLBACK_TEXT_SELECTION_START"; + case LOK_CALLBACK_TEXT_SELECTION_END: + return "LOK_CALLBACK_TEXT_SELECTION_END"; + } + return 0; +} + /// Invoked on the main thread if lok_docview_callback_worker() requests so. static gboolean lok_docview_callback(gpointer pData) { @@ -665,7 +683,7 @@ static void lok_docview_callback_worker(int nType, const char* pPayload, void* p pCallback->m_nType = nType; pCallback->m_pPayload = g_strdup(pPayload); pCallback->m_pDocView = pDocView; - g_info("lok_docview_callback_worker: %d, '%s'", nType, pPayload); + g_info("lok_docview_callback_worker: %s, '%s'", lcl_LibreOfficeKitCallbackTypeToString(nType), pPayload); #if GTK_CHECK_VERSION(2,12,0) gdk_threads_add_idle(lok_docview_callback, pCallback); #else |