Lines Matching refs:attr

40 static const char* kAttrPrivateType = "^attr-private";
326 PendingAttribute attr(myPackage, in, block, inStyleable);
328 const String16 attr16("attr");
341 attr.ident = String16(block.getAttributeStringValue(identIdx, &len));
343 *outIdent = attr.ident;
346 attr.sourcePos.error("A 'name' attribute is required for <attr>\n");
347 attr.hasErrors = true;
350 attr.comment = String16(
356 attr.type = parse_flags(typeStr.string(), typeStr.size(), gFormatFlags);
357 if (attr.type == 0) {
358 attr.sourcePos.error("Tag <attr> 'format' attribute value \"%s\" not valid\n",
360 attr.hasErrors = true;
362 attr.createIfNeeded(outTable);
366 attr.createIfNeeded(outTable);
369 //printf("Attribute %s: type=0x%08x\n", String8(attr.ident).string(), attr.type);
375 attr.sourcePos.error("Tag <attr> 'min' attribute must be a number, not \"%s\"\n",
377 attr.hasErrors = true;
379 attr.createIfNeeded(outTable);
380 if (!attr.hasErrors) {
381 err = outTable->addBag(attr.sourcePos, myPackage, attr16, attr.ident,
384 attr.hasErrors = true;
393 attr.sourcePos.error("Tag <attr> 'max' attribute must be a number, not \"%s\"\n",
395 attr.hasErrors = true;
397 attr.createIfNeeded(outTable);
398 if (!attr.hasErrors) {
399 err = outTable->addBag(attr.sourcePos, myPackage, attr16, attr.ident,
401 attr.hasErrors = true;
405 if ((minIdx >= 0 || maxIdx >= 0) && (attr.type&ResTable_map::TYPE_INTEGER) == 0) {
406 attr.sourcePos.error("Tag <attr> must have format=integer attribute if using max or min\n");
407 attr.hasErrors = true;
416 attr.sourcePos.error("Tag <attr> 'localization' attribute value \"%s\" not valid\n",
418 attr.hasErrors = true;
420 attr.createIfNeeded(outTable);
421 if (!attr.hasErrors) {
424 err = outTable->addBag(attr.sourcePos, myPackage, attr16, attr.ident,
427 attr.hasErrors = true;
443 .error("Tag <%s> can not appear inside <attr>, only <enum> or <flag>\n",
448 attr.createIfNeeded(outTable);
450 if (attr.type == ResTable_map::TYPE_ANY) {
453 attr.type = 0;
456 if ((attr.type&(ResTable_map::TYPE_ENUM|ResTable_map::TYPE_FLAGS)) == 0) {
458 attr.type |= localType;
459 if (!attr.hasErrors) {
461 sprintf(numberStr, "%d", attr.type);
463 myPackage, attr16, attr.ident, String16(""),
466 attr.hasErrors = true;
469 } else if ((uint32_t)(attr.type&(ResTable_map::TYPE_ENUM|ResTable_map::TYPE_FLAGS)) != localType) {
473 attr.hasErrors = true;
477 attr.hasErrors = true;
488 attr.hasErrors = true;
498 attr.hasErrors = true;
500 if (!attr.hasErrors && !ResTable::stringToInt(value.string(), value.size(), NULL)) {
505 attr.hasErrors = true;
508 if (!attr.hasErrors) {
510 enumOrFlagsComment.append(mayOrMust(attr.type,
512 enumOrFlagsComment.append((attr.type&ResTable_map::TYPE_ENUM)
534 attr16, attr.ident, String16(""),
537 attr.hasErrors = true;
544 if ((attr.type&ResTable_map::TYPE_ENUM) != 0) {
562 if (!attr.hasErrors && attr.added) {
563 appendTypeInfo(outTable, myPackage, attr16, attr.ident, attr.type, gFormatFlags);
566 if (!attr.hasErrors && enumOrFlagsComment.size() > 0) {
568 outTable->appendTypeComment(myPackage, attr16, attr.ident, enumOrFlagsComment);
787 const String16 attr16("attr");
1275 "Tag <%s> can not appear inside <declare-styleable>, only <attr>\n",
1301 "Found tag </%s> where </attr> is expected\n",
1355 const char16_t* attr = block.getAttributeName(i, &length);
1356 if (strcmp16(attr, name16.string()) == 0) {
1358 } else if (strcmp16(attr, translatable16.string()) == 0) {
1360 } else if (strcmp16(attr, formatted16.string()) == 0) {
1474 const char16_t* attr = block.getAttributeName(i, &length);
1475 if (strcmp16(attr, formatted16.string()) == 0) {
1480 } else if (strcmp16(attr, translatable16.string()) == 0) {
1783 getType(mAssetsPackage, String16("attr"), unknown);
2106 const String16 attr16("attr");
2120 source.error("Failed to create entry attr/%s", String8(name).string());
2222 if (type != String16("attr")) {
2369 if (type != String16("attr")) {
2475 buf, ac->attr.string(), ac->value.string());
2624 sp<Type> attr = p->getType(String16("attr"), unknown);
2650 LOG_ALWAYS_FATAL_IF(ti == 0 && attr != t,
2651 "First type is not attr!");
2720 typeSymbols = outSymbols->addNestedSymbol(String8("attr"), t->getPos());
3556 // one an attr and one an id, with the same name. Not something we
3602 const String16 attr16("attr");
3655 const String16 attr16("attr");
4218 sp<Type> attr = mTypes.valueFor(String16("attr"));
4219 if (attr == NULL) {
4227 const Vector<sp<ConfigList> >& configs = attr->getOrderedConfigs();
4234 if (attr->isPublic(configs[i]->getName())) {
4255 attr->removeEntry(cl->getName());
4571 * | 0x01010234 | attr/color
4572 * | 0x01010235 | attr/background
4575 * | 0x01010236 | attr/secret
4576 * | 0x01010237 | attr/shhh
4582 * | 0x01010234 | attr/color
4583 * | 0x01010235 | attr/background
4584 * | 0x01010236 | attr/shinyNewAttr
4585 * | 0x01010237 | attr/highlyValuedFeature
4588 * | 0x01010238 | attr/secret
4589 * | 0x01010239 | attr/shhh
4610 const String16 attr16("attr");
4771 const XMLNode::attribute_entry& attr = attrs[i];
4772 const int sdkLevel = getPublicAttributeSdkLevel(attr.nameResId);
4786 String8(attr.ns).string(),
4787 (attr.ns.size() == 0 ? "" : ":"),
4788 String8(attr.name).string(),
4929 * <aapt:attr name="android:drawable">
4936 * </aapt:attr>
4939 * When AAPT sees the <aapt:attr> tag, it will extract its single element and its children
4974 const String16 kAttr16("attr");
5001 // This is the <aapt:attr> tag. Look for the 'name' attribute.
5012 // Find the special attribute 'parent-attr'. This attribute's value contains
5014 const XMLNode::attribute_entry* attr = child->getAttribute(String16(), kName16);
5015 if (attr == NULL) {
5023 bool result = ResTable::expandResourceRef(attr->string.string(),
5024 attr->string.size(),
5100 // Remove the <aapt:attr> child element from here.