Changeset 180 in Sophya
- Timestamp:
- Dec 24, 1998, 5:03:22 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pibwdggen.cc
r163 r180 66 66 // PIPointer GetPointerShape() 67 67 // Renvoie la forme du pointeur 68 // void Refresh()69 // L'appel à cette méthode permet de retracer le contenu de la70 // fenêtre et des "Drawer" associés.71 68 //-- 72 69 … … 115 112 116 113 117 /* --Methode-- */114 /* --Methode-- 118 115 void PIBaseWdgGen::Refresh() 119 116 { … … 124 121 return; 125 122 } 126 123 */ 127 124 128 125 //++ -
trunk/SophyaPI/PI/pibwdggen.h
r170 r180 55 55 virtual PIPointer GetPointerShape() = 0; 56 56 virtual void AssignKeyboard() = 0; 57 58 // Fonction qui doit etre appelee pour rafraichir la fenetre59 virtual void Refresh();60 57 61 58 // Fonctions qui doivent contenir le dessin du contenu du widget lui-meme -
trunk/SophyaPI/PI/pibwdgx.cc
r158 r180 106 106 107 107 /* --Methode-- */ 108 void PIBaseWdgX::Refresh() 109 { 110 if ( IsVisible() ) { 111 // EraseWindow(); --> Ne pas faire Reza 12/98 112 Draw(mWGrC, 0, 0, XSize(), YSize()); 113 CallDrawers(mWGrC); 114 CallDrawHandlers(0, 0, XSize(), YSize()); 115 } 116 return; 117 } 118 119 120 /* --Methode-- */ 108 121 void PIBaseWdgX::ActivatePtrCross() 109 122 { -
trunk/SophyaPI/PI/pibwdgx.h
r158 r180 46 46 virtual bool IsVisible(); 47 47 48 // Fonction qui doit etre appelee pour rafraichir la fenetre 49 virtual void Refresh(); 50 48 51 // Appel depuis le PIXtBaseWidget uniquement (ExposeEvt de Xt ) 49 52 virtual void eXposeProcess(int x0, int y0, int dx, int dy); -
trunk/SophyaPI/PI/pigraphgen.cc
r173 r180 36 36 // Constructeur pour les *PIGraphicWin*. Objet "PIGraphic" capable 37 37 // de tracer dans un "PIWdg". 38 // PIGraphic(PI GraphicBuffer* grb)38 // PIGraphic(PIScreenBuffer* grb) 39 39 // Constructeur pour objet "PIGraphic" capable de tracer dans un 40 40 // buffer graphique. … … 47 47 // Renvoie le type de l'objet "PIGraphic" . 48 48 // * PI_UnknownGraphics : Objet PIGraphic de type inconnue. 49 // * PI_ GrBufferGraphics : Objet PIGraphic associé à un "GraphicBuffer"49 // * PI_ScrBufferGraphics : Objet PIGraphic associé à un "GraphicBuffer" 50 50 // * PI_ScrWindowGraphics : Objet PIGraphic associé à une fenêtre sur l'écran (PIWdg) 51 51 // * PI_PSFileGraphics : Objet PIGraphic à un fichier PostScript (pour impression papier) … … 76 76 77 77 /* --Methode-- */ 78 PIGraphicGen::PIGraphicGen(PI GraphicBuffer* grb)78 PIGraphicGen::PIGraphicGen(PIScreenBuffer* grb) 79 79 { 80 80 myWdg = NULL; -
trunk/SophyaPI/PI/pigraphgen.h
r173 r180 62 62 63 63 enum PIGraphicsType { PI_UnknownGraphics = 0, 64 PI_ScrWindowGraphics = 2, PI_ GrBufferGraphics = 3,64 PI_ScrWindowGraphics = 2, PI_ScrBufferGraphics = 3, 65 65 PI_PSFileGraphics = 8, 66 66 PI_UCGraphics = 32, PI_3DGraphics = 36 }; … … 73 73 PIGraphicGen(); 74 74 PIGraphicGen(PIWdg* wdg); 75 PIGraphicGen(PI GraphicBuffer* grb);75 PIGraphicGen(PIScreenBuffer* grb); 76 76 virtual ~PIGraphicGen(); 77 77 … … 139 139 // Pour Save/Restore des attributs graphiques 140 140 PIWdg* myWdg; 141 PI GraphicBuffer* myGrb;141 PIScreenBuffer* myGrb; 142 142 143 143 PIColors sFCol, sBCol; -
trunk/SophyaPI/PI/pigraphx.cc
r173 r180 50 50 51 51 /* --Methode-- */ 52 PIGraphicX::PIGraphicX(PI GraphicBuffer* grb)52 PIGraphicX::PIGraphicX(PIScreenBuffer* grb) 53 53 : PIGraphicGen(grb) 54 54 { … … 56 56 57 57 mDisp = PIXDisplay(); // Structure Display X associe 58 mWId = grb->X GrBuffer();58 mWId = grb->XScrBuffer(); 59 59 60 60 XGCValues xgv; … … 91 91 { 92 92 if (myWdg != NULL) return (PI_ScrWindowGraphics); 93 else if (myGrb != NULL) return (PI_ GrBufferGraphics);93 else if (myGrb != NULL) return (PI_ScrBufferGraphics); 94 94 else return(PI_UnknownGraphics); 95 95 } -
trunk/SophyaPI/PI/pigraphx.h
r173 r180 14 14 public: 15 15 PIGraphicX(PIWdg* wdg); 16 PIGraphicX(PI GraphicBuffer* grb);16 PIGraphicX(PIScreenBuffer* grb); 17 17 virtual ~PIGraphicX(); 18 18 -
trunk/SophyaPI/PI/pimsghandler.h
r110 r180 5 5 6 6 #include <stdlib.h> 7 8 #include "defs.h" 7 9 8 10 enum { -
trunk/SophyaPI/PI/piscdrawwdg.h
r162 r180 38 38 39 39 int AddScDrawer(PIDrawer*, bool ad=false); // Ajoute un Drawer en auto 40 inline PI Drawer*BaseDrawer() { return mBDrw; };40 inline PIElDrawer* BaseDrawer() { return mBDrw; }; 41 41 42 42 float XMin() const {return mBDrw->XMin();} -
trunk/SophyaPI/PI/pisurfdr.cc
r170 r180 98 98 // g3->SelForeground(PI_White); 99 99 g3->SelBackground(PI_White); 100 g3->Erase(xmin, ymin, xmax-xmin, ymax-ymin);100 // g3->Erase(xmin, ymin, xmax-xmin, ymax-ymin); 101 101 102 102 int xsz = mArr->XSize(); -
trunk/SophyaPI/PI/piwdggen.cc
r173 r180 91 91 // bool IfSensitive() 92 92 // indique si l'objet est répond aux sollicitations utilisateur. 93 //-- 94 95 //++ 96 // Titre Rafraîchissement de la fenêtre 97 //-- 98 //++ 99 // void Refresh() 100 // L'appel à cette méthode permet de retracer le contenu de la 101 // fenêtre et des "Drawer" associés. 93 102 //-- 94 103 … … 237 246 // La méthode "Draw(PIGraphic* g, ...)" sera appelé pour rafraîchir le contenu de la fenêtre. 238 247 // void RemoveDrawHandler(PIEventHandler* drwh) 239 // Suppression d'un objet gestionnaire de tracé. 248 // Suppression d'un objet gestionnaire de tracé. Toutes les réferences sonnt supprimées en cas 249 // d' enregistrement multiple. 240 250 // void AddEventHandler(PIEventHandler* evh, unsigned long evtmask, bool ad=false) 241 251 // Ajout d'un objet gestionnaire d'événements. La variable "evtmask" détermine pour … … 248 258 // 249 259 // void RemoveEventHandler(PIEventHandler* evh) 250 // Suppression d'un gestionnaire d'événements. 260 // Suppression d'un gestionnaire d'événements. Toutes les réferences sonnt supprimées en cas 261 // d' enregistrement multiple, même avec différents masques d'événements. 251 262 //-- 252 263 … … 263 274 { 264 275 list<EvHand>::iterator it; 265 for(it= mDHlist.begin(); it != mDHlist.end(); it++) 266 if ((*it).evh == drwh) { mDHlist.erase(it); break; } 276 bool found = true; 277 while (found) { 278 found = false; 279 for(it= mDHlist.begin(); it != mDHlist.end(); it++) 280 if ((*it).evh == drwh) { mDHlist.erase(it); found = true; break; } 281 } 267 282 } 268 283 … … 279 294 { 280 295 list<EvHand>::iterator it; 281 for(it= mEHlist.begin(); it != mEHlist.end(); it++) 282 if ((*it).evh == evh) { mEHlist.erase(it); break; } 296 bool found = true; 297 while (found) { 298 found = false; 299 for(it= mEHlist.begin(); it != mEHlist.end(); it++) 300 if ((*it).evh == evh) { mEHlist.erase(it); found = true; break; } 301 } 283 302 } 284 303 -
trunk/SophyaPI/PI/piwdggen.h
r173 r180 81 81 virtual bool IsVisible()=0; 82 82 83 // Fonction qui doit etre appelee pour rafraichir la fenetre 84 virtual void Refresh()=0; 85 83 86 // Pour rendre un composant graphique (PIWdg) sensible/insensible 84 87 // aux actions utilisateur (souris, clavier, ...) … … 118 121 }; 119 122 120 // ---- La classe PI GraphicBuffer doit se conformer a l'interface suivante121 // class PI GraphicBuffer {123 // ---- La classe PIScreenBuffer doit se conformer a l'interface suivante 124 // class PIScreenBuffer { 122 125 // public : 123 // PI GraphicBuffer(int sx, int sy);124 // virtual ~PI GraphicBuffer();126 // PIScreenBuffer(int sx, int sy); 127 // virtual ~PIScreenBuffer(); 125 128 // virtual int XSize(); 126 129 // virtual int YSize(); 127 130 // virtual void CopyFromWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y); 128 131 // virtual void CopyToWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y); 129 // virtual void CopyFrom(PI GraphicBuffer* grb, int ox, int oy, int dx, int dy, int x, int y);132 // virtual void CopyFrom(PIScreenBuffer* grb, int ox, int oy, int dx, int dy, int x, int y); 130 133 // }; 131 134 -
trunk/SophyaPI/PI/piwdgx.cc
r173 r180 245 245 ( (this->XtWdg())->core.visible) ) return(true); 246 246 else return(false); 247 } 248 249 /* --Methode-- */ 250 void PIWdgX::Refresh() 251 { 252 if (XtIsRealized(XtWdg())) 253 XClearArea(XtDisplay(XtWdg()), XtWindow(XtWdg()), 0, 0, 0, 0, True); 247 254 } 248 255 … … 770 777 { 771 778 PIWdgGen::AddDrawHandler(drwh, ad); 772 Xt AddEventHandler( XtWdg(), ExposureMask, FALSE, evthandler_piwdgx, this);779 XtInsertEventHandler( XtWdg(), ExposureMask, FALSE, evthandler_piwdgx, this, XtListTail); 773 780 } 774 781 … … 789 796 if (evtmask & PIEvent_Leave) mask |= LeaveNotify; 790 797 if (evtmask & PIEvent_But1Press) mask |= ButtonPressMask; 791 if (evtmask & PIEvent_But1Release) mask |= ButtonRelease ;798 if (evtmask & PIEvent_But1Release) mask |= ButtonReleaseMask; 792 799 if (evtmask & PIEvent_But2Press) mask |= ButtonPressMask; 793 if (evtmask & PIEvent_But2Release) mask |= ButtonRelease ;800 if (evtmask & PIEvent_But2Release) mask |= ButtonReleaseMask; 794 801 if (evtmask & PIEvent_But3Press) mask |= ButtonPressMask; 795 if (evtmask & PIEvent_But3Release) mask |= ButtonRelease ;802 if (evtmask & PIEvent_But3Release) mask |= ButtonReleaseMask; 796 803 if (evtmask & PIEvent_PtrMove) mask |= PointerMotionHintMask; 797 804 if (evtmask & PIEvent_Ptr1Move) mask |= (PointerMotionHintMask | Button1MotionMask); … … 799 806 if (evtmask & PIEvent_Ptr3Move) mask |= (PointerMotionHintMask | Button3MotionMask); 800 807 if (evtmask & PIEvent_Keyboard) mask |= KeyPressMask; 801 XtAddEventHandler( XtWdg(), mask, FALSE, evthandler_piwdgx, this); 808 printf("PIWdgX::AddEventHandler() Mask = %lx \n", (long)mask); 809 XtInsertEventHandler( XtWdg(), mask, FALSE, evthandler_piwdgx, this, XtListTail); 802 810 } 803 811 … … 807 815 PIWdgGen::RemoveEventHandler(evh); 808 816 if (mEHlist.size() > 0) return; 809 unsignedmask = EnterNotify;817 EventMask mask = EnterNotify; 810 818 mask |= LeaveNotify; 811 819 mask |= ButtonPressMask; … … 862 870 { 863 871 864 *cont = FALSE;872 *cont = true ; 865 873 PIWdgX* wx = (PIWdgX*)usd; 866 874 PIEventMask evm = PIEvent_None; … … 999 1007 1000 1008 1001 // -------- La classe PI GraphicBuffer ----------1002 /* --Methode-- */ 1003 PI GraphicBuffer::PIGraphicBuffer(int sx, int sy)1009 // -------- La classe PIScreenBuffer ---------- 1010 /* --Methode-- */ 1011 PIScreenBuffer::PIScreenBuffer(int sx, int sy) 1004 1012 { 1005 1013 if (sx < 1) sx = 1; … … 1008 1016 Display * dsx = PIXDisplay(); 1009 1017 Window rw = DefaultRootWindow(dsx); 1010 x Grbuff = XCreatePixmap(dsx, rw, sx, sy, DefaultDepth(dsx, DefaultScreen(dsx)) );1011 } 1012 /* --Methode-- */ 1013 PI GraphicBuffer::~PIGraphicBuffer()1014 { 1015 XFreePixmap(PIXDisplay(),x Grbuff);1016 } 1017 1018 /* --Methode-- */ 1019 int PI GraphicBuffer::XSize()1018 xScrbuff = XCreatePixmap(dsx, rw, sx, sy, DefaultDepth(dsx, DefaultScreen(dsx)) ); 1019 } 1020 /* --Methode-- */ 1021 PIScreenBuffer::~PIScreenBuffer() 1022 { 1023 XFreePixmap(PIXDisplay(),xScrbuff); 1024 } 1025 1026 /* --Methode-- */ 1027 int PIScreenBuffer::XSize() 1020 1028 { 1021 1029 return(mSx); … … 1023 1031 1024 1032 /* --Methode-- */ 1025 int PI GraphicBuffer::YSize()1033 int PIScreenBuffer::YSize() 1026 1034 { 1027 1035 return(mSx); … … 1029 1037 1030 1038 /* --Methode-- */ 1031 void PI GraphicBuffer::CopyFromWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y)1032 { 1033 XCopyArea(XtDisplay(wdg->XtWdg()), XtWindow(wdg->XtWdg()), X GrBuffer(), defgc, ox, oy,1039 void PIScreenBuffer::CopyFromWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y) 1040 { 1041 XCopyArea(XtDisplay(wdg->XtWdg()), XtWindow(wdg->XtWdg()), XScrBuffer(), defgc, ox, oy, 1034 1042 (unsigned int)dx, (unsigned int)dy, x, y); 1035 1043 } 1036 1044 1037 1045 /* --Methode-- */ 1038 void PI GraphicBuffer::CopyToWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y)1039 { 1040 XCopyArea(XtDisplay(wdg->XtWdg()), X GrBuffer(), XtWindow(wdg->XtWdg()), defgc, ox, oy,1046 void PIScreenBuffer::CopyToWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y) 1047 { 1048 XCopyArea(XtDisplay(wdg->XtWdg()), XScrBuffer(), XtWindow(wdg->XtWdg()), defgc, ox, oy, 1041 1049 (unsigned int)dx, (unsigned int)dy, x, y); 1042 1050 } 1043 1051 1044 1052 /* --Methode-- */ 1045 void PI GraphicBuffer::CopyFrom(PIGraphicBuffer* grb, int ox, int oy, int dx, int dy, int x, int y)1046 { 1047 1048 XCopyArea(PIXDisplay(), grb->X GrBuffer(), XGrBuffer(), defgc, ox, oy,1053 void PIScreenBuffer::CopyFrom(PIScreenBuffer* grb, int ox, int oy, int dx, int dy, int x, int y) 1054 { 1055 1056 XCopyArea(PIXDisplay(), grb->XScrBuffer(), XScrBuffer(), defgc, ox, oy, 1049 1057 (unsigned int)dx, (unsigned int)dy, x, y); 1050 1058 } -
trunk/SophyaPI/PI/piwdgx.h
r173 r180 52 52 virtual bool IsVisible(); 53 53 54 // Fonction qui doit etre appelee pour rafraichir la fenetre 55 virtual void Refresh(); 56 57 // Pour rendre un composant graphique (PIWdg) sensible/insensible 54 58 virtual void SetSensitive(); 55 59 virtual void SetUnSensitive(); … … 97 101 typedef PIWdgX PIWdg; 98 102 99 // -------- La classe PI GraphicBuffer ----------100 class PI GraphicBuffer {103 // -------- La classe PIScreenBuffer ---------- 104 class PIScreenBuffer { 101 105 public : 102 PI GraphicBuffer(int sx, int sy);103 virtual ~PI GraphicBuffer();106 PIScreenBuffer(int sx, int sy); 107 virtual ~PIScreenBuffer(); 104 108 105 109 virtual int XSize(); … … 107 111 virtual void CopyFromWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y); 108 112 virtual void CopyToWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y); 109 virtual void CopyFrom(PI GraphicBuffer* grb, int ox, int oy, int dx, int dy, int x, int y);113 virtual void CopyFrom(PIScreenBuffer* grb, int ox, int oy, int dx, int dy, int x, int y); 110 114 111 115 // Acces au Drawable X 112 inline Pixmap X GrBuffer() { return(xGrbuff); }116 inline Pixmap XScrBuffer() { return(xScrbuff); } 113 117 protected : 114 Pixmap x Grbuff;118 Pixmap xScrbuff; 115 119 int mSx, mSy; 116 120 }; -
trunk/SophyaPI/PI/pixtbase.cc
r163 r180 198 198 { 199 199 200 *cont = FALSE;200 *cont = true ; 201 201 switch (evt->type) { 202 202 case EnterNotify :
Note:
See TracChangeset
for help on using the changeset viewer.