2 * Copyright 2001-2010, Haiku.
3 * Distributed under the terms of the MIT License.
16 #include "pr_server.h"
23 if (GetPrinterServerMessenger(msgr
) != B_OK
)
26 BMessage
getNameOfActivePrinter(B_GET_PROPERTY
);
27 getNameOfActivePrinter
.AddSpecifier("ActivePrinter");
30 msgr
.SendMessage(&getNameOfActivePrinter
, &reply
);
32 BString activePrinterName
;
33 reply
.FindString("result", &activePrinterName
);
35 return activePrinterName
;
40 GetPrinterServerMessenger(BMessenger
& msgr
)
42 // If print server is not yet running, start it
43 if (!be_roster
->IsRunning(PSRV_SIGNATURE_TYPE
))
44 be_roster
->Launch(PSRV_SIGNATURE_TYPE
);
46 msgr
= BMessenger(PSRV_SIGNATURE_TYPE
);
47 return msgr
.IsValid() ? B_OK
: B_ERROR
;