Ignore:
Timestamp:
Feb 8, 2013, 4:32:21 PM (13 years ago)
Author:
garnier
Message:

avancements sur PI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Quartz/pigraphquartz.cpp

    r4083 r4085  
    77#include "sopnamsp.h"
    88#include "pigraphquartz.h"
     9#include "PIContainerQuartz.h"
     10#include "PIWindowQuartz.h"
     11//#include <HIToolbox/MacWindows.h>
     12
    913
    1014/*  Variables globales pour modifier les GC  */
     
    2024        int value;
    2125                       
    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();
    2358       
    2459        value = HIViewGetValue (hiViewRef);
     
    2661        err = HIViewGetFrame (hiViewRef, &frame);
    2762       
    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",
    2964                                                                                        frame.origin.x, frame.origin.y,
    3065                                                                                        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    }
    3373        cgWindow =  HIViewGetWindow(hiViewRef);
    3474        cgContext = NULL ;     
     
    101141        }
    102142
    103     CGAffineTransform myTextTransform;
     143    CGAffineTransform myTextTransform ;
    104144        CGContextSelectFont(cgContext, "Times-Bold", 10.0, kCGEncodingMacRoman);
    105145        CGContextSetCharacterSpacing (cgContext, 2);
    106146        CGContextSetTextDrawingMode (cgContext, kCGTextFill);
    107147
    108     CGContextSetRGBFillColor (cgContext, 0, 1, 0, .5);// 6
     148    SelForeground(mFCol); // FIXME already done there ?
    109149    CGContextSetRGBStrokeColor (cgContext, 0, 0, 1, 1);//
    110150        myTextTransform =  CGAffineTransformMakeRotation  (0.);// 8
    111     CGContextSetTextMatrix (cgContext, myTextTransform);
     151   CGContextSetTextMatrix (cgContext, myTextTransform);
    112152
    113153        CGContextShowTextAtPoint (cgContext, xpos, ypos, s, strlen(s));
     
    121161void PIGraphicQuartz::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    122162{
     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   
    123173int dx, dy, xi, yi;
    124174xi = x;  yi = y;
     
    939989        cgAffineTransform.tx = cat.tx;
    940990        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);
    942992        return;
    943993}
     
    947997void PIGraphicQuartz::SetGCRect(float x0, float y0, float dx, float dy)
    948998{
    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);
    9501000//      CGAffineTransform cat;
    9511001        CGContextScaleCTM (cgContext, 1., 1.);
     
    9541004        return;
    9551005}
     1006
Note: See TracChangeset for help on using the changeset viewer.