]> git.sesse.net Git - vlc/blob - modules/gui/skins/src/dialog.cpp
* gtk2_bitmap.cpp: fixed constructor bug
[vlc] / modules / gui / skins / src / dialog.cpp
1 /*****************************************************************************
2  * dialog.cpp: Classes for some dialog boxes
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: dialog.cpp,v 1.3 2003/04/12 21:43:27 asmax Exp $
6  *
7  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
8  *          Emmanuel Puig    <karibu@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111,
23  * USA.
24  *****************************************************************************/
25
26
27 //--- VLC -------------------------------------------------------------------
28 #include <vlc/intf.h>
29
30 //--- SKIN ------------------------------------------------------------------
31 #include "dialog.h"
32
33
34
35 //---------------------------------------------------------------------------
36 // Open file dialog box
37 //---------------------------------------------------------------------------
38 OpenFileDialog::OpenFileDialog( intf_thread_t *_p_intf, string title,
39     bool multiselect )
40 {
41     p_intf       = _p_intf;
42     MultiSelect  = multiselect;
43     Title        = title;
44     Filter       = new char[200];
45     FilterLength = 0;
46 }
47 //---------------------------------------------------------------------------
48 OpenFileDialog::~OpenFileDialog()
49 {
50     delete[] Filter;
51 }
52 //---------------------------------------------------------------------------
53
54
55
56
57 //---------------------------------------------------------------------------
58 // Log Window
59 //---------------------------------------------------------------------------
60 LogWindow::LogWindow( intf_thread_t *_p_intf )
61 {
62     p_intf = _p_intf;
63     Visible = false;
64 }
65 //---------------------------------------------------------------------------
66 LogWindow::~LogWindow()
67 {
68 }
69 //---------------------------------------------------------------------------
70 void LogWindow::Update( msg_subscription_t *Sub )
71 {
72     //if( !Visible )
73     //    return;
74
75     int i_start, i_stop;
76     int i_max_lines;
77
78     vlc_mutex_lock( Sub->p_lock );
79     i_stop = *Sub->pi_stop;
80     vlc_mutex_unlock( Sub->p_lock );
81
82     if( Sub->i_start != i_stop )
83     {
84         for( i_start = Sub->i_start;
85              i_start != i_stop;
86              i_start = (i_start+1) % VLC_MSG_QSIZE )
87         {
88
89
90 /* FIXME: kludge */
91 #ifdef WIN32
92             // Append all messages to log window
93             switch( Sub->p_msg[i_start].i_type )
94             {
95                 case VLC_MSG_ERR:
96                     ChangeColor( RGB( 255, 0, 0 ), true );
97                     break;
98                 case VLC_MSG_WARN:
99                     ChangeColor( RGB( 255, 128, 0 ), true );
100                     break;
101                 default:
102                     ChangeColor( RGB( 128, 128, 128 ) );
103                     break;
104 #else
105   fprintf(stderr, "WARNING: FIXME in dialog.cpp");
106             // Append all messages to log window
107             switch( Sub->p_msg[i_start].i_type )
108             {
109                 case VLC_MSG_ERR:
110  //                   ChangeColor( RGB( 255, 0, 0 ), true );
111                     break;
112                 case VLC_MSG_WARN:
113 //                    ChangeColor( RGB( 255, 128, 0 ), true );
114                     break;
115                 default:
116 //                    ChangeColor( RGB( 128, 128, 128 ) );
117                     break;
118 #endif
119             }
120
121             // Add message
122             if( i_max_lines )
123             {
124                 AddLine( (string)Sub->p_msg[i_start].psz_msg );
125             }
126         }
127
128         vlc_mutex_lock( Sub->p_lock );
129         Sub->i_start = i_start;
130         vlc_mutex_unlock( Sub->p_lock );
131     }
132 }
133 //---------------------------------------------------------------------------
134