netsurf: branch master updated. release/3.0-563-gb96222d
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/b96222d8571237919bbfc...
...commit http://git.netsurf-browser.org/netsurf.git/commit/b96222d8571237919bbfc7d...
...tree http://git.netsurf-browser.org/netsurf.git/tree/b96222d8571237919bbfc7d85...
The branch, master has been updated
via b96222d8571237919bbfc7d85d43a2d46cfe262f (commit)
from 951ad51cd45ba2e5f49fab169ccbabc8f98a5185 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=b96222d8571237919bb...
commit b96222d8571237919bbfc7d85d43a2d46cfe262f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
We return client data, not node.
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 7c967b6..65f0c53 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -63,6 +63,18 @@ struct textarea_utf8 {
* trailing NULL */
};
+struct textarea_undo_detail {
+ unsigned int offset; /**< Offset to detail's text in undo.text */
+ unsigned int len; /**< Length of detail's text */
+};
+
+struct textarea_undo {
+ unsigned int next_detail;
+ struct textarea_undo_detail *details;
+
+ struct textarea_utf8 text;
+};
+
struct textarea {
int scroll_x, scroll_y; /**< scroll offsets for the textarea */
@@ -1337,7 +1349,7 @@ static inline void textarea_char_to_byte_offset(struct textarea_utf8 *text,
/**
- * Replace text in a textarea
+ * Perform actual text replacment in a textarea
*
* \param ta Textarea widget
* \param b_start Start byte index of replaced section (inclusive)
@@ -1352,7 +1364,7 @@ static inline void textarea_char_to_byte_offset(struct textarea_utf8 *text,
* Note, b_start and b_end must be the byte offsets in ta->show, so in the
* password textarea case, they are for ta->password.
*/
-static bool textarea_replace_text(struct textarea *ta, size_t b_start,
+static bool textarea_replace_text_internal(struct textarea *ta, size_t b_start,
size_t b_end, const char *rep, size_t rep_len,
bool add_to_clipboard, int *byte_delta, struct rect *r)
{
@@ -1462,6 +1474,47 @@ static bool textarea_replace_text(struct textarea *ta, size_t b_start,
/**
+ * Replace text in a textarea, updating undo buffer.
+ *
+ * \param ta Textarea widget
+ * \param b_start Start byte index of replaced section (inclusive)
+ * \param b_end End byte index of replaced section (exclusive)
+ * \param rep Replacement UTF-8 text to insert
+ * \param rep_len Byte length of replacement UTF-8 text
+ * \param add_to_clipboard True iff replaced text to be added to clipboard
+ * \param byte_delta Updated to change in byte count in textarea (ta->show)
+ * \param r Updated to area where redraw is required
+ * \return false on memory exhaustion, true otherwise
+ *
+ * Note, b_start and b_end must be the byte offsets in ta->show, so in the
+ * password textarea case, they are for ta->password.
+ */
+static bool textarea_replace_text(struct textarea *ta, size_t b_start,
+ size_t b_end, const char *rep, size_t rep_len,
+ bool add_to_clipboard, int *byte_delta, struct rect *r)
+{
+ /* TODO: Make copy of any replaced text */
+ if (b_start != b_end) {
+ }
+
+ /* Replace the text in the textarea, and reflow it */
+ if (textarea_replace_text_internal(ta, b_start, b_end, rep, rep_len,
+ add_to_clipboard, byte_delta, r) == false) {
+ return false;
+ }
+
+ if (b_start == b_end && rep_len == 0) {
+ /* Nothing changed at all */
+ return true;
+ }
+
+ /* TODO: Update UNDO buffer */
+
+ return true;
+}
+
+
+/**
* Handles the end of a drag operation
*
* \param ta Text area
diff --git a/desktop/textinput.h b/desktop/textinput.h
index e0581b2..a1ee504 100644
--- a/desktop/textinput.h
+++ b/desktop/textinput.h
@@ -63,6 +63,9 @@ enum input_key {
KEY_PAGE_DOWN,
KEY_DELETE_LINE_END,
KEY_DELETE_LINE_START,
+
+ KEY_UNDO,
+ KEY_REDO
};
diff --git a/desktop/treeview.c b/desktop/treeview.c
index d1eae40..af950aa 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -2078,9 +2078,13 @@ static treeview_node * treeview_get_first_selected(treeview *tree)
/* Exported interface, documented in treeview.h */
void treeview_get_selection(treeview *tree, void **node_data)
{
+ treeview_node *n;
+
assert(tree != NULL);
- *node_data = treeview_get_first_selected(tree);
+ n = treeview_get_first_selected(tree);
+
+ *node_data = n->client_data;
}
-----------------------------------------------------------------------
Summary of changes:
desktop/textarea.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-
desktop/textinput.h | 3 ++
desktop/treeview.c | 6 ++++-
3 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 7c967b6..65f0c53 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -63,6 +63,18 @@ struct textarea_utf8 {
* trailing NULL */
};
+struct textarea_undo_detail {
+ unsigned int offset; /**< Offset to detail's text in undo.text */
+ unsigned int len; /**< Length of detail's text */
+};
+
+struct textarea_undo {
+ unsigned int next_detail;
+ struct textarea_undo_detail *details;
+
+ struct textarea_utf8 text;
+};
+
struct textarea {
int scroll_x, scroll_y; /**< scroll offsets for the textarea */
@@ -1337,7 +1349,7 @@ static inline void textarea_char_to_byte_offset(struct textarea_utf8 *text,
/**
- * Replace text in a textarea
+ * Perform actual text replacment in a textarea
*
* \param ta Textarea widget
* \param b_start Start byte index of replaced section (inclusive)
@@ -1352,7 +1364,7 @@ static inline void textarea_char_to_byte_offset(struct textarea_utf8 *text,
* Note, b_start and b_end must be the byte offsets in ta->show, so in the
* password textarea case, they are for ta->password.
*/
-static bool textarea_replace_text(struct textarea *ta, size_t b_start,
+static bool textarea_replace_text_internal(struct textarea *ta, size_t b_start,
size_t b_end, const char *rep, size_t rep_len,
bool add_to_clipboard, int *byte_delta, struct rect *r)
{
@@ -1462,6 +1474,47 @@ static bool textarea_replace_text(struct textarea *ta, size_t b_start,
/**
+ * Replace text in a textarea, updating undo buffer.
+ *
+ * \param ta Textarea widget
+ * \param b_start Start byte index of replaced section (inclusive)
+ * \param b_end End byte index of replaced section (exclusive)
+ * \param rep Replacement UTF-8 text to insert
+ * \param rep_len Byte length of replacement UTF-8 text
+ * \param add_to_clipboard True iff replaced text to be added to clipboard
+ * \param byte_delta Updated to change in byte count in textarea (ta->show)
+ * \param r Updated to area where redraw is required
+ * \return false on memory exhaustion, true otherwise
+ *
+ * Note, b_start and b_end must be the byte offsets in ta->show, so in the
+ * password textarea case, they are for ta->password.
+ */
+static bool textarea_replace_text(struct textarea *ta, size_t b_start,
+ size_t b_end, const char *rep, size_t rep_len,
+ bool add_to_clipboard, int *byte_delta, struct rect *r)
+{
+ /* TODO: Make copy of any replaced text */
+ if (b_start != b_end) {
+ }
+
+ /* Replace the text in the textarea, and reflow it */
+ if (textarea_replace_text_internal(ta, b_start, b_end, rep, rep_len,
+ add_to_clipboard, byte_delta, r) == false) {
+ return false;
+ }
+
+ if (b_start == b_end && rep_len == 0) {
+ /* Nothing changed at all */
+ return true;
+ }
+
+ /* TODO: Update UNDO buffer */
+
+ return true;
+}
+
+
+/**
* Handles the end of a drag operation
*
* \param ta Text area
diff --git a/desktop/textinput.h b/desktop/textinput.h
index e0581b2..a1ee504 100644
--- a/desktop/textinput.h
+++ b/desktop/textinput.h
@@ -63,6 +63,9 @@ enum input_key {
KEY_PAGE_DOWN,
KEY_DELETE_LINE_END,
KEY_DELETE_LINE_START,
+
+ KEY_UNDO,
+ KEY_REDO
};
diff --git a/desktop/treeview.c b/desktop/treeview.c
index d1eae40..af950aa 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -2078,9 +2078,13 @@ static treeview_node * treeview_get_first_selected(treeview *tree)
/* Exported interface, documented in treeview.h */
void treeview_get_selection(treeview *tree, void **node_data)
{
+ treeview_node *n;
+
assert(tree != NULL);
- *node_data = treeview_get_first_selected(tree);
+ n = treeview_get_first_selected(tree);
+
+ *node_data = n->client_data;
}
--
NetSurf Browser
9 years, 8 months
netsurf: branch master updated. release/3.0-562-g951ad51
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/951ad51cd45ba2e5f49fa...
...commit http://git.netsurf-browser.org/netsurf.git/commit/951ad51cd45ba2e5f49fab1...
...tree http://git.netsurf-browser.org/netsurf.git/tree/951ad51cd45ba2e5f49fab169...
The branch, master has been updated
via 951ad51cd45ba2e5f49fab169ccbabc8f98a5185 (commit)
from 653cf8fa1fe9796b48988ac8fd726056a55c70f4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=951ad51cd45ba2e5f49...
commit 951ad51cd45ba2e5f49fab169ccbabc8f98a5185
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add functions to get first selected hotlist/global_history node data.
diff --git a/desktop/global_history.c b/desktop/global_history.c
index 191ff19..94521e7 100644
--- a/desktop/global_history.c
+++ b/desktop/global_history.c
@@ -950,6 +950,27 @@ bool global_history_has_selection(void)
/* Exported interface, documented in global_history.h */
+bool global_history_get_selection(nsurl **url, const char **title)
+{
+ struct global_history_entry *e;
+ void *v;
+
+ treeview_get_selection(gh_ctx.tree, &v);
+ if (v == NULL) {
+ *url = NULL;
+ *title = NULL;
+ return false;
+ }
+
+ e = (struct global_history_entry *)v;
+
+ *url = e->url;
+ *title = e->data[GH_TITLE].value;
+ return true;
+}
+
+
+/* Exported interface, documented in global_history.h */
nserror global_history_expand(bool only_folders)
{
return treeview_expand(gh_ctx.tree, only_folders);
diff --git a/desktop/global_history.h b/desktop/global_history.h
index 4ebe139..7c49cfc 100644
--- a/desktop/global_history.h
+++ b/desktop/global_history.h
@@ -110,6 +110,15 @@ void global_history_keypress(uint32_t key);
bool global_history_has_selection(void);
/**
+ * Get the first selected node
+ *
+ * \param url Updated to the selected entry's address, or NULL
+ * \param title Updated to the selected entry's title, or NULL
+ * \return true iff global history has a selection
+ */
+bool global_history_get_selection(nsurl **url, const char **title);
+
+/**
* Expand the treeview's nodes
*
* \param only_folders Iff true, only folders are expanded.
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index fde4c33..bedb095 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -1483,6 +1483,27 @@ bool hotlist_has_selection(void)
/* Exported interface, documented in hotlist.h */
+bool hotlist_get_selection(nsurl **url, const char **title)
+{
+ struct hotlist_entry *e;
+ void *v;
+
+ treeview_get_selection(hl_ctx.tree, &v);
+ if (v == NULL) {
+ *url = NULL;
+ *title = NULL;
+ return false;
+ }
+
+ e = (struct hotlist_entry *)v;
+
+ *url = e->url;
+ *title = e->data[HL_TITLE].value;
+ return true;
+}
+
+
+/* Exported interface, documented in hotlist.h */
void hotlist_edit_selection(void)
{
treeview_edit_selection(hl_ctx.tree);
diff --git a/desktop/hotlist.h b/desktop/hotlist.h
index c6e74f2..e5ae834 100644
--- a/desktop/hotlist.h
+++ b/desktop/hotlist.h
@@ -201,6 +201,15 @@ void hotlist_keypress(uint32_t key);
bool hotlist_has_selection(void);
/**
+ * Get the first selected node
+ *
+ * \param url Updated to the selected entry's address, or NULL
+ * \param title Updated to the selected entry's title, or NULL
+ * \return true iff hotlist has a selection
+ */
+bool hotlist_get_selection(nsurl **url, const char **title);
+
+/**
* Edit the first selected node
*/
void hotlist_edit_selection(void);
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 6b74c90..d1eae40 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -2075,6 +2075,15 @@ static treeview_node * treeview_get_first_selected(treeview *tree)
}
+/* Exported interface, documented in treeview.h */
+void treeview_get_selection(treeview *tree, void **node_data)
+{
+ assert(tree != NULL);
+
+ *node_data = treeview_get_first_selected(tree);
+}
+
+
/**
* Clear any selection in a treeview
*
diff --git a/desktop/treeview.h b/desktop/treeview.h
index 6fe6521..8f5c44e 100644
--- a/desktop/treeview.h
+++ b/desktop/treeview.h
@@ -376,6 +376,14 @@ void treeview_mouse_action(treeview *tree,
bool treeview_has_selection(treeview *tree);
/**
+ * Get the first selected node
+ *
+ * \param tree Treeview object to get selected node in
+ * \param node_data Client data for the selected treeview node, or NULL
+ */
+void treeview_get_selection(treeview *tree, void **node_data);
+
+/**
* Edit the first selected node
*
* \param tree Treeview object to edit selected node in
-----------------------------------------------------------------------
Summary of changes:
desktop/global_history.c | 21 +++++++++++++++++++++
desktop/global_history.h | 9 +++++++++
desktop/hotlist.c | 21 +++++++++++++++++++++
desktop/hotlist.h | 9 +++++++++
desktop/treeview.c | 9 +++++++++
desktop/treeview.h | 8 ++++++++
6 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/desktop/global_history.c b/desktop/global_history.c
index 191ff19..94521e7 100644
--- a/desktop/global_history.c
+++ b/desktop/global_history.c
@@ -950,6 +950,27 @@ bool global_history_has_selection(void)
/* Exported interface, documented in global_history.h */
+bool global_history_get_selection(nsurl **url, const char **title)
+{
+ struct global_history_entry *e;
+ void *v;
+
+ treeview_get_selection(gh_ctx.tree, &v);
+ if (v == NULL) {
+ *url = NULL;
+ *title = NULL;
+ return false;
+ }
+
+ e = (struct global_history_entry *)v;
+
+ *url = e->url;
+ *title = e->data[GH_TITLE].value;
+ return true;
+}
+
+
+/* Exported interface, documented in global_history.h */
nserror global_history_expand(bool only_folders)
{
return treeview_expand(gh_ctx.tree, only_folders);
diff --git a/desktop/global_history.h b/desktop/global_history.h
index 4ebe139..7c49cfc 100644
--- a/desktop/global_history.h
+++ b/desktop/global_history.h
@@ -110,6 +110,15 @@ void global_history_keypress(uint32_t key);
bool global_history_has_selection(void);
/**
+ * Get the first selected node
+ *
+ * \param url Updated to the selected entry's address, or NULL
+ * \param title Updated to the selected entry's title, or NULL
+ * \return true iff global history has a selection
+ */
+bool global_history_get_selection(nsurl **url, const char **title);
+
+/**
* Expand the treeview's nodes
*
* \param only_folders Iff true, only folders are expanded.
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index fde4c33..bedb095 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -1483,6 +1483,27 @@ bool hotlist_has_selection(void)
/* Exported interface, documented in hotlist.h */
+bool hotlist_get_selection(nsurl **url, const char **title)
+{
+ struct hotlist_entry *e;
+ void *v;
+
+ treeview_get_selection(hl_ctx.tree, &v);
+ if (v == NULL) {
+ *url = NULL;
+ *title = NULL;
+ return false;
+ }
+
+ e = (struct hotlist_entry *)v;
+
+ *url = e->url;
+ *title = e->data[HL_TITLE].value;
+ return true;
+}
+
+
+/* Exported interface, documented in hotlist.h */
void hotlist_edit_selection(void)
{
treeview_edit_selection(hl_ctx.tree);
diff --git a/desktop/hotlist.h b/desktop/hotlist.h
index c6e74f2..e5ae834 100644
--- a/desktop/hotlist.h
+++ b/desktop/hotlist.h
@@ -201,6 +201,15 @@ void hotlist_keypress(uint32_t key);
bool hotlist_has_selection(void);
/**
+ * Get the first selected node
+ *
+ * \param url Updated to the selected entry's address, or NULL
+ * \param title Updated to the selected entry's title, or NULL
+ * \return true iff hotlist has a selection
+ */
+bool hotlist_get_selection(nsurl **url, const char **title);
+
+/**
* Edit the first selected node
*/
void hotlist_edit_selection(void);
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 6b74c90..d1eae40 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -2075,6 +2075,15 @@ static treeview_node * treeview_get_first_selected(treeview *tree)
}
+/* Exported interface, documented in treeview.h */
+void treeview_get_selection(treeview *tree, void **node_data)
+{
+ assert(tree != NULL);
+
+ *node_data = treeview_get_first_selected(tree);
+}
+
+
/**
* Clear any selection in a treeview
*
diff --git a/desktop/treeview.h b/desktop/treeview.h
index 6fe6521..8f5c44e 100644
--- a/desktop/treeview.h
+++ b/desktop/treeview.h
@@ -376,6 +376,14 @@ void treeview_mouse_action(treeview *tree,
bool treeview_has_selection(treeview *tree);
/**
+ * Get the first selected node
+ *
+ * \param tree Treeview object to get selected node in
+ * \param node_data Client data for the selected treeview node, or NULL
+ */
+void treeview_get_selection(treeview *tree, void **node_data);
+
+/**
* Edit the first selected node
*
* \param tree Treeview object to edit selected node in
--
NetSurf Browser
9 years, 8 months
netsurf: branch master updated. release/3.0-561-g653cf8f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/653cf8fa1fe9796b48988...
...commit http://git.netsurf-browser.org/netsurf.git/commit/653cf8fa1fe9796b48988ac...
...tree http://git.netsurf-browser.org/netsurf.git/tree/653cf8fa1fe9796b48988ac8f...
The branch, master has been updated
via 653cf8fa1fe9796b48988ac8fd726056a55c70f4 (commit)
from 69b0350a3ca417ff945aa5981c4ece16d8232633 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=653cf8fa1fe9796b489...
commit 653cf8fa1fe9796b48988ac8fd726056a55c70f4
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Use a simulated keypress rather than a simulated mouseclick
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 797f581..454fe26 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -1220,12 +1220,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
switch(itemid)
{
case CMID_TREE_LAUNCH:
- tree_mouse_action(tree, BROWSER_MOUSE_DOUBLE_CLICK, 0, 0);
- /**TODO: this needs fixing. ^^^^
- (a) the mouse co-ordinates where the context menu was opened are not propagated and
- (b) does a double-click here open ALL selected entries?
- (c) what happens if the user right-clicked over a non-selected entry with others selected?
- **/
+ tree_keypress(tree, KEY_CR);
break;
case CMID_TREE_EDITFOLDER:
-----------------------------------------------------------------------
Summary of changes:
amiga/context_menu.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 797f581..454fe26 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -1220,12 +1220,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
switch(itemid)
{
case CMID_TREE_LAUNCH:
- tree_mouse_action(tree, BROWSER_MOUSE_DOUBLE_CLICK, 0, 0);
- /**TODO: this needs fixing. ^^^^
- (a) the mouse co-ordinates where the context menu was opened are not propagated and
- (b) does a double-click here open ALL selected entries?
- (c) what happens if the user right-clicked over a non-selected entry with others selected?
- **/
+ tree_keypress(tree, KEY_CR);
break;
case CMID_TREE_EDITFOLDER:
--
NetSurf Browser
9 years, 8 months
netsurf: branch master updated. release/3.0-560-g69b0350
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/69b0350a3ca417ff945aa...
...commit http://git.netsurf-browser.org/netsurf.git/commit/69b0350a3ca417ff945aa59...
...tree http://git.netsurf-browser.org/netsurf.git/tree/69b0350a3ca417ff945aa5981...
The branch, master has been updated
via 69b0350a3ca417ff945aa5981c4ece16d8232633 (commit)
via 0bc226def97e72974abf9b8b526586b93c2d84cf (commit)
via ccdaabfa38ba7ef958cd9021ecd0f472a339ec50 (commit)
via fda365fb2d64333b4d60649cb7e778b51c179fc5 (commit)
via 177b46e873d29c4c5324467239bc80f11997c5e0 (commit)
via ffb024f66d3f912392f1f25eb5c25a15fdd2c4a5 (commit)
via 667dc146ae5651d1ed07bcaf53770c204453fd0e (commit)
via 5b457faf5f1898b02b33f5ddcd3ddb7a2ca2e924 (commit)
via 0e5667e28e1a31da06a797a93b72ecb1942d28b9 (commit)
via 9af55136d0c899492f20466f8c96b3ba24302e68 (commit)
from 9c551589bd0a2214706e18ff80720875cf5b9860 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=69b0350a3ca417ff945...
commit 69b0350a3ca417ff945aa5981c4ece16d8232633
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Make the hotlist toolbar work
diff --git a/amiga/gui.c b/amiga/gui.c
index b5b833f..6b18ccd 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -4888,20 +4888,17 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
case GID_HOTLIST:
if(node = (struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) {
- GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&urltxt, TAG_DONE);
+ GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE);
- if (nsurl_create(urltxt, &url) != NSERROR_OK) {
- warn_user("NoMemory", 0);
- } else {
- if(gwin->key_state & BROWSER_MOUSE_MOD_2) {
- browser_window_create(BROWSER_WINDOW_VERIFIABLE |
+ if(gwin->key_state & BROWSER_MOUSE_MOD_2) {
+ browser_window_create(BROWSER_WINDOW_VERIFIABLE |
BROWSER_WINDOW_TAB,
url,
NULL,
gwin->bw,
NULL);
- } else {
- browser_window_navigate(gwin->bw,
+ } else {
+ browser_window_navigate(gwin->bw,
url,
NULL,
BROWSER_WINDOW_HISTORY |
@@ -4910,8 +4907,6 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
NULL,
NULL);
- }
- nsurl_unref(url);
}
}
break;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0bc226def97e72974ab...
commit 0bc226def97e72974abf9b8b526586b93c2d84cf
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Make hotlist toolbar use the new functions
diff --git a/amiga/gui.c b/amiga/gui.c
index 6a9e6d2..b5b833f 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -142,6 +142,12 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+struct ami_gui_tb_userdata {
+ struct List *sblist;
+ struct gui_window_2 *gw;
+ int items;
+};
+
struct MsgPort *appport;
struct Library *KeymapBase = NULL;
struct KeymapIFace *IKeymap = NULL;
@@ -2849,68 +2855,37 @@ void ami_update_buttons(struct gui_window_2 *gwin)
}
}
-void ami_gui_hotlist_scan_2(struct tree *tree, struct node *root, WORD *gen, int *item,
- struct List *speed_button_list, struct gui_window_2 *gwin)
+static bool ami_gui_hotlist_add(void *userdata, int level, int item, const char *title, nsurl *url, bool is_folder)
{
-#if 0
- struct node *tempnode;
- struct node_element *element=NULL;
- struct node *node;
+ struct ami_gui_tb_userdata *tb_userdata = (struct ami_gui_tb_userdata *)userdata;
struct Node *speed_button_node;
- *gen = *gen + 1;
-
- for (node = root; node; node = tree_node_get_next(node))
- {
- if((*gen == 1) && (*item < AMI_GUI_TOOLBAR_MAX)) /* Don't cascade into sub-dirs */
- {
- gwin->hotlist_toolbar_lab[*item] = ami_utf8_easy((char *)tree_url_node_get_title(node));
+ if(level != 1) return false;
+ if(item > AMI_GUI_TOOLBAR_MAX) return false;
+ if(is_folder == true) return false;
+
+ tb_userdata->gw->hotlist_toolbar_lab[item] = ami_utf8_easy(title);
- speed_button_node = AllocSpeedButtonNode(*item,
- SBNA_Text, gwin->hotlist_toolbar_lab[*item],
- SBNA_UserData, (void *)tree_url_node_get_url(node),
+ speed_button_node = AllocSpeedButtonNode(item,
+ SBNA_Text, tb_userdata->gw->hotlist_toolbar_lab[item],
+ SBNA_UserData, (void *)url,
TAG_DONE);
- AddTail(speed_button_list, speed_button_node);
+ AddTail(tb_userdata->sblist, speed_button_node);
- *item = *item + 1;
- }
-
- /* Don't need this atm as it cascades into sub-dirs
- if (tree_node_get_child(node))
- {
- ami_gui_hotlist_scan_2(tree, tree_node_get_child(node), gen);
- }
- */
- }
-
- *gen = *gen - 1;
-#endif
+ tb_userdata->items++;
+ return true;
}
int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_list, struct gui_window_2 *gwin)
{
-#if 0
- struct node *root = tree_node_get_child(tree_get_root(tree));
- struct node *node;
- struct node_element *element;
- WORD gen = 0;
- int item = 0;
-
- for (node = root; node; node = tree_node_get_next(node))
- {
- element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
- if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
- if(element && (strcmp(tree_node_element_get_text(element), messages_get("HotlistToolbar")) == 0))
- {
- ami_gui_hotlist_scan_2(tree, tree_node_get_child(node), &gen, &item, speed_button_list, gwin);
- }
- }
+ struct ami_gui_tb_userdata userdata;
+ userdata.gw = gwin;
+ userdata.sblist = speed_button_list;
+ userdata.items = 0;
- return item;
-#else
- return 0;
-#endif
+ ami_hotlist_scan((void *)&userdata, 0, messages_get("HotlistToolbar"), ami_gui_hotlist_add);
+ return userdata.items;
}
void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ccdaabfa38ba7ef958c...
commit ccdaabfa38ba7ef958cd9021ecd0f472a339ec50
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Pass generic userdata
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index e9841d3..70f0143 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -22,12 +22,12 @@
#include "desktop/hotlist.h"
struct ami_hotlist_ctx {
- struct gui_window_2 *gw;
+ void *userdata;
int level;
int item;
const char *folder; /* folder we're interested in */
bool in_menu; /* set if we are in that folder */
- bool (*cb)(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool folder);
+ bool (*cb)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder);
};
@@ -51,7 +51,7 @@ static nserror ami_hotlist_folder_enter_cb(void *ctx, const char *title)
struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
if(menu_ctx->in_menu == true) {
- if(menu_ctx->cb(menu_ctx->gw, menu_ctx->level, menu_ctx->item, title, NULL, true) == true)
+ if(menu_ctx->cb(menu_ctx->userdata, menu_ctx->level, menu_ctx->item, title, NULL, true) == true)
menu_ctx->item++;
} else {
if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0))
@@ -66,7 +66,7 @@ static nserror ami_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
if(menu_ctx->in_menu == true) {
- if(menu_ctx->cb(menu_ctx->gw, menu_ctx->level, menu_ctx->item, title, url, false) == true)
+ if(menu_ctx->cb(menu_ctx->userdata, menu_ctx->level, menu_ctx->item, title, url, false) == true)
menu_ctx->item++;
}
@@ -85,8 +85,8 @@ static nserror ami_hotlist_folder_leave_cb(void *ctx)
return NSERROR_OK;
}
-nserror ami_hotlist_scan(struct gui_window_2 *gwin, int first_item, const char *folder,
- bool (*cb_add_item)(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool folder))
+nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder,
+ bool (*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder))
{
struct ami_hotlist_ctx ctx;
@@ -94,7 +94,7 @@ nserror ami_hotlist_scan(struct gui_window_2 *gwin, int first_item, const char *
ctx.item = first_item;
ctx.folder = folder;
ctx.in_menu = false;
- ctx.gw = gwin;
+ ctx.userdata = userdata;
ctx.cb = cb_add_item;
return hotlist_iterate(&ctx,
diff --git a/amiga/hotlist.h b/amiga/hotlist.h
index be38163..54f8a63 100755
--- a/amiga/hotlist.h
+++ b/amiga/hotlist.h
@@ -23,8 +23,8 @@
void ami_hotlist_initialise(const char *hotlist_file);
void ami_hotlist_free(const char *hotlist_file);
-nserror ami_hotlist_scan(struct gui_window_2 *gwin, int first_item, const char *folder,
- bool (*cb_add_item)(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool folder));
+nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder,
+ bool (*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder));
struct treeview_window *hotlist_window;
#endif
diff --git a/amiga/menu.c b/amiga/menu.c
index 6c67b04..e75e037 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -535,10 +535,11 @@ void ami_menu_arexx_scan(struct gui_window_2 *gwin)
gwin->menu[item].nm_Label = NULL;
}
-static bool ami_menu_hotlist_add(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool is_folder)
+static bool ami_menu_hotlist_add(void *userdata, int level, int item, const char *title, nsurl *url, bool is_folder)
{
UBYTE type;
char *icon;
+ struct gui_window_2 *gw = (struct gui_window_2 *)userdata;
if(item >= AMI_MENU_HOTLIST_MAX) return false;
@@ -571,7 +572,7 @@ static bool ami_menu_hotlist_add(struct gui_window_2 *gw, int level, int item, c
static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin)
{
- return ami_hotlist_scan(gwin, AMI_MENU_HOTLIST, messages_get("HotlistMenu"), ami_menu_hotlist_add);
+ return ami_hotlist_scan((void *)gwin, AMI_MENU_HOTLIST, messages_get("HotlistMenu"), ami_menu_hotlist_add);
}
void ami_menu_update_checked(struct gui_window_2 *gwin)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=fda365fb2d64333b4d6...
commit fda365fb2d64333b4d60649cb7e778b51c179fc5
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Move the hotlist menu creator into hotlist.c and make it more generic
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index 6fa1568..e9841d3 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -19,6 +19,17 @@
#include <proto/exec.h>
#include "amiga/hotlist.h"
#include "amiga/tree.h"
+#include "desktop/hotlist.h"
+
+struct ami_hotlist_ctx {
+ struct gui_window_2 *gw;
+ int level;
+ int item;
+ const char *folder; /* folder we're interested in */
+ bool in_menu; /* set if we are in that folder */
+ bool (*cb)(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool folder);
+};
+
void ami_hotlist_initialise(const char *hotlist_file)
{
@@ -33,3 +44,61 @@ void ami_hotlist_free(const char *hotlist_file)
ami_tree_destroy(hotlist_window);
hotlist_window = NULL;
}
+
+
+static nserror ami_hotlist_folder_enter_cb(void *ctx, const char *title)
+{
+ struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
+
+ if(menu_ctx->in_menu == true) {
+ if(menu_ctx->cb(menu_ctx->gw, menu_ctx->level, menu_ctx->item, title, NULL, true) == true)
+ menu_ctx->item++;
+ } else {
+ if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0))
+ menu_ctx->in_menu = true;
+ }
+ menu_ctx->level++;
+ return NSERROR_OK;
+}
+
+static nserror ami_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
+{
+ struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
+
+ if(menu_ctx->in_menu == true) {
+ if(menu_ctx->cb(menu_ctx->gw, menu_ctx->level, menu_ctx->item, title, url, false) == true)
+ menu_ctx->item++;
+ }
+
+ return NSERROR_OK;
+}
+
+static nserror ami_hotlist_folder_leave_cb(void *ctx)
+{
+ struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
+
+ menu_ctx->level--;
+
+ if((menu_ctx->in_menu == true) && (menu_ctx->level == 0))
+ menu_ctx->in_menu = false;
+
+ return NSERROR_OK;
+}
+
+nserror ami_hotlist_scan(struct gui_window_2 *gwin, int first_item, const char *folder,
+ bool (*cb_add_item)(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool folder))
+{
+ struct ami_hotlist_ctx ctx;
+
+ ctx.level = 0;
+ ctx.item = first_item;
+ ctx.folder = folder;
+ ctx.in_menu = false;
+ ctx.gw = gwin;
+ ctx.cb = cb_add_item;
+
+ return hotlist_iterate(&ctx,
+ ami_hotlist_folder_enter_cb,
+ ami_hotlist_address_cb,
+ ami_hotlist_folder_leave_cb);
+}
diff --git a/amiga/hotlist.h b/amiga/hotlist.h
index ee258af..be38163 100755
--- a/amiga/hotlist.h
+++ b/amiga/hotlist.h
@@ -23,6 +23,8 @@
void ami_hotlist_initialise(const char *hotlist_file);
void ami_hotlist_free(const char *hotlist_file);
+nserror ami_hotlist_scan(struct gui_window_2 *gwin, int first_item, const char *folder,
+ bool (*cb_add_item)(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool folder));
struct treeview_window *hotlist_window;
#endif
diff --git a/amiga/menu.c b/amiga/menu.c
index 50f48a9..6c67b04 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -73,14 +73,6 @@ enum {
NSA_GLYPH_MAX
};
-struct ami_hotlist_ctx {
- struct gui_window_2 *gw;
- int level;
- int item;
- bool in_menu;
-};
-
-
BOOL menualreadyinit;
const char * const netsurf_version;
const char * const verdate;
@@ -543,15 +535,14 @@ void ami_menu_arexx_scan(struct gui_window_2 *gwin)
gwin->menu[item].nm_Label = NULL;
}
-static nserror ami_menu_hotlist_add(void *ctx, const char *title, nsurl *url, bool is_folder)
+static bool ami_menu_hotlist_add(struct gui_window_2 *gw, int level, int item, const char *title, nsurl *url, bool is_folder)
{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
UBYTE type;
char *icon;
- if(menu_ctx->item >= AMI_MENU_HOTLIST_MAX) return NSERROR_OK;
+ if(item >= AMI_MENU_HOTLIST_MAX) return false;
- switch(menu_ctx->level) {
+ switch(level) {
case 1:
type = NM_ITEM;
break;
@@ -560,7 +551,7 @@ static nserror ami_menu_hotlist_add(void *ctx, const char *title, nsurl *url, bo
break;
default:
/* entries not at level 1 or 2 are not able to be added */
- return NSERROR_OK;
+ return false;
break;
}
@@ -570,65 +561,17 @@ static nserror ami_menu_hotlist_add(void *ctx, const char *title, nsurl *url, bo
icon = "icons/content.png";
}
- ami_menu_alloc_item(menu_ctx->gw, menu_ctx->item, type, title,
+ ami_menu_alloc_item(gw, item, type, title,
0, icon, ami_menu_item_hotlist_entries, (void *)url);
if((is_folder == true) && (type == NM_SUB))
- menu_ctx->gw->menu[menu_ctx->item].nm_Flags = NM_ITEMDISABLED;
-
- menu_ctx->item++;
-
- return NSERROR_OK;
-}
+ gw->menu[item].nm_Flags = NM_ITEMDISABLED;
-static nserror ami_menu_hotlist_folder_enter_cb(void *ctx, const char *title)
-{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
- if(menu_ctx->in_menu == true) {
- ami_menu_hotlist_add(menu_ctx, title, NULL, true);
- } else {
- if((menu_ctx->level == 0) && (strcmp(title, messages_get("HotlistMenu")) == 0))
- menu_ctx->in_menu = true;
- }
- menu_ctx->level++;
- return NSERROR_OK;
-}
-
-static nserror ami_menu_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
-{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
- if(menu_ctx->in_menu == true)
- ami_menu_hotlist_add(menu_ctx, title, url, false);
-
- return NSERROR_OK;
-}
-
-static nserror ami_menu_hotlist_folder_leave_cb(void *ctx)
-{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
- menu_ctx->level--;
-
- if((menu_ctx->in_menu == true) && (menu_ctx->level == 0))
- menu_ctx->in_menu = false;
-
- return NSERROR_OK;
+ return true;
}
static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin)
{
- struct ami_hotlist_ctx ctx;
-
- ctx.level = 0;
- ctx.item = AMI_MENU_HOTLIST;
- ctx.in_menu = false;
- ctx.gw = gwin;
-
- return hotlist_iterate(&ctx,
- ami_menu_hotlist_folder_enter_cb,
- ami_menu_hotlist_address_cb,
- ami_menu_hotlist_folder_leave_cb);
+ return ami_hotlist_scan(gwin, AMI_MENU_HOTLIST, messages_get("HotlistMenu"), ami_menu_hotlist_add);
}
void ami_menu_update_checked(struct gui_window_2 *gwin)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=177b46e873d29c4c532...
commit 177b46e873d29c4c5324467239bc80f11997c5e0
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add hotlist menu items at the correct offset
diff --git a/amiga/menu.c b/amiga/menu.c
index d8e49fc..50f48a9 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -590,7 +590,6 @@ static nserror ami_menu_hotlist_folder_enter_cb(void *ctx, const char *title)
if((menu_ctx->level == 0) && (strcmp(title, messages_get("HotlistMenu")) == 0))
menu_ctx->in_menu = true;
}
-
menu_ctx->level++;
return NSERROR_OK;
}
@@ -598,7 +597,7 @@ static nserror ami_menu_hotlist_folder_enter_cb(void *ctx, const char *title)
static nserror ami_menu_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
{
struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
+
if(menu_ctx->in_menu == true)
ami_menu_hotlist_add(menu_ctx, title, url, false);
@@ -622,7 +621,7 @@ static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin)
struct ami_hotlist_ctx ctx;
ctx.level = 0;
- ctx.item = 0;
+ ctx.item = AMI_MENU_HOTLIST;
ctx.in_menu = false;
ctx.gw = gwin;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ffb024f66d3f912392f...
commit ffb024f66d3f912392f1f25eb5c25a15fdd2c4a5
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Remove context menu some more as it's irrepairably broken anyway
diff --git a/amiga/tree.c b/amiga/tree.c
index aba0723..a8f22e9 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -882,12 +882,13 @@ BOOL ami_tree_event(struct treeview_window *twin)
if(twin->drag_y == 0) twin->drag_y = y;
break;
case MENUDOWN:
+#if 0
if(tree_node_has_selection(tree_get_root(twin->tree)) == false)
{
tree_set_node_selected_at(twin->tree, x, y, true);
}
ami_context_menu_show_tree(twin->tree, twin->win, twin->type);
-
+#endif
break;
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=667dc146ae5651d1ed0...
commit 667dc146ae5651d1ed07bcaf53770c204453fd0e
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix buttons in the least convaluted way possible
diff --git a/amiga/tree.c b/amiga/tree.c
index 5320773..aba0723 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -496,13 +496,12 @@ void ami_tree_update_buttons(struct treeview_window *twin)
{
if(twin->type == AMI_TREE_SSLCERT) return;
- if(tree_node_has_selection(tree_get_root(twin->tree)))
- {
+ if(((twin->type == AMI_TREE_HOTLIST) && (hotlist_has_selection())) ||
+ ((twin->type == AMI_TREE_COOKIES) && (cookie_manager_has_selection())) ||
+ ((twin->type == AMI_TREE_HISTORY) && (global_history_has_selection()))) {
OnMenu(twin->win, AMI_TREE_MENU_DELETE);
OnMenu(twin->win, AMI_TREE_MENU_CLEAR);
- }
- else
- {
+ } else {
OffMenu(twin->win, AMI_TREE_MENU_DELETE);
OffMenu(twin->win, AMI_TREE_MENU_CLEAR);
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5b457faf5f1898b02b3...
commit 5b457faf5f1898b02b33f5ddcd3ddb7a2ca2e924
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Remove some very useful drag stuff that doesn't seem to yet have an equivalalent in the new treeveiw
diff --git a/amiga/tree.c b/amiga/tree.c
index 5aee277..5320773 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -272,7 +272,7 @@ void ami_tree_drag_icon_show(struct treeview_window *twin)
if((twin->type == AMI_TREE_COOKIES) ||
(twin->type == AMI_TREE_SSLCERT)) return; /* No permissable drag operations */
-
+#if 0
node = tree_get_selected_node(tree_get_root(twin->tree));
if(node && tree_node_is_folder(node))
@@ -294,6 +294,7 @@ void ami_tree_drag_icon_show(struct treeview_window *twin)
}
ami_drag_icon_show(twin->win, type);
}
+#endif
}
void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
@@ -304,7 +305,7 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
BOOL drag;
if(drag = ami_drag_in_progress()) ami_drag_icon_close(twin->win);
-
+#if 0
if(drag && (twin != ami_window_at_pointer(AMINS_TVWINDOW)))
{
selected_node = tree_get_selected_node(tree_get_root(twin->tree));
@@ -349,6 +350,7 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
twin->drag_x, twin->drag_y); /* Keep the tree happy */
}
else
+#endif
{
if(tree_drag_status(twin->tree) == TREE_UNKNOWN_DRAG)
DisplayBeep(scrn);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0e5667e28e1a31da06a...
commit 0e5667e28e1a31da06a797a93b72ecb1942d28b9
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Botched fixes just to get it to compile again
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 27678db..797f581 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -1220,7 +1220,12 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
switch(itemid)
{
case CMID_TREE_LAUNCH:
- tree_launch_selected(tree, true);
+ tree_mouse_action(tree, BROWSER_MOUSE_DOUBLE_CLICK, 0, 0);
+ /**TODO: this needs fixing. ^^^^
+ (a) the mouse co-ordinates where the context menu was opened are not propagated and
+ (b) does a double-click here open ALL selected entries?
+ (c) what happens if the user right-clicked over a non-selected entry with others selected?
+ **/
break;
case CMID_TREE_EDITFOLDER:
@@ -1256,7 +1261,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
break;
case CMID_TREE_DELETE:
- tree_delete_selected_nodes(tree, userdata);
+ tree_keypress(tree, KEY_DELETE_RIGHT);
break;
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9af55136d0c899492f2...
commit 9af55136d0c899492f20466f8c96b3ba24302e68
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Disable the treeview context menu for now, as it needs fixing.
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 5a3da55..27678db 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -1029,6 +1029,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
void ami_context_menu_show_tree(struct tree *tree, struct Window *win, int type)
{
+#if 0
struct node *root = tree_get_root(tree);
struct node *sel_node = tree_get_selected_node(root);
bool has_selection = tree_node_has_selection(root);
@@ -1203,6 +1204,7 @@ void ami_context_menu_show_tree(struct tree *tree, struct Window *win, int type)
if(menu_content == true)
IDoMethod(ctxmenuobj, PM_OPEN, win);
+#endif
}
static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR reserved)
-----------------------------------------------------------------------
Summary of changes:
amiga/context_menu.c | 11 +++++-
amiga/gui.c | 90 ++++++++++++++++---------------------------------
amiga/hotlist.c | 69 ++++++++++++++++++++++++++++++++++++++
amiga/hotlist.h | 2 +
amiga/menu.c | 75 +++++------------------------------------
amiga/tree.c | 18 +++++----
6 files changed, 129 insertions(+), 136 deletions(-)
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 5a3da55..797f581 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -1029,6 +1029,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
void ami_context_menu_show_tree(struct tree *tree, struct Window *win, int type)
{
+#if 0
struct node *root = tree_get_root(tree);
struct node *sel_node = tree_get_selected_node(root);
bool has_selection = tree_node_has_selection(root);
@@ -1203,6 +1204,7 @@ void ami_context_menu_show_tree(struct tree *tree, struct Window *win, int type)
if(menu_content == true)
IDoMethod(ctxmenuobj, PM_OPEN, win);
+#endif
}
static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR reserved)
@@ -1218,7 +1220,12 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
switch(itemid)
{
case CMID_TREE_LAUNCH:
- tree_launch_selected(tree, true);
+ tree_mouse_action(tree, BROWSER_MOUSE_DOUBLE_CLICK, 0, 0);
+ /**TODO: this needs fixing. ^^^^
+ (a) the mouse co-ordinates where the context menu was opened are not propagated and
+ (b) does a double-click here open ALL selected entries?
+ (c) what happens if the user right-clicked over a non-selected entry with others selected?
+ **/
break;
case CMID_TREE_EDITFOLDER:
@@ -1254,7 +1261,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
break;
case CMID_TREE_DELETE:
- tree_delete_selected_nodes(tree, userdata);
+ tree_keypress(tree, KEY_DELETE_RIGHT);
break;
}
}
diff --git a/amiga/gui.c b/amiga/gui.c
index 6a9e6d2..6b18ccd 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -142,6 +142,12 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+struct ami_gui_tb_userdata {
+ struct List *sblist;
+ struct gui_window_2 *gw;
+ int items;
+};
+
struct MsgPort *appport;
struct Library *KeymapBase = NULL;
struct KeymapIFace *IKeymap = NULL;
@@ -2849,68 +2855,37 @@ void ami_update_buttons(struct gui_window_2 *gwin)
}
}
-void ami_gui_hotlist_scan_2(struct tree *tree, struct node *root, WORD *gen, int *item,
- struct List *speed_button_list, struct gui_window_2 *gwin)
+static bool ami_gui_hotlist_add(void *userdata, int level, int item, const char *title, nsurl *url, bool is_folder)
{
-#if 0
- struct node *tempnode;
- struct node_element *element=NULL;
- struct node *node;
+ struct ami_gui_tb_userdata *tb_userdata = (struct ami_gui_tb_userdata *)userdata;
struct Node *speed_button_node;
- *gen = *gen + 1;
-
- for (node = root; node; node = tree_node_get_next(node))
- {
- if((*gen == 1) && (*item < AMI_GUI_TOOLBAR_MAX)) /* Don't cascade into sub-dirs */
- {
- gwin->hotlist_toolbar_lab[*item] = ami_utf8_easy((char *)tree_url_node_get_title(node));
+ if(level != 1) return false;
+ if(item > AMI_GUI_TOOLBAR_MAX) return false;
+ if(is_folder == true) return false;
+
+ tb_userdata->gw->hotlist_toolbar_lab[item] = ami_utf8_easy(title);
- speed_button_node = AllocSpeedButtonNode(*item,
- SBNA_Text, gwin->hotlist_toolbar_lab[*item],
- SBNA_UserData, (void *)tree_url_node_get_url(node),
+ speed_button_node = AllocSpeedButtonNode(item,
+ SBNA_Text, tb_userdata->gw->hotlist_toolbar_lab[item],
+ SBNA_UserData, (void *)url,
TAG_DONE);
- AddTail(speed_button_list, speed_button_node);
-
- *item = *item + 1;
- }
-
- /* Don't need this atm as it cascades into sub-dirs
- if (tree_node_get_child(node))
- {
- ami_gui_hotlist_scan_2(tree, tree_node_get_child(node), gen);
- }
- */
- }
+ AddTail(tb_userdata->sblist, speed_button_node);
- *gen = *gen - 1;
-#endif
+ tb_userdata->items++;
+ return true;
}
int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_list, struct gui_window_2 *gwin)
{
-#if 0
- struct node *root = tree_node_get_child(tree_get_root(tree));
- struct node *node;
- struct node_element *element;
- WORD gen = 0;
- int item = 0;
-
- for (node = root; node; node = tree_node_get_next(node))
- {
- element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
- if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
- if(element && (strcmp(tree_node_element_get_text(element), messages_get("HotlistToolbar")) == 0))
- {
- ami_gui_hotlist_scan_2(tree, tree_node_get_child(node), &gen, &item, speed_button_list, gwin);
- }
- }
+ struct ami_gui_tb_userdata userdata;
+ userdata.gw = gwin;
+ userdata.sblist = speed_button_list;
+ userdata.items = 0;
- return item;
-#else
- return 0;
-#endif
+ ami_hotlist_scan((void *)&userdata, 0, messages_get("HotlistToolbar"), ami_gui_hotlist_add);
+ return userdata.items;
}
void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
@@ -4913,20 +4888,17 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
case GID_HOTLIST:
if(node = (struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) {
- GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&urltxt, TAG_DONE);
+ GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE);
- if (nsurl_create(urltxt, &url) != NSERROR_OK) {
- warn_user("NoMemory", 0);
- } else {
- if(gwin->key_state & BROWSER_MOUSE_MOD_2) {
- browser_window_create(BROWSER_WINDOW_VERIFIABLE |
+ if(gwin->key_state & BROWSER_MOUSE_MOD_2) {
+ browser_window_create(BROWSER_WINDOW_VERIFIABLE |
BROWSER_WINDOW_TAB,
url,
NULL,
gwin->bw,
NULL);
- } else {
- browser_window_navigate(gwin->bw,
+ } else {
+ browser_window_navigate(gwin->bw,
url,
NULL,
BROWSER_WINDOW_HISTORY |
@@ -4935,8 +4907,6 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
NULL,
NULL);
- }
- nsurl_unref(url);
}
}
break;
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index 6fa1568..70f0143 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -19,6 +19,17 @@
#include <proto/exec.h>
#include "amiga/hotlist.h"
#include "amiga/tree.h"
+#include "desktop/hotlist.h"
+
+struct ami_hotlist_ctx {
+ void *userdata;
+ int level;
+ int item;
+ const char *folder; /* folder we're interested in */
+ bool in_menu; /* set if we are in that folder */
+ bool (*cb)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder);
+};
+
void ami_hotlist_initialise(const char *hotlist_file)
{
@@ -33,3 +44,61 @@ void ami_hotlist_free(const char *hotlist_file)
ami_tree_destroy(hotlist_window);
hotlist_window = NULL;
}
+
+
+static nserror ami_hotlist_folder_enter_cb(void *ctx, const char *title)
+{
+ struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
+
+ if(menu_ctx->in_menu == true) {
+ if(menu_ctx->cb(menu_ctx->userdata, menu_ctx->level, menu_ctx->item, title, NULL, true) == true)
+ menu_ctx->item++;
+ } else {
+ if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0))
+ menu_ctx->in_menu = true;
+ }
+ menu_ctx->level++;
+ return NSERROR_OK;
+}
+
+static nserror ami_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
+{
+ struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
+
+ if(menu_ctx->in_menu == true) {
+ if(menu_ctx->cb(menu_ctx->userdata, menu_ctx->level, menu_ctx->item, title, url, false) == true)
+ menu_ctx->item++;
+ }
+
+ return NSERROR_OK;
+}
+
+static nserror ami_hotlist_folder_leave_cb(void *ctx)
+{
+ struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
+
+ menu_ctx->level--;
+
+ if((menu_ctx->in_menu == true) && (menu_ctx->level == 0))
+ menu_ctx->in_menu = false;
+
+ return NSERROR_OK;
+}
+
+nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder,
+ bool (*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder))
+{
+ struct ami_hotlist_ctx ctx;
+
+ ctx.level = 0;
+ ctx.item = first_item;
+ ctx.folder = folder;
+ ctx.in_menu = false;
+ ctx.userdata = userdata;
+ ctx.cb = cb_add_item;
+
+ return hotlist_iterate(&ctx,
+ ami_hotlist_folder_enter_cb,
+ ami_hotlist_address_cb,
+ ami_hotlist_folder_leave_cb);
+}
diff --git a/amiga/hotlist.h b/amiga/hotlist.h
index ee258af..54f8a63 100755
--- a/amiga/hotlist.h
+++ b/amiga/hotlist.h
@@ -23,6 +23,8 @@
void ami_hotlist_initialise(const char *hotlist_file);
void ami_hotlist_free(const char *hotlist_file);
+nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder,
+ bool (*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder));
struct treeview_window *hotlist_window;
#endif
diff --git a/amiga/menu.c b/amiga/menu.c
index d8e49fc..e75e037 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -73,14 +73,6 @@ enum {
NSA_GLYPH_MAX
};
-struct ami_hotlist_ctx {
- struct gui_window_2 *gw;
- int level;
- int item;
- bool in_menu;
-};
-
-
BOOL menualreadyinit;
const char * const netsurf_version;
const char * const verdate;
@@ -543,15 +535,15 @@ void ami_menu_arexx_scan(struct gui_window_2 *gwin)
gwin->menu[item].nm_Label = NULL;
}
-static nserror ami_menu_hotlist_add(void *ctx, const char *title, nsurl *url, bool is_folder)
+static bool ami_menu_hotlist_add(void *userdata, int level, int item, const char *title, nsurl *url, bool is_folder)
{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
UBYTE type;
char *icon;
+ struct gui_window_2 *gw = (struct gui_window_2 *)userdata;
- if(menu_ctx->item >= AMI_MENU_HOTLIST_MAX) return NSERROR_OK;
+ if(item >= AMI_MENU_HOTLIST_MAX) return false;
- switch(menu_ctx->level) {
+ switch(level) {
case 1:
type = NM_ITEM;
break;
@@ -560,7 +552,7 @@ static nserror ami_menu_hotlist_add(void *ctx, const char *title, nsurl *url, bo
break;
default:
/* entries not at level 1 or 2 are not able to be added */
- return NSERROR_OK;
+ return false;
break;
}
@@ -570,66 +562,17 @@ static nserror ami_menu_hotlist_add(void *ctx, const char *title, nsurl *url, bo
icon = "icons/content.png";
}
- ami_menu_alloc_item(menu_ctx->gw, menu_ctx->item, type, title,
+ ami_menu_alloc_item(gw, item, type, title,
0, icon, ami_menu_item_hotlist_entries, (void *)url);
if((is_folder == true) && (type == NM_SUB))
- menu_ctx->gw->menu[menu_ctx->item].nm_Flags = NM_ITEMDISABLED;
-
- menu_ctx->item++;
-
- return NSERROR_OK;
-}
-
-static nserror ami_menu_hotlist_folder_enter_cb(void *ctx, const char *title)
-{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
- if(menu_ctx->in_menu == true) {
- ami_menu_hotlist_add(menu_ctx, title, NULL, true);
- } else {
- if((menu_ctx->level == 0) && (strcmp(title, messages_get("HotlistMenu")) == 0))
- menu_ctx->in_menu = true;
- }
-
- menu_ctx->level++;
- return NSERROR_OK;
-}
-
-static nserror ami_menu_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
-{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
- if(menu_ctx->in_menu == true)
- ami_menu_hotlist_add(menu_ctx, title, url, false);
-
- return NSERROR_OK;
-}
+ gw->menu[item].nm_Flags = NM_ITEMDISABLED;
-static nserror ami_menu_hotlist_folder_leave_cb(void *ctx)
-{
- struct ami_hotlist_ctx *menu_ctx = (struct ami_hotlist_ctx *)ctx;
-
- menu_ctx->level--;
-
- if((menu_ctx->in_menu == true) && (menu_ctx->level == 0))
- menu_ctx->in_menu = false;
-
- return NSERROR_OK;
+ return true;
}
static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin)
{
- struct ami_hotlist_ctx ctx;
-
- ctx.level = 0;
- ctx.item = 0;
- ctx.in_menu = false;
- ctx.gw = gwin;
-
- return hotlist_iterate(&ctx,
- ami_menu_hotlist_folder_enter_cb,
- ami_menu_hotlist_address_cb,
- ami_menu_hotlist_folder_leave_cb);
+ return ami_hotlist_scan((void *)gwin, AMI_MENU_HOTLIST, messages_get("HotlistMenu"), ami_menu_hotlist_add);
}
void ami_menu_update_checked(struct gui_window_2 *gwin)
diff --git a/amiga/tree.c b/amiga/tree.c
index 5aee277..a8f22e9 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -272,7 +272,7 @@ void ami_tree_drag_icon_show(struct treeview_window *twin)
if((twin->type == AMI_TREE_COOKIES) ||
(twin->type == AMI_TREE_SSLCERT)) return; /* No permissable drag operations */
-
+#if 0
node = tree_get_selected_node(tree_get_root(twin->tree));
if(node && tree_node_is_folder(node))
@@ -294,6 +294,7 @@ void ami_tree_drag_icon_show(struct treeview_window *twin)
}
ami_drag_icon_show(twin->win, type);
}
+#endif
}
void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
@@ -304,7 +305,7 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
BOOL drag;
if(drag = ami_drag_in_progress()) ami_drag_icon_close(twin->win);
-
+#if 0
if(drag && (twin != ami_window_at_pointer(AMINS_TVWINDOW)))
{
selected_node = tree_get_selected_node(tree_get_root(twin->tree));
@@ -349,6 +350,7 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
twin->drag_x, twin->drag_y); /* Keep the tree happy */
}
else
+#endif
{
if(tree_drag_status(twin->tree) == TREE_UNKNOWN_DRAG)
DisplayBeep(scrn);
@@ -494,13 +496,12 @@ void ami_tree_update_buttons(struct treeview_window *twin)
{
if(twin->type == AMI_TREE_SSLCERT) return;
- if(tree_node_has_selection(tree_get_root(twin->tree)))
- {
+ if(((twin->type == AMI_TREE_HOTLIST) && (hotlist_has_selection())) ||
+ ((twin->type == AMI_TREE_COOKIES) && (cookie_manager_has_selection())) ||
+ ((twin->type == AMI_TREE_HISTORY) && (global_history_has_selection()))) {
OnMenu(twin->win, AMI_TREE_MENU_DELETE);
OnMenu(twin->win, AMI_TREE_MENU_CLEAR);
- }
- else
- {
+ } else {
OffMenu(twin->win, AMI_TREE_MENU_DELETE);
OffMenu(twin->win, AMI_TREE_MENU_CLEAR);
}
@@ -881,12 +882,13 @@ BOOL ami_tree_event(struct treeview_window *twin)
if(twin->drag_y == 0) twin->drag_y = y;
break;
case MENUDOWN:
+#if 0
if(tree_node_has_selection(tree_get_root(twin->tree)) == false)
{
tree_set_node_selected_at(twin->tree, x, y, true);
}
ami_context_menu_show_tree(twin->tree, twin->win, twin->type);
-
+#endif
break;
}
}
--
NetSurf Browser
9 years, 8 months
netsurf: branch master updated. release/3.0-550-g9c55158
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/9c551589bd0a2214706e1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/9c551589bd0a2214706e18f...
...tree http://git.netsurf-browser.org/netsurf.git/tree/9c551589bd0a2214706e18ff8...
The branch, master has been updated
via 9c551589bd0a2214706e18ff80720875cf5b9860 (commit)
via c04cef649a163c3131c8560d44fb3dd458929345 (commit)
from becc7fe064c2b22a32900a02aee1043fc349425d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9c551589bd0a2214706...
commit 9c551589bd0a2214706e18ff80720875cf5b9860
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Added comments.
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 30f70c2..01f5483 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -1185,7 +1185,10 @@ void gemtk_wm_send_msg(GUIWIN *win, short msg_type, short a, short b, short c,
appl_write(gl_apid, 16, &msg);
}
-/** Directly execute an Message to a GUIWIN using internal dispatcher
+/** Directly execute an Message to a GUIWIN using the internal dispatcher function.
+* This only works for managed windows which have the,
+ GEMTK_WM_FLAG_PREPROC_WM flag set.
+ This call does not send any AES messages.
* \param win the GUIWIN which shall receive the message
* \param msg_type the WM_ message definition
* \param a the 4th parameter to appl_write
diff --git a/atari/history.c b/atari/history.c
index 1a19d4a..6da8eeb 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -107,15 +107,24 @@ bool atari_global_history_init( void )
GRECT desk;
int flags = ATARI_TREEVIEW_WIDGETS;
+ // initialize state options:
gl_history.open = false;
+
+ // Create an AES window:
handle = wind_create(flags, 40, 40, desk_area.g_w, desk_area.g_h);
+
+ // add the AES window to the gemtk window manager:
gl_history.window = gemtk_wm_add(handle, GEMTK_WM_FLAG_DEFAULTS, NULL);
+
if( gl_history.window == NULL ) {
LOG(("Failed to allocate history window"));
return( false );
}
+
+ // Set window title:
wind_set_str(handle, WF_NAME, (char*)messages_get("GlobalHistory"));
+ // Make the window part of the netsurf treeview framework:
gl_history.tv = atari_treeview_create(TREE_HISTORY,
gl_history.window, handle_event);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c04cef649a163c3131c...
commit c04cef649a163c3131c8560d44fb3dd458929345
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Also setup slider info before tree creation.
diff --git a/atari/treeview.c b/atari/treeview.c
index d03ff21..8565484 100755
--- a/atari/treeview.c
+++ b/atari/treeview.c
@@ -279,13 +279,6 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
gemtk_wm_set_event_handler(win, handle_event);
gemtk_wm_set_user_data(win, (void*)new);
- // now create a new netsurf tree:
- new->tree = tree_create(flags, &atari_tree_callbacks, new);
- if (new->tree == NULL) {
- free(new);
- return NULL;
- }
-
// Get acces to the gemtk scroll info struct:
slid = gemtk_wm_get_scroll_info(new->window);
@@ -294,6 +287,13 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
slid->y_unit_px = 16;
slid->x_unit_px = 16;
+ // now create a new netsurf tree:
+ new->tree = tree_create(flags, &atari_tree_callbacks, new);
+ if (new->tree == NULL) {
+ free(new);
+ return NULL;
+ }
+
return(new);
}
@@ -301,7 +301,6 @@ void atari_treeview_open( NSTREEVIEW tv )
{
if( tv->window != NULL ) {
gemtk_wm_link(tv->window);
-
}
}
@@ -478,13 +477,23 @@ void atari_treeview_resized(struct tree *tree, int width, int height, void *pw)
tv->extent.x = width;
tv->extent.y = height;
+
struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(tv->window);
gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &area);
- slid->x_units = (width/slid->x_unit_px);
- slid->y_units = (height/slid->y_unit_px);
+
+ if(width > -1) {
+ slid->x_units = (width/slid->x_unit_px);
+ gemtk_wm_update_slider(tv->window, GEMTK_WM_HSLIDER);
+ }
+
+ if(height > -1){
+ slid->y_units = (height/slid->y_unit_px);
+ gemtk_wm_update_slider(tv->window, GEMTK_WM_VSLIDER);
+ }
+
/*printf("units content: %d, units viewport: %d\n", (height/slid->y_unit_px),
(area.g_h/slid->y_unit_px));*/
- gemtk_wm_update_slider(tv->window, GEMTK_WM_VH_SLIDER);
+ //gemtk_wm_update_slider(tv->window, GEMTK_WM_VH_SLIDER);
}
}
-----------------------------------------------------------------------
Summary of changes:
atari/gemtk/guiwin.c | 5 ++++-
atari/history.c | 9 +++++++++
atari/treeview.c | 31 ++++++++++++++++++++-----------
3 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 30f70c2..01f5483 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -1185,7 +1185,10 @@ void gemtk_wm_send_msg(GUIWIN *win, short msg_type, short a, short b, short c,
appl_write(gl_apid, 16, &msg);
}
-/** Directly execute an Message to a GUIWIN using internal dispatcher
+/** Directly execute an Message to a GUIWIN using the internal dispatcher function.
+* This only works for managed windows which have the,
+ GEMTK_WM_FLAG_PREPROC_WM flag set.
+ This call does not send any AES messages.
* \param win the GUIWIN which shall receive the message
* \param msg_type the WM_ message definition
* \param a the 4th parameter to appl_write
diff --git a/atari/history.c b/atari/history.c
index 1a19d4a..6da8eeb 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -107,15 +107,24 @@ bool atari_global_history_init( void )
GRECT desk;
int flags = ATARI_TREEVIEW_WIDGETS;
+ // initialize state options:
gl_history.open = false;
+
+ // Create an AES window:
handle = wind_create(flags, 40, 40, desk_area.g_w, desk_area.g_h);
+
+ // add the AES window to the gemtk window manager:
gl_history.window = gemtk_wm_add(handle, GEMTK_WM_FLAG_DEFAULTS, NULL);
+
if( gl_history.window == NULL ) {
LOG(("Failed to allocate history window"));
return( false );
}
+
+ // Set window title:
wind_set_str(handle, WF_NAME, (char*)messages_get("GlobalHistory"));
+ // Make the window part of the netsurf treeview framework:
gl_history.tv = atari_treeview_create(TREE_HISTORY,
gl_history.window, handle_event);
diff --git a/atari/treeview.c b/atari/treeview.c
index d03ff21..8565484 100755
--- a/atari/treeview.c
+++ b/atari/treeview.c
@@ -279,13 +279,6 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
gemtk_wm_set_event_handler(win, handle_event);
gemtk_wm_set_user_data(win, (void*)new);
- // now create a new netsurf tree:
- new->tree = tree_create(flags, &atari_tree_callbacks, new);
- if (new->tree == NULL) {
- free(new);
- return NULL;
- }
-
// Get acces to the gemtk scroll info struct:
slid = gemtk_wm_get_scroll_info(new->window);
@@ -294,6 +287,13 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
slid->y_unit_px = 16;
slid->x_unit_px = 16;
+ // now create a new netsurf tree:
+ new->tree = tree_create(flags, &atari_tree_callbacks, new);
+ if (new->tree == NULL) {
+ free(new);
+ return NULL;
+ }
+
return(new);
}
@@ -301,7 +301,6 @@ void atari_treeview_open( NSTREEVIEW tv )
{
if( tv->window != NULL ) {
gemtk_wm_link(tv->window);
-
}
}
@@ -478,13 +477,23 @@ void atari_treeview_resized(struct tree *tree, int width, int height, void *pw)
tv->extent.x = width;
tv->extent.y = height;
+
struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(tv->window);
gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &area);
- slid->x_units = (width/slid->x_unit_px);
- slid->y_units = (height/slid->y_unit_px);
+
+ if(width > -1) {
+ slid->x_units = (width/slid->x_unit_px);
+ gemtk_wm_update_slider(tv->window, GEMTK_WM_HSLIDER);
+ }
+
+ if(height > -1){
+ slid->y_units = (height/slid->y_unit_px);
+ gemtk_wm_update_slider(tv->window, GEMTK_WM_VSLIDER);
+ }
+
/*printf("units content: %d, units viewport: %d\n", (height/slid->y_unit_px),
(area.g_h/slid->y_unit_px));*/
- gemtk_wm_update_slider(tv->window, GEMTK_WM_VH_SLIDER);
+ //gemtk_wm_update_slider(tv->window, GEMTK_WM_VH_SLIDER);
}
}
--
NetSurf Browser
9 years, 8 months
netsurf: branch master updated. release/3.0-548-gbecc7fe
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/becc7fe064c2b22a32900...
...commit http://git.netsurf-browser.org/netsurf.git/commit/becc7fe064c2b22a32900a0...
...tree http://git.netsurf-browser.org/netsurf.git/tree/becc7fe064c2b22a32900a02a...
The branch, master has been updated
via becc7fe064c2b22a32900a02aee1043fc349425d (commit)
from 65a658769ed25e0cb313f2ac5c1bfcac159a1cf4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=becc7fe064c2b22a329...
commit becc7fe064c2b22a32900a02aee1043fc349425d
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Set window ref before calling tree_create. Fixes crash during startup.
(tree_create causes an resize event which requires the window handle
to be available).
diff --git a/atari/treeview.c b/atari/treeview.c
index f25bf7e..d03ff21 100755
--- a/atari/treeview.c
+++ b/atari/treeview.c
@@ -259,25 +259,38 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
gemtk_wm_event_handler_f user_func)
{
struct gemtk_wm_scroll_info_s *slid;
+ NSTREEVIEW new;
if( win == NULL )
return( NULL );
- NSTREEVIEW new = malloc(sizeof(struct atari_treeview));
+
+ new = malloc(sizeof(struct atari_treeview));
if (new == NULL)
return NULL;
- memset( new, 0, sizeof(struct atari_treeview));
- new->tree = tree_create(flags, &atari_tree_callbacks, new);
- if (new->tree == NULL) {
- free(new);
- return NULL;
- }
+
+ memset(new, 0, sizeof(struct atari_treeview));
+
+ /* Store the window ref inside the new treeview: */
new->window = win;
new->user_func = user_func;
+ // Setup gemtk event handler function and set the userdata
+ // to be the new treeview:
gemtk_wm_set_event_handler(win, handle_event);
gemtk_wm_set_user_data(win, (void*)new);
+ // now create a new netsurf tree:
+ new->tree = tree_create(flags, &atari_tree_callbacks, new);
+ if (new->tree == NULL) {
+ free(new);
+ return NULL;
+ }
+
+ // Get acces to the gemtk scroll info struct:
slid = gemtk_wm_get_scroll_info(new->window);
+
+ // Setup line and column height/width of the window,
+ // each scroll takes the configured steps:
slid->y_unit_px = 16;
slid->x_unit_px = 16;
@@ -462,6 +475,7 @@ void atari_treeview_resized(struct tree *tree, int width, int height, void *pw)
NSTREEVIEW tv = (NSTREEVIEW) pw;
if( tv->disposing )
return;
+
tv->extent.x = width;
tv->extent.y = height;
struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(tv->window);
-----------------------------------------------------------------------
Summary of changes:
atari/treeview.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/atari/treeview.c b/atari/treeview.c
index f25bf7e..d03ff21 100755
--- a/atari/treeview.c
+++ b/atari/treeview.c
@@ -259,25 +259,38 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
gemtk_wm_event_handler_f user_func)
{
struct gemtk_wm_scroll_info_s *slid;
+ NSTREEVIEW new;
if( win == NULL )
return( NULL );
- NSTREEVIEW new = malloc(sizeof(struct atari_treeview));
+
+ new = malloc(sizeof(struct atari_treeview));
if (new == NULL)
return NULL;
- memset( new, 0, sizeof(struct atari_treeview));
- new->tree = tree_create(flags, &atari_tree_callbacks, new);
- if (new->tree == NULL) {
- free(new);
- return NULL;
- }
+
+ memset(new, 0, sizeof(struct atari_treeview));
+
+ /* Store the window ref inside the new treeview: */
new->window = win;
new->user_func = user_func;
+ // Setup gemtk event handler function and set the userdata
+ // to be the new treeview:
gemtk_wm_set_event_handler(win, handle_event);
gemtk_wm_set_user_data(win, (void*)new);
+ // now create a new netsurf tree:
+ new->tree = tree_create(flags, &atari_tree_callbacks, new);
+ if (new->tree == NULL) {
+ free(new);
+ return NULL;
+ }
+
+ // Get acces to the gemtk scroll info struct:
slid = gemtk_wm_get_scroll_info(new->window);
+
+ // Setup line and column height/width of the window,
+ // each scroll takes the configured steps:
slid->y_unit_px = 16;
slid->x_unit_px = 16;
@@ -462,6 +475,7 @@ void atari_treeview_resized(struct tree *tree, int width, int height, void *pw)
NSTREEVIEW tv = (NSTREEVIEW) pw;
if( tv->disposing )
return;
+
tv->extent.x = width;
tv->extent.y = height;
struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(tv->window);
--
NetSurf Browser
9 years, 8 months
libcss: branch master updated. release/0.2.0-11-ga27846b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/a27846b490a4a907872a62...
...commit http://git.netsurf-browser.org/libcss.git/commit/a27846b490a4a907872a62e5...
...tree http://git.netsurf-browser.org/libcss.git/tree/a27846b490a4a907872a62e568...
The branch, master has been updated
via a27846b490a4a907872a62e568c412e6d1fc96b6 (commit)
via 72a98c0dd6dfad592a4ec9883d4071b55e87f811 (commit)
via bae45a3a08fb41d86725c51512c761a40ba305a2 (commit)
via bc9c80c2dbf21d805f5372aea3df14d310a1512c (commit)
from 2234cab352b0ef702b32aaa7ef433c4793086824 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=a27846b490a4a907872a...
commit a27846b490a4a907872a62e568c412e6d1fc96b6
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Update test dumpers to output writing-mode.
diff --git a/test/dump.h b/test/dump.h
index 73b61ea..941117c 100644
--- a/test/dump.h
+++ b/test/dump.h
@@ -476,6 +476,7 @@ static const char *opcode_names[] = {
"column-rule-width",
"column-span",
"column-width",
+ "writing-mode",
};
static void dump_css_fixed(css_fixed f, char **ptr)
@@ -2529,6 +2530,19 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
break;
}
break;
+ case CSS_PROP_WRITING_MODE:
+ switch (value) {
+ case WRITING_MODE_HORIZONTAL_TB:
+ *ptr += sprintf(*ptr, "horizontal-tb");
+ break;
+ case WRITING_MODE_VERTICAL_RL:
+ *ptr += sprintf(*ptr, "vertical-rl");
+ break;
+ case WRITING_MODE_VERTICAL_LR:
+ *ptr += sprintf(*ptr, "vertical-lr");
+ break;
+ }
+ break;
case CSS_PROP_Z_INDEX:
switch (value) {
case Z_INDEX_SET:
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 6a29c2d..451ba1a 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -2472,6 +2472,28 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* writing-mode */
+ val = css_computed_writing_mode(style);
+ switch (val) {
+ case CSS_WRITING_MODE_INHERIT:
+ wrote = snprintf(ptr, *len, "writing-mode: inherit\n");
+ break;
+ case CSS_WRITING_MODE_HORIZONTAL_TB:
+ wrote = snprintf(ptr, *len, "writing-mode: horizontal-tb\n");
+ break;
+ case CSS_WRITING_MODE_VERTICAL_RL:
+ wrote = snprintf(ptr, *len, "writing-mode: vertical-rl\n");
+ break;
+ case CSS_WRITING_MODE_VERTICAL_LR:
+ wrote = snprintf(ptr, *len, "writing-mode: vertical-lr\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* z-index */
val = css_computed_z_index(style, &zindex);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=72a98c0dd6dfad592a4e...
commit 72a98c0dd6dfad592a4ec9883d4071b55e87f811
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add tests for writing-mode. Update selection tests to handle writing-mode.
diff --git a/test/data/parse/properties.dat b/test/data/parse/properties.dat
index efe06ee..d96d826 100644
--- a/test/data/parse/properties.dat
+++ b/test/data/parse/properties.dat
@@ -4262,3 +4262,55 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
| 0x0200006e 0x00000066 0x00000002
#reset
+##
+## 6f - writing-mode
+##
+
+#data
+* { writing-mode: horizontal-tb; }
+#errors
+#expected
+| 1 *
+| 0x0000006f
+#reset
+
+#data
+* { writing-mode: vertical-rl; }
+#errors
+#expected
+| 1 *
+| 0x0004006f
+#reset
+
+#data
+* { writing-mode: vertical-lr; }
+#errors
+#expected
+| 1 *
+| 0x0008006f
+#reset
+
+#data
+* { writing-mode: inherit }
+#errors
+#expected
+| 1 *
+| 0x0000086f
+#reset
+
+#data
+* { writing-mode: inherit ! important }
+#errors
+#expected
+| 1 *
+| 0x00000c6f
+#reset
+
+#data
+* { writing-mode: vertical-lr ! important }
+#errors
+#expected
+| 1 *
+| 0x0008046f
+#reset
+
diff --git a/test/data/parse2/illegal-values.dat b/test/data/parse2/illegal-values.dat
index b882328..3187e18 100644
--- a/test/data/parse2/illegal-values.dat
+++ b/test/data/parse2/illegal-values.dat
@@ -4455,6 +4455,27 @@ max-height: 30%; min-height: 2em; }
#reset
#data
+* { writing-mode: em; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { writing-mode: 2em; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { writing-mode: vertical; }
+#errors
+#expected
+| *
+#reset
+
+#data
* { z-index: - 40; }
#errors
#expected
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 4e9bf34..51c5426 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -89,6 +89,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -184,6 +185,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -279,6 +281,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -374,6 +377,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -461,6 +465,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -546,6 +551,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -632,6 +638,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -718,6 +725,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -803,6 +811,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -893,6 +902,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -983,6 +993,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1074,6 +1085,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1168,6 +1180,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1261,6 +1274,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1360,6 +1374,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1459,6 +1474,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1558,6 +1574,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1661,6 +1678,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1763,6 +1781,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1863,6 +1882,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1962,6 +1982,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2061,6 +2082,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2160,6 +2182,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2259,6 +2282,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2358,6 +2382,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2457,6 +2482,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2556,6 +2582,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2655,6 +2682,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2754,6 +2782,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2853,6 +2882,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2952,6 +2982,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3051,6 +3082,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3150,6 +3182,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3249,6 +3282,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3348,6 +3382,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3447,6 +3482,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3546,6 +3582,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3645,6 +3682,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3744,6 +3782,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3843,6 +3882,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3935,6 +3975,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -4027,5 +4068,99 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div
+| id=foo
+| p*
+#ua
+div, p { display: none; float: right; position: absolute; }
+#user
+p { display: block; writing-mode: vertical-lr; }
+#author
+div#foo p { letter-spacing: inherit; }
+div p { letter-spacing: horizontal-tb; }
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: inherit
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: inherit
+direction: inherit
+display: block
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: inherit
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: medium
+overflow: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: absolute
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: inherit
+writing-mode: vertical-lr
z-index: auto
#reset
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=bae45a3a08fb41d86725...
commit bae45a3a08fb41d86725c51512c761a40ba305a2
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add computed style accessor for writing-mode and and writing-mode to the property handler table.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 843795e..6e04e61 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -269,6 +269,9 @@ uint8_t css_computed_empty_cells(
uint8_t css_computed_float(
const css_computed_style *style);
+uint8_t css_computed_writing_mode(
+ const css_computed_style *style);
+
uint8_t css_computed_font_style(
const css_computed_style *style);
diff --git a/src/parse/properties/properties.c b/src/parse/properties/properties.c
index e8ca3ce..c4e939a 100644
--- a/src/parse/properties/properties.c
+++ b/src/parse/properties/properties.c
@@ -140,6 +140,7 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
css__parse_widows,
css__parse_width,
css__parse_word_spacing,
+ css__parse_writing_mode,
css__parse_z_index
};
diff --git a/src/select/computed.c b/src/select/computed.c
index 9f21d4a..059c76f 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -479,6 +479,27 @@ uint8_t css_computed_word_spacing(
#undef CSS_WORD_SPACING_SHIFT
#undef CSS_WORD_SPACING_INDEX
+#define CSS_WRITING_MODE_INDEX 4
+#define CSS_WRITING_MODE_SHIFT 1
+#define CSS_WRITING_MODE_MASK 0x6
+uint8_t css_computed_writing_mode(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[CSS_WRITING_MODE_INDEX];
+ bits &= CSS_WRITING_MODE_MASK;
+ bits >>= CSS_WRITING_MODE_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+ }
+
+ return CSS_WRITING_MODE_HORIZONTAL_TB;
+}
+#undef CSS_WRITING_MODE_MASK
+#undef CSS_WRITING_MODE_SHIFT
+#undef CSS_WRITING_MODE_INDEX
+
#define CSS_COUNTER_INCREMENT_INDEX 3
#define CSS_COUNTER_INCREMENT_SHIFT 1
#define CSS_COUNTER_INCREMENT_MASK 0x2
diff --git a/src/select/properties/properties.h b/src/select/properties/properties.h
index d0bb648..63cdb17 100644
--- a/src/select/properties/properties.h
+++ b/src/select/properties/properties.h
@@ -131,6 +131,7 @@ PROPERTY_FUNCS(white_space);
PROPERTY_FUNCS(widows);
PROPERTY_FUNCS(width);
PROPERTY_FUNCS(word_spacing);
+PROPERTY_FUNCS(writing_mode);
PROPERTY_FUNCS(z_index);
#undef PROPERTY_FUNCS
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=bc9c80c2dbf21d805f53...
commit bc9c80c2dbf21d805f5372aea3df14d310a1512c
Author: Caitlin Potter <snowball(a)defpixel.com>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add support for parsing the writing-mode property. Thanks to Caitlin Potter.
diff --git a/docs/Bytecode b/docs/Bytecode
index 900b1f9..b4154b5 100644
--- a/docs/Bytecode
+++ b/docs/Bytecode
@@ -1232,6 +1232,15 @@ Opcodes
bits 0-6: 0000000 => auto,
other => rffe.
+6f - writing-mode
+ <value> (14bits) :
+ bits 8-13: MBZ
+ bits 0-7 :
+ 00000000 => horizontal-tb,
+ 00000001 => vertical-rl,
+ 00000010 => vertical-lr,
+ other => Reserved for future expansion.
+
-6f-3ff - Reserved for future expansion.
+70-3ff - Reserved for future expansion.
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index feba9ce..bbb6baa 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -125,6 +125,7 @@ enum css_properties_e {
CSS_PROP_COLUMN_RULE_WIDTH = 0x06c,
CSS_PROP_COLUMN_SPAN = 0x06d,
CSS_PROP_COLUMN_WIDTH = 0x06e,
+ CSS_PROP_WRITING_MODE = 0x06f,
CSS_N_PROPERTIES
};
@@ -740,6 +741,13 @@ enum css_word_spacing_e {
CSS_WORD_SPACING_NORMAL = 0x2
};
+enum css_writing_mode_e {
+ CSS_WRITING_MODE_INHERIT = 0x0,
+ CSS_WRITING_MODE_HORIZONTAL_TB = 0x1,
+ CSS_WRITING_MODE_VERTICAL_RL = 0x2,
+ CSS_WRITING_MODE_VERTICAL_LR = 0x3
+};
+
enum css_z_index_e {
CSS_Z_INDEX_INHERIT = 0x0,
CSS_Z_INDEX_SET = 0x1,
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index a0d38d4..544687a 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -718,6 +718,12 @@ enum op_word_spacing {
WORD_SPACING_NORMAL = 0x0000
};
+enum op_writing_mode {
+ WRITING_MODE_HORIZONTAL_TB = 0x0000,
+ WRITING_MODE_VERTICAL_RL = 0x0001,
+ WRITING_MODE_VERTICAL_LR = 0x0002
+};
+
enum op_z_index {
Z_INDEX_SET = 0x0080,
diff --git a/src/parse/properties/properties.gen b/src/parse/properties/properties.gen
index 5a4ebe0..80f1a30 100644
--- a/src/parse/properties/properties.gen
+++ b/src/parse/properties/properties.gen
@@ -212,3 +212,4 @@ column_span:CSS_PROP_COLUMN_SPAN IDENT:( INHERIT: NONE:0,COLUMN_SPAN_NONE ALL:0,
column_width:CSS_PROP_COLUMN_WIDTH IDENT:( INHERIT: AUTO:0,COLUMN_WIDTH_AUTO IDENT:) LENGTH_UNIT:( UNIT_PX:COLUMN_WIDTH_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ||unit&UNIT_PCT LENGTH_UNIT:)
+writing_mode:CSS_PROP_WRITING_MODE IDENT:( INHERIT: HORIZONTAL_TB:0,WRITING_MODE_HORIZONTAL_TB VERTICAL_RL:0,WRITING_MODE_VERTICAL_RL VERTICAL_LR:0,WRITING_MODE_VERTICAL_LR IDENT:)
diff --git a/src/parse/properties/properties.h b/src/parse/properties/properties.h
index 7280d93..7c4d8a1 100644
--- a/src/parse/properties/properties.h
+++ b/src/parse/properties/properties.h
@@ -406,6 +406,9 @@ css_error css__parse_width(css_language *c,
css_error css__parse_word_spacing(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
+css_error css__parse_writing_mode(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
css_error css__parse_z_index(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 35466eb..913241c 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -210,6 +210,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "widows", SLEN("widows") },
{ "width", SLEN("width") },
{ "word-spacing", SLEN("word-spacing") },
+ { "writing-mode", SLEN("writing-mode") },
{ "z-index", SLEN("z-index") },
{ "inherit", SLEN("inherit") },
@@ -406,6 +407,9 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "avoid-page", SLEN("avoid_page") },
{ "avoid-column", SLEN("avoid-column") },
{ "balance", SLEN("balance") },
+ { "horizontal-tb", SLEN("horizontal-tb") },
+ { "vertical-rl", SLEN("vertical-rl") },
+ { "vertical-lr", SLEN("vertical-lr") },
{ "aliceblue", SLEN("aliceblue") },
{ "antiquewhite", SLEN("antiquewhite") },
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 2ed0743..72a60ae 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -64,7 +64,8 @@ enum {
SPEAK_HEADER, SPEAK_NUMERAL, SPEAK_PUNCTUATION, SPEAK, SPEECH_RATE,
STRESS, TABLE_LAYOUT, TEXT_ALIGN, TEXT_DECORATION, TEXT_INDENT,
TEXT_TRANSFORM, TOP, UNICODE_BIDI, VERTICAL_ALIGN, VISIBILITY,
- VOICE_FAMILY, VOLUME, WHITE_SPACE, WIDOWS, WIDTH, WORD_SPACING, Z_INDEX,
+ VOICE_FAMILY, VOLUME, WHITE_SPACE, WIDOWS, WIDTH, WORD_SPACING,
+ WRITING_MODE, Z_INDEX,
LAST_PROP = Z_INDEX,
@@ -96,7 +97,7 @@ enum {
LINE_THROUGH, BLINK, RGB, RGBA, HSL, HSLA, LIBCSS_LEFT, LIBCSS_CENTER,
LIBCSS_RIGHT, CURRENTCOLOR, ODD, EVEN, SRC, LOCAL, INITIAL,
FORMAT, WOFF, TRUETYPE, OPENTYPE, EMBEDDED_OPENTYPE, SVG, COLUMN,
- AVOID_PAGE, AVOID_COLUMN, BALANCE,
+ AVOID_PAGE, AVOID_COLUMN, BALANCE, HORIZONTAL_TB, VERTICAL_RL, VERTICAL_LR,
/* Named colours */
FIRST_COLOUR,
diff --git a/src/select/computed.h b/src/select/computed.h
index f891047..8be3873 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -59,7 +59,7 @@ typedef struct css_computed_uncommon {
* 2 ooooooob outline-width | border-spacing
* 3 bbbbbbbb border-spacing
* 4 wwwwwwir word-spacing | counter-increment | counter-reset
- * 5 uuuuu... cursor | <unused>
+ * 5 uuuuumm. cursor | writing-mode | <unused>
* 6 cccccccc clip
* 7 cccccccc clip
* 8 ccccccoo clip | content
diff --git a/src/select/dispatch.c b/src/select/dispatch.c
index 85c1289..03d5c63 100644
--- a/src/select/dispatch.c
+++ b/src/select/dispatch.c
@@ -572,5 +572,10 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = {
PROPERTY_FUNCS(column_width),
0,
GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(writing_mode),
+ 0,
+ GROUP_UNCOMMON
}
};
diff --git a/src/select/properties/Makefile b/src/select/properties/Makefile
index a557846..eacc240 100644
--- a/src/select/properties/Makefile
+++ b/src/select/properties/Makefile
@@ -110,6 +110,7 @@ white_space.c \
width.c \
windows.c \
word_spacing.c \
+writing_mode.c \
z_index.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/select/properties/writing_mode.c b/src/select/properties/writing_mode.c
new file mode 100644
index 0000000..3ec1352
--- /dev/null
+++ b/src/select/properties/writing_mode.c
@@ -0,0 +1,70 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2009 John-Mark Bell <jmb(a)netsurf-browser.org>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_writing_mode(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ bool inherit = isInherit(opv);
+ uint16_t writing_mode = CSS_WRITING_MODE_INHERIT;
+ UNUSED(style);
+
+ if (inherit == false) {
+ switch (getValue(opv)) {
+ case WRITING_MODE_HORIZONTAL_TB:
+ writing_mode = CSS_WRITING_MODE_HORIZONTAL_TB;
+ break;
+ case WRITING_MODE_VERTICAL_RL:
+ writing_mode = CSS_WRITING_MODE_VERTICAL_RL;
+ break;
+ case WRITING_MODE_VERTICAL_LR:
+ writing_mode = CSS_WRITING_MODE_VERTICAL_LR;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ inherit)) {
+ return set_writing_mode(state->computed, writing_mode);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_writing_mode_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_writing_mode(style, hint->status);
+}
+
+css_error css__initial_writing_mode(css_select_state *state)
+{
+ return set_writing_mode(state->computed,
+ CSS_WRITING_MODE_HORIZONTAL_TB);
+}
+
+css_error css__compose_writing_mode(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t writing_mode = get_writing_mode(child);
+
+ if (writing_mode == CSS_WRITING_MODE_INHERIT) {
+ writing_mode = get_writing_mode(parent);
+ }
+
+ return set_writing_mode(result, writing_mode);
+}
+
diff --git a/src/select/propget.h b/src/select/propget.h
index 41f6315..16b8fc2 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -174,6 +174,25 @@ static inline uint8_t get_word_spacing(
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_INDEX
+#define WRITING_MODE_INDEX 4
+#define WRITING_MODE_MASK 0x6
+#define WRITING_MODE_SHIFT 1
+static inline uint8_t get_writing_mode(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[WRITING_MODE_INDEX];
+ bits &= WRITING_MODE_MASK;
+ bits >>= WRITING_MODE_SHIFT;
+ return bits;
+ }
+
+ return CSS_WRITING_MODE_HORIZONTAL_TB;
+}
+#undef WRITING_MODE_INDEX
+#undef WRITING_MODE_MASK
+#undef WRITING_MODE_SHIFT
+
#define COUNTER_INCREMENT_INDEX 3
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
diff --git a/src/select/propset.h b/src/select/propset.h
index 2b705ae..29e8ae5 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -22,7 +22,7 @@ static const css_computed_uncommon default_uncommon = {
0,
(CSS_WORD_SPACING_INHERIT << 2) |
(CSS_COUNTER_INCREMENT_NONE << 1) | CSS_COUNTER_RESET_NONE,
- (CSS_CURSOR_INHERIT << 3) | 0,
+ (CSS_CURSOR_INHERIT << 3) | (CSS_WRITING_MODE_INHERIT << 1) | 0,
0,
0,
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL
@@ -214,6 +214,28 @@ static inline css_error set_word_spacing(
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_INDEX
+#define WRITING_MODE_INDEX 4
+#define WRITING_MODE_SHIFT 1
+#define WRITING_MODE_MASK 0x6
+static inline css_error set_writing_mode(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[WRITING_MODE_INDEX];
+
+ /* 2bits: type */
+ *bits = (*bits & ~WRITING_MODE_MASK) |
+ ((type & 0x3) << WRITING_MODE_SHIFT);
+
+ return CSS_OK;
+}
+#undef WRITING_MODE_MASK
+#undef WRITING_MODE_SHIFT
+#undef WRITING_MODE_INDEX
+
#define COUNTER_INCREMENT_INDEX 3
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
-----------------------------------------------------------------------
Summary of changes:
docs/Bytecode | 11 +++-
include/libcss/computed.h | 3 +
include/libcss/properties.h | 8 ++
src/bytecode/opcodes.h | 6 ++
src/parse/properties/properties.c | 1 +
src/parse/properties/properties.gen | 1 +
src/parse/properties/properties.h | 3 +
src/parse/propstrings.c | 4 +
src/parse/propstrings.h | 5 +-
src/select/computed.c | 21 +++++
src/select/computed.h | 2 +-
src/select/dispatch.c | 5 +
src/select/properties/Makefile | 1 +
src/select/properties/properties.h | 1 +
src/select/properties/writing_mode.c | 70 +++++++++++++++++
src/select/propget.h | 19 +++++
src/select/propset.h | 24 ++++++-
test/data/parse/properties.dat | 52 +++++++++++++
test/data/parse2/illegal-values.dat | 21 +++++
test/data/select/tests1.dat | 135 ++++++++++++++++++++++++++++++++++
test/dump.h | 14 ++++
test/dump_computed.h | 22 ++++++
22 files changed, 424 insertions(+), 5 deletions(-)
create mode 100644 src/select/properties/writing_mode.c
diff --git a/docs/Bytecode b/docs/Bytecode
index 900b1f9..b4154b5 100644
--- a/docs/Bytecode
+++ b/docs/Bytecode
@@ -1232,6 +1232,15 @@ Opcodes
bits 0-6: 0000000 => auto,
other => rffe.
+6f - writing-mode
+ <value> (14bits) :
+ bits 8-13: MBZ
+ bits 0-7 :
+ 00000000 => horizontal-tb,
+ 00000001 => vertical-rl,
+ 00000010 => vertical-lr,
+ other => Reserved for future expansion.
+
-6f-3ff - Reserved for future expansion.
+70-3ff - Reserved for future expansion.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 843795e..6e04e61 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -269,6 +269,9 @@ uint8_t css_computed_empty_cells(
uint8_t css_computed_float(
const css_computed_style *style);
+uint8_t css_computed_writing_mode(
+ const css_computed_style *style);
+
uint8_t css_computed_font_style(
const css_computed_style *style);
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index feba9ce..bbb6baa 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -125,6 +125,7 @@ enum css_properties_e {
CSS_PROP_COLUMN_RULE_WIDTH = 0x06c,
CSS_PROP_COLUMN_SPAN = 0x06d,
CSS_PROP_COLUMN_WIDTH = 0x06e,
+ CSS_PROP_WRITING_MODE = 0x06f,
CSS_N_PROPERTIES
};
@@ -740,6 +741,13 @@ enum css_word_spacing_e {
CSS_WORD_SPACING_NORMAL = 0x2
};
+enum css_writing_mode_e {
+ CSS_WRITING_MODE_INHERIT = 0x0,
+ CSS_WRITING_MODE_HORIZONTAL_TB = 0x1,
+ CSS_WRITING_MODE_VERTICAL_RL = 0x2,
+ CSS_WRITING_MODE_VERTICAL_LR = 0x3
+};
+
enum css_z_index_e {
CSS_Z_INDEX_INHERIT = 0x0,
CSS_Z_INDEX_SET = 0x1,
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index a0d38d4..544687a 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -718,6 +718,12 @@ enum op_word_spacing {
WORD_SPACING_NORMAL = 0x0000
};
+enum op_writing_mode {
+ WRITING_MODE_HORIZONTAL_TB = 0x0000,
+ WRITING_MODE_VERTICAL_RL = 0x0001,
+ WRITING_MODE_VERTICAL_LR = 0x0002
+};
+
enum op_z_index {
Z_INDEX_SET = 0x0080,
diff --git a/src/parse/properties/properties.c b/src/parse/properties/properties.c
index e8ca3ce..c4e939a 100644
--- a/src/parse/properties/properties.c
+++ b/src/parse/properties/properties.c
@@ -140,6 +140,7 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
css__parse_widows,
css__parse_width,
css__parse_word_spacing,
+ css__parse_writing_mode,
css__parse_z_index
};
diff --git a/src/parse/properties/properties.gen b/src/parse/properties/properties.gen
index 5a4ebe0..80f1a30 100644
--- a/src/parse/properties/properties.gen
+++ b/src/parse/properties/properties.gen
@@ -212,3 +212,4 @@ column_span:CSS_PROP_COLUMN_SPAN IDENT:( INHERIT: NONE:0,COLUMN_SPAN_NONE ALL:0,
column_width:CSS_PROP_COLUMN_WIDTH IDENT:( INHERIT: AUTO:0,COLUMN_WIDTH_AUTO IDENT:) LENGTH_UNIT:( UNIT_PX:COLUMN_WIDTH_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ||unit&UNIT_PCT LENGTH_UNIT:)
+writing_mode:CSS_PROP_WRITING_MODE IDENT:( INHERIT: HORIZONTAL_TB:0,WRITING_MODE_HORIZONTAL_TB VERTICAL_RL:0,WRITING_MODE_VERTICAL_RL VERTICAL_LR:0,WRITING_MODE_VERTICAL_LR IDENT:)
diff --git a/src/parse/properties/properties.h b/src/parse/properties/properties.h
index 7280d93..7c4d8a1 100644
--- a/src/parse/properties/properties.h
+++ b/src/parse/properties/properties.h
@@ -406,6 +406,9 @@ css_error css__parse_width(css_language *c,
css_error css__parse_word_spacing(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
+css_error css__parse_writing_mode(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
css_error css__parse_z_index(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 35466eb..913241c 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -210,6 +210,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "widows", SLEN("widows") },
{ "width", SLEN("width") },
{ "word-spacing", SLEN("word-spacing") },
+ { "writing-mode", SLEN("writing-mode") },
{ "z-index", SLEN("z-index") },
{ "inherit", SLEN("inherit") },
@@ -406,6 +407,9 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "avoid-page", SLEN("avoid_page") },
{ "avoid-column", SLEN("avoid-column") },
{ "balance", SLEN("balance") },
+ { "horizontal-tb", SLEN("horizontal-tb") },
+ { "vertical-rl", SLEN("vertical-rl") },
+ { "vertical-lr", SLEN("vertical-lr") },
{ "aliceblue", SLEN("aliceblue") },
{ "antiquewhite", SLEN("antiquewhite") },
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 2ed0743..72a60ae 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -64,7 +64,8 @@ enum {
SPEAK_HEADER, SPEAK_NUMERAL, SPEAK_PUNCTUATION, SPEAK, SPEECH_RATE,
STRESS, TABLE_LAYOUT, TEXT_ALIGN, TEXT_DECORATION, TEXT_INDENT,
TEXT_TRANSFORM, TOP, UNICODE_BIDI, VERTICAL_ALIGN, VISIBILITY,
- VOICE_FAMILY, VOLUME, WHITE_SPACE, WIDOWS, WIDTH, WORD_SPACING, Z_INDEX,
+ VOICE_FAMILY, VOLUME, WHITE_SPACE, WIDOWS, WIDTH, WORD_SPACING,
+ WRITING_MODE, Z_INDEX,
LAST_PROP = Z_INDEX,
@@ -96,7 +97,7 @@ enum {
LINE_THROUGH, BLINK, RGB, RGBA, HSL, HSLA, LIBCSS_LEFT, LIBCSS_CENTER,
LIBCSS_RIGHT, CURRENTCOLOR, ODD, EVEN, SRC, LOCAL, INITIAL,
FORMAT, WOFF, TRUETYPE, OPENTYPE, EMBEDDED_OPENTYPE, SVG, COLUMN,
- AVOID_PAGE, AVOID_COLUMN, BALANCE,
+ AVOID_PAGE, AVOID_COLUMN, BALANCE, HORIZONTAL_TB, VERTICAL_RL, VERTICAL_LR,
/* Named colours */
FIRST_COLOUR,
diff --git a/src/select/computed.c b/src/select/computed.c
index 9f21d4a..059c76f 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -479,6 +479,27 @@ uint8_t css_computed_word_spacing(
#undef CSS_WORD_SPACING_SHIFT
#undef CSS_WORD_SPACING_INDEX
+#define CSS_WRITING_MODE_INDEX 4
+#define CSS_WRITING_MODE_SHIFT 1
+#define CSS_WRITING_MODE_MASK 0x6
+uint8_t css_computed_writing_mode(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[CSS_WRITING_MODE_INDEX];
+ bits &= CSS_WRITING_MODE_MASK;
+ bits >>= CSS_WRITING_MODE_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+ }
+
+ return CSS_WRITING_MODE_HORIZONTAL_TB;
+}
+#undef CSS_WRITING_MODE_MASK
+#undef CSS_WRITING_MODE_SHIFT
+#undef CSS_WRITING_MODE_INDEX
+
#define CSS_COUNTER_INCREMENT_INDEX 3
#define CSS_COUNTER_INCREMENT_SHIFT 1
#define CSS_COUNTER_INCREMENT_MASK 0x2
diff --git a/src/select/computed.h b/src/select/computed.h
index f891047..8be3873 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -59,7 +59,7 @@ typedef struct css_computed_uncommon {
* 2 ooooooob outline-width | border-spacing
* 3 bbbbbbbb border-spacing
* 4 wwwwwwir word-spacing | counter-increment | counter-reset
- * 5 uuuuu... cursor | <unused>
+ * 5 uuuuumm. cursor | writing-mode | <unused>
* 6 cccccccc clip
* 7 cccccccc clip
* 8 ccccccoo clip | content
diff --git a/src/select/dispatch.c b/src/select/dispatch.c
index 85c1289..03d5c63 100644
--- a/src/select/dispatch.c
+++ b/src/select/dispatch.c
@@ -572,5 +572,10 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = {
PROPERTY_FUNCS(column_width),
0,
GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(writing_mode),
+ 0,
+ GROUP_UNCOMMON
}
};
diff --git a/src/select/properties/Makefile b/src/select/properties/Makefile
index a557846..eacc240 100644
--- a/src/select/properties/Makefile
+++ b/src/select/properties/Makefile
@@ -110,6 +110,7 @@ white_space.c \
width.c \
windows.c \
word_spacing.c \
+writing_mode.c \
z_index.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/select/properties/properties.h b/src/select/properties/properties.h
index d0bb648..63cdb17 100644
--- a/src/select/properties/properties.h
+++ b/src/select/properties/properties.h
@@ -131,6 +131,7 @@ PROPERTY_FUNCS(white_space);
PROPERTY_FUNCS(widows);
PROPERTY_FUNCS(width);
PROPERTY_FUNCS(word_spacing);
+PROPERTY_FUNCS(writing_mode);
PROPERTY_FUNCS(z_index);
#undef PROPERTY_FUNCS
diff --git a/src/select/properties/writing_mode.c b/src/select/properties/writing_mode.c
new file mode 100644
index 0000000..3ec1352
--- /dev/null
+++ b/src/select/properties/writing_mode.c
@@ -0,0 +1,70 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2009 John-Mark Bell <jmb(a)netsurf-browser.org>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_writing_mode(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ bool inherit = isInherit(opv);
+ uint16_t writing_mode = CSS_WRITING_MODE_INHERIT;
+ UNUSED(style);
+
+ if (inherit == false) {
+ switch (getValue(opv)) {
+ case WRITING_MODE_HORIZONTAL_TB:
+ writing_mode = CSS_WRITING_MODE_HORIZONTAL_TB;
+ break;
+ case WRITING_MODE_VERTICAL_RL:
+ writing_mode = CSS_WRITING_MODE_VERTICAL_RL;
+ break;
+ case WRITING_MODE_VERTICAL_LR:
+ writing_mode = CSS_WRITING_MODE_VERTICAL_LR;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ inherit)) {
+ return set_writing_mode(state->computed, writing_mode);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_writing_mode_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_writing_mode(style, hint->status);
+}
+
+css_error css__initial_writing_mode(css_select_state *state)
+{
+ return set_writing_mode(state->computed,
+ CSS_WRITING_MODE_HORIZONTAL_TB);
+}
+
+css_error css__compose_writing_mode(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t writing_mode = get_writing_mode(child);
+
+ if (writing_mode == CSS_WRITING_MODE_INHERIT) {
+ writing_mode = get_writing_mode(parent);
+ }
+
+ return set_writing_mode(result, writing_mode);
+}
+
diff --git a/src/select/propget.h b/src/select/propget.h
index 41f6315..16b8fc2 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -174,6 +174,25 @@ static inline uint8_t get_word_spacing(
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_INDEX
+#define WRITING_MODE_INDEX 4
+#define WRITING_MODE_MASK 0x6
+#define WRITING_MODE_SHIFT 1
+static inline uint8_t get_writing_mode(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[WRITING_MODE_INDEX];
+ bits &= WRITING_MODE_MASK;
+ bits >>= WRITING_MODE_SHIFT;
+ return bits;
+ }
+
+ return CSS_WRITING_MODE_HORIZONTAL_TB;
+}
+#undef WRITING_MODE_INDEX
+#undef WRITING_MODE_MASK
+#undef WRITING_MODE_SHIFT
+
#define COUNTER_INCREMENT_INDEX 3
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
diff --git a/src/select/propset.h b/src/select/propset.h
index 2b705ae..29e8ae5 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -22,7 +22,7 @@ static const css_computed_uncommon default_uncommon = {
0,
(CSS_WORD_SPACING_INHERIT << 2) |
(CSS_COUNTER_INCREMENT_NONE << 1) | CSS_COUNTER_RESET_NONE,
- (CSS_CURSOR_INHERIT << 3) | 0,
+ (CSS_CURSOR_INHERIT << 3) | (CSS_WRITING_MODE_INHERIT << 1) | 0,
0,
0,
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL
@@ -214,6 +214,28 @@ static inline css_error set_word_spacing(
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_INDEX
+#define WRITING_MODE_INDEX 4
+#define WRITING_MODE_SHIFT 1
+#define WRITING_MODE_MASK 0x6
+static inline css_error set_writing_mode(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[WRITING_MODE_INDEX];
+
+ /* 2bits: type */
+ *bits = (*bits & ~WRITING_MODE_MASK) |
+ ((type & 0x3) << WRITING_MODE_SHIFT);
+
+ return CSS_OK;
+}
+#undef WRITING_MODE_MASK
+#undef WRITING_MODE_SHIFT
+#undef WRITING_MODE_INDEX
+
#define COUNTER_INCREMENT_INDEX 3
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
diff --git a/test/data/parse/properties.dat b/test/data/parse/properties.dat
index efe06ee..d96d826 100644
--- a/test/data/parse/properties.dat
+++ b/test/data/parse/properties.dat
@@ -4262,3 +4262,55 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
| 0x0200006e 0x00000066 0x00000002
#reset
+##
+## 6f - writing-mode
+##
+
+#data
+* { writing-mode: horizontal-tb; }
+#errors
+#expected
+| 1 *
+| 0x0000006f
+#reset
+
+#data
+* { writing-mode: vertical-rl; }
+#errors
+#expected
+| 1 *
+| 0x0004006f
+#reset
+
+#data
+* { writing-mode: vertical-lr; }
+#errors
+#expected
+| 1 *
+| 0x0008006f
+#reset
+
+#data
+* { writing-mode: inherit }
+#errors
+#expected
+| 1 *
+| 0x0000086f
+#reset
+
+#data
+* { writing-mode: inherit ! important }
+#errors
+#expected
+| 1 *
+| 0x00000c6f
+#reset
+
+#data
+* { writing-mode: vertical-lr ! important }
+#errors
+#expected
+| 1 *
+| 0x0008046f
+#reset
+
diff --git a/test/data/parse2/illegal-values.dat b/test/data/parse2/illegal-values.dat
index b882328..3187e18 100644
--- a/test/data/parse2/illegal-values.dat
+++ b/test/data/parse2/illegal-values.dat
@@ -4455,6 +4455,27 @@ max-height: 30%; min-height: 2em; }
#reset
#data
+* { writing-mode: em; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { writing-mode: 2em; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { writing-mode: vertical; }
+#errors
+#expected
+| *
+#reset
+
+#data
* { z-index: - 40; }
#errors
#expected
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 4e9bf34..51c5426 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -89,6 +89,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -184,6 +185,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -279,6 +281,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -374,6 +377,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -461,6 +465,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -546,6 +551,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -632,6 +638,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -718,6 +725,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -803,6 +811,7 @@ visibility: visible
white-space: normal
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -893,6 +902,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -983,6 +993,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1074,6 +1085,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1168,6 +1180,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1261,6 +1274,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1360,6 +1374,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1459,6 +1474,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1558,6 +1574,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1661,6 +1678,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1763,6 +1781,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1863,6 +1882,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -1962,6 +1982,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2061,6 +2082,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2160,6 +2182,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2259,6 +2282,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2358,6 +2382,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2457,6 +2482,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2556,6 +2582,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2655,6 +2682,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2754,6 +2782,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2853,6 +2882,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -2952,6 +2982,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3051,6 +3082,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3150,6 +3182,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3249,6 +3282,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3348,6 +3382,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3447,6 +3482,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3546,6 +3582,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3645,6 +3682,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3744,6 +3782,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3843,6 +3882,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -3935,6 +3975,7 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: normal
+writing-mode: horizontal-tb
z-index: auto
#reset
@@ -4027,5 +4068,99 @@ visibility: inherit
white-space: inherit
width: auto
word-spacing: inherit
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div
+| id=foo
+| p*
+#ua
+div, p { display: none; float: right; position: absolute; }
+#user
+p { display: block; writing-mode: vertical-lr; }
+#author
+div#foo p { letter-spacing: inherit; }
+div p { letter-spacing: horizontal-tb; }
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: inherit
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: inherit
+direction: inherit
+display: block
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: inherit
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: medium
+overflow: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: absolute
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: inherit
+writing-mode: vertical-lr
z-index: auto
#reset
diff --git a/test/dump.h b/test/dump.h
index 73b61ea..941117c 100644
--- a/test/dump.h
+++ b/test/dump.h
@@ -476,6 +476,7 @@ static const char *opcode_names[] = {
"column-rule-width",
"column-span",
"column-width",
+ "writing-mode",
};
static void dump_css_fixed(css_fixed f, char **ptr)
@@ -2529,6 +2530,19 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
break;
}
break;
+ case CSS_PROP_WRITING_MODE:
+ switch (value) {
+ case WRITING_MODE_HORIZONTAL_TB:
+ *ptr += sprintf(*ptr, "horizontal-tb");
+ break;
+ case WRITING_MODE_VERTICAL_RL:
+ *ptr += sprintf(*ptr, "vertical-rl");
+ break;
+ case WRITING_MODE_VERTICAL_LR:
+ *ptr += sprintf(*ptr, "vertical-lr");
+ break;
+ }
+ break;
case CSS_PROP_Z_INDEX:
switch (value) {
case Z_INDEX_SET:
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 6a29c2d..451ba1a 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -2472,6 +2472,28 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* writing-mode */
+ val = css_computed_writing_mode(style);
+ switch (val) {
+ case CSS_WRITING_MODE_INHERIT:
+ wrote = snprintf(ptr, *len, "writing-mode: inherit\n");
+ break;
+ case CSS_WRITING_MODE_HORIZONTAL_TB:
+ wrote = snprintf(ptr, *len, "writing-mode: horizontal-tb\n");
+ break;
+ case CSS_WRITING_MODE_VERTICAL_RL:
+ wrote = snprintf(ptr, *len, "writing-mode: vertical-rl\n");
+ break;
+ case CSS_WRITING_MODE_VERTICAL_LR:
+ wrote = snprintf(ptr, *len, "writing-mode: vertical-lr\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* z-index */
val = css_computed_z_index(style, &zindex);
switch (val) {
--
Cascading Style Sheets library
9 years, 8 months
libcss: branch master updated. release/0.2.0-7-g2234cab
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/2234cab352b0ef702b32aa...
...commit http://git.netsurf-browser.org/libcss.git/commit/2234cab352b0ef702b32aaa7...
...tree http://git.netsurf-browser.org/libcss.git/tree/2234cab352b0ef702b32aaa7ef...
The branch, master has been updated
via 2234cab352b0ef702b32aaa7ef433c4793086824 (commit)
via 4211ae875a892f3af2b0749ce50c271665b7833d (commit)
via 627d6ebea72a62143e8d8a865e0d1d28f98ab09b (commit)
from ae8fa42f0c577f2d1a3d45ad0a750eecbd90d997 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=2234cab352b0ef702b32...
commit 2234cab352b0ef702b32aaa7ef433c4793086824
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix test data for border shorthand property.
diff --git a/test/data/parse2/border.dat b/test/data/parse2/border.dat
index ec7b796..787727e 100644
--- a/test/data/parse2/border.dat
+++ b/test/data/parse2/border.dat
@@ -79,12 +79,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: medium
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: medium
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: medium
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: medium
#reset
@@ -94,12 +98,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: none
| border-top-width: thin
+| border-right-color: currentColor
| border-right-style: none
| border-right-width: thin
+| border-bottom-color: currentColor
| border-bottom-style: none
| border-bottom-width: thin
+| border-left-color: currentColor
| border-left-style: none
| border-left-width: thin
#reset
@@ -185,12 +193,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: thin
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: thin
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: thin
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: thin
#reset
@@ -200,12 +212,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: thin
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: thin
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: thin
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: thin
#reset
@@ -368,12 +384,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: solid !important
| border-top-width: medium !important
+| border-right-color: currentColor !important
| border-right-style: solid !important
| border-right-width: medium !important
+| border-bottom-color: currentColor !important
| border-bottom-style: solid !important
| border-bottom-width: medium !important
+| border-left-color: currentColor !important
| border-left-style: solid !important
| border-left-width: medium !important
#reset
@@ -383,12 +403,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: none !important
| border-top-width: thin !important
+| border-right-color: currentColor !important
| border-right-style: none !important
| border-right-width: thin !important
+| border-bottom-color: currentColor !important
| border-bottom-style: none !important
| border-bottom-width: thin !important
+| border-left-color: currentColor !important
| border-left-style: none !important
| border-left-width: thin !important
#reset
@@ -474,12 +498,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: solid !important
| border-top-width: thin !important
+| border-right-color: currentColor !important
| border-right-style: solid !important
| border-right-width: thin !important
+| border-bottom-color: currentColor !important
| border-bottom-style: solid !important
| border-bottom-width: thin !important
+| border-left-color: currentColor !important
| border-left-style: solid !important
| border-left-width: thin !important
#reset
@@ -489,12 +517,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: solid !important
| border-top-width: thin !important
+| border-right-color: currentColor !important
| border-right-style: solid !important
| border-right-width: thin !important
+| border-bottom-color: currentColor !important
| border-bottom-style: solid !important
| border-bottom-width: thin !important
+| border-left-color: currentColor !important
| border-left-style: solid !important
| border-left-width: thin !important
#reset
@@ -1067,6 +1099,7 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: medium
#reset
@@ -1076,6 +1109,7 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: none
| border-top-width: thin
#reset
@@ -1125,6 +1159,7 @@
#errors
#expected
| *
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: medium
#reset
@@ -1134,6 +1169,7 @@
#errors
#expected
| *
+| border-right-color: currentColor
| border-right-style: none
| border-right-width: thin
#reset
@@ -1183,6 +1219,7 @@
#errors
#expected
| *
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: medium
#reset
@@ -1192,6 +1229,7 @@
#errors
#expected
| *
+| border-bottom-color: currentColor
| border-bottom-style: none
| border-bottom-width: thin
#reset
@@ -1241,6 +1279,7 @@
#errors
#expected
| *
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: medium
#reset
@@ -1250,6 +1289,7 @@
#errors
#expected
| *
+| border-left-color: currentColor
| border-left-style: none
| border-left-width: thin
#reset
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=4211ae875a892f3af2b0...
commit 4211ae875a892f3af2b0749ce50c271665b7833d
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Apply slightly modified patch from Murat Gocmen.
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index 63fe065..e018599 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -212,7 +212,7 @@ css_error css__parse_border_side(css_language *c,
} while (*ctx != prev_ctx && token != NULL);
if (style) {
- error = css__stylesheet_style_appendOPV(style_style,
+ error = css__stylesheet_style_appendOPV(style_style,
CSS_PROP_BORDER_TOP_STYLE + side, 0,
BORDER_STYLE_NONE);
if (error != CSS_OK)
@@ -220,9 +220,17 @@ css_error css__parse_border_side(css_language *c,
}
if (width) {
- error = css__stylesheet_style_appendOPV(width_style,
- CSS_PROP_BORDER_TOP_WIDTH + side,
- 0, BORDER_WIDTH_MEDIUM);
+ error = css__stylesheet_style_appendOPV(width_style,
+ CSS_PROP_BORDER_TOP_WIDTH + side, 0,
+ BORDER_WIDTH_MEDIUM);
+ if (error != CSS_OK)
+ goto css__parse_border_side_cleanup;
+ }
+
+ if (color) {
+ error = css__stylesheet_style_appendOPV(color_style,
+ CSS_PROP_BORDER_TOP_COLOR + side, 0,
+ BORDER_COLOR_CURRENT_COLOR);
if (error != CSS_OK)
goto css__parse_border_side_cleanup;
}
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=627d6ebea72a62143e8d...
commit 627d6ebea72a62143e8d8a865e0d1d28f98ab09b
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add a couple of letter spacing tests.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 6c8c889..4e9bf34 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -3845,3 +3845,187 @@ width: auto
word-spacing: inherit
z-index: auto
#reset
+
+#tree
+| div
+| id=foo
+| p*
+#ua
+div, p { display: none; float: right; position: absolute; }
+#user
+p { display: inherit; float: none; }
+#author
+div#foo { background-color: #bbc; letter-spacing: 200%; }
+div#foo p { letter-spacing: 300%; }
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: 0px 0px
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: inherit
+display: inherit
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: normal
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: absolute
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: normal
+z-index: auto
+#reset
+
+#tree
+| div
+| id=foo
+| p*
+#ua
+div, p { display: none; float: right; position: absolute; }
+#user
+p { display: inherit; float: none; }
+#author
+div#foo { background-color: #bbc; letter-spacing: 20mm; }
+div#foo p { letter-spacing: 300px; }
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: inherit
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: inherit
+direction: inherit
+display: inherit
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: 300px
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: medium
+overflow: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: absolute
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: inherit
+z-index: auto
+#reset
-----------------------------------------------------------------------
Summary of changes:
src/parse/properties/utils.c | 16 +++-
test/data/parse2/border.dat | 40 +++++++++
test/data/select/tests1.dat | 184 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 236 insertions(+), 4 deletions(-)
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index 63fe065..e018599 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -212,7 +212,7 @@ css_error css__parse_border_side(css_language *c,
} while (*ctx != prev_ctx && token != NULL);
if (style) {
- error = css__stylesheet_style_appendOPV(style_style,
+ error = css__stylesheet_style_appendOPV(style_style,
CSS_PROP_BORDER_TOP_STYLE + side, 0,
BORDER_STYLE_NONE);
if (error != CSS_OK)
@@ -220,9 +220,17 @@ css_error css__parse_border_side(css_language *c,
}
if (width) {
- error = css__stylesheet_style_appendOPV(width_style,
- CSS_PROP_BORDER_TOP_WIDTH + side,
- 0, BORDER_WIDTH_MEDIUM);
+ error = css__stylesheet_style_appendOPV(width_style,
+ CSS_PROP_BORDER_TOP_WIDTH + side, 0,
+ BORDER_WIDTH_MEDIUM);
+ if (error != CSS_OK)
+ goto css__parse_border_side_cleanup;
+ }
+
+ if (color) {
+ error = css__stylesheet_style_appendOPV(color_style,
+ CSS_PROP_BORDER_TOP_COLOR + side, 0,
+ BORDER_COLOR_CURRENT_COLOR);
if (error != CSS_OK)
goto css__parse_border_side_cleanup;
}
diff --git a/test/data/parse2/border.dat b/test/data/parse2/border.dat
index ec7b796..787727e 100644
--- a/test/data/parse2/border.dat
+++ b/test/data/parse2/border.dat
@@ -79,12 +79,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: medium
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: medium
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: medium
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: medium
#reset
@@ -94,12 +98,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: none
| border-top-width: thin
+| border-right-color: currentColor
| border-right-style: none
| border-right-width: thin
+| border-bottom-color: currentColor
| border-bottom-style: none
| border-bottom-width: thin
+| border-left-color: currentColor
| border-left-style: none
| border-left-width: thin
#reset
@@ -185,12 +193,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: thin
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: thin
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: thin
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: thin
#reset
@@ -200,12 +212,16 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: thin
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: thin
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: thin
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: thin
#reset
@@ -368,12 +384,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: solid !important
| border-top-width: medium !important
+| border-right-color: currentColor !important
| border-right-style: solid !important
| border-right-width: medium !important
+| border-bottom-color: currentColor !important
| border-bottom-style: solid !important
| border-bottom-width: medium !important
+| border-left-color: currentColor !important
| border-left-style: solid !important
| border-left-width: medium !important
#reset
@@ -383,12 +403,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: none !important
| border-top-width: thin !important
+| border-right-color: currentColor !important
| border-right-style: none !important
| border-right-width: thin !important
+| border-bottom-color: currentColor !important
| border-bottom-style: none !important
| border-bottom-width: thin !important
+| border-left-color: currentColor !important
| border-left-style: none !important
| border-left-width: thin !important
#reset
@@ -474,12 +498,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: solid !important
| border-top-width: thin !important
+| border-right-color: currentColor !important
| border-right-style: solid !important
| border-right-width: thin !important
+| border-bottom-color: currentColor !important
| border-bottom-style: solid !important
| border-bottom-width: thin !important
+| border-left-color: currentColor !important
| border-left-style: solid !important
| border-left-width: thin !important
#reset
@@ -489,12 +517,16 @@
#errors
#expected
| *
+| border-top-color: currentColor !important
| border-top-style: solid !important
| border-top-width: thin !important
+| border-right-color: currentColor !important
| border-right-style: solid !important
| border-right-width: thin !important
+| border-bottom-color: currentColor !important
| border-bottom-style: solid !important
| border-bottom-width: thin !important
+| border-left-color: currentColor !important
| border-left-style: solid !important
| border-left-width: thin !important
#reset
@@ -1067,6 +1099,7 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: solid
| border-top-width: medium
#reset
@@ -1076,6 +1109,7 @@
#errors
#expected
| *
+| border-top-color: currentColor
| border-top-style: none
| border-top-width: thin
#reset
@@ -1125,6 +1159,7 @@
#errors
#expected
| *
+| border-right-color: currentColor
| border-right-style: solid
| border-right-width: medium
#reset
@@ -1134,6 +1169,7 @@
#errors
#expected
| *
+| border-right-color: currentColor
| border-right-style: none
| border-right-width: thin
#reset
@@ -1183,6 +1219,7 @@
#errors
#expected
| *
+| border-bottom-color: currentColor
| border-bottom-style: solid
| border-bottom-width: medium
#reset
@@ -1192,6 +1229,7 @@
#errors
#expected
| *
+| border-bottom-color: currentColor
| border-bottom-style: none
| border-bottom-width: thin
#reset
@@ -1241,6 +1279,7 @@
#errors
#expected
| *
+| border-left-color: currentColor
| border-left-style: solid
| border-left-width: medium
#reset
@@ -1250,6 +1289,7 @@
#errors
#expected
| *
+| border-left-color: currentColor
| border-left-style: none
| border-left-width: thin
#reset
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 6c8c889..4e9bf34 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -3845,3 +3845,187 @@ width: auto
word-spacing: inherit
z-index: auto
#reset
+
+#tree
+| div
+| id=foo
+| p*
+#ua
+div, p { display: none; float: right; position: absolute; }
+#user
+p { display: inherit; float: none; }
+#author
+div#foo { background-color: #bbc; letter-spacing: 200%; }
+div#foo p { letter-spacing: 300%; }
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: 0px 0px
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: inherit
+display: inherit
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: normal
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: absolute
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: normal
+z-index: auto
+#reset
+
+#tree
+| div
+| id=foo
+| p*
+#ua
+div, p { display: none; float: right; position: absolute; }
+#user
+p { display: inherit; float: none; }
+#author
+div#foo { background-color: #bbc; letter-spacing: 20mm; }
+div#foo p { letter-spacing: 300px; }
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: inherit
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: inherit
+direction: inherit
+display: inherit
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: 300px
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: medium
+overflow: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: absolute
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: inherit
+z-index: auto
+#reset
--
Cascading Style Sheets library
9 years, 8 months
netsurf: branch master updated. release/3.0-547-g65a6587
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/65a658769ed25e0cb313f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/65a658769ed25e0cb313f2a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/65a658769ed25e0cb313f2ac5...
The branch, master has been updated
via 65a658769ed25e0cb313f2ac5c1bfcac159a1cf4 (commit)
from 3d123d72fc9b09d5caba0bb1100cf7bb142120e2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=65a658769ed25e0cb31...
commit 65a658769ed25e0cb313f2ac5c1bfcac159a1cf4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Set treeview text size to 12pt.
diff --git a/riscos/gui.c b/riscos/gui.c
index 4ce5c81..fc857f2 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -59,7 +59,7 @@
#include "desktop/netsurf.h"
#include "utils/nsoption.h"
#include "desktop/save_complete.h"
-#include "desktop/tree.h"
+#include "desktop/treeview.h"
#include "render/font.h"
#include "riscos/content-handlers/artworks.h"
#include "riscos/bitmap.h"
@@ -416,6 +416,7 @@ static void gui_init(int argc, char** argv)
int length;
char *nsdir_temp;
byte *base;
+ nserror err;
/* re-enable all FPU exceptions/traps except inexact operations,
* which we're not interested in, and underflow which is incorrectly
@@ -541,6 +542,11 @@ static void gui_init(int argc, char** argv)
die(error->errmess);
}
+ err = treeview_init(12);
+ if (err != NSERROR_OK) {
+ die("Failed to initialise treeview");
+ }
+
/* Initialise themes before dialogs */
ro_gui_theme_initialise();
/* Initialise dialog windows (must be after UI sprites are loaded) */
-----------------------------------------------------------------------
Summary of changes:
riscos/gui.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/riscos/gui.c b/riscos/gui.c
index 4ce5c81..fc857f2 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -59,7 +59,7 @@
#include "desktop/netsurf.h"
#include "utils/nsoption.h"
#include "desktop/save_complete.h"
-#include "desktop/tree.h"
+#include "desktop/treeview.h"
#include "render/font.h"
#include "riscos/content-handlers/artworks.h"
#include "riscos/bitmap.h"
@@ -416,6 +416,7 @@ static void gui_init(int argc, char** argv)
int length;
char *nsdir_temp;
byte *base;
+ nserror err;
/* re-enable all FPU exceptions/traps except inexact operations,
* which we're not interested in, and underflow which is incorrectly
@@ -541,6 +542,11 @@ static void gui_init(int argc, char** argv)
die(error->errmess);
}
+ err = treeview_init(12);
+ if (err != NSERROR_OK) {
+ die("Failed to initialise treeview");
+ }
+
/* Initialise themes before dialogs */
ro_gui_theme_initialise();
/* Initialise dialog windows (must be after UI sprites are loaded) */
--
NetSurf Browser
9 years, 8 months
netsurf: branch master updated. release/3.0-546-g3d123d7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/3d123d72fc9b09d5caba0...
...commit http://git.netsurf-browser.org/netsurf.git/commit/3d123d72fc9b09d5caba0bb...
...tree http://git.netsurf-browser.org/netsurf.git/tree/3d123d72fc9b09d5caba0bb11...
The branch, master has been updated
via 3d123d72fc9b09d5caba0bb1100cf7bb142120e2 (commit)
via b10252e3255df587ef4f64ee592c90f3e22a25ba (commit)
from 172551870b2c11f80cc9d707831914bd0acf9d23 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=3d123d72fc9b09d5cab...
commit 3d123d72fc9b09d5caba0bb1100cf7bb142120e2
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Enable front end to select treeview text size.
diff --git a/desktop/tree.c b/desktop/tree.c
index f64c390..6097c22 100644
--- a/desktop/tree.c
+++ b/desktop/tree.c
@@ -129,7 +129,7 @@ static bool treeview_test_init(struct tree *tree)
treeview_inits++;
if (treeview_inits == 1)
- treeview_init();
+ treeview_init(0);
switch (tree->flags) {
case TREE_COOKIES:
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 41d176f..6b74c90 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3560,14 +3560,16 @@ static void treeview_init_furniture(void)
/* Exported interface, documented in treeview.h */
-nserror treeview_init(void)
+nserror treeview_init(int font_pt_size)
{
int font_px_size;
- int font_pt_size = 11;
if (tree_g.initialised == true)
return NSERROR_OK;
+ if (font_pt_size <= 0)
+ font_pt_size = 11;
+
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
treeview_init_furniture();
diff --git a/desktop/treeview.h b/desktop/treeview.h
index 9af72f9..6fe6521 100644
--- a/desktop/treeview.h
+++ b/desktop/treeview.h
@@ -106,9 +106,10 @@ struct treeview_callback_table {
/**
* Prepare treeview module for treeview usage
*
+ * \param font_pt_size Treeview text size in pt. Set to <= 0 for default.
* \return NSERROR_OK on success, appropriate error otherwise
*/
-nserror treeview_init(void);
+nserror treeview_init(int font_pt_size);
/**
* Finalise the treeview module (all treeviews must have been destroyed first)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=b10252e3255df587ef4...
commit b10252e3255df587ef4f64ee592c90f3e22a25ba
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Protect against attempt to initialise twice.
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 3f445bc..41d176f 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -33,6 +33,7 @@
#define REDRAW_MAX 8000
struct treeview_globals {
+ bool initialised;
int line_height;
int furniture_width;
int step_width;
@@ -3564,6 +3565,9 @@ nserror treeview_init(void)
int font_px_size;
int font_pt_size = 11;
+ if (tree_g.initialised == true)
+ return NSERROR_OK;
+
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
treeview_init_furniture();
@@ -3577,6 +3581,8 @@ nserror treeview_init(void)
tree_g.icon_step = 23;
tree_g.move_offset = 18;
+ tree_g.initialised = true;
+
return NSERROR_OK;
}
@@ -3590,5 +3596,7 @@ nserror treeview_fini(void)
hlcache_handle_release(treeview_res[i].c);
}
+ tree_g.initialised = false;
+
return NSERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
desktop/tree.c | 2 +-
desktop/treeview.c | 14 ++++++++++++--
desktop/treeview.h | 3 ++-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/desktop/tree.c b/desktop/tree.c
index f64c390..6097c22 100644
--- a/desktop/tree.c
+++ b/desktop/tree.c
@@ -129,7 +129,7 @@ static bool treeview_test_init(struct tree *tree)
treeview_inits++;
if (treeview_inits == 1)
- treeview_init();
+ treeview_init(0);
switch (tree->flags) {
case TREE_COOKIES:
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 3f445bc..6b74c90 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -33,6 +33,7 @@
#define REDRAW_MAX 8000
struct treeview_globals {
+ bool initialised;
int line_height;
int furniture_width;
int step_width;
@@ -3559,10 +3560,15 @@ static void treeview_init_furniture(void)
/* Exported interface, documented in treeview.h */
-nserror treeview_init(void)
+nserror treeview_init(int font_pt_size)
{
int font_px_size;
- int font_pt_size = 11;
+
+ if (tree_g.initialised == true)
+ return NSERROR_OK;
+
+ if (font_pt_size <= 0)
+ font_pt_size = 11;
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
@@ -3577,6 +3583,8 @@ nserror treeview_init(void)
tree_g.icon_step = 23;
tree_g.move_offset = 18;
+ tree_g.initialised = true;
+
return NSERROR_OK;
}
@@ -3590,5 +3598,7 @@ nserror treeview_fini(void)
hlcache_handle_release(treeview_res[i].c);
}
+ tree_g.initialised = false;
+
return NSERROR_OK;
}
diff --git a/desktop/treeview.h b/desktop/treeview.h
index 9af72f9..6fe6521 100644
--- a/desktop/treeview.h
+++ b/desktop/treeview.h
@@ -106,9 +106,10 @@ struct treeview_callback_table {
/**
* Prepare treeview module for treeview usage
*
+ * \param font_pt_size Treeview text size in pt. Set to <= 0 for default.
* \return NSERROR_OK on success, appropriate error otherwise
*/
-nserror treeview_init(void);
+nserror treeview_init(int font_pt_size);
/**
* Finalise the treeview module (all treeviews must have been destroyed first)
--
NetSurf Browser
9 years, 8 months