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
634ee953
Kaydet (Commit)
634ee953
authored
Ara 13, 2012
tarafından
Muthu Subramanian
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#56402: SVG in About Dialog.
üst
6b5059c7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
61 deletions
+55
-61
about.cxx
cui/source/dialogs/about.cxx
+15
-24
svapp.hxx
vcl/inc/vcl/svapp.hxx
+1
-0
svgdata.hxx
vcl/inc/vcl/svgdata.hxx
+1
-0
brand.cxx
vcl/source/app/brand.cxx
+9
-37
svgdata.cxx
vcl/source/gdi/svgdata.cxx
+29
-0
No files found.
cui/source/dialogs/about.cxx
Dosyayı görüntüle @
634ee953
...
@@ -207,22 +207,19 @@ void AboutDialog::LayoutControls()
...
@@ -207,22 +207,19 @@ void AboutDialog::LayoutControls()
Size
aLogoSize
(
aIdealTextWidth
,
aIdealTextWidth
/
20
);
Size
aLogoSize
(
aIdealTextWidth
,
aIdealTextWidth
/
20
);
Point
aLogoPos
(
0
,
0
);
Point
aLogoPos
(
0
,
0
);
#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
if
(
Application
::
LoadBrandSVG
(
"flat_logo"
,
aLogoBitmap
)
&&
vcl
::
RenderGraphicRasterizer
aRasterizerLogo
=
Application
::
LoadBrandSVG
(
"flat_logo"
);
!
aLogoBitmap
.
IsEmpty
()
)
if
(
!
aRasterizerLogo
.
GetRenderGraphic
().
IsEmpty
()
&&
aRasterizerLogo
.
GetDefaultSizePixel
().
Width
()
>
0
&&
aRasterizerLogo
.
GetDefaultSizePixel
().
Height
()
>
0
)
{
{
const
float
aLogoWidthHeightRatio
=
(
float
)
a
RasterizerLogo
.
GetDefaultSizePixel
().
Width
()
/
(
float
)
aRasterizerLogo
.
GetDefaul
tSizePixel
().
Height
();
const
float
aLogoWidthHeightRatio
=
(
float
)
a
LogoBitmap
.
GetSizePixel
().
Width
()
/
(
float
)
aLogoBitmap
.
Ge
tSizePixel
().
Height
();
aLogoSize
.
Width
()
=
aDialogSize
.
Width
()
;
aLogoSize
.
Width
()
=
aDialogSize
.
Width
()
;
aLogoSize
.
Height
()
=
aLogoSize
.
Width
()
/
aLogoWidthHeightRatio
;
aLogoSize
.
Height
()
=
aLogoSize
.
Width
()
/
aLogoWidthHeightRatio
;
aLogoBitmap
.
Scale
(
aLogoSize
);
aLogoBitmap
=
aRasterizerLogo
.
Rasterize
(
aLogoSize
);
aLogoImage
.
SetImage
(
Image
(
aLogoBitmap
)
);
aLogoImage
.
SetImage
(
Image
(
aLogoBitmap
)
);
aLogoImage
.
SetPosSizePixel
(
aLogoPos
,
aLogoSize
);
aLogoImage
.
SetPosSizePixel
(
aLogoPos
,
aLogoSize
);
aLogoImage
.
Show
();
aLogoImage
.
Show
();
}
}
else
else
#endif
{
{
aLogoPos
.
X
()
=
aDialogBorder
;
aLogoPos
.
X
()
=
aDialogBorder
;
aLogoPos
.
Y
()
=
aDialogBorder
;
aLogoPos
.
Y
()
=
aDialogBorder
;
...
@@ -277,27 +274,21 @@ void AboutDialog::LayoutControls()
...
@@ -277,27 +274,21 @@ void AboutDialog::LayoutControls()
// Layout background image
// Layout background image
#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
if
(
!
(
Application
::
GetSettings
().
GetStyleSettings
().
GetHighContrastMode
())
&&
if
(
!
(
Application
::
GetSettings
().
GetStyleSettings
().
GetHighContrastMode
())
)
{
Application
::
LoadBrandSVG
(
"shell/about"
,
aBackgroundBitmap
)
&&
vcl
::
RenderGraphicRasterizer
aRasterizerBackground
=
Application
::
LoadBrandSVG
(
"shell/about"
);
!
aBackgroundBitmap
.
IsEmpty
()
)
{
const
float
aBackgroundWidthHeightRatio
=
(
float
)
aBackgroundBitmap
.
GetSizePixel
().
Width
()
/
(
float
)
aBackgroundBitmap
.
GetSizePixel
().
Height
();
Size
aBackgroundSize
(
aDialogSize
.
Width
(),
aDialogSize
.
Width
()
/
aBackgroundWidthHeightRatio
);
if
(
!
aRasterizerBackground
.
GetRenderGraphic
().
IsEmpty
()
&&
if
(
aBackgroundSize
.
Height
()
<
aDialogSize
.
Height
())
aRasterizerBackground
.
GetDefaultSizePixel
().
Width
()
>
0
&&
aRasterizerBackground
.
GetDefaultSizePixel
().
Height
()
>
0
)
{
{
const
float
aBackgroundWidthHeightRatio
=
(
float
)
aRasterizerBackground
.
GetDefaultSizePixel
().
Width
()
/
aBackgroundSize
.
Width
()
=
aDialogSize
.
Height
()
*
aBackgroundWidthHeightRatio
;
(
float
)
aRasterizerBackground
.
GetDefaultSizePixel
().
Height
();
aBackgroundSize
.
Height
()
=
aDialogSize
.
Height
();
Size
aBackgroundSize
(
aDialogSize
.
Width
(),
aDialogSize
.
Width
()
/
aBackgroundWidthHeightRatio
);
if
(
aBackgroundSize
.
Height
()
<
aDialogSize
.
Height
())
{
aBackgroundSize
.
Width
()
=
aDialogSize
.
Height
()
*
aBackgroundWidthHeightRatio
;
aBackgroundSize
.
Height
()
=
aDialogSize
.
Height
();
}
aBackgroundBitmap
=
aRasterizerBackground
.
Rasterize
(
aBackgroundSize
);
}
}
aBackgroundBitmap
.
Scale
(
aBackgroundSize
);
}
}
#endif
SetOutputSizePixel
(
aDialogSize
);
SetOutputSizePixel
(
aDialogSize
);
...
...
vcl/inc/vcl/svapp.hxx
Dosyayı görüntüle @
634ee953
...
@@ -267,6 +267,7 @@ public:
...
@@ -267,6 +267,7 @@ public:
static
void
SetAppName
(
const
String
&
rUniqueName
);
static
void
SetAppName
(
const
String
&
rUniqueName
);
static
String
GetAppName
();
static
String
GetAppName
();
static
bool
LoadBrandBitmap
(
const
char
*
pName
,
BitmapEx
&
rBitmap
);
static
bool
LoadBrandBitmap
(
const
char
*
pName
,
BitmapEx
&
rBitmap
);
static
bool
LoadBrandSVG
(
const
char
*
pName
,
BitmapEx
&
rBitmap
);
// default name of the application for message dialogs and printing
// default name of the application for message dialogs and printing
static
void
SetDisplayName
(
const
UniString
&
rDisplayName
);
static
void
SetDisplayName
(
const
UniString
&
rDisplayName
);
...
...
vcl/inc/vcl/svgdata.hxx
Dosyayı görüntüle @
634ee953
...
@@ -57,6 +57,7 @@ private:
...
@@ -57,6 +57,7 @@ private:
public
:
public
:
SvgData
(
const
SvgDataArray
&
rSvgDataArray
,
sal_uInt32
nSvgDataArrayLength
,
const
rtl
::
OUString
&
rPath
);
SvgData
(
const
SvgDataArray
&
rSvgDataArray
,
sal_uInt32
nSvgDataArrayLength
,
const
rtl
::
OUString
&
rPath
);
SvgData
(
const
rtl
::
OUString
&
rPath
);
/// data read
/// data read
const
SvgDataArray
&
getSvgDataArray
()
const
{
return
maSvgDataArray
;
}
const
SvgDataArray
&
getSvgDataArray
()
const
{
return
maSvgDataArray
;
}
...
...
vcl/source/app/brand.cxx
Dosyayı görüntüle @
634ee953
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <tools/stream.hxx>
#include <tools/stream.hxx>
#include <vcl/pngread.hxx>
#include <vcl/pngread.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svgdata.hxx>
namespace
{
namespace
{
static
bool
loadPng
(
const
char
*
pPath
,
const
rtl
::
OUString
&
rName
,
BitmapEx
&
rBitmap
)
static
bool
loadPng
(
const
char
*
pPath
,
const
rtl
::
OUString
&
rName
,
BitmapEx
&
rBitmap
)
...
@@ -40,27 +41,6 @@ namespace {
...
@@ -40,27 +41,6 @@ namespace {
else
else
return
false
;
return
false
;
}
}
#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
static
vcl
::
RenderGraphicRasterizer
loadSvg
(
const
char
*
pPath
,
const
rtl
::
OUString
&
rName
)
{
rtl
::
OUString
uri
=
rtl
::
OUString
::
createFromAscii
(
pPath
)
+
rName
;
rtl
::
Bootstrap
::
expandMacros
(
uri
);
INetURLObject
aObj
(
uri
);
SvFileStream
aStrm
(
aObj
.
PathToFileName
(),
STREAM_STD_READ
);
vcl
::
RenderGraphic
aRenderGraphic
;
vcl
::
RenderGraphic
aRasterizer
(
aRenderGraphic
);
if
(
!
aStrm
.
GetError
()
)
{
vcl
::
SVGReader
aSVGReader
(
aStrm
);
aRenderGraphic
=
aSVGReader
.
GetRenderGraphic
();
vcl
::
RenderGraphic
aNewRasterizer
(
aRenderGraphic
);
aRasterizer
=
aNewRasterizer
;
}
return
aRasterizer
;
}
#endif
}
}
bool
Application
::
LoadBrandBitmap
(
const
char
*
pName
,
BitmapEx
&
rBitmap
)
bool
Application
::
LoadBrandBitmap
(
const
char
*
pName
,
BitmapEx
&
rBitmap
)
...
@@ -86,8 +66,7 @@ bool Application::LoadBrandBitmap (const char* pName, BitmapEx &rBitmap)
...
@@ -86,8 +66,7 @@ bool Application::LoadBrandBitmap (const char* pName, BitmapEx &rBitmap)
loadPng
(
"$BRAND_BASE_DIR/program"
,
aName
,
rBitmap
)
);
loadPng
(
"$BRAND_BASE_DIR/program"
,
aName
,
rBitmap
)
);
}
}
#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
bool
Application
::
LoadBrandSVG
(
const
char
*
pName
,
BitmapEx
&
rBitmap
)
vcl
::
RenderGraphicRasterizer
Application
::
LoadBrandSVG
(
const
char
*
pName
)
{
{
rtl
::
OUString
aBaseName
=
(
rtl
::
OUString
(
"/"
)
+
rtl
::
OUString
aBaseName
=
(
rtl
::
OUString
(
"/"
)
+
rtl
::
OUString
::
createFromAscii
(
pName
)
);
rtl
::
OUString
::
createFromAscii
(
pName
)
);
...
@@ -101,20 +80,13 @@ vcl::RenderGraphicRasterizer Application::LoadBrandSVG (const char* pName)
...
@@ -101,20 +80,13 @@ vcl::RenderGraphicRasterizer Application::LoadBrandSVG (const char* pName)
rtl
::
OUString
aLocaleName
=
(
aBaseName
+
rtl
::
OUString
(
"-"
)
+
rtl
::
OUString
aLocaleName
=
(
aBaseName
+
rtl
::
OUString
(
"-"
)
+
aLanguageTag
.
getBcp47
()
+
aLanguageTag
.
getBcp47
()
+
aSvg
);
aSvg
);
//rtl::OUString uri = rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ) + aLocaleName;
vcl
::
RenderGraphicRasterizer
aRasterizer
=
loadSvg
(
"$BRAND_BASE_DIR/program/edition"
,
aLocaleName
);
rtl
::
OUString
uri
=
rtl
::
OUString
::
createFromAscii
(
"$BRAND_BASE_DIR/program"
)
+
aBaseName
+
aSvg
;
if
(
!
aRasterizer
.
GetRenderGraphic
().
IsEmpty
())
rtl
::
Bootstrap
::
expandMacros
(
uri
);
return
aRasterizer
;
INetURLObject
aObj
(
uri
);
aRasterizer
=
loadSvg
(
"$BRAND_BASE_DIR/program"
,
aLocaleName
);
SvgData
aSvgData
(
aObj
.
PathToFileName
());
if
(
!
aRasterizer
.
GetRenderGraphic
().
IsEmpty
())
rBitmap
=
aSvgData
.
getReplacement
();
return
aRasterizer
;
return
true
;
aRasterizer
=
loadSvg
(
"$BRAND_BASE_DIR/program/edition"
,
aName
);
if
(
!
aRasterizer
.
GetRenderGraphic
().
IsEmpty
())
return
aRasterizer
;
aRasterizer
=
loadSvg
(
"$BRAND_BASE_DIR/program"
,
aName
);
return
aRasterizer
;
}
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/gdi/svgdata.cxx
Dosyayı görüntüle @
634ee953
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#include <tools/stream.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/svgdata.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
...
@@ -163,6 +164,34 @@ SvgData::SvgData(const SvgDataArray& rSvgDataArray, sal_uInt32 nSvgDataArrayLeng
...
@@ -163,6 +164,34 @@ SvgData::SvgData(const SvgDataArray& rSvgDataArray, sal_uInt32 nSvgDataArrayLeng
{
{
}
}
//////////////////////////////////////////////////////////////////////////////
SvgData
::
SvgData
(
const
OUString
&
rPath
)
:
maSvgDataArray
(
NULL
),
mnSvgDataArrayLength
(
0
),
maPath
(
rPath
),
maRange
(),
maSequence
(),
maReplacement
()
{
SvFileStream
rIStm
(
rPath
,
STREAM_STD_READ
);
if
(
rIStm
.
GetError
())
return
;
const
sal_uInt32
nStmPos
(
rIStm
.
Tell
());
const
sal_uInt32
nStmLen
(
rIStm
.
Seek
(
STREAM_SEEK_TO_END
)
-
nStmPos
);
if
(
nStmLen
)
{
SvgDataArray
aNewData
(
new
sal_uInt8
[
nStmLen
]);
rIStm
.
Seek
(
nStmPos
);
rIStm
.
Read
(
aNewData
.
get
(),
nStmLen
);
if
(
!
rIStm
.
GetError
())
{
maSvgDataArray
=
aNewData
;
mnSvgDataArrayLength
=
nStmLen
;
}
}
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
const
basegfx
::
B2DRange
&
SvgData
::
getRange
()
const
const
basegfx
::
B2DRange
&
SvgData
::
getRange
()
const
...
...
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