1 /* 2 * Copyright 2001-2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Rafael Romo 7 * Stefano Ceccherini (burton666@libero.it) 8 * Andrew Bachmann 9 * Sergei Panteleev 10 */ 11 12 13 #include "ScreenApplication.h" 14 #include "ScreenWindow.h" 15 #include "ScreenSettings.h" 16 #include "Constants.h" 17 18 #include <Alert.h> 19 20 21 static const char* kAppSignature = "application/x-vnd.Be-SCRN"; 22 23 24 ScreenApplication::ScreenApplication() 25 : BApplication(kAppSignature), 26 fScreenWindow(new ScreenWindow(new ScreenSettings())) 27 { 28 fScreenWindow->Show(); 29 } 30 31 32 void 33 ScreenApplication::AboutRequested() 34 { 35 BAlert *aboutAlert = new BAlert("About", "Screen preferences by the Haiku team", 36 "Ok", NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT); 37 aboutAlert->SetShortcut(0, B_OK); 38 aboutAlert->Go(); 39 } 40 41 42 void 43 ScreenApplication::MessageReceived(BMessage* message) 44 { 45 switch (message->what) { 46 case SET_CUSTOM_REFRESH_MSG: 47 case MAKE_INITIAL_MSG: 48 fScreenWindow->PostMessage(message); 49 break; 50 51 default: 52 BApplication::MessageReceived(message); 53 break; 54 } 55 } 56 57 58 // #pragma mark - 59 60 61 int 62 main() 63 { 64 ScreenApplication app; 65 app.Run(); 66 67 return 0; 68 } 69