handlebox.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PAPYRUSHANDLEBOX_H
00021 #define PAPYRUSHANDLEBOX_H
00022
00023 #include <papyrus/boxed.h>
00024
00025 namespace Papyrus
00026 {
00027
00031 class Handlebox : public Boxed
00032 {
00033 protected:
00034
00035 Handlebox ( const Glib::ustring& id, Handles handles );
00036
00037 public:
00038
00039 typedef PapyrusPointer<Handlebox> pointer;
00040
00041 static pointer create ( Handles handles=CORNER_HANDLES );
00042
00043 static pointer create ( const Glib::ustring& id, Handles handles=CORNER_HANDLES );
00044
00045 virtual ~Handlebox();
00046
00047 void set_handle_shape ( Position p, Drawable::pointer shape, bool activate=true );
00048
00049 void set_handle_shape ( Handles h, Drawable::pointer shape, bool activate=true );
00050
00051 Drawable::pointer get_handle_shape ( Position p );
00052
00053 void activate_handle ( Position p, bool activate=true );
00054
00055 void activate_handle ( Handles h, bool activate=true );
00056
00057 void deactivate_handle ( Position p );
00058
00059 void deactivate_handle ( Handles h );
00060
00061 bool is_active ( Position p );
00062
00063 bool is_active ( Handles h );
00064
00065 int inside_handle ( double x, double y );
00066
00067 PAPYRUS_CLASS_NAME ( "Handle Box" );
00068
00069 PAPYRUS_CLONE_METHOD ( Handlebox );
00070
00071 protected:
00072 Drawable::pointer m_handle_shape[ 8 ];
00073 bool m_handle_active[8];
00074 bool m_initializing;
00075
00080 virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00081
00082 virtual void position_handle ( Drawable::pointer, double x, double y );
00083
00084 virtual void on_child_added ( Drawable::pointer child );
00085
00086 virtual void on_child_removed ( Drawable::pointer child );
00087
00088 };
00089
00090 }
00091
00092 #endif