Title: [100419] trunk/Source/WebCore
Revision
100419
Author
ma...@webkit.org
Date
2011-11-16 00:16:33 -0800 (Wed, 16 Nov 2011)

Log Message

[GTK] Use GQuark's in the ATK wrapper to get and set arbitrary data
https://bugs.webkit.org/show_bug.cgi?id=72394

Reviewed by Martin Robinson.

No new functionality, no new tests needed.

* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(webkit_accessible_class_init): Initialize GQuarks.
(getGailTextUtilForAtk): Use gailTextUtilQuark.
(getPangoLayoutForAtk): Remove unused call to
g_object_set_data_full, since that data is no used anywhere.
(webkitAccessibleHyperlinkImplGetHyperlink): Use hyperlinkObjectQuark.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (100418 => 100419)


--- trunk/Source/WebCore/ChangeLog	2011-11-16 08:06:09 UTC (rev 100418)
+++ trunk/Source/WebCore/ChangeLog	2011-11-16 08:16:33 UTC (rev 100419)
@@ -1,3 +1,19 @@
+2011-11-16  Mario Sanchez Prada  <msanc...@igalia.com>
+
+        [GTK] Use GQuark's in the ATK wrapper to get and set arbitrary data
+        https://bugs.webkit.org/show_bug.cgi?id=72394
+
+        Reviewed by Martin Robinson.
+
+        No new functionality, no new tests needed.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (webkit_accessible_class_init): Initialize GQuarks.
+        (getGailTextUtilForAtk): Use gailTextUtilQuark.
+        (getPangoLayoutForAtk): Remove unused call to
+        g_object_set_data_full, since that data is no used anywhere.
+        (webkitAccessibleHyperlinkImplGetHyperlink): Use hyperlinkObjectQuark.
+
 2011-11-15  Alexandru Chiculita  <ach...@adobe.com>
 
         [CSSShaders] Implement the style cached resources and computed style for the shader urls

Modified: trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp (100418 => 100419)


--- trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp	2011-11-16 08:06:09 UTC (rev 100418)
+++ trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp	2011-11-16 08:16:33 UTC (rev 100419)
@@ -76,6 +76,9 @@
 
 using namespace WebCore;
 
+static GQuark gailTextUtilQuark = 0;
+static GQuark hyperlinkObjectQuark = 0;
+
 static AccessibilityObject* fallbackObject()
 {
     // FIXME: An AXObjectCache with a Document is meaningless.
@@ -830,6 +833,9 @@
     klass->get_index_in_parent = webkit_accessible_get_index_in_parent;
     klass->get_attributes = webkit_accessible_get_attributes;
     klass->ref_relation_set = webkit_accessible_ref_relation_set;
+
+    gailTextUtilQuark = g_quark_from_static_string("webkit-accessible-gail-text-util");
+    hyperlinkObjectQuark = g_quark_from_static_string("webkit-accessible-hyperlink-object");
 }
 
 GType
@@ -1275,13 +1281,13 @@
 
 static GailTextUtil* getGailTextUtilForAtk(AtkText* textObject)
 {
-    gpointer data = "" "webkit-accessible-gail-text-util");
+    gpointer data = "" gailTextUtilQuark);
     if (data)
         return static_cast<GailTextUtil*>(data);
 
     GailTextUtil* gailTextUtil = gail_text_util_new();
     gail_text_util_text_setup(gailTextUtil, webkit_accessible_text_get_text(textObject, 0, -1));
-    g_object_set_data_full(G_OBJECT(textObject), "webkit-accessible-gail-text-util", gailTextUtil, g_object_unref);
+    g_object_set_qdata_full(G_OBJECT(textObject), gailTextUtilQuark, gailTextUtil, g_object_unref);
     return gailTextUtil;
 }
 
@@ -1302,7 +1308,6 @@
 
     // Create a string with the layout as it appears on the screen
     PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), textForObject(coreObject));
-    g_object_set_data_full(G_OBJECT(textObject), "webkit-accessible-pango-layout", layout, g_object_unref);
     return layout;
 }
 
@@ -2360,10 +2365,10 @@
 
 static AtkHyperlink* webkitAccessibleHyperlinkImplGetHyperlink(AtkHyperlinkImpl* hyperlink)
 {
-    AtkHyperlink* hyperlinkObject = ATK_HYPERLINK(g_object_get_data(G_OBJECT(hyperlink), "hyperlink-object"));
+    AtkHyperlink* hyperlinkObject = ATK_HYPERLINK(g_object_get_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark));
     if (!hyperlinkObject) {
         hyperlinkObject = ATK_HYPERLINK(webkitAccessibleHyperlinkNew(hyperlink));
-        g_object_set_data(G_OBJECT(hyperlink), "hyperlink-object", hyperlinkObject);
+        g_object_set_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark, hyperlinkObject);
     }
     return hyperlinkObject;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to