libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / preferences / printers / Printers.cpp
blob916f2ff965338b5a732313b0df896a4cf8cafcab
1 /*
2 * Copyright 2001-2010, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Michael Pfeiffer
7 */
10 #include "Printers.h"
12 #include <Locale.h>
14 #include "pr_server.h"
15 #include "Messages.h"
16 #include "PrintersWindow.h"
19 int
20 main()
22 PrintersApp app;
23 app.Run();
24 return 0;
28 PrintersApp::PrintersApp()
29 : Inherited(PRINTERS_SIGNATURE)
34 void
35 PrintersApp::ReadyToRun()
37 PrintersWindow* win = new PrintersWindow(BRect(78, 71, 561, 409));
38 win->Show();
42 void
43 PrintersApp::MessageReceived(BMessage* msg)
45 if (msg->what == B_PRINTER_CHANGED || msg->what == PRINTERS_ADD_PRINTER) {
46 // broadcast message
47 uint32 what = msg->what;
48 if (what == PRINTERS_ADD_PRINTER)
49 what = kMsgAddPrinter;
51 BWindow* w;
52 for (int32 i = 0; (w = WindowAt(i)) != NULL; i++) {
53 BMessenger msgr(NULL, w);
54 msgr.SendMessage(what);
56 } else {
57 BApplication::MessageReceived(msg);
62 void
63 PrintersApp::ArgvReceived(int32 argc, char** argv)
65 for (int i = 1; i < argc; i++) {
66 // TODO: show a pre-filled add printer dialog here