Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
0ea68eec
Kaydet (Commit)
0ea68eec
authored
Kas 18, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtktiledviewer: allow passing initializeForRendering() arguments
Change-Id: Ic7b52764cf2fedbf73d4dcaaf36d1055b8ee22f2
üst
479325de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
LibreOfficeKitGtk.h
include/LibreOfficeKit/LibreOfficeKitGtk.h
+2
-0
gtktiledviewer.cxx
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+21
-4
lokdocview.cxx
libreofficekit/source/gtk/lokdocview.cxx
+4
-1
No files found.
include/LibreOfficeKit/LibreOfficeKitGtk.h
Dosyayı görüntüle @
0ea68eec
...
...
@@ -65,6 +65,7 @@ GtkWidget* lok_doc_view_new_from_widget (LOKDocView*
* lok_doc_view_open_document:
* @pDocView: The #LOKDocView instance
* @pPath: (transfer full): The path of the document that #LOKDocView widget should try to open
* @pRenderingArguments: lok::Document::initializeForRendering() arguments.
* @cancellable:
* @callback:
* @userdata:
...
...
@@ -73,6 +74,7 @@ GtkWidget* lok_doc_view_new_from_widget (LOKDocView*
*/
void
lok_doc_view_open_document
(
LOKDocView
*
pDocView
,
const
gchar
*
pPath
,
const
gchar
*
pRenderingArguments
,
GCancellable
*
cancellable
,
GAsyncReadyCallback
callback
,
gpointer
userdata
);
...
...
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
Dosyayı görüntüle @
0ea68eec
...
...
@@ -29,7 +29,9 @@
static
int
help
()
{
fprintf
(
stderr
,
"Usage: gtktiledviewer <absolute-path-to-libreoffice-install's-program-directory> <path-to-document>
\n
"
);
fprintf
(
stderr
,
"Usage: gtktiledviewer <absolute-path-to-libreoffice-install's-program-directory> <path-to-document> [<options> ... ]
\n\n
"
);
fprintf
(
stderr
,
"Options:
\n\n
"
);
fprintf
(
stderr
,
"--hide-whitespace: Hide whitespace between pages in text documents.
\n
"
);
return
1
;
}
...
...
@@ -475,13 +477,25 @@ static void createView(GtkWidget* pButton, gpointer /*pItem*/)
}
/// Creates a new model, i.e. LOK init and document load, one view implicitly.
static
void
createModelAndView
(
const
char
*
pLOPath
,
const
char
*
pDocPath
)
static
void
createModelAndView
(
const
char
*
pLOPath
,
const
char
*
pDocPath
,
const
std
::
vector
<
std
::
string
>&
rArguments
)
{
GtkWidget
*
pDocView
=
lok_doc_view_new
(
pLOPath
,
nullptr
,
nullptr
);
setupWidgetAndCreateWindow
(
pDocView
);
lok_doc_view_open_document
(
LOK_DOC_VIEW
(
pDocView
),
pDocPath
,
nullptr
,
openDocumentCallback
,
pDocView
);
boost
::
property_tree
::
ptree
aTree
;
for
(
const
std
::
string
&
rArgument
:
rArguments
)
{
if
(
rArgument
==
"--hide-whitespace"
)
{
aTree
.
put
(
boost
::
property_tree
::
ptree
::
path_type
(
".uno:HideWhitespace/type"
,
'/'
),
"boolean"
);
aTree
.
put
(
boost
::
property_tree
::
ptree
::
path_type
(
".uno:HideWhitespace/value"
,
'/'
),
true
);
}
}
std
::
stringstream
aStream
;
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
std
::
string
aArguments
=
aStream
.
str
();
lok_doc_view_open_document
(
LOK_DOC_VIEW
(
pDocView
),
pDocPath
,
aArguments
.
c_str
(),
nullptr
,
openDocumentCallback
,
pDocView
);
}
/// Our GtkClipboardGetFunc implementation for HTML.
...
...
@@ -1263,7 +1277,10 @@ int main( int argc, char* argv[] )
gtk_init
(
&
argc
,
&
argv
);
createModelAndView
(
argv
[
1
],
argv
[
2
]);
std
::
vector
<
std
::
string
>
aArguments
;
for
(
int
i
=
3
;
i
<
argc
;
++
i
)
aArguments
.
push_back
(
argv
[
i
]);
createModelAndView
(
argv
[
1
],
argv
[
2
],
aArguments
);
gtk_main
();
...
...
libreofficekit/source/gtk/lokdocview.cxx
Dosyayı görüntüle @
0ea68eec
...
...
@@ -44,6 +44,7 @@ struct LOKDocViewPrivateImpl
{
const
gchar
*
m_aLOPath
;
const
gchar
*
m_aDocPath
;
std
::
string
m_aRenderingArguments
;
gdouble
m_nLoadProgress
;
gboolean
m_bIsLoading
;
gboolean
m_bCanZoomIn
;
...
...
@@ -530,7 +531,7 @@ static gboolean postDocumentLoad(gpointer pData)
LOKDocViewPrivate
&
priv
=
getPrivate
(
pLOKDocView
);
priv
->
m_pDocument
->
pClass
->
setView
(
priv
->
m_pDocument
,
priv
->
m_nViewId
);
priv
->
m_pDocument
->
pClass
->
initializeForRendering
(
priv
->
m_pDocument
,
nullptr
);
priv
->
m_pDocument
->
pClass
->
initializeForRendering
(
priv
->
m_pDocument
,
priv
->
m_aRenderingArguments
.
c_str
()
);
priv
->
m_pDocument
->
pClass
->
registerCallback
(
priv
->
m_pDocument
,
callbackWorker
,
pLOKDocView
);
priv
->
m_pDocument
->
pClass
->
getDocumentSize
(
priv
->
m_pDocument
,
&
priv
->
m_nDocumentWidthTwips
,
&
priv
->
m_nDocumentHeightTwips
);
g_timeout_add
(
600
,
handleTimeout
,
pLOKDocView
);
...
...
@@ -2312,6 +2313,7 @@ lok_doc_view_open_document_finish (LOKDocView* pDocView, GAsyncResult* res, GErr
SAL_DLLPUBLIC_EXPORT
void
lok_doc_view_open_document
(
LOKDocView
*
pDocView
,
const
gchar
*
pPath
,
const
gchar
*
pRenderingArguments
,
GCancellable
*
cancellable
,
GAsyncReadyCallback
callback
,
gpointer
userdata
)
...
...
@@ -2324,6 +2326,7 @@ lok_doc_view_open_document (LOKDocView* pDocView,
pLOEvent
->
m_pPath
=
pPath
;
priv
->
m_aDocPath
=
pPath
;
priv
->
m_aRenderingArguments
=
pRenderingArguments
;
g_task_set_task_data
(
task
,
pLOEvent
,
LOEvent
::
destroy
);
g_thread_pool_push
(
priv
->
lokThreadPool
,
g_object_ref
(
task
),
&
error
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment