Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4989904b
Commit
4989904b
authored
Jun 17, 2003
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tooltips are now updated during scrolling
parent
0f0a0c68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
7 deletions
+61
-7
modules/gui/skins/src/window.cpp
modules/gui/skins/src/window.cpp
+12
-1
modules/gui/skins/x11/x11_window.cpp
modules/gui/skins/x11/x11_window.cpp
+47
-5
modules/gui/skins/x11/x11_window.h
modules/gui/skins/x11/x11_window.h
+2
-1
No files found.
modules/gui/skins/src/window.cpp
View file @
4989904b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* window.cpp: Window class
* window.cpp: Window class
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: window.cpp,v 1.
29 2003/06/10 11:43:40 gbazin
Exp $
* $Id: window.cpp,v 1.
30 2003/06/17 18:13:18 asmax
Exp $
*
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
@@ -456,7 +456,18 @@ void SkinWindow::MouseScroll( int x, int y, int direction )
...
@@ -456,7 +456,18 @@ void SkinWindow::MouseScroll( int x, int y, int direction )
{
{
break
;
break
;
}
}
}
// Checking for change in Tool Tip
for
(
int
i
=
ControlList
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
if
(
ControlList
[
i
]
->
IsVisible
()
&&
ControlList
[
i
]
->
ToolTipTest
(
x
,
y
)
)
{
break
;
}
}
}
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void
SkinWindow
::
Init
()
void
SkinWindow
::
Init
()
...
...
modules/gui/skins/x11/x11_window.cpp
View file @
4989904b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* x11_window.cpp: X11 implementation of the Window class
* x11_window.cpp: X11 implementation of the Window class
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: x11_window.cpp,v 1.2
3 2003/06/14 18:49:02 gbazin
Exp $
* $Id: x11_window.cpp,v 1.2
4 2003/06/17 18:13:18 asmax
Exp $
*
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Authors: Cyril Deguet <asmax@videolan.org>
*
*
...
@@ -51,7 +51,8 @@
...
@@ -51,7 +51,8 @@
#include "x11_timer.h"
#include "x11_timer.h"
bool
ToolTipCallback
(
void
*
data
);
static
bool
ToolTipCallback
(
void
*
data
);
static
void
DrawToolTipText
(
tooltip_t
*
tooltip
);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
...
@@ -145,6 +146,7 @@ X11Window::X11Window( intf_thread_t *p_intf, Window wnd, int x, int y,
...
@@ -145,6 +146,7 @@ X11Window::X11Window( intf_thread_t *p_intf, Window wnd, int x, int y,
X11Timer
*
timer
=
new
X11Timer
(
p_intf
,
500000
,
ToolTipCallback
,
&
ToolTip
);
X11Timer
*
timer
=
new
X11Timer
(
p_intf
,
500000
,
ToolTipCallback
,
&
ToolTip
);
ToolTip
.
p_intf
=
p_intf
;
ToolTip
.
p_intf
=
p_intf
;
ToolTip
.
timer
=
timer
;
ToolTip
.
timer
=
timer
;
ToolTip
.
active
=
False
;
// Double-click handling
// Double-click handling
ClickedX
=
0
;
ClickedX
=
0
;
...
@@ -491,12 +493,42 @@ bool ToolTipCallback( void *data )
...
@@ -491,12 +493,42 @@ bool ToolTipCallback( void *data )
XDrawString
(
disp
,
win
,
gc
,
4
,
overall
.
ascent
+
4
,
text
.
c_str
(),
XDrawString
(
disp
,
win
,
gc
,
4
,
overall
.
ascent
+
4
,
text
.
c_str
(),
text
.
size
()
);
text
.
size
()
);
XSync
(
disp
,
0
);
XSync
(
disp
,
0
);
((
tooltip_t
*
)
data
)
->
active
=
True
;
XUNLOCK
;
XUNLOCK
;
return
False
;
return
False
;
}
}
void
DrawToolTipText
(
tooltip_t
*
tooltip
)
{
int
direction
,
fontAscent
,
fontDescent
;
Display
*
disp
=
tooltip
->
display
;
Window
win
=
tooltip
->
window
;
Font
font
=
tooltip
->
font
;
GC
gc
=
tooltip
->
gc
;
string
text
=
tooltip
->
text
;
int
curX
=
tooltip
->
curX
;
int
curY
=
tooltip
->
curY
;
XLOCK
;
XClearWindow
(
disp
,
win
);
XCharStruct
overall
;
XQueryTextExtents
(
disp
,
font
,
text
.
c_str
(),
text
.
size
(),
&
direction
,
&
fontAscent
,
&
fontDescent
,
&
overall
);
int
w
=
overall
.
rbearing
-
overall
.
lbearing
;
int
h
=
overall
.
ascent
+
overall
.
descent
;
XMoveWindow
(
disp
,
win
,
curX
-
w
/
4
,
curY
+
20
);
XResizeWindow
(
disp
,
win
,
w
+
8
,
h
+
8
);
XDrawString
(
disp
,
win
,
gc
,
4
,
overall
.
ascent
+
4
,
text
.
c_str
(),
text
.
size
()
);
XSync
(
disp
,
0
);
XUNLOCK
;
}
void
X11Window
::
ChangeToolTipText
(
string
text
)
void
X11Window
::
ChangeToolTipText
(
string
text
)
{
{
if
(
text
==
"none"
)
if
(
text
==
"none"
)
...
@@ -511,6 +543,7 @@ void X11Window::ChangeToolTipText( string text )
...
@@ -511,6 +543,7 @@ void X11Window::ChangeToolTipText( string text )
XUnmapWindow
(
display
,
ToolTip
.
window
);
XUnmapWindow
(
display
,
ToolTip
.
window
);
XResizeWindow
(
display
,
ToolTip
.
window
,
1
,
1
);
XResizeWindow
(
display
,
ToolTip
.
window
,
1
,
1
);
XSync
(
display
,
0
);
XSync
(
display
,
0
);
ToolTip
.
active
=
False
;
XUNLOCK
;
XUNLOCK
;
}
}
}
}
...
@@ -520,9 +553,18 @@ void X11Window::ChangeToolTipText( string text )
...
@@ -520,9 +553,18 @@ void X11Window::ChangeToolTipText( string text )
{
{
ToolTipText
=
text
;
ToolTipText
=
text
;
ToolTip
.
text
=
text
;
ToolTip
.
text
=
text
;
OSAPI_GetMousePos
(
ToolTip
.
curX
,
ToolTip
.
curY
);
if
(
!
ToolTip
.
active
)
X11TimerManager
*
timerManager
=
X11TimerManager
::
Instance
(
p_intf
);
{
timerManager
->
addTimer
(
ToolTip
.
timer
);
// Create the tooltip
OSAPI_GetMousePos
(
ToolTip
.
curX
,
ToolTip
.
curY
);
X11TimerManager
*
timerManager
=
X11TimerManager
::
Instance
(
p_intf
);
timerManager
->
addTimer
(
ToolTip
.
timer
);
}
else
{
// Refresh the tooltip
DrawToolTipText
(
&
ToolTip
);
}
}
}
}
}
}
}
...
...
modules/gui/skins/x11/x11_window.h
View file @
4989904b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* x11_window.h: X11 implementation of the Window class
* x11_window.h: X11 implementation of the Window class
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: x11_window.h,v 1.
5 2003/06/08 00:32:07
asmax Exp $
* $Id: x11_window.h,v 1.
6 2003/06/17 18:13:18
asmax Exp $
*
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Authors: Cyril Deguet <asmax@videolan.org>
*
*
...
@@ -47,6 +47,7 @@ typedef struct
...
@@ -47,6 +47,7 @@ typedef struct
Font
font
;
Font
font
;
int
curX
;
int
curX
;
int
curY
;
int
curY
;
bool
active
;
}
tooltip_t
;
}
tooltip_t
;
...
...
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