Changeset 50727 in webkit


Ignore:
Timestamp:
Nov 10, 2009 1:53:33 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-10 Joanmarie Diggs <joanmarie.diggs@gmail.com>

Reviewed by Reviewed by Jan Alonzo.

https://bugs.webkit.org/show_bug.cgi?id=30901
[Gtk] Need to de-lint the Atk a11y code

Removal of various and sundry style-violating nits.

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50726 r50727  
     12009-11-10  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
     2
     3        Reviewed by Reviewed by Jan Alonzo.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=30901
     6        [Gtk] Need to de-lint the Atk a11y code
     7
     8        Removal of various and sundry style-violating nits.
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11
    1122009-11-10  Philippe Normand  <pnormand@igalia.com>
    213
  • trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r50641 r50727  
    200200}
    201201
    202 static gpointer webkit_accessible_parent_class = NULL;
     202static gpointer webkit_accessible_parent_class = 0;
    203203
    204204static AtkObject* atkParentOfWebView(AtkObject* object)
     
    248248    AccessibilityObject* coreObject = core(object);
    249249    AccessibilityObject::AccessibilityChildrenVector children = coreObject->children();
    250     if (index < 0 || index >= children.size())
     250    if (index < 0 || static_cast<unsigned>(index) >= children.size())
    251251        return 0;
    252252
     
    254254
    255255    if (!coreChild)
    256         return NULL;
     256        return 0;
    257257
    258258    AtkObject* child = coreChild->wrapper();
     
    305305static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object)
    306306{
    307     AtkAttributeSet* attributeSet = NULL;
     307    AtkAttributeSet* attributeSet = 0;
    308308
    309309    int headingLevel = core(object)->headingLevel();
     
    593593        static const GTypeInfo tinfo = {
    594594            sizeof(WebKitAccessibleClass),
    595             (GBaseInitFunc)NULL,
    596             (GBaseFinalizeFunc)NULL,
    597             (GClassInitFunc)webkit_accessible_class_init,
    598             (GClassFinalizeFunc)NULL,
    599             NULL, /* class data */
     595            (GBaseInitFunc) 0,
     596            (GBaseFinalizeFunc) 0,
     597            (GClassInitFunc) webkit_accessible_class_init,
     598            (GClassFinalizeFunc) 0,
     599            0, /* class data */
    600600            sizeof(WebKitAccessible), /* instance size */
    601601            0, /* nb preallocs */
    602             (GInstanceInitFunc)NULL,
    603             NULL /* value table */
     602            (GInstanceInitFunc) 0,
     603            0 /* value table */
    604604        };
    605605
     
    625625static const gchar* webkit_accessible_action_get_description(AtkAction* action, gint i)
    626626{
    627     g_return_val_if_fail(i == 0, NULL);
     627    g_return_val_if_fail(i == 0, 0);
    628628    // TODO: Need a way to provide/localize action descriptions.
    629629    notImplemented();
     
    633633static const gchar* webkit_accessible_action_get_keybinding(AtkAction* action, gint i)
    634634{
    635     g_return_val_if_fail(i == 0, NULL);
     635    g_return_val_if_fail(i == 0, 0);
    636636    // FIXME: Construct a proper keybinding string.
    637637    return returnString(core(action)->accessKey().string());
     
    640640static const gchar* webkit_accessible_action_get_name(AtkAction* action, gint i)
    641641{
    642     g_return_val_if_fail(i == 0, NULL);
     642    g_return_val_if_fail(i == 0, 0);
    643643    return returnString(core(action)->actionVerb());
    644644}
     
    841841    CString stringUTF8 = UTF8Encoding().encode(characters, length, QuestionMarksForUnencodables);
    842842    gchar* utf8String = utf8Substr(stringUTF8.data(), from, to);
    843     if (!g_utf8_validate(utf8String, -1, NULL)) {
     843    if (!g_utf8_validate(utf8String, -1, 0)) {
    844844        g_free(utf8String);
    845845        return 0;
    846846    }
    847847    gsize len = strlen(utf8String);
    848     GString* ret = g_string_new_len(NULL, len);
     848    GString* ret = g_string_new_len(0, len);
    849849    gchar* ptr = utf8String;
    850850
     
    877877        return 0;
    878878
    879     GString* str = g_string_new(NULL);
     879    GString* str = g_string_new(0);
    880880
    881881    AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject);
     
    889889    InlineTextBox* box = renderText->firstTextBox();
    890890    while (box) {
    891         gchar *text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
     891        gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
    892892        g_string_append(str, text);
    893893        g_string_append(str, "\n");
     
    918918{
    919919    notImplemented();
    920     return NULL;
     920    return 0;
    921921}
    922922
     
    930930{
    931931    notImplemented();
    932     return NULL;
     932    return 0;
    933933}
    934934
     
    936936{
    937937    notImplemented();
    938     return NULL;
     938    return 0;
    939939}
    940940
     
    981981}
    982982
    983 static bool selectionBelongsToObject(AccessibilityObject *coreObject, VisibleSelection& selection)
     983static bool selectionBelongsToObject(AccessibilityObject* coreObject, VisibleSelection& selection)
    984984{
    985985    if (!coreObject->isAccessibilityRenderObject())
     
    10161016    if (selection_num != 0 || !selectionBelongsToObject(coreObject, selection)) {
    10171017        *start_offset = *end_offset = 0;
    1018         return NULL;
     1018        return 0;
    10191019    }
    10201020
     
    12021202    AccessibilityObject* target = core(component)->doAccessibilityHitTest(pos);
    12031203    if (!target)
    1204         return NULL;
     1204        return 0;
    12051205    g_object_ref(target->wrapper());
    12061206    return target->wrapper();
     
    12191219}
    12201220
    1221 static void atk_component_interface_init(AtkComponentIface *iface)
     1221static void atk_component_interface_init(AtkComponentIface* iface)
    12221222{
    12231223    iface->ref_accessible_at_point = webkit_accessible_component_ref_accessible_at_point;
     
    12661266}
    12671267
    1268 static gint cellIndex(AccessibilityTableCell* AXCell, AccessibilityTable* AXTable)
     1268static gint cellIndex(AccessibilityTableCell* axCell, AccessibilityTable* axTable)
    12691269{
    12701270    // Calculate the cell's index as if we had a traditional Gtk+ table in
    12711271    // which cells are all direct children of the table, arranged row-first.
    12721272    AccessibilityObject::AccessibilityChildrenVector allCells;
    1273     AXTable->cells(allCells);
     1273    axTable->cells(allCells);
    12741274    AccessibilityObject::AccessibilityChildrenVector::iterator position;
    1275     position = std::find(allCells.begin(), allCells.end(), AXCell);
     1275    position = std::find(allCells.begin(), allCells.end(), axCell);
    12761276    if (position == allCells.end())
    12771277        return -1;
     
    12951295static AtkObject* webkit_accessible_table_ref_at(AtkTable* table, gint row, gint column)
    12961296{
    1297     AccessibilityTableCell* AXCell = cell(table, row, column);
    1298     if (!AXCell)
    1299         return 0;
    1300     return AXCell->wrapper();
     1297    AccessibilityTableCell* axCell = cell(table, row, column);
     1298    if (!axCell)
     1299        return 0;
     1300    return axCell->wrapper();
    13011301}
    13021302
    13031303static gint webkit_accessible_table_get_index_at(AtkTable* table, gint row, gint column)
    13041304{
    1305     AccessibilityTableCell* AXCell = cell(table, row, column);
    1306     AccessibilityTable* AXTable = static_cast<AccessibilityTable*>(core(table));
    1307     return cellIndex(AXCell, AXTable);
     1305    AccessibilityTableCell* axCell = cell(table, row, column);
     1306    AccessibilityTable* axTable = static_cast<AccessibilityTable*>(core(table));
     1307    return cellIndex(axCell, axTable);
    13081308}
    13091309
     
    13481348static gint webkit_accessible_table_get_column_extent_at(AtkTable* table, gint row, gint column)
    13491349{
    1350     AccessibilityTableCell* AXCell = cell(table, row, column);
    1351     if (AXCell) {
     1350    AccessibilityTableCell* axCell = cell(table, row, column);
     1351    if (axCell) {
    13521352        pair<int, int> columnRange;
    1353         AXCell->columnIndexRange(columnRange);
     1353        axCell->columnIndexRange(columnRange);
    13541354        return columnRange.second;
    13551355    }
     
    13591359static gint webkit_accessible_table_get_row_extent_at(AtkTable* table, gint row, gint column)
    13601360{
    1361     AccessibilityTableCell* AXCell = cell(table, row, column);
    1362     if (AXCell) {
     1361    AccessibilityTableCell* axCell = cell(table, row, column);
     1362    if (axCell) {
    13631363        pair<int, int> rowRange;
    1364         AXCell->rowIndexRange(rowRange);
     1364        axCell->rowIndexRange(rowRange);
    13651365        return rowRange.second;
    13661366    }
     
    14991499static const GInterfaceInfo AtkInterfacesInitFunctions[] = {
    15001500    {(GInterfaceInitFunc)atk_action_interface_init,
    1501      (GInterfaceFinalizeFunc) NULL, NULL},
     1501     (GInterfaceFinalizeFunc) 0, 0},
    15021502    {(GInterfaceInitFunc)atk_selection_interface_init,
    1503      (GInterfaceFinalizeFunc) NULL, NULL},
     1503     (GInterfaceFinalizeFunc) 0, 0},
    15041504    {(GInterfaceInitFunc)atk_editable_text_interface_init,
    1505      (GInterfaceFinalizeFunc) NULL, NULL},
     1505     (GInterfaceFinalizeFunc) 0, 0},
    15061506    {(GInterfaceInitFunc)atk_text_interface_init,
    1507      (GInterfaceFinalizeFunc) NULL, NULL},
     1507     (GInterfaceFinalizeFunc) 0, 0},
    15081508    {(GInterfaceInitFunc)atk_component_interface_init,
    1509      (GInterfaceFinalizeFunc) NULL, NULL},
     1509     (GInterfaceFinalizeFunc) 0, 0},
    15101510    {(GInterfaceInitFunc)atk_image_interface_init,
    1511      (GInterfaceFinalizeFunc) NULL, NULL},
     1511     (GInterfaceFinalizeFunc) 0, 0},
    15121512    {(GInterfaceInitFunc)atk_table_interface_init,
    1513      (GInterfaceFinalizeFunc) NULL, NULL},
     1513     (GInterfaceFinalizeFunc) 0, 0},
    15141514    {(GInterfaceInitFunc)atk_document_interface_init,
    1515      (GInterfaceFinalizeFunc) NULL, NULL}
     1515     (GInterfaceFinalizeFunc) 0, 0}
    15161516};
    15171517
     
    15961596#define WAI_TYPE_NAME_LEN (30) /* Enough for prefix + 5 hex characters (max) */
    15971597    static char name[WAI_TYPE_NAME_LEN + 1];
    1598    
     1598
    15991599    g_sprintf(name, "WAIType%x", interfaceMask);
    16001600    name[WAI_TYPE_NAME_LEN] = '\0';
    1601    
     1601
    16021602    return name;
    16031603}
     
    16071607    static const GTypeInfo typeInfo = {
    16081608        sizeof(WebKitAccessibleClass),
    1609         (GBaseInitFunc) NULL,
    1610         (GBaseFinalizeFunc) NULL,
    1611         (GClassInitFunc) NULL,
    1612         (GClassFinalizeFunc) NULL,
    1613         NULL, /* class data */
     1609        (GBaseInitFunc) 0,
     1610        (GBaseFinalizeFunc) 0,
     1611        (GClassInitFunc) 0,
     1612        (GClassFinalizeFunc) 0,
     1613        0, /* class data */
    16141614        sizeof(WebKitAccessible), /* instance size */
    16151615        0, /* nb preallocs */
    1616         (GInstanceInitFunc) NULL,
    1617         NULL /* value table */
     1616        (GInstanceInitFunc) 0,
     1617        0 /* value table */
    16181618    };
    16191619
     
    16401640{
    16411641    GType type = getAccessibilityTypeFromObject(coreObject);
    1642     AtkObject* object = static_cast<AtkObject*>(g_object_new(type, NULL));
     1642    AtkObject* object = static_cast<AtkObject*>(g_object_new(type, 0));
    16431643
    16441644    atk_object_initialize(object, coreObject);
Note: See TracChangeset for help on using the changeset viewer.