Ticket #6126: fontdemoDebugMsg.patch
File fontdemoDebugMsg.patch, 3.8 KB (added by , 14 years ago) |
---|
-
src/apps/fontdemo/FontDemoView.cpp
290 290 { 291 291 if (msg->FindInt32("_mode", (int32 *)&fDrawingMode) == B_OK) { 292 292 Invalidate(/*&fBoxRegion*/); 293 switch (fDrawingMode) { 294 case B_OP_COPY: 295 printf("Drawing mode: B_OP_COPY\n"); 296 break; 297 case B_OP_OVER: 298 printf("Drawing mode: B_OP_OVER\n"); 299 break; 300 case B_OP_ERASE: 301 printf("Drawing mode: B_OP_ERASE\n"); 302 break; 303 case B_OP_INVERT: 304 printf("Drawing mode: B_OP_INVERT\n"); 305 break; 306 case B_OP_ADD: 307 printf("Drawing mode: B_OP_ADD\n"); 308 break; 309 case B_OP_SUBTRACT: 310 printf("Drawing mode: B_OP_SUBTRACT\n"); 311 break; 312 case B_OP_BLEND: 313 printf("Drawing mode: B_OP_BLEND\n"); 314 break; 315 case B_OP_MIN: 316 printf("Drawing mode: B_OP_MIN\n"); 317 break; 318 case B_OP_MAX: 319 printf("Drawing mode: B_OP_MAX\n"); 320 break; 321 case B_OP_SELECT: 322 printf("Drawing mode: B_OP_SELECT\n"); 323 break; 324 case B_OP_ALPHA: 325 printf("Drawing mode: B_OP_ALPHA\n"); 326 break; 327 default: 328 printf("Drawing mode: %d\n", fDrawingMode); 329 } 293 330 } 294 331 break; 295 332 } -
src/apps/fontdemo/ControlView.cpp
272 272 BMessage msg(ALIASING_MSG); 273 273 msg.AddBool("_aliased", static_cast<bool>(fAliasingCheckBox->Value())); 274 274 fMessenger->SendMessage(&msg); 275 if (static_cast<bool>(fAliasingCheckBox->Value()) == true) 276 printf("Aliasing: true\n"); 277 else 278 printf("Aliasing: false\n"); 275 279 break; 276 280 } 277 281 … … 280 284 BMessage msg(BOUNDING_BOX_MSG); 281 285 msg.AddBool("_boundingbox", static_cast<bool>(fBoundingboxesCheckBox->Value())); 282 286 fMessenger->SendMessage(&msg); 287 if (static_cast<bool>(fBoundingboxesCheckBox->Value())) 288 printf("Bounding: true\n"); 289 else 290 printf("Bounding: false\n"); 283 291 break; 284 292 } 285 293 … … 309 317 delete fMessageRunner; 310 318 fMessageRunner = new BMessageRunner(this, 311 319 new BMessage(CYCLING_FONTS_UPDATE_MSG), 360000*2, -1); 320 printf("Cycle fonts enabled\n"); 312 321 } else { 313 322 delete fMessageRunner; 314 323 fMessageRunner = NULL; 315 324 fFontStyleindex = 0; 316 325 // Delete our MessageRunner and reset the style index 326 printf("Cycle fonts disabled\n"); 317 327 } 318 328 break; 319 329 } … … 351 361 if (newFontFamilyItem && newstyleitem) { 352 362 if (msg->AddString("_style", newstyleitem->Label()) != B_OK 353 363 || msg->AddString("_family", newFontFamilyItem->Label()) != B_OK) { 354 printf("Failed to add _style or family to the message\n");364 printf("Failed to add style or family to the message\n"); 355 365 return; 356 366 } 357 367 printf("InstalledStyles(%ld), Font(%s), Style(%s)\n", … … 461 471 font_style style; 462 472 463 473 if (message->FindString("_family", (const char **)&family) == B_OK) { 464 printf("Family:%s\n\n", family); 474 char* _name; 475 type_code type_found = 0; 476 int32 countFound = 0; 477 status_t ret = B_OK; 465 478 479 ret = message->GetInfo(B_ANY_TYPE, 480 0, 481 &_name, 482 &type_found, 483 &countFound); 484 if (ret == B_OK) 485 if (type_found == B_STRING_TYPE) { 486 BString str; 487 status_t ok = B_OK; 488 ok = message->FindString(_name, 489 0, 490 &str); 491 if (ok == B_OK) 492 printf("Family: %s\n", str.String()); 493 } 466 494 BMenuItem* markedItem = fFontFamilyMenu->FindItem(family); 467 495 if (!markedItem) 468 496 return; … … 512 540 if (styleItem && !styleItem->IsMarked()) 513 541 styleItem->SetMarked(true); 514 542 } 543 printf("Family: %s, Style: %s\n", family, style); 515 544 } 516 545 517 546 BString string;