diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-21 13:20:26 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-19 19:06:16 +0100 |
commit | fb51e433f8991c9a50fcd53e2845538a5710c776 (patch) | |
tree | 23dc622693f80d6a5328da8401e62e96c0212949 /libreofficekit | |
parent | d2e79cfbb188d6402dbcfc7bd71886f6d2252727 (diff) |
lokdocview: Handle INVALIDATE_HEADER cb
With this calc gtktiledviewer or any other lok client shouldn't crash
anymore when a new view is opened.
And while at it, update documentation of callbacks.
(cherry picked from commit 71cd37fad9792038279969c82e0cb209df06f024)
Change-Id: I436c3b424dd4e2e6b8c312b0d3ba43d7006e944b
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 01873f516bb0..5243e3887514 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -3247,9 +3247,32 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_STRING); /** - * LOKDocView::window - * @pDocView: the #LOKDocView on which the signal is emitted - * @pPayload: JSON containing the information, including id, about the window + * Window related callbacks are emitted under this category. It includes + * external windows like dialogs, autopopups for now. + * + * The payload format is: + * + * { + * "id": "unique integer id of the dialog", + * "action": "<see below>", + * "type": "<see below>" + * "rectangle": "x, y, width, height" + * } + * + * "type" tells the type of the window the action is associated with + * - "dialog" - window is a dialog + * - "child" - window is a floating window (combo boxes, etc.) + * + * "action" can take following values: + * - "created" - window is created in the backend, client can render it now + * - "title_changed" - window's title is changed + * - "size_changed" - window's size is changed + * - "invalidate" - the area as described by "rectangle" is invalidated + * Clients must request the new area + * - "cursor_invalidate" - cursor is invalidated. New position is in "rectangle" + * - "cursor_visible" - cursor visible status is changed. Status is availabe + * in "visible" field + * - "close" - window is closed */ doc_view_signals[WINDOW] = g_signal_new("window", @@ -3260,6 +3283,23 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_STRING); + + /** + * The column/row header is no more valid because of a column/row insertion + * or a similar event. Clients must query a new column/row header set. + * + * The payload says if we are invalidating a row or column header. So, + * payload values can be: "row", "column", "all". + */ + doc_view_signals[INVALIDATE_HEADER] = + g_signal_new("invalidate-header", + G_TYPE_FROM_CLASS(pGObjectClass), + G_SIGNAL_RUN_FIRST, + 0, + nullptr, nullptr, + g_cclosure_marshal_generic, + G_TYPE_NONE, 1, + G_TYPE_STRING); } SAL_DLLPUBLIC_EXPORT GtkWidget* |