1 /*****************************************************************************
2 * pda.c : PDA Gtk2 plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2002 the VideoLAN team
7 * Authors: Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
8 * Marc Ariberti <marcari@videolan.org>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include <errno.h> /* ENOMEM */
31 #include <vlc_input.h>
32 #include <vlc_interface.h>
33 #include <vlc_playlist.h>
37 #include "pda_callbacks.h"
38 #include "pda_interface.h"
39 #include "pda_support.h"
42 /*****************************************************************************
44 *****************************************************************************/
45 static int Open ( vlc_object_t * );
46 static void Close ( vlc_object_t * );
47 static void Run ( intf_thread_t * );
49 void GtkAutoPlayFile ( vlc_object_t * );
50 static int Manage ( intf_thread_t *p_intf );
51 void E_(GtkDisplayDate) ( GtkAdjustment *p_adj, gpointer userdata );
52 gint E_(GtkModeManage) ( intf_thread_t * p_intf );
54 /*****************************************************************************
56 *****************************************************************************/
57 #define AUTOPLAYFILE_TEXT N_("Autoplay selected file")
58 #define AUTOPLAYFILE_LONGTEXT N_("Automatically play a file when selected in the "\
59 "file selection list")
61 /*****************************************************************************
63 *****************************************************************************/
65 set_description( _("PDA Linux Gtk2+ interface") );
66 set_category( CAT_INTERFACE );
67 set_subcategory( SUBCAT_INTERFACE_MAIN );
68 // add_bool( "pda-autoplayfile", 1, GtkAutoPlayFile, AUTOPLAYFILE_TEXT, AUTOPLAYFILE_LONGTEXT, VLC_TRUE );
69 set_capability( "interface", 70 );
70 set_callbacks( Open, Close );
71 add_shortcut( "pda" );
74 /*****************************************************************************
75 * Open: initialize and create window
76 *****************************************************************************/
77 static int Open( vlc_object_t *p_this )
79 intf_thread_t *p_intf = (intf_thread_t *)p_this;
81 /* Allocate instance and initialize some members */
82 p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
83 if( p_intf->p_sys == NULL )
85 msg_Err( p_intf, "out of memory" );
90 msg_Dbg( p_intf, "Using gui-helper" );
91 p_intf->p_sys->p_gtk_main =
92 module_Need( p_this, "gui-helper", "gtk2", VLC_TRUE );
93 if( p_intf->p_sys->p_gtk_main == NULL )
95 free( p_intf->p_sys );
100 /* Initialize Gtk+ thread */
101 p_intf->p_sys->p_input = NULL;
103 p_intf->p_sys->b_autoplayfile = 1;
104 p_intf->p_sys->b_playing = 0;
105 p_intf->p_sys->b_slider_free = 1;
107 p_intf->pf_run = Run;
112 /*****************************************************************************
113 * Close: destroy interface window
114 *****************************************************************************/
115 static void Close( vlc_object_t *p_this )
117 intf_thread_t *p_intf = (intf_thread_t *)p_this;
119 if( p_intf->p_sys->p_input )
121 vlc_object_release( p_intf->p_sys->p_input );
124 #ifdef NEED_GTK2_MAIN
125 msg_Dbg( p_intf, "Releasing gui-helper" );
126 module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
129 /* Destroy structure */
130 free( p_intf->p_sys );
133 /*****************************************************************************
135 *****************************************************************************
136 * this part of the interface is in a separate thread so that we can call
137 * gtk_main() from within it without annoying the rest of the program.
138 *****************************************************************************/
139 static void Run( intf_thread_t *p_intf )
141 #ifndef NEED_GTK2_MAIN
142 /* gtk_init needs to know the command line. We don't care, so we
143 * give it an empty one */
144 char *p_args[] = { "", NULL };
145 char **pp_args = p_args;
149 playlist_t *p_playlist;
150 GtkCellRenderer *p_renderer = NULL;
151 GtkTreeViewColumn *p_column = NULL;
152 GtkListStore *p_filelist = NULL;
153 GtkListStore *p_playlist_store = NULL;
155 #ifndef NEED_GTK2_MAIN
157 msg_Dbg( p_intf, "Starting pda GTK2+ interface" );
158 gtk_init( &i_args, &pp_args );
160 /* Initialize Gtk+ */
161 msg_Dbg( p_intf, "Starting pda GTK2+ interface thread" );
165 /* Create some useful widgets that will certainly be used */
166 /* FIXME: magic path */
167 add_pixmap_directory("share");
168 add_pixmap_directory("/usr/share/vlc");
170 /* Path for pixmaps under linupy 1.4 */
171 add_pixmap_directory("/usr/local/share/pixmaps/vlc");
172 /* Path for pixmaps under linupy 2.0 */
173 add_pixmap_directory("/usr/share/pixmaps/vlc");
175 p_intf->p_sys->p_window = create_pda();
176 if (p_intf->p_sys->p_window == NULL)
178 msg_Err( p_intf, "unable to create pda interface" );
181 /* Store p_intf to keep an eye on it */
182 gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
185 /* Set the title of the main window */
186 gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
187 VOUT_TITLE " (PDA Linux interface)");
189 /* Get the notebook object */
190 p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data(
191 GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) );
193 /* Get the slider object */
194 p_intf->p_sys->p_slider = (GtkHScale*) lookup_widget( p_intf->p_sys->p_window, "timeSlider" );
195 p_intf->p_sys->p_slider_label = (GtkLabel*) lookup_widget( p_intf->p_sys->p_window, "timeLabel" );
196 if (p_intf->p_sys->p_slider == NULL)
197 msg_Err( p_intf, "Time slider widget not found." );
198 if (p_intf->p_sys->p_slider_label == NULL)
199 msg_Err( p_intf, "Time label widget not found." );
201 /* Connect the date display to the slider */
202 p_intf->p_sys->p_adj = gtk_range_get_adjustment( GTK_RANGE(p_intf->p_sys->p_slider) );
203 if (p_intf->p_sys->p_adj == NULL)
204 msg_Err( p_intf, "Adjustment range not found." );
205 g_signal_connect( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
206 G_CALLBACK( E_(GtkDisplayDate) ), p_intf );
207 p_intf->p_sys->f_adj_oldvalue = 0;
208 p_intf->p_sys->i_adj_oldvalue = 0;
210 /* BEGIN OF FILEVIEW GTK_TREE_VIEW */
211 p_intf->p_sys->p_tvfile = NULL;
212 p_intf->p_sys->p_tvfile = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window,
214 if (NULL == p_intf->p_sys->p_tvfile)
215 msg_Err(p_intf, "Error obtaining pointer to File List");
217 /* Insert columns 0 */
218 p_renderer = gtk_cell_renderer_text_new ();
219 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 0, (gchar *) N_("Filename"), p_renderer, NULL);
220 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 0 );
221 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
222 gtk_tree_view_column_set_sort_column_id(p_column, 0);
223 /* Insert columns 1 */
224 p_renderer = gtk_cell_renderer_text_new ();
225 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 1, (gchar *) N_("Permissions"), p_renderer, NULL);
226 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 1 );
227 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
228 gtk_tree_view_column_set_sort_column_id(p_column, 1);
229 /* Insert columns 2 */
230 p_renderer = gtk_cell_renderer_text_new ();
231 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 2, (gchar *) N_("Size"), p_renderer, NULL);
232 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 2 );
233 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
234 gtk_tree_view_column_set_sort_column_id(p_column, 2);
235 /* Insert columns 3 */
236 p_renderer = gtk_cell_renderer_text_new ();
237 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 3, (gchar *) N_("Owner"), p_renderer, NULL);
238 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 3 );
239 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 3 );
240 gtk_tree_view_column_set_sort_column_id(p_column, 3);
241 /* Insert columns 4 */
242 p_renderer = gtk_cell_renderer_text_new ();
243 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 4, (gchar *) N_("Group"), p_renderer, NULL);
244 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 4 );
245 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 4 );
246 gtk_tree_view_column_set_sort_column_id(p_column, 4);
248 /* Get new directory listing */
249 p_filelist = gtk_list_store_new (5,
250 G_TYPE_STRING, /* Filename */
251 G_TYPE_STRING, /* permissions */
252 G_TYPE_UINT64, /* File size */
253 G_TYPE_STRING, /* Owner */
254 G_TYPE_STRING);/* Group */
255 ReadDirectory(p_intf, p_filelist, ".");
256 gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(p_filelist));
257 g_object_unref(p_filelist); /* Model will be released by GtkTreeView */
258 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile)),GTK_SELECTION_MULTIPLE);
260 /* Column properties */
261 gtk_tree_view_set_headers_visible(p_intf->p_sys->p_tvfile, TRUE);
262 gtk_tree_view_columns_autosize(p_intf->p_sys->p_tvfile);
263 gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile),TRUE);
264 /* END OF FILEVIEW GTK_TREE_VIEW */
266 /* BEGIN OF PLAYLIST GTK_TREE_VIEW */
267 p_intf->p_sys->p_tvplaylist = NULL;
268 p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist");
269 if (NULL == p_intf->p_sys->p_tvplaylist)
270 msg_Err(p_intf, "Error obtaining pointer to Play List");
273 p_renderer = gtk_cell_renderer_text_new ();
274 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 0, (gchar *) N_("Filename"), p_renderer, NULL);
275 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 0 );
276 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
277 gtk_tree_view_column_set_sort_column_id(p_column, 0);
279 p_renderer = gtk_cell_renderer_text_new ();
280 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 1, (gchar *) N_("Time"), p_renderer, NULL);
281 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 );
282 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
283 gtk_tree_view_column_set_sort_column_id(p_column, 1);
285 /* Column 3 - is a hidden column used for reliable deleting items from the underlying playlist */
286 p_renderer = gtk_cell_renderer_text_new ();
287 gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, (gchar *) N_("Index"), p_renderer, NULL);
288 p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 );
289 gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
290 gtk_tree_view_column_set_sort_column_id(p_column, 2);
292 /* update the playlist */
293 p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
294 p_playlist_store = gtk_list_store_new (3,
295 G_TYPE_STRING, /* Filename */
296 G_TYPE_STRING, /* Time */
297 G_TYPE_UINT); /* Hidden index */
298 PlaylistRebuildListStore(p_intf,p_playlist_store, p_playlist);
299 gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_playlist_store));
300 g_object_unref(p_playlist_store);
301 vlc_object_release(p_playlist); /* Free the playlist */
302 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
304 /* Column properties */
305 gtk_tree_view_set_headers_visible(p_intf->p_sys->p_tvplaylist, TRUE);
306 gtk_tree_view_columns_autosize(p_intf->p_sys->p_tvplaylist);
307 gtk_tree_view_set_headers_clickable(p_intf->p_sys->p_tvplaylist, TRUE);
308 /* END OF PLAYLIST GTK_TREE_VIEW */
310 /* Hide the Preference TAB for now. */
311 GtkWidget *p_preference_tab = NULL;
312 p_preference_tab = gtk_notebook_get_nth_page(p_intf->p_sys->p_notebook,5);
313 if (p_preference_tab != NULL)
314 gtk_widget_hide(p_preference_tab);
316 /* Show the control window */
317 gtk_widget_show( p_intf->p_sys->p_window );
319 #ifdef NEED_GTK2_MAIN
320 msg_Dbg( p_intf, "Manage GTK keyboard events using threads" );
321 while( !intf_ShouldDie( p_intf ) )
325 /* Sleep to avoid using all CPU - since some interfaces need to
326 * access keyboard events, a 100ms delay is a good compromise */
328 if (vlc_CPU() & CPU_CAPABILITY_FPU)
329 msleep( INTF_IDLE_SLEEP );
335 msg_Dbg( p_intf, "Manage GTK keyboard events using timeouts" );
336 /* Sleep to avoid using all CPU - since some interfaces needs to access
337 * keyboard events, a 1000ms delay is a good compromise */
338 if (vlc_CPU() & CPU_CAPABILITY_FPU)
339 i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, p_intf );
341 i_dummy = gtk_timeout_add( 1000, (GtkFunction)Manage, p_intf );
345 /* Remove the timeout */
346 gtk_timeout_remove( i_dummy );
349 gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
350 #ifdef NEED_GTK2_MAIN
355 /*****************************************************************************
356 * GtkAutoplayFile: Autoplay file depending on configuration settings
357 *****************************************************************************/
358 void GtkAutoPlayFile( vlc_object_t *p_this )
360 GtkWidget *cbautoplay;
361 intf_thread_t *p_intf;
363 vlc_list_t *p_list = vlc_list_find( p_this, VLC_OBJECT_INTF,
366 for( i_index = 0; i_index < p_list->i_count; i_index++ )
368 p_intf = (intf_thread_t *)p_list->p_values[i_index].p_object ;
370 if( strcmp( MODULE_STRING, module_GetObjName(p_intf->p_module) ) )
374 cbautoplay = GTK_WIDGET( gtk_object_get_data(
375 GTK_OBJECT( p_intf->p_sys->p_window ),
378 if( !config_GetInt( p_this, "pda-autoplayfile" ) )
380 p_intf->p_sys->b_autoplayfile = VLC_FALSE;
384 p_intf->p_sys->b_autoplayfile = VLC_TRUE;
386 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( cbautoplay ),
387 p_intf->p_sys->b_autoplayfile );
389 vlc_list_release( p_list );
392 /* following functions are local */
394 /*****************************************************************************
395 * Manage: manage main thread messages
396 *****************************************************************************
397 * In this function, called approx. 10 times a second, we check what the
398 * main program wanted to tell us.
399 *****************************************************************************/
400 static int Manage( intf_thread_t *p_intf )
402 GtkListStore *p_liststore;
403 vlc_mutex_lock( &p_intf->change_lock );
405 /* Update the input */
406 if( p_intf->p_sys->p_input == NULL )
408 p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
411 else if( p_intf->p_sys->p_input->b_dead )
413 vlc_object_release( p_intf->p_sys->p_input );
414 p_intf->p_sys->p_input = NULL;
417 if( p_intf->p_sys->p_input )
419 input_thread_t *p_input = p_intf->p_sys->p_input;
420 int64_t i_time = 0, i_length = 0;
422 vlc_mutex_lock( &p_input->object_lock );
423 if( !p_input->b_die )
425 playlist_t *p_playlist;
427 E_(GtkModeManage)( p_intf );
428 p_intf->p_sys->b_playing = 1;
430 /* update playlist interface */
431 p_playlist = (playlist_t *) vlc_object_find(
432 p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
433 if (p_playlist != NULL)
435 p_liststore = gtk_list_store_new (3,
438 G_TYPE_UINT); /* Hidden index */
439 PlaylistRebuildListStore(p_intf, p_liststore, p_playlist);
440 gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
441 g_object_unref(p_liststore);
442 vlc_object_release( p_playlist );
445 /* Manage the slider */
446 i_time = var_GetTime( p_intf->p_sys->p_input, "time" );
447 i_length = var_GetTime( p_intf->p_sys->p_input, "length" );
449 if (vlc_CPU() & CPU_CAPABILITY_FPU)
451 /* Manage the slider for CPU_CAPABILITY_FPU hardware */
452 if( p_intf->p_sys->b_playing )
454 float newvalue = p_intf->p_sys->p_adj->value;
456 /* If the user hasn't touched the slider since the last time,
457 * then the input can safely change it */
458 if( newvalue == p_intf->p_sys->f_adj_oldvalue )
460 /* Update the value */
461 p_intf->p_sys->p_adj->value =
462 p_intf->p_sys->f_adj_oldvalue =
463 ( 100 * i_time ) / i_length;
464 g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
467 /* Otherwise, send message to the input if the user has
468 * finished dragging the slider */
469 else if( p_intf->p_sys->b_slider_free )
471 double f_pos = (double)newvalue / 100.0;
473 /* release the lock to be able to seek */
474 vlc_mutex_unlock( &p_input->object_lock );
475 var_SetFloat( p_input, "position", f_pos );
476 vlc_mutex_lock( &p_input->object_lock );
478 /* Update the old value */
479 p_intf->p_sys->f_adj_oldvalue = newvalue;
485 /* Manage the slider without CPU_CAPABILITY_FPU hardware */
486 if( p_intf->p_sys->b_playing )
488 off_t newvalue = p_intf->p_sys->p_adj->value;
490 /* If the user hasn't touched the slider since the last time,
491 * then the input can safely change it */
492 if( newvalue == p_intf->p_sys->i_adj_oldvalue )
494 /* Update the value */
495 p_intf->p_sys->p_adj->value =
496 p_intf->p_sys->i_adj_oldvalue =
497 ( 100 * i_time ) / i_length;
498 g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
501 /* Otherwise, send message to the input if the user has
502 * finished dragging the slider */
503 else if( p_intf->p_sys->b_slider_free )
505 double f_pos = (double)newvalue / 100.0;
507 /* release the lock to be able to seek */
508 vlc_mutex_unlock( &p_input->object_lock );
509 var_SetFloat( p_input, "position", f_pos );
510 vlc_mutex_lock( &p_input->object_lock );
512 /* Update the old value */
513 p_intf->p_sys->i_adj_oldvalue = newvalue;
518 vlc_mutex_unlock( &p_input->object_lock );
520 else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) )
522 E_(GtkModeManage)( p_intf );
523 p_intf->p_sys->b_playing = 0;
526 #ifndef NEED_GTK2_MAIN
527 if( intf_ShouldDie( p_intf ) )
529 vlc_mutex_unlock( &p_intf->change_lock );
531 /* Prepare to die, young Skywalker */
538 vlc_mutex_unlock( &p_intf->change_lock );
543 /*****************************************************************************
544 * GtkDisplayDate: display stream date
545 *****************************************************************************
546 * This function displays the current date related to the position in
547 * the stream. It is called whenever the slider changes its value.
548 * The lock has to be taken before you call the function.
549 *****************************************************************************/
550 void E_(GtkDisplayDate)( GtkAdjustment *p_adj, gpointer userdata )
552 intf_thread_t *p_intf;
554 p_intf = (intf_thread_t*) userdata;
558 if( p_intf->p_sys->p_input )
560 char psz_time[ MSTRTIME_MAX_SIZE ];
563 i_seconds = var_GetTime( p_intf->p_sys->p_input, "time" ) / I64C(1000000 );
564 secstotimestr( psz_time, i_seconds );
566 gtk_label_set_text( GTK_LABEL( p_intf->p_sys->p_slider_label ),
571 /*****************************************************************************
572 * GtkModeManage: actualize the aspect of the interface whenever the input
574 *****************************************************************************
575 * The lock has to be taken before you call the function.
576 *****************************************************************************/
577 gint E_(GtkModeManage)( intf_thread_t * p_intf )
579 GtkWidget * p_slider = NULL;
580 vlc_bool_t b_control;
582 if ( p_intf->p_sys->p_window == NULL )
583 msg_Err( p_intf, "Main widget not found" );
585 p_slider = lookup_widget( p_intf->p_sys->p_window, "timeSlider");
586 if (p_slider == NULL)
587 msg_Err( p_intf, "Slider widget not found" );
589 /* controls unavailable */
592 /* show the box related to current input mode */
593 if( p_intf->p_sys->p_input )
595 /* initialize and show slider for seekable streams */
597 gtk_widget_show( GTK_WIDGET( p_slider ) );
600 /* control buttons for free pace streams */
601 b_control = p_intf->p_sys->p_input->b_can_pace_control;
603 msg_Dbg( p_intf, "stream has changed, refreshing interface" );
606 /* set control items */
607 gtk_widget_set_sensitive( lookup_widget( p_intf->p_sys->p_window, "tbRewind"), b_control );
608 gtk_widget_set_sensitive( lookup_widget( p_intf->p_sys->p_window, "tbPause"), b_control );
609 gtk_widget_set_sensitive( lookup_widget( p_intf->p_sys->p_window, "tbForward"), b_control );