diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-10-29 17:40:36 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-10-29 17:40:36 +0000 |
commit | 25e9b79f5c944837192186c733feb4a3a311a051 (patch) | |
tree | 27664e6ba318748d7bdca4d631f158335387be06 /desktop | |
parent | 802f58f10d1d733093b0c285a2ee8bfdf68de414 (diff) | |
download | netsurf-25e9b79f5c944837192186c733feb4a3a311a051.tar.gz netsurf-25e9b79f5c944837192186c733feb4a3a311a051.tar.bz2 |
Allow getting the tree's drag property. This ensures we can see whether the current
drag is something we might need to display an icon for.
svn path=/trunk/netsurf/; revision=10917
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/tree.c | 19 | ||||
-rw-r--r-- | desktop/tree.h | 8 |
2 files changed, 19 insertions, 8 deletions
diff --git a/desktop/tree.c b/desktop/tree.c index 3ea3dbeda..566781ef7 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -40,13 +40,6 @@ #include "utils/utils.h" #include "utils/url.h" -typedef enum { - TREE_NO_DRAG = 0, - TREE_SELECT_DRAG, - TREE_MOVE_DRAG -} tree_drag_type; - - #define MAXIMUM_URL_LENGTH 1024 #define TREE_ICON_SIZE 16 @@ -1431,6 +1424,18 @@ bool tree_is_edited(struct tree *tree) /** + * Get the drag state of a tree + * + * \param tree the tree to get the state of + * \return drag type (defined in desktop/tree.h) + */ +tree_drag_type tree_drag_status(struct tree *tree) +{ + return tree->drag; +} + + +/** * Returns the first child of a node * * \param node the node to get the child of diff --git a/desktop/tree.h b/desktop/tree.h index 707f3d126..30d142005 100644 --- a/desktop/tree.h +++ b/desktop/tree.h @@ -64,6 +64,12 @@ struct node; struct node_element; typedef enum { + TREE_NO_DRAG = 0, + TREE_SELECT_DRAG, + TREE_MOVE_DRAG +} tree_drag_type; + +typedef enum { NODE_ELEMENT_TEXT, /**< Text only */ NODE_ELEMENT_TEXT_PLUS_ICON, /**< Text and icon */ NODE_ELEMENT_BITMAP /**< Bitmap only */ @@ -163,7 +169,7 @@ bool tree_update_element_text(struct tree *tree, struct node_element *element, c const char *tree_node_element_get_text(struct node_element *element); struct node *tree_get_root(struct tree *tree); bool tree_is_edited(struct tree *tree); - +tree_drag_type tree_drag_status(struct tree *tree); /* functions for traversing the tree */ struct node *tree_node_get_child(struct node *node); |