xref: /haiku/src/preferences/joysticks/Joysticks.cpp (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2007 Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
7  *		Ryan Leavengood, leavengood@gmail.com
8  */
9 
10 
11 #include "Joysticks.h"
12 #include "JoyWin.h"
13 
14 #include <stdio.h>
15 #include <stdlib.h>
16 
17 #include <Window.h>
18 #include <View.h>
19 #include <Button.h>
20 #include <Box.h>
21 #include <StringView.h>
22 
23 int main(void)
24 {
25 	Joysticks application("application/x-vnd.Haiku-Joysticks");
26 	application.Run();
27 	return 0;
28 }
29 
30 
31 Joysticks::Joysticks(const char *signature)
32 	: BApplication(signature)
33 {
34 }
35 
36 
37 Joysticks::~Joysticks()
38 {
39 	be_app_messenger.SendMessage(B_QUIT_REQUESTED);
40 }
41 
42 
43 bool
44 Joysticks::QuitRequested()
45 {
46 	return BApplication::QuitRequested();
47 }
48 
49 
50 void
51 Joysticks::ReadyToRun()
52 {
53 	fJoywin = new JoyWin(BRect(100, 100, 500, 400), "Joysticks");
54 	if (fJoywin != NULL)
55 		fJoywin->Show();
56 	else
57 		be_app->PostMessage(B_QUIT_REQUESTED);
58 }
59 
60