~ubuntu-branches/ubuntu/quantal/gecko-mediaplayer/quantal

« back to all changes in this revision

Viewing changes to .pc/dont_use_libxul.patch/src/plugin_types_qt.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2011-07-17 22:24:37 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20110717222437-f0skmzay316o4rve
Tags: 1.0.4-0ubuntu1
* New upstream release.
* debian/patches:
 - 90_svn420_fix_null.patch: Remove, merged upstream.
 - 91_svn421_disable_npp_initialize.patch: Remove, merged upstream.
 - dont_use_libxul.patch: Remove, fixed upstream.
 - autotools.patch: Remove, not needed now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
 
/* ***** BEGIN LICENSE BLOCK *****
3
 
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
 
 *
5
 
 * The contents of this file are subject to the Mozilla Public License Version
6
 
 * 1.1 (the "License"); you may not use this file except in compliance with
7
 
 * the License. You may obtain a copy of the License at
8
 
 * http://www.mozilla.org/MPL/
9
 
 *
10
 
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 
 * for the specific language governing rights and limitations under the
13
 
 * License.
14
 
 *
15
 
 * The Original Code is mozilla.org code.
16
 
 *
17
 
 * The Initial Developer of the Original Code is
18
 
 * Netscape Communications Corporation.
19
 
 * Portions created by the Initial Developer are Copyright (C) 1998
20
 
 * the Initial Developer. All Rights Reserved.
21
 
 *
22
 
 * Contributor(s):
23
 
 *
24
 
 * Alternatively, the contents of this file may be used under the terms of
25
 
 * either the GNU General Public License Version 2 or later (the "GPL"), or
26
 
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
 
 * in which case the provisions of the GPL or the LGPL are applicable instead
28
 
 * of those above. If you wish to allow use of your version of this file only
29
 
 * under the terms of either the GPL or the LGPL, and not to allow others to
30
 
 * use your version of this file under the terms of the MPL, indicate your
31
 
 * decision by deleting the provisions above and replace them with the notice
32
 
 * and other provisions required by the GPL or the LGPL. If you do not delete
33
 
 * the provisions above, a recipient may use your version of this file under
34
 
 * the terms of any one of the MPL, the GPL or the LGPL.
35
 
 *
36
 
 * ***** END LICENSE BLOCK ***** */
37
 
 
38
 
#include "plugin_types.h"
39
 
 
40
 
gchar *GetMIMEDescription()
41
 
{
42
 
    gchar MimeTypes[4000];
43
 
    GmPrefStore *store;
44
 
    gboolean qt_disabled = FALSE;
45
 
 
46
 
    g_type_init();
47
 
    store = gm_pref_store_new("gecko-mediaplayer");
48
 
    if (store != NULL) {
49
 
        qt_disabled = gm_pref_store_get_boolean(store, DISABLE_QT);
50
 
        gm_pref_store_free(store);
51
 
    }
52
 
 
53
 
    if (qt_disabled) {
54
 
        return NULL;
55
 
    } else {
56
 
        g_strlcpy(MimeTypes,
57
 
                  "video/quicktime:mov:Quicktime;"
58
 
                  "video/x-quicktime:mov:Quicktime;"
59
 
                  "image/x-quicktime:mov:Quicktime;"
60
 
                  "video/quicktime:mp4:Quicktime;"
61
 
                  "video/quicktime:sdp:Quicktime - Session Description Protocol;"
62
 
                  "application/x-quicktimeplayer:mov:Quicktime;", sizeof(MimeTypes));
63
 
 
64
 
        return g_strdup(MimeTypes);
65
 
    }
66
 
}
67
 
 
68
 
NPError PluginGetValue(NPPVariable variable, void *value)
69
 
{
70
 
    NPError err = NPERR_NO_ERROR;
71
 
 
72
 
    // some sites use this description to figure out what formats can be played. So we have to make sure the 
73
 
    // description matches the features
74
 
 
75
 
    if (variable == NPPVpluginNameString) {
76
 
        *((const char **) value) = "QuickTime Plug-in 7.6.4";
77
 
    }
78
 
    if (variable == NPPVpluginDescriptionString) {
79
 
        *((const char **) value) =
80
 
            "<a href=\"http://kdekorte.googlepages.com/gecko-mediaplayer\">Gecko Media Player</a> "
81
 
            VERSION
82
 
            "<br><br>Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using <a href=\"http://mplayerhq.hu\">MPlayer</a>";
83
 
 
84
 
    }
85
 
 
86
 
    if (variable == NPPVpluginNeedsXEmbed) {
87
 
        *((bool *) value) = TRUE;
88
 
    }
89
 
 
90
 
    if ((variable != NPPVpluginNameString)
91
 
        && (variable != NPPVpluginDescriptionString)
92
 
        && (variable != NPPVpluginNeedsXEmbed)) {
93
 
        err = NPERR_INVALID_PARAM;
94
 
    }
95
 
 
96
 
    return err;
97
 
 
98
 
 
99
 
}
100
 
 
101
 
void pluginSpecific(CPlugin * instance)
102
 
{
103
 
    //printf("calling pluginSpecific for qt plugin\n");
104
 
    setPreference(instance, "general.useragent.override", "QuickTime/7.6.4");
105
 
}