Author: vince
Date: Mon Sep 27 08:39:52 2010
New Revision: 10850
URL:
http://source.netsurf-browser.org?rev=10850&view=rev
Log:
final core review updates
Modified:
branches/jmb/treeview-redux/content/urldb.c
branches/jmb/treeview-redux/desktop/tree.h
Modified: branches/jmb/treeview-redux/content/urldb.c
URL:
http://source.netsurf-browser.org/branches/jmb/treeview-redux/content/url...
==============================================================================
--- branches/jmb/treeview-redux/content/urldb.c (original)
+++ branches/jmb/treeview-redux/content/urldb.c Mon Sep 27 08:39:52 2010
@@ -2442,9 +2442,7 @@
url_func_result res;
int i;
- assert(url);
-
-// LOG(("%s", url));
+ assert(url != NULL);
urldb_add_url(url);
@@ -2529,8 +2527,6 @@
}
}
-// LOG(("%s", ret));
-
/* Now consider cookies whose paths prefix-match ours */
for (p = p->parent; p; p = p->parent) {
/* Find directory's path entry(ies) */
@@ -2540,7 +2536,6 @@
continue;
for (c = q->cookies; c; c = c->next) {
-// LOG(("%p: %s=%s", c, c->name, c->value));
if (c->expires != 1 && c->expires < now)
/* cookie has expired => ignore */
continue;
@@ -2604,8 +2599,6 @@
}
-// LOG(("%s", ret));
-
/* Finally consider domain cookies for hosts which domain match ours */
for (h = (const struct host_part *)p; h && h != &db_root;
h = h->parent) {
@@ -2634,8 +2627,6 @@
cookies_schedule_update((struct cookie_data *)c);
}
}
-
-// LOG(("%s", ret));
if (count == 0) {
/* No cookies found */
@@ -2704,8 +2695,6 @@
url_func_result res;
assert(url && header);
-
-// LOG(("'%s' : '%s'", url, header));
/* strip fragment */
urlt = strdup(url);
@@ -3392,7 +3381,6 @@
urldb_free_cookie(d);
cookies_schedule_update((struct cookie_data *)c);
-// LOG(("%p: %s=%s", c, c->name, c->value));
}
} else {
c->prev = p->cookies_end;
@@ -3402,7 +3390,6 @@
else
p->cookies = c;
p->cookies_end = c;
-// LOG(("%p: %s=%s", c, c->name, c->value));
}
return true;
Modified: branches/jmb/treeview-redux/desktop/tree.h
URL:
http://source.netsurf-browser.org/branches/jmb/treeview-redux/desktop/tre...
==============================================================================
--- branches/jmb/treeview-redux/desktop/tree.h (original)
+++ branches/jmb/treeview-redux/desktop/tree.h Mon Sep 27 08:39:52 2010
@@ -33,18 +33,26 @@
struct hlcache_handle;
/* Tree flags */
-#define TREE_NO_FLAGS 0
-#define TREE_NO_DRAGS 1
-#define TREE_NO_FURNITURE 2
-#define TREE_SINGLE_SELECT 4
-#define TREE_NO_SELECT 8
-#define TREE_MOVABLE 16
-/* if the last child of a directory is deleted the directory will be deleted
- too */
-#define TREE_DELETE_EMPTY_DIRS 16
+enum tree_flags {
+ TREE_NO_FLAGS = 0,
+ TREE_NO_DRAGS = 1,
+ TREE_NO_FURNITURE = 2,
+ TREE_SINGLE_SELECT = 4,
+ TREE_NO_SELECT = 8,
+ TREE_MOVABLE = 16,
+ TREE_DELETE_EMPTY_DIRS = 32, /**< if the last child of a
+ * directory is deleted the
+ * directory will be deleted
+ * too.
+ */
+};
-/* the flag for the first node_element in every node, all other flags should
- be different than this one */
+/** A "flag" value to indicate the element data contains title
+ * text. This value should be the first node_element in every
+ * node. All other values should be different than this one. The term
+ * flag is misused as it is actually a value used by the API consumer
+ * to indicate teh type of data a node element contains.
+ */
#define TREE_ELEMENT_TITLE 0x00
/* these should be defined in front end code */
@@ -56,48 +64,50 @@
struct node_element;
typedef enum {
- NODE_ELEMENT_TEXT, /* Text only */
- NODE_ELEMENT_TEXT_PLUS_ICON, /* Text and icon */
- NODE_ELEMENT_BITMAP /* Bitmap only */
+ NODE_ELEMENT_TEXT, /**< Text only */
+ NODE_ELEMENT_TEXT_PLUS_ICON, /**< Text and icon */
+ NODE_ELEMENT_BITMAP /**< Bitmap only */
} node_element_type;
typedef enum {
- NODE_DELETE_ELEMENT_TXT, /* The text of an element of the node
- is being deleted */
- NODE_DELETE_ELEMENT_IMG, /* The bitmap or icon of a node is being
- deleted */
- NODE_LAUNCH, /* The node has been launched */
- NODE_ELEMENT_EDIT_FINISHING, /* New text has to be accepted or
- rejected */
- NODE_ELEMENT_EDIT_FINISHED /* Editing of a node_element has been
- finished */
+ NODE_DELETE_ELEMENT_TXT, /**< The text of an element of the
+ * node is being deleted */
+ NODE_DELETE_ELEMENT_IMG, /**< The bitmap or icon of a node is
+ * being deleted */
+ NODE_LAUNCH, /**< The node has been launched */
+ NODE_ELEMENT_EDIT_FINISHING, /**< New text has to be accepted
+ * or rejected. */
+ NODE_ELEMENT_EDIT_FINISHED /**< Editing of a node_element has
+ * been finished. */
} node_msg;
typedef enum {
NODE_CALLBACK_HANDLED,
NODE_CALLBACK_NOT_HANDLED,
- NODE_CALLBACK_REJECT, /* reject new text for node element and
- leave editing mode */
- NODE_CALLBACK_CONTINUE /* don't leave editig mode */
+ NODE_CALLBACK_REJECT, /**< reject new text for node element
+ * and leave editing mode. */
+ NODE_CALLBACK_CONTINUE /**< don't leave editig mode. */
} node_callback_resp;
+/** Internal node message. */
struct node_msg_data {
- node_msg msg;
- unsigned int flag;
- struct node *node;
+ node_msg msg; /**< The type of message. */
+ unsigned int flag; /**< message flags. */
+ struct node *node; /**< tree node messsage concerns. */
union {
- char *text;
- void *bitmap;
- } data;
+ char *text; /**< textural data. */
+ void *bitmap; /**< bitmap data. */
+ } data; /**< The message data. */
};
+/** callbacks to perform necessary operations on treeview. */
struct treeview_table {
void (*redraw_request)(int x, int y, int width, int height,
- void *data);
+ void *data); /**< request a redraw. */
void (*resized)(struct tree *tree, int width, int height,
- void *data);
- void (*scroll_visible)(int y, int height, void *data);
- void (*get_window_dimensions)(int *width, int *height, void *data);
+ void *data); /**< resize treeview area. */
+ void (*scroll_visible)(int y, int height, void *data); /**< scroll visible treeview
area. */
+ void (*get_window_dimensions)(int *width, int *height, void *data); /**< get
dimensions of window */
};
/**