xref: /haiku/src/apps/sudoku/Sudoku.cpp (revision 90ae2e54f6ccaca73c011a2aa4cdd660417108ad)
1 /*
2  * Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "Sudoku.h"
8 
9 #include "SudokuWindow.h"
10 
11 #include <stdlib.h>
12 
13 #include <Alert.h>
14 #include <Application.h>
15 #include <Catalog.h>
16 #include <TextView.h>
17 
18 
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "Sudoku"
21 
22 
23 const char* kSignature = "application/x-vnd.Haiku-Sudoku";
24 
25 
26 Sudoku::Sudoku()
27 	:
28 	BApplication(kSignature)
29 {
30 }
31 
32 
33 Sudoku::~Sudoku()
34 {
35 }
36 
37 
38 void
39 Sudoku::ReadyToRun()
40 {
41 	fWindow = new SudokuWindow();
42 	fWindow->Show();
43 }
44 
45 
46 void
47 Sudoku::RefsReceived(BMessage* message)
48 {
49 	fWindow->PostMessage(message);
50 }
51 
52 
53 void
54 Sudoku::MessageReceived(BMessage* message)
55 {
56 	BApplication::MessageReceived(message);
57 }
58 
59 
60 //	#pragma mark -
61 
62 
63 int
64 main(int /*argc*/, char** /*argv*/)
65 {
66 	srand(system_time() % INT_MAX);
67 
68 	Sudoku sudoku;
69 	sudoku.Run();
70 
71 	return 0;
72 }
73