Network: removed dummy add-ons.

This commit is contained in:
Axel Dörfler 2015-02-16 18:15:13 +00:00
parent 85fb1470bf
commit 14f5b52b21
4 changed files with 0 additions and 97 deletions

View File

@ -1,17 +0,0 @@
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <stdlib.h>
#include "NetworkSetupAddOn.h"
NetworkSetupAddOn*
get_nth_addon(image_id image, int index)
{
if (index != 0)
return NULL;
return new NetworkSetupAddOn(image);
}

View File

@ -1,9 +0,0 @@
SubDir HAIKU_TOP src preferences network DummyAddOn ;
UseHeaders [ FDirName $(HAIKU_TOP) src preferences network ] ;
Addon Dummy :
DummyAddOn.cpp
: be <nogrist>Network [ TargetLibstdc++ ] # $(HAIKU_NETWORK_LIBS)
;

View File

@ -1,9 +0,0 @@
SubDir HAIKU_TOP src preferences network MultipleAddOns ;
UseHeaders [ FDirName $(HAIKU_TOP) src preferences network ] ;
Addon Multiple :
MultipleAddOn.cpp
: be <nogrist>Network [ TargetLibstdc++ ] # $(HAIKU_NETWORK_LIBS)
;

View File

@ -1,62 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include "NetworkSetupAddOn.h"
class MultipleAddOn : public NetworkSetupAddOn {
public:
MultipleAddOn(image_id addon_image, int index);
~MultipleAddOn();
BView* CreateView(BRect* bounds);
const char* Name();
private:
char* fName;
rgb_color fViewColor;
};
MultipleAddOn::MultipleAddOn(image_id image, int i)
:
NetworkSetupAddOn(image)
{
fName = (char*) malloc(64);
sprintf(fName, "Multi #%d", i);
fViewColor.red = rand() % 256;
fViewColor.blue = rand() % 256;
fViewColor.green = rand() % 256;
fViewColor.alpha = 255;
}
MultipleAddOn::~MultipleAddOn()
{
free(fName);
}
BView*
MultipleAddOn::CreateView(BRect* bounds)
{
BView *v = new BView(*bounds, "a view", B_FOLLOW_ALL, B_WILL_DRAW);
v->SetViewColor(fViewColor);
return v;
}
const char*
MultipleAddOn::Name()
{
return fName;
}
NetworkSetupAddOn*
get_nth_addon(image_id image, int index)
{
if (index < 0 || index > 3)
return NULL;
return new MultipleAddOn(image, index);
}