/* Swfdec Mozilla Plugin
 * Copyright (C) 2006 Benjamin Otte <otte@gnome.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
 * Boston, MA  02110-1301  USA
 */

#ifndef _SWFMOZ_PLUGIN_H_
#define _SWFMOZ_PLUGIN_H_

#include <npapi.h>
#include <pthread.h>

typedef struct 
{
  void *window;
  NPObject *windowObj;
  int invoke_cnt;
  NPIdentifier *invoke_name;
  pthread_mutex_t mutex;
  pthread_cond_t cond;
  int childpid;
  int streamfd;
  int eventfd;
  int evretfd;		/* return (recv) */
  int externalfd;
  int exterretfd;	/* return (send) */
  FILE *fstream;
  char buffer[10240];
} PLUGIN_PDATA;

bool		plugin_get_value		(NPP		instance,
						 NPNVariable	var,
						 void * data);

void		plugin_get_url			(NPP		instance,
						 const char *	url,
						 const char *	target);
void		plugin_get_url_notify		(NPP		instance,
						 const char *	url,
						 const char *	target,
						 void *		data);
void		plugin_post_url			(NPP		instance,
						 const char *	url,
						 const char *	target,
						 const char *	data,
						 unsigned int	data_len);
void		plugin_post_url_notify		(NPP		instance,
						 const char *	url,
						 const char *	target,
						 const char *	data,
						 unsigned int 	data_len,
						 void *		user_data);

void		plugin_destroy_stream		(NPP		instance,
						 NPStream *	stream);

void		plugin_invalidate_rect		(NPP		instance,
						 NPRect *	rect);

#endif
