1 /* === S Y N F I G ========================================================= */ 2 /*! \file renderer_dragbox.h 3 ** \brief Renderer_Dragbox classe is used to display in the workarea 4 ** the interactive selection box, and select workarea objects (actually handles) 5 ** accordingly to the shift/control modifier keys. 6 ** 7 ** $Id$ 8 ** 9 ** \legal 10 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley 11 ** Copyright (c) 2015 Blanchi Jérôme 12 ** 13 ** This package is free software; you can redistribute it and/or 14 ** modify it under the terms of the GNU General Public License as 15 ** published by the Free Software Foundation; either version 2 of 16 ** the License, or (at your option) any later version. 17 ** 18 ** This package is distributed in the hope that it will be useful, 19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 ** General Public License for more details. 22 ** \endlegal 23 */ 24 /* ========================================================================= */ 25 26 /* === S T A R T =========================================================== */ 27 28 #ifndef __SYNFIG_RENDERER_DRAGBOX_H 29 #define __SYNFIG_RENDERER_DRAGBOX_H 30 31 /* === H E A D E R S ======================================================= */ 32 33 #include "workarearenderer.h" 34 #include "duckmatic.h" 35 #include <vector> 36 #include <synfig/vector.h> 37 #include <synfig/guidset.h> 38 39 40 /* === M A C R O S ========================================================= */ 41 42 #define DRAGBOX_COLOR_OUTLINE Gdk::Color("#000000") 43 44 /* === T Y P E D E F S ===================================================== */ 45 46 /* === C L A S S E S & S T R U C T S ======================================= */ 47 48 namespace studio { 49 50 class Renderer_Dragbox : public studio::WorkAreaRenderer 51 { 52 53 public: 54 ~Renderer_Dragbox(); 55 56 //! Redraw the drag box 57 void render_vfunc(const Glib::RefPtr<Gdk::Window>& drawable,const Gdk::Rectangle& expose_area ); 58 //! Catch some mouse events to select objects (handles) in the workarea 59 bool event_vfunc(GdkEvent* event); 60 61 const synfig::Point& get_drag_point()const; 62 const synfig::Point& get_curr_point()const; 63 64 private: 65 //! Context of workarea objects for selection process 66 DuckList handles_selected_; 67 DuckList handles_all_; 68 synfig::GUIDSet handles_selected_guid_; 69 70 //! Used to catch a new drag box sequence 71 bool drag_paused; 72 73 protected: 74 bool get_enabled_vfunc()const; 75 }; 76 77 }; // END of namespace studio 78 79 /* === E N D =============================================================== */ 80 81 #endif 82