Pairs: Style fixes and update copyright headers.

Update long description in rdef
This commit is contained in:
John Scipione
2014-01-27 14:02:14 -05:00
parent bfdb2a4938
commit c6b0a589df
10 changed files with 90 additions and 31 deletions
+16 -2
View File
@@ -1,19 +1,30 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#include "Pairs.h"
#include <stdlib.h> #include <stdlib.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h> #include <Catalog.h>
#include "Pairs.h"
#include "PairsWindow.h" #include "PairsWindow.h"
const char* kSignature = "application/x-vnd.Haiku-Pairs"; const char* kSignature = "application/x-vnd.Haiku-Pairs";
// #pragma mark - Pairs
Pairs::Pairs() Pairs::Pairs()
: :
BApplication(kSignature), BApplication(kSignature),
@@ -49,6 +60,9 @@ Pairs::MessageReceived(BMessage* message)
} }
// #pragma mark - main
int int
main(void) main(void)
{ {
+10 -1
View File
@@ -1,15 +1,23 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#ifndef PAIRS_H #ifndef PAIRS_H
#define PAIRS_H #define PAIRS_H
#include <Application.h> #include <Application.h>
#include <Catalog.h> #include <Catalog.h>
extern const char* kSignature; extern const char* kSignature;
class BMessage; class BMessage;
class PairsWindow; class PairsWindow;
@@ -26,4 +34,5 @@ private:
PairsWindow* fWindow; PairsWindow* fWindow;
}; };
#endif // PAIRS_H #endif // PAIRS_H
+1 -2
View File
@@ -18,7 +18,7 @@ resource app_version {
internal = 1, internal = 1,
short_info = "Pairs", short_info = "Pairs",
long_info = "Pairs, ©2008-2009 Haiku Inc." long_info = "Pairs, ©2008 Ralf Schülke, ©2010 Adam Smith, ©2014 Haiku, Inc."
}; };
@@ -41,4 +41,3 @@ resource vector_icon {
$"070108000A060107000A0001041815FF01178400040A00010418001501178600" $"070108000A060107000A0001041815FF01178400040A00010418001501178600"
$"040A040104000A0301090815FF" $"040A040104000A0301090815FF"
}; };
+7 -2
View File
@@ -1,11 +1,16 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#ifndef PAIRS_GLOBAL_H #ifndef PAIRS_GLOBAL_H
#define PAIRS_GLOBAL_H #define PAIRS_GLOBAL_H
#include <SupportDefs.h> #include <SupportDefs.h>
+5 -1
View File
@@ -1,7 +1,11 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* All rights reserved. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#include <stdio.h> #include <stdio.h>
+6 -1
View File
@@ -1,6 +1,11 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#ifndef PAIRS_TOP_BUTTON_H #ifndef PAIRS_TOP_BUTTON_H
#define PAIRS_TOP_BUTTON_H #define PAIRS_TOP_BUTTON_H
+7 -1
View File
@@ -1,9 +1,15 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* Copyright 2010 Adam Smith <[email protected]> * Copyright 2010 Adam Smith <[email protected]>
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#include "PairsView.h" #include "PairsView.h"
#include <stdio.h> #include <stdio.h>
+6 -1
View File
@@ -1,7 +1,12 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* Copyright 2010 Adam Smith <[email protected]> * Copyright 2010 Adam Smith <[email protected]>
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#ifndef PAIRS_VIEW_H #ifndef PAIRS_VIEW_H
#define PAIRS_VIEW_H #define PAIRS_VIEW_H
+16 -10
View File
@@ -1,9 +1,15 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* Copyright 2010 Adam Smith <[email protected]> * Copyright 2010 Adam Smith <[email protected]>
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#include "PairsWindow.h" #include "PairsWindow.h"
#include <stdio.h> #include <stdio.h>
@@ -25,17 +31,18 @@
#include "PairsTopButton.h" #include "PairsTopButton.h"
// #pragma mark - PairsWindow
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "PairsWindow" #define B_TRANSLATION_CONTEXT "PairsWindow"
const uint32 MENU_NEW = 'MGnw'; const uint32 MENU_NEW = 'MGnw';
const uint32 MENU_SIZE = 'MGsz'; const uint32 MENU_SIZE = 'MGsz';
const uint32 MENU_QUIT = 'MGqu'; const uint32 MENU_QUIT = 'MGqu';
// #pragma mark - PairsWindow
PairsWindow::PairsWindow() PairsWindow::PairsWindow()
: :
BWindow(BRect(100, 100, 405, 423), B_TRANSLATE_SYSTEM_NAME("Pairs"), BWindow(BRect(100, 100, 405, 423), B_TRANSLATE_SYSTEM_NAME("Pairs"),
@@ -152,6 +159,7 @@ PairsWindow::MessageReceived(BMessage* message)
case MENU_NEW: case MENU_NEW:
NewGame(); NewGame();
break; break;
case MENU_SIZE: case MENU_SIZE:
{ {
int32 width; int32 width;
@@ -162,9 +170,11 @@ PairsWindow::MessageReceived(BMessage* message)
} }
break; break;
} }
case MENU_QUIT: case MENU_QUIT:
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
break; break;
case kMsgCardButton: case kMsgCardButton:
if (fIsPairsActive) { if (fIsPairsActive) {
fButtonClicks++; fButtonClicks++;
@@ -248,18 +258,14 @@ PairsWindow::MessageReceived(BMessage* message)
view->ResizeToPreferred(); view->ResizeToPreferred();
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) { if (alert->Go() == 0)
// New game
NewGame(); NewGame();
} else { else
// Quit game
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
} }
}
break; break;
default: default:
BWindow::MessageReceived(message); BWindow::MessageReceived(message);
break;
} }
} }
+8 -2
View File
@@ -1,14 +1,20 @@
/* /*
* Copyright 2008 Ralf Schülke, [email protected]. * Copyright 2008 Ralf Schülke, [email protected].
* Copyright 2010 Adam Smith <[email protected]> * Copyright 2010 Adam Smith <[email protected]>
* All rights reserved. Distributed under the terms of the MIT License. * Copyright 2014 Haiku, Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*/ */
#ifndef PAIRS_WINDOW_H #ifndef PAIRS_WINDOW_H
#define PAIRS_WINDOW_H #define PAIRS_WINDOW_H
#include <Window.h> #include <Window.h>
class PairsView; class PairsView;
class BMessageRunner; class BMessageRunner;