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
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/
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
15
* The Original Code is mozilla.org code.
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.
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.
36
* ***** END LICENSE BLOCK ***** */
41
#include <npruntime.h>
42
#include <npfunctions.h>
44
#include <dbus/dbus.h>
45
#include <dbus/dbus-glib-lowlevel.h>
50
#include <gconf/gconf.h>
51
#include <gconf/gconf-client.h>
52
#include <gconf/gconf-value.h>
56
#include <glib/gstdio.h>
57
#include <glib/gi18n.h>
58
#include "plugin_list.h"
63
#include "libgmlib/gmlib.h"
65
// JavaScript Playstates
66
#define STATE_UNDEFINED 0
67
#define STATE_STOPPED 1
68
#define STATE_PAUSED 2
69
#define STATE_PLAYING 3
70
#define STATE_SCANFORWARD 4
71
#define STATE_SCANREVERSE 5
72
#define STATE_BUFFERING 6
73
#define STATE_WAITING 7
74
#define STATE_MEDIAENDED 8
75
#define STATE_TRANSITIONING 9
76
#define STATE_READY 10
77
#define STATE_RECONNECTING 11
79
// config settings stored in gconf
80
#define CACHE_SIZE "cache_size"
81
#define DISABLE_QT "disable_qt"
82
#define DISABLE_REAL "disable_real"
83
#define DISABLE_WMP "disable_wmp"
84
#define DISABLE_DVX "disable_dvx"
85
#define DEBUG_LEVEL "debug_level"
86
#define DISABLE_MIDI "disable_midi"
87
#define PLAYER_BACKEND "player_backend"
96
void postDOMEvent(NPP mInstance, const gchar * id, const gchar * event);
101
NPStream *m_pNPStream;
103
NPObject *m_pScriptableObject;
104
NPObject *m_pScriptableObjectControls;
107
CPlugin(NPP pNPInstance);
110
NPBool init(NPWindow * aWindow);
112
NPBool isInitialized();
113
int16_t handleEvent(void *event);
115
NPObject *GetScriptableObject();
116
NPObject *GetScriptableObjectControls();
118
NPError GetValue(NPPVariable variable, void *value);
119
NPError SetWindow(NPWindow * aWindow);
120
NPError NewStream(NPMIMEType type, NPStream * stream, NPBool seekable, uint16_t * stype);
121
NPError DestroyStream(NPStream * stream, NPError reason);
122
void URLNotify(const char *url, NPReason reason, void *notifyData);
123
int32_t WriteReady(NPStream * stream);
124
int32_t Write(NPStream * stream, int32_t offset, int32_t len, void *buffer);
134
void Seek(double counter);
135
void SetShowControls(bool value);
136
void SetFullScreen(bool value);
137
void SetVolume(double value);
138
void GetVolume(double *_retval);
139
void GetFullScreen(bool * _retval);
140
void GetShowControls(bool * _retval);
141
void GetTime(double *_retval);
142
void GetDuration(double *_retval);
143
void GetPercent(double *_retval);
144
void GetPlayState(int32_t * playstate);
145
void SetFilename(const char *filename);
146
void GetFilename(char **filename);
147
void GetMIMEType(char **_retval);
148
void GetLoop(bool * _retval);
149
void SetLoop(bool value);
150
void SetOnClick(const char *event);
151
void SetOnMediaComplete(const char *event);
152
void SetOnMouseUp(const char *event);
153
void SetOnMouseDown(const char *event);
154
void SetOnMouseOut(const char *event);
155
void SetOnMouseOver(const char *event);
156
void SetOnDestroy(const char *event);
161
gint mWidth, mHeight;
174
gboolean player_launched;
175
gboolean playerready;
176
DBusConnection *connection;
177
GThread *dbus_dispatch;
178
ListItem *lastopened;
185
gboolean disable_context_menu;
186
gboolean disable_fullscreen;
194
gchar *player_backend;
197
gboolean post_dom_events;
198
gchar *event_mediacomplete;
199
gchar *event_destroy;
200
gchar *event_mousedown;
201
gchar *event_mouseup;
202
gchar *event_mouseclicked;
203
gchar *event_enterwindow;
204
gchar *event_leavewindow;
219
void pluginSpecific(CPlugin * instance);
220
void setPreference(CPlugin * instance, const gchar * name, const gchar * value);
222
#endif // __PLUGIN_H__