front_idill/extern/fajran-npTuioClient/src/plugin.h
changeset 21 e4e5f02787a1
child 28 9ccef81f02ab
equal deleted inserted replaced
20:f4303074311f 21:e4e5f02787a1
       
     1 // 
       
     2 //   Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
       
     3 // 
       
     4 // This program is free software; you can redistribute it and/or modify
       
     5 // it under the terms of the GNU General Public License as published by
       
     6 // the Free Software Foundation; either version 3 of the License, or
       
     7 // (at your option) any later version.
       
     8 // 
       
     9 // This program is distributed in the hope that it will be useful,
       
    10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 // GNU General Public License for more details.
       
    13 // 
       
    14 // You should have received a copy of the GNU General Public License
       
    15 // along with this program; if not, write to the Free Software
       
    16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    17 
       
    18 
       
    19 #ifndef PLUGIN_H
       
    20 #define PLUGIN_H
       
    21 
       
    22 #include "pluginbase.h"
       
    23 #include "client.h"
       
    24 
       
    25 #include <string>
       
    26 #include <map>
       
    27 
       
    28 extern NPBool      plugInitialized;
       
    29 
       
    30 class nsPluginInstance : public nsPluginInstanceBase
       
    31 {
       
    32 public:
       
    33     nsPluginInstance(nsPluginCreateData* );
       
    34     virtual ~nsPluginInstance();
       
    35 
       
    36     // We are required to implement these three methods.
       
    37     NPBool init(NPWindow *aWindow);
       
    38     NPBool isInitialized() { return plugInitialized; }
       
    39     void shut();
       
    40 
       
    41     NPError GetValue(NPPVariable variable, void *value);
       
    42     NPError SetWindow(NPWindow *aWindow);
       
    43 
       
    44     NPError NewStream(NPMIMEType type, NPStream *stream, NPBool seekable,
       
    45                       uint16 *stype);
       
    46     NPError DestroyStream(NPStream * stream, NPError reason);
       
    47 
       
    48     int32_t WriteReady(NPStream *stream);
       
    49     int32_t Write(NPStream *stream, int32_t offset, int32_t len, void *buffer);
       
    50 
       
    51     NPError WriteStatus(const char *msg) const;
       
    52 
       
    53 	void event(TuioEventData);
       
    54 
       
    55 
       
    56 private:
       
    57     NPP         _instance;
       
    58 
       
    59 	int         _port;
       
    60 	std::string _callback;
       
    61 };
       
    62 
       
    63 // end of __PLUGIN_H__
       
    64 #endif
       
    65 
       
    66 // Local Variables:
       
    67 // mode: C++
       
    68 // End: