1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 2 // 3 // Copyright (c) 2004, Haiku 4 // 5 // This software is part of the Haiku distribution and is covered 6 // by the MIT License. 7 // 8 // 9 // Program: desklink 10 // Author: Jérôme DUVAL 11 // Description: MethodReplicant Test 12 // Created : October 20, 2004 13 // 14 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 15 16 #include <Application.h> 17 #include <Deskbar.h> 18 #include <Roster.h> 19 #include <stdio.h> 20 #include "MethodReplicant.h" 21 22 const char *app_signature = "application/x-vnd.obos.testmethodreplicant"; 23 // the application signature used by the replicant to find the supporting 24 // code 25 26 extern "C" _EXPORT BView* instantiate_deskbar_item(); 27 28 BView * 29 instantiate_deskbar_item() 30 { 31 return new MethodReplicant(app_signature); 32 } 33 34 int main(int argc, char **argv) 35 { 36 BApplication app(app_signature); 37 38 app_info info; 39 app.GetAppInfo(&info); 40 41 status_t err = BDeskbar().AddItem(&info.ref); 42 43 if(err!=B_OK) { 44 printf("desklink: Deskbar refuses link\n"); 45 return 1; 46 } 47 48 return 0; 49 } 50