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
fe3ab848
Kaydet (Commit)
fe3ab848
authored
Ock 13, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtktiledviewer: start in viewer mode, switch to edit mode by mouse click
Change-Id: I0863ec8fb159a2e367951ba9e7d7310d250d8a1e
üst
f1a2759c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
LibreOfficeKitGtk.h
include/LibreOfficeKit/LibreOfficeKitGtk.h
+5
-0
gtktiledviewer.cxx
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+13
-1
lokdocview.c
libreofficekit/source/gtk/lokdocview.c
+13
-1
No files found.
include/LibreOfficeKit/LibreOfficeKitGtk.h
Dosyayı görüntüle @
fe3ab848
...
...
@@ -41,6 +41,8 @@ struct _LOKDocView
LibreOfficeKit
*
pOffice
;
LibreOfficeKitDocument
*
pDocument
;
/// View or edit mode.
gboolean
m_bEdit
;
};
struct
_LOKDocViewClass
...
...
@@ -64,6 +66,9 @@ char* lok_docview_get_part_name (LOKDocView* pDocView,
int
nPart
);
void
lok_docview_set_partmode
(
LOKDocView
*
pDocView
,
LibreOfficeKitPartMode
ePartMode
);
/// Sets if the viewer is actually an editor or not.
void
lok_docview_set_edit
(
LOKDocView
*
pDocView
,
gboolean
bEdit
);
#ifdef __cplusplus
}
#endif
...
...
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
Dosyayı görüntüle @
fe3ab848
...
...
@@ -131,8 +131,11 @@ void changeQuadView( GtkWidget* /*pButton*/, gpointer /* pItem */ )
static
void
signalKey
(
GtkWidget
*
/*pWidget*/
,
GdkEventKey
*
pEvent
,
gpointer
/*pData*/
)
{
LOKDocView
*
pLOKDocView
=
LOK_DOCVIEW
(
pDocView
);
int
nCode
=
0
;
if
(
!
pLOKDocView
->
m_bEdit
)
return
;
switch
(
pEvent
->
keyval
)
{
case
GDK_BackSpace
:
...
...
@@ -154,6 +157,14 @@ static void signalKey(GtkWidget* /*pWidget*/, GdkEventKey* pEvent, gpointer /*pD
pLOKDocView
->
pOffice
->
pClass
->
postKeyEvent
(
pLOKDocView
->
pOffice
,
LOK_KEYEVENT_KEYINPUT
,
nCode
);
}
/// Receives a button press event.
static
void
signalButton
(
GtkWidget
*
/*pWidget*/
,
GdkEvent
*
/*pEvent*/
,
gpointer
/*pData*/
)
{
LOKDocView
*
pLOKDocView
=
LOK_DOCVIEW
(
pDocView
);
lok_docview_set_edit
(
pLOKDocView
,
TRUE
);
}
// GtkComboBox requires gtk 2.24 or later
#if ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION > 2
void
populatePartSelector
()
...
...
@@ -311,6 +322,7 @@ int main( int argc, char* argv[] )
// Input handling.
g_signal_connect
(
pWindow
,
"key-press-event"
,
G_CALLBACK
(
signalKey
),
NULL
);
g_signal_connect
(
pWindow
,
"key-release-event"
,
G_CALLBACK
(
signalKey
),
NULL
);
g_signal_connect
(
pDocView
,
"button-press-event"
,
G_CALLBACK
(
signalButton
),
NULL
);
gtk_container_add
(
GTK_CONTAINER
(
pVBox
),
pDocView
);
...
...
libreofficekit/source/gtk/lokdocview.c
Dosyayı görüntüle @
fe3ab848
...
...
@@ -71,6 +71,9 @@ static void lok_docview_init( LOKDocView* pDocView )
gtk_scrolled_window_add_with_viewport
(
GTK_SCROLLED_WINDOW
(
pDocView
),
pDocView
->
pEventBox
);
// Allow reacting to button press events.
gtk_widget_set_events
(
pDocView
->
pEventBox
,
GDK_BUTTON_PRESS_MASK
);
pDocView
->
pCanvas
=
gtk_image_new
();
gtk_container_add
(
GTK_CONTAINER
(
pDocView
->
pEventBox
),
pDocView
->
pCanvas
);
...
...
@@ -84,6 +87,7 @@ static void lok_docview_init( LOKDocView* pDocView )
pDocView
->
pDocument
=
0
;
pDocView
->
fZoom
=
1
;
pDocView
->
m_bEdit
=
FALSE
;
gtk_signal_connect
(
GTK_OBJECT
(
pDocView
),
"destroy"
,
GTK_SIGNAL_FUNC
(
lcl_onDestroy
),
NULL
);
...
...
@@ -212,7 +216,6 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, c
{
pDocView
->
pDocument
->
pClass
->
initializeForRendering
(
pDocView
->
pDocument
);
renderDocument
(
pDocView
);
pDocView
->
pDocument
->
pClass
->
registerCallback
(
pDocView
->
pDocument
,
&
lok_docview_callback_worker
,
pDocView
);
}
return
TRUE
;
...
...
@@ -261,4 +264,13 @@ SAL_DLLPUBLIC_EXPORT void lok_docview_set_partmode( LOKDocView* pDocView,
pDocView
->
pDocument
->
pClass
->
setPartMode
(
pDocView
->
pDocument
,
ePartMode
);
renderDocument
(
pDocView
);
}
SAL_DLLPUBLIC_EXPORT
void
lok_docview_set_edit
(
LOKDocView
*
pDocView
,
gboolean
bEdit
)
{
if
(
!
pDocView
->
m_bEdit
&&
bEdit
)
pDocView
->
pDocument
->
pClass
->
registerCallback
(
pDocView
->
pDocument
,
&
lok_docview_callback_worker
,
pDocView
);
pDocView
->
m_bEdit
=
bEdit
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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