cleanups, updated copyrights

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21001 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2007-05-03 20:05:47 +00:00
parent a8ff4e33f1
commit def763251b
16 changed files with 59 additions and 71 deletions

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/

View File

@ -1,10 +1,11 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
#ifndef AUTO_SETTINGS_MENU_H
#define AUTO_SETTINGS_MENU_H
@ -20,3 +21,4 @@ class AutoSettingsMenu : public BMenu {
};
#endif // AUTO_SETTINGS_MENU_H

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/

View File

@ -1,20 +1,19 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
#ifndef BITMAP_MENU_ITEM_H
#define BITMAP_MENU_ITEM_H
#include <MenuItem.h>
#include <String.h>
class BBitmap;
class BitmapMenuItem : public BMenuItem {
public:
BitmapMenuItem(const char* name, BMessage* message, BBitmap* bmp,

View File

@ -59,11 +59,6 @@ ColorWindow::ColorWindow(BMessenger owner)
}
ColorWindow::~ColorWindow()
{
}
void
ColorWindow::Quit()
{

View File

@ -1,11 +1,13 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
* Vasilis Kaoutsis, kaoutsis@sch.gr
*/
#ifndef COLOR_WINDOW_H
#define COLOR_WINDOW_H
@ -21,7 +23,6 @@ class BButton;
class ColorWindow : public BWindow {
public:
ColorWindow(BMessenger owner);
~ColorWindow();
virtual void Quit();
virtual void MessageReceived(BMessage* message);

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
@ -14,8 +15,6 @@
#include <MenuItem.h>
#include <Message.h>
#include <stdlib.h>
FontMenu::FontMenu()
: AutoSettingsMenu("Font", B_ITEMS_IN_COLUMN)
@ -48,30 +47,32 @@ void
FontMenu::GetFonts()
{
int32 numFamilies = count_font_families();
for ( int32 i = 0; i < numFamilies; i++ ) {
font_family *family = (font_family*)malloc(sizeof(font_family));
for (int32 i = 0; i < numFamilies; i++) {
font_family family;
uint32 flags;
if ( get_font_family(i, family, &flags) == B_OK ) {
BMenu *fontStyleMenu = new BMenu(*family, B_ITEMS_IN_COLUMN);
if (get_font_family(i, &family, &flags) == B_OK) {
BMenu *fontStyleMenu = new BMenu(family, B_ITEMS_IN_COLUMN);
fontStyleMenu->SetRadioMode(true);
int32 numStyles = count_font_styles(*family);
for ( int32 j = 0; j < numStyles; j++ ) {
font_style *style = (font_style*)malloc(sizeof(font_style));
if ( get_font_style(*family, j, style, &flags) == B_OK ) {
int32 numStyles = count_font_styles(family);
for (int32 j = 0; j < numStyles; j++) {
font_style style;
if (get_font_style(family, j, &style, &flags) == B_OK) {
BMessage *msg = new BMessage(MENU_FONT_STYLE);
msg->AddPointer("family", family);
msg->AddPointer("style", style);
BMenuItem *fontStyleItem = new BMenuItem(*style, msg, 0, 0);
msg->AddString("family", family);
msg->AddString("style", style);
BMenuItem *fontStyleItem = new BMenuItem(style, msg);
fontStyleMenu->AddItem(fontStyleItem);
}
}
BMessage *msg = new BMessage(MENU_FONT_FAMILY);
msg->AddPointer("family", family);
font_style *style = (font_style*)malloc(sizeof(font_style));
msg->AddString("family", family);
// if font family selected, we need to change style to
// first style
if ( get_font_style(*family, 0, style, &flags) == B_OK )
msg->AddPointer("style", style);
font_style style;
if (get_font_style(family, 0, &style, &flags) == B_OK)
msg->AddString("style", style);
BMenuItem *fontFamily = new BMenuItem(fontStyleMenu, msg);
AddItem(fontFamily);
}

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
@ -69,3 +70,4 @@ FontSizeMenu::AttachedToWindow()
item->SetMarked(true);
}

View File

@ -1,10 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Jack Burton
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
* Vasilis Kaoutsis, kaoutsis@sch.gr
*/

View File

@ -4,7 +4,7 @@
*
* Authors:
* <unknown, please fill in who knows>
* Jack Burton
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
#ifndef MENU_APP_H
#define MENU_APP_H

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
* Vasilis Kaoutsis, kaoutsis@sch.gr
*/

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
#ifndef MENU_BAR_H
#define MENU_BAR_H
@ -12,8 +13,6 @@
#include <MenuBar.h>
class BMenuItem;
class MenuBar : public BMenuBar {
public:
MenuBar();

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/

View File

@ -1,9 +1,10 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
* Vasilis Kaoutsis, kaoutsis@sch.gr
*/
@ -64,11 +65,6 @@ MenuWindow::MenuWindow(BRect rect)
}
MenuWindow::~MenuWindow()
{
}
void
MenuWindow::MessageReceived(BMessage *msg)
{
@ -96,13 +92,14 @@ MenuWindow::MessageReceived(BMessage *msg)
case MENU_FONT_STYLE:
{
fRevert = true;
font_family *family;
msg->FindPointer("family", (void**)&family);
font_style *style;
msg->FindPointer("style", (void**)&style);
const font_family *family;
msg->FindString("family", (const char **)&family);
const font_style *style;
msg->FindString("style", (const char **)&style);
settings->Get(info);
memcpy(info.f_family, family, sizeof(info.f_family));
memcpy(info.f_style, style, sizeof(info.f_style));
strlcpy(info.f_family, (const char *)family, B_FONT_FAMILY_LENGTH);
strlcpy(info.f_style, (const char *)style, B_FONT_STYLE_LENGTH);
settings->Set(info);
Update();
break;
@ -116,14 +113,6 @@ MenuWindow::MessageReceived(BMessage *msg)
Update();
break;
case MENU_SEP_TYPE:
fRevert = true;
settings->Get(info);
msg->FindInt32("sep", &info.separator);
settings->Set(info);
Update();
break;
case ALLWAYS_TRIGGERS_MSG:
fRevert = true;
settings->Get(info);

View File

@ -1,10 +1,12 @@
/*
* Copyright 2002-2006, Haiku Inc. All rights reserved.
* Copyright 2002-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <unknown, please fill in who knows>
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
*/
#ifndef MENU_WINDOW_H
#define MENU_WINDOW_H
@ -16,12 +18,9 @@
class ColorWindow;
class BButton;
class MenuBar;
class MenuWindow : public BWindow {
public:
MenuWindow(BRect frame);
virtual ~MenuWindow();
virtual void MessageReceived(BMessage *message);
virtual bool QuitRequested();

View File

@ -35,7 +35,5 @@ const uint32 MENU_FONT_FAMILY = 'mffm';
const uint32 MENU_FONT_STYLE = 'mfst';
const uint32 MENU_FONT_SIZE = 'mfsz';
// seperator
const uint32 MENU_SEP_TYPE = 'mstp';
#endif // MESSAGES_H