Changeset 4086 in Sophya
- Timestamp:
- May 29, 2013, 3:12:57 PM (11 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Quartz/QuartzAppTest.cpp
r4085 r4086 124 124 vector<int> points; 125 125 126 printf("main debut \n");126 printf("main debut---\n"); 127 127 128 128 mainApp = new QuartzApp(); -
trunk/SophyaPI/PI/Quartz/Test/Quartz2DBasics/Quartz2DBasics.carbon/Info.plist
r4084 r4086 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 3 <plist version="1.0"> 4 4 <dict> -
trunk/SophyaPI/PI/Quartz/Test/Quartz2DBasics/Quartz2DBasics.cocoa/Quartz2DBasics.cocoa.xcodeproj/project.pbxproj
r4084 r4086 4 4 classes = { 5 5 }; 6 objectVersion = 4 2;6 objectVersion = 46; 7 7 objects = { 8 8 … … 17 17 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 18 18 /* End PBXBuildFile section */ 19 20 /* Begin PBXBuildStyle section */21 2D00B68C0A4856F8006A99DB /* Development */ = {22 isa = PBXBuildStyle;23 buildSettings = {24 COPY_PHASE_STRIP = NO;25 };26 name = Development;27 };28 2D00B68D0A4856F8006A99DB /* Deployment */ = {29 isa = PBXBuildStyle;30 buildSettings = {31 COPY_PHASE_STRIP = YES;32 };33 name = Deployment;34 };35 /* End PBXBuildStyle section */36 19 37 20 /* Begin PBXFileReference section */ … … 162 145 29B97313FDCFA39411CA2CEA /* Project object */ = { 163 146 isa = PBXProject; 147 attributes = { 148 LastUpgradeCheck = 0460; 149 }; 164 150 buildConfigurationList = 2D4F4E8A08E0C8B9002C8F59 /* Build configuration list for PBXProject "Quartz2DBasics.cocoa" */; 165 buildSettings = { 166 }; 167 buildStyles = ( 168 2D00B68C0A4856F8006A99DB /* Development */, 169 2D00B68D0A4856F8006A99DB /* Deployment */, 170 ); 151 compatibilityVersion = "Xcode 3.2"; 152 developmentRegion = English; 171 153 hasScannedForEncodings = 1; 154 knownRegions = ( 155 en, 156 ); 172 157 mainGroup = 29B97314FDCFA39411CA2CEA /* BasicDrawing.cocoa */; 173 158 projectDirPath = ""; 159 projectRoot = ""; 174 160 targets = ( 175 161 8D1107260486CEB800E47090 /* Quartz2DBasics.Cocoa */, … … 228 214 isa = XCBuildConfiguration; 229 215 buildSettings = { 216 COMBINE_HIDPI_IMAGES = YES; 230 217 COPY_PHASE_STRIP = NO; 231 218 GCC_DYNAMIC_NO_PIC = NO; 232 GCC_ENABLE_FIX_AND_CONTINUE = YES;233 219 GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 234 220 GCC_OPTIMIZATION_LEVEL = 0; … … 237 223 INFOPLIST_FILE = Info.plist; 238 224 INSTALL_PATH = "$(HOME)/Applications"; 239 MACOSX_DEPLOYMENT_TARGET = 10.4; 240 PREBINDING = NO; 225 MACOSX_DEPLOYMENT_TARGET = 10.8; 241 226 PRODUCT_NAME = Quartz2DBasics.Cocoa; 242 227 WRAPPER_EXTENSION = app; … … 248 233 isa = XCBuildConfiguration; 249 234 buildSettings = { 250 ARCHS = ( 251 ppc, 252 i386, 253 ); 235 ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 236 COMBINE_HIDPI_IMAGES = YES; 254 237 COPY_PHASE_STRIP = YES; 255 GCC_ENABLE_FIX_AND_CONTINUE = NO;256 238 GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 257 239 GCC_PRECOMPILE_PREFIX_HEADER = YES; … … 259 241 INFOPLIST_FILE = Info.plist; 260 242 INSTALL_PATH = "$(HOME)/Applications"; 261 MACOSX_DEPLOYMENT_TARGET = 10.4; 262 PREBINDING = NO; 243 MACOSX_DEPLOYMENT_TARGET = 10.8; 263 244 PRODUCT_NAME = Quartz2DBasics.Cocoa; 264 245 WRAPPER_EXTENSION = app; … … 270 251 isa = XCBuildConfiguration; 271 252 buildSettings = { 253 COMBINE_HIDPI_IMAGES = YES; 272 254 GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 273 255 GCC_PRECOMPILE_PREFIX_HEADER = YES; … … 275 257 INFOPLIST_FILE = Info.plist; 276 258 INSTALL_PATH = "$(HOME)/Applications"; 277 MACOSX_DEPLOYMENT_TARGET = 10.4; 278 PREBINDING = NO; 259 MACOSX_DEPLOYMENT_TARGET = 10.8; 279 260 PRODUCT_NAME = Quartz2DBasics.Cocoa; 280 261 WRAPPER_EXTENSION = app; … … 286 267 isa = XCBuildConfiguration; 287 268 buildSettings = { 288 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;269 SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 289 270 }; 290 271 name = Development; … … 293 274 isa = XCBuildConfiguration; 294 275 buildSettings = { 295 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;276 SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 296 277 }; 297 278 name = Deployment; … … 300 281 isa = XCBuildConfiguration; 301 282 buildSettings = { 302 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;283 SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 303 284 }; 304 285 name = Default; -
trunk/SophyaPI/PI/Quartz/pibwdgquartz.cpp
r4085 r4086 19 19 HIViewRef rootView; 20 20 HIViewRef contentView; 21 OSStatus err ;21 OSStatus err = 0; 22 22 fName = nom; 23 23 … … 25 25 err = HIViewGetBounds (rootView, &localHIRect); 26 26 27 err = HIScrollViewCreate(kHIScrollViewOptionsVertScroll | kHIScrollViewOptionsHorizScroll, &wdgHIView);27 err += HIScrollViewCreate(kHIScrollViewOptionsVertScroll | kHIScrollViewOptionsHorizScroll, &wdgHIView); 28 28 err += HIViewSetVisible (wdgHIView, true); 29 29 … … 38 38 localHIRect.size.height = (float)sy; 39 39 40 err = HIViewSetFrame (wdgHIView, &localHIRect);40 err += HIViewSetFrame (wdgHIView, &localHIRect); 41 41 42 42 err += HIViewGetFrame (wdgHIView, &localHIRect); … … 47 47 err,nom); 48 48 49 err = InstallEventHandler (GetControlEventTarget (wdgHIView), 49 /* 50 err = InstallEventHandler (GetControlEventTarget (wdgHIView), 50 51 NewEventHandlerUPP (BaseWdgQuartzEventHandler), 51 52 GetEventTypeCount (basewdgSpec), … … 53 54 (void *) this, 54 55 NULL); 55 56 HIViewRender(wdgHIView); 56 */ 57 printf("PIBaseWdgQuartz::PIBaseWdgQuartz HIView %d \n",contentView); 58 err += HIViewInstallEventHandler (contentView, 59 NewEventHandlerUPP (BaseWdgQuartzEventHandler), 60 GetEventTypeCount (basewdgSpec), 61 (const EventTypeSpec*)&basewdgSpec, 62 (void *) contentView, 63 NULL); 64 65 HIViewRender(contentView); 57 66 mWGrC = new PIGraphicWin(this); 58 67 } … … 119 128 { 120 129 // return; 121 printf("---->> PIBaseWdgQuartz::Refresh -%s- context:%lx\n",fName,mWGrC->GetCGContext()); 130 131 printf("---->> PIBaseWdgQuartz::Refresh -%s- context:%lx\n",fName,mWGrC->GetCGContext()); 122 132 EventRef rEvent; 123 133 OSStatus err; … … 133 143 134 144 printf(" cg : %lx ox : %g oy : %g width : %g height : %g \n", 135 mWGrC->GetCGContext(), hiRect.origin.x, hiRect.origin.y, hiRect.size.width, hiRect.size.height); 145 146 mWGrC->GetCGContext(), hiRect.origin.x, hiRect.origin.y, hiRect.size.width, hiRect.size.height); 136 147 // mWGrC->SetGCRect(hiRect.origin.x, hiRect.origin.y, hiRect.size.width, hiRect.size.height); 137 148 // Draw(mWGrC, 0, 0, XSize(), YSize()); 138 149 150 151 if(wdgHIView){ 152 HIViewSetNeedsDisplay(wdgHIView, true); 153 printf("---->> PIBaseWdgQuartz::Refresh -%s- \n",fName); 154 } 155 139 156 return; 140 157 } … … 144 161 { 145 162 printf("PIBaseWdgQuartz::ExposeProcess -%s- to x:%d y:%d dx:%d dy:%d\n",fName,x0,y0,dx,dy); 146 if (mWGrC->GetCGContext() == NULL) { 147 mWGrC->SetCGContext(cg); 148 printf("PIBaseWdgQuartz::ExposeProcess CHANGE context to %lx\n",cg); 149 mWGrC->SetCTM(CGContextGetCTM(cg)); 150 } 151 printf("PIBaseWdgQuartz::ExposeProcess set CTM to %lx\n",cg); 152 CGContextSaveGState(mWGrC->GetCGContext()); 163 if (1 == 1) { 164 165 if (mWGrC->GetCGContext() == NULL) { 166 mWGrC->SetCGContext(cg); 167 printf("PIBaseWdgQuartz::ExposeProcess CHANGE context to %lx\n",cg); 168 mWGrC->SetCTM(CGContextGetCTM(cg)); 169 } else { 170 171 // Flip the coordinates by translating and scaling. This produces a 172 // coordinate system that matches the Quartz default coordinate system 173 // with the origin in the lower-left corner with the y axis pointing up. 174 HIRect bounds; 175 HIViewGetBounds ((HIViewRef) wdgHIView, &bounds); 176 177 // CGContextTranslateCTM(cg, 0, bounds.size.height); 178 // CGContextScaleCTM(cg, 1.0, -1.0) 179 } 180 } 181 182 printf("PIBaseWdgQuartz::ExposeProcess set CTM to %lx\n",cg); 183 CGContextSaveGState(cg); 153 184 Draw(mWGrC, x0, y0, dx, dy); 154 185 // CGContextRestoreGState (cg); 155 CGContextRestoreGState ( mWGrC->GetCGContext());186 CGContextRestoreGState (cg); 156 187 157 188 return; … … 169 200 PIGetEventName(event); 170 201 171 PIBaseWdgQuartz* wdg = (PIBaseWdgQuartz*) userData;172 printf("\n BaseWdgQuartzEventHandler -%s- (%d) : ", wdg->fName,counterDraw);202 // PIBaseWdgQuartz* wdg = (PIBaseWdgQuartz*) userData; 203 printf("\n BaseWdgQuartzEventHandler (%d) : ",counterDraw); 173 204 printf("\n"); 174 205 … … 176 207 WindowRef window; 177 208 Rect bounds; 178 if (! wdg)209 if (!userData) 179 210 return status; 180 211 181 status = GetEventParameter (event, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof (CGContextRef), NULL, &cg); 182 212 status = GetEventParameter (event, kEventParamCGContextRef, 213 typeCGContextRef, NULL, 214 sizeof (CGContextRef), 215 NULL, 216 &cg); 217 218 printf("BaseWdgQuartzEventHandler GET EVENT CLASS:%lx KIND %d status:%d\n",(long)GetEventClass(event),(int)GetEventKind(event), status); 219 220 /* copy form .h file 221 222 static const EventTypeSpec basewdgSpec[] = { 223 { kEventClassWindow, kEventWindowResizeCompleted}, 224 { kEventClassWindow, kEventWindowDrawContent}, 225 { kEventClassHIObject, kEventHIObjectConstruct }, 226 { kEventClassHIObject, kEventHIObjectInitialize }, 227 { kEventClassHIObject, kEventHIObjectDestruct }, 228 { kEventClassControl, kEventControlClick}, 229 { kEventClassControl, kEventControlBoundsChanged}, 230 { kEventClassControl, kEventControlOwningWindowChanged }, 231 { kEventClassControl, kEventControlInitialize }, 232 { kEventClassControl, kEventControlGetPartRegion }, 233 { kEventClassControl, kEventControlHitTest } 234 }; 235 */ 183 236 switch(GetEventClass(event)) 184 237 { … … 193 246 break; 194 247 195 */ case kEventClassWindow: { 248 */ 249 case kEventClassWindow: { 196 250 197 251 switch (GetEventKind(event)) … … 201 255 GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &bounds ); 202 256 203 // wdg->adaptResize(bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top);204 // wdg->requestRedraw();257 // wdg->adaptResize(bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top); 258 // wdg->requestRedraw(); 205 259 status = noErr; 206 260 break; … … 209 263 InvalWindowRect(window, GetWindowPortBounds(window, &bounds)); 210 264 GetWindowBounds(window, kWindowContentRgn, &bounds); 211 // wdg->adaptResize(bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top);265 // wdg->adaptResize(bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top); 212 266 status = noErr; 213 267 break; … … 218 272 break; 219 273 220 default: 274 default: 275 HIViewRef view = (HIViewRef) userData; 276 HIRect hiRect; 277 HIViewGetFrame(view, &hiRect); 278 // Pour le moment on rafraichit toute la vue 279 int ox = (int)(hiRect.origin.x); 280 int oy = (int)(hiRect.origin.x); 281 int dx = (int)(hiRect.size.width); 282 int dy = (int)(hiRect.size.height); 283 /// wdg->eXposeProcess(cg, 0 , 0, dx, dy); 221 284 break; 222 285 } … … 224 287 } 225 288 case kEventClassControl : { 226 case kEventControlDraw: { 227 // wdg->SetQuartzCGContext(cg); 228 HIViewRef view = wdg->GetHIViewRef(); 229 HIRect hiRect; 230 HIViewGetFrame(view, &hiRect); 231 // Pour le moment on rafraichit toute la vue 232 int ox = (int)(hiRect.origin.x); 233 int oy = (int)(hiRect.origin.x); 234 int dx = (int)(hiRect.size.width); 235 int dy = (int)(hiRect.size.height); 236 printf("-->> PIbWdgquartz::BaseWdgQuartzEventHandler -%s- cg : %lx [%d %d] Frame [%d, %d] \n", wdg->fName,(unsigned long)cg, ox, oy, dx, dy); 237 238 HIRect bounds; 239 HIViewGetBounds ((HIViewRef) userData, &bounds); 240 printf("-->> PIbWdgquartz::BaseWdgQuartzEventHandler BOUNDS [%f %f] SIZE [%f, %f] \n",hiRect.origin.x,hiRect.origin.y,hiRect.size.width,hiRect.size.height); 241 // err = HIViewSetFrame (wdgHIView, &localHIRect); 242 243 wdg->eXposeProcess(cg, 0 , 0, dx, dy); 244 } 289 switch (GetEventKind(event)) 290 { 291 case kEventControlDraw: { 292 // wdg->SetQuartzCGContext(cg); 293 HIViewRef view = (HIViewRef) userData; 294 HIRect hiRect; 295 HIViewGetFrame(view, &hiRect); 296 // Pour le moment on rafraichit toute la vue 297 int ox = (int)(hiRect.origin.x); 298 int oy = (int)(hiRect.origin.x); 299 int dx = (int)(hiRect.size.width); 300 int dy = (int)(hiRect.size.height); 301 printf("-->> PIbWdgquartz::BaseWdgQuartzEventHandler cg : %lx [%d %d] Frame [%d, %d] \n", (unsigned long)cg, ox, oy, dx, dy); 302 303 HIRect bounds; 304 HIViewGetBounds ((HIViewRef) userData, &bounds); 305 printf("-->> PIbWdgquartz::BaseWdgQuartzEventHandler BOUNDS [%f %f] SIZE [%f, %f] \n",hiRect.origin.x,hiRect.origin.y,hiRect.size.width,hiRect.size.height); 306 // err = HIViewSetFrame (wdgHIView, &localHIRect); 307 308 /// wdg->eXposeProcess(cg, 0 , 0, dx, dy); 309 } 310 default: { 311 printf("unknown: %g\n",GetEventClass(event)); 312 break; 313 } 314 break; 315 } 245 316 break; 246 } 247 break; 317 } 248 318 default: 249 319 printf("unknown: %g\n",GetEventClass(event)); 250 320 break; 251 }321 } 252 322 253 323 ///// -
trunk/SophyaPI/PI/Quartz/pibwdgquartz.h
r4081 r4086 16 16 #include "pigraphps.h" 17 17 18 /* 18 19 19 static const EventTypeSpec basewdgSpec[] = { 20 20 { kEventClassWindow, kEventWindowClose}, … … 22 22 { kEventClassWindow, kEventWindowDrawContent}, 23 23 { kEventClassWindow, kEventWindowBoundsChanged }, 24 { kEventClassWindow, kEventWindowBoundsChanging }, 24 25 { kEventClassHIObject, kEventHIObjectConstruct }, 25 26 { kEventClassHIObject, kEventHIObjectInitialize }, … … 34 35 }; 35 36 37 38 39 /* 40 static const EventTypeSpec basewdgSpec[] = {{ kEventClassControl, kEventControlDraw},{kEventWindowBoundsChanged,kEventWindowResizeCompleted}}; 36 41 */ 37 38 static const EventTypeSpec basewdgSpec[] = {{ kEventClassControl, kEventControlDraw},{kEventWindowBoundsChanged,kEventWindowResizeCompleted}};39 40 42 41 43 class PIBaseWdgQuartz : public PIBaseWdgGen -
trunk/SophyaPI/PI/piapplx.cc
r4083 r4086 127 127 msy+=5; 128 128 topwdg->SetSize(sx, sy+msy); 129 //DBGprintf("PIApplicationX-DBG:: Size=%d %d \n", topwdg->XSize(), topwdg->YSize());129 printf("PIApplicationX-DBG:: Size=%d %d \n", topwdg->XSize(), topwdg->YSize()); 130 130 131 131 intcont = new PIContainerX((PIMsgHandler *)this, topwdg, "MBCont", -
trunk/SophyaPI/PI/pibwdggen.cc
r2780 r4086 612 612 { 613 613 if (mDrwList.size() < 1) return -1; 614 double xmin,ymin, xmax, ymax;614 // double xmin,ymin, xmax, ymax; 615 615 int drx0, dry0, drdx, drdy; 616 616 int ddrx0, ddry0, ddrdx, ddrdy; -
trunk/SophyaPI/PI/picons.cc
r2676 r4086 107 107 PIBaseWdg(par, nom, ((scb)?sx-Scb_Width:sx), sy, px, py) 108 108 { 109 mNL = (nl > 10) ? nl : 10; 109 printf("PIConsole::PIConsole sizeX:%d sizeY:%d\n",XSize(), YSize()); 110 mNL = (nl > 10) ? nl : 10; 110 111 mNC = (nc > 30) ? nc : 30; 111 112 mText = new char[mNL*mNC]; … … 146 147 SelectFont(); 147 148 SelFgBgCol(); 148 mCurL = mNL-mWSzL-1; 149 //mCurL = mNL-mWSzL-1; 150 mCurL = 0; 149 151 mCurC = 0; 150 152 … … 274 276 void PIConsole::SelectFont(PIFontSize sz) 275 277 { 276 int asc, desc; 278 printf("+++PIConsole::SelectFont %d %d\n",XSize(),YSize()); 279 int asc, desc; 277 280 mWGrC->SelFont(sz); 278 281 mFTaille = sz; -
trunk/SophyaPI/PI/pidrwtools.cc
r3475 r4086 821 821 void PIDrwOptionStringWindow::Process(PIMessage msg, PIMsgHandler* sender, void* data) 822 822 { 823 PIMessage mod = ModMsg(msg);823 // PIMessage mod = ModMsg(msg); 824 824 msg = UserMsg(msg); 825 825 switch (msg) { … … 1455 1455 int aid = mBWdg->GetActiveDrawerId(); 1456 1456 PIDrawer* actdrw = mBWdg->GetActiveDrawer(); 1457 PIMessage mod = ModMsg(msg);1457 // PIMessage mod = ModMsg(msg); 1458 1458 msg = UserMsg(msg); 1459 1459 switch (msg) { -
trunk/SophyaPI/PI/pigraphps.cc
r4083 r4086 389 389 390 390 391 static int fntsz[5] = {8,10,12,14,16};391 //static int fntsz[5] = {8,10,12,14,16}; 392 392 393 393 /* --Methode-- */ -
trunk/SophyaPI/PI/psfile.cc
r4083 r4086 899 899 int nce = 0; 900 900 int ls = strlen(s); 901 int i,j,k;901 int j; 902 902 for(int k=0; k<ls; k++) 903 903 if ( (s[k] == '(') || (s[k] == ')') || (s[k] == '\\') ) nce++;
Note: See TracChangeset
for help on using the changeset viewer.