diff options
author | Aditya Dewan <iit2015097@iiita.ac.in> | 2017-07-15 21:47:14 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-08-17 13:10:30 +0200 |
commit | d64a7f4ba80fa2a0a0ad2bddc6906ab6b78a23c8 (patch) | |
tree | 8269f9ab235c5a4b31ede606bc64b0b474591102 /libreofficekit | |
parent | ea43e0e3ceec30336273da0fb3d47c24073cffd2 (diff) |
implementing callback for ruler invalidation
adding commands to fetch and changee ruler state
'.uno:RulerState' and '.uno:RulerStateChange'
Change-Id: I66107039a7ae5893691feb45c8ab2e4aa476ea76
Reviewed-on: https://gerrit.libreoffice.org/40727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx | 1 | ||||
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx | 8 | ||||
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx | 2 | ||||
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv.ui | 14 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 16 |
5 files changed, 41 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx index 0da85fd89e65..f94ef776b6d2 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx @@ -103,6 +103,7 @@ gtv_main_toolbar_init(GtvMainToolbar* toolbar) gtk_builder_add_callback_symbol(builder.get(), "doCopy", G_CALLBACK(doCopy)); gtk_builder_add_callback_symbol(builder.get(), "doPaste", G_CALLBACK(doPaste)); gtk_builder_add_callback_symbol(builder.get(), "createView", G_CALLBACK(createView)); + gtk_builder_add_callback_symbol(builder.get(), "getRulerState", G_CALLBACK(getRulerState)); gtk_builder_add_callback_symbol(builder.get(), "unoCommandDebugger", G_CALLBACK(unoCommandDebugger)); gtk_builder_add_callback_symbol(builder.get(), "toggleEditing", G_CALLBACK(toggleEditing)); gtk_builder_add_callback_symbol(builder.get(), "changePartMode", G_CALLBACK(changePartMode)); diff --git a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx index 3c9ee3e405f2..9e0b575dcdd5 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx @@ -133,6 +133,14 @@ void createView(GtkWidget* pButton, gpointer /*pItem*/) gtv_application_window_create_view_from_window(GTV_APPLICATION_WINDOW(window)); } +void getRulerState(GtkWidget* pButton, gpointer /*pItem*/) +{ + const std::string type = ".uno:RulerState"; + GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(pButton)); + LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(window->lokdocview)); + pDocument->pClass->getCommandValues(pDocument, type.c_str()); +} + static void removeUnoParam(GtkWidget* pWidget, gpointer userdata) { GtkWidget* pParamAreaBox = GTK_WIDGET(userdata); diff --git a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx index a19a7b5cd744..2f9948fe61d7 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx @@ -20,6 +20,8 @@ void doPaste(GtkWidget* pButton, gpointer /*pItem*/); void createView(GtkWidget* pButton, gpointer /*pItem*/); +void getRulerState(GtkWidget* pButton, gpointer /*pItem*/); + void unoCommandDebugger(GtkWidget* pButton, gpointer /* pItem */); void toggleEditing(GtkWidget* pButton, gpointer /*pItem*/); diff --git a/libreofficekit/qa/gtktiledviewer/gtv.ui b/libreofficekit/qa/gtktiledviewer/gtv.ui index e27f79714a4b..eacec33b2d1b 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv.ui +++ b/libreofficekit/qa/gtktiledviewer/gtv.ui @@ -486,6 +486,20 @@ <property name="homogeneous">True</property> </packing> </child> + <child> + <object class="GtkToolButton" id="btn_rulerstate"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">.uno:UpdateRuler</property> + <property name="use_underline">True</property> + <property name="icon_name">text-x-generic</property> + <signal name="clicked" handler="getRulerState" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> </object> <object class="GtkToolbar" id="toolbar2"> <property name="visible">True</property> diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 37932525596c..3d4b0fa8279d 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -278,6 +278,7 @@ enum TEXT_SELECTION, PASSWORD_REQUIRED, COMMENT, + RULER, LAST_SIGNAL }; @@ -433,6 +434,8 @@ callbackTypeToString (int nType) return "LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED"; case LOK_CALLBACK_COMMENT: return "LOK_CALLBACK_COMMENT"; + case LOK_CALLBACK_RULER_UPDATE: + return "LOK_CALLBACK_RULER_UPDATE"; } g_assert(false); return nullptr; @@ -1422,6 +1425,9 @@ callback (gpointer pData) case LOK_CALLBACK_COMMENT: g_signal_emit(pCallback->m_pDocView, doc_view_signals[COMMENT], 0, pCallback->m_aPayload.c_str()); break; + case LOK_CALLBACK_RULER_UPDATE: + g_signal_emit(pCallback->m_pDocView, doc_view_signals[RULER], 0, pCallback->m_aPayload.c_str()); + break; default: g_assert(false); break; @@ -3208,6 +3214,16 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_STRING); + + doc_view_signals[RULER] = + g_signal_new("ruler", + 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* |