actor.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _CLUTTERMM_ACTOR_H
00004 #define _CLUTTERMM_ACTOR_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/object.h>
00027 #include <cluttermm/color.h>
00028 #include <cluttermm/scriptable.h>
00029 #include <clutter/clutter-event.h> //For Clutter*Event
00030  
00031 
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _ClutterActor ClutterActor;
00034 typedef struct _ClutterActorClass ClutterActorClass;
00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00036 
00037 
00038 namespace Clutter
00039 { class Actor_Class; } // namespace Clutter
00040 namespace Clutter
00041 {
00042 
00043 typedef ClutterEvent Event;
00044 typedef ClutterButtonEvent ButtonEvent;
00045 typedef ClutterKeyEvent KeyEvent;
00046 typedef ClutterMotionEvent MotionEvent;
00047 typedef ClutterScrollEvent ScrollEvent;
00048 typedef ClutterCrossingEvent CrossingEvent;
00049 
00050 
00051 class Actor : public Glib::Object, public Scriptable
00052 {
00053   
00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00055 
00056 public:
00057   typedef Actor CppObjectType;
00058   typedef Actor_Class CppClassType;
00059   typedef ClutterActor BaseObjectType;
00060   typedef ClutterActorClass BaseClassType;
00061 
00062 private:  friend class Actor_Class;
00063   static CppClassType actor_class_;
00064 
00065 private:
00066   // noncopyable
00067   Actor(const Actor&);
00068   Actor& operator=(const Actor&);
00069 
00070 protected:
00071   explicit Actor(const Glib::ConstructParams& construct_params);
00072   explicit Actor(ClutterActor* castitem);
00073 
00074 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00075 
00076 public:
00077   virtual ~Actor();
00078 
00079 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00080   static GType get_type()      G_GNUC_CONST;
00081   static GType get_base_type() G_GNUC_CONST;
00082 #endif
00083 
00085   ClutterActor*       gobj()       { return reinterpret_cast<ClutterActor*>(gobject_); }
00086 
00088   const ClutterActor* gobj() const { return reinterpret_cast<ClutterActor*>(gobject_); }
00089 
00091   ClutterActor* gobj_copy();
00092 
00093 private:
00094 
00095   
00096 protected:
00097   Actor();
00098 
00099 public:
00100   //There is no create() because this is an abstract base class.
00101   //_WRAP_CREATE()
00102   
00103   
00107   void show();
00108   
00113   void show_all();
00114   
00118   void hide();
00119   
00124   void hide_all();
00125   
00129   void realize();
00130   
00134   void unrealize();
00135   
00141   void paint();
00142   
00150   void queue_redraw();
00151 
00152   //TODO: Check that we don't want to wrap this: _WRAP_METHOD(void destroy(), clutter_actor_destroy)
00153 
00154   //TODO: If these are output parameters, then they probably need to be hand-coded:
00155   //TODO: _WRAP_METHOD(void request_coords(const Glib::RefPtr<ActorBox>& box), clutter_actor_request_coords)
00156   //TODO: _WRAP_METHOD(void query_coords(const Glib::RefPtr<ActorBox>& box), clutter_actor_query_coords)
00157   
00162   void set_geometry(const ClutterGeometry *geometry);
00163   
00168   void get_geometry(ClutterGeometry *geometry);
00169   
00177   void get_coords(int *x_1, int *y_1, int *x_2, int *y_2) const;
00178   
00184   void set_size(int width, int height);
00185   
00193   void set_sizeu(Unit width, Unit height);
00194   
00201   void get_position(int& x, int& y);
00202   
00209   void get_positionu(Unit& x, Unit& y);
00210   
00216   void set_position(int x, int y);
00217   
00225   void set_positionu(Unit x, Unit y);
00226   
00232   void get_abs_position(int& x, int& y) const;
00233   
00237   guint get_width() const;
00238   
00244   Unit get_widthu() const;
00245   
00249   guint get_height() const;
00250   
00256   Unit get_heightu() const;
00257   
00263   void set_width(guint width);
00264   
00270   void set_widthu(Unit width);
00271   
00277   void set_height(guint height);
00278   
00284   void set_heightu(Unit height);
00285 
00286   
00292   void set_x(int x);
00293   
00299   void set_xu(Unit x);
00300   
00305   int get_x() const;
00306   
00313   Unit get_xu() const;
00314   
00320   void set_y(int y);
00321   
00327   void set_yu(Unit y);
00328   
00333   int get_y() const;
00334   
00339   Unit get_yu() const;
00340   
00346   void set_reactive(bool reactive = true);
00347   
00353   bool get_reactive() const;
00354 
00355   
00376   void set_rotation(RotateAxis axis, double angle, int x, int y, int z);
00377   
00389   void set_rotationx(RotateAxis axis, Fixed angle, int x, int y, int z);
00390   
00404   double get_rotation(RotateAxis axis, int& x, int& y, int& z) const;
00405   
00418   Fixed get_rotationx(RotateAxis axis, int& x, int& y, int& z) const;
00419   
00424   void set_opacity (guint8 opacity);
00425   
00429   guint8 get_opacity() const;
00430   
00434   void set_name(const gchar           *name);
00435   
00441   Glib::ustring get_name() const;
00442   
00448   guint32 get_gid() const;
00449   
00458   void set_clip(int xoff, int yoff, int width, int height);
00459   
00468   void get_clip(int& xoff, int& yoff, int& width, int& height);
00469   
00482   void set_clipu(Unit xoff, Unit yoff, Unit width, Unit height);
00483   
00494   void get_clipu(Unit& xoff, Unit& yoff, Unit& width, Unit& height);
00495   
00498   void remove_clip();
00499   
00505   bool has_clip() const;
00506   
00514   void set_parent(const Glib::RefPtr<Actor>& parent);
00515   
00519   Glib::RefPtr<Actor> get_parent();
00520   
00524   Glib::RefPtr<const Actor> get_parent() const;
00525   
00533   void reparent(const Glib::RefPtr<Actor>& new_parent);
00534   
00541   void unparent();
00542   
00547   void raise(const Glib::RefPtr<Actor>& below);
00548   
00553   void lower(const Glib::RefPtr<Actor>& above);
00554   
00557   void raise_top ();
00558   
00561   void lower_bottom();
00562   
00567   void set_depth(int depth);
00568   
00573   void set_depthu(Unit depth);
00574   
00578   int get_depth() const;
00579   
00585   Unit get_depthu() const;
00586   
00591   void set_scalex(Fixed scale_x, Fixed scale_y);
00592   
00599   void set_scale(double scale_x, double scale_y);
00600   
00607   void get_scalex(Fixed& scale_x, Fixed& scale_y) const;
00608   
00615   void get_scale(double& scale_x, double& scale_y) const;
00616 
00617   //TODO:: removed? _WRAP_METHOD(void set_scale_with_gravityx(Fixed scale_x, Fixed scale_y, ClutterGravity gravity), clutter_actor_set_scale_with_gravityx)
00618 
00619   //TODO:: removed? _WRAP_METHOD(void set_scale_with_gravity(float scale_x, float scale_y, ClutterGravity gravity), clutter_actor_set_scale_with_gravity)
00620 
00621   
00627   void get_abs_size(guint& width, guint& height) const;
00628   
00635   void get_size(guint& width, guint& height) const;
00636   
00644   void get_sizeu(Unit& width, Unit& height) const;
00645   
00653   void move_by(int dx, int dy);
00654   
00661   void move_byu(Unit dx, Unit dy);
00662 
00663   //TODO: _WRAP_METHOD(void get_vertices(ClutterVertex verts[4]) const, clutter_actor_get_vertices)
00664 
00665 //TODO: typedef (or wrap) ClutterVertex.
00666  
00667 
00676   void apply_transform_to_point(const ClutterVertex& point, ClutterVertex& vertex);
00677   
00700   void transform_stage_point(Unit x, Unit y, Unit& x_out, Unit& y_out);
00701 
00702 
00714   bool event(ClutterEvent* event, bool capture);
00715   //TODO: _WRAP_METHOD(Glib::RefPtr<Actor> clutter_get_actor_by_gid(guint32 id), clutter_get_actor_by_gid)
00716   //TODO: _WRAP_METHOD(Glib::RefPtr<const Actor> clutter_get_actor_by_gid(guint32 id) const, clutter_get_actor_by_gid, constversion)
00717 
00718   
00728   void set_anchor_point(int anchor_x, int anchor_y);
00729   
00736   void get_anchor_point(int& anchor_x, int& anchor_y) const;
00737   
00747   void set_anchor_pointu(Unit anchor_x, Unit anchor_y);
00748   
00755   void get_anchor_pointu(Unit& anchor_x, Unit& anchor_y);
00756   
00763   void set_anchor_point_from_gravity(ClutterGravity gravity);
00764 
00765 // signals
00766   
00772   Glib::SignalProxy1< bool,ButtonEvent* > signal_button_press_event();
00773 
00774   
00780   Glib::SignalProxy1< bool,ButtonEvent* > signal_button_release_event();
00781 
00782   
00788   Glib::SignalProxy1< bool,MotionEvent* > signal_motion_event();
00789 
00790   
00796   Glib::SignalProxy1< bool,CrossingEvent* > signal_leave_event();
00797 
00798   
00804   Glib::SignalProxy0< void > signal_show();
00805 
00806   
00812   Glib::SignalProxy0< void > signal_hide();
00813 
00814   
00820   Glib::SignalProxy0< void > signal_destroy();
00821 
00822   
00828   Glib::SignalProxy1< bool,KeyEvent* > signal_key_release_event();
00829 
00830   
00836   Glib::SignalProxy1< bool,CrossingEvent* > signal_enter_event();
00837 
00838   
00844   Glib::SignalProxy1< bool,Event* > signal_event();
00845 
00846   
00852   Glib::SignalProxy0< void > signal_focus_out();
00853 
00854   
00860   Glib::SignalProxy0< void > signal_focus_in();
00861 
00862   //TODO: _WRAP_SIGNAL(void parent_set(const Glib::RefPtr<Actor>& old_parent), "parent_set")
00863   
00869   Glib::SignalProxy1< bool,ScrollEvent* > signal_scroll_event();
00870 
00871   
00877   Glib::SignalProxy1< bool,KeyEvent* > signal_key_press_event();
00878 
00879   
00885   Glib::SignalProxy1< bool,Event* > signal_captured_event();
00886 
00887 
00888   protected:
00889   // according to the clutter docs, these functions should never be called
00890   // directly and are only for subclasses
00891   
00905   void pick(const Color& color);
00906   
00913   bool should_pick_paint() const;
00914 
00915 
00916 public:
00917 
00918 public:
00919   //C++ methods used to invoke GTK+ virtual functions:
00920 #ifdef GLIBMM_VFUNCS_ENABLED
00921 #endif //GLIBMM_VFUNCS_ENABLED
00922 
00923 protected:
00924   //GTK+ Virtual Functions (override these to change behaviour):
00925 #ifdef GLIBMM_VFUNCS_ENABLED
00926 #endif //GLIBMM_VFUNCS_ENABLED
00927 
00928   //Default Signal Handlers::
00929 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00930   virtual bool on_button_press_event(ButtonEvent* event);
00931   virtual bool on_button_release_event(ButtonEvent* event);
00932   virtual bool on_motion_event(MotionEvent* event);
00933   virtual bool on_leave_event(CrossingEvent* event);
00934   virtual void on_show();
00935   virtual void on_hide();
00936   virtual void on_destroy();
00937   virtual bool on_key_release_event(KeyEvent* event);
00938   virtual bool on_enter_event(CrossingEvent* event);
00939   virtual bool on_event(Event* event);
00940   virtual void on_focus_out();
00941   virtual void on_focus_in();
00942   virtual bool on_scroll_event(ScrollEvent* event);
00943   virtual bool on_key_press_event(KeyEvent* event);
00944   virtual bool on_captured_event(Event* event);
00945 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00946 
00947 
00948 };
00949 
00950 } // namespace Clutter
00951 
00952 
00953 namespace Glib
00954 {
00963   Glib::RefPtr<Clutter::Actor> wrap(ClutterActor* object, bool take_copy = false);
00964 }
00965 
00966 
00967 #endif /* _CLUTTERMM_ACTOR_H */
00968 

Generated on Fri Jun 6 02:18:31 2008 for cluttermm by  doxygen 1.5.5