]> git.sesse.net Git - vlc/blob - modules/gui/macosx/macosx.m
591614efc6f7745b34720da6c75000fd89b82a51
[vlc] / modules / gui / macosx / macosx.m
1 /*****************************************************************************
2  * macosx.m: Mac OS X module for vlc
3  *****************************************************************************
4  * Copyright (C) 2001-2011 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Colin Delacroix <colin@zoy.org>
8  *          Eugenio Jarosiewicz <ej0@cise.ufl.edu>
9  *          Florian G. Pflug <fgp@phlo.org>
10  *          Jon Lech Johansen <jon-vl@nanocrew.net>
11  *          Felix Paul Kühne <fkuehne at videolan dot org>
12  *
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
27  *****************************************************************************/
28
29 /*****************************************************************************
30  * Preamble
31  *****************************************************************************/
32 #include <stdlib.h>                                      /* malloc(), free() */
33 #include <string.h>
34
35 #ifdef HAVE_CONFIG_H
36 # include "config.h"
37 #endif
38
39 #include <vlc_common.h>
40 #include <vlc_plugin.h>
41 #include <vlc_vout_window.h>
42
43 /*****************************************************************************
44  * External prototypes
45  *****************************************************************************/
46 int  OpenIntf     ( vlc_object_t * );
47 void CloseIntf    ( vlc_object_t * );
48
49 int  WindowOpen   ( vout_window_t *, const vout_window_cfg_t * );
50 void WindowClose  ( vout_window_t * );
51
52 /*****************************************************************************
53  * Module descriptor
54  *****************************************************************************/
55 #define VDEV_TEXT N_("Video device")
56 #define VDEV_LONGTEXT N_("Number of the screen to use by default to display " \
57                          "videos in 'fullscreen'. The screen number correspondance can be found in "\
58                          "the video device selection menu.")
59
60 #define OPAQUENESS_TEXT N_("Opaqueness")
61 #define OPAQUENESS_LONGTEXT N_( "Set the transparency of the video output. 1 is non-transparent (default) " \
62                                 "0 is fully transparent.")
63
64 #define BLACK_TEXT N_("Black screens in fullscreen")
65 #define BLACK_LONGTEXT N_("In fullscreen mode, keep screen where there is no " \
66                           "video displayed black" )
67
68 #define FSPANEL_TEXT N_("Show Fullscreen controller")
69 #define FSPANEL_LONGTEXT N_("Shows a lucent controller when moving the mouse " \
70                             "in fullscreen mode.")
71
72 #define AUTOPLAY_OSX_TEST N_("Auto-playback of new items")
73 #define AUTOPLAY_OSX_LONGTEXT N_("Start playback of new items immediately " \
74                                  "once they were added." )
75
76 #define RECENT_ITEMS_TEXT N_("Keep Recent Items")
77 #define RECENT_ITEMS_LONGTEXT N_("By default, VLC keeps a list of the last 10 items. " \
78                                  "This feature can be disabled here.")
79
80 #define USE_APPLE_REMOTE_TEXT N_("Control playback with the Apple Remote")
81 #define USE_APPLE_REMOTE_LONGTEXT N_("By default, VLC can be remotely controlled with the Apple Remote.")
82
83 #define USE_MEDIAKEYS_TEXT N_("Control playback with media keys")
84 #define USE_MEDIAKEYS_LONGTEXT N_("By default, VLC can be controlled using the media keys on modern Apple " \
85                                   "keyboards.")
86
87 #define INTERFACE_STYLE_TEXT N_("Run VLC with dark or bright interface style")
88 #define INTERFACE_STYLE_LONGTEXT N_("By default, VLC will use the dark interface style.")
89
90 #define NATIVE_FULLSCREEN_MODE_ON_LION_TEXT N_("Use the native fullscreen mode on OS X Lion")
91 #define NATIVE_FULLSCREEN_MODE_ON_LION_LONGTEXT N_("By default, VLC uses the native fullscreen mode on Mac OS X 10.7 and later. It can also use the custom mode known from previous Mac OS X releases.")
92
93 vlc_module_begin ()
94     set_description( N_("Mac OS X interface") )
95     set_capability( "interface", 200 )
96     set_callbacks( OpenIntf, CloseIntf )
97     set_category( CAT_INTERFACE )
98     set_subcategory( SUBCAT_INTERFACE_MAIN )
99     cannot_unload_broken_library( )
100     add_bool( "macosx-autoplay", true, AUTOPLAY_OSX_TEST, AUTOPLAY_OSX_LONGTEXT,
101               false )
102     add_bool( "macosx-recentitems", true, RECENT_ITEMS_TEXT, RECENT_ITEMS_LONGTEXT,
103               false )
104     add_bool( "macosx-fspanel", true, FSPANEL_TEXT, FSPANEL_LONGTEXT,
105               false )
106     add_bool( "macosx-appleremote", true, USE_APPLE_REMOTE_TEXT, USE_APPLE_REMOTE_LONGTEXT,
107              false )
108     add_bool( "macosx-mediakeys", true, USE_MEDIAKEYS_TEXT, USE_MEDIAKEYS_LONGTEXT,
109              false )
110     add_bool( "macosx-interfacestyle", true, INTERFACE_STYLE_TEXT, INTERFACE_STYLE_LONGTEXT,
111              false )
112     add_bool( "macosx-nativefullscreenmode", true, NATIVE_FULLSCREEN_MODE_ON_LION_TEXT, NATIVE_FULLSCREEN_MODE_ON_LION_LONGTEXT, false )
113     add_obsolete_bool( "macosx-stretch" ) /* since 1.2.0 */
114     add_obsolete_bool( "macosx-background" ) /* since 1.2.0 */
115     add_obsolete_bool( "macosx-eq-keep" ) /* since 1.2.0 */
116
117     add_submodule ()
118         set_description( "Mac OS X Video Output Provider" )
119         set_capability( "vout window nsobject", 100 )
120         set_callbacks( WindowOpen, WindowClose )
121
122         add_integer( "macosx-vdev", 0, VDEV_TEXT, VDEV_LONGTEXT,
123                      false )
124         add_float_with_range( "macosx-opaqueness", 1, 0, 1,
125                               OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, true );
126         add_bool( "macosx-black", true, BLACK_TEXT, BLACK_LONGTEXT,
127                   false )
128 vlc_module_end ()
129