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
This commit is contained in:
Ryan Leavengood 2006-12-13 00:15:56 +00:00
parent 6cc7630f36
commit 252f476782
16 changed files with 73 additions and 37 deletions

View File

@ -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 zipomatic ;
SubInclude HAIKU_TOP src add-ons tracker filetype ; SubInclude HAIKU_TOP src add-ons tracker filetype ;
SubInclude HAIKU_TOP src add-ons tracker mark_as ;

View File

@ -9,6 +9,7 @@
#include "Exporter.h" #include "Exporter.h"
#include <fs_attr.h> #include <fs_attr.h>
#include <stdio.h>
#include <Alert.h> #include <Alert.h>
#include <File.h> #include <File.h>

View File

@ -1595,6 +1595,13 @@ ShowImageView::KeyDown(const char* bytes, int32 numBytes)
case B_DELETE: case B_DELETE:
// TODO: move image to Trash (script Tracker) // TODO: move image to Trash (script Tracker)
break; break;
case '+':
case '=':
ZoomIn();
break;
case '-':
ZoomOut();
break;
} }
} }

View File

@ -229,7 +229,7 @@ ShowImageWindow::BuildViewMenu(BMenu *menu)
menu->AddSeparatorItem(); menu->AddSeparatorItem();
AddItemMenu(menu, "Original Size", MSG_ORIGINAL_SIZE, 0, 0, 'W', true); 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); AddItemMenu(menu, "Zoom Out", MSG_ZOOM_OUT, '-', 0, 'W', true);
menu->AddSeparatorItem(); menu->AddSeparatorItem();

View File

@ -20,6 +20,7 @@
#include <algorithm> #include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <vector> #include <vector>

View File

@ -13,6 +13,8 @@
#include <PictureDataWriter.h> #include <PictureDataWriter.h>
#include <PictureProtocol.h> #include <PictureProtocol.h>
#include <stdio.h>
PictureDataWriter::PictureDataWriter(BPositionIO *data) PictureDataWriter::PictureDataWriter(BPositionIO *data)
: :
fData(data) fData(data)

View File

@ -12,6 +12,8 @@
#include <Size.h> #include <Size.h>
#include <String.h> #include <String.h>
#include <stdio.h>
#include "SimpleLayouter.h" #include "SimpleLayouter.h"
// Since the qoca headers are DEBUG and NDEBUG conditional, we get // Since the qoca headers are DEBUG and NDEBUG conditional, we get

View File

@ -48,7 +48,7 @@ SharedLibrary libmail.so :
tracker tracker
$(TARGET_LIBSTDC++) $(TARGET_LIBSTDC++)
$(NETWORK_LIBS) $(NETWORK_LIBS)
$(SELECT_UNAME_ETC_LIB) # $(SELECT_UNAME_ETC_LIB)
; ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :

View File

@ -30,6 +30,7 @@
#include <new> #include <new>
#include <string.h> #include <string.h>
#include <stdio.h>
#ifdef HAIKU_TARGET_PLATFORM_HAIKU #ifdef HAIKU_TARGET_PLATFORM_HAIKU
extern "C" status_t _kern_get_safemode_option(const char *parameter, extern "C" status_t _kern_get_safemode_option(const char *parameter,

View File

@ -216,20 +216,20 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac
// so that it has only to be recalculated on demand. With double buffered // 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 // windows, this would also open up the door to have a more detailed
// preview. // preview.
#if 0 #if 1
BString title = window->Name(); BString title(window->Title());
ServerFont font = fDrawState->Font(); ServerFont font = fDrawState->Font();
font.SetSize(7); font.SetSize(7);
fDrawState->SetFont(font); fDrawState->SetFont(font);
fDrawState->Font().TruncateString(&title, B_TRUNCATE_END, frame.Width() - 4); 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); fDrawState, NULL);
float height = GetDrawingEngine()->StringHeight(title.String(), title.Length(), float height = drawingEngine->StringHeight(title.String(), title.Length(),
fDrawState); fDrawState);
GetDrawingEngine()->DrawString(title.String(), title.Length(), drawingEngine->DrawString(title.String(), title.Length(),
BPoint(frame.left + (frame.Width() - width) / 2, BPoint(frame.left + (frame.Width() - width) / 2,
frame.top + (frame.Height() + height) / 2), frame.top + (frame.Height() + height) / 2),
fDrawState, NULL); fDrawState, NULL);

View File

@ -365,14 +365,26 @@ InputServer::QuitRequested()
CALLED(); CALLED();
if (!BApplication::QuitRequested()) if (!BApplication::QuitRequested())
return false; return false;
PostMessage(SYSTEM_SHUTTING_DOWN);
fAddOnManager->SaveState(); bool shutdown = false;
gDeviceManager.SaveState(); CurrentMessage()->FindBool("_shutdown_", &shutdown);
delete_port(fEventLooperPort); // Don't actually quit when the system is being shutdown
// the event looper thread will exit after this if (shutdown) {
fEventLooperPort = -1; PRINT(("****RJL: The system is shutting down, so NOT QUITTING!\n"));
return true; 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;
}
} }

View File

@ -68,6 +68,7 @@ status_t our_image(image_info* image)
BView* instantiate_deskbar_item(void) BView* instantiate_deskbar_item(void)
{ {
printf("Ryan was here!\n");
return new DeskbarView(BRect(0, 0, 15, 15)); return new DeskbarView(BRect(0, 0, 15, 15));
} }
@ -227,9 +228,11 @@ DeskbarView::MessageReceived(BMessage *message)
switch (what) { switch (what) {
case B_ENTRY_CREATED: case B_ENTRY_CREATED:
fNewMessages++; fNewMessages++;
printf("B_QUERY_UPDATE::B_ENTRY_CREATED, fNewMessages = %d\n", fNewMessages);
break; break;
case B_ENTRY_REMOVED: case B_ENTRY_REMOVED:
fNewMessages--; fNewMessages--;
printf("B_QUERY_UPDATE::B_ENTRY_REMOVED, fNewMessages = %d\n", fNewMessages);
break; break;
} }
ChangeIcon((fNewMessages > 0) ? NEW_MAIL : NO_MAIL); ChangeIcon((fNewMessages > 0) ? NEW_MAIL : NO_MAIL);

View File

@ -709,7 +709,7 @@ ShutdownProcess::Init(BMessage *request)
// get a list of all applications to shut down and sort them // get a list of all applications to shut down and sort them
error = fRoster->GetShutdownApps(fUserApps, fSystemApps, fBackgroundApps, error = fRoster->GetShutdownApps(fUserApps, fSystemApps, fBackgroundApps,
fVitalSystemApps, fInputServer); fVitalSystemApps);//, fInputServer);
if (error != B_OK) { if (error != B_OK) {
fRoster->RemoveWatcher(this); fRoster->RemoveWatcher(this);
fRoster->SetShuttingDown(false); fRoster->SetShuttingDown(false);
@ -1275,12 +1275,12 @@ ShutdownProcess::_WorkerDoShutdown()
sync(); sync();
// notify the input server we are shutting down // 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 // The SYSTEM_SHUTTING_DOWN message is defined in InputServerTypes.h
BMessage message(SYSTEM_SHUTTING_DOWN); BMessage message(SYSTEM_SHUTTING_DOWN);
SingleMessagingTargetSet target(fInputServer.port, B_PREFERRED_TOKEN); SingleMessagingTargetSet target(fInputServer.port, B_PREFERRED_TOKEN);
MessageDeliverer::Default()->DeliverMessage(&message, target); MessageDeliverer::Default()->DeliverMessage(&message, target);
} }*/
// phase 1: terminate the user apps // phase 1: terminate the user apps
_SetPhase(USER_APP_TERMINATION_PHASE); _SetPhase(USER_APP_TERMINATION_PHASE);
@ -1413,6 +1413,8 @@ ShutdownProcess::_QuitApps(AppInfoList &list, bool disableCancel)
return; return;
} }
PRINT(("****RJL: Asking %s to quit\n", appName));
// set window text // set window text
char buffer[1024]; char buffer[1024];
snprintf(buffer, sizeof(buffer), "Asking \"%s\" to quit.", appName); snprintf(buffer, sizeof(buffer), "Asking \"%s\" to quit.", appName);

View File

@ -97,7 +97,7 @@ private:
AppInfoList fSystemApps; AppInfoList fSystemApps;
AppInfoList fUserApps; AppInfoList fUserApps;
AppInfoList fBackgroundApps; AppInfoList fBackgroundApps;
RosterAppInfo fInputServer; //RosterAppInfo fInputServer;
TimeoutEvent *fTimeoutEvent; TimeoutEvent *fTimeoutEvent;
InternalEventList *fInternalEvents; InternalEventList *fInternalEvents;
sem_id fInternalEventSemaphore; sem_id fInternalEventSemaphore;

View File

@ -177,6 +177,7 @@ PRINT(("full registration: %d\n", fullReg));
// check the parameters // check the parameters
team_id otherTeam = -1; team_id otherTeam = -1;
uint32 token = 0; uint32 token = 0;
RosterAppInfo *otherInfo = NULL;
uint32 launchFlags = flags & B_LAUNCH_MASK; uint32 launchFlags = flags & B_LAUNCH_MASK;
@ -187,13 +188,12 @@ PRINT(("full registration: %d\n", fullReg));
PRINT(("flags: %lx\n", flags)); PRINT(("flags: %lx\n", flags));
PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name)); PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name));
// check single/exclusive launchers // check single/exclusive launchers
RosterAppInfo *info = NULL;
if ((launchFlags == B_SINGLE_LAUNCH if ((launchFlags == B_SINGLE_LAUNCH
|| launchFlags == B_EXCLUSIVE_LAUNCH) || launchFlags == B_EXCLUSIVE_LAUNCH)
&& (((info = fRegisteredApps.InfoFor(&ref))) && (((otherInfo = fRegisteredApps.InfoFor(&ref)))
|| ((info = fEarlyPreRegisteredApps.InfoFor(&ref))))) { || ((otherInfo = fEarlyPreRegisteredApps.InfoFor(&ref))))) {
SET_ERROR(error, B_ALREADY_RUNNING); SET_ERROR(error, B_ALREADY_RUNNING);
otherTeam = info->team; otherTeam = otherInfo->team;
} }
} else } else
SET_ERROR(error, B_ENTRY_NOT_FOUND); SET_ERROR(error, B_ENTRY_NOT_FOUND);
@ -202,13 +202,12 @@ PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name));
// signature // signature
if (error == B_OK && signature) { if (error == B_OK && signature) {
// check exclusive launchers // check exclusive launchers
RosterAppInfo *info = NULL;
if (launchFlags == B_EXCLUSIVE_LAUNCH if (launchFlags == B_EXCLUSIVE_LAUNCH
&& (((info = fRegisteredApps.InfoFor(signature))) && (((otherInfo = fRegisteredApps.InfoFor(signature)))
|| ((info = fEarlyPreRegisteredApps.InfoFor(signature))))) { || ((otherInfo = fEarlyPreRegisteredApps.InfoFor(signature))))) {
SET_ERROR(error, B_ALREADY_RUNNING); SET_ERROR(error, B_ALREADY_RUNNING);
otherTeam = info->team; otherTeam = otherInfo->team;
token = info->token; token = otherInfo->token;
} }
} }
@ -277,6 +276,12 @@ PRINT(("added to early pre-regs, token: %lu\n", token));
request->SendReply(&reply); 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(); FUNCTION_END();
} }
@ -1245,7 +1250,7 @@ TRoster::ActivateApp(RosterAppInfo *info)
_AppDeactivated(oldActiveApp); _AppDeactivated(oldActiveApp);
// activate the new app // activate the new app
if (info) { if (info) {
info = fActiveApp; fActiveApp = info;
_AppActivated(info); _AppActivated(info);
} }
} }
@ -1321,7 +1326,7 @@ TRoster::SetShuttingDown(bool shuttingDown)
*/ */
status_t status_t
TRoster::GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps, TRoster::GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps,
AppInfoList &backgroundApps, hash_set<team_id> &vitalSystemApps, RosterAppInfo &inputServer) AppInfoList &backgroundApps, hash_set<team_id> &vitalSystemApps)
{ {
BAutolock _(fLock); BAutolock _(fLock);
@ -1351,12 +1356,12 @@ TRoster::GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps,
} }
// input server // input server
RosterAppInfo *info RosterAppInfo *info;
= fRegisteredApps.InfoFor("application/x-vnd.Be-input_server"); /* = fRegisteredApps.InfoFor("application/x-vnd.Be-input_server");
if (info) { if (info) {
inputServer = *info; inputServer = *info;
vitalSystemApps.insert(info->team); vitalSystemApps.insert(info->team);
} }*/
// debug server // debug server
info = fRegisteredApps.InfoFor("application/x-vnd.haiku-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()) { if (vitalSystemApps.find(info->team) == vitalSystemApps.end()) {
RosterAppInfo *clonedInfo = info->Clone(); RosterAppInfo *clonedInfo = info->Clone();
if (clonedInfo) { if (clonedInfo) {
if (info->flags & B_BACKGROUND_APP) { if (_IsSystemApp(info)) {
if (!backgroundApps.AddInfo(clonedInfo))
error = B_NO_MEMORY;
} else if (_IsSystemApp(info)) {
if (!systemApps.AddInfo(clonedInfo)) if (!systemApps.AddInfo(clonedInfo))
error = B_NO_MEMORY; error = B_NO_MEMORY;
} else if (info->flags & B_BACKGROUND_APP) {
if (!backgroundApps.AddInfo(clonedInfo))
error = B_NO_MEMORY;
} else { } else {
if (!userApps.AddInfo(clonedInfo)) if (!userApps.AddInfo(clonedInfo))
error = B_NO_MEMORY; error = B_NO_MEMORY;

View File

@ -92,8 +92,7 @@ public:
void SetShuttingDown(bool shuttingDown); void SetShuttingDown(bool shuttingDown);
status_t GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps, status_t GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps,
AppInfoList &backgroundApps, hash_set<team_id> &vitalSystemApps, AppInfoList &backgroundApps, hash_set<team_id> &vitalSystemApps);
RosterAppInfo &inputServer);
status_t AddWatcher(Watcher *watcher); status_t AddWatcher(Watcher *watcher);
void RemoveWatcher(Watcher *watcher); void RemoveWatcher(Watcher *watcher);