Changeset 4085 in Sophya for trunk/SophyaPI/PI/Quartz/pigraphquartz.cpp
- Timestamp:
- Feb 8, 2013, 4:32:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Quartz/pigraphquartz.cpp
r4083 r4085 7 7 #include "sopnamsp.h" 8 8 #include "pigraphquartz.h" 9 #include "PIContainerQuartz.h" 10 #include "PIWindowQuartz.h" 11 //#include <HIToolbox/MacWindows.h> 12 9 13 10 14 /* Variables globales pour modifier les GC */ … … 20 24 int value; 21 25 22 hiViewRef = wdg->GetHIViewRef(); 26 WindowRef wParent = (static_cast <PIContainerQuartz*>(wdg->Parent()))->GetWindowRef(); 27 SetPortWindowPort(wParent); 28 // SetRect(&wdgRect,px,py,px+sx,py+sy); 29 WindowAttributes windowAttributes; 30 HIRect bounds; 31 32 bounds.origin.x = 50; 33 bounds.origin.y = 50; 34 bounds.size.width = 500; 35 bounds.size.height = 500; 36 37 windowAttributes = kWindowStandardDocumentAttributes | kWindowCompositingAttribute | kWindowStandardHandlerAttribute | kWindowLiveResizeAttribute; 38 /* 39 err = HIWindowCreate(kDrawerWindowClass, &windowAttributes, NULL, kHICoordSpaceScreenPixel, &bounds, &wParent); 40 41 */ 42 if (err) 43 printf ("PIWindowQuartz Create Err = %d \n",err); 44 45 /* CFStringRef cfsrLabel = CFStringCreateWithCString(kCFAllocatorDefault,nom,kCFStringEncodingMacRoman); 46 err = SetWindowTitleWithCFString (wRef, cfsrLabel); 47 48 wdgHIView = HIViewGetRoot(wRef); 49 HIViewGetBounds (wdgHIView, &bounds); 50 51 */ 52 53 54 55 56 57 hiViewRef = wdg->GetHIViewRef(); 23 58 24 59 value = HIViewGetValue (hiViewRef); … … 26 61 err = HIViewGetFrame (hiViewRef, &frame); 27 62 28 printf("PIGraphicQuartz::PIGraphicQuartz View Frame (%g %g) [%g %g] err : % d value : %d\n",63 printf("PIGraphicQuartz::PIGraphicQuartz View Frame (%g %g) [%g %g] err : %ld value : %d %d\n", 29 64 frame.origin.x, frame.origin.y, 30 65 frame.size.width, frame.size.height, 31 err, value); 32 66 err, value, hiViewRef); 67 68 if (value == 0) { 69 printf("\n********************\n"); 70 printf("PIGraphicQuartz::PIGraphicQuartz HIViewGetValue retourne une valeur nulle, fenetre non initialisee\n"); 71 printf("********************\n\n"); 72 } 33 73 cgWindow = HIViewGetWindow(hiViewRef); 34 74 cgContext = NULL ; … … 101 141 } 102 142 103 CGAffineTransform myTextTransform ;143 CGAffineTransform myTextTransform ; 104 144 CGContextSelectFont(cgContext, "Times-Bold", 10.0, kCGEncodingMacRoman); 105 145 CGContextSetCharacterSpacing (cgContext, 2); 106 146 CGContextSetTextDrawingMode (cgContext, kCGTextFill); 107 147 108 CGContextSetRGBFillColor (cgContext, 0, 1, 0, .5);// 6148 SelForeground(mFCol); // FIXME already done there ? 109 149 CGContextSetRGBStrokeColor (cgContext, 0, 0, 1, 1);// 110 150 myTextTransform = CGAffineTransformMakeRotation (0.);// 8 111 151 CGContextSetTextMatrix (cgContext, myTextTransform); 112 152 113 153 CGContextShowTextAtPoint (cgContext, xpos, ypos, s, strlen(s)); … … 121 161 void PIGraphicQuartz::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos) 122 162 { 163 printf("\n===========\n PIGraphicQuartz::DrawOpaqueString ne marche pas\n PIGraphicQuartz::DrawString est utilise la place\n==========\n"); 164 165 SelForeground(PI_Blue); 166 DrawString(x, y, "totototo", pos); 167 DrawString(x, y, s, pos); 168 return; 169 170 171 172 123 173 int dx, dy, xi, yi; 124 174 xi = x; yi = y; … … 939 989 cgAffineTransform.tx = cat.tx; 940 990 cgAffineTransform.ty = cat.ty; 941 printf("PIGraphicQuartz::SetCTM a:%d b:%d c:%d d:%d tx:% d ty:%d\n",cat.a,cat.b,cat.c,cat.d,cat.tx,cat.ty);991 printf("PIGraphicQuartz::SetCTM a:%d b:%d c:%d d:%d tx:%f ty:%f\n",cat.a,cat.b,cat.c,cat.d,cat.tx,cat.ty); 942 992 return; 943 993 } … … 947 997 void PIGraphicQuartz::SetGCRect(float x0, float y0, float dx, float dy) 948 998 { 949 printf("PIGraphicQuartz::SetGCRect %g %g %g %g CONTEXT:% lx\n", x0, y0, dx, dy,(unsigned) cgContext);999 printf("PIGraphicQuartz::SetGCRect %g %g %g %g CONTEXT:%d \n", x0, y0, dx, dy,(unsigned) cgContext); 950 1000 // CGAffineTransform cat; 951 1001 CGContextScaleCTM (cgContext, 1., 1.); … … 954 1004 return; 955 1005 } 1006
Note:
See TracChangeset
for help on using the changeset viewer.