Fix Haiku backend build
Some checks failed
Build / build-appimage (push) Successful in 3m21s
Build / build-android (push) Failing after 2m52s
Build / build-gentoo (push) Failing after 1m14s
Build / download-system-deps (push) Successful in 3m29s
Build / get-source-code (push) Successful in 7m1s
Build / build-windows (push) Failing after 6m40s

This commit is contained in:
Zachary Hall 2024-11-21 10:43:50 -08:00
parent 65824f39ae
commit 1756fb40a1
4 changed files with 9 additions and 9 deletions

View file

@ -42,7 +42,7 @@ HaikuAboutWindow::HaikuAboutWindow() : BWindow(BRect(100, 100, 600, 400), "About
license_list = new BListView(); license_list = new BListView();
license_list->SetTarget(this); license_list->SetTarget(this);
for (auto &license : get_license_data()) { for (auto &license : get_license_data()) {
license_list->AddItem(new LicenseItem(license)); license_list->AddItem(new HaikuLicenseItem(license));
} }
license_list->SetSelectionMessage(new BMessage(CMD_LOAD_LICENSE)); license_list->SetSelectionMessage(new BMessage(CMD_LOAD_LICENSE));
BScrollView *license_list_scroller = new BScrollView("about:license-list-scroller", license_list, B_FOLLOW_ALL_SIDES, B_SUPPORTS_LAYOUT|B_FRAME_EVENTS, false, true); BScrollView *license_list_scroller = new BScrollView("about:license-list-scroller", license_list, B_FOLLOW_ALL_SIDES, B_SUPPORTS_LAYOUT|B_FRAME_EVENTS, false, true);
@ -66,7 +66,7 @@ void HaikuAboutWindow::MessageReceived(BMessage *msg) {
if (msg->IsSystem()) return; if (msg->IsSystem()) return;
if (msg->what == CMD_LOAD_LICENSE) { if (msg->what == CMD_LOAD_LICENSE) {
auto selection = license_list->ItemAt(msg->GetInt32("index", 0)); auto selection = license_list->ItemAt(msg->GetInt32("index", 0));
std::string str = ((LicenseItem*)selection)->license_text; std::string str = ((HaikuLicenseItem*)selection)->license_text;
license_text->SetText(str.c_str()); license_text->SetText(str.c_str());

View file

@ -10,7 +10,7 @@ std::string HaikuUIBackend::get_name() {
return "Haiku Native"; return "Haiku Native";
} }
void HaikuUIBackend::QuitHandler() { void HaikuUIBackend::QuitHandler() {
LooperWindow *app = (LooperWindow*)main_loop; HaikuLooperWindow *app = (HaikuLooperWindow*)main_loop;
app->Hide(); app->Hide();
} }
static bool about_window_shown = false; static bool about_window_shown = false;
@ -18,7 +18,7 @@ static bool prefs_window_shown = false;
int HaikuUIBackend::run(std::vector<std::string> realArgs, int argc, char **argv) { int HaikuUIBackend::run(std::vector<std::string> realArgs, int argc, char **argv) {
int ret = UIBackend::run(realArgs, argc, argv); int ret = UIBackend::run(realArgs, argc, argv);
if (ret != 0) return ret; if (ret != 0) return ret;
LooperWindow *app = new LooperWindow(playback); HaikuLooperWindow *app = new HaikuLooperWindow(playback);
main_loop = (void*)app; main_loop = (void*)app;
app->Show(); app->Show();
while (!app->IsHidden()) { while (!app->IsHidden()) {

View file

@ -74,7 +74,7 @@ HaikuLooperWindow::HaikuLooperWindow(Playback *playback) : BWindow(BRect(100, 10
SetSizeLimits(minW, maxW, minH, maxH); SetSizeLimits(minW, maxW, minH, maxH);
ResizeTo(minW, minH); ResizeTo(minW, minH);
DisableUpdates(); DisableUpdates();
auto about_window = new AboutWindow(); auto about_window = new HaikuAboutWindow();
layout = new BGroupLayout(B_VERTICAL); layout = new BGroupLayout(B_VERTICAL);
SetLayout(layout); SetLayout(layout);
layout->SetSpacing(0.0); layout->SetSpacing(0.0);
@ -140,7 +140,7 @@ HaikuLooperWindow::HaikuLooperWindow(Playback *playback) : BWindow(BRect(100, 10
BRect bottom_rect = bottom_item->Frame(); BRect bottom_rect = bottom_item->Frame();
bottom_item->SetExplicitMinSize(bottom_rect.Size()); bottom_item->SetExplicitMinSize(bottom_rect.Size());
Pulse(); Pulse();
this->update_thread = new std::thread(std::mem_fn(&LooperWindow::ThreadFunc), this); this->update_thread = new std::thread(std::mem_fn(&HaikuLooperWindow::ThreadFunc), this);
UpdateIfNeeded(); UpdateIfNeeded();
StartWatching(prefs_window, CMD_UPDATE_LABEL_SETTING); StartWatching(prefs_window, CMD_UPDATE_LABEL_SETTING);
auto *msg = new BMessage(CMD_UPDATE_LABEL_SETTING); auto *msg = new BMessage(CMD_UPDATE_LABEL_SETTING);
@ -349,7 +349,7 @@ void HaikuLooperWindow::ThreadFunc() {
std::this_thread::sleep_for(1s / 60.0); std::this_thread::sleep_for(1s / 60.0);
} }
} }
HaikuLooperRefHandler::HaikuLooperRefHandler(LooperWindow *win) { HaikuLooperRefHandler::HaikuLooperRefHandler(HaikuLooperWindow *win) {
this->win = win; this->win = win;
be_app->Lock(); be_app->Lock();
this->next_handler = be_app->PreferredHandler(); this->next_handler = be_app->PreferredHandler();

View file

@ -85,7 +85,7 @@ void HaikuLooperSlider::SetLimitLabels(const char *min, const char *max) {
SetMinLabel(min); SetMinLabel(min);
SetMaxLabel(max); SetMaxLabel(max);
} }
HaikuLooperSlider::~LooperSlider() { HaikuLooperSlider::~HaikuLooperSlider() {
if (min_label != NULL) free((void*)min_label); if (min_label != NULL) free((void*)min_label);
if (max_label != NULL) free((void*)max_label); if (max_label != NULL) free((void*)max_label);
delete slider; delete slider;
@ -178,7 +178,7 @@ void HaikuLooperSlider::MessageReceived(BMessage *msg) {
} break; } break;
case CMD_UPDATE_LABEL_SETTING: { case CMD_UPDATE_LABEL_SETTING: {
const char *precision_text[2] = {"Imprecise", "Precise"}; const char *precision_text[2] = {"Imprecise", "Precise"};
BBitmap *precision_bitmap[2] = {LooperSlider::slider_mode_bitmap, LooperSlider::text_mode_bitmap}; BBitmap *precision_bitmap[2] = {HaikuLooperSlider::slider_mode_bitmap, HaikuLooperSlider::text_mode_bitmap};
BBitmap *bitmap = precision_bitmap[text_edit_mode ? 0 : 1]; BBitmap *bitmap = precision_bitmap[text_edit_mode ? 0 : 1];
if (show_labels || bitmap == NULL) { if (show_labels || bitmap == NULL) {
btn->SetLabel(precision_text[text_edit_mode ? 0 : 1]); btn->SetLabel(precision_text[text_edit_mode ? 0 : 1]);