diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index 7c7acafe7f..e93e2df26d 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -21,9 +21,10 @@ #include #include #include +#include #include #include -#include +#include #include #include @@ -118,7 +119,7 @@ AboutView::AboutView(const BRect &rect) fLastActionTime(system_time()), fScrollRunner(NULL) { - fLogo = BTranslationUtils::GetBitmap('PNG ', "haikulogo.png"); + fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "haikulogo.png"); if (fLogo) { fDrawPoint.x = (225-fLogo->Bounds().Width()) / 2; fDrawPoint.y = 0; diff --git a/src/apps/clock/cl_view.cpp b/src/apps/clock/cl_view.cpp index dc7769a305..00edde3b7d 100644 --- a/src/apps/clock/cl_view.cpp +++ b/src/apps/clock/cl_view.cpp @@ -65,7 +65,7 @@ dummy_label: } theRect.Set(0,0,15,15); - if ((picH = rsrcs.FindResource('MICN', "center", &len))) { + if ((picH = rsrcs.FindResource(B_MINI_ICON_TYPE, "center", &len))) { fCenter = new BBitmap(theRect, B_CMAP8); fCenter->SetBits(picH, len, 0, B_CMAP8); free(picH); diff --git a/src/apps/diskprobe/AttributeEditors.cpp b/src/apps/diskprobe/AttributeEditors.cpp index 0d22a572d4..a88c5f5174 100644 --- a/src/apps/diskprobe/AttributeEditors.cpp +++ b/src/apps/diskprobe/AttributeEditors.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -772,7 +773,7 @@ ImageView::ImageView(BRect rect, DataEditor &editor) fBitmap(NULL), fScaleSlider(NULL) { - if (editor.Type() == 'MICN' || editor.Type() == 'ICON' + if (editor.Type() == B_MINI_ICON_TYPE || editor.Type() == B_LARGE_ICON_TYPE #ifdef HAIKU_TARGET_PLATFORM_HAIKU || editor.Type() == B_VECTOR_ICON_TYPE #endif @@ -878,7 +879,7 @@ ImageView::UpdateImage() return; } - if (fBitmap != NULL && (fEditor.Type() == 'MICN' || fEditor.Type() == 'ICON')) { + if (fBitmap != NULL && (fEditor.Type() == B_MINI_ICON_TYPE || fEditor.Type() == B_LARGE_ICON_TYPE)) { // optimize icon update... fBitmap->SetBits(data, fEditor.FileSize(), 0, B_CMAP8); fEditor.SetViewSize(viewSize); @@ -899,12 +900,12 @@ ImageView::UpdateImage() fBitmap = NULL; switch (fEditor.Type()) { - case 'MICN': + case B_MINI_ICON_TYPE: fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8); if (fBitmap->InitCheck() == B_OK) fBitmap->SetBits(data, fEditor.FileSize(), 0, B_CMAP8); break; - case 'ICON': + case B_LARGE_ICON_TYPE: fBitmap = new BBitmap(BRect(0, 0, 31, 31), B_CMAP8); if (fBitmap->InitCheck() == B_OK) fBitmap->SetBits(data, fEditor.FileSize(), 0, B_CMAP8); @@ -921,13 +922,13 @@ ImageView::UpdateImage() } break; #endif - case 'PNG ': + case B_PNG_FORMAT: { BMemoryIO stream(data, fEditor.FileSize()); fBitmap = BTranslationUtils::GetBitmap(&stream); break; } - case 'MSGG': + case B_MESSAGE_TYPE: { BMessage message; // ToDo: this could be problematic if the data is not large @@ -950,17 +951,17 @@ ImageView::UpdateImage() char buffer[256]; const char *type = "Unknown Type"; switch (fEditor.Type()) { - case 'MICN': - case 'ICON': + case B_MINI_ICON_TYPE: + case B_LARGE_ICON_TYPE: #ifdef HAIKU_TARGET_PLATFORM_HAIKU case B_VECTOR_ICON_TYPE: #endif type = "Icon"; break; - case 'PNG ': + case B_PNG_FORMAT: type = "PNG Format"; break; - case 'MSGG': + case B_MESSAGE_TYPE: type = "Flattened Bitmap"; break; default: @@ -1083,10 +1084,10 @@ GetTypeEditorFor(BRect rect, DataEditor &editor) case B_OFF_T_TYPE: case B_POINTER_TYPE: return new NumberEditor(rect, editor); - case 'MICN': - case 'ICON': - case 'PNG ': - case 'MSGG': + case B_MINI_ICON_TYPE: + case B_LARGE_ICON_TYPE: + case B_PNG_FORMAT: + case B_MESSAGE_TYPE: #ifdef HAIKU_TARGET_PLATFORM_HAIKU case B_VECTOR_ICON_TYPE: #endif diff --git a/src/apps/installer/FSUtils.cpp b/src/apps/installer/FSUtils.cpp index 69c7ec9e37..1379a9b4b8 100644 --- a/src/apps/installer/FSUtils.cpp +++ b/src/apps/installer/FSUtils.cpp @@ -2140,13 +2140,13 @@ FSGetDeskDir(BDirectory *deskDir, dev_t dev) size_t size; const void* data = GetTrackerResources()-> - LoadResource('ICON', kResDeskIcon, &size); + LoadResource(B_LARGE_ICON_TYPE, kResDeskIcon, &size); if (data) deskDir->WriteAttr(kAttrLargeIcon, B_COLOR_8_BIT_TYPE, 0, data, size); data = GetTrackerResources()-> - LoadResource('MICN', kResDeskIcon, &size); + LoadResource(B_MINI_ICON_TYPE, kResDeskIcon, &size); if (data) deskDir->WriteAttr(kAttrMiniIcon, B_COLOR_8_BIT_TYPE, 0, data, size); @@ -2639,13 +2639,13 @@ FSCreateTrashDirs() if (FSGetTrashDir(&trashDir, volume.Device()) == B_OK) { size_t size; const void* data = GetTrackerResources()-> - LoadResource('ICON', kResTrashIcon, &size); + LoadResource(B_LARGE_ICON_TYPE, kResTrashIcon, &size); if (data) { trashDir.WriteAttr(kAttrLargeIcon, B_COLOR_8_BIT_TYPE, 0, data, size); } data = GetTrackerResources()-> - LoadResource('MICN', kResTrashIcon, &size); + LoadResource(B_MINI_ICON_TYPE, kResTrashIcon, &size); if (data) { trashDir.WriteAttr(kAttrMiniIcon, B_COLOR_8_BIT_TYPE, 0, data, size); diff --git a/src/bin/listattr.cpp b/src/bin/listattr.cpp index f50f308de1..b932628838 100644 --- a/src/bin/listattr.cpp +++ b/src/bin/listattr.cpp @@ -51,9 +51,9 @@ get_type(type_code type) case B_DOUBLE_TYPE: return "Double"; - case 'MICN': + case B_MINI_ICON_TYPE: return "Mini Icon"; - case 'ICON': + case B_LARGE_ICON_TYPE: return "Icon"; default: diff --git a/src/bin/listres.cpp b/src/bin/listres.cpp index 0303ac725f..c4419ca57b 100644 --- a/src/bin/listres.cpp +++ b/src/bin/listres.cpp @@ -49,9 +49,9 @@ get_type(type_code type) case B_DOUBLE_TYPE: return "Double"; - case 'MICN': + case B_MINI_ICON_TYPE: return "Mini Icon"; - case 'ICON': + case B_LARGE_ICON_TYPE: return "Icon"; default: diff --git a/src/preferences/filetypes/IconView.cpp b/src/preferences/filetypes/IconView.cpp index 36c0d2dd56..8ba4a04184 100644 --- a/src/preferences/filetypes/IconView.cpp +++ b/src/preferences/filetypes/IconView.cpp @@ -1073,7 +1073,7 @@ IconView::ShowIconHeap(bool show) if (data == NULL) { // no vector icon or failed to get bitmap // try bitmap icon - data = resources->LoadResource('ICON', "icon heap", NULL); + data = resources->LoadResource(B_LARGE_ICON_TYPE, "icon heap", NULL); if (data != NULL) { fHeapIcon = Icon::AllocateBitmap(B_LARGE_ICON, B_CMAP8); memcpy(fHeapIcon->Bits(), data, fHeapIcon->BitsLength()); diff --git a/src/preferences/mail/ConfigWindow.cpp b/src/preferences/mail/ConfigWindow.cpp index 23523dd30e..9cc44bca08 100644 --- a/src/preferences/mail/ConfigWindow.cpp +++ b/src/preferences/mail/ConfigWindow.cpp @@ -443,7 +443,7 @@ ConfigWindow::MakeHowToView() BResources *resources = BApplication::AppResources(); if (resources) { size_t length; - char *buffer = (char *)resources->FindResource('ICON', 101, &length); + char *buffer = (char *)resources->FindResource(B_LARGE_ICON_TYPE, 101, &length); if (buffer) { BBitmap *bitmap = new BBitmap(BRect(0, 0, 63, 63), B_CMAP8); if (bitmap && bitmap->InitCheck() == B_OK) { diff --git a/src/preferences/media/MediaAlert.cpp b/src/preferences/media/MediaAlert.cpp index 6fef2a7b12..4a0420edac 100644 --- a/src/preferences/media/MediaAlert.cpp +++ b/src/preferences/media/MediaAlert.cpp @@ -130,7 +130,7 @@ BBitmap* MediaAlert::InitIcon() // Load the raw icon data size_t size; const void* rawIcon = - Resources.LoadResource('ICON', iconName, &size); + Resources.LoadResource(B_LARGE_ICON_TYPE, iconName, &size); if (rawIcon) { diff --git a/src/preferences/mouse/MouseView.cpp b/src/preferences/mouse/MouseView.cpp index 93a05d26c5..036371a12e 100644 --- a/src/preferences/mouse/MouseView.cpp +++ b/src/preferences/mouse/MouseView.cpp @@ -96,8 +96,8 @@ MouseView::MouseView(BRect rect, const MouseSettings &settings) fMouseDownBitmap->SetBits(kMouseDownBits, sizeof(kMouseDownBits), 0, kMouseDownColorSpace); // ToDo: move these images to the resources as well - //fMouseBitmap = BTranslationUtils::GetBitmap('PNG ', "mouse_bmap"); - //fMouseDownBitmap = BTranslationUtils::GetBitmap('PNG ', "pressed_mouse_bmap"); + //fMouseBitmap = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "mouse_bmap"); + //fMouseDownBitmap = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "pressed_mouse_bmap"); if (fMouseDownBitmap != NULL) fMouseDownBounds = fMouseDownBitmap->Bounds(); diff --git a/src/preferences/screen/AlertView.cpp b/src/preferences/screen/AlertView.cpp index 707f0f22b8..06bf2633ef 100644 --- a/src/preferences/screen/AlertView.cpp +++ b/src/preferences/screen/AlertView.cpp @@ -144,7 +144,7 @@ AlertView::InitIcon() && resources.SetTo(&file) == B_OK) { // Load the raw icon data size_t size; - const void* data = resources.LoadResource('ICON', "warn", &size); + const void* data = resources.LoadResource(B_LARGE_ICON_TYPE, "warn", &size); if (data) { // Now build the bitmap icon = new BBitmap(BRect(0, 0, 31, 31), 0, B_CMAP8); diff --git a/src/servers/midi/DeviceWatcher.cpp b/src/servers/midi/DeviceWatcher.cpp index 9fca4f1063..c7c7299ab8 100644 --- a/src/servers/midi/DeviceWatcher.cpp +++ b/src/servers/midi/DeviceWatcher.cpp @@ -51,10 +51,10 @@ DeviceWatcher::DeviceWatcher() size_t size; const void* bits; - bits = res.LoadResource('ICON', 10, &size); + bits = res.LoadResource(B_LARGE_ICON_TYPE, 10, &size); largeIcon->SetBits(bits, size, 0, B_CMAP8); - bits = res.LoadResource('MICN', 11, &size); + bits = res.LoadResource(B_MINI_ICON_TYPE, 11, &size); miniIcon->SetBits(bits, size, 0, B_CMAP8); } } @@ -132,10 +132,10 @@ void DeviceWatcher::SetIcons(BMidiEndpoint* endp) BMessage msg; msg.AddData( - "be:large_icon", 'ICON', largeIcon->Bits(), largeIcon->BitsLength()); + "be:large_icon", B_LARGE_ICON_TYPE, largeIcon->Bits(), largeIcon->BitsLength()); msg.AddData( - "be:mini_icon", 'MICN', miniIcon->Bits(), miniIcon->BitsLength()); + "be:mini_icon", B_MINI_ICON_TYPE, miniIcon->Bits(), miniIcon->BitsLength()); endp->SetProperties(&msg); }