2 * Copyright 2004-2006, Jérôme Duval. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 #include "ExpanderApp.h"
9 #include "ExpanderWindow.h"
12 ExpanderApp::ExpanderApp()
14 BApplication("application/x-vnd.Haiku-Expander")
16 BPoint windowPosition
= fSettings
.Message().FindPoint("window_position");
17 BRect
windowFrame(0, 0, 450, 120);
18 windowFrame
.OffsetBy(windowPosition
);
19 BMessage
settings(fSettings
.Message());
20 fWindow
= new ExpanderWindow(windowFrame
, NULL
, &settings
);
25 ExpanderApp::ArgvReceived(int32 argc
, char** argv
)
27 BMessage
* message
= NULL
;
28 for (int32 i
= 1; i
< argc
; i
++) {
30 status_t err
= get_ref_for_path(argv
[i
], &ref
);
32 if (message
== NULL
) {
33 message
= new BMessage
;
34 message
->what
= B_REFS_RECEIVED
;
36 message
->AddRef("refs", &ref
);
41 RefsReceived(message
);
46 ExpanderApp::RefsReceived(BMessage
* message
)
48 BMessenger
messenger(fWindow
);
49 message
->AddBool("fromApp", true);
50 messenger
.SendMessage(message
);
55 ExpanderApp::UpdateSettingsFrom(BMessage
* message
)
57 fSettings
.UpdateFrom(message
);
61 // #pragma mark - main method
65 main(int argc
, char** argv
)