1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Netscape Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/NPL/
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 NPL, 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 NPL, the GPL or the LGPL.
36
* ***** END LICENSE BLOCK ***** */
40
#define _XOPEN_SOURCE 500
45
#ifdef GECKOSDK_ENABLED
46
#include "mozilla-config.h"
48
#include "pluginbase.h"
49
#include "nsScriptablePeer.h"
50
#include "plugin-setup.h"
52
#include <sys/types.h>
55
class nsPluginInstance:public nsPluginInstanceBase {
57
nsPluginInstance(NPP aInstance);
58
virtual ~ nsPluginInstance();
60
NPBool init(NPWindow * aWindow);
62
NPBool isInitialized();
63
NPError NewStream(NPMIMEType type, NPStream * stream, NPBool seekable,
65
NPError SetWindow(NPWindow * aWindow);
66
NPError DestroyStream(NPStream * stream, NPError reason);
67
int32 WriteReady(NPStream * stream);
68
int32 Write(NPStream * stream, int32 offset, int32 len, void *buffer);
77
void Seek(double counter);
78
void GetPlayState(PRInt32 * playstate);
79
void GetTime(double *_retval);
80
void GetDuration(double *_retval);
81
void GetPercent(double *_retval);
82
void GetFilename(char * *filename);
83
void SetFilename(const char *filename);
84
void GetShowControls(PRBool *_retval);
85
void SetShowControls(PRBool value);
86
void GetFullscreen(PRBool *_retval);
87
void SetFullscreen(PRBool value);
88
void GetShowlogo(PRBool *_retval);
89
void SetShowlogo(PRBool value);
91
// we need to provide implementation of this method as it will be
92
// used by Mozilla to retrive the scriptable peer
93
// and couple of other things on Unix
94
NPError GetValue(NPPVariable variable, void *value);
96
nsScriptablePeer *getScriptablePeer();
97
nsControlsScriptablePeer *getControlsScriptablePeer();
102
nsScriptablePeer *mScriptablePeer;
103
nsControlsScriptablePeer *mControlsScriptablePeer;
105
// put member data here
114
uint32 window_height;
139
Window player_window;
147
char *mediaCompleteCallback;
148
float mediaLength; // length of media in seconds
149
int mediaPercent; // percentage of media played
150
float mediaTime; // time in seconds
158
GtkWidget *gtkwidget;
160
GtkWidget *fixed_container;
161
GtkProgressBar *progress_bar;
162
GtkProgressBar *mediaprogress_bar;
164
GtkWidget *drawing_area;
166
GtkWidget *play_event_box;
167
GtkWidget *pause_event_box;
168
GtkWidget *stop_event_box;
169
GtkWidget *ff_event_box;
170
GtkWidget *rew_event_box;
171
GtkWidget *fs_event_box;
173
GtkWidget *image_play;
174
GtkWidget *image_pause;
175
GtkWidget *image_stop;
177
GtkWidget *image_rew;
181
GtkMenuItem *menuitem_play;
182
GtkMenuItem *menuitem_pause;
183
GtkMenuItem *menuitem_stop;
184
GtkMenuItem *menuitem_sep1;
185
GtkMenuItem *menuitem_sep2;
186
GtkMenuItem *menuitem_showcontrols;
187
GtkMenuItem *menuitem_fullscreen;
188
GtkMenuItem *menuitem_save;
192
pthread_t player_thread;
193
pthread_attr_t thread_attr;
194
pthread_cond_t playlist_complete_cond;
195
pthread_mutex_t playlist_mutex;
196
pthread_mutex_t playlist_cond_mutex;
197
pthread_mutex_t control_mutex;
200
// Pixbufs - GTK1 does not use Pixbufs
204
GdkPixbuf *pb_sm_play_up;
205
GdkPixbuf *pb_sm_play_down;
206
GdkPixbuf *pb_sm_pause_up;
207
GdkPixbuf *pb_sm_pause_down;
208
GdkPixbuf *pb_sm_stop_up;
209
GdkPixbuf *pb_sm_stop_down;
210
GdkPixbuf *pb_sm_ff_up;
211
GdkPixbuf *pb_sm_ff_down;
212
GdkPixbuf *pb_sm_rew_up;
213
GdkPixbuf *pb_sm_rew_down;
214
GdkPixbuf *pb_sm_fs_up;
215
GdkPixbuf *pb_sm_fs_down;
222
GdkPixmap *pb_sm_play_up;
223
GdkPixmap *pb_sm_play_down;
224
GdkPixmap *pb_sm_pause_up;
225
GdkPixmap *pb_sm_pause_down;
226
GdkPixmap *pb_sm_stop_up;
227
GdkPixmap *pb_sm_stop_down;
228
GdkPixmap *pb_sm_ff_up;
229
GdkPixmap *pb_sm_ff_down;
230
GdkPixmap *pb_sm_rew_up;
231
GdkPixmap *pb_sm_rew_down;
232
GdkPixmap *pb_sm_fs_up;
233
GdkPixmap *pb_sm_fs_down;
243
Pixmap progress_left;
244
Pixmap progress_leftmask;
245
Pixmap progress_middle;
246
Pixmap progress_middlemask;
247
Pixmap progress_right;
248
Pixmap progress_rightmask;
249
Pixmap progress_fill;
250
Pixmap progress_fillmask;
267
char *output_display;
279
#endif // __PLUGIN_H__