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
3435dcce
Commit
3435dcce
authored
Apr 21, 2003
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* we now use a wxwindow dialog to load the skins, so we can get rid
of our custom dialog
parent
dfa3c5d0
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
17 additions
and
755 deletions
+17
-755
modules/gui/skins/Modules.am
modules/gui/skins/Modules.am
+0
-7
modules/gui/skins/gtk2/gtk2_dialog.cpp
modules/gui/skins/gtk2/gtk2_dialog.cpp
+0
-188
modules/gui/skins/gtk2/gtk2_dialog.h
modules/gui/skins/gtk2/gtk2_dialog.h
+0
-56
modules/gui/skins/gtk2/gtk2_theme.cpp
modules/gui/skins/gtk2/gtk2_theme.cpp
+1
-3
modules/gui/skins/os_dialog.h
modules/gui/skins/os_dialog.h
+0
-36
modules/gui/skins/src/dialog.cpp
modules/gui/skins/src/dialog.cpp
+0
-53
modules/gui/skins/src/dialog.h
modules/gui/skins/src/dialog.h
+0
-96
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/skin_main.cpp
+6
-18
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/theme.cpp
+1
-3
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/src/vlcproc.cpp
+8
-18
modules/gui/skins/win32/win32_dialog.cpp
modules/gui/skins/win32/win32_dialog.cpp
+0
-189
modules/gui/skins/win32/win32_dialog.h
modules/gui/skins/win32/win32_dialog.h
+0
-85
modules/gui/skins/win32/win32_theme.cpp
modules/gui/skins/win32/win32_theme.cpp
+1
-3
No files found.
modules/gui/skins/Modules.am
View file @
3435dcce
SOURCES_skins = \
modules/gui/skins/os_api.h \
modules/gui/skins/os_bitmap.h \
modules/gui/skins/os_dialog.h \
modules/gui/skins/os_event.h \
modules/gui/skins/os_font.h \
modules/gui/skins/os_graphics.h \
...
...
@@ -40,8 +39,6 @@ SOURCES_skins = \
modules/gui/skins/src/bezier.h \
modules/gui/skins/src/bitmap.cpp \
modules/gui/skins/src/bitmap.h \
modules/gui/skins/src/dialog.cpp \
modules/gui/skins/src/dialog.h \
modules/gui/skins/src/event.cpp \
modules/gui/skins/src/event.h \
modules/gui/skins/src/font.cpp \
...
...
@@ -63,8 +60,6 @@ SOURCES_skins = \
modules/gui/skins/win32/win32_api.cpp \
modules/gui/skins/win32/win32_bitmap.cpp \
modules/gui/skins/win32/win32_bitmap.h \
modules/gui/skins/win32/win32_dialog.cpp \
modules/gui/skins/win32/win32_dialog.h \
modules/gui/skins/win32/win32_dragdrop.cpp \
modules/gui/skins/win32/win32_dragdrop.h \
modules/gui/skins/win32/win32_event.cpp \
...
...
@@ -82,8 +77,6 @@ SOURCES_skins = \
modules/gui/skins/gtk2/gtk2_api.cpp \
modules/gui/skins/gtk2/gtk2_bitmap.cpp \
modules/gui/skins/gtk2/gtk2_bitmap.h \
modules/gui/skins/gtk2/gtk2_dialog.cpp \
modules/gui/skins/gtk2/gtk2_dialog.h \
modules/gui/skins/gtk2/gtk2_dragdrop.cpp \
modules/gui/skins/gtk2/gtk2_dragdrop.h \
modules/gui/skins/gtk2/gtk2_event.cpp \
...
...
modules/gui/skins/gtk2/gtk2_dialog.cpp
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* gtk2_dialog.cpp: GTK2 implementation of some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_dialog.cpp,v 1.5 2003/04/20 20:28:39 ipkiss Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#if !defined WIN32
//--- VLC -------------------------------------------------------------------
#include <vlc/intf.h>
extern
intf_thread_t
*
g_pIntf
;
//--- GTK2 -----------------------------------------------------------------
#define _GTK2_IE 0x0400 // Yes, i think it's a fucking kludge !
//#include <windows.h>
//#include <commdlg.h>
//#include <commctrl.h>
//#include <richedit.h>
//--- SKIN ------------------------------------------------------------------
#include "../src/banks.h"
#include "../src/dialog.h"
#include "../os_dialog.h"
#include "../src/skin_common.h"
#include "../src/window.h"
#include "../os_window.h"
#include "../src/theme.h"
#include "../os_theme.h"
#include "../src/event.h"
#include "../os_api.h"
//---------------------------------------------------------------------------
// Open file dialog box
//---------------------------------------------------------------------------
GTK2OpenFileDialog
::
GTK2OpenFileDialog
(
intf_thread_t
*
_p_intf
,
string
title
,
bool
multiselect
)
:
OpenFileDialog
(
_p_intf
,
title
,
multiselect
)
{
}
//---------------------------------------------------------------------------
GTK2OpenFileDialog
::~
GTK2OpenFileDialog
()
{
}
//---------------------------------------------------------------------------
void
GTK2OpenFileDialog
::
AddFilter
(
string
name
,
string
type
)
{
/* unsigned int i;
for( i = 0; i < name.length(); i++ )
Filter[FilterLength++] = name[i];
Filter[FilterLength++] = ' ';
Filter[FilterLength++] = '(';
for( i = 0; i < type.length(); i++ )
Filter[FilterLength++] = type[i];
Filter[FilterLength++] = ')';
Filter[FilterLength++] = '\0';
for( i = 0; i < type.length(); i++ )
Filter[FilterLength++] = type[i];
Filter[FilterLength++] = '\0';
// Ending null character if this filter is the last
Filter[FilterLength] = '\0';*/
}
//---------------------------------------------------------------------------
bool
GTK2OpenFileDialog
::
Open
()
{
// Initailize dialog box
/* OPENFILENAME OpenFile;
memset( &OpenFile, 0, sizeof( OpenFile ) );
OpenFile.lStructSize = sizeof( OPENFILENAME );
OpenFile.hwndOwner = NULL;
OpenFile.lpstrFile = new char[MAX_PATH];
OpenFile.lpstrFile[0] = '\0';
OpenFile.nMaxFile = MAX_PATH;
if( MultiSelect )
{
OpenFile.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER;
}
else
{
OpenFile.Flags = OFN_EXPLORER;
}
OpenFile.lpstrTitle = Title.c_str();
OpenFile.lpstrFilter = Filter;
// Remove mouse tracking event to avoid non process due to modal open box
if( p_intf != NULL && p_intf->p_sys->p_theme != NULL )
{
TRACKMOUSEEVENT TrackEvent;
TrackEvent.cbSize = sizeof( TRACKMOUSEEVENT );
TrackEvent.dwFlags = TME_LEAVE|TME_CANCEL;
TrackEvent.dwHoverTime = 1;
list<Window *>::const_iterator win;
for( win = g_pIntf->p_sys->p_theme->WindowList.begin();
win != g_pIntf->p_sys->p_theme->WindowList.end(); win++ )
{
TrackEvent.hwndTrack = ( (GTK2Window *)(*win) )->GetHandle();
TrackMouseEvent( &TrackEvent );
}
}
// Show dialog box
if( !GetOpenFileName( &OpenFile ) )
{
OSAPI_PostMessage( NULL, WINDOW_LEAVE, 0, 0 );
return false;
}
// Tell windows that mouse cursor has left window because it has been
// unactivated
OSAPI_PostMessage( NULL, WINDOW_LEAVE, 0, 0 );
// Find files in string result
char * File = OpenFile.lpstrFile;
int i = OpenFile.nFileOffset;
int last = OpenFile.nFileOffset;
string path;
string tmpFile;
// If only one file has been selected
if( File[OpenFile.nFileOffset - 1] != '\0' )
{
FileList.push_back( (string)File );
}
// If multiple files have been selected
else
{
// Add \ if not present at end of path
if( File[OpenFile.nFileOffset - 2] != '\\' )
{
path = (string)File + '\\';
}
else
{
path = (string)File;
}
// Search filenames
while( true )
{
if( File[i] == '\0' )
{
if( i == last )
break;
else
{
// Add file
FileList.push_back( path + (string)&File[last] );
last = i + 1;
}
}
i++;
}
}
// Free memory
delete[] OpenFile.lpstrFile;
return true;*/
}
//---------------------------------------------------------------------------
#endif
modules/gui/skins/gtk2/gtk2_dialog.h
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* gtk2_dialog.h: GTK2 implementation of some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_dialog.h,v 1.2 2003/04/20 20:28:39 ipkiss Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#ifndef VLC_SKIN_GTK2_DIALOG
#define VLC_SKIN_GTK2_DIALOG
//--- GENERAL ---------------------------------------------------------------
#include <string>
using
namespace
std
;
//---------------------------------------------------------------------------
class
GTK2OpenFileDialog
:
OpenFileDialog
{
private:
protected:
public:
// Constructors
GTK2OpenFileDialog
(
intf_thread_t
*
_p_intf
,
string
title
,
bool
multiselect
);
// Destructors
virtual
~
GTK2OpenFileDialog
();
virtual
void
AddFilter
(
string
name
,
string
type
);
virtual
bool
Open
();
};
//---------------------------------------------------------------------------
#endif
modules/gui/skins/gtk2/gtk2_theme.cpp
View file @
3435dcce
...
...
@@ -2,7 +2,7 @@
* gtk2_theme.cpp: GTK2 implementation of the Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_theme.cpp,v 1.2
0 2003/04/20 20:28:39
ipkiss Exp $
* $Id: gtk2_theme.cpp,v 1.2
1 2003/04/21 02:12:06
ipkiss Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -40,8 +40,6 @@
#include "../os_event.h"
#include "../src/theme.h"
#include "../os_theme.h"
#include "../src/dialog.h"
#include "../os_dialog.h"
#include "../src/vlcproc.h"
#include "../src/skin_common.h"
...
...
modules/gui/skins/os_dialog.h
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* os_dialog.h: Wrapper for the common dialogs
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: os_dialog.h,v 1.4 2003/04/20 20:28:39 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#if defined( WIN32 )
#include "win32/win32_dialog.h"
#define OSOpenFileDialog Win32OpenFileDialog
#else
#include "gtk2/gtk2_dialog.h"
#define OSOpenFileDialog GTK2OpenFileDialog
#endif
modules/gui/skins/src/dialog.cpp
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* dialog.cpp: Classes for some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: dialog.cpp,v 1.4 2003/04/20 20:28:39 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
//--- VLC -------------------------------------------------------------------
#include <vlc/intf.h>
//--- SKIN ------------------------------------------------------------------
#include "dialog.h"
//---------------------------------------------------------------------------
// Open file dialog box
//---------------------------------------------------------------------------
OpenFileDialog
::
OpenFileDialog
(
intf_thread_t
*
_p_intf
,
string
title
,
bool
multiselect
)
{
p_intf
=
_p_intf
;
MultiSelect
=
multiselect
;
Title
=
title
;
Filter
=
new
char
[
200
];
FilterLength
=
0
;
}
//---------------------------------------------------------------------------
OpenFileDialog
::~
OpenFileDialog
()
{
delete
[]
Filter
;
}
//---------------------------------------------------------------------------
modules/gui/skins/src/dialog.h
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* dialog.h: Classes for some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: dialog.h,v 1.2 2003/03/20 09:29:07 karibu Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#ifndef VLC_SKIN_DIALOG
#define VLC_SKIN_DIALOG
//--- GENERAL ---------------------------------------------------------------
#include <string>
#include <list>
using
namespace
std
;
//---------------------------------------------------------------------------
struct
intf_thread_t
;
struct
msg_subscription_t
;
//---------------------------------------------------------------------------
class
OpenFileDialog
{
private:
protected:
char
*
Filter
;
int
FilterLength
;
string
Title
;
bool
MultiSelect
;
intf_thread_t
*
p_intf
;
public:
// Constructors
OpenFileDialog
(
intf_thread_t
*
_p_intf
,
string
title
,
bool
multiselect
);
// Destructors
virtual
~
OpenFileDialog
();
// List of files
list
<
string
>
FileList
;
// Specific methods
virtual
void
AddFilter
(
string
name
,
string
type
)
=
0
;
virtual
bool
Open
()
=
0
;
};
//---------------------------------------------------------------------------
class
LogWindow
{
protected:
bool
Visible
;
intf_thread_t
*
p_intf
;
public:
// Constructors
LogWindow
(
intf_thread_t
*
_p_intf
);
// Destructors
virtual
~
LogWindow
();
virtual
void
Clear
()
=
0
;
virtual
void
AddLine
(
string
line
)
=
0
;
virtual
void
ChangeColor
(
int
color
,
bool
bold
=
false
)
=
0
;
virtual
void
Show
()
=
0
;
virtual
void
Hide
()
=
0
;
// Getters
bool
IsVisible
()
{
return
Visible
;
};
void
Update
(
msg_subscription_t
*
Sub
);
};
//---------------------------------------------------------------------------
#endif
modules/gui/skins/src/skin_main.cpp
View file @
3435dcce
...
...
@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.1
3 2003/04/21 00:54:2
6 ipkiss Exp $
* $Id: skin_main.cpp,v 1.1
4 2003/04/21 02:12:0
6 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -34,8 +34,6 @@
//--- SKIN ------------------------------------------------------------------
#include "../os_api.h"
#include "event.h"
#include "dialog.h"
#include "../os_dialog.h"
#include "banks.h"
#include "window.h"
#include "theme.h"
...
...
@@ -184,35 +182,25 @@ static void Run( intf_thread_t *p_intf )
#endif
{
// Last chance: the user can select a new theme file
wxFileDialog
dialog
(
NULL
,
_
(
"Open a skin file"
),
""
,
""
,
"Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
"All files|*.*"
,
wxOPEN
);
// Initialize file structure
OpenFileDialog
*
OpenFile
;
OpenFile
=
(
OpenFileDialog
*
)
new
OSOpenFileDialog
(
NULL
,
_
(
"Open skin"
),
false
);
OpenFile
->
AddFilter
(
_
(
"Skin files"
),
"*.vlt"
);
OpenFile
->
AddFilter
(
_
(
"Skin files"
),
"*.xml"
);
OpenFile
->
AddFilter
(
_
(
"All files"
),
"*.*"
);
// Open dialog box
if
(
OpenFile
->
Open
()
)
if
(
dialog
.
ShowModal
()
==
wxID_OK
)
{
// try to load selected file
if
(
!
Loader
->
Load
(
OpenFile
->
FileList
.
front
()
)
)
if
(
!
Loader
->
Load
(
dialog
.
GetPath
().
c_str
()
)
)
{
// He, he, what the hell is he doing ?
delete
OpenFile
;
delete
Loader
;
return
;
}
}
else
{
delete
OpenFile
;
delete
Loader
;
return
;
}
delete
OpenFile
;
}
}
...
...
modules/gui/skins/src/theme.cpp
View file @
3435dcce
...
...
@@ -2,7 +2,7 @@
* theme.cpp: Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: theme.cpp,v 1.
9 2003/04/20 20:28:39
ipkiss Exp $
* $Id: theme.cpp,v 1.
10 2003/04/21 02:12:06
ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -31,8 +31,6 @@
#include "../os_api.h"
#include "window.h"
#include "../os_window.h"
#include "dialog.h"
#include "../os_dialog.h"
#include "banks.h"
#include "anchor.h"
#include "event.h"
...
...
modules/gui/skins/src/vlcproc.cpp
View file @
3435dcce
...
...
@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.1
2 2003/04/21 00:54:2
6 ipkiss Exp $
* $Id: vlcproc.cpp,v 1.1
3 2003/04/21 02:12:0
6 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -34,8 +34,6 @@
//--- SKIN ------------------------------------------------------------------
#include "../os_api.h"
#include "dialog.h"
#include "../os_dialog.h"
#include "event.h"
#include "banks.h"
#include "theme.h"
...
...
@@ -329,29 +327,21 @@ void VlcProc::LoadSkin()
{
if
(
p_intf
->
p_sys
->
p_new_theme_file
==
NULL
)
{
// Initialize file structure
OpenFileDialog
*
OpenFile
;
OpenFile
=
(
OpenFileDialog
*
)
new
OSOpenFileDialog
(
p_intf
,
_
(
"Change skin - Open new file"
),
false
);
OpenFile
->
AddFilter
(
_
(
"Skin files"
),
"*.vlt"
);
OpenFile
->
AddFilter
(
_
(
"Skin files"
),
"*.xml"
);
OpenFile
->
AddFilter
(
_
(
"All files"
),
"*.*"
);
// Open dialog box
if
(
OpenFile
->
Open
()
)
wxFileDialog
dialog
(
NULL
,
_
(
"Open a skin file"
),
""
,
""
,
"Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|All files|*.*"
,
wxOPEN
);
if
(
dialog
.
ShowModal
()
==
wxID_OK
)
{
p_intf
->
p_sys
->
p_new_theme_file
=
new
char
[
OpenFile
->
FileList
.
front
().
l
ength
()];
new
char
[
dialog
.
GetPath
().
L
ength
()];
strcpy
(
p_intf
->
p_sys
->
p_new_theme_file
,
OpenFile
->
FileList
.
front
().
c_str
()
);
dialog
.
GetPath
().
c_str
()
);
// Tell vlc to change skin after hiding interface
OSAPI_PostMessage
(
NULL
,
VLC_HIDE
,
VLC_LOAD_SKIN
,
0
);
}
// Free memory
delete
OpenFile
;
}
else
{
...
...
modules/gui/skins/win32/win32_dialog.cpp
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* win32_dialog.cpp: Win32 implementation of some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_dialog.cpp,v 1.5 2003/04/20 20:28:39 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#ifdef WIN32
//--- VLC -------------------------------------------------------------------
#include <vlc/intf.h>
extern
intf_thread_t
*
g_pIntf
;
//--- WIN32 -----------------------------------------------------------------
#define _WIN32_IE 0x0400 // Yes, i think it's a fucking kludge !
#include <windows.h>
#include <commdlg.h>
#include <commctrl.h>
#include <richedit.h>
//--- SKIN ------------------------------------------------------------------
#include "../src/banks.h"
#include "../src/dialog.h"
#include "../os_dialog.h"
#include "../src/skin_common.h"
#include "../src/window.h"
#include "../os_window.h"
#include "../src/theme.h"
#include "../os_theme.h"
#include "../src/event.h"
#include "../os_api.h"
//---------------------------------------------------------------------------
// Open file dialog box
//---------------------------------------------------------------------------
Win32OpenFileDialog
::
Win32OpenFileDialog
(
intf_thread_t
*
_p_intf
,
string
title
,
bool
multiselect
)
:
OpenFileDialog
(
_p_intf
,
title
,
multiselect
)
{
}
//---------------------------------------------------------------------------
Win32OpenFileDialog
::~
Win32OpenFileDialog
()
{
}
//---------------------------------------------------------------------------
void
Win32OpenFileDialog
::
AddFilter
(
string
name
,
string
type
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
name
.
length
();
i
++
)
Filter
[
FilterLength
++
]
=
name
[
i
];
Filter
[
FilterLength
++
]
=
' '
;
Filter
[
FilterLength
++
]
=
'('
;
for
(
i
=
0
;
i
<
type
.
length
();
i
++
)
Filter
[
FilterLength
++
]
=
type
[
i
];
Filter
[
FilterLength
++
]
=
')'
;
Filter
[
FilterLength
++
]
=
'\0'
;
for
(
i
=
0
;
i
<
type
.
length
();
i
++
)
Filter
[
FilterLength
++
]
=
type
[
i
];
Filter
[
FilterLength
++
]
=
'\0'
;
// Ending null character if this filter is the last
Filter
[
FilterLength
]
=
'\0'
;
}
//---------------------------------------------------------------------------
bool
Win32OpenFileDialog
::
Open
()
{
// Initailize dialog box
OPENFILENAME
OpenFile
;
memset
(
&
OpenFile
,
0
,
sizeof
(
OpenFile
)
);
OpenFile
.
lStructSize
=
sizeof
(
OPENFILENAME
);
OpenFile
.
hwndOwner
=
NULL
;
OpenFile
.
lpstrFile
=
new
char
[
MAX_PATH
];
OpenFile
.
lpstrFile
[
0
]
=
'\0'
;
OpenFile
.
nMaxFile
=
MAX_PATH
;
if
(
MultiSelect
)
{
OpenFile
.
Flags
=
OFN_ALLOWMULTISELECT
|
OFN_EXPLORER
;
}
else
{
OpenFile
.
Flags
=
OFN_EXPLORER
;
}
OpenFile
.
lpstrTitle
=
Title
.
c_str
();
OpenFile
.
lpstrFilter
=
Filter
;
// Remove mouse tracking event to avoid non process due to modal open box
if
(
p_intf
!=
NULL
&&
p_intf
->
p_sys
->
p_theme
!=
NULL
)
{
TRACKMOUSEEVENT
TrackEvent
;
TrackEvent
.
cbSize
=
sizeof
(
TRACKMOUSEEVENT
);
TrackEvent
.
dwFlags
=
TME_LEAVE
|
TME_CANCEL
;
TrackEvent
.
dwHoverTime
=
1
;
list
<
Window
*>::
const_iterator
win
;
for
(
win
=
g_pIntf
->
p_sys
->
p_theme
->
WindowList
.
begin
();
win
!=
g_pIntf
->
p_sys
->
p_theme
->
WindowList
.
end
();
win
++
)
{
TrackEvent
.
hwndTrack
=
(
(
Win32Window
*
)(
*
win
)
)
->
GetHandle
();
TrackMouseEvent
(
&
TrackEvent
);
}
}
// Show dialog box
if
(
!
GetOpenFileName
(
&
OpenFile
)
)
{
OSAPI_PostMessage
(
NULL
,
WINDOW_LEAVE
,
0
,
0
);
return
false
;
}
// Tell windows that mouse cursor has left window because it has been
// unactivated
OSAPI_PostMessage
(
NULL
,
WINDOW_LEAVE
,
0
,
0
);
// Find files in string result
char
*
File
=
OpenFile
.
lpstrFile
;
int
i
=
OpenFile
.
nFileOffset
;
int
last
=
OpenFile
.
nFileOffset
;
string
path
;
string
tmpFile
;
// If only one file has been selected
if
(
File
[
OpenFile
.
nFileOffset
-
1
]
!=
'\0'
)
{
FileList
.
push_back
(
(
string
)
File
);
}
// If multiple files have been selected
else
{
// Add \ if not present at end of path
if
(
File
[
OpenFile
.
nFileOffset
-
2
]
!=
'\\'
)
{
path
=
(
string
)
File
+
'\\'
;
}
else
{
path
=
(
string
)
File
;
}
// Search filenames
while
(
true
)
{
if
(
File
[
i
]
==
'\0'
)
{
if
(
i
==
last
)
break
;
else
{
// Add file
FileList
.
push_back
(
path
+
(
string
)
&
File
[
last
]
);
last
=
i
+
1
;
}
}
i
++
;
}
}
// Free memory
delete
[]
OpenFile
.
lpstrFile
;
return
true
;
}
//---------------------------------------------------------------------------
#endif
modules/gui/skins/win32/win32_dialog.h
deleted
100644 → 0
View file @
dfa3c5d0
/*****************************************************************************
* win32_dialog.h: Win32 implementation of some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_dialog.h,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#ifdef WIN32
#ifndef VLC_SKIN_WIN32_DIALOG
#define VLC_SKIN_WIN32_DIALOG
//--- GENERAL ---------------------------------------------------------------
#include <string>
using
namespace
std
;
//---------------------------------------------------------------------------
class
Win32OpenFileDialog
:
OpenFileDialog
{
private:
protected:
public:
// Constructors
Win32OpenFileDialog
(
intf_thread_t
*
_p_intf
,
string
title
,
bool
multiselect
);
// Destructors
virtual
~
Win32OpenFileDialog
();
virtual
void
AddFilter
(
string
name
,
string
type
);
virtual
bool
Open
();
};
//---------------------------------------------------------------------------
class
Win32LogWindow
:
LogWindow
{
private:
HWND
hWindow
;
HWND
hRichCtrl
;
string
RtfHeader
;
public:
// Constructors
Win32LogWindow
(
intf_thread_t
*
_p_intf
);
// Destructors
virtual
~
Win32LogWindow
();
virtual
void
Clear
();
virtual
void
AddLine
(
string
line
);
virtual
void
ChangeColor
(
int
color
,
bool
bold
=
false
);
virtual
void
Show
();
virtual
void
Hide
();
// Specific methods
HWND
GetRichCtrl
()
{
return
hRichCtrl
;
};
HWND
GetWindow
()
{
return
hWindow
;
};
};
//---------------------------------------------------------------------------
#endif
#endif
modules/gui/skins/win32/win32_theme.cpp
View file @
3435dcce
...
...
@@ -2,7 +2,7 @@
* win32_theme.cpp: Win32 implementation of the Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_theme.cpp,v 1.
4 2003/04/20 20:28:39
ipkiss Exp $
* $Id: win32_theme.cpp,v 1.
5 2003/04/21 02:12:06
ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -44,8 +44,6 @@
#include "../os_event.h"
#include "../src/theme.h"
#include "../os_theme.h"
#include "../src/dialog.h"
#include "../os_dialog.h"
#include "../src/vlcproc.h"
#include "../src/skin_common.h"
...
...
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