Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
00b26db6
Commit
00b26db6
authored
Nov 21, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skins2: Cosmetics
parent
1603369c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
165 deletions
+152
-165
modules/gui/skins2/src/theme_loader.cpp
modules/gui/skins2/src/theme_loader.cpp
+31
-32
modules/gui/skins2/utils/position.cpp
modules/gui/skins2/utils/position.cpp
+8
-8
modules/gui/skins2/win32/win32_factory.cpp
modules/gui/skins2/win32/win32_factory.cpp
+6
-18
modules/gui/skins2/x11/x11_display.cpp
modules/gui/skins2/x11/x11_display.cpp
+95
-95
modules/gui/skins2/x11/x11_loop.cpp
modules/gui/skins2/x11/x11_loop.cpp
+12
-12
No files found.
modules/gui/skins2/src/theme_loader.cpp
View file @
00b26db6
...
...
@@ -579,34 +579,33 @@ int tar_extract_all( TAR *t, char *prefix )
switch
(
buffer
.
header
.
typeflag
)
{
case
DIRTYPE
:
makedir
(
fname
);
break
;
case
REGTYPE
:
case
AREGTYPE
:
remaining
=
getoct
(
buffer
.
header
.
size
,
12
);
if
(
remaining
)
case
DIRTYPE
:
makedir
(
fname
);
break
;
case
REGTYPE
:
case
AREGTYPE
:
remaining
=
getoct
(
buffer
.
header
.
size
,
12
);
if
(
!
remaining
)
outfile
=
NULL
;
else
{
outfile
=
fopen
(
fname
,
"wb"
);
if
(
outfile
==
NULL
)
{
outfile
=
fopen
(
fname
,
"wb"
);
if
(
outfile
==
NULL
)
/* try creating directory */
char
*
p
=
strrchr
(
fname
,
'/'
);
if
(
p
!=
NULL
)
{
/* try creating directory */
char
*
p
=
strrchr
(
fname
,
'/'
);
if
(
p
!=
NULL
)
*
p
=
'\0'
;
makedir
(
fname
);
*
p
=
'/'
;
outfile
=
fopen
(
fname
,
"wb"
);
if
(
!
outfile
)
{
*
p
=
'\0'
;
makedir
(
fname
);
*
p
=
'/'
;
outfile
=
fopen
(
fname
,
"wb"
);
if
(
!
outfile
)
{
fprintf
(
stderr
,
"tar couldn't create %s
\n
"
,
fname
);
}
fprintf
(
stderr
,
"tar couldn't create %s
\n
"
,
fname
);
}
}
}
else
outfile
=
NULL
;
}
/*
* could have no contents
...
...
@@ -741,16 +740,16 @@ int gzopen_frontend( const char *pathname, int oflags, int mode )
switch
(
oflags
)
{
case
O_WRONLY
:
gzflags
=
"wb"
;
break
;
case
O_RDONLY
:
gzflags
=
"rb"
;
break
;
case
O_RDWR
:
default:
errno
=
EINVAL
;
return
-
1
;
case
O_WRONLY
:
gzflags
=
"wb"
;
break
;
case
O_RDONLY
:
gzflags
=
"rb"
;
break
;
case
O_RDWR
:
default:
errno
=
EINVAL
;
return
-
1
;
}
gzf
=
gzopen
(
pathname
,
gzflags
);
...
...
modules/gui/skins2/utils/position.cpp
View file @
00b26db6
...
...
@@ -120,14 +120,14 @@ int Position::getLeft() const
{
switch
(
m_refLeftTop
)
{
case
kLeftTop
:
case
kLeftBottom
:
return
m_rRect
.
getLeft
()
+
m_left
;
break
;
case
kRightTop
:
case
kRightBottom
:
return
m_rRect
.
getLeft
()
+
m_rRect
.
getWidth
()
+
m_left
-
1
;
break
;
case
kLeftTop
:
case
kLeftBottom
:
return
m_rRect
.
getLeft
()
+
m_left
;
break
;
case
kRightTop
:
case
kRightBottom
:
return
m_rRect
.
getLeft
()
+
m_rRect
.
getWidth
()
+
m_left
-
1
;
break
;
}
// Avoid a warning
return
0
;
...
...
modules/gui/skins2/win32/win32_factory.cpp
View file @
00b26db6
...
...
@@ -389,24 +389,12 @@ void Win32Factory::changeCursor( CursorType_t type ) const
LPCTSTR
id
;
switch
(
type
)
{
case
kDefaultArrow
:
id
=
IDC_ARROW
;
break
;
case
kResizeNWSE
:
id
=
IDC_SIZENWSE
;
break
;
case
kResizeNS
:
id
=
IDC_SIZENS
;
break
;
case
kResizeWE
:
id
=
IDC_SIZEWE
;
break
;
case
kResizeNESW
:
id
=
IDC_SIZENESW
;
break
;
default:
id
=
IDC_ARROW
;
break
;
default:
case
kDefaultArrow
:
id
=
IDC_ARROW
;
break
;
case
kResizeNWSE
:
id
=
IDC_SIZENWSE
;
break
;
case
kResizeNS
:
id
=
IDC_SIZENS
;
break
;
case
kResizeWE
:
id
=
IDC_SIZEWE
;
break
;
case
kResizeNESW
:
id
=
IDC_SIZENESW
;
break
;
}
HCURSOR
hCurs
=
LoadCursor
(
NULL
,
id
);
...
...
modules/gui/skins2/x11/x11_display.cpp
View file @
00b26db6
...
...
@@ -87,110 +87,110 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
switch
(
depth
)
{
case
8
:
xVInfoTemplate
.
c_class
=
DirectColor
;
// Get the DirectColor visual
pVInfo
=
XGetVisualInfo
(
m_pDisplay
,
VisualScreenMask
|
VisualClassMask
,
&
xVInfoTemplate
,
&
vCount
);
if
(
pVInfo
==
NULL
)
{
msg_Err
(
getIntf
(),
"no DirectColor visual available"
);
m_pDisplay
=
NULL
;
break
;
}
m_pVisual
=
pVInfo
->
visual
;
// Compute the color shifts
getShifts
(
pVInfo
->
red_mask
,
m_redLeftShift
,
m_redRightShift
);
getShifts
(
pVInfo
->
green_mask
,
m_greenLeftShift
,
m_greenRightShift
);
getShifts
(
pVInfo
->
blue_mask
,
m_blueLeftShift
,
m_blueRightShift
);
// Create a color map
m_colormap
=
XCreateColormap
(
m_pDisplay
,
root
,
DefaultVisual
(
m_pDisplay
,
screen
),
AllocAll
);
// Create the palette
XColor
pColors
[
255
];
for
(
uint16_t
i
=
0
;
i
<
255
;
i
++
)
case
8
:
xVInfoTemplate
.
c_class
=
DirectColor
;
// Get the DirectColor visual
pVInfo
=
XGetVisualInfo
(
m_pDisplay
,
VisualScreenMask
|
VisualClassMask
,
&
xVInfoTemplate
,
&
vCount
);
if
(
pVInfo
==
NULL
)
{
msg_Err
(
getIntf
(),
"no DirectColor visual available"
);
m_pDisplay
=
NULL
;
break
;
}
m_pVisual
=
pVInfo
->
visual
;
// Compute the color shifts
getShifts
(
pVInfo
->
red_mask
,
m_redLeftShift
,
m_redRightShift
);
getShifts
(
pVInfo
->
green_mask
,
m_greenLeftShift
,
m_greenRightShift
);
getShifts
(
pVInfo
->
blue_mask
,
m_blueLeftShift
,
m_blueRightShift
);
// Create a color map
m_colormap
=
XCreateColormap
(
m_pDisplay
,
root
,
DefaultVisual
(
m_pDisplay
,
screen
),
AllocAll
);
// Create the palette
XColor
pColors
[
255
];
for
(
uint16_t
i
=
0
;
i
<
255
;
i
++
)
{
// kludge: colors are indexed reversely because color 255 seems
// to bereserved for black even if we try to set it to white
pColors
[
i
].
pixel
=
254
-
i
;
pColors
[
i
].
pad
=
0
;
pColors
[
i
].
flags
=
DoRed
|
DoGreen
|
DoBlue
;
pColors
[
i
].
red
=
(
i
>>
m_redLeftShift
)
<<
(
m_redRightShift
+
8
);
pColors
[
i
].
green
=
(
i
>>
m_greenLeftShift
)
<<
(
m_greenRightShift
+
8
);
pColors
[
i
].
blue
=
(
i
>>
m_blueLeftShift
)
<<
(
m_blueRightShift
+
8
);
}
XStoreColors
(
m_pDisplay
,
m_colormap
,
pColors
,
255
);
blendPixelImpl
=
&
X11Display
::
blendPixel8
;
putPixelImpl
=
&
X11Display
::
putPixel8
;
m_pixelSize
=
1
;
break
;
case
15
:
case
16
:
case
24
:
case
32
:
// Get the TrueColor visual
xVInfoTemplate
.
c_class
=
TrueColor
;
pVInfo
=
XGetVisualInfo
(
m_pDisplay
,
VisualScreenMask
|
VisualDepthMask
|
VisualClassMask
,
&
xVInfoTemplate
,
&
vCount
);
if
(
pVInfo
==
NULL
)
{
msg_Err
(
getIntf
(),
"No TrueColor visual for depth %d"
,
depth
);
m_pDisplay
=
NULL
;
break
;
}
m_pVisual
=
pVInfo
->
visual
;
// Compute the color shifts
getShifts
(
pVInfo
->
red_mask
,
m_redLeftShift
,
m_redRightShift
);
getShifts
(
pVInfo
->
green_mask
,
m_greenLeftShift
,
m_greenRightShift
);
getShifts
(
pVInfo
->
blue_mask
,
m_blueLeftShift
,
m_blueRightShift
);
if
(
depth
==
15
||
depth
==
16
)
{
if
(
order
==
MSBFirst
)
{
// kludge: colors are indexed reversely because color 255 seems
// to bereserved for black even if we try to set it to white
pColors
[
i
].
pixel
=
254
-
i
;
pColors
[
i
].
pad
=
0
;
pColors
[
i
].
flags
=
DoRed
|
DoGreen
|
DoBlue
;
pColors
[
i
].
red
=
(
i
>>
m_redLeftShift
)
<<
(
m_redRightShift
+
8
);
pColors
[
i
].
green
=
(
i
>>
m_greenLeftShift
)
<<
(
m_greenRightShift
+
8
);
pColors
[
i
].
blue
=
(
i
>>
m_blueLeftShift
)
<<
(
m_blueRightShift
+
8
);
blendPixelImpl
=
&
X11Display
::
blendPixel16MSB
;
putPixelImpl
=
&
X11Display
::
putPixel16MSB
;
}
XStoreColors
(
m_pDisplay
,
m_colormap
,
pColors
,
255
);
blendPixelImpl
=
&
X11Display
::
blendPixel8
;
putPixelImpl
=
&
X11Display
::
putPixel8
;
m_pixelSize
=
1
;
break
;
case
15
:
case
16
:
case
24
:
case
32
:
// Get the TrueColor visual
xVInfoTemplate
.
c_class
=
TrueColor
;
pVInfo
=
XGetVisualInfo
(
m_pDisplay
,
VisualScreenMask
|
VisualDepthMask
|
VisualClassMask
,
&
xVInfoTemplate
,
&
vCount
);
if
(
pVInfo
==
NULL
)
else
{
msg_Err
(
getIntf
(),
"No TrueColor visual for depth %d"
,
depth
);
m_pDisplay
=
NULL
;
break
;
blendPixelImpl
=
&
X11Display
::
blendPixel16LSB
;
putPixelImpl
=
&
X11Display
::
putPixel16LSB
;
}
m_pVisual
=
pVInfo
->
visual
;
// Compute the color shifts
getShifts
(
pVInfo
->
red_mask
,
m_redLeftShift
,
m_redRightShift
);
getShifts
(
pVInfo
->
green_mask
,
m_greenLeftShift
,
m_greenRightShift
);
getShifts
(
pVInfo
->
blue_mask
,
m_blueLeftShift
,
m_blueRightShift
);
if
(
depth
==
15
||
depth
==
16
)
m_pixelSize
=
2
;
}
else
{
if
(
order
==
MSBFirst
)
{
if
(
order
==
MSBFirst
)
{
blendPixelImpl
=
&
X11Display
::
blendPixel16MSB
;
putPixelImpl
=
&
X11Display
::
putPixel16MSB
;
}
else
{
blendPixelImpl
=
&
X11Display
::
blendPixel16LSB
;
putPixelImpl
=
&
X11Display
::
putPixel16LSB
;
}
m_pixelSize
=
2
;
blendPixelImpl
=
&
X11Display
::
blendPixel32MSB
;
putPixelImpl
=
&
X11Display
::
putPixel32MSB
;
}
else
{
if
(
order
==
MSBFirst
)
{
blendPixelImpl
=
&
X11Display
::
blendPixel32MSB
;
putPixelImpl
=
&
X11Display
::
putPixel32MSB
;
}
else
{
blendPixelImpl
=
&
X11Display
::
blendPixel32LSB
;
putPixelImpl
=
&
X11Display
::
putPixel32LSB
;
}
m_pixelSize
=
4
;
blendPixelImpl
=
&
X11Display
::
blendPixel32LSB
;
putPixelImpl
=
&
X11Display
::
putPixel32LSB
;
}
break
;
default:
msg_Err
(
getIntf
(),
"unsupported depth: %d bpp
\n
"
,
depth
);
m_pDisplay
=
NULL
;
break
;
m_pixelSize
=
4
;
}
break
;
default:
msg_Err
(
getIntf
(),
"unsupported depth: %d bpp
\n
"
,
depth
);
m_pDisplay
=
NULL
;
break
;
}
// Free the visual info
...
...
modules/gui/skins2/x11/x11_loop.cpp
View file @
00b26db6
...
...
@@ -222,12 +222,12 @@ void X11Loop::handleX11Event()
EvtMouse
::
ActionType_t
action
=
EvtMouse
::
kDown
;
switch
(
event
.
type
)
{
case
ButtonPress
:
action
=
EvtMouse
::
kDown
;
break
;
case
ButtonRelease
:
action
=
EvtMouse
::
kUp
;
break
;
case
ButtonPress
:
action
=
EvtMouse
::
kDown
;
break
;
case
ButtonRelease
:
action
=
EvtMouse
::
kUp
;
break
;
}
// Get the modifiers
...
...
@@ -345,12 +345,12 @@ void X11Loop::handleX11Event()
switch
(
event
.
type
)
{
case
KeyPress
:
action
=
EvtKey
::
kDown
;
break
;
case
KeyRelease
:
action
=
EvtKey
::
kUp
;
break
;
case
KeyPress
:
action
=
EvtKey
::
kDown
;
break
;
case
KeyRelease
:
action
=
EvtKey
::
kUp
;
break
;
}
EvtKey
evt
(
getIntf
(),
key
,
action
,
mod
);
pWin
->
processEvent
(
evt
);
...
...
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