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
1382dad9
Kaydet (Commit)
1382dad9
authored
Nis 10, 2013
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor refactoring: Move a function to the only file where it is used
Change-Id: I98f1eda871eb36cdf61e003d046395698dcdad18
üst
8b7da751
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
155 deletions
+87
-155
Library_vclplug_gen.mk
vcl/Library_vclplug_gen.mk
+0
-1
soicon.hxx
vcl/inc/unx/soicon.hxx
+0
-33
soicon.cxx
vcl/unx/generic/app/soicon.cxx
+0
-110
salframe.cxx
vcl/unx/generic/window/salframe.cxx
+87
-11
No files found.
vcl/Library_vclplug_gen.mk
Dosyayı görüntüle @
1382dad9
...
...
@@ -73,7 +73,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
vcl/unx/generic/app/salinst \
vcl/unx/generic/app/saltimer \
vcl/unx/generic/app/sm \
vcl/unx/generic/app/soicon \
vcl/unx/generic/app/wmadaptor \
vcl/unx/generic/dtrans/bmp \
vcl/unx/generic/dtrans/config \
...
...
vcl/inc/unx/soicon.hxx
deleted
100644 → 0
Dosyayı görüntüle @
8b7da751
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _SV_SOICON_HXX
#define _SV_SOICON_HXX
#include <unx/saltype.h>
class
SalDisplay
;
class
SalBitmap
;
class
Bitmap
;
sal_Bool
SelectAppIconPixmap
(
SalDisplay
*
pDisplay
,
SalX11Screen
nScreen
,
sal_uInt16
nIcon
,
sal_uInt16
iconSize
,
Pixmap
&
icon_pixmap
,
Pixmap
&
icon_mask
);
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/unx/generic/app/soicon.cxx
deleted
100644 → 0
Dosyayı görüntüle @
8b7da751
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <unx/salunx.h>
#include <unx/saldisp.hxx>
#include <unx/salbmp.h>
#include <unx/soicon.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/graph.hxx>
#include <svdata.hxx>
#include <svids.hrc>
#include <salbmp.hxx>
#include <impbmp.hxx>
sal_Bool
SelectAppIconPixmap
(
SalDisplay
*
pDisplay
,
SalX11Screen
nXScreen
,
sal_uInt16
nIcon
,
sal_uInt16
iconSize
,
Pixmap
&
icon_pixmap
,
Pixmap
&
icon_mask
)
{
if
(
!
ImplGetResMgr
()
)
return
sal_False
;
sal_uInt16
nIconSizeOffset
;
if
(
iconSize
>=
48
)
nIconSizeOffset
=
SV_ICON_SIZE48_START
;
else
if
(
iconSize
>=
32
)
nIconSizeOffset
=
SV_ICON_SIZE32_START
;
else
if
(
iconSize
>=
16
)
nIconSizeOffset
=
SV_ICON_SIZE16_START
;
else
return
sal_False
;
BitmapEx
aIcon
(
ResId
(
nIconSizeOffset
+
nIcon
,
*
ImplGetResMgr
()));
if
(
sal_True
==
aIcon
.
IsEmpty
()
)
return
sal_False
;
SalTwoRect
aRect
;
aRect
.
mnSrcX
=
0
;
aRect
.
mnSrcY
=
0
;
aRect
.
mnSrcWidth
=
iconSize
;
aRect
.
mnSrcHeight
=
iconSize
;
aRect
.
mnDestX
=
0
;
aRect
.
mnDestY
=
0
;
aRect
.
mnDestWidth
=
iconSize
;
aRect
.
mnDestHeight
=
iconSize
;
X11SalBitmap
*
pBitmap
=
static_cast
<
X11SalBitmap
*
>
(
aIcon
.
ImplGetBitmapImpBitmap
()
->
ImplGetSalBitmap
());
icon_pixmap
=
XCreatePixmap
(
pDisplay
->
GetDisplay
(),
pDisplay
->
GetRootWindow
(
nXScreen
),
iconSize
,
iconSize
,
DefaultDepth
(
pDisplay
->
GetDisplay
(),
nXScreen
.
getXScreen
()
)
);
pBitmap
->
ImplDraw
(
icon_pixmap
,
nXScreen
,
DefaultDepth
(
pDisplay
->
GetDisplay
(),
nXScreen
.
getXScreen
()
),
aRect
,
DefaultGC
(
pDisplay
->
GetDisplay
(),
nXScreen
.
getXScreen
()
)
);
icon_mask
=
None
;
if
(
TRANSPARENT_BITMAP
==
aIcon
.
GetTransparentType
()
)
{
icon_mask
=
XCreatePixmap
(
pDisplay
->
GetDisplay
(),
pDisplay
->
GetRootWindow
(
pDisplay
->
GetDefaultXScreen
()
),
iconSize
,
iconSize
,
1
);
XGCValues
aValues
;
aValues
.
foreground
=
0xffffffff
;
aValues
.
background
=
0
;
aValues
.
function
=
GXcopy
;
GC
aMonoGC
=
XCreateGC
(
pDisplay
->
GetDisplay
(),
icon_mask
,
GCFunction
|
GCForeground
|
GCBackground
,
&
aValues
);
Bitmap
aMask
=
aIcon
.
GetMask
();
aMask
.
Invert
();
X11SalBitmap
*
pMask
=
static_cast
<
X11SalBitmap
*
>
(
aMask
.
ImplGetImpBitmap
()
->
ImplGetSalBitmap
());
pMask
->
ImplDraw
(
icon_mask
,
nXScreen
,
1
,
aRect
,
aMonoGC
);
XFreeGC
(
pDisplay
->
GetDisplay
(),
aMonoGC
);
}
return
sal_True
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/unx/generic/window/salframe.cxx
Dosyayı görüntüle @
1382dad9
...
...
@@ -50,7 +50,6 @@
#include "unx/saldisp.hxx"
#include "unx/salgdi.h"
#include "unx/salframe.h"
#include "unx/soicon.hxx"
#include "unx/sm.hxx"
#include "unx/wmadaptor.hxx"
#include "generic/genprn.h"
...
...
@@ -66,6 +65,9 @@
#include <sal/macros.h>
#include <com/sun/star/uno/Exception.hpp>
#include "svids.hrc"
#include "impbmp.hxx"
#include <algorithm>
#ifndef Button6
...
...
@@ -191,6 +193,80 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
GetGenericData
()
->
ErrorTrapPop
();
}
static
sal_Bool
lcl_SelectAppIconPixmap
(
SalDisplay
*
pDisplay
,
SalX11Screen
nXScreen
,
sal_uInt16
nIcon
,
sal_uInt16
iconSize
,
Pixmap
&
icon_pixmap
,
Pixmap
&
icon_mask
)
{
if
(
!
ImplGetResMgr
()
)
return
sal_False
;
sal_uInt16
nIconSizeOffset
;
if
(
iconSize
>=
48
)
nIconSizeOffset
=
SV_ICON_SIZE48_START
;
else
if
(
iconSize
>=
32
)
nIconSizeOffset
=
SV_ICON_SIZE32_START
;
else
if
(
iconSize
>=
16
)
nIconSizeOffset
=
SV_ICON_SIZE16_START
;
else
return
sal_False
;
BitmapEx
aIcon
(
ResId
(
nIconSizeOffset
+
nIcon
,
*
ImplGetResMgr
()));
if
(
sal_True
==
aIcon
.
IsEmpty
()
)
return
sal_False
;
SalTwoRect
aRect
;
aRect
.
mnSrcX
=
0
;
aRect
.
mnSrcY
=
0
;
aRect
.
mnSrcWidth
=
iconSize
;
aRect
.
mnSrcHeight
=
iconSize
;
aRect
.
mnDestX
=
0
;
aRect
.
mnDestY
=
0
;
aRect
.
mnDestWidth
=
iconSize
;
aRect
.
mnDestHeight
=
iconSize
;
X11SalBitmap
*
pBitmap
=
static_cast
<
X11SalBitmap
*
>
(
aIcon
.
ImplGetBitmapImpBitmap
()
->
ImplGetSalBitmap
());
icon_pixmap
=
XCreatePixmap
(
pDisplay
->
GetDisplay
(),
pDisplay
->
GetRootWindow
(
nXScreen
),
iconSize
,
iconSize
,
DefaultDepth
(
pDisplay
->
GetDisplay
(),
nXScreen
.
getXScreen
()
)
);
pBitmap
->
ImplDraw
(
icon_pixmap
,
nXScreen
,
DefaultDepth
(
pDisplay
->
GetDisplay
(),
nXScreen
.
getXScreen
()
),
aRect
,
DefaultGC
(
pDisplay
->
GetDisplay
(),
nXScreen
.
getXScreen
()
)
);
icon_mask
=
None
;
if
(
TRANSPARENT_BITMAP
==
aIcon
.
GetTransparentType
()
)
{
icon_mask
=
XCreatePixmap
(
pDisplay
->
GetDisplay
(),
pDisplay
->
GetRootWindow
(
pDisplay
->
GetDefaultXScreen
()
),
iconSize
,
iconSize
,
1
);
XGCValues
aValues
;
aValues
.
foreground
=
0xffffffff
;
aValues
.
background
=
0
;
aValues
.
function
=
GXcopy
;
GC
aMonoGC
=
XCreateGC
(
pDisplay
->
GetDisplay
(),
icon_mask
,
GCFunction
|
GCForeground
|
GCBackground
,
&
aValues
);
Bitmap
aMask
=
aIcon
.
GetMask
();
aMask
.
Invert
();
X11SalBitmap
*
pMask
=
static_cast
<
X11SalBitmap
*
>
(
aMask
.
ImplGetImpBitmap
()
->
ImplGetSalBitmap
());
pMask
->
ImplDraw
(
icon_mask
,
nXScreen
,
1
,
aRect
,
aMonoGC
);
XFreeGC
(
pDisplay
->
GetDisplay
(),
aMonoGC
);
}
return
sal_True
;
}
void
X11SalFrame
::
Init
(
sal_uLong
nSalFrameStyle
,
SalX11Screen
nXScreen
,
SystemParentData
*
pParentData
,
bool
bUseGeometry
)
{
if
(
nXScreen
.
getXScreen
()
>=
GetDisplay
()
->
GetXScreenCount
()
)
...
...
@@ -401,10 +477,10 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, SalX11Screen nXScreen, SystemP
bool
bOk
=
false
;
try
{
bOk
=
SelectAppIconPixmap
(
pDisplay_
,
m_nXScreen
,
mnIconID
!=
1
?
mnIconID
:
(
mpParent
?
mpParent
->
mnIconID
:
1
),
32
,
Hints
.
icon_pixmap
,
Hints
.
icon_mask
);
bOk
=
lcl_
SelectAppIconPixmap
(
pDisplay_
,
m_nXScreen
,
mnIconID
!=
1
?
mnIconID
:
(
mpParent
?
mpParent
->
mnIconID
:
1
),
32
,
Hints
.
icon_pixmap
,
Hints
.
icon_mask
);
}
catch
(
com
::
sun
::
star
::
uno
::
Exception
&
)
{
...
...
@@ -931,15 +1007,15 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon )
}
pHints
=
&
Hints
;
sal_Bool
bOk
=
SelectAppIconPixmap
(
GetDisplay
(),
m_nXScreen
,
nIcon
,
iconSize
,
pHints
->
icon_pixmap
,
pHints
->
icon_mask
);
sal_Bool
bOk
=
lcl_
SelectAppIconPixmap
(
GetDisplay
(),
m_nXScreen
,
nIcon
,
iconSize
,
pHints
->
icon_pixmap
,
pHints
->
icon_mask
);
if
(
!
bOk
)
{
// load default icon (0)
bOk
=
SelectAppIconPixmap
(
GetDisplay
(),
m_nXScreen
,
0
,
iconSize
,
pHints
->
icon_pixmap
,
pHints
->
icon_mask
);
bOk
=
lcl_
SelectAppIconPixmap
(
GetDisplay
(),
m_nXScreen
,
0
,
iconSize
,
pHints
->
icon_pixmap
,
pHints
->
icon_mask
);
}
if
(
bOk
)
{
...
...
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