Lines Matching refs:view

32 static void testNoOp(BView *view, BRect frame)
37 static void testDrawChar(BView *view, BRect frame)
39 view->MovePenTo(frame.left, frame.bottom - 5);
40 view->DrawChar('A');
42 view->DrawChar('B', BPoint(frame.left + 20, frame.bottom - 5));
45 static void testDrawString(BView *view, BRect frame)
48 view->GetFont(&font);
53 view->SetHighColor(kGreen);
54 view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
56 view->SetHighColor(kBlack);
57 view->DrawString("Haiku [������������]", BPoint(frame.left, baseline));
60 static void testDrawStringWithLength(BView *view, BRect frame)
63 view->GetFont(&font);
68 view->SetHighColor(kGreen);
69 view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
71 view->SetHighColor(kBlack);
72 view->DrawString("Haiku [������������]", 13, BPoint(frame.left, baseline));
76 static void testDrawStringWithOffsets(BView* view, BRect frame)
79 view->GetFont(&font);
84 view->SetHighColor(kGreen);
85 view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
87 view->SetHighColor(kBlack);
100 view->DrawString("Haiku", pointArray, sizeof(pointArray) / sizeof(pointArray[0]));
104 static void testDrawStringWithoutPosition(BView* view, BRect frame)
107 view->GetFont(&font);
112 view->SetHighColor(kGreen);
113 view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
115 view->SetHighColor(kBlack);
116 view->MovePenTo(BPoint(frame.left, baseline));
117 view->DrawString("H");
118 view->DrawString("a");
119 view->DrawString("i");
120 view->DrawString("k");
121 view->DrawString("u");
125 static void testFillArc(BView *view, BRect frame)
128 view->FillArc(frame, 45, 180);
131 static void testStrokeArc(BView *view, BRect frame)
134 view->StrokeArc(frame, 45, 180);
137 static void testFillBezier(BView *view, BRect frame)
145 view->FillBezier(points);
148 static void testStrokeBezier(BView *view, BRect frame)
156 view->StrokeBezier(points);
159 static void testFillEllipse(BView *view, BRect frame)
162 view->FillEllipse(frame);
164 view->SetHighColor(kRed);
167 view->FillEllipse(centerPoint(frame), r, s);
170 static void testStrokeEllipse(BView *view, BRect frame)
173 view->StrokeEllipse(frame);
175 view->SetHighColor(kRed);
178 view->StrokeEllipse(centerPoint(frame), r, s);
181 static void testFillPolygon(BView *view, BRect frame)
191 view->FillPolygon(points, 4);
194 static void testStrokePolygon(BView *view, BRect frame)
204 view->StrokePolygon(points, 4);
207 static void testFillRect(BView *view, BRect frame)
210 view->FillRect(frame);
213 static void testFillRectGradientLinear(BView* view, BRect frame)
219 view->FillRect(frame, gradient);
222 static void testFillRectGradientRadial(BView* view, BRect frame)
228 view->FillRect(frame, gradient);
231 static void testFillRectGradientRadialFocus(BView* view, BRect frame)
237 view->FillRect(frame, gradient);
240 static void testFillRectGradientDiamond(BView* view, BRect frame)
246 view->FillRect(frame, gradient);
249 static void testFillRectGradientConic(BView* view, BRect frame)
255 view->FillRect(frame, gradient);
258 static void testStrokeRect(BView *view, BRect frame)
261 view->StrokeRect(frame);
264 static void testFillRegion(BView *view, BRect frame)
270 view->FillRegion(&region);
273 static void testFillRegionGradientLinear(BView* view, BRect frame)
282 view->FillRegion(&region, gradient);
285 static void testFillRegionGradientRadial(BView* view, BRect frame)
294 view->FillRegion(&region, gradient);
297 static void testFillRegionGradientRadialFocus(BView* view, BRect frame)
306 view->FillRegion(&region, gradient);
309 static void testFillRegionGradientDiamond(BView* view, BRect frame)
318 view->FillRegion(&region, gradient);
321 static void testFillRegionGradientConic(BView* view, BRect frame)
330 view->FillRegion(&region, gradient);
333 static void testFillRoundRect(BView *view, BRect frame)
336 view->FillRoundRect(frame, 5, 3);
339 static void testFillRoundRectGradientLinear(BView* view, BRect frame)
345 view->FillRoundRect(frame, 5, 3, gradient);
348 static void testFillRoundRectGradientRadial(BView* view, BRect frame)
354 view->FillRoundRect(frame, 5, 3, gradient);
357 static void testFillRoundRectGradientRadialFocus(BView* view, BRect frame)
362 view->FillRoundRect(frame, 5, 3, gradient);
365 static void testFillRoundRectGradientDiamond(BView* view, BRect frame)
371 view->FillRoundRect(frame, 5, 3, gradient);
374 static void testFillRoundRectGradientConic(BView* view, BRect frame)
380 view->FillRoundRect(frame, 5, 3, gradient);
383 static void testStrokeRoundRect(BView *view, BRect frame)
386 view->StrokeRoundRect(frame, 5, 3);
389 static void testFillTriangle(BView *view, BRect frame)
396 view->FillTriangle(points[0], points[1], points[2]);
399 static void testFillTriangleGradientLinear(BView* view, BRect frame)
409 view->FillTriangle(points[0], points[1], points[2], gradient);
412 static void testFillTriangleGradientRadial(BView* view, BRect frame)
422 view->FillTriangle(points[0], points[1], points[2], gradient);
425 static void testFillTriangleGradientRadialFocus(BView* view, BRect frame)
435 view->FillTriangle(points[0], points[1], points[2], gradient);
438 static void testFillTriangleGradientDiamond(BView* view, BRect frame)
448 view->FillTriangle(points[0], points[1], points[2], gradient);
451 static void testFillTriangleGradientConic(BView* view, BRect frame)
461 view->FillTriangle(points[0], points[1], points[2], gradient);
464 static void testStrokeTriangle(BView *view, BRect frame)
471 view->StrokeTriangle(points[0], points[1], points[2]);
474 static void testStrokeLine(BView *view, BRect frame)
477 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
481 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.bottom));
485 view->StrokeLine(BPoint(frame.right, frame.top), BPoint(frame.left, frame.top));
488 static void testFillShape(BView *view, BRect frame)
496 view->FillShape(&shape);
499 static void testStrokeShape(BView *view, BRect frame)
507 view->StrokeShape(&shape);
510 static void testRecordPicture(BView *view, BRect frame)
513 view->BeginPicture(picture);
514 view->FillRect(frame);
515 view->EndPicture();
519 static void testRecordAndPlayPicture(BView *view, BRect frame)
522 view->BeginPicture(picture);
524 view->FillRect(frame);
525 view->EndPicture();
526 view->DrawPicture(picture);
530 static void testRecordAndPlayPictureWithOffset(BView *view, BRect frame)
533 view->BeginPicture(picture);
536 view->FillRect(frame);
537 view->EndPicture();
539 view->DrawPicture(picture, BPoint(10, 10));
541 view->SetLowColor(kGreen);
542 view->SetLowColor(kRed);
543 view->DrawPicture(picture, BPoint(0, 0));
547 static void testAppendToPicture(BView *view, BRect frame)
550 view->BeginPicture(new BPicture());
551 view->FillRect(frame);
552 BPicture* picture = view->EndPicture();
557 view->AppendToPicture(picture);
558 view->SetHighColor(kRed);
559 view->FillRect(frame);
560 if (view->EndPicture() != picture)
563 view->DrawPicture(picture);
567 static void testDrawScaledPicture(BView* view, BRect frame)
569 view->BeginPicture(new BPicture());
570 view->FillRect(BRect(0, 0, 15, 15));
571 BPicture* picture = view->EndPicture();
574 view->DrawPicture(picture, BPoint(2, 2));
577 view->SetScale(0.5);
579 view->DrawPicture(picture, BPoint(frame.Width(), 4));
584 static void testLineArray(BView *view, BRect frame)
587 view->BeginLineArray(3);
588 view->AddLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top), kBlack);
592 view->AddLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.bottom), kRed);
596 view->AddLine(BPoint(frame.right, frame.top), BPoint(frame.left, frame.top), kGreen);
598 view->EndLineArray();
601 static void testInvertRect(BView *view, BRect frame)
604 view->InvertRect(frame);
607 static void testInvertRectSetDrawingMode(BView *view, BRect frame)
609 view->SetDrawingMode(B_OP_ALPHA);
610 view->SetHighColor(128, 128, 128, 128);
612 view->InvertRect(frame);
614 view->FillRect(frame, B_SOLID_HIGH);
645 static void testDrawBitmap(BView *view, BRect frame) {
648 view->DrawBitmap(&bitmap, BPoint(0, 0));
651 static void testDrawBitmapAtPoint(BView *view, BRect frame) {
661 view->DrawBitmap(&bitmap, centerPoint(frame));
664 static void testDrawBitmapAtRect(BView *view, BRect frame) {
669 view->DrawBitmap(&bitmap, frame);
672 static void testDrawLargeBitmap(BView *view, BRect frame) {
680 view->DrawBitmap(&bitmap, frame);
683 static void testConstrainClippingRegion(BView *view, BRect frame)
687 view->SetHighColor(kRed);
688 view->FillRect(frame);
695 view->ConstrainClippingRegion(&region);
698 view->SetHighColor(kBlack);
699 view->FillRect(frame);
704 static void testClipToPicture(BView *view, BRect frame)
707 view->BeginPicture(new BPicture());
708 view->FillEllipse(frame);
709 BPicture *picture = view->EndPicture();
713 view->ClipToPicture(picture);
716 view->FillRect(frame);
720 static void testClipToInversePicture(BView *view, BRect frame)
724 view->BeginPicture(new BPicture());
725 view->FillEllipse(frame);
726 BPicture *picture = view->EndPicture();
730 view->ClipToInversePicture(picture);
733 view->FillRect(frame);
737 static void testSetPenSize(BView *view, BRect frame)
742 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
745 view->SetPenSize(1);
746 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
747 view->SetPenSize(0);
748 view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
751 view->SetPenSize(1);
752 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
753 view->SetPenSize(2);
754 view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
757 view->SetPenSize(1);
758 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
759 view->SetPenSize(3);
760 view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
763 view->SetPenSize(1);
764 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
765 view->SetPenSize(4);
766 view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
769 static void testSetPenSize2(BView *view, BRect frame)
774 view->SetPenSize(4);
775 view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
776 view->SetScale(0.5);
777 view->StrokeLine(BPoint(frame.left + 2, frame.bottom), BPoint(frame.right + 2, frame.bottom));
784 static void testPattern(BView *view, BRect frame)
792 view->SetLowColor(kGreen);
793 view->SetHighColor(kRed);
795 view->FillRect(frame, B_SOLID_HIGH);
798 view->FillRect(frame, B_MIXED_COLORS);
801 view->FillRect(frame, B_SOLID_LOW);
804 static void testSetOrigin(BView *view, BRect frame)
806 BPoint origin = view->Origin();
808 view->SetOrigin(center);
811 view->SetHighColor(kBlue);
812 view->FillRect(r);
814 view->SetOrigin(origin);
815 view->SetHighColor(kRed);
816 view->FillRect(r);
824 static void testSetOrigin2(BView *view, BRect frame)
828 view->SetOrigin(center);
829 view->PushState();
830 view->SetOrigin(BPoint(-center.x, 0));
831 view->FillRect(r);
832 view->PopState();
836 static void testSetScale(BView *view, BRect frame)
838 view->SetScale(0.5);
839 view->FillRect(frame);
843 static void testSetScale2(BView *view, BRect frame)
845 view->SetScale(0.5);
846 view->PushState();
847 view->SetScale(0.5);
848 view->FillRect(frame);
849 view->PopState();
855 static void testSetScale3(BView *view, BRect frame)
857 view->SetScale(0.5);
858 view->PushState();
862 view->SetScale(0.5000001);
863 view->FillRect(frame);
864 view->PopState();
870 static void testSetOriginAndScale(BView *view, BRect frame)
876 view->SetOrigin(center);
877 view->FillRect(r);
879 view->SetScale(0.5);
880 view->SetHighColor(kRed);
881 view->FillRect(r);
884 static void testSetOriginAndScale2(BView *view, BRect frame)
890 view->SetOrigin(center);
891 view->FillRect(r);
893 view->SetScale(0.5);
894 view->SetHighColor(kRed);
895 view->FillRect(r);
897 view->SetOrigin(0, 0);
898 view->SetHighColor(kGreen);
899 view->FillRect(r);
902 static void testSetOriginAndScale3(BView *view, BRect frame)
908 view->SetOrigin(center);
909 view->FillRect(r);
911 view->SetScale(0.5);
912 view->SetHighColor(kRed);
913 view->FillRect(r);
915 view->SetScale(0.25);
916 view->SetHighColor(kGreen);
917 view->FillRect(r);
920 static void testSetOriginAndScale4(BView *view, BRect frame)
926 view->SetOrigin(center);
927 view->FillRect(r);
929 view->SetScale(0.5);
930 view->SetHighColor(kRed);
931 view->FillRect(r);
933 view->PushState();
935 view->SetOrigin(center.x+1, center.y);
942 view->SetHighColor(kGreen);
943 view->FillRect(r);
944 view->PopState();
947 static void testSetOriginAndScale5(BView *view, BRect frame)
953 view->SetOrigin(center);
954 view->FillRect(r);
956 view->SetScale(0.5);
957 view->SetHighColor(kRed);
958 view->FillRect(r);
960 view->PushState();
961 view->SetScale(0.75);
962 view->SetHighColor(kGreen);
963 view->FillRect(r);
964 view->PopState();
967 static void testSetFontSize(BView *view, BRect frame)
973 view->MovePenTo(BPoint(frame.left, frame.top));
974 view->SetFontSize(size);
975 view->DrawString("Haiku");
979 view->MovePenTo(BPoint(frame.left, frame.top));
980 view->SetFontSize(size);
981 view->DrawString("Haiku");
984 static void testSetFontFamilyAndStyle(BView *view, BRect frame)
986 view->DrawString("This is a test", BPoint(2, 6));
989 view->GetFont(&font);
999 view->SetFont(&font);
1000 view->DrawString( "This is a test", BPoint(2, 19));
1003 static void testSetDrawingMode(BView *view, BRect frame)
1006 view->StrokeLine(frame.LeftTop(), frame.RightBottom());
1007 view->StrokeLine(frame.LeftBottom(), frame.RightTop());
1008 view->SetDrawingMode(B_OP_ALPHA);
1011 view->SetHighColor(color);
1012 view->FillRect(frame, B_SOLID_HIGH);
1015 static void testPushPopState(BView *view, BRect frame)
1018 view->SetHighColor(kGreen);
1019 view->PushState();
1020 view->SetHighColor(kRed);
1021 view->PopState();
1023 view->FillRect(frame, B_SOLID_HIGH);
1026 static void testFontRotation(BView* view, BRect frame)
1029 view->GetFont(&font);
1032 view->SetFont(&font, B_FONT_ROTATION);
1033 view->DrawString("This is a test!", BPoint(frame.Width() / 2, frame.bottom - 3));
1035 view->GetFont(&font);
1041 static void testClipToRect(BView* view, BRect frame)
1046 view->ClipToRect(clipped);
1048 view->FillRect(frame);
1052 static void testClipToInverseRect(BView* view, BRect frame)
1057 view->ClipToInverseRect(clipped);
1059 view->FillRect(frame);
1063 static void testClipToShape(BView* view, BRect frame)
1071 view->ClipToShape(&shape);
1073 view->FillRect(frame);
1077 static void testClipToInverseShape(BView* view, BRect frame)
1085 view->ClipToInverseShape(&shape);
1087 view->FillRect(frame);