Skip to content

Commit

Permalink
Fix Deskbar AddOn
Browse files Browse the repository at this point in the history
  • Loading branch information
puckipedia committed Dec 4, 2013
1 parent 3d6e788 commit f72d9bd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
3 changes: 0 additions & 3 deletions deskbar add-on/DeskbarAddOn.rdef
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ resource app_version {
variety = B_APPV_FINAL,
internal = 0,

short_info = #'CSTR' array {

},
long_info = "1.0 ©2001 Werner Freytag"
};

Expand Down
21 changes: 14 additions & 7 deletions deskbar add-on/DeskbarView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#include <Deskbar.h>
#include <Entry.h>
#include <File.h>
#include <iostream>
#include <MenuItem.h>
#include <Message.h>
#include <PopUpMenu.h>
#include <Resources.h>
#include <Roster.h>
#include <stdio.h>
#include <Window.h>

#include "minimize_all.h"
#include "../minimize.h"

extern "C" _EXPORT BView *instantiate_deskbar_item();

Expand Down Expand Up @@ -80,7 +80,7 @@ void DeskbarView::Init() {
fMinimizedIcon = new BBitmap( &msg );
}
else {
cerr << "*** Resource not found" << endl;
printf("*** Resource not found\n");
}

fPopUpMenu = NULL;
Expand Down Expand Up @@ -145,7 +145,7 @@ void DeskbarView::MouseDown(BPoint where) {
void DeskbarView::MouseUp(BPoint where) {

if (fMouseDown && Bounds().Contains(where)) {
minimize_all();
minimize(min_minimize_all);
}

fMouseDown = false;
Expand Down Expand Up @@ -173,17 +173,24 @@ void DeskbarView::MessageReceived( BMessage *msg ) {

void DeskbarView::AddToDeskbar()
{
#if B_BEOS_VERSION >= B_BEOS_VERSION_5
#if defined(__HAIKU__)
BApplication app(APP_SIGNATURE);
BDeskbar *deskbar = new BDeskbar();
app_info info;
app.GetAppInfo(&info);
printf("%d: ", deskbar->AddItem(&info.ref) == B_OK);
delete deskbar;
#elif B_BEOS_VERSION >= B_BEOS_VERSION_5
BDeskbar *deskbar = new BDeskbar();
entry_ref ref;
be_roster->FindApp(APP_SIGNATURE, &ref);
deskbar->AddItem(&ref);
delete deskbar;
#else
BDeskbar *deskbar = new BDeskbar();
DeskbarView *replicant = new DeskbarView( VIEW_RECT );
DeskbarView *replicant = new DeskbarView();

err = deskbar->AddItem(replicant);
status_t err = deskbar->AddItem(replicant);
delete replicant;
delete deskbar;
#endif
Expand Down
2 changes: 1 addition & 1 deletion deskbar add-on/DeskbarView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class _EXPORT DeskbarView;

class BBitmap;

class BPopUpMenu;
class DeskbarView : public BView
{

Expand Down

0 comments on commit f72d9bd

Please sign in to comment.