front_idill/extern/fajran-npTuioClient/src/plugin.h
changeset 30 45c889eae324
parent 29 fcf435874395
child 31 2c7fc855eba8
equal deleted inserted replaced
29:fcf435874395 30:45c889eae324
     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     Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
       
    20 */
       
    21 
       
    22 #ifndef PLUGIN_H
       
    23 #define PLUGIN_H
       
    24 
       
    25 #include "pluginbase.h"
       
    26 #include "client.h"
       
    27 
       
    28 #include <string>
       
    29 #include <map>
       
    30 
       
    31 extern NPBool      plugInitialized;
       
    32 
       
    33 class nsPluginInstance : public nsPluginInstanceBase
       
    34 {
       
    35 public:
       
    36     nsPluginInstance(nsPluginCreateData* );
       
    37     virtual ~nsPluginInstance();
       
    38 
       
    39     // We are required to implement these three methods.
       
    40     NPBool init(NPWindow *aWindow);
       
    41     NPBool isInitialized() { return plugInitialized; }
       
    42     void shut();
       
    43 
       
    44     NPError GetValue(NPPVariable variable, void *value);
       
    45     NPError SetWindow(NPWindow *aWindow);
       
    46 
       
    47     NPError NewStream(NPMIMEType type, NPStream *stream, NPBool seekable,
       
    48                       uint16 *stype);
       
    49     NPError DestroyStream(NPStream * stream, NPError reason);
       
    50 
       
    51     int32_t WriteReady(NPStream *stream);
       
    52     int32_t Write(NPStream *stream, int32_t offset, int32_t len, void *buffer);
       
    53 
       
    54     NPError WriteStatus(const char *msg) const;
       
    55 
       
    56     void event(TuioEventData);
       
    57 
       
    58 
       
    59 private:
       
    60     NPP         _instance;
       
    61 
       
    62     int         _port;
       
    63     std::string _callback;
       
    64 };
       
    65 
       
    66 // end of __PLUGIN_H__
       
    67 #endif
       
    68 
       
    69 // Local Variables:
       
    70 // mode: C++
       
    71 // End: