Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
0d15ca7b
Commit
0d15ca7b
authored
Apr 21, 2003
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* raise the skin window on top when clicked
* a bit of code cleaning
parent
c8e01ad8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
205 deletions
+45
-205
modules/gui/skins/controls/playlist.cpp
modules/gui/skins/controls/playlist.cpp
+1
-3
modules/gui/skins/gtk2/gtk2_bitmap.cpp
modules/gui/skins/gtk2/gtk2_bitmap.cpp
+20
-67
modules/gui/skins/gtk2/gtk2_run.cpp
modules/gui/skins/gtk2/gtk2_run.cpp
+1
-7
modules/gui/skins/gtk2/gtk2_theme.cpp
modules/gui/skins/gtk2/gtk2_theme.cpp
+13
-115
modules/gui/skins/gtk2/gtk2_window.cpp
modules/gui/skins/gtk2/gtk2_window.cpp
+10
-13
No files found.
modules/gui/skins/controls/playlist.cpp
View file @
0d15ca7b
...
...
@@ -2,7 +2,7 @@
* playlist.cpp: Playlist control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.
6 2003/04/21 00:18:37
asmax Exp $
* $Id: playlist.cpp,v 1.
7 2003/04/21 14:26:59
asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -465,9 +465,7 @@ bool ControlPlayList::MouseScroll( int x, int y, int direction )
if
(
!
TextClipRgn
->
Hit
(
x
-
Left
,
y
-
Top
)
&&
!
Slider
->
MouseOver
(
x
,
y
)
)
return
false
;
//long pos = Slider->GetCursorPosition();
long
pos
=
StartIndex
;
fprintf
(
stderr
,
" scroll %d %d
\n
"
,
pos
,
StartIndex
);
switch
(
direction
)
{
case
MOUSE_SCROLL_UP
:
...
...
modules/gui/skins/gtk2/gtk2_bitmap.cpp
View file @
0d15ca7b
...
...
@@ -2,7 +2,7 @@
* gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_bitmap.cpp,v 1.1
4 2003/04/17 17:45:38
asmax Exp $
* $Id: gtk2_bitmap.cpp,v 1.1
5 2003/04/21 14:26:59
asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -47,73 +47,22 @@
GTK2Bitmap
::
GTK2Bitmap
(
intf_thread_t
*
p_intf
,
string
FileName
,
int
AColor
)
:
Bitmap
(
p_intf
,
FileName
,
AColor
)
{
/* HBITMAP HBitmap;
HBITMAP HBuf;
BITMAP Bmp;
HDC bufDC;
// Create image from file if it exists
HBitmap = (HBITMAP) LoadImage( NULL, FileName.c_str(), IMAGE_BITMAP,
0, 0, LR_LOADFROMFILE );
if( HBitmap == NULL )
{
if( FileName != "" )
msg_Warn( p_intf, "Couldn't load bitmap: %s", FileName.c_str() );
HBitmap = CreateBitmap( 0, 0, 1, 32, NULL );
}
// Create device context
bmpDC = CreateCompatibleDC( NULL );
SelectObject( bmpDC, HBitmap );
// Get size of image
GetObject( HBitmap, sizeof( Bmp ), &Bmp );
Width = Bmp.bmWidth;
Height = Bmp.bmHeight;
// If alpha color is not 0, then change 0 colors to non black color to avoid
// window transparency
if( (int)AlphaColor != OSAPI_GetNonTransparentColor( 0 ) )
{
bufDC = CreateCompatibleDC( bmpDC );
HBuf = CreateCompatibleBitmap( bmpDC, Width, Height );
SelectObject( bufDC, HBuf );
LPRECT r = new RECT;
HBRUSH Brush = CreateSolidBrush( OSAPI_GetNonTransparentColor( 0 ) );
r->left = 0;
r->top = 0;
r->right = Width;
r->bottom = Height;
FillRect( bufDC, r, Brush );
DeleteObject( Brush );
delete r;
TransparentBlt( bufDC, 0, 0, Width, Height, bmpDC, 0, 0, Width, Height, 0 );
BitBlt( bmpDC, 0, 0, Width, Height, bufDC, 0, 0, SRCCOPY );
DeleteDC( bufDC );
DeleteObject( HBuf );
}
// Delete objects
DeleteObject( HBitmap );*/
// Load the bitmap image
Bmp
=
gdk_pixbuf_new_from_file
(
FileName
.
c_str
(),
NULL
);
if
(
Bmp
==
NULL
)
{
if
(
FileName
!=
""
)
msg_Warn
(
p_intf
,
"Couldn't load bitmap: %s"
,
FileName
.
c_str
()
);
// Bmp = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, 1, 1);
Bmp
=
NULL
;
Width
=
0
;
Height
=
0
;
}
else
{
Bmp
=
gdk_pixbuf_add_alpha
(
Bmp
,
TRUE
,
AColor
&
0xff
,
(
AColor
>>
8
)
&
0xff
,
(
AColor
>>
16
)
&
0xff
);
Width
=
gdk_pixbuf_get_width
(
Bmp
);
Height
=
gdk_pixbuf_get_height
(
Bmp
);
}
Bmp
=
gdk_pixbuf_add_alpha
(
Bmp
,
TRUE
,
AColor
&
0xff
,
(
AColor
>>
8
)
&
0xff
,
(
AColor
>>
16
)
&
0xff
);
Width
=
gdk_pixbuf_get_width
(
Bmp
);
Height
=
gdk_pixbuf_get_height
(
Bmp
);
}
//---------------------------------------------------------------------------
GTK2Bitmap
::
GTK2Bitmap
(
intf_thread_t
*
p_intf
,
Graphics
*
from
,
int
x
,
int
y
,
...
...
@@ -154,17 +103,21 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, Bitmap *c )
//---------------------------------------------------------------------------
GTK2Bitmap
::~
GTK2Bitmap
()
{
/* DeleteDC( bmpDC );*/
if
(
Bmp
)
g_object_unref
(
G_OBJECT
(
Bmp
)
);
}
//---------------------------------------------------------------------------
void
GTK2Bitmap
::
DrawBitmap
(
int
x
,
int
y
,
int
w
,
int
h
,
int
xRef
,
int
yRef
,
Graphics
*
dest
)
{
GdkDrawable
*
destImg
=
(
(
GTK2Graphics
*
)
dest
)
->
GetImage
();
GdkGC
*
destGC
=
(
(
GTK2Graphics
*
)
dest
)
->
GetGC
();
if
(
Bmp
)
{
GdkDrawable
*
destImg
=
(
(
GTK2Graphics
*
)
dest
)
->
GetImage
();
GdkGC
*
destGC
=
(
(
GTK2Graphics
*
)
dest
)
->
GetGC
();
gdk_pixbuf_render_to_drawable
(
Bmp
,
destImg
,
destGC
,
x
,
y
,
xRef
,
yRef
,
w
,
h
,
GDK_RGB_DITHER_NORMAL
,
0
,
0
);
gdk_pixbuf_render_to_drawable
(
Bmp
,
destImg
,
destGC
,
x
,
y
,
xRef
,
yRef
,
w
,
h
,
GDK_RGB_DITHER_NORMAL
,
0
,
0
);
}
}
//---------------------------------------------------------------------------
bool
GTK2Bitmap
::
Hit
(
int
x
,
int
y
)
...
...
@@ -179,7 +132,7 @@ bool GTK2Bitmap::Hit( int x, int y)
//---------------------------------------------------------------------------
int
GTK2Bitmap
::
GetBmpPixel
(
int
x
,
int
y
)
{
if
(
x
<
0
||
x
>=
Width
||
y
<
0
||
y
>=
Height
)
if
(
!
Bmp
||
x
<
0
||
x
>=
Width
||
y
<
0
||
y
>=
Height
)
return
-
1
;
guchar
*
pixels
;
...
...
modules/gui/skins/gtk2/gtk2_run.cpp
View file @
0d15ca7b
...
...
@@ -2,7 +2,7 @@
* gtk2_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_run.cpp,v 1.1
8 2003/04/21 03:37:40
asmax Exp $
* $Id: gtk2_run.cpp,v 1.1
9 2003/04/21 14:26:59
asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -150,7 +150,6 @@ void GTK2Proc( GdkEvent *event, gpointer data )
{
if
(
!
proc
->
EventProc
(
evt
)
)
{
fprintf
(
stderr
,
"Quit
\n
"
);
wxExit
();
return
;
// Exit VLC !
}
...
...
@@ -258,11 +257,6 @@ void OSRun( intf_thread_t *p_intf )
wxTheApp
=
new
Instance
(
p_intf
,
callbackobj
);
/* vlc_mutex_lock( &p_intf->p_sys->init_lock );
vlc_cond_wait( &p_intf->p_sys->init_cond, &p_intf->p_sys->init_lock );
vlc_mutex_unlock( &p_intf->p_sys->init_lock );*/
wxEntry
(
1
,
p_args
);
delete
callbackobj
;
...
...
modules/gui/skins/gtk2/gtk2_theme.cpp
View file @
0d15ca7b
...
...
@@ -2,7 +2,7 @@
* gtk2_theme.cpp: GTK2 implementation of the Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_theme.cpp,v 1.2
1 2003/04/21 02:12:06 ipkiss
Exp $
* $Id: gtk2_theme.cpp,v 1.2
2 2003/04/21 14:26:59 asmax
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -53,40 +53,8 @@ void SkinManage( intf_thread_t *p_intf );
//---------------------------------------------------------------------------
GTK2Theme
::
GTK2Theme
(
intf_thread_t
*
_p_intf
)
:
Theme
(
_p_intf
)
{
/*
// Get instance handle
hinst = GetModuleHandle( NULL );
// Create window class
WNDCLASS SkinWindow;
SkinWindow.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
SkinWindow.lpfnWndProc = (WNDPROC) GTK2Proc;
SkinWindow.lpszClassName = "SkinWindow";
SkinWindow.lpszMenuName = NULL;
SkinWindow.cbClsExtra = 0;
SkinWindow.cbWndExtra = 0;
SkinWindow.hbrBackground = HBRUSH (COLOR_WINDOW);
SkinWindow.hCursor = LoadCursor( NULL , IDC_ARROW );
SkinWindow.hIcon = LoadIcon( hinst, "VLC_ICON" );
SkinWindow.hInstance = hinst;
if( !RegisterClass( &SkinWindow ) )
{
WNDCLASS wndclass;
// Check why it failed. If it's because the class already exists
// then fine, otherwise return with an error.
if( !GetClassInfo( hinst, "SkinWindow", &wndclass ) )
{
msg_Err( p_intf, "Cannot register window class" );
return;
}
}
*/
//Initialize value
ParentWindow
=
NULL
;
}
//---------------------------------------------------------------------------
...
...
@@ -108,73 +76,17 @@ GTK2Theme::~GTK2Theme()
{
Shell_NotifyIcon( NIM_DELETE, &TrayIcon );
}
*/
// Destroy parent window
if
(
ParentWindow
)
{
DestroyWindow
( ParentWindow );
}
*/
gdk_window_destroy
(
ParentWindow
);
}
}
//---------------------------------------------------------------------------
void
GTK2Theme
::
OnLoadTheme
()
{
/*
// Create window class
WNDCLASS ParentClass;
ParentClass.style = CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS;
ParentClass.lpfnWndProc = (WNDPROC) GTK2Proc;
ParentClass.lpszClassName = "ParentWindow";
ParentClass.lpszMenuName = NULL;
ParentClass.cbClsExtra = 0;
ParentClass.cbWndExtra = 0;
ParentClass.hbrBackground = HBRUSH (COLOR_WINDOW);
ParentClass.hCursor = LoadCursor( NULL , IDC_ARROW );
ParentClass.hIcon = LoadIcon( hinst, "VLC_ICON" );
ParentClass.hInstance = hinst;
// register class and check it
if( !RegisterClass( &ParentClass ) )
{
WNDCLASS wndclass;
// Check why it failed. If it's because the class already exists
// then fine, otherwise return with an error.
if( !GetClassInfo( hinst, "ParentWindow", &wndclass ) )
{
msg_Err( p_intf, "Cannot register window class" );
return;
}
}
// Create Window
ParentWindow = CreateWindowEx( WS_EX_LAYERED|WS_EX_TOOLWINDOW,
"ParentWindow", "VLC Media Player",
WS_SYSMENU,
0, 0, 0, 0, 0, 0, hinst, NULL );
// Store with it a pointer to the interface thread
SetWindowLongPtr( ParentWindow, GWLP_USERDATA, (LONG_PTR)p_intf );
ShowWindow( ParentWindow, SW_SHOW );
// System tray icon
TrayIcon.cbSize = sizeof( PNOTIFYICONDATA );
TrayIcon.hWnd = ParentWindow;
TrayIcon.uID = 42;
TrayIcon.uFlags = NIF_ICON|NIF_TIP|NIF_MESSAGE;
TrayIcon.uCallbackMessage = WM_RBUTTONDOWN;
TrayIcon.hIcon = LoadIcon( hinst, "VLC_ICON" );
strcpy( TrayIcon.szTip, "VLC Media Player" );
// Remove default entries from system menu popup
SysMenu = GetSystemMenu( ParentWindow, false );
RemoveMenu( SysMenu, SC_RESTORE, MF_BYCOMMAND );
RemoveMenu( SysMenu, SC_MOVE, MF_BYCOMMAND );
RemoveMenu( SysMenu, SC_SIZE, MF_BYCOMMAND );
RemoveMenu( SysMenu, SC_MINIMIZE, MF_BYCOMMAND );
RemoveMenu( SysMenu, SC_MAXIMIZE, MF_BYCOMMAND );
RemoveMenu( SysMenu, SC_CLOSE, MF_BYCOMMAND );
RemoveMenu( SysMenu, 0, MF_BYPOSITION );
// The create menu
{
/* // The create menu
CreateSystemMenu();
*/
// Set the parent window attributes
...
...
@@ -193,8 +105,11 @@ void GTK2Theme::OnLoadTheme()
// Create the parent window
ParentWindow
=
gdk_window_new
(
NULL
,
&
attr
,
mask
);
// gdk_window_show( ParentWindow );
if
(
!
ParentWindow
)
{
msg_Err
(
p_intf
,
"gdk_window_new failed"
);
return
;
}
}
//---------------------------------------------------------------------------
void
GTK2Theme
::
AddSystemMenu
(
string
name
,
Event
*
event
)
...
...
@@ -217,24 +132,7 @@ void GTK2Theme::ChangeClientWindowName( string name )
//---------------------------------------------------------------------------
void
GTK2Theme
::
AddWindow
(
string
name
,
int
x
,
int
y
,
bool
visible
,
int
fadetime
,
int
alpha
,
int
movealpha
,
bool
dragdrop
)
{
/*
HWND hwnd;
hwnd = CreateWindowEx( WS_EX_LAYERED|WS_EX_TOOLWINDOW,
"SkinWindow", name.c_str(), WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT,
0, 0, ParentWindow, 0, hinst, NULL );
if( !hwnd )
{
msg_Err( p_intf, "CreateWindow failed" );
return;
}
SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR)p_intf );
WindowList.push_back( (Window *)new OSWindow( p_intf, hwnd, x, y, visible,
fadetime, alpha, movealpha, dragdrop ) ) ;*/
{
GdkWindowAttr
attr
;
attr
.
title
=
(
gchar
*
)
name
.
c_str
();
attr
.
event_mask
=
GDK_ALL_EVENTS_MASK
;
...
...
@@ -250,7 +148,7 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible,
GdkWindow
*
gwnd
=
gdk_window_new
(
NULL
,
&
attr
,
mask
);
if
(
!
gwnd
)
{
msg_Err
(
p_intf
,
"
CreateWindo
w failed"
);
msg_Err
(
p_intf
,
"
gdk_window_ne
w failed"
);
return
;
}
...
...
modules/gui/skins/gtk2/gtk2_window.cpp
View file @
0d15ca7b
...
...
@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_window.cpp,v 1.2
4 2003/04/20 15:00:19 karibu
Exp $
* $Id: gtk2_window.cpp,v 1.2
5 2003/04/21 14:26:59 asmax
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -48,17 +48,6 @@
#include "../src/theme.h"
//---------------------------------------------------------------------------
// Fading API
//---------------------------------------------------------------------------
/*#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
typedef BOOL (WINAPI *SLWA)(HWND, COLORREF, BYTE, DWORD);
HMODULE hModule = LoadLibrary( "user32.dll" );
SLWA SetLayeredWindowAttributes =
(SLWA)GetProcAddress( hModule, "SetLayeredWindowAttributes" );
*/
//---------------------------------------------------------------------------
// Skinable Window
//---------------------------------------------------------------------------
...
...
@@ -169,7 +158,7 @@ bool GTK2Window::ProcessOSEvent( Event *evt )
case
GDK_EXPOSE
:
RefreshFromImage
(
0
,
0
,
Width
,
Height
);
return
true
;
case
GDK_MOTION_NOTIFY
:
if
(
LButtonDown
)
MouseMove
(
(
int
)(
(
GdkEventButton
*
)
p2
)
->
x
,
...
...
@@ -185,6 +174,14 @@ bool GTK2Window::ProcessOSEvent( Event *evt )
case
GDK_BUTTON_PRESS
:
// Raise all the windows
for
(
list
<
Window
*>::
const_iterator
win
=
p_intf
->
p_sys
->
p_theme
->
WindowList
.
begin
();
win
!=
p_intf
->
p_sys
->
p_theme
->
WindowList
.
end
();
win
++
)
{
gdk_window_raise
(
(
(
GTK2Window
*
)(
*
win
)
)
->
GetHandle
()
);
}
switch
(
(
(
GdkEventButton
*
)
p2
)
->
button
)
{
case
1
:
...
...
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