Title: [93602] trunk/Source/WebKit/efl
Revision
93602
Author
[email protected]
Date
2011-08-23 06:37:39 -0700 (Tue, 23 Aug 2011)

Log Message

[EFL] Add auxiliary history functions for DRT
https://bugs.webkit.org/show_bug.cgi?id=66700

Patch by Raphael Kubo da Costa <[email protected]> on 2011-08-23
Reviewed by Kent Tamura.

EFL's DumpRenderTree implementation needs some private, auxiliary
functions in ewk in order to iterate and dump the history tree when
necessary.

* ewk/ewk_history.cpp:
(ewk_history_item_target_get):
(ewk_history_item_target_is):
(ewk_history_item_children_get):
* ewk/ewk_private.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (93601 => 93602)


--- trunk/Source/WebKit/efl/ChangeLog	2011-08-23 13:36:35 UTC (rev 93601)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-08-23 13:37:39 UTC (rev 93602)
@@ -1,5 +1,22 @@
 2011-08-23  Raphael Kubo da Costa  <[email protected]>
 
+        [EFL] Add auxiliary history functions for DRT
+        https://bugs.webkit.org/show_bug.cgi?id=66700
+
+        Reviewed by Kent Tamura.
+
+        EFL's DumpRenderTree implementation needs some private, auxiliary
+        functions in ewk in order to iterate and dump the history tree when
+        necessary.
+
+        * ewk/ewk_history.cpp:
+        (ewk_history_item_target_get):
+        (ewk_history_item_target_is):
+        (ewk_history_item_children_get):
+        * ewk/ewk_private.h:
+
+2011-08-23  Raphael Kubo da Costa  <[email protected]>
+
         [EFL] Add auxiliary ewk_util functions for DRT.
         https://bugs.webkit.org/show_bug.cgi?id=66702
 

Modified: trunk/Source/WebKit/efl/ewk/ewk_history.cpp (93601 => 93602)


--- trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2011-08-23 13:36:35 UTC (rev 93601)
+++ trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2011-08-23 13:37:39 UTC (rev 93602)
@@ -406,3 +406,52 @@
     history->core->deref();
     free(history);
 }
+
+/**
+ * @internal
+ *
+ * Returns a newly-allocated string with the item's target name.
+ * Callers are responsible for freeing the allocated memory with free(3).
+ *
+ * @param item instance to operate upon.
+ */
+char* ewk_history_item_target_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    return strdup(core->target().utf8().data());
+}
+
+/**
+ * @internal
+ *
+ * Returns whether the given item is currently a target.
+ *
+ * @param item instance to check.
+ */
+Eina_Bool ewk_history_item_target_is(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    return core->isTargetItem();
+}
+
+/**
+ * @internal
+ *
+ * Returns a list of child history items relative to the given item,
+ * or @c NULL if there are none.
+ *
+ * @param item instance to operate upon.
+ */
+Eina_List* ewk_history_item_children_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    const WebCore::HistoryItemVector& children = core->children();
+    if (!children.size())
+        return 0;
+
+    Eina_List* kids = 0;
+    const unsigned size = children.size();
+    for (unsigned i = 0; i < size; ++i)
+        kids = eina_list_append(kids, _ewk_history_item_new(children[i].get()));
+    return kids;
+}

Modified: trunk/Source/WebKit/efl/ewk/ewk_private.h (93601 => 93602)


--- trunk/Source/WebKit/efl/ewk/ewk_private.h	2011-08-23 13:36:35 UTC (rev 93601)
+++ trunk/Source/WebKit/efl/ewk/ewk_private.h	2011-08-23 13:37:39 UTC (rev 93602)
@@ -134,6 +134,9 @@
 
 Ewk_History *ewk_history_new(WebCore::BackForwardListImpl *history);
 void ewk_history_free(Ewk_History *history);
+char *ewk_history_item_target_get(const Ewk_History_Item *item);
+Eina_Bool ewk_history_item_target_is(const Ewk_History_Item *item);
+Eina_List *ewk_history_item_children_get(const Ewk_History_Item *item);
 
 #if ENABLE(CONTEXT_MENUS)
 Ewk_Context_Menu *ewk_context_menu_new(Evas_Object *view, WebCore::ContextMenuController *controller);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to