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
543e3529
Commit
543e3529
authored
Jan 26, 2003
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some colors.
parent
7a3a7029
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
35 deletions
+63
-35
modules/gui/beos/MessagesWindow.cpp
modules/gui/beos/MessagesWindow.cpp
+61
-34
modules/gui/beos/MessagesWindow.h
modules/gui/beos/MessagesWindow.h
+2
-1
No files found.
modules/gui/beos/MessagesWindow.cpp
View file @
543e3529
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* MessagesWindow.cpp: beos interface
* MessagesWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MessagesWindow.cpp,v 1.
1 2003/01/25 20:15:41
titer Exp $
* $Id: MessagesWindow.cpp,v 1.
2 2003/01/26 08:28:20
titer Exp $
*
*
* Authors: Eric Petit <titer@videolan.org>
* Authors: Eric Petit <titer@videolan.org>
*
*
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
/* BeOS headers */
/* BeOS headers */
#include <InterfaceKit.h>
#include <InterfaceKit.h>
#include <SupportKit.h>
/* VLC headers */
/* VLC headers */
#include <vlc/vlc.h>
#include <vlc/vlc.h>
...
@@ -43,18 +44,18 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
...
@@ -43,18 +44,18 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
this
->
p_intf
=
p_intf
;
this
->
p_intf
=
p_intf
;
p_sub
=
p_intf
->
p_sys
->
p_sub
;
p_sub
=
p_intf
->
p_sys
->
p_sub
;
BRect
rect
,
rect2
;
BRect
rect
,
textRect
;
rect
=
Bounds
();
rect
=
Bounds
();
rect
.
right
-=
B_V_SCROLL_BAR_WIDTH
;
rect
.
right
-=
B_V_SCROLL_BAR_WIDTH
;
rect
.
bottom
-=
B_H_SCROLL_BAR_HEIGHT
;
textRect
=
rect
;
rect2
=
rect
;
textRect
.
InsetBy
(
5
,
5
);
rect2
.
InsetBy
(
5
,
5
);
fMessagesView
=
new
BTextView
(
rect
,
"messages"
,
textRect
,
fMessagesView
=
new
BTextView
(
rect
,
"messages"
,
rect2
,
B_FOLLOW_ALL
,
B_WILL_DRAW
);
B_FOLLOW_ALL
,
B_WILL_DRAW
);
fMessagesView
->
MakeEditable
(
false
);
fMessagesView
->
MakeEditable
(
false
);
fMessagesView
->
SetStylable
(
true
);
fScrollView
=
new
BScrollView
(
"scrollview"
,
fMessagesView
,
B_WILL_DRAW
,
fScrollView
=
new
BScrollView
(
"scrollview"
,
fMessagesView
,
B_WILL_DRAW
,
B_FOLLOW_ALL
,
tru
e
,
true
);
B_FOLLOW_ALL
,
fals
e
,
true
);
fScrollBar
=
fScrollView
->
ScrollBar
(
B_VERTICAL
);
fScrollBar
=
fScrollView
->
ScrollBar
(
B_VERTICAL
);
AddChild
(
fScrollView
);
AddChild
(
fScrollView
);
...
@@ -70,6 +71,16 @@ MessagesWindow::~MessagesWindow()
...
@@ -70,6 +71,16 @@ MessagesWindow::~MessagesWindow()
{
{
}
}
/*****************************************************************************
* MessagesWindow::FrameResized
*****************************************************************************/
void
MessagesWindow
::
FrameResized
(
float
,
float
)
{
BRect
rect
=
fMessagesView
->
Bounds
();
rect
.
InsetBy
(
5
,
5
);
fMessagesView
->
SetTextRect
(
rect
);
}
/*****************************************************************************
/*****************************************************************************
* MessagesWindow::QuitRequested
* MessagesWindow::QuitRequested
*****************************************************************************/
*****************************************************************************/
...
@@ -93,7 +104,13 @@ void MessagesWindow::ReallyQuit()
...
@@ -93,7 +104,13 @@ void MessagesWindow::ReallyQuit()
*****************************************************************************/
*****************************************************************************/
void
MessagesWindow
::
UpdateMessages
()
void
MessagesWindow
::
UpdateMessages
()
{
{
int
i_start
;
int
i_start
,
oldLength
;
char
*
psz_module_type
=
NULL
;
rgb_color
red
=
{
200
,
0
,
0
};
rgb_color
gray
=
{
150
,
150
,
150
};
rgb_color
green
=
{
0
,
150
,
0
};
rgb_color
orange
=
{
230
,
180
,
00
};
rgb_color
color
;
vlc_mutex_lock
(
p_sub
->
p_lock
);
vlc_mutex_lock
(
p_sub
->
p_lock
);
int
i_stop
=
*
p_sub
->
pi_stop
;
int
i_stop
=
*
p_sub
->
pi_stop
;
...
@@ -105,34 +122,44 @@ void MessagesWindow::UpdateMessages()
...
@@ -105,34 +122,44 @@ void MessagesWindow::UpdateMessages()
i_start
!=
i_stop
;
i_start
!=
i_stop
;
i_start
=
(
i_start
+
1
)
%
VLC_MSG_QSIZE
)
i_start
=
(
i_start
+
1
)
%
VLC_MSG_QSIZE
)
{
{
/* Append all messages to log window */
/* Add message */
/* textctrl->SetDefaultStyle( *dbg_attr );
switch
(
p_sub
->
p_msg
[
i_start
].
i_type
)
(*textctrl) << p_sub->p_msg[i_start].psz_module; */
{
case
VLC_MSG_INFO
:
color
=
green
;
break
;
case
VLC_MSG_WARN
:
color
=
orange
;
break
;
case
VLC_MSG_ERR
:
color
=
red
;
break
;
case
VLC_MSG_DBG
:
color
=
gray
;
break
;
}
/* switch( p_sub->p_msg[i_start].i
_type )
switch
(
p_sub
->
p_msg
[
i_start
].
i_object
_type
)
{
{
case VLC_MSG_INFO:
case
VLC_OBJECT_ROOT
:
psz_module_type
=
"root"
;
break
;
(*textctrl) << ": ";
case
VLC_OBJECT_VLC
:
psz_module_type
=
"vlc"
;
break
;
textctrl->SetDefaultStyle( *info_attr );
case
VLC_OBJECT_MODULE
:
psz_module_type
=
"module"
;
break
;
break;
case
VLC_OBJECT_INTF
:
psz_module_type
=
"interface"
;
break
;
case VLC_MSG_ERR:
case
VLC_OBJECT_PLAYLIST
:
psz_module_type
=
"playlist"
;
break
;
(*textctrl) << " error: ";
case
VLC_OBJECT_ITEM
:
psz_module_type
=
"item"
;
break
;
textctrl->SetDefaultStyle( *err_attr );
case
VLC_OBJECT_INPUT
:
psz_module_type
=
"input"
;
break
;
break;
case
VLC_OBJECT_DECODER
:
psz_module_type
=
"decoder"
;
break
;
case VLC_MSG_WARN:
case
VLC_OBJECT_VOUT
:
psz_module_type
=
"video output"
;
break
;
(*textctrl) << " warning: ";
case
VLC_OBJECT_AOUT
:
psz_module_type
=
"audio output"
;
break
;
textctrl->SetDefaultStyle( *warn_attr );
case
VLC_OBJECT_SOUT
:
psz_module_type
=
"stream output"
;
break
;
break;
}
case VLC_MSG_DBG:
default:
(*textctrl) << " debug: ";
break;
} */
/* Add message */
fMessagesView
->
LockLooper
();
fMessagesView
->
LockLooper
();
fMessagesView
->
Insert
(
p_sub
->
p_msg
[
i_start
].
psz_msg
);
oldLength
=
fMessagesView
->
TextLength
();
fMessagesView
->
Insert
(
"
\n
"
);
BString
string
;
string
.
Append
(
p_sub
->
p_msg
[
i_start
].
psz_module
);
string
.
Append
(
" "
);
string
.
Append
(
psz_module_type
);
string
.
Append
(
" : "
);
string
.
Append
(
p_sub
->
p_msg
[
i_start
].
psz_msg
);
string
.
Append
(
"
\n
"
);
fMessagesView
->
Insert
(
string
.
String
()
);
fMessagesView
->
SetFontAndColor
(
oldLength
,
fMessagesView
->
TextLength
(),
NULL
,
0
,
&
color
);
fMessagesView
->
Draw
(
fMessagesView
->
Bounds
()
);
fMessagesView
->
UnlockLooper
();
fMessagesView
->
UnlockLooper
();
/* Scroll at the end */
/* Scroll at the end */
...
...
modules/gui/beos/MessagesWindow.h
View file @
543e3529
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* MessagesWindow.h
* MessagesWindow.h
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MessagesWindow.h,v 1.
1 2003/01/25 20:15:41
titer Exp $
* $Id: MessagesWindow.h,v 1.
2 2003/01/26 08:28:20
titer Exp $
*
*
* Authors: Eric Petit <titer@videolan.org>
* Authors: Eric Petit <titer@videolan.org>
*
*
...
@@ -32,6 +32,7 @@ class MessagesWindow : public BWindow
...
@@ -32,6 +32,7 @@ class MessagesWindow : public BWindow
MessagesWindow
(
intf_thread_t
*
p_intf
,
MessagesWindow
(
intf_thread_t
*
p_intf
,
BRect
frame
,
const
char
*
name
);
BRect
frame
,
const
char
*
name
);
virtual
~
MessagesWindow
();
virtual
~
MessagesWindow
();
virtual
void
FrameResized
(
float
,
float
);
virtual
bool
QuitRequested
();
virtual
bool
QuitRequested
();
void
ReallyQuit
();
void
ReallyQuit
();
...
...
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