Changeset 173 in Sophya for trunk/SophyaPI/PI/piwdgx.cc
- Timestamp:
- Dec 22, 1998, 5:19:22 PM (27 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piwdgx.cc
r170 r173 25 25 static SysDWdg top = NULL; 26 26 static Display * dpy = NULL; 27 static GC defgc; 27 28 // static char appname[64]; 28 29 static char appclass[64]; … … 560 561 top = XtVaAppInitialize(&appctx, appclass, NULL, 0, &n, ppc, (String*)(fallback_res), NULL); 561 562 #endif 563 if (top == NULL) { 564 fprintf(stderr, "PIWdgX::InitXt()/ Error XtVaAppInitialize() -> Exit \n"); 565 exit(9); 566 } 562 567 dpy = XtDisplay(top); 568 if (dpy == NULL) { 569 fprintf(stderr, "PIWdgX::InitXt()/ Error XtVaAppInitialize()/DisplayConnection -> Exit \n"); 570 exit(9); 571 } 572 573 /* le GC pour les XCopyArea */ 574 XGCValues xgv; 575 xgv.function = GXcopy; 576 xgv.plane_mask = ~0; 577 defgc = XCreateGC (dpy, DefaultRootWindow(dpy), GCFunction | GCPlaneMask, &xgv); 563 578 564 579 // On va recuperer la fonte par defaut des composantes Motif … … 736 751 #endif 737 752 return; 753 } 754 755 // Copie depuis un PIWdgGen 756 void PIWdgX::CopyFrom(PIWdgGen* wdg, int ox, int oy, int dx, int dy, int x, int y) 757 { 758 PIWdgX* wx = (PIWdgX*)wdg; 759 XCopyArea(XtDisplay(XtWdg()), XtWindow(wx->XtWdg()), XtWindow(XtWdg()), defgc, ox, oy, 760 (unsigned int)dx, (unsigned int)dy, x, y); 738 761 } 739 762 … … 974 997 return; 975 998 } 999 1000 1001 // -------- La classe PIGraphicBuffer ---------- 1002 /* --Methode-- */ 1003 PIGraphicBuffer::PIGraphicBuffer(int sx, int sy) 1004 { 1005 if (sx < 1) sx = 1; 1006 if (sy < 1) sy = 1; 1007 mSx = sx; mSy = sy; 1008 Display * dsx = PIXDisplay(); 1009 Window rw = DefaultRootWindow(dsx); 1010 xGrbuff = XCreatePixmap(dsx, rw, sx, sy, DefaultDepth(dsx, DefaultScreen(dsx)) ); 1011 } 1012 /* --Methode-- */ 1013 PIGraphicBuffer::~PIGraphicBuffer() 1014 { 1015 XFreePixmap(PIXDisplay(),xGrbuff); 1016 } 1017 1018 /* --Methode-- */ 1019 int PIGraphicBuffer::XSize() 1020 { 1021 return(mSx); 1022 } 1023 1024 /* --Methode-- */ 1025 int PIGraphicBuffer::YSize() 1026 { 1027 return(mSx); 1028 } 1029 1030 /* --Methode-- */ 1031 void PIGraphicBuffer::CopyFromWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y) 1032 { 1033 XCopyArea(XtDisplay(wdg->XtWdg()), XtWindow(wdg->XtWdg()), XGrBuffer(), defgc, ox, oy, 1034 (unsigned int)dx, (unsigned int)dy, x, y); 1035 } 1036 1037 /* --Methode-- */ 1038 void PIGraphicBuffer::CopyToWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y) 1039 { 1040 XCopyArea(XtDisplay(wdg->XtWdg()), XGrBuffer(), XtWindow(wdg->XtWdg()), defgc, ox, oy, 1041 (unsigned int)dx, (unsigned int)dy, x, y); 1042 } 1043 1044 /* --Methode-- */ 1045 void PIGraphicBuffer::CopyFrom(PIGraphicBuffer* grb, int ox, int oy, int dx, int dy, int x, int y) 1046 { 1047 1048 XCopyArea(PIXDisplay(), grb->XGrBuffer(), XGrBuffer(), defgc, ox, oy, 1049 (unsigned int)dx, (unsigned int)dy, x, y); 1050 }
Note:
See TracChangeset
for help on using the changeset viewer.