Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
2aa9dde7
Commit
2aa9dde7
authored
May 07, 2003
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/gui/beos/PreferencesWindow.cpp:
Misc enhancements
parent
41409dfc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
19 deletions
+58
-19
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/PreferencesWindow.cpp
+58
-19
No files found.
modules/gui/beos/PreferencesWindow.cpp
View file @
2aa9dde7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* PreferencesWindow.cpp: beos interface
* PreferencesWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PreferencesWindow.cpp,v 1.1
6 2003/05/05 13:06:02
titer Exp $
* $Id: PreferencesWindow.cpp,v 1.1
7 2003/05/07 16:47:10
titer Exp $
*
*
* Authors: Eric Petit <titer@videolan.org>
* Authors: Eric Petit <titer@videolan.org>
*
*
...
@@ -31,6 +31,28 @@
...
@@ -31,6 +31,28 @@
#include "PreferencesWindow.h"
#include "PreferencesWindow.h"
/* We use this function to order the items of the BOutlineView */
int
compare_func
(
const
BListItem
*
_first
,
const
BListItem
*
_second
)
{
StringItemWithView
*
first
=
(
StringItemWithView
*
)
_first
;
StringItemWithView
*
second
=
(
StringItemWithView
*
)
_second
;
/* the beos module first */
if
(
!
strcmp
(
first
->
Text
(),
"beos"
)
)
return
-
1
;
if
(
!
strcmp
(
second
->
Text
(),
"beos"
)
)
return
1
;
/* the main module in second */
if
(
!
strcmp
(
first
->
Text
(),
"main"
)
)
return
-
1
;
if
(
!
strcmp
(
second
->
Text
(),
"main"
)
)
return
1
;
/* alphabetic order */
return
(
strcmp
(
first
->
Text
(),
second
->
Text
()
)
);
}
/*****************************************************************************
/*****************************************************************************
* StringItemWithView::StringItemWithView
* StringItemWithView::StringItemWithView
*****************************************************************************/
*****************************************************************************/
...
@@ -90,14 +112,19 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
...
@@ -90,14 +112,19 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
fDummyView
=
new
BView
(
rect
,
""
,
B_FOLLOW_ALL_SIDES
,
B_WILL_DRAW
);
fDummyView
=
new
BView
(
rect
,
""
,
B_FOLLOW_ALL_SIDES
,
B_WILL_DRAW
);
fPrefsView
->
AddChild
(
fDummyView
);
fPrefsView
->
AddChild
(
fDummyView
);
/* Add a category for modules configuration */
StringItemWithView
*
modulesItem
;
modulesItem
=
new
StringItemWithView
(
_
(
"Modules"
)
);
modulesItem
->
fConfigView
=
NULL
;
fOutline
->
AddItem
(
modulesItem
);
/* Fill the tree */
/* Fill the tree */
/* TODO:
/* TODO:
- manage CONFIG_HINT_SUBCATEGORY
- manage CONFIG_HINT_SUBCATEGORY
- use a pop-up for CONFIG_HINT_MODULE
- use a pop-up for CONFIG_HINT_MODULE
- use BSliders for integer_with_range and float_with_range
- use BSliders for integer_with_range and float_with_range
- add a tab for BeOS specific configution (screenshot path, etc)
- add the needed LockLooper()s
- add the needed LockLooper()s
- fix window resizing
- fix
horizontal
window resizing
- make this intuitive ! */
- make this intuitive ! */
vlc_list_t
*
p_list
;
vlc_list_t
*
p_list
;
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
...
@@ -220,7 +247,11 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
...
@@ -220,7 +247,11 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
StringItemWithView
*
stringItem
;
StringItemWithView
*
stringItem
;
stringItem
=
new
StringItemWithView
(
p_module
->
psz_object_name
);
stringItem
=
new
StringItemWithView
(
p_module
->
psz_object_name
);
stringItem
->
fConfigView
=
configView
;
stringItem
->
fConfigView
=
configView
;
if
(
!
strcmp
(
p_module
->
psz_object_name
,
"beos"
)
||
!
strcmp
(
p_module
->
psz_object_name
,
"main"
)
)
fOutline
->
AddItem
(
stringItem
);
fOutline
->
AddItem
(
stringItem
);
else
fOutline
->
AddUnder
(
stringItem
,
modulesItem
);
}
}
vlc_list_release
(
p_list
);
vlc_list_release
(
p_list
);
...
@@ -228,6 +259,10 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
...
@@ -228,6 +259,10 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
/* Set the correct values */
/* Set the correct values */
ApplyChanges
(
false
);
ApplyChanges
(
false
);
/* Sort items, collapse the Modules one */
fOutline
->
FullListSortItems
(
compare_func
);
fOutline
->
Collapse
(
modulesItem
);
/* Select the first item */
/* Select the first item */
fOutline
->
Select
(
0
);
fOutline
->
Select
(
0
);
...
@@ -306,16 +341,12 @@ void PreferencesWindow::FrameResized( float width, float height )
...
@@ -306,16 +341,12 @@ void PreferencesWindow::FrameResized( float width, float height )
{
{
BWindow
::
FrameResized
(
width
,
height
);
BWindow
::
FrameResized
(
width
,
height
);
StringItemWithView
*
item
;
/* Get the current ConfigView */
ConfigView
*
view
;
ConfigView
*
view
;
for
(
int
i
=
0
;
i
<
fOutline
->
CountItems
();
i
++
)
view
=
(
ConfigView
*
)
fConfigScroll
->
ChildAt
(
0
);
{
/* Fix ConfigView sizes */
item
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
i
);
view
=
item
->
fConfigView
;
view
->
ResizeTo
(
fDummyView
->
Bounds
().
Width
()
-
B_V_SCROLL_BAR_WIDTH
,
view
->
ResizeTo
(
fDummyView
->
Bounds
().
Width
()
-
B_V_SCROLL_BAR_WIDTH
,
fDummyView
->
Bounds
().
Height
()
);
fDummyView
->
Bounds
().
Height
()
);
}
UpdateScrollBar
();
UpdateScrollBar
();
}
}
...
@@ -325,12 +356,16 @@ void PreferencesWindow::FrameResized( float width, float height )
...
@@ -325,12 +356,16 @@ void PreferencesWindow::FrameResized( float width, float height )
*****************************************************************************/
*****************************************************************************/
void
PreferencesWindow
::
Update
()
void
PreferencesWindow
::
Update
()
{
{
/* Get the selected item */
/* Get the selected item
, if any
*/
if
(
fOutline
->
CurrentSelection
()
<
0
)
if
(
fOutline
->
CurrentSelection
()
<
0
)
return
;
return
;
StringItemWithView
*
selectedItem
=
StringItemWithView
*
selectedItem
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
fOutline
->
CurrentSelection
()
);
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
fOutline
->
CurrentSelection
()
);
if
(
!
selectedItem
->
fConfigView
)
/* This must be the "Modules" item */
return
;
if
(
fConfigScroll
)
if
(
fConfigScroll
)
{
{
/* If we don't do this, the ConfigView will remember a wrong position */
/* If we don't do this, the ConfigView will remember a wrong position */
...
@@ -345,6 +380,10 @@ void PreferencesWindow::Update()
...
@@ -345,6 +380,10 @@ void PreferencesWindow::Update()
delete
fConfigScroll
;
delete
fConfigScroll
;
}
}
selectedItem
->
fConfigView
->
ResizeTo
(
fDummyView
->
Bounds
().
Width
()
-
B_V_SCROLL_BAR_WIDTH
,
fDummyView
->
Bounds
().
Height
()
);
/* Create a BScrollView with the new ConfigView in it */
/* Create a BScrollView with the new ConfigView in it */
fConfigScroll
=
new
BScrollView
(
""
,
selectedItem
->
fConfigView
,
B_FOLLOW_ALL_SIDES
,
fConfigScroll
=
new
BScrollView
(
""
,
selectedItem
->
fConfigView
,
B_FOLLOW_ALL_SIDES
,
0
,
false
,
true
,
B_NO_BORDER
);
0
,
false
,
true
,
B_NO_BORDER
);
...
@@ -363,11 +402,7 @@ void PreferencesWindow::UpdateScrollBar()
...
@@ -363,11 +402,7 @@ void PreferencesWindow::UpdateScrollBar()
/* Get the current config view */
/* Get the current config view */
ConfigView
*
view
;
ConfigView
*
view
;
if
(
fOutline
->
CurrentSelection
()
<
0
)
view
=
(
ConfigView
*
)
fConfigScroll
->
ChildAt
(
0
);
return
;
StringItemWithView
*
selectedItem
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
fOutline
->
CurrentSelection
()
);
view
=
selectedItem
->
fConfigView
;
/* Get the available BRect for display */
/* Get the available BRect for display */
BRect
display
=
fConfigScroll
->
Bounds
();
BRect
display
=
fConfigScroll
->
Bounds
();
...
@@ -401,6 +436,10 @@ void PreferencesWindow::ApplyChanges( bool doIt )
...
@@ -401,6 +436,10 @@ void PreferencesWindow::ApplyChanges( bool doIt )
item
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
i
);
item
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
i
);
view
=
item
->
fConfigView
;
view
=
item
->
fConfigView
;
if
(
!
view
)
/* This must be the "Modules" item */
continue
;
for
(
int
j
=
0
;
j
<
view
->
CountChildren
();
j
++
)
for
(
int
j
=
0
;
j
<
view
->
CountChildren
();
j
++
)
{
{
child
=
view
->
ChildAt
(
j
);
child
=
view
->
ChildAt
(
j
);
...
...
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