rem: err = BDeskbar().AddItem(new DeskButton(BRect(0, 0, 16, 16), &ref, "DeskButton",
add: err = BDeskbar().AddItem(new DeskButton(BRect(0, 0, 15, 15), &ref, "DeskButton",
context: main(int, char **argv){		BApplication app(app_signature);	bool atLeastOnePath = false;	BList titleList;	BList actionList;			for(int32 i=1; argv[i]!=NULL; i++) {		if (strcmp(argv[i], "--list") == 0) {			BDeskbar db;			int32 i, found = 0, count;			count = db.CountItems();			printf("Deskbar items:\n");			/* the API is doomed, so don't try to enum for too long */			for (i = 0; (found < count) && (i >= 0) && (i < 5000); i++) {				const char scratch[2] = ""; /* BDeskbar is buggy */				const char *name=scratch;				if (db.GetItemInfo(i, &name) >= B_OK) {					found++;					printf("Item %ld: '%s'\n", i, name);					free((void *)name); /* INTENDED */				}			}			return 0;		}		if (strcmp(argv[i], "--remove") == 0) {			BDeskbar db;			int32 found = 0;			uint32 count = db.CountItems();			/* BDeskbar is definitely doomed ! */			while ((db.RemoveItem("DeskButton") == B_OK) && (db.CountItems() < count)) {				count = db.CountItems();				found++;			}			printf("removed %ld items.\n", found);			return 0;		}				if (strncmp(argv[i], "cmd=", 4) == 0) {			BString *title = new BString(argv[i] + 4);			int32 index = title->FindFirst(':');			if(index<=0) {				printf("desklink: usage: cmd=title:action\n");			} else {				title->Truncate(index);				BString *action = new BString(argv[i] + 4);				action->Remove(0, index+1);				titleList.AddItem(title);				actionList.AddItem(action);			}			continue;		}				atLeastOnePath = true;			BEntry entry(argv[i], true);		if(!entry.Exists()) {			printf("desklink: cannot find '%s'\n", argv[i]);			return 1;		}				entry_ref ref;		entry.GetRef(&ref);				status_t err;		err = BDeskbar().AddItem(new DeskButton(BRect(0, 0, 16, 16), &ref, "DeskButton",			titleList, actionList));			if(err!=B_OK) {			printf("desklink: Deskbar refuses link to '%s': %s\n", argv[i], strerror(err));			}				titleList.MakeEmpty();		actionList.MakeEmpty();	}		if (!atLeastOnePath) {		// print a simple usage string		printf(	"usage: desklink { [ --list|--remove|[cmd=title:action ... ] path ] } ...\n"			"--list: list all Deskbar addons.\n"			"--remove: delete all desklink addons.\n");		return 1;	}		return 0;}