Changeset 43407 in vbox
- Timestamp:
- Sep 22, 2012 2:19:26 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80893
- Location:
- trunk/src/VBox/Additions/haiku/VBoxTray
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp
r43364 r43407 48 48 * Header Files * 49 49 *******************************************************************************/ 50 #include <iprt/log.h> 51 50 52 #include <errno.h> 51 #define DEBUG 152 53 #include <Alert.h> 53 54 #include <Debug.h> … … 62 63 : BApplication(VBOX_GUEST_APP_SIG) 63 64 { 64 PRINT(("%s()\n", __FUNCTION__));65 65 } 66 66 … … 68 68 VBoxGuestApplication::~VBoxGuestApplication() 69 69 { 70 PRINT(("%s()\n", __FUNCTION__));71 70 } 72 71 … … 77 76 78 77 err = VBoxGuestDeskbarView::AddToDeskbar(); 79 PRINT(("%s: VBoxGuestDeskbarView::AddToDeskbar: 0x%08lx\n", __FUNCTION__, err)); 80 78 LogFlow(("VBoxGuestDeskbarView::ReadyToRun: AddToDeskbar returned 0x%08lx\n", err)); 81 79 exit(0); 82 80 } … … 88 86 be_app->Run(); 89 87 delete be_app; 90 91 /* int rc = RTR3Init();92 if (RT_SUCCESS(rc))93 {94 rc = VbglR3Init();95 if (RT_SUCCESS(rc))96 rc = vboxOpenBaseDriver();97 }98 99 if (RT_SUCCESS(rc))100 {101 Log(("VBoxGuestApp: Init successful\n"));102 103 new VBoxGuestApplication(gVBoxDriverFD);104 be_app->Run();105 delete be_app;106 107 }108 109 if (RT_FAILURE(rc))110 {111 LogRel(("VBoxGuestApp: Error while starting, rc=%Rrc\n", rc));112 }113 LogRel(("VBoxGuestApp: Ended\n"));114 115 vboxCloseBaseDriver();116 117 VbglR3Term();*/118 119 88 return 0; 120 89 } -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.h
r43363 r43407 48 48 #define __VBOXGUESTAPPLICATION__H 49 49 50 /** @todo r=ramshankar; why are we including all the headers here!?? Do it in 51 * the .cpp please. */ 50 52 #include <Application.h> 51 53 … … 62 64 class VBoxClipboardService; 63 65 64 class VBoxGuestApplication : public BApplication { 65 public: 66 VBoxGuestApplication(); 67 virtual ~VBoxGuestApplication(); 66 class VBoxGuestApplication : public BApplication 67 { 68 public: 69 VBoxGuestApplication(); 70 virtual ~VBoxGuestApplication(); 68 71 69 72 virtual void ReadyToRun(); 70 73 }; 71 74 -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxGuestDeskbarView.cpp
r43364 r43407 48 48 *******************************************************************************/ 49 49 #include <errno.h> 50 #define DEBUG 151 50 #include <Alert.h> 52 51 #include <Roster.h> … … 64 63 #include "VBoxGuestApplication.h" 65 64 66 #define VIEWNAME "VBoxGuestDeskbarView"65 #define VIEWNAME "VBoxGuestDeskbarView" 67 66 68 67 static status_t … … 87 86 fIcon(NULL), fClipboardService(NULL), fDisplayService(NULL) 88 87 { 89 PRINT(("%s()\n", __FUNCTION__));90 88 _Init(); 91 89 } … … 96 94 fIcon(NULL) 97 95 { 98 PRINT(("%s()\n", __FUNCTION__));99 96 archive->PrintToStream(); 100 101 97 _Init(archive); 102 98 } … … 105 101 VBoxGuestDeskbarView::~VBoxGuestDeskbarView() 106 102 { 107 PRINT(("%s()\n", __FUNCTION__));108 103 delete fIcon; 109 104 if (fClipboardService) … … 118 113 BArchivable* VBoxGuestDeskbarView::Instantiate(BMessage *data) 119 114 { 120 PRINT(("%s()\n", __FUNCTION__));121 115 if (!validate_instantiation(data, VIEWNAME)) 122 116 return NULL; … … 129 123 { 130 124 status_t err; 131 PRINT(("%s()\n", __FUNCTION__));132 125 133 126 err = BView::Archive(data, false); 134 127 if (err < B_OK) 128 { 129 LogRel(("VBoxGuestDeskbarView::Archive failed.rc=%08lx\n", err)); 135 130 return err; 131 } 136 132 data->AddString("add_on", VBOX_GUEST_APP_SIG); 137 133 data->AddString("class", "VBoxGuestDeskbarView"); … … 156 152 } 157 153 158 if (fClipboardService) / / don't repeatedly crash deskbar if vboxdev not loaded154 if (fClipboardService) /* Don't repeatedly crash deskbar if vboxdev not loaded */ 159 155 { 160 156 Looper()->AddHandler(fClipboardService); … … 163 159 164 160 if (fDisplayService) 165 {166 161 fDisplayService->Start(); 167 }168 162 } 169 163 … … 179 173 void VBoxGuestDeskbarView::MouseDown(BPoint point) 180 174 { 181 printf("MouseDown\n");182 175 int32 buttons = B_PRIMARY_MOUSE_BUTTON; 183 176 if (Looper() != NULL && Looper()->CurrentMessage() != NULL) … … 213 206 BDeskbar deskbar; 214 207 status_t err; 215 PRINT(("%s()\n", __FUNCTION__));216 208 217 209 if (force) … … 222 214 app_info info; 223 215 err = be_app->GetAppInfo(&info); 224 PRINT(("%s: be_app->GetAppInfo: 0x%08lx\n", __FUNCTION__, err));225 216 if (err < B_OK) 226 217 return err; 227 218 228 219 BPath p(&info.ref); 229 PRINT(("%s: app path: '%s'\n", __FUNCTION__, p.Path()));230 231 220 return deskbar.AddItem(&info.ref); 232 221 } … … 236 225 { 237 226 BDeskbar deskbar; 238 PRINT(("%s()\n", __FUNCTION__));239 240 227 return deskbar.RemoveItem(VIEWNAME); 241 228 } … … 275 262 276 263 int rc = RTR3InitDll(0); 277 printf("%d\n", rc);278 264 if (RT_SUCCESS(rc)) 279 265 { 280 266 rc = VbglR3Init(); 281 } 282 printf("%d\n", rc); 283 if (RT_SUCCESS(rc)) 284 { 285 fClipboardService = new VBoxClipboardService(); 286 fDisplayService = new VBoxDisplayService(); 287 } 288 267 if (RT_SUCCESS(rc)) 268 { 269 fClipboardService = new VBoxClipboardService(); 270 fDisplayService = new VBoxDisplayService(); 271 } 272 else 273 LogRel(("VBoxGuestDeskbarView::_init VbglR3Init failed. rc=%d\n", rc)); 274 } 275 else 276 LogRel(("VBoxGuestDeskbarView::_init RTR3InitDll failed. rc=%d\n", rc)); 289 277 return RTErrConvertToErrno(rc); 290 278 } … … 293 281 RTDECL(BView*) instantiate_deskbar_item() 294 282 { 295 PRINT(("%s()\n", __FUNCTION__));296 283 return new VBoxGuestDeskbarView(); 297 284 } -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxServiceDescriptor.h
r43363 r43407 49 49 #include <Handler.h> 50 50 51 class VBoxClipboardService : public BHandler { 52 public: 53 VBoxClipboardService(); 54 virtual ~VBoxClipboardService(); 55 56 private: 57 51 class VBoxClipboardService : public BHandler 52 { 53 public: 54 VBoxClipboardService(); 55 virtual ~VBoxClipboardService(); 58 56 }; 59 57 60 58 /* The shared clipboard service prototypes. */ 61 int VBoxClipboardInit (const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread); 62 unsigned __stdcall VBoxClipboardThread (void *pInstance); 63 void VBoxClipboardDestroy (const VBOXSERVICEENV *pEnv, void *pInstance); 64 59 int VBoxClipboardInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread); 60 unsigned __stdcall VBoxClipboardThread(void *pInstance); 61 void VBoxClipboardDestroy(const VBOXSERVICEENV *pEnv, void *pInstance); 65 62 66 63 #endif /* __VBOXSERVICESHAREDCLIPLBOARD__H */
Note:
See TracChangeset
for help on using the changeset viewer.