| 30 | surface_t FileView::folderIconSml; |
| 31 | |
| 32 | __attribute__((constructor)) |
| 33 | void InitializeFVIcons(){ |
| 34 | if(FILE* f = fopen("/initrd/disk.png", "rb")){ |
| 35 | Graphics::LoadImage(f, &FileView::diskIcon); |
| 36 | fclose(f); |
| 37 | } else { |
| 38 | printf("GUI: Warning: Could not load FileView icons!"); |
| 39 | FileView::diskIcon.buffer = nullptr; |
| 40 | FileView::diskIcon.width = 0; |
| 41 | } |
| 42 | |
| 43 | if(FILE* f = fopen("/initrd/folder.png", "rb")){ |
| 44 | Graphics::LoadImage(f, &FileView::folderIcon); |
| 45 | fclose(f); |
| 46 | } else { |
| 47 | printf("GUI: Warning: Could not load FileView icons!"); |
| 48 | FileView::folderIcon.buffer = nullptr; |
| 49 | FileView::folderIcon.width = 0; |
| 50 | } |
| 51 | |
| 52 | if(FILE* f = fopen("/initrd/file.png", "rb")){ |
| 53 | Graphics::LoadImage(f, &FileView::fileIcon); |
| 54 | fclose(f); |
| 55 | } else { |
| 56 | printf("GUI: Warning: Could not load FileView icons!"); |
| 57 | FileView::fileIcon.buffer = nullptr; |
| 58 | FileView::fileIcon.width = 0; |
| 59 | } |
| 60 | |
| 61 | if(FILE* f = fopen("/initrd/textfile.png", "rb")){ |
| 62 | Graphics::LoadImage(f, &FileView::textFileIcon); |
| 63 | fclose(f); |
| 64 | } else { |
| 65 | printf("GUI: Warning: Could not load FileView icons!"); |
| 66 | FileView::textFileIcon.buffer = nullptr; |
| 67 | FileView::textFileIcon.width = 0; |
| 68 | } |
| 69 | |
| 70 | if(FILE* f = fopen("/initrd/jsonfile.png", "rb")){ |
| 71 | Graphics::LoadImage(f, &FileView::jsonFileIcon); |
| 72 | fclose(f); |
| 73 | } else { |
| 74 | printf("GUI: Warning: Could not load FileView icons!"); |
| 75 | FileView::jsonFileIcon.buffer = nullptr; |
| 76 | FileView::jsonFileIcon.width = 0; |
| 77 | } |
| 78 | |
| 79 | if(FILE* f = fopen("/initrd/disksml.png", "rb")){ |
| 80 | Graphics::LoadImage(f, &FileView::diskIconSml); |
| 81 | fclose(f); |
| 82 | } else { |
| 83 | printf("GUI: Warning: Could not load FileView icons!"); |
| 84 | FileView::diskIconSml.buffer = nullptr; |
| 85 | FileView::diskIconSml.width = 0; |
| 86 | } |
| 87 | |
| 88 | if(FILE* f = fopen("/initrd/foldersml.png", "rb")){ |
| 89 | Graphics::LoadImage(f, &FileView::folderIconSml); |
nothing calls this directly
no test coverage detected