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
36fa8d44
Kaydet (Commit)
36fa8d44
authored
Eyl 15, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtktiledviewer: allow multiple status bars
Change-Id: I84c4102937deee662814c41607ee8de380a067f2
üst
f6ef6af2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
gtktiledviewer.cxx
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+12
-6
No files found.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
Dosyayı görüntüle @
36fa8d44
...
@@ -30,7 +30,6 @@ static int help()
...
@@ -30,7 +30,6 @@ static int help()
return
1
;
return
1
;
}
}
static
GtkWidget
*
pStatusBar
;
static
GtkToolItem
*
pEnableEditing
;
static
GtkToolItem
*
pEnableEditing
;
static
GtkToolItem
*
pBold
;
static
GtkToolItem
*
pBold
;
static
GtkToolItem
*
pItalic
;
static
GtkToolItem
*
pItalic
;
...
@@ -49,13 +48,16 @@ static GtkWidget* pFindbar;
...
@@ -49,13 +48,16 @@ static GtkWidget* pFindbar;
static
GtkWidget
*
pFindbarEntry
;
static
GtkWidget
*
pFindbarEntry
;
static
GtkWidget
*
pFindbarLabel
;
static
GtkWidget
*
pFindbarLabel
;
/// Represents all the state that is specific to one GtkWindow of this app.
class
TiledWindow
class
TiledWindow
{
{
public
:
public
:
GtkWidget
*
m_pDocView
;
GtkWidget
*
m_pDocView
;
GtkWidget
*
m_pStatusBar
;
TiledWindow
()
TiledWindow
()
:
m_pDocView
(
0
)
:
m_pDocView
(
0
),
m_pStatusBar
(
0
)
{
{
}
}
};
};
...
@@ -462,8 +464,10 @@ static void changePart( GtkWidget* pSelector, gpointer /* pItem */ )
...
@@ -462,8 +464,10 @@ static void changePart( GtkWidget* pSelector, gpointer /* pItem */ )
}
}
}
}
static
void
removeChildrenFromStatusbar
(
GtkWidget
*
children
,
gpointer
)
static
void
removeChildrenFromStatusbar
(
GtkWidget
*
children
,
gpointer
pData
)
{
{
GtkWidget
*
pStatusBar
=
static_cast
<
GtkWidget
*>
(
pData
);
gtk_container_remove
(
GTK_CONTAINER
(
pStatusBar
),
children
);
gtk_container_remove
(
GTK_CONTAINER
(
pStatusBar
),
children
);
}
}
...
@@ -491,6 +495,7 @@ static void changePartMode( GtkWidget* pSelector, gpointer /* pItem */ )
...
@@ -491,6 +495,7 @@ static void changePartMode( GtkWidget* pSelector, gpointer /* pItem */ )
static
void
openDocumentCallback
(
GObject
*
source_object
,
GAsyncResult
*
res
,
gpointer
/*userdata*/
)
static
void
openDocumentCallback
(
GObject
*
source_object
,
GAsyncResult
*
res
,
gpointer
/*userdata*/
)
{
{
LOKDocView
*
pDocView
=
LOK_DOC_VIEW
(
source_object
);
LOKDocView
*
pDocView
=
LOK_DOC_VIEW
(
source_object
);
TiledWindow
&
rWindow
=
lcl_getTiledWindow
(
GTK_WIDGET
(
pDocView
));
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
GList
*
focusChain
=
NULL
;
GList
*
focusChain
=
NULL
;
...
@@ -509,7 +514,7 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo
...
@@ -509,7 +514,7 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo
focusChain
=
g_list_append
(
focusChain
,
pDocView
);
focusChain
=
g_list_append
(
focusChain
,
pDocView
);
gtk_container_set_focus_chain
(
GTK_CONTAINER
(
pVBox
),
focusChain
);
gtk_container_set_focus_chain
(
GTK_CONTAINER
(
pVBox
),
focusChain
);
gtk_widget_hide
(
pStatusBar
);
gtk_widget_hide
(
rWindow
.
m_
pStatusBar
);
}
}
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
int
argc
,
char
*
argv
[]
)
...
@@ -692,8 +697,8 @@ int main( int argc, char* argv[] )
...
@@ -692,8 +697,8 @@ int main( int argc, char* argv[] )
GtkWidget
*
pProgressBar
=
gtk_progress_bar_new
();
GtkWidget
*
pProgressBar
=
gtk_progress_bar_new
();
g_signal_connect
(
pDocView
,
"load-changed"
,
G_CALLBACK
(
loadChanged
),
pProgressBar
);
g_signal_connect
(
pDocView
,
"load-changed"
,
G_CALLBACK
(
loadChanged
),
pProgressBar
);
pStatusBar
=
gtk_statusbar_new
();
GtkWidget
*
pStatusBar
=
gtk_statusbar_new
();
gtk_container_forall
(
GTK_CONTAINER
(
pStatusBar
),
removeChildrenFromStatusbar
,
NULL
);
gtk_container_forall
(
GTK_CONTAINER
(
pStatusBar
),
removeChildrenFromStatusbar
,
pStatusBar
);
gtk_container_add
(
GTK_CONTAINER
(
pVBox
),
pStatusBar
);
gtk_container_add
(
GTK_CONTAINER
(
pVBox
),
pStatusBar
);
gtk_container_add
(
GTK_CONTAINER
(
pStatusBar
),
pProgressBar
);
gtk_container_add
(
GTK_CONTAINER
(
pStatusBar
),
pProgressBar
);
gtk_widget_set_hexpand
(
pProgressBar
,
true
);
gtk_widget_set_hexpand
(
pProgressBar
,
true
);
...
@@ -704,6 +709,7 @@ int main( int argc, char* argv[] )
...
@@ -704,6 +709,7 @@ int main( int argc, char* argv[] )
TiledWindow
aWindow
;
TiledWindow
aWindow
;
aWindow
.
m_pDocView
=
pDocView
;
aWindow
.
m_pDocView
=
pDocView
;
aWindow
.
m_pStatusBar
=
pStatusBar
;
g_aWindows
[
pWindow
]
=
aWindow
;
g_aWindows
[
pWindow
]
=
aWindow
;
lok_doc_view_open_document
(
LOK_DOC_VIEW
(
pDocView
),
argv
[
2
],
NULL
,
openDocumentCallback
,
pDocView
);
lok_doc_view_open_document
(
LOK_DOC_VIEW
(
pDocView
),
argv
[
2
],
NULL
,
openDocumentCallback
,
pDocView
);
...
...
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