diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-05 18:40:52 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-11-09 04:14:38 +0100 |
commit | 25822ff930edd13442442a47714755a99fbb9992 (patch) | |
tree | 8aaef28ba7aca657bf2e681dcf15c312617ed179 /include/LibreOfficeKit | |
parent | 446a37ece35dbe4c442f0679dd1cb4df79ed87a7 (diff) |
lokdialog: Move getting dialog information in separate LOK call
Using outparameters to get the dialog information with the paintDialog
call was quite confusing.
Change-Id: Ief331b251dc66e66084b827ce5b025ba6c9ce7d2
Reviewed-on: https://gerrit.libreoffice.org/44473
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 10 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 40 |
2 files changed, 32 insertions, 18 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index cb0f17a41655..14824821cfd7 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -269,10 +269,14 @@ struct _LibreOfficeKitDocumentClass /// Paints dialog with given dialog id to the buffer /// @see lok::Document::paintDialog(). void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, - const int x, const int y, unsigned char* pBuffer, - char** pDialogTitle, - int* nWidth, int* nHeight); + const int x, const int y, + const int width, const int height); + + /// Get info about dialog with given dialog id + /// @see lok::Document::getDialogInfo(). + void (*getDialogInfo) (LibreOfficeKitDocument* pThis, const char* pDialogId, + char** pDialogTitle, int* pWidth, int* pHeight); /// @see lok::Document::paintActiveFloatingWindow(). void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 586637f6606e..19e121fe6573 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -161,28 +161,38 @@ public: * Client must truncate pBuffer according to the nWidth and nHeight returned after the call. * * @param pDialogId Unique dialog id to be painted + * @param pBuffer Buffer with enough memory allocated to render any dialog * @param x x-coordinate from where the dialog should start painting * @param y y-coordinate from where the dialog should start painting - * @param pBuffer Buffer with enough memory allocated to render any dialog - * @param pDialogTitle output parameter pointing to a dialog title - * string. Should be freed by the caller. - * @param nWidth in/out parameter returning the width of the rendered - * dialog. The input width value is used to determined the size of the - * image to be painted. - * @param nHeight in/out parameter returning the height of the rendered - * dialog. The input height value is used to determine the size of the - * image to be painted. + * @param width The width of the dialog image to be painted + * @param height The height of the dialog image to be painted */ void paintDialog(const char* pDialogId, + unsigned char* pBuffer, const int x, const int y, - unsigned char* pBuffer, - char** pDialogTitle, - int& nWidth, - int& nHeight) + const int width, + const int height) + { + return mpDoc->pClass->paintDialog(mpDoc, pDialogId, pBuffer, + x, y, width, height); + } + + /* Get info about dialog with given dialog id + * + * @param pDialogId Unique dialog id for which to get info about + * @param pDialogTitle Pointer to pointer pointing to string containing the + * dialog title. Caller should the pointer to allocated string themselves. + * @param pWidth The width of the dialog + * @param pHeight The height of the dialog + */ + void getDialogInfo(const char* pDialogId, + char** pDialogTitle, + int& pWidth, + int& pHeight) { - return mpDoc->pClass->paintDialog(mpDoc, pDialogId, x, y, pBuffer, - pDialogTitle, &nWidth, &nHeight); + return mpDoc->pClass->getDialogInfo(mpDoc, pDialogId, pDialogTitle, &pWidth, &pHeight); + } /** |