| 122 | } |
| 123 | |
| 124 | const Result CtrlrLinux::getDefaultPanel(MemoryBlock& dataToWrite) |
| 125 | { |
| 126 | #ifdef DEBUG_INSTANCE |
| 127 | File temp("/home/r.kubiak/devel/debug.bpanelz"); |
| 128 | temp.loadFileAsData (dataToWrite); |
| 129 | return (Result::ok()); |
| 130 | #endif |
| 131 | libr_file *handle = libr_open (nullptr, LIBR_READ); |
| 132 | |
| 133 | if (handle == nullptr) |
| 134 | { |
| 135 | return (Result::fail ("Linux native, libr_open failed to open binary [self]")); |
| 136 | } |
| 137 | else |
| 138 | { |
| 139 | _DBG("CtrlrLinux::getDefaultPanel, libr_open succeeded for binary [self]"); |
| 140 | } |
| 141 | |
| 142 | size_t panelDataSize; |
| 143 | char *panelData = (char *)libr_malloc (handle, (char *)CTRLR_INTERNAL_PANEL_SECTION, &panelDataSize); |
| 144 | |
| 145 | if (panelData == nullptr) |
| 146 | { |
| 147 | libr_close (handle); |
| 148 | return (Result::fail ("Linux native, libr_malloc didn't fint embedded panel in binary")); |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | _DBG("CtrlrLinux::getDefaultPanel, libr_malloc returned data for panel size ["+STR((int32)panelDataSize)+"]"); |
| 153 | } |
| 154 | |
| 155 | dataToWrite.append (panelData, panelDataSize); |
| 156 | |
| 157 | libr_close (handle); |
| 158 | |
| 159 | return (Result::ok()); |
| 160 | } |
| 161 | |
| 162 | const Result CtrlrLinux::getDefaultResources(MemoryBlock& dataToWrite) |
| 163 | { |
nothing calls this directly
no test coverage detected