[Toxine-cvs] CVS: toxine/src/plugins vo_aa.c,1.1.1.1,1.2 vo_dxr3.c,1.1.1.1,1.2 vo_plugin.h,1.1.1.1,1
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2002-06-21 08:57:29
|
Update of /cvsroot/toxine/toxine/src/plugins In directory usw-pr-cvs1:/tmp/cvs-serv20351/src/plugins Modified Files: vo_aa.c vo_dxr3.c vo_plugin.h vo_x11.c Log Message: Add get/set video fullscreen. Index: vo_aa.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_aa.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- vo_aa.c 13 May 2002 20:46:45 -0000 1.1.1.1 +++ vo_aa.c 21 Jun 2002 08:57:25 -0000 1.2 @@ -139,6 +139,19 @@ return "Video out plugin supporting AsciiArt driver.\n"; } +/* + * + */ +static int is_fullscreen(toxine_t *tox, toxine_vo_plugin_t *vop) { + return 0; +} + +/* + * + */ +static void fullscreen(toxine_t *tox, toxine_vo_plugin_t *vop) { +} + toxine_vo_plugin_t *toxine_load_vo_plugin(toxine_t *tox) { toxine_vo_plugin_t *aa; aa_private_t *private; @@ -156,7 +169,10 @@ aa->get_property_min_max = get_property_min_max; aa->set_property = set_property; aa->get_help = get_help; + aa->is_fullscreen = is_fullscreen; + aa->fullscreen = fullscreen; aa->private = (void *) private; return aa; } + Index: vo_dxr3.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_dxr3.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- vo_dxr3.c 13 May 2002 20:46:45 -0000 1.1.1.1 +++ vo_dxr3.c 21 Jun 2002 08:57:25 -0000 1.2 @@ -125,6 +125,13 @@ return "Video out plugin supporting dxr3/hw+ cards.\n"; } +static int is_fullscreen(toxine_t *tox, toxine_vo_plugin_t *vop) { + return 0; +} + +static void fullscreen(toxine_t *tox, toxine_vo_plugin_t *vop) { +} + toxine_vo_plugin_t *toxine_load_vo_plugin(toxine_t *tox) { toxine_vo_plugin_t *dxr3; dxr3_private_t *private; @@ -142,6 +149,8 @@ dxr3->get_property_min_max = get_property_min_max; dxr3->set_property = set_property; dxr3->get_help = get_help; + dxr3->is_fullscreen = is_fullscreen; + dxr3->fullscreen = fullscreen; dxr3->private = (void *) private; return dxr3; Index: vo_plugin.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_plugin.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- vo_plugin.h 13 May 2002 20:46:45 -0000 1.1.1.1 +++ vo_plugin.h 21 Jun 2002 08:57:25 -0000 1.2 @@ -37,6 +37,8 @@ void (*get_property_min_max)(toxine_t *, int property, int *min, int *max); int (*set_property)(toxine_t *, int property, int value); char *(*get_help)(void); + int (*is_fullscreen)(toxine_t *, toxine_vo_plugin_t *); + void (*fullscreen)(toxine_t *, toxine_vo_plugin_t *); void *private; }; Index: vo_x11.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_x11.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- vo_x11.c 3 Jun 2002 14:53:18 -0000 1.2 +++ vo_x11.c 21 Jun 2002 08:57:25 -0000 1.3 @@ -145,6 +145,24 @@ }; /* + * + */ +static void toggle_fullscreen(toxine_t *tox) { + x11_private_t *private = (x11_private_t *) tox->video.cur_plugin->private; + + XLockDisplay(private->display); + XUnmapWindow(private->display, private->x11_drawable[private->fullscreen].video_window); + private->fullscreen = !private->fullscreen; + XMapRaised(private->display, private->x11_drawable[private->fullscreen].video_window); + XUnlockDisplay(private->display); + + if(tox->video.driver) + tox->video.driver->gui_data_exchange (tox->video.driver, + GUI_DATA_EX_DRAWABLE_CHANGED, + (void*)private->x11_drawable[private->fullscreen].video_window); +} + +/* * Update cursor apparence, reflected by cursor.visible value. */ static void update_cursor_visibility(toxine_t *tox) { @@ -770,16 +788,7 @@ /* Fullscreen toggle */ case XK_f: case XK_F: - XLockDisplay(private->display); - XUnmapWindow(private->display, private->x11_drawable[private->fullscreen].video_window); - private->fullscreen = !private->fullscreen; - XMapRaised(private->display, private->x11_drawable[private->fullscreen].video_window); - XUnlockDisplay(private->display); - - if(tox->video.driver) - tox->video.driver->gui_data_exchange (tox->video.driver, - GUI_DATA_EX_DRAWABLE_CHANGED, - (void*)private->x11_drawable[private->fullscreen].video_window); + toggle_fullscreen(tox); break; } @@ -1002,6 +1011,21 @@ /* * */ +static int is_fullscreen(toxine_t *tox, toxine_vo_plugin_t *vop) { + x11_private_t *private = (x11_private_t *) vop->private; + return (private->fullscreen ? 1 : 0); +} + +/* + * + */ +static void fullscreen(toxine_t *tox, toxine_vo_plugin_t *vop) { + toggle_fullscreen(tox); +} + +/* + * + */ toxine_vo_plugin_t *toxine_load_vo_plugin(toxine_t *tox) { toxine_vo_plugin_t *x11; x11_private_t *private; @@ -1019,6 +1043,8 @@ x11->get_property_min_max = get_property_min_max; x11->set_property = set_property; x11->get_help = get_help; + x11->is_fullscreen = is_fullscreen; + x11->fullscreen = fullscreen; x11->private = (void *) private; return x11; |