From 252f4767828ef4564f9fcedca981234e26e7bd32 Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Wed, 13 Dec 2006 00:15:56 +0000 Subject: [PATCH] Added some needed stdio.h includes. I don't know what magic was used to compile these for other people, but they wouldn't compile for me when building the app_server test environment. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19479 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/tracker/Jamfile | 1 + .../icon-o-matic/import_export/Exporter.cpp | 1 + src/apps/showimage/ShowImageView.cpp | 7 ++++ src/apps/showimage/ShowImageWindow.cpp | 2 +- src/kits/app/Handler.cpp | 1 + src/kits/interface/PictureDataWriter.cpp | 2 + .../layouter/ConstraintSolverLayouter.cpp | 2 + src/kits/mail/Jamfile | 2 +- src/kits/translation/TranslatorRoster.cpp | 1 + src/servers/app/WorkspacesLayer.cpp | 10 ++--- src/servers/input/InputServer.cpp | 24 ++++++++--- src/servers/mail/deskbarview.cpp | 3 ++ src/servers/registrar/ShutdownProcess.cpp | 8 ++-- src/servers/registrar/ShutdownProcess.h | 2 +- src/servers/registrar/TRoster.cpp | 41 +++++++++++-------- src/servers/registrar/TRoster.h | 3 +- 16 files changed, 73 insertions(+), 37 deletions(-) diff --git a/src/add-ons/tracker/Jamfile b/src/add-ons/tracker/Jamfile index dddbcdee38..b798bc2301 100644 --- a/src/add-ons/tracker/Jamfile +++ b/src/add-ons/tracker/Jamfile @@ -2,4 +2,5 @@ SubDir HAIKU_TOP src add-ons tracker ; SubInclude HAIKU_TOP src add-ons tracker zipomatic ; SubInclude HAIKU_TOP src add-ons tracker filetype ; +SubInclude HAIKU_TOP src add-ons tracker mark_as ; diff --git a/src/apps/icon-o-matic/import_export/Exporter.cpp b/src/apps/icon-o-matic/import_export/Exporter.cpp index 8793580917..1f43768b01 100644 --- a/src/apps/icon-o-matic/import_export/Exporter.cpp +++ b/src/apps/icon-o-matic/import_export/Exporter.cpp @@ -9,6 +9,7 @@ #include "Exporter.h" #include +#include #include #include diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index 75658a887d..0d996e4656 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -1595,6 +1595,13 @@ ShowImageView::KeyDown(const char* bytes, int32 numBytes) case B_DELETE: // TODO: move image to Trash (script Tracker) break; + case '+': + case '=': + ZoomIn(); + break; + case '-': + ZoomOut(); + break; } } diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index 0887c7329a..f013157a8f 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -229,7 +229,7 @@ ShowImageWindow::BuildViewMenu(BMenu *menu) menu->AddSeparatorItem(); AddItemMenu(menu, "Original Size", MSG_ORIGINAL_SIZE, 0, 0, 'W', true); - AddItemMenu(menu, "Zoom In", MSG_ZOOM_IN, '=', 0, 'W', true); + AddItemMenu(menu, "Zoom In", MSG_ZOOM_IN, '+', 0, 'W', true); AddItemMenu(menu, "Zoom Out", MSG_ZOOM_OUT, '-', 0, 'W', true); menu->AddSeparatorItem(); diff --git a/src/kits/app/Handler.cpp b/src/kits/app/Handler.cpp index 73e048738f..135cc2da79 100644 --- a/src/kits/app/Handler.cpp +++ b/src/kits/app/Handler.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/src/kits/interface/PictureDataWriter.cpp b/src/kits/interface/PictureDataWriter.cpp index efe4900646..85d67d9161 100644 --- a/src/kits/interface/PictureDataWriter.cpp +++ b/src/kits/interface/PictureDataWriter.cpp @@ -13,6 +13,8 @@ #include #include +#include + PictureDataWriter::PictureDataWriter(BPositionIO *data) : fData(data) diff --git a/src/kits/interface/layouter/ConstraintSolverLayouter.cpp b/src/kits/interface/layouter/ConstraintSolverLayouter.cpp index 99380c02dd..2360cc4ff8 100644 --- a/src/kits/interface/layouter/ConstraintSolverLayouter.cpp +++ b/src/kits/interface/layouter/ConstraintSolverLayouter.cpp @@ -12,6 +12,8 @@ #include #include +#include + #include "SimpleLayouter.h" // Since the qoca headers are DEBUG and NDEBUG conditional, we get diff --git a/src/kits/mail/Jamfile b/src/kits/mail/Jamfile index 44e0b22dfd..050fb93aad 100644 --- a/src/kits/mail/Jamfile +++ b/src/kits/mail/Jamfile @@ -48,7 +48,7 @@ SharedLibrary libmail.so : tracker $(TARGET_LIBSTDC++) $(NETWORK_LIBS) - $(SELECT_UNAME_ETC_LIB) +# $(SELECT_UNAME_ETC_LIB) ; Package haiku-maildaemon-cvs : diff --git a/src/kits/translation/TranslatorRoster.cpp b/src/kits/translation/TranslatorRoster.cpp index a38a806a5b..567a38adc7 100644 --- a/src/kits/translation/TranslatorRoster.cpp +++ b/src/kits/translation/TranslatorRoster.cpp @@ -30,6 +30,7 @@ #include #include +#include #ifdef HAIKU_TARGET_PLATFORM_HAIKU extern "C" status_t _kern_get_safemode_option(const char *parameter, diff --git a/src/servers/app/WorkspacesLayer.cpp b/src/servers/app/WorkspacesLayer.cpp index b04a1733a8..b6f7cd1b3d 100644 --- a/src/servers/app/WorkspacesLayer.cpp +++ b/src/servers/app/WorkspacesLayer.cpp @@ -216,20 +216,20 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac // so that it has only to be recalculated on demand. With double buffered // windows, this would also open up the door to have a more detailed // preview. -#if 0 - BString title = window->Name(); +#if 1 + BString title(window->Title()); ServerFont font = fDrawState->Font(); font.SetSize(7); fDrawState->SetFont(font); fDrawState->Font().TruncateString(&title, B_TRUNCATE_END, frame.Width() - 4); - float width = GetDrawingEngine()->StringWidth(title.String(), title.Length(), + float width = drawingEngine->StringWidth(title.String(), title.Length(), fDrawState, NULL); - float height = GetDrawingEngine()->StringHeight(title.String(), title.Length(), + float height = drawingEngine->StringHeight(title.String(), title.Length(), fDrawState); - GetDrawingEngine()->DrawString(title.String(), title.Length(), + drawingEngine->DrawString(title.String(), title.Length(), BPoint(frame.left + (frame.Width() - width) / 2, frame.top + (frame.Height() + height) / 2), fDrawState, NULL); diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index bf66cc399c..e27405934b 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -365,14 +365,26 @@ InputServer::QuitRequested() CALLED(); if (!BApplication::QuitRequested()) return false; + + PostMessage(SYSTEM_SHUTTING_DOWN); - fAddOnManager->SaveState(); - gDeviceManager.SaveState(); + bool shutdown = false; + CurrentMessage()->FindBool("_shutdown_", &shutdown); - delete_port(fEventLooperPort); - // the event looper thread will exit after this - fEventLooperPort = -1; - return true; + // Don't actually quit when the system is being shutdown + if (shutdown) { + PRINT(("****RJL: The system is shutting down, so NOT QUITTING!\n")); + return false; + } else { + PRINT(("****RJL: The system is NOT shutting down, so I AM QUITTING!\n")); + fAddOnManager->SaveState(); + gDeviceManager.SaveState(); + + delete_port(fEventLooperPort); + // the event looper thread will exit after this + fEventLooperPort = -1; + return true; + } } diff --git a/src/servers/mail/deskbarview.cpp b/src/servers/mail/deskbarview.cpp index 5920459040..6e0ab0494d 100644 --- a/src/servers/mail/deskbarview.cpp +++ b/src/servers/mail/deskbarview.cpp @@ -68,6 +68,7 @@ status_t our_image(image_info* image) BView* instantiate_deskbar_item(void) { + printf("Ryan was here!\n"); return new DeskbarView(BRect(0, 0, 15, 15)); } @@ -227,9 +228,11 @@ DeskbarView::MessageReceived(BMessage *message) switch (what) { case B_ENTRY_CREATED: fNewMessages++; + printf("B_QUERY_UPDATE::B_ENTRY_CREATED, fNewMessages = %d\n", fNewMessages); break; case B_ENTRY_REMOVED: fNewMessages--; + printf("B_QUERY_UPDATE::B_ENTRY_REMOVED, fNewMessages = %d\n", fNewMessages); break; } ChangeIcon((fNewMessages > 0) ? NEW_MAIL : NO_MAIL); diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 3f01b5fbf6..05667514f1 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -709,7 +709,7 @@ ShutdownProcess::Init(BMessage *request) // get a list of all applications to shut down and sort them error = fRoster->GetShutdownApps(fUserApps, fSystemApps, fBackgroundApps, - fVitalSystemApps, fInputServer); + fVitalSystemApps);//, fInputServer); if (error != B_OK) { fRoster->RemoveWatcher(this); fRoster->SetShuttingDown(false); @@ -1275,12 +1275,12 @@ ShutdownProcess::_WorkerDoShutdown() sync(); // notify the input server we are shutting down - if (fInputServer.registration_time != 0) { + /*if (fInputServer.registration_time != 0) { // The SYSTEM_SHUTTING_DOWN message is defined in InputServerTypes.h BMessage message(SYSTEM_SHUTTING_DOWN); SingleMessagingTargetSet target(fInputServer.port, B_PREFERRED_TOKEN); MessageDeliverer::Default()->DeliverMessage(&message, target); - } + }*/ // phase 1: terminate the user apps _SetPhase(USER_APP_TERMINATION_PHASE); @@ -1413,6 +1413,8 @@ ShutdownProcess::_QuitApps(AppInfoList &list, bool disableCancel) return; } + PRINT(("****RJL: Asking %s to quit\n", appName)); + // set window text char buffer[1024]; snprintf(buffer, sizeof(buffer), "Asking \"%s\" to quit.", appName); diff --git a/src/servers/registrar/ShutdownProcess.h b/src/servers/registrar/ShutdownProcess.h index df0bdf129f..314886ee9f 100644 --- a/src/servers/registrar/ShutdownProcess.h +++ b/src/servers/registrar/ShutdownProcess.h @@ -97,7 +97,7 @@ private: AppInfoList fSystemApps; AppInfoList fUserApps; AppInfoList fBackgroundApps; - RosterAppInfo fInputServer; + //RosterAppInfo fInputServer; TimeoutEvent *fTimeoutEvent; InternalEventList *fInternalEvents; sem_id fInternalEventSemaphore; diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index 8d4f462d4d..1a5476bde7 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -177,6 +177,7 @@ PRINT(("full registration: %d\n", fullReg)); // check the parameters team_id otherTeam = -1; uint32 token = 0; + RosterAppInfo *otherInfo = NULL; uint32 launchFlags = flags & B_LAUNCH_MASK; @@ -187,13 +188,12 @@ PRINT(("full registration: %d\n", fullReg)); PRINT(("flags: %lx\n", flags)); PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name)); // check single/exclusive launchers - RosterAppInfo *info = NULL; if ((launchFlags == B_SINGLE_LAUNCH || launchFlags == B_EXCLUSIVE_LAUNCH) - && (((info = fRegisteredApps.InfoFor(&ref))) - || ((info = fEarlyPreRegisteredApps.InfoFor(&ref))))) { + && (((otherInfo = fRegisteredApps.InfoFor(&ref))) + || ((otherInfo = fEarlyPreRegisteredApps.InfoFor(&ref))))) { SET_ERROR(error, B_ALREADY_RUNNING); - otherTeam = info->team; + otherTeam = otherInfo->team; } } else SET_ERROR(error, B_ENTRY_NOT_FOUND); @@ -202,13 +202,12 @@ PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name)); // signature if (error == B_OK && signature) { // check exclusive launchers - RosterAppInfo *info = NULL; if (launchFlags == B_EXCLUSIVE_LAUNCH - && (((info = fRegisteredApps.InfoFor(signature))) - || ((info = fEarlyPreRegisteredApps.InfoFor(signature))))) { + && (((otherInfo = fRegisteredApps.InfoFor(signature))) + || ((otherInfo = fEarlyPreRegisteredApps.InfoFor(signature))))) { SET_ERROR(error, B_ALREADY_RUNNING); - otherTeam = info->team; - token = info->token; + otherTeam = otherInfo->team; + token = otherInfo->token; } } @@ -277,6 +276,12 @@ PRINT(("added to early pre-regs, token: %lu\n", token)); request->SendReply(&reply); } + if (otherInfo) { + // Activate the other app + printf("Trying to activate other app with team id: %d\n", otherInfo->team); + ActivateApp(otherInfo); + } + FUNCTION_END(); } @@ -1245,7 +1250,7 @@ TRoster::ActivateApp(RosterAppInfo *info) _AppDeactivated(oldActiveApp); // activate the new app if (info) { - info = fActiveApp; + fActiveApp = info; _AppActivated(info); } } @@ -1321,7 +1326,7 @@ TRoster::SetShuttingDown(bool shuttingDown) */ status_t TRoster::GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps, - AppInfoList &backgroundApps, hash_set &vitalSystemApps, RosterAppInfo &inputServer) + AppInfoList &backgroundApps, hash_set &vitalSystemApps) { BAutolock _(fLock); @@ -1351,12 +1356,12 @@ TRoster::GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps, } // input server - RosterAppInfo *info - = fRegisteredApps.InfoFor("application/x-vnd.Be-input_server"); + RosterAppInfo *info; +/* = fRegisteredApps.InfoFor("application/x-vnd.Be-input_server"); if (info) { inputServer = *info; vitalSystemApps.insert(info->team); - } + }*/ // debug server info = fRegisteredApps.InfoFor("application/x-vnd.haiku-debug-server"); @@ -1370,12 +1375,12 @@ TRoster::GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps, if (vitalSystemApps.find(info->team) == vitalSystemApps.end()) { RosterAppInfo *clonedInfo = info->Clone(); if (clonedInfo) { - if (info->flags & B_BACKGROUND_APP) { - if (!backgroundApps.AddInfo(clonedInfo)) - error = B_NO_MEMORY; - } else if (_IsSystemApp(info)) { + if (_IsSystemApp(info)) { if (!systemApps.AddInfo(clonedInfo)) error = B_NO_MEMORY; + } else if (info->flags & B_BACKGROUND_APP) { + if (!backgroundApps.AddInfo(clonedInfo)) + error = B_NO_MEMORY; } else { if (!userApps.AddInfo(clonedInfo)) error = B_NO_MEMORY; diff --git a/src/servers/registrar/TRoster.h b/src/servers/registrar/TRoster.h index 2256f69424..13a683afd2 100644 --- a/src/servers/registrar/TRoster.h +++ b/src/servers/registrar/TRoster.h @@ -92,8 +92,7 @@ public: void SetShuttingDown(bool shuttingDown); status_t GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps, - AppInfoList &backgroundApps, hash_set &vitalSystemApps, - RosterAppInfo &inputServer); + AppInfoList &backgroundApps, hash_set &vitalSystemApps); status_t AddWatcher(Watcher *watcher); void RemoveWatcher(Watcher *watcher);