vbox的更動 43406 路徑 trunk/src/VBox/Additions/haiku
- 時間撮記:
- 2012-9-22 下午02:11:49 (12 年 以前)
- 位置:
- trunk/src/VBox/Additions/haiku/VBoxTray
- 檔案:
-
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxClipboard.cpp
r43364 r43406 67 67 #include <VBox/log.h> 68 68 69 #undef Log 70 #define Log(x) printf x 71 #undef LogRel 72 #define LogRel(x) printf x 73 #undef LogRelFlowFunc 74 #define LogRelFlowFunc(x) printf x 69 /** @todo r=ramshankar: this hack should go eventually. */ 70 #ifdef DEBUG_ramshankar 71 # undef Log 72 # define Log(x) printf x 73 # undef LogRel 74 # define LogRel(x) printf x 75 # undef LogRelFlowFunc 76 # define LogRelFlowFunc(x) printf x 77 #endif 75 78 76 79 … … 92 95 { 93 96 status_t err; 94 printf("VBoxClipboardService::%s()\n", __FUNCTION__);97 LogFlowFunc(("Connect\n")); 95 98 96 99 int rc = VbglR3ClipboardConnect(&fClientId); 97 100 if (RT_SUCCESS(rc)) 98 101 { 99 err = fServiceThreadID = spawn_thread(_ServiceThreadNub, 100 "VBoxClipboardService", B_NORMAL_PRIORITY, this); 101 102 err = fServiceThreadID = spawn_thread(_ServiceThreadNub, "VBoxClipboardService", B_NORMAL_PRIORITY, this); 102 103 if (err >= B_OK) 103 104 { 104 105 resume_thread(fServiceThreadID); 105 106 106 err = be_clipboard->StartWatching(BMessenger(this)); 107 printf("be_clipboard->StartWatching: %ld\n", err);107 LogFlow(("be_clipboard->StartWatching: %ld\n", err)); 108 108 if (err == B_OK) 109 109 return B_OK; … … 156 156 if (!formats) 157 157 break; 158 158 159 if (!be_clipboard->Lock()) 159 160 break; … … 177 178 { 178 179 BString str(text); 179 / / @todo use vboxClipboardUtf16WinToLin()180 /** @todo user vboxClipboardUtf16WinToLin() */ 180 181 // convert Windows CRLF to LF 181 182 str.ReplaceAll("\r\n", "\n"); … … 194 195 if (pv) 195 196 { 196 void *pBmp;197 size_t cbBmp ;197 void *pBmp = NULL; 198 size_t cbBmp = 0; 198 199 rc = vboxClipboardDibToBmp(pv, cb, &pBmp, &cbBmp); 199 200 if (RT_SUCCESS(rc)) … … 204 205 { 205 206 BMessage bitmapArchive; 206 if (bitmap->IsValid() && 207 bitmap->Archive(&bitmapArchive) == B_OK && 208 clip->AddMessage("image/bitmap", &bitmapArchive) == B_OK) 207 208 /** @todo r=ramshankar: split this into functions with error checking as 209 * neccessary. */ 210 if ( bitmap->IsValid() 211 && bitmap->Archive(&bitmapArchive) == B_OK 212 && clip->AddMessage("image/bitmap", &bitmapArchive) == B_OK) 209 213 { 210 214 commit = true; … … 218 222 } 219 223 220 /* make sure we don't bounce this data back to the host, 221 * it's impolite. 222 * It can also be used as a hint to applications probably. */ 224 /* 225 * Make sure we don't bounce this data back to the host, it's impolite. It can also 226 * be used as a hint to applications probably. 227 */ 223 228 clip->AddBool("FromVirtualBoxHost", true); 224 225 229 if (commit) 226 230 be_clipboard->Commit(); … … 265 269 uint32_t cb = (RTUtf16Len(pwsz) + 1) * sizeof(RTUTF16); 266 270 267 rc = VbglR3ClipboardWriteData(fClientId, 268 VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, pwsz, cb); 271 rc = VbglR3ClipboardWriteData(fClientId, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, pwsz, cb); 269 272 //printf("VbglR3ClipboardWriteData: %d\n", rc); 270 271 273 RTUtf16Free(pwsz); 272 274 } … … 296 298 if (RT_SUCCESS(rc)) 297 299 { 298 rc = VbglR3ClipboardWriteData(fClientId, 299 VBOX_SHARED_CLIPBOARD_FMT_BITMAP, (void *)pDib,cbDibSize);300 rc = VbglR3ClipboardWriteData(fClientId, VBOX_SHARED_CLIPBOARD_FMT_BITMAP, (void *)pDib, 301 cbDibSize); 300 302 } 301 303 } … … 334 336 if (clip->FindData("text/plain", B_MIME_TYPE, &data, &dataLen) == B_OK) 335 337 formats |= VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 336 if (clip->HasMessage("image/bitmap") || clip->HasMessage("image/x-be-bitmap")) 338 339 if ( clip->HasMessage("image/bitmap") 340 || clip->HasMessage("image/x-be-bitmap")) 341 { 337 342 formats |= VBOX_SHARED_CLIPBOARD_FMT_BITMAP; 343 } 338 344 339 345 be_clipboard->Unlock(); … … 376 382 case VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS: 377 383 { 378 /* The host has announced available clipboard formats. 379 * Forward the information to the handler. */ 384 /* 385 * The host has announced available clipboard formats. Forward 386 * the information to the handler. 387 */ 380 388 LogRelFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS u32Formats=%x\n", u32Formats)); 381 389 BMessage msg(VBOX_GUEST_CLIPBOARD_HOST_MSG_FORMATS); -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxClipboard.h
r43364 r43406 56 56 virtual ~VBoxClipboardService(); 57 57 58 virtual status_t 59 virtual status_t 58 virtual status_t Connect(); 59 virtual status_t Disconnect(); 60 60 61 virtual voidMessageReceived(BMessage *message);61 virtual void MessageReceived(BMessage *message); 62 62 63 63 private: 64 static status_t _ServiceThreadNub(void *_this); 65 status_t _ServiceThread(); 64 66 65 static status_t _ServiceThreadNub(void *_this); 66 status_t _ServiceThread(); 67 void* _VBoxReadHostClipboard(uint32_t format, uint32_t *pcb); 67 68 68 void* _VBoxReadHostClipboard(uint32_t format, uint32_t *pcb); 69 70 uint32_t fClientId; 71 thread_id fServiceThreadID; 72 bool fExiting; 73 69 uint32_t fClientId; 70 thread_id fServiceThreadID; 71 bool fExiting; 74 72 }; 75 73 74 #endif /* __VBOXSERVICESHAREDCLIPLBOARD__H */ 76 75 77 #endif /* __VBOXSERVICESHAREDCLIPLBOARD__H */ -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxDisplay.cpp
r43364 r43406 63 63 #include <VBox/log.h> 64 64 65 #undef Log 66 #define Log(x) printf x 67 #undef LogRel 68 #define LogRel(x) printf x 69 #undef LogRelFlowFunc 70 #define LogRelFlowFunc(x) printf x 65 #ifdef DEBUG_ramshankar 66 # undef Log 67 # define Log(x) printf x 68 # undef LogRel 69 # define LogRel(x) printf x 70 # undef LogRelFlowFunc 71 # define LogRelFlowFunc(x) printf x 72 #endif 71 73 72 74 VBoxDisplayService::VBoxDisplayService() … … 88 90 { 89 91 status_t err; 90 err = fServiceThreadID = spawn_thread(_ServiceThreadNub, 91 "VBoxDisplayService", B_NORMAL_PRIORITY, this); 92 92 err = fServiceThreadID = spawn_thread(_ServiceThreadNub, "VBoxDisplayService", B_NORMAL_PRIORITY, this); 93 93 if (err >= B_OK) 94 94 resume_thread(fServiceThreadID); 95 95 else 96 96 LogRel(("VBoxDisplayService: Error starting service thread: %s\n", strerror(err))); 97 98 97 } 99 98 … … 117 116 status_t VBoxDisplayService::_ServiceThread() 118 117 { 119 printf("VBoxDisplayService::%s()\n", __FUNCTION__);118 LogFlow(("VBoxDisplayService::_ServiceThread")); 120 119 121 120 VbglR3CtlFilterMask(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0); 122 121 VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0); 123 124 122 for (;;) 125 123 { 126 124 uint32_t events; 127 128 125 int rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 5000, &events); 129 126 if (rc == -6) // timed out? … … 134 131 uint32_t cx, cy, cBits, iDisplay; 135 132 int rc2 = VbglR3GetDisplayChangeRequest(&cx, &cy, &cBits, &iDisplay, true); 136 printf("rc2=%d screen %d size changed (%d, %d, %d)\n", rc2, iDisplay, cx, cy, cBits);133 LogFlow(("rc2=%d screen %d size changed (%d, %d, %d)\n", rc2, iDisplay, cx, cy, cBits)); 137 134 138 135 if (RT_SUCCESS(rc2)) … … 141 138 fScreen.GetMode(&mode); 142 139 if (cBits == 0) 143 {144 140 cBits = get_depth_for_color_space(mode.space); 145 } 141 146 142 mode.timing.h_display = cx; 147 143 mode.timing.v_display = cy; 148 mode.space = get_color_space_for_depth(cBits);149 mode.virtual_width = cx;150 mode.virtual_height = cy;144 mode.space = get_color_space_for_depth(cBits); 145 mode.virtual_width = cx; 146 mode.virtual_height = cy; 151 147 152 148 /*= { … … 162 158 fExiting = true; 163 159 164 LogRelFlow(("processed host event rc = %d\n", rc)); 165 160 LogFlow(("processed host event rc = %d\n", rc)); 166 161 if (fExiting) 167 162 break; -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxDisplay.h
r43364 r43406 58 58 59 59 void Start(); 60 61 virtual void MessageReceived(BMessage *message); 60 virtual void MessageReceived(BMessage *message); 62 61 63 62 private: 64 65 63 static status_t _ServiceThreadNub(void *_this); 66 64 status_t _ServiceThread(); … … 72 70 }; 73 71 74 #endif /* __VBOX SERVICESHAREDCLIPLBOARD__H */72 #endif /* __VBOXDISPLAY__H */ 75 73
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器