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
d47392b8
Commit
d47392b8
authored
May 13, 2003
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* beginning of event processing in X11 skins
* graphics should work, but....
parent
4e2943d8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
43 deletions
+144
-43
modules/gui/skins/x11/x11_run.cpp
modules/gui/skins/x11/x11_run.cpp
+114
-19
modules/gui/skins/x11/x11_window.cpp
modules/gui/skins/x11/x11_window.cpp
+26
-21
modules/gui/skins/x11/x11_window.h
modules/gui/skins/x11/x11_window.h
+4
-3
No files found.
modules/gui/skins/x11/x11_run.cpp
View file @
d47392b8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* x11_run.cpp:
* x11_run.cpp:
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: x11_run.cpp,v 1.
2 2003/05/12 17:33:19 gbazin
Exp $
* $Id: x11_run.cpp,v 1.
3 2003/05/13 20:36:29 asmax
Exp $
*
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Authors: Cyril Deguet <asmax@videolan.org>
*
*
...
@@ -49,12 +49,6 @@
...
@@ -49,12 +49,6 @@
// include the icon graphic
// include the icon graphic
#include "share/vlc32x32.xpm"
#include "share/vlc32x32.xpm"
//---------------------------------------------------------------------------
class
CallBackObjects
{
public:
VlcProc
*
Proc
;
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Specific method
// Specific method
...
@@ -70,14 +64,13 @@ class Instance: public wxApp
...
@@ -70,14 +64,13 @@ class Instance: public wxApp
{
{
public:
public:
Instance
();
Instance
();
Instance
(
intf_thread_t
*
_p_intf
,
CallBackObjects
*
callback
);
Instance
(
intf_thread_t
*
_p_intf
);
bool
OnInit
();
bool
OnInit
();
OpenDialog
*
open
;
OpenDialog
*
open
;
private:
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
CallBackObjects
*
callbackobj
;
};
};
...
@@ -211,11 +204,10 @@ Instance::Instance( )
...
@@ -211,11 +204,10 @@ Instance::Instance( )
{
{
}
}
Instance
::
Instance
(
intf_thread_t
*
_p_intf
,
CallBackObjects
*
callback
)
Instance
::
Instance
(
intf_thread_t
*
_p_intf
)
{
{
// Initialization
// Initialization
p_intf
=
_p_intf
;
p_intf
=
_p_intf
;
callbackobj
=
callback
;
}
}
IMPLEMENT_APP_NO_MAIN
(
Instance
)
IMPLEMENT_APP_NO_MAIN
(
Instance
)
...
@@ -241,18 +233,121 @@ bool Instance::OnInit()
...
@@ -241,18 +233,121 @@ bool Instance::OnInit()
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// GTK2 interface
// X11 event processing
//---------------------------------------------------------------------------
void
ProcessEvent
(
intf_thread_t
*
p_intf
,
VlcProc
*
proc
,
XEvent
*
event
)
{
// Variables
list
<
SkinWindow
*>::
const_iterator
win
;
unsigned
int
msg
;
Event
*
evt
;
Window
wnd
=
((
XAnyEvent
*
)
event
)
->
window
;
fprintf
(
stderr
,
"event %d %x
\n
"
,
event
->
type
,
wnd
);
// Create event to dispatch in windows
// Skin event
if
(
event
->
type
==
ClientMessage
)
{
/* msg = ( (GdkEventClient *)event )->data.l[0];
evt = (Event *)new OSEvent( p_intf,
((GdkEventAny *)event)->window,
msg,
( (GdkEventClient *)event )->data.l[1],
( (GdkEventClient *)event )->data.l[2] );*/
}
// System event
else
{
msg
=
event
->
type
;
evt
=
(
Event
*
)
new
OSEvent
(
p_intf
,
((
XAnyEvent
*
)
event
)
->
window
,
msg
,
0
,
(
long
)
event
);
}
// Process keyboard shortcuts
if
(
msg
==
KeyPress
)
{
/* int KeyModifier = 0;
// If key is ALT
if( ((GdkEventKey *)event)->state & GDK_MOD1_MASK )
{
KeyModifier = 1;
}
// If key is CTRL
else if( ((GdkEventKey *)event)->state & GDK_CONTROL_MASK )
{
KeyModifier = 2;
}
int key = ((GdkEventKey *)event)->keyval;
// Translate into lower case
if( key >= 'a' && key <= 'z' )
{
key -= ('a' - 'A');
}
if( KeyModifier > 0 )
p_intf->p_sys->p_theme->EvtBank->TestShortcut( key , KeyModifier );*/
}
// Send event
else
if
(
IsVLCEvent
(
msg
)
)
{
if
(
!
proc
->
EventProc
(
evt
)
)
{
// wxExit();
return
;
// Exit VLC !
}
}
else
if
(
wnd
==
NULL
)
{
for
(
win
=
p_intf
->
p_sys
->
p_theme
->
WindowList
.
begin
();
win
!=
p_intf
->
p_sys
->
p_theme
->
WindowList
.
end
();
win
++
)
{
(
*
win
)
->
ProcessEvent
(
evt
);
}
}
else
{
// Find window matching with gwnd
for
(
win
=
p_intf
->
p_sys
->
p_theme
->
WindowList
.
begin
();
win
!=
p_intf
->
p_sys
->
p_theme
->
WindowList
.
end
();
win
++
)
{
// If it is the correct window
if
(
wnd
==
(
(
X11Window
*
)(
*
win
)
)
->
GetHandle
()
)
{
// Send event and check if processed
if
(
(
*
win
)
->
ProcessEvent
(
evt
)
)
{
delete
(
OSEvent
*
)
evt
;
return
;
}
else
{
break
;
}
}
}
}
evt
->
DestructParameters
();
delete
(
OSEvent
*
)
evt
;
// Check if vlc is closing
proc
->
IsClosing
();
}
//---------------------------------------------------------------------------
// X11 interface
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void
OSRun
(
intf_thread_t
*
p_intf
)
void
OSRun
(
intf_thread_t
*
p_intf
)
{
{
static
char
*
p_args
[]
=
{
""
};
static
char
*
p_args
[]
=
{
""
};
// Create VLC event object processing
VlcProc
*
proc
=
new
VlcProc
(
p_intf
);
CallBackObjects
*
callbackobj
=
new
CallBackObjects
();
callbackobj
->
Proc
=
new
VlcProc
(
p_intf
);
/* wxTheApp = new Instance( p_intf, callbackobj );
/* wxTheApp = new Instance( p_intf, callbackobj );
wxEntry( 1, p_args );*/
wxEntry( 1, p_args );*/
Display
*
display
=
((
OSTheme
*
)
p_intf
->
p_sys
->
p_theme
)
->
GetDisplay
();
Display
*
display
=
((
OSTheme
*
)
p_intf
->
p_sys
->
p_theme
)
->
GetDisplay
();
...
@@ -262,10 +357,10 @@ void OSRun( intf_thread_t *p_intf )
...
@@ -262,10 +357,10 @@ void OSRun( intf_thread_t *p_intf )
{
{
XEvent
*
event
;
XEvent
*
event
;
XNextEvent
(
display
,
event
);
XNextEvent
(
display
,
event
);
fprintf
(
stderr
,
"event %d
\n
"
,
event
->
type
);
ProcessEvent
(
p_intf
,
proc
,
event
);
}
}
delete
callbackobj
;
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
bool
IsVLCEvent
(
unsigned
int
msg
)
bool
IsVLCEvent
(
unsigned
int
msg
)
...
...
modules/gui/skins/x11/x11_window.cpp
View file @
d47392b8
...
@@ -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.
1 2003/04/28 14:32:57
asmax Exp $
* $Id: x11_window.cpp,v 1.
2 2003/05/13 20:36:29
asmax Exp $
*
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Authors: Cyril Deguet <asmax@videolan.org>
*
*
...
@@ -58,7 +58,11 @@ X11Window::X11Window( intf_thread_t *p_intf, Window wnd, int x, int y,
...
@@ -58,7 +58,11 @@ X11Window::X11Window( intf_thread_t *p_intf, Window wnd, int x, int y,
{
{
// Set handles
// Set handles
Wnd
=
wnd
;
Wnd
=
wnd
;
// gc = gdk_gc_new( gwnd );
display
=
p_intf
->
p_sys
->
display
;
int
screen
=
DefaultScreen
(
display
);
Gc
=
DefaultGC
(
display
,
screen
);
Name
=
name
;
Name
=
name
;
...
@@ -155,15 +159,15 @@ bool X11Window::ProcessOSEvent( Event *evt )
...
@@ -155,15 +159,15 @@ bool X11Window::ProcessOSEvent( Event *evt )
unsigned
int
msg
=
evt
->
GetMessage
();
unsigned
int
msg
=
evt
->
GetMessage
();
unsigned
int
p1
=
evt
->
GetParam1
();
unsigned
int
p1
=
evt
->
GetParam1
();
int
p2
=
evt
->
GetParam2
();
int
p2
=
evt
->
GetParam2
();
/*
switch
(
msg
)
switch
(
msg
)
{
{
case
GDK_EXPOSE
:
case
Expose
:
RefreshFromImage
(
0
,
0
,
Width
,
Height
);
RefreshFromImage
(
0
,
0
,
Width
,
Height
);
return
true
;
return
true
;
case
GDK_MOTION_NOTIFY
:
case
MotionNotify
:
if( LButtonDown )
/*
if( LButtonDown )
MouseMove( (int)( (GdkEventButton *)p2 )->x,
MouseMove( (int)( (GdkEventButton *)p2 )->x,
(int)( (GdkEventButton *)p2 )->y, 1 );
(int)( (GdkEventButton *)p2 )->y, 1 );
else if( RButtonDown )
else if( RButtonDown )
...
@@ -172,13 +176,13 @@ bool X11Window::ProcessOSEvent( Event *evt )
...
@@ -172,13 +176,13 @@ bool X11Window::ProcessOSEvent( Event *evt )
else
else
MouseMove( (int)( (GdkEventButton *)p2 )->x,
MouseMove( (int)( (GdkEventButton *)p2 )->x,
(int)( (GdkEventButton *)p2 )->y, 0 );
(int)( (GdkEventButton *)p2 )->y, 0 );
gdk_window_get_pointer( gWnd, 0, 0, 0 );
gdk_window_get_pointer( gWnd, 0, 0, 0 );
*/
return
true
;
return
true
;
case
GDK_BUTTON_PRESS
:
case
ButtonPress
:
// Raise all the windows
// Raise all the windows
for( list<SkinWindow *>::const_iterator win =
/*
for( list<SkinWindow *>::const_iterator win =
p_intf->p_sys->p_theme->WindowList.begin();
p_intf->p_sys->p_theme->WindowList.begin();
win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
{
{
...
@@ -203,11 +207,11 @@ bool X11Window::ProcessOSEvent( Event *evt )
...
@@ -203,11 +207,11 @@ bool X11Window::ProcessOSEvent( Event *evt )
default:
default:
break;
break;
}
}
*/
return
true
;
return
true
;
case
GDK_BUTTON_RELEASE
:
case
ButtonRelease
:
switch( ( (GdkEventButton *)p2 )->button )
/*
switch( ( (GdkEventButton *)p2 )->button )
{
{
case 1:
case 1:
// Left button
// Left button
...
@@ -225,14 +229,14 @@ bool X11Window::ProcessOSEvent( Event *evt )
...
@@ -225,14 +229,14 @@ bool X11Window::ProcessOSEvent( Event *evt )
default:
default:
break;
break;
}
}
*/
return
true
;
return
true
;
case
GDK_LEAVE_NOTIFY
:
case
LeaveNotify
:
OSAPI_PostMessage
(
this
,
WINDOW_LEAVE
,
0
,
0
);
OSAPI_PostMessage
(
this
,
WINDOW_LEAVE
,
0
,
0
);
return
true
;
return
true
;
case GDK_2BUTTON_PRESS:
/*
case GDK_2BUTTON_PRESS:
MouseDblClick( (int)( (GdkEventButton *)p2 )->x,
MouseDblClick( (int)( (GdkEventButton *)p2 )->x,
(int)( (GdkEventButton *)p2 )->y, 1 );
(int)( (GdkEventButton *)p2 )->y, 1 );
return true;
return true;
...
@@ -256,10 +260,10 @@ bool X11Window::ProcessOSEvent( Event *evt )
...
@@ -256,10 +260,10 @@ bool X11Window::ProcessOSEvent( Event *evt )
break;
break;
}
}
return true;
return true;
*/
default:
default:
return
false
;
return
false
;
}
*/
}
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void
X11Window
::
SetTransparency
(
int
Value
)
void
X11Window
::
SetTransparency
(
int
Value
)
...
@@ -283,11 +287,12 @@ void X11Window::RefreshFromImage( int x, int y, int w, int h )
...
@@ -283,11 +287,12 @@ void X11Window::RefreshFromImage( int x, int y, int w, int h )
ReleaseDC( hWnd, DC );
ReleaseDC( hWnd, DC );
*/
*/
/* GdkDrawable *drawable = (( X11Graphics* )Image )->GetImage();
Drawable
drawable
=
((
X11Graphics
*
)
Image
)
->
GetImage
();
GdkImage *image = gdk_drawable_get_image( drawable, 0, 0, Width, Height );
gdk_draw_drawable( gWnd, gc, drawable, x, y, x, y, w, h );
fprintf
(
stderr
,
"prout
\n
"
);
XCopyArea
(
display
,
drawable
,
Wnd
,
Gc
,
x
,
y
,
w
,
h
,
x
,
y
);
XSync
(
display
,
0
);
/*
// Mask for transparency
// Mask for transparency
GdkRegion *region = gdk_region_new();
GdkRegion *region = gdk_region_new();
for( int line = 0; line < Height; line++ )
for( int line = 0; line < Height; line++ )
...
...
modules/gui/skins/x11/x11_window.h
View file @
d47392b8
...
@@ -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.
1 2003/04/28 14:32:57
asmax Exp $
* $Id: x11_window.h,v 1.
2 2003/05/13 20:36:29
asmax Exp $
*
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Authors: Cyril Deguet <asmax@videolan.org>
*
*
...
@@ -39,7 +39,8 @@ class X11Window : public SkinWindow
...
@@ -39,7 +39,8 @@ class X11Window : public SkinWindow
private:
private:
// General parameters
// General parameters
Window
Wnd
;
Window
Wnd
;
// GdkGC *gc;
Display
*
display
;
GC
Gc
;
int
CursorX
;
int
CursorX
;
int
CursorY
;
int
CursorY
;
int
WindowX
;
int
WindowX
;
...
@@ -80,7 +81,7 @@ class X11Window : public SkinWindow
...
@@ -80,7 +81,7 @@ class X11Window : public SkinWindow
virtual
void
Move
(
int
left
,
int
top
);
virtual
void
Move
(
int
left
,
int
top
);
virtual
void
Size
(
int
width
,
int
height
);
virtual
void
Size
(
int
width
,
int
height
);
// Specific
gtk2
methods
// Specific
X11
methods
Window
GetHandle
()
{
return
Wnd
;
};
Window
GetHandle
()
{
return
Wnd
;
};
// Tooltip texts
// Tooltip texts
...
...
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