Back to index

easystroke  0.5.5.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
Actions::Store Class Reference
Collaboration diagram for Actions::Store:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Store (const Gtk::TreeModelColumnRecord &columns, Actions *p)

Static Public Member Functions

static Glib::RefPtr< Storecreate (const Gtk::TreeModelColumnRecord &columns, Actions *parent)

Protected Member Functions

bool row_draggable_vfunc (const Gtk::TreeModel::Path &path) const
bool row_drop_possible_vfunc (const Gtk::TreeModel::Path &dest, const Gtk::SelectionData &selection) const
bool drag_data_received_vfunc (const Gtk::TreeModel::Path &dest, const Gtk::SelectionData &selection)

Private Attributes

Actionsparent

Detailed Description

Definition at line 90 of file actions.h.


Constructor & Destructor Documentation

Actions::Store::Store ( const Gtk::TreeModelColumnRecord &  columns,
Actions p 
) [inline]

Definition at line 93 of file actions.h.

: Gtk::ListStore(columns), parent(p) {}

Here is the caller graph for this function:


Member Function Documentation

static Glib::RefPtr<Store> Actions::Store::create ( const Gtk::TreeModelColumnRecord &  columns,
Actions parent 
) [inline, static]

Definition at line 94 of file actions.h.

                                                                                                        {
                     return Glib::RefPtr<Store>(new Store(columns, parent));
              }

Here is the call graph for this function:

Here is the caller graph for this function:

bool Actions::Store::drag_data_received_vfunc ( const Gtk::TreeModel::Path &  dest,
const Gtk::SelectionData &  selection 
) [protected]

Definition at line 466 of file actions.cc.

                                                                                                           {
       Gtk::TreePath src;
       Glib::RefPtr<TreeModel> model;
       if (!Gtk::TreeModel::Path::get_from_selection_data(selection, model, src))
              return false;
       if (model != parent->tm)
              return false;
       Unique *src_id = (*parent->tm->get_iter(src))[parent->cols.id];
       Gtk::TreeIter dest_iter = parent->tm->get_iter(dest);
       Unique *dest_id = dest_iter ? (*dest_iter)[parent->cols.id] : (Unique *)0;
       if (dest_id && src_id->level != dest_id->level)
              return false;
       Glib::RefPtr<Gtk::TreeSelection> sel = parent->tv.get_selection();
       if (sel->count_selected_rows() <= 1) {
              if (parent->action_list->move(src_id, dest_id)) {
                     (*parent->tm->get_iter(src))[parent->cols.id] = src_id;
                     update_actions();
              }
       } else {
              std::vector<Gtk::TreePath> paths = sel->get_selected_rows();
              bool updated = false;
              for (std::vector<Gtk::TreePath>::iterator i = paths.begin(); i != paths.end(); ++i) {
                     Unique *id = (*parent->tm->get_iter(*i))[parent->cols.id];
                     if (parent->action_list->move(id, dest_id))
                            updated = true;
              }
              if (updated) {
                     parent->update_action_list();
                     update_actions();
              }
       }
       return false;
}

Here is the call graph for this function:

bool Actions::Store::row_draggable_vfunc ( const Gtk::TreeModel::Path &  path) const [protected]

Definition at line 419 of file actions.cc.

                                                                         {
       int col;
       Gtk::SortType sort;
       parent->tm->get_sort_column_id(col, sort);
       if (col != Gtk::TreeSortable::DEFAULT_SORT_COLUMN_ID)
              return false;
       if (sort != Gtk::SORT_ASCENDING)
              return false;
       Glib::RefPtr<Gtk::TreeSelection> sel = parent->tv.get_selection();
       if (sel->count_selected_rows() <= 1) {
              Unique *id = (*parent->tm->get_iter(path))[parent->cols.id];
              return id->level == parent->action_list->level;
       } else {
              std::vector<Gtk::TreePath> paths = sel->get_selected_rows();
              for (std::vector<Gtk::TreePath>::iterator i = paths.begin(); i != paths.end(); ++i) {
                     Unique *id = (*parent->tm->get_iter(*i))[parent->cols.id];
                     if (id->level != parent->action_list->level)
                            return false;
              }
              return true;
       }
}
bool Actions::Store::row_drop_possible_vfunc ( const Gtk::TreeModel::Path &  dest,
const Gtk::SelectionData &  selection 
) const [protected]

Definition at line 442 of file actions.cc.

                                                                                                                {
       static bool ignore_next = false;
       if (dest.get_depth() > 1) {
              ignore_next = true;
              return false;
       }
       if (ignore_next) {
              ignore_next = false;
              return false;
       }
       Gtk::TreePath src;
       Glib::RefPtr<TreeModel> model;
       if (!Gtk::TreeModel::Path::get_from_selection_data(selection, model, src))
              return false;
       if (model != parent->tm)
              return false;
       Unique *src_id = (*parent->tm->get_iter(src))[parent->cols.id];
       Gtk::TreeIter dest_iter = parent->tm->get_iter(dest);
       Unique *dest_id = dest_iter ? (*dest_iter)[parent->cols.id] : (Unique *)0;
       if (dest_id && src_id->level != dest_id->level)
              return false;
       return true;
}

Member Data Documentation

Definition at line 91 of file actions.h.


The documentation for this class was generated from the following files: