14 #ifndef DROP_TARGET_H_INCLUDED
15 #define DROP_TARGET_H_INCLUDED
21 #include <boost/shared_ptr.hpp>
22 #include <boost/noncopyable.hpp>
39 typedef std::multimap<drop_target_group, drop_target*>
drop_groups;
46 bool hit_rect(
const SDL_Rect& hit_loc,
const int not_id)
const;
61 static bool empty() {
return groups_.empty() && next_id_.empty(); }
bool hit_rect(const SDL_Rect &hit_loc, const int not_id) const
drop_target_group get_group_id() const
static target_id next_id_
drop_target(const drop_group_manager_ptr group, const SDL_Rect &loc)
Registers drop target and saves reference to location.
static drop_groups groups_
static drop_target_group create_group()
std::multimap< drop_target_group, drop_target * > drop_groups
int handle_drop()
Called by widget object when droping happens.
drop_groups::iterator find_this() const
bool is_this_id(const int id) const
Checks if id matches id for this object.
const drop_target_group group_id_
drop_group_manager_ptr group_
static bool empty()
Used to check if static storages are empty.
boost::shared_ptr< drop_group_manager > drop_group_manager_ptr
boost::shared_ptr< drop_target > drop_target_ptr
static drop_target_group next_group_
Used to create and destroy drop groups.
std::map< drop_target_group, int > target_id
Handles droping for drag able ui items.
int next_free_id(const drop_target_group &group) const
static void delete_group(const drop_target_group id)