scriptable.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _CLUTTERMM_SCRIPTABLE_H
00004 #define _CLUTTERMM_SCRIPTABLE_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* Copyright (C) 2007 The cluttermm Development Team
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free
00023  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #include <glibmm/interface.h>
00027 #include <glibmm/ustring.h>
00028 #include <cluttermm/script.h>
00029 #include <clutter/clutter-scriptable.h>
00030  
00031 
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _ClutterScriptable ClutterScriptable;
00034 typedef struct _ClutterScriptableClass ClutterScriptableClass;
00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00036 
00037 
00038 namespace Clutter
00039 { class Scriptable_Class; } // namespace Clutter
00040 namespace Clutter
00041 {
00042 
00043 
00044 class Scriptable : public Glib::Interface
00045 {
00046   
00047 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00048 
00049 public:
00050   typedef Scriptable CppObjectType;
00051   typedef Scriptable_Class CppClassType;
00052   typedef ClutterScriptable BaseObjectType;
00053   typedef ClutterScriptableIface BaseClassType;
00054 
00055 private:
00056   friend class Scriptable_Class;
00057   static CppClassType scriptable_class_;
00058 
00059   // noncopyable
00060   Scriptable(const Scriptable&);
00061   Scriptable& operator=(const Scriptable&);
00062 
00063 protected:
00064   Scriptable(); // you must derive from this class
00065 
00072   explicit Scriptable(const Glib::Interface_Class& interface_class);
00073 
00074 public:
00075   // This is public so that C++ wrapper instances can be
00076   // created for C instances of unwrapped types.
00077   // For instance, if an unexpected C type implements the C interface. 
00078   explicit Scriptable(ClutterScriptable* castitem);
00079 
00080 protected:
00081 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00082 
00083 public:
00084   virtual ~Scriptable();
00085 
00086   static void add_interface(GType gtype_implementer);
00087 
00088 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00089   static GType get_type()      G_GNUC_CONST;
00090   static GType get_base_type() G_GNUC_CONST;
00091 #endif
00092 
00094   ClutterScriptable*       gobj()       { return reinterpret_cast<ClutterScriptable*>(gobject_); }
00095 
00097   const ClutterScriptable* gobj() const { return reinterpret_cast<ClutterScriptable*>(gobject_); }
00098 
00099 private:
00100 
00101 
00102 public:
00103   
00114   void set_id(const std::string& id);
00115   
00122   std::string get_id() const;
00123 
00124   // TODO: Wrap glib-json?
00125   
00126 
00137   bool parse_custom_node(const Glib::RefPtr<Script>& script, Glib::ValueBase& value, const Glib::ustring& name, JsonNode* node);
00138   
00147   void set_custom_property(const Glib::RefPtr<Script>& script, const Glib::ustring& name, const Glib::ValueBase& value);
00148 
00149 protected:
00150 
00151   #ifdef GLIBMM_VFUNCS_ENABLED
00152   virtual void set_id_vfunc(const std::string& id);
00153 #endif //GLIBMM_VFUNCS_ENABLED
00154 
00155 
00156   // Note: We cannot return a std::string here since the C API expects a
00157   // const gchar* as return value. const gchar* however means that the returned
00158   // value is not supposed to be freed by the caller. If we would want to return
00159   // std::string here, what should we pass to the underlying C API then?
00160   // string.c_str() doesn't work since the string destroys the data upon
00161   // destruction (which means, we would effectively return an invalid pointer).
00162   // We also can't copy the string's content since we would leak that copy
00163   // otherwise.
00164   #ifdef GLIBMM_VFUNCS_ENABLED
00165   virtual const char* get_id_vfunc() const;
00166 #endif //GLIBMM_VFUNCS_ENABLED
00167 
00168 
00169   #ifdef GLIBMM_VFUNCS_ENABLED
00170   virtual void set_custom_property_vfunc(const Glib::RefPtr<Script>& script, const Glib::ustring& name, const Glib::ValueBase& value);
00171 #endif //GLIBMM_VFUNCS_ENABLED
00172 
00173 
00174   // TODO: parse_custom_node vfunc
00175 
00176 
00177 public:
00178 
00179 public:
00180   //C++ methods used to invoke GTK+ virtual functions:
00181 #ifdef GLIBMM_VFUNCS_ENABLED
00182 #endif //GLIBMM_VFUNCS_ENABLED
00183 
00184 protected:
00185   //GTK+ Virtual Functions (override these to change behaviour):
00186 #ifdef GLIBMM_VFUNCS_ENABLED
00187 #endif //GLIBMM_VFUNCS_ENABLED
00188 
00189   //Default Signal Handlers::
00190 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00191 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00192 
00193 
00194 };
00195 
00196 } // namespace Clutter
00197 //vim: ts=2,sw=2
00198 
00199 
00200 namespace Glib
00201 {
00210   Glib::RefPtr<Clutter::Scriptable> wrap(ClutterScriptable* object, bool take_copy = false);
00211 
00212 } // namespace Glib
00213 
00214 
00215 #endif /* _CLUTTERMM_SCRIPTABLE_H */
00216 

Generated on Mon Sep 15 05:42:28 2008 for cluttermm by  doxygen 1.5.6