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
05d4077b
Kaydet (Commit)
05d4077b
authored
Eyl 01, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rearrange matters to get FloatingWindows working loaded from .ui
Change-Id: I099c810533c4590ee3182e1edf27e9038ed44f30
üst
2f1eed48
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
87 additions
and
42 deletions
+87
-42
dialog.hxx
include/vcl/dialog.hxx
+1
-4
floatwin.hxx
include/vcl/floatwin.hxx
+2
-1
syswin.hxx
include/vcl/syswin.hxx
+7
-4
previewer.cxx
vcl/source/uipreviewer/previewer.cxx
+9
-4
builder.cxx
vcl/source/window/builder.cxx
+36
-5
dialog.cxx
vcl/source/window/dialog.cxx
+6
-13
floatwin.cxx
vcl/source/window/floatwin.cxx
+19
-1
syswin.cxx
vcl/source/window/syswin.cxx
+7
-10
No files found.
include/vcl/dialog.hxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -39,7 +39,6 @@ class VclButtonBox;
class
VCL_DLLPUBLIC
Dialog
:
public
SystemWindow
{
private
:
Window
*
mpDialogParent
;
Dialog
*
mpPrevExecuteDlg
;
DialogImpl
*
mpDialogImpl
;
long
mnMousePositioned
;
...
...
@@ -47,7 +46,6 @@ private:
bool
mbOldSaveBack
;
bool
mbInClose
;
bool
mbModalMode
;
bool
mbIsDefferedInit
;
VclButtonBox
*
mpActionArea
;
VclBox
*
mpContentArea
;
...
...
@@ -67,8 +65,7 @@ protected:
public
:
SAL_DLLPRIVATE
bool
IsInClose
()
const
{
return
mbInClose
;
}
SAL_DLLPRIVATE
void
doDeferredInit
(
bool
bResizable
);
SAL_DLLPRIVATE
bool
isDeferredInit
()
const
{
return
mbIsDefferedInit
;
}
virtual
void
doDeferredInit
(
bool
bResizable
)
SAL_OVERRIDE
;
protected
:
explicit
Dialog
(
WindowType
nType
);
...
...
include/vcl/floatwin.hxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -117,9 +117,10 @@ public:
SAL_DLLPRIVATE
void
ImplEndPopupMode
(
sal_uInt16
nFlags
=
0
,
sal_uLong
nFocusId
=
0
);
SAL_DLLPRIVATE
Rectangle
&
ImplGetItemEdgeClipRect
();
SAL_DLLPRIVATE
bool
ImplIsInPrivatePopupMode
()
const
{
return
mbInPopupMode
;
}
virtual
void
doDeferredInit
(
bool
bResizable
)
SAL_OVERRIDE
;
public
:
explicit
FloatingWindow
(
Window
*
pParent
,
WinBits
nStyle
=
WB_STDFLOATWIN
);
explicit
FloatingWindow
(
Window
*
pParent
,
WinBits
nStyle
=
WB_STDFLOATWIN
);
explicit
FloatingWindow
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
);
explicit
FloatingWindow
(
Window
*
pParent
,
const
ResId
&
);
virtual
~
FloatingWindow
();
...
...
include/vcl/syswin.hxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -147,17 +147,19 @@ private:
bool
mbDockBtn
;
bool
mbHideBtn
;
bool
mbSysChild
;
bool
mbIsDefferedInit
;
bool
mbIsCalculatingInitialLayoutSize
;
bool
mbInitialLayoutDone
;
sal_uInt16
mnMenuBarMode
;
sal_uInt16
mnIcon
;
ImplData
*
mpImplData
;
Timer
maLayoutTimer
;
protected
:
bool
mbIsDefferedInit
;
Window
*
mpDialogParent
;
public
:
using
Window
::
ImplIsInTaskPaneList
;
SAL_DLLPRIVATE
bool
ImplIsInTaskPaneList
(
Window
*
pWin
);
SAL_DLLPRIVATE
bool
isDeferredInit
()
const
{
return
mbIsDefferedInit
;
}
private
:
SAL_DLLPRIVATE
void
Init
();
...
...
@@ -168,7 +170,7 @@ private:
protected
:
// Single argument ctors shall be explicit.
explicit
SystemWindow
(
WindowType
nType
);
explicit
SystemWindow
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
,
WindowType
nType
);
void
loadUI
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
);
void
SetWindowStateData
(
const
WindowStateData
&
rData
);
...
...
@@ -187,7 +189,6 @@ public:
virtual
void
Resizing
(
Size
&
rSize
);
virtual
void
Resize
()
SAL_OVERRIDE
;
virtual
Size
GetOptimalSize
()
const
SAL_OVERRIDE
;
virtual
void
StateChanged
(
StateChangedType
nStateChange
)
SAL_OVERRIDE
;
virtual
void
queue_resize
(
StateChangedType
eReason
=
STATE_CHANGE_LAYOUT
)
SAL_OVERRIDE
;
bool
isLayoutEnabled
()
const
;
void
setOptimalLayoutSize
();
...
...
@@ -274,6 +275,8 @@ public:
const
Link
&
GetCloseHdl
()
const
;
SAL_DLLPRIVATE
bool
hasPendingLayout
()
const
{
return
maLayoutTimer
.
IsActive
();
}
virtual
void
doDeferredInit
(
bool
bResizable
);
};
#endif // INCLUDED_VCL_SYSWIN_HXX
...
...
vcl/source/uipreviewer/previewer.cxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -70,18 +70,23 @@ int UIPreviewApp::Main()
{
VclBuilder
aBuilder
(
pDialog
,
OUString
(),
uifiles
[
0
]);
Dialog
*
pRealDialog
=
dynamic_cast
<
Dialog
*>
(
aBuilder
.
get_widget_root
());
Window
*
pRoot
=
aBuilder
.
get_widget_root
();
Dialog
*
pRealDialog
=
dynamic_cast
<
Dialog
*>
(
pRoot
);
if
(
!
pRealDialog
)
pRealDialog
=
pDialog
;
if
(
pRealDialog
)
{
pRealDialog
->
SetText
(
OUString
(
"LibreOffice ui-previewer"
));
pRealDialog
->
SetStyle
(
pDialog
->
GetStyle
()
|
WB_CLOSEABLE
);
/*
Force a new STATE_CHANGE_INITSHOW for the edge case where pRoot
is not a dialog or contents of a dialog, but instead a visible floating window
which may have had initshow already done before it was given children
*/
pRoot
->
Hide
();
pRoot
->
Show
();
pRealDialog
->
Execute
();
}
}
delete
pDialog
;
}
...
...
vcl/source/window/builder.cxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -176,7 +176,7 @@ VclBuilder::VclBuilder(Window *pParent, const OUString& sUIDir, const OUString&
,
m_pParserState
(
new
ParserState
)
,
m_xFrame
(
rFrame
)
{
m_bToplevelHasDeferredInit
=
pParent
&&
pParent
->
Is
Dialog
()
&&
static_cast
<
Dialog
*>
(
pParent
)
->
isDeferredInit
();
m_bToplevelHasDeferredInit
=
pParent
&&
pParent
->
Is
SystemWindow
()
&&
static_cast
<
SystemWindow
*>
(
pParent
)
->
isDeferredInit
();
m_bToplevelHasDeferredProperties
=
m_bToplevelHasDeferredInit
;
sal_Int32
nIdx
=
m_sHelpRoot
.
lastIndexOf
(
'.'
);
...
...
@@ -571,6 +571,18 @@ OString VclBuilder::extractCustomProperty(VclBuilder::stringmap &rMap)
namespace
{
OString
extractTypeHint
(
VclBuilder
::
stringmap
&
rMap
)
{
OString
sRet
(
"normal"
);
VclBuilder
::
stringmap
::
iterator
aFind
=
rMap
.
find
(
OString
(
"type-hint"
));
if
(
aFind
!=
rMap
.
end
())
{
sRet
=
aFind
->
second
;
rMap
.
erase
(
aFind
);
}
return
sRet
;
}
bool
extractResizable
(
VclBuilder
::
stringmap
&
rMap
)
{
bool
bResizable
=
true
;
...
...
@@ -1571,6 +1583,21 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
return
NULL
;
// no widget to be created
}
}
else
if
(
name
==
"GtkWindow"
)
{
WinBits
nBits
=
WB_SYSTEMWINDOW
|
WB_MOVEABLE
|
WB_3DLOOK
|
WB_CLOSEABLE
|
WB_HIDE
;
if
(
extractResizable
(
rMap
))
nBits
|=
WB_SIZEABLE
;
OString
sType
(
extractTypeHint
(
rMap
));
if
(
sType
==
"utility"
)
{
pWindow
=
new
FloatingWindow
(
pParent
,
nBits
);
}
else
{
SAL_WARN
(
"vcl.layout"
,
"no mapping yet for GtkWindow of type "
<<
sType
.
getStr
()
<<
" yet"
);
}
}
else
{
sal_Int32
nDelim
=
name
.
indexOf
(
'-'
);
...
...
@@ -1660,13 +1687,17 @@ Window *VclBuilder::insertObject(Window *pParent, const OString &rClass,
if
(
m_pParent
&&
!
isConsideredGtkPseudo
(
m_pParent
)
&&
!
m_sID
.
isEmpty
()
&&
rID
.
equals
(
m_sID
))
{
pCurrentChild
=
m_pParent
;
//toplevels default to resizable
if
(
pCurrentChild
->
IsDialog
())
//toplevels default to resizable and apparently you can't change them
//afterwards, so we need to wait until now before we can truly
//initialize the dialog.
if
(
pParent
->
IsSystemWindow
())
{
Dialog
*
pDialog
=
static_cast
<
Dialog
*>
(
pCurrentChild
);
p
Dialog
->
doDeferredInit
(
extractResizable
(
rProps
));
SystemWindow
*
pSysWin
=
static_cast
<
SystemWindow
*>
(
pCurrentChild
);
p
SysWin
->
doDeferredInit
(
extractResizable
(
rProps
));
m_bToplevelHasDeferredInit
=
false
;
}
if
(
pCurrentChild
->
GetHelpId
().
isEmpty
())
{
pCurrentChild
->
SetHelpId
(
m_sHelpRoot
+
m_sID
);
...
...
vcl/source/window/dialog.cxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -339,7 +339,6 @@ struct DialogImpl
void
Dialog
::
ImplInitDialogData
()
{
mpWindowImpl
->
mbDialog
=
true
;
mpDialogParent
=
NULL
;
mpPrevExecuteDlg
=
NULL
;
mbInExecute
=
false
;
mbOldSaveBack
=
false
;
...
...
@@ -450,7 +449,6 @@ void Dialog::ImplInitSettings()
Dialog
::
Dialog
(
WindowType
nType
)
:
SystemWindow
(
nType
)
,
mbIsDefferedInit
(
false
)
{
ImplInitDialogData
();
}
...
...
@@ -491,26 +489,21 @@ void Dialog::doDeferredInit(bool bResizable)
}
Dialog
::
Dialog
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
)
:
SystemWindow
(
WINDOW_DIALOG
)
,
mbIsDefferedInit
(
true
)
:
SystemWindow
(
WINDOW_DIALOG
)
{
ImplInitDialogData
();
mpDialogParent
=
pParent
;
//will be unset in doDeferredInit
m_pUIBuilder
=
new
VclBuilder
(
this
,
getUIRootDir
(),
rUIXMLDescription
,
rID
);
loadUI
(
pParent
,
rID
,
rUIXMLDescription
);
}
Dialog
::
Dialog
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
,
WindowType
nType
)
:
SystemWindow
(
nType
)
,
mbIsDefferedInit
(
true
)
:
SystemWindow
(
nType
)
{
ImplInitDialogData
();
mpDialogParent
=
pParent
;
//will be unset in doDeferredInit
m_pUIBuilder
=
new
VclBuilder
(
this
,
getUIRootDir
(),
rUIXMLDescription
,
rID
);
loadUI
(
pParent
,
rID
,
rUIXMLDescription
);
}
Dialog
::
Dialog
(
Window
*
pParent
,
WinBits
nStyle
)
:
SystemWindow
(
WINDOW_DIALOG
)
,
mbIsDefferedInit
(
false
)
Dialog
::
Dialog
(
Window
*
pParent
,
WinBits
nStyle
)
:
SystemWindow
(
WINDOW_DIALOG
)
{
ImplInitDialogData
();
ImplInit
(
pParent
,
nStyle
);
...
...
vcl/source/window/floatwin.cxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -165,8 +165,21 @@ FloatingWindow::FloatingWindow( Window* pParent, const ResId& rResId ) :
}
FloatingWindow
::
FloatingWindow
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
)
:
SystemWindow
(
pParent
,
rID
,
rUIXMLDescription
,
WINDOW_FLOATINGWINDOW
)
:
SystemWindow
(
WINDOW_FLOATINGWINDOW
)
{
loadUI
(
pParent
,
rID
,
rUIXMLDescription
);
}
//Find the real parent stashed in mpDialogParent.
void
FloatingWindow
::
doDeferredInit
(
bool
bResizable
)
{
WinBits
nBits
=
WB_MOVEABLE
|
WB_3DLOOK
;
if
(
bResizable
)
nBits
|=
WB_SIZEABLE
;
Window
*
pParent
=
mpDialogParent
;
mpDialogParent
=
NULL
;
ImplInit
(
pParent
,
nBits
);
mbIsDefferedInit
=
false
;
}
void
FloatingWindow
::
ImplLoadRes
(
const
ResId
&
rResId
)
...
...
@@ -554,6 +567,11 @@ bool FloatingWindow::Notify( NotifyEvent& rNEvt )
void
FloatingWindow
::
StateChanged
(
StateChangedType
nType
)
{
if
(
nType
==
STATE_CHANGE_INITSHOW
)
{
DoInitialLayout
();
}
SystemWindow
::
StateChanged
(
nType
);
if
(
nType
==
STATE_CHANGE_CONTROLBACKGROUND
)
...
...
vcl/source/window/syswin.cxx
Dosyayı görüntüle @
05d4077b
...
...
@@ -81,6 +81,7 @@ void SystemWindow::Init()
mbInitialLayoutDone
=
false
;
mnMenuBarMode
=
MENUBAR_MODE_NORMAL
;
mnIcon
=
0
;
mpDialogParent
=
NULL
;
//To-Do, reuse maResizeTimer
maLayoutTimer
.
SetTimeout
(
50
);
...
...
@@ -89,14 +90,15 @@ void SystemWindow::Init()
SystemWindow
::
SystemWindow
(
WindowType
nType
)
:
Window
(
nType
)
,
mbIsDefferedInit
(
false
)
{
Init
();
}
SystemWindow
::
SystemWindow
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
,
WindowType
nType
)
:
Window
(
pParent
,
nType
)
void
SystemWindow
::
loadUI
(
Window
*
pParent
,
const
OString
&
rID
,
const
OUString
&
rUIXMLDescription
)
{
Init
();
mbIsDefferedInit
=
true
;
mpDialogParent
=
pParent
;
//should be unset in doDeferredInit
m_pUIBuilder
=
new
VclBuilder
(
this
,
getUIRootDir
(),
rUIXMLDescription
,
rID
);
}
...
...
@@ -1102,14 +1104,9 @@ void SystemWindow::DoInitialLayout()
}
}
void
SystemWindow
::
StateChanged
(
StateChangedType
nType
)
void
SystemWindow
::
doDeferredInit
(
bool
/*bResizable*/
)
{
Window
::
StateChanged
(
nType
);
if
(
nType
==
STATE_CHANGE_INITSHOW
&&
!
mbInitialLayoutDone
)
{
DoInitialLayout
();
}
SAL_WARN
(
"vcl.layout"
,
"SystemWindow in layout without doDeferredInit impl"
);
}
/* 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