style cleanup; added missing public source headers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40314 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-01-29 15:42:20 +00:00
parent 30222ff141
commit 8422bd4a5e
12 changed files with 93 additions and 25 deletions

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <stdlib.h> #include <stdlib.h>
#include "NetworkSetupAddOn.h" #include "NetworkSetupAddOn.h"

View File

@ -92,8 +92,9 @@ InterfacesAddOn::CreateView(BRect *bounds)
r.left += w + SMALL_MARGIN; r.left += w + SMALL_MARGIN;
fOnOff = new BButton(r, "onoff", "Disable", new BMessage(ONOFF_INTERFACE_MSG), fOnOff = new BButton(r, "onoff", "Disable",
B_FOLLOW_BOTTOM | B_FOLLOW_LEFT); new BMessage(ONOFF_INTERFACE_MSG),
B_FOLLOW_BOTTOM | B_FOLLOW_LEFT);
fOnOff->GetPreferredSize(&w, &h); fOnOff->GetPreferredSize(&w, &h);
fOnOff->ResizeToPreferred(); fOnOff->ResizeToPreferred();
fOnOff->Hide(); fOnOff->Hide();
@ -119,7 +120,7 @@ InterfacesAddOn::MessageReceived(BMessage* msg)
{ {
int nr = fListview->CurrentSelection(); int nr = fListview->CurrentSelection();
InterfaceListItem *item = NULL; InterfaceListItem *item = NULL;
if(nr != -1) { if (nr != -1) {
item = dynamic_cast<InterfaceListItem*>(fListview->ItemAt(nr)); item = dynamic_cast<InterfaceListItem*>(fListview->ItemAt(nr));
} }

View File

@ -5,7 +5,7 @@
* Authors: * Authors:
* Philippe Houdoin * Philippe Houdoin
* Fredrik Modéen * Fredrik Modéen
* Alexander von Gluck IV, <kallisti5@unixzen.com> * Alexander von Gluck IV, kallisti5@unixzen.com
*/ */
@ -75,7 +75,7 @@ InterfaceListItem::~InterfaceListItem()
void void
InterfaceListItem::Update(BView* owner, const BFont* font) InterfaceListItem::Update(BView* owner, const BFont* font)
{ {
BListItem::Update(owner,font); BListItem::Update(owner, font);
font_height height; font_height height;
font->GetHeight(&height); font->GetHeight(&height);
@ -101,24 +101,25 @@ InterfaceListItem::DrawItem(BView* owner, BRect /*bounds*/, bool complete)
BRect bounds = list->ItemFrame(list->IndexOf(this)); BRect bounds = list->ItemFrame(list->IndexOf(this));
rgb_color black= { 0,0,0,255 }; rgb_color black = {0, 0, 0, 255};
if ( IsSelected() || complete ) { if (IsSelected() || complete) {
if (IsSelected()) { if (IsSelected()) {
owner->SetHighColor(tint_color(owner->ViewColor() , B_HIGHLIGHT_BACKGROUND_TINT)); owner->SetHighColor(tint_color(owner->ViewColor(),
} else { B_HIGHLIGHT_BACKGROUND_TINT));
owner->SetHighColor(owner->LowColor()); } else {
} owner->SetHighColor(owner->LowColor());
}
owner->FillRect(bounds); owner->FillRect(bounds);
} }
BPoint iconPt = bounds.LeftTop() + BPoint(4,4); BPoint iconPt = bounds.LeftTop() + BPoint(4, 4);
BPoint namePt = BPoint(32+12, fFirstlineOffset); BPoint namePt(32 + 12, fFirstlineOffset);
BPoint v4addrPt = BPoint(32+12, fSecondlineOffset); BPoint v4addrPt(32 + 12, fSecondlineOffset);
BPoint v6addrPt = BPoint(32+12, fThirdlineOffset); BPoint v6addrPt(32 + 12, fThirdlineOffset);
if ( fSettings->IsDisabled() ) { if (fSettings->IsDisabled()) {
owner->SetDrawingMode(B_OP_ALPHA); owner->SetDrawingMode(B_OP_ALPHA);
owner->SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_OVERLAY); owner->SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_OVERLAY);
owner->SetHighColor(0, 0, 0, 32); owner->SetHighColor(0, 0, 0, 32);
@ -127,11 +128,11 @@ InterfaceListItem::DrawItem(BView* owner, BRect /*bounds*/, bool complete)
owner->DrawBitmapAsync(fIcon, iconPt); owner->DrawBitmapAsync(fIcon, iconPt);
if ( fSettings->IsDisabled() ) if (fSettings->IsDisabled())
owner->SetHighColor(tint_color(black, B_LIGHTEN_1_TINT)); owner->SetHighColor(tint_color(black, B_LIGHTEN_1_TINT));
else else
owner->SetHighColor(black); owner->SetHighColor(black);
owner->SetFont(be_bold_font); owner->SetFont(be_bold_font);
owner->DrawString(Name(), namePt); owner->DrawString(Name(), namePt);
owner->SetFont(be_plain_font); owner->SetFont(be_plain_font);
@ -142,7 +143,7 @@ InterfaceListItem::DrawItem(BView* owner, BRect /*bounds*/, bool complete)
BString v4str("IPv4: "); BString v4str("IPv4: ");
v4str << fSettings->IP(); v4str << fSettings->IP();
v4str << " ("; v4str << " (";
if ( fSettings->AutoConfigure() ) if (fSettings->AutoConfigure())
v4str << "DHCP"; v4str << "DHCP";
else else
v4str << "manual"; v4str << "manual";
@ -200,13 +201,17 @@ InterfaceListItem::_Init()
size_t size; size_t size;
// Try specific interface icon? // Try specific interface icon?
const uint8* rawIcon = (const uint8*)resources.LoadResource(B_VECTOR_ICON_TYPE, Name(), &size); const uint8* rawIcon = (const uint8*)resources.LoadResource(
B_VECTOR_ICON_TYPE, Name(), &size);
if (rawIcon == NULL && mediaTypeName != NULL) if (rawIcon == NULL && mediaTypeName != NULL)
// Not found, try interface media type? // Not found, try interface media type?
rawIcon = (const uint8*)resources.LoadResource(B_VECTOR_ICON_TYPE, mediaTypeName, &size); rawIcon = (const uint8*)resources.LoadResource(
B_VECTOR_ICON_TYPE, mediaTypeName, &size);
if (rawIcon == NULL) if (rawIcon == NULL)
// Not found, try default interface icon? // Not found, try default interface icon?
rawIcon = (const uint8*)resources.LoadResource(B_VECTOR_ICON_TYPE, "ether", &size); rawIcon = (const uint8*)resources.LoadResource(
B_VECTOR_ICON_TYPE, "ether", &size);
if (rawIcon) { if (rawIcon) {
// Now build the bitmap // Now build the bitmap
@ -218,6 +223,7 @@ InterfaceListItem::_Init()
} }
} }
// #pragma mark - // #pragma mark -
@ -313,6 +319,7 @@ InterfacesListView::_UpdateList()
return B_OK; return B_OK;
} }
void void
InterfacesListView::_HandleNetworkMessage(BMessage* message) InterfacesListView::_HandleNetworkMessage(BMessage* message)
{ {
@ -354,3 +361,4 @@ InterfacesListView::_HandleNetworkMessage(BMessage* message)
break; break;
} }
} }

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <stdlib.h> #include <stdlib.h>
#include "NetworkSetupAddOn.h" #include "NetworkSetupAddOn.h"

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2007 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <Alert.h> #include <Alert.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h> #include <Catalog.h>

View File

@ -1,3 +1,8 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include "NetworkSetupAddOn.h" #include "NetworkSetupAddOn.h"

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#ifndef NETWORKSETUPADDON_H #ifndef NETWORKSETUPADDON_H
#define NETWORKSETUPADDON_H #define NETWORKSETUPADDON_H

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <stdlib.h> #include <stdlib.h>
#include "NetworkSetupProfile.h" #include "NetworkSetupProfile.h"

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#ifndef NETWORKSETUPPROFILE_H #ifndef NETWORKSETUPPROFILE_H
#define NETWORKSETUPPROFILE_H #define NETWORKSETUPPROFILE_H

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include "NetworkSetupAddOn.h" #include "NetworkSetupAddOn.h"
#include "NetworkSetupWindow.h" #include "NetworkSetupWindow.h"

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#ifndef NETWORKSETUPWINDOW_H #ifndef NETWORKSETUPWINDOW_H
#define NETWORKSETUPWINDOW_H #define NETWORKSETUPWINDOW_H

View File

@ -1,3 +1,9 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>