Lines Matching refs:entry

136 		// clean up a bit to leave the hash table entry in an initialized state
148 const SharedCacheEntry* entry)
150 sharedCache->SetAliasFor(this, entry);
164 IconCacheEntry* entry)
166 if (entry == NULL)
169 return sharedCache->ResolveIfAlias(entry);
349 LazyBitmapAllocator* lazyBitmap, IconCacheEntry* entry)
356 if (entry == NULL) {
357 entry = fSharedCache.FindItem(fileTypeSignature, preferredApp);
358 if (entry != NULL) {
359 entry = entry->ResolveIfAlias(&fSharedCache, entry);
362 __FILE__, __LINE__, preferredApp, fileTypeSignature, entry));
364 if (entry->HaveIconBitmap(mode, size))
365 return entry;
369 if (entry == NULL || !entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
383 if (entry == NULL) {
385 ("File %s; Line %d # adding entry for preferredApp %s, "
388 entry = fSharedCache.AddItem(fileTypeSignature, preferredApp);
390 entry->SetIcon(bitmap, kNormalIcon, size);
394 && entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
395 entry->ConstructBitmap(mode, size, lazyBitmap);
396 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
399 return entry;
405 BSize size, LazyBitmapAllocator* lazyBitmap, IconCacheEntry* entry)
409 if (entry == NULL)
410 entry = fSharedCache.FindItem(fileType);
412 if (entry != NULL) {
413 entry = entry->ResolveIfAlias(&fSharedCache, entry);
415 if (entry->HaveIconBitmap(mode, size))
416 return entry;
419 if (entry == NULL || !entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
432 if (entry != NULL) {
434 = (SharedCacheEntry*)entry->ResolveIfAlias(&fSharedCache);
444 // make an aliased entry so that the next time we get a
446 if (entry == NULL) {
448 ("File %s; Line %d # adding entry as alias for type %s\n",
450 entry = fSharedCache.AddItem(fileType);
451 entry->SetAliasFor(&fSharedCache, aliasTo);
459 if (entry == NULL) {
460 PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n",
462 entry = fSharedCache.AddItem(fileType);
464 entry->SetIcon(bitmap, kNormalIcon, size);
467 ASSERT(entry != NULL);
470 && entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
471 entry->ConstructBitmap(mode, size, lazyBitmap);
472 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
476 if (!entry->HaveIconBitmap(mode, size))
480 ASSERT(entry->HaveIconBitmap(mode, size));
482 return entry;
489 LazyBitmapAllocator* lazyBitmap, IconCacheEntry* entry)
502 entry = GetIconForPreferredApp(fileType, nodePreferredApp, mode,
503 size, lazyBitmap, entry);
506 __FILE__, __LINE__, nodePreferredApp, fileType, entry));
508 if (entry != NULL) {
510 ASSERT(entry->HaveIconBitmap(mode, size));
512 return entry;
519 entry = GetIconFromMetaMime(fileType, mode, size, lazyBitmap, entry);
520 if (entry == NULL) {
528 entry = GetIconFromMetaMime(superTypeFileType, mode, size,
529 lazyBitmap, entry);
540 ASSERT(entry == NULL || entry->HaveIconBitmap(mode, size));
541 if (entry != NULL) {
544 // fileType/preferredApp combo with an aliased entry
546 // make an aliased entry so that the next time we get a
550 ("File %s; Line %d # adding entry as alias for "
556 (SharedCacheEntry*)entry);
566 if (!entry->HaveIconBitmap(mode, size))
569 ASSERT(entry->HaveIconBitmap(mode, size));
572 return entry;
585 IconCacheEntry* entry = 0;
588 entry = fNodeCache.FindItem(model->NodeRef());
589 if (entry != NULL) {
590 entry = IconCacheEntry::ResolveIfAlias(&fSharedCache, entry);
593 // if tracker default, resolved entry is from shared cache
594 // this could be done a little cleaner if entry had a way to
600 if (entry->HaveIconBitmap(mode, size))
601 return entry;
607 if (entry == NULL || !entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
615 if (entry == NULL) {
617 ("File %s; Line %d # adding entry for model %s\n",
619 entry = fNodeCache.AddItem(model->NodeRef());
621 entry->SetIcon(lazyBitmap->Adopt(), kNormalIcon, size);
626 if (entry == NULL) {
628 ("File %s; Line %d # adding entry for model %s\n",
630 entry = fNodeCache.AddItem(model->NodeRef());
632 ASSERT(entry != NULL);
633 entry->SetIcon(bitmap, kNormalIcon, size);
640 entry = GetIconFromMetaMime(B_VOLUME_MIMETYPE, mode,
641 size, lazyBitmap, entry);
645 if (mode != kNormalIcon && entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
646 entry->ConstructBitmap(mode, size, lazyBitmap);
647 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
650 return entry;
690 IconCacheEntry* entry = fSharedCache.FindItem(type.String());
691 if (entry != NULL) {
692 entry = entry->ResolveIfAlias(&fSharedCache, entry);
693 if (entry->HaveIconBitmap(mode, size))
694 return entry;
697 if (entry == NULL || !entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
763 entry = fSharedCache.AddItem(type.String());
768 entry->SetIcon(lazyBitmap->Adopt(), kNormalIcon, size);
772 && entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
773 entry->ConstructBitmap(mode, size, lazyBitmap);
774 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
777 ASSERT(entry->HaveIconBitmap(mode, size));
779 return entry;
789 LazyBitmapAllocator* lazyBitmap, IconCacheEntry* entry, bool permanent)
794 entry = fNodeCache.FindItem(model->NodeRef());
795 if (entry == NULL || !entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
821 PRINT_ADD_ITEM(("File %s; Line %d # adding entry for model %s\n",
823 entry = fNodeCache.AddItem(model->NodeRef(), permanent);
824 ASSERT(entry != NULL);
825 entry->SetIcon(bitmap, kNormalIcon, size);
827 entry->ConstructBitmap(mode, size, lazyBitmap);
828 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
834 if (entry == NULL) {
837 } else if (!entry->HaveIconBitmap(mode, size)
838 && entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
839 entry->ConstructBitmap(mode, size, lazyBitmap);
840 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
841 ASSERT(entry->HaveIconBitmap(mode, size));
844 return entry;
853 LazyBitmapAllocator* lazyBitmap, IconCacheEntry* entry)
858 entry = GetIconFromMetaMime(B_FILE_MIMETYPE, mode, size, lazyBitmap, 0);
859 if (entry == NULL)
862 // make an aliased entry so that the next time we get a
865 ("File %s; Line %d # adding entry for preferredApp %s, type %s\n",
870 aliasedEntry->SetAliasFor(&fSharedCache, (SharedCacheEntry*)entry);
874 ASSERT(entry->HaveIconBitmap(mode, size));
876 return entry;
884 LazyBitmapAllocator* lazyBitmap, IconCacheEntry* entry)
889 entry = fSharedCache.AddItem(model->MimeType(),
895 entry->SetIcon(lazyBitmap->Adopt(), kNormalIcon, size);
898 entry->ConstructBitmap(mode, size, lazyBitmap);
899 entry->SetIcon(lazyBitmap->Adopt(), mode, size);
902 ASSERT(entry->HaveIconBitmap(mode, size));
904 return entry;
915 IconCacheEntry* entry = NULL;
935 entry = GetNodeIcon(&modelOpener, nodeCacheLocker,
937 &lazyBitmap, entry, permanent);
938 if (entry == NULL || !entry->HaveIconBitmap(mode, size)) {
940 entry = GetVolumeIcon(nodeCacheLocker, sharedCacheLocker,
945 entry = GetRootIcon(nodeCacheLocker, sharedCacheLocker,
948 ASSERT(entry != NULL);
952 entry = GetNodeIcon(&modelOpener, nodeCacheLocker,
954 mode, size, &lazyBitmap, entry, permanent);
957 if (entry == NULL) {
964 entry = GetIconFromFileTypes(&modelOpener, source, mode,
966 if (entry == NULL) {
968 entry = GetGenericIcon(sharedCacheLocker,
970 size, &lazyBitmap, entry);
985 entry = GetNodeIcon(&modelOpener, nodeCacheLocker,
987 size, &lazyBitmap, entry, permanent);
988 if (entry != NULL) {
989 entry = IconCacheEntry::ResolveIfAlias(&fSharedCache,
990 entry);
991 if (!entry->HaveIconBitmap(mode, size)
992 && entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
993 entry->ConstructBitmap(mode, size, &lazyBitmap);
994 entry->SetIcon(lazyBitmap.Adopt(), mode, size);
996 ASSERT(entry->HaveIconBitmap(mode, size));
1001 entry = GetRootIcon(nodeCacheLocker, sharedCacheLocker,
1006 entry = GetWellKnownIcon(nodeCacheLocker,
1009 if (entry != NULL)
1016 entry = GetNodeIcon(&modelOpener, nodeCacheLocker,
1018 mode, size, &lazyBitmap, entry, permanent);
1019 if (entry == NULL
1020 || !entry->HaveIconBitmap(mode, size)) {
1021 entry = GetVolumeIcon(nodeCacheLocker,
1034 entry = GetIconFromFileTypes(&modelOpener, source, mode,
1037 if (entry == NULL || !entry->HaveIconBitmap(mode, size)) {
1039 entry = GetGenericIcon(sharedCacheLocker,
1041 &lazyBitmap, entry);
1053 ASSERT(entry != NULL);
1054 ASSERT(entry->HaveIconBitmap(mode, size));
1063 if (entry == NULL || !entry->HaveIconBitmap(mode, size)) {
1068 entry = GetGenericIcon(sharedCacheLocker, &resultingOpenCache,
1069 model, source, mode, size, &lazyBitmap, entry);
1073 if (entry == NULL || !entry->HaveIconBitmap(mode, size)) {
1077 entry = GetFallbackIcon(sharedCacheLocker,
1079 entry);
1088 ASSERT(entry != NULL && entry->HaveIconBitmap(mode, size));
1093 return entry;
1108 IconCacheEntry* entry = Preload(&nodeCacheLocker, &sharedCacheLocker,
1110 // Preload finds/creates the appropriate entry, locking down the
1113 if (entry == NULL)
1116 ASSERT(entry != NULL);
1117 ASSERT(entry->HaveIconBitmap(mode, size));
1118 // got the entry, now draw it
1119 resultingCacheLocker->LockedItem()->Draw(entry, view, where, mode,
1137 IconCacheEntry* entry = Preload(&nodeCacheLocker, &sharedCacheLocker,
1140 if (entry == NULL)
1143 ASSERT(entry != NULL);
1144 ASSERT(entry->HaveIconBitmap(mode, size));
1145 resultingCacheLocker->LockedItem()->Draw(entry, view, where,
1175 IconCacheEntry* entry = GetIconForPreferredApp(fileType, preferredAppSig,
1177 if (entry != NULL)
1186 entry = fSharedCache.AddItem(fileType);
1188 entry->SetIcon(bitmap, kNormalIcon, size);
1190 entry->ConstructBitmap(mode, size, &lazyBitmap);
1191 entry->SetIcon(lazyBitmap.Adopt(), mode, size);
1244 SharedCacheEntry* entry = fSharedCache.FindItem(mimeType, appSignature);
1245 if (entry == NULL)
1250 entry = (SharedCacheEntry*)fSharedCache.ResolveIfAlias(entry);
1251 ASSERT(entry != NULL);
1253 fNodeCache.RemoveAliasesTo(entry);
1254 fSharedCache.RemoveAliasesTo(entry);
1256 fSharedCache.IconChanged(entry);
1381 IconCacheEntry* entry = Preload(&nodeCacheLocker, &sharedCacheLocker,
1383 // Preload finds/creates the appropriate entry, locking down the
1386 if (entry != NULL)
1387 return entry->IconHitTest(where, mode, size);
1436 SharedIconCache::Draw(IconCacheEntry* entry, BView* view, BPoint where,
1439 ((SharedCacheEntry*)entry)->Draw(view, where, mode, size, async);
1444 SharedIconCache::Draw(IconCacheEntry* entry, BView* view, BPoint where,
1448 ((SharedCacheEntry*)entry)->Draw(view, where, mode, size,
1473 SharedCacheEntry* entry = new SharedCacheEntry(fileType, appSignature);
1474 if (fHashTable.Insert(entry) == B_OK)
1475 return entry;
1477 delete entry;
1483 SharedIconCache::IconChanged(SharedCacheEntry* entry)
1485 // by now there should be no aliases to entry, just remove entry
1487 ASSERT(entry->fAliasTo == NULL);
1488 entry->RetireIcons(&fRetiredBitmaps);
1489 fHashTable.Remove(entry);
1498 SharedCacheEntry* entry = it.Next();
1499 if (entry->fAliasTo == alias)
1500 fHashTable.RemoveUnchecked(entry);
1506 SharedIconCache::SetAliasFor(IconCacheEntry* entry,
1509 entry->fAliasTo = original;
1706 NodeIconCache::Draw(IconCacheEntry* entry, BView* view, BPoint where,
1709 ((NodeCacheEntry*)entry)->Draw(view, where, mode, size, async);
1714 NodeIconCache::Draw(IconCacheEntry* entry, BView* view, BPoint where,
1718 ((NodeCacheEntry*)entry)->Draw(view, where, mode, size,
1733 NodeCacheEntry* entry = new NodeCacheEntry(node, permanent);
1734 if (fHashTable.Insert(entry) == B_OK)
1735 return entry;
1737 delete entry;
1745 NodeCacheEntry* entry = FindItem(node);
1746 if (entry == NULL || entry->Permanent())
1749 fHashTable.Remove(entry);
1756 NodeCacheEntry* entry = FindItem(node);
1757 ASSERT(entry != NULL);
1758 if (entry == NULL)
1761 fHashTable.Remove(entry);
1786 NodeCacheEntry* entry = it.Next();
1787 if (entry->fAliasTo == alias)
1788 fHashTable.RemoveUnchecked(entry);