|
|
135360 |
From 0942d9f6f6057e83fb542a008dfc80c6e1dcc98e Mon Sep 17 00:00:00 2001
|
|
|
135360 |
From: Pranav Kant <pranavk@gnome.org>
|
|
|
135360 |
Date: Thu, 24 Sep 2015 14:41:26 +0200
|
|
|
135360 |
Subject: [PATCH 161/398] Move all introspection comments to header file
|
|
|
135360 |
|
|
|
135360 |
... wherever possible. There are few things we can't move to
|
|
|
135360 |
header file, for example, the comments corresponding to GObject
|
|
|
135360 |
properties, and signals.
|
|
|
135360 |
|
|
|
135360 |
Change-Id: If74d61b17ccee11f8a056f3a93040d2cff2dd98d
|
|
|
135360 |
Reviewed-on: https://gerrit.libreoffice.org/18863
|
|
|
135360 |
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
|
|
|
135360 |
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
|
|
|
135360 |
(cherry picked from commit 392437393d97a157e8291d20f1d6b6ac357ff0db)
|
|
|
135360 |
---
|
|
|
135360 |
include/LibreOfficeKit/LibreOfficeKitGtk.h | 132 ++++++++++++++++++++++++++++-
|
|
|
135360 |
libreofficekit/source/gtk/lokdocview.cxx | 87 +------------------
|
|
|
135360 |
2 files changed, 129 insertions(+), 90 deletions(-)
|
|
|
135360 |
|
|
|
135360 |
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
|
|
|
135360 |
index f17925b4c53a..81f42105d374 100644
|
|
|
135360 |
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
|
|
|
135360 |
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
|
|
|
135360 |
@@ -40,54 +40,178 @@ struct _LOKDocViewClass
|
|
|
135360 |
|
|
|
135360 |
GType lok_doc_view_get_type (void) G_GNUC_CONST;
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_new:
|
|
|
135360 |
+ * @pPath: LibreOffice install path.
|
|
|
135360 |
+ * @cancellable: The cancellable object that you can use to cancel this
|
|
|
135360 |
+ * operation.
|
|
|
135360 |
+ * @error: The error that will be set if the object fails to initialize.
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: (transfer none): The #LOKDocView widget instance.
|
|
|
135360 |
+ */
|
|
|
135360 |
GtkWidget* lok_doc_view_new (const gchar* pPath,
|
|
|
135360 |
GCancellable *cancellable,
|
|
|
135360 |
GError **error);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_new_from_widget:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: (transfer none): The #LOKDocView widget instance.
|
|
|
135360 |
+ */
|
|
|
135360 |
GtkWidget* lok_doc_view_new_from_widget (LOKDocView* pDocView);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_open_document:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @pPath: (transfer full): The path of the document that #LOKDocView widget should try to open
|
|
|
135360 |
+ * @cancellable:
|
|
|
135360 |
+ * @callback:
|
|
|
135360 |
+ * @userdata:
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: %TRUE if the document is loaded succesfully, %FALSE otherwise
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_open_document (LOKDocView* pDocView,
|
|
|
135360 |
const gchar* pPath,
|
|
|
135360 |
GCancellable* cancellable,
|
|
|
135360 |
GAsyncReadyCallback callback,
|
|
|
135360 |
gpointer userdata);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_open_document_finish:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @res:
|
|
|
135360 |
+ * @error:
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: %TRUE if the document is loaded succesfully, %FALSE otherwise
|
|
|
135360 |
+ */
|
|
|
135360 |
gboolean lok_doc_view_open_document_finish (LOKDocView* pDocView,
|
|
|
135360 |
GAsyncResult* res,
|
|
|
135360 |
GError** error);
|
|
|
135360 |
|
|
|
135360 |
-/// Gets the document the viewer displays.
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_get_document:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Gets the document the viewer displays.
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: The #LibreOfficeKitDocument instance the widget is currently showing
|
|
|
135360 |
+ */
|
|
|
135360 |
LibreOfficeKitDocument* lok_doc_view_get_document (LOKDocView* pDocView);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_set_zoom:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @fZoom: The new zoom level that pDocView must set it into.
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Sets the new zoom level for the widget.
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_set_zoom (LOKDocView* pDocView,
|
|
|
135360 |
float fZoom);
|
|
|
135360 |
+
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_get_zoom:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: The current zoom factor value in float for pDocView
|
|
|
135360 |
+ */
|
|
|
135360 |
float lok_doc_view_get_zoom (LOKDocView* pDocView);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_get_parts:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ */
|
|
|
135360 |
int lok_doc_view_get_parts (LOKDocView* pDocView);
|
|
|
135360 |
+
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_get_part:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ */
|
|
|
135360 |
int lok_doc_view_get_part (LOKDocView* pDocView);
|
|
|
135360 |
+
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_set_part:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @nPart:
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_set_part (LOKDocView* pDocView,
|
|
|
135360 |
int nPart);
|
|
|
135360 |
+
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_get_part_name:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @nPart:
|
|
|
135360 |
+ */
|
|
|
135360 |
char* lok_doc_view_get_part_name (LOKDocView* pDocView,
|
|
|
135360 |
int nPart);
|
|
|
135360 |
+
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_set_partmode:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @nPartMode:
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_set_partmode (LOKDocView* pDocView,
|
|
|
135360 |
int nPartMode);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_reset_view:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_reset_view (LOKDocView* pDocView);
|
|
|
135360 |
|
|
|
135360 |
-/// Sets if the viewer is actually an editor or not.
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_set_edit:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @bEdit: %TRUE if the pDocView should go in edit mode, %FALSE otherwise
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Sets if the viewer is actually an editor or not.
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_set_edit (LOKDocView* pDocView,
|
|
|
135360 |
gboolean bEdit);
|
|
|
135360 |
-/// Gets if the viewer is actually an editor or not.
|
|
|
135360 |
+
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_get_edit:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Gets if the viewer is actually an editor or not.
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: %TRUE if the given pDocView is in edit mode.
|
|
|
135360 |
+ */
|
|
|
135360 |
gboolean lok_doc_view_get_edit (LOKDocView* pDocView);
|
|
|
135360 |
|
|
|
135360 |
-/// Posts the .uno: command to the LibreOfficeKit.
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_post_command:
|
|
|
135360 |
+ * @pDocView: the #LOKDocView instance
|
|
|
135360 |
+ * @pCommand: the command to issue to LO core
|
|
|
135360 |
+ * @pArguments: the arguments to the given command
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Posts the .uno: command to the LibreOfficeKit.
|
|
|
135360 |
+ */
|
|
|
135360 |
void lok_doc_view_post_command (LOKDocView* pDocView,
|
|
|
135360 |
const gchar* pCommand,
|
|
|
135360 |
const gchar* pArguments);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_pixel_to_twip:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @fInput: The value in pixels to convert to twips
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Converts the value in pixels to twips according to zoom level.
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: The corresponding value in twips
|
|
|
135360 |
+ */
|
|
|
135360 |
float lok_doc_view_pixel_to_twip (LOKDocView* pDocView,
|
|
|
135360 |
float fInput);
|
|
|
135360 |
|
|
|
135360 |
+/**
|
|
|
135360 |
+ * lok_doc_view_twip_to_pixel:
|
|
|
135360 |
+ * @pDocView: The #LOKDocView instance
|
|
|
135360 |
+ * @fInput: The value in twips to convert to pixels
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Converts the value in twips to pixels according to zoom level.
|
|
|
135360 |
+ *
|
|
|
135360 |
+ * Returns: The corresponding value in pixels
|
|
|
135360 |
+ */
|
|
|
135360 |
float lok_doc_view_twip_to_pixel (LOKDocView* pDocView,
|
|
|
135360 |
float fInput);
|
|
|
135360 |
|
|
|
135360 |
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
|
|
|
135360 |
index 60304b4ff59c..7c52ce2e2efb 100644
|
|
|
135360 |
--- a/libreofficekit/source/gtk/lokdocview.cxx
|
|
|
135360 |
+++ b/libreofficekit/source/gtk/lokdocview.cxx
|
|
|
135360 |
@@ -1843,15 +1843,6 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
|
|
|
135360 |
G_TYPE_INT, G_TYPE_INT);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_new:
|
|
|
135360 |
- * @pPath: LibreOffice install path.
|
|
|
135360 |
- * @cancellable: The cancellable object that you can use to cancel this
|
|
|
135360 |
- * operation.
|
|
|
135360 |
- * @error: The error that will be set if the object fails to initialize.
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: (transfer none): The #LOKDocView widget instance.
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT GtkWidget*
|
|
|
135360 |
lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError **error)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -1873,14 +1864,6 @@ SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* pOldLOK
|
|
|
135360 |
return pNewDocView;
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_open_document_finish:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- * @res:
|
|
|
135360 |
- * @error:
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: %TRUE if the document is loaded succesfully, %FALSE otherwise
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT gboolean
|
|
|
135360 |
lok_doc_view_open_document_finish (LOKDocView* pDocView, GAsyncResult* res, GError** error)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -1894,17 +1877,6 @@ lok_doc_view_open_document_finish (LOKDocView* pDocView, GAsyncResult* res, GErr
|
|
|
135360 |
return g_task_propagate_boolean(task, error);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_open_document:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- * @pPath: (transfer full): The path of the document that #LOKDocView widget should try to open
|
|
|
135360 |
- * @cancellable:
|
|
|
135360 |
- * @callback:
|
|
|
135360 |
- * @userdata:
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: %TRUE if the document is loaded succesfully, %FALSE otherwise
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT void
|
|
|
135360 |
lok_doc_view_open_document (LOKDocView* pDocView,
|
|
|
135360 |
const gchar* pPath,
|
|
|
135360 |
@@ -1925,12 +1897,6 @@ lok_doc_view_open_document (LOKDocView* pDocView,
|
|
|
135360 |
g_object_unref(task);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_get_document:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: The #LibreOfficeKitDocument instance the widget is currently showing
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT LibreOfficeKitDocument*
|
|
|
135360 |
lok_doc_view_get_document (LOKDocView* pDocView)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -1938,13 +1904,6 @@ lok_doc_view_get_document (LOKDocView* pDocView)
|
|
|
135360 |
return priv->m_pDocument;
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_set_zoom:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- * @fZoom: The new zoom level that pDocView must set it into.
|
|
|
135360 |
- *
|
|
|
135360 |
- * Sets the new zoom level for the widget.
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT void
|
|
|
135360 |
lok_doc_view_set_zoom (LOKDocView* pDocView, float fZoom)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -1963,12 +1922,6 @@ lok_doc_view_set_zoom (LOKDocView* pDocView, float fZoom)
|
|
|
135360 |
nDocumentHeightPixels);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_get_zoom:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: The current zoom factor value in float for pDocView
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT float
|
|
|
135360 |
lok_doc_view_get_zoom (LOKDocView* pDocView)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -2036,13 +1989,6 @@ lok_doc_view_reset_view(LOKDocView* pDocView)
|
|
|
135360 |
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_set_edit:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- * @bEdit: %TRUE if the pDocView should go in edit mode, %FALSE otherwise
|
|
|
135360 |
- *
|
|
|
135360 |
- * Sets the edit-mode for pDocView
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT void
|
|
|
135360 |
lok_doc_view_set_edit(LOKDocView* pDocView,
|
|
|
135360 |
gboolean bEdit)
|
|
|
135360 |
@@ -2057,12 +2003,6 @@ lok_doc_view_set_edit(LOKDocView* pDocView,
|
|
|
135360 |
g_object_unref(task);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_get_edit:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: %TRUE if the given pDocView is in edit mode.
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT gboolean
|
|
|
135360 |
lok_doc_view_get_edit (LOKDocView* pDocView)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -2070,14 +2010,7 @@ lok_doc_view_get_edit (LOKDocView* pDocView)
|
|
|
135360 |
return priv->m_bEdit;
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_post_command:
|
|
|
135360 |
- * @pDocView: the #LOKDocView instance
|
|
|
135360 |
- * @pCommand: the command to issue to LO core
|
|
|
135360 |
- * @pArguments: the arguments to the given command
|
|
|
135360 |
- *
|
|
|
135360 |
- * This methods forwards your command to LO core.
|
|
|
135360 |
-*/
|
|
|
135360 |
+
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT void
|
|
|
135360 |
lok_doc_view_post_command (LOKDocView* pDocView,
|
|
|
135360 |
const gchar* pCommand,
|
|
|
135360 |
@@ -2094,15 +2027,6 @@ lok_doc_view_post_command (LOKDocView* pDocView,
|
|
|
135360 |
g_object_unref(task);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_pixel_to_twip:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- * @fInput: The value in pixels to convert to twips
|
|
|
135360 |
- *
|
|
|
135360 |
- * Converts the value in pixels to twips according to zoom level.
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: The corresponding value in twips
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT float
|
|
|
135360 |
lok_doc_view_pixel_to_twip (LOKDocView* pDocView, float fInput)
|
|
|
135360 |
{
|
|
|
135360 |
@@ -2110,15 +2034,6 @@ lok_doc_view_pixel_to_twip (LOKDocView* pDocView, float fInput)
|
|
|
135360 |
return pixelToTwip(fInput, priv->m_fZoom);
|
|
|
135360 |
}
|
|
|
135360 |
|
|
|
135360 |
-/**
|
|
|
135360 |
- * lok_doc_view_twip_to_pixel:
|
|
|
135360 |
- * @pDocView: The #LOKDocView instance
|
|
|
135360 |
- * @fInput: The value in twips to convert to pixels
|
|
|
135360 |
- *
|
|
|
135360 |
- * Converts the value in twips to pixels according to zoom level.
|
|
|
135360 |
- *
|
|
|
135360 |
- * Returns: The corresponding value in pixels
|
|
|
135360 |
- */
|
|
|
135360 |
SAL_DLLPUBLIC_EXPORT float
|
|
|
135360 |
lok_doc_view_twip_to_pixel (LOKDocView* pDocView, float fInput)
|
|
|
135360 |
{
|
|
|
135360 |
--
|
|
|
135360 |
2.12.0
|
|
|
135360 |
|