00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PAPYRUSHANDLEBOX_H
00020 #define PAPYRUSHANDLEBOX_H
00021
00022 #include <papyrus/boxed.h>
00023
00024 namespace Papyrus {
00025
00029 class Handlebox : public Boxed {
00030 public:
00031 typedef enum HANDLE {
00032 HANDLE_TOP_CENTER,
00033 HANDLE_TOP_RIGHT,
00034 HANDLE_CENTER_RIGHT,
00035 HANDLE_BOTTOM_RIGHT,
00036 HANDLE_BOTTOM_CENTER,
00037 HANDLE_BOTTOM_LEFT,
00038 HANDLE_CENTER_LEFT,
00039 HANDLE_TOP_LEFT
00040 } HANDLE;
00041
00042 typedef PapyrusSmartPointer<Handlebox> pointer;
00043
00044 Handlebox(Handles handles=CORNER_HANDLES);
00045
00046 static Handlebox::pointer create(Handles handles=CORNER_HANDLES);
00047
00048 virtual ~Handlebox();
00049
00050 void set_handle_shape( Drawable::pointer );
00051 void set_handle_shape( unsigned short int which, Drawable::pointer );
00052 void set_corner_handle_shape( Drawable::pointer );
00053 Drawable::pointer get_handle_shape( unsigned short int which );
00054
00055 void clear_handles();
00056 void clear_handle( unsigned int which );
00057
00058 int inside_handle( double x, double y );
00059
00060 PAPYRUS_CLASS_NAME("Handle Box");
00061
00062 PAPYRUS_CLONE_METHOD( Handlebox );
00063
00064 protected:
00065 Drawable::pointer m_handle_shape[ 8 ];
00066
00067 virtual void draw( Cairo::RefPtr< Cairo :: Context > cairo );
00068
00073 virtual void update_extents();
00074
00075 virtual void position_handle( Drawable::pointer, double x, double y );
00076
00077 };
00078
00079 }
00080
00081 #endif