Block.h (pymol-open-source-2.2.0) | : | Block.h (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
H* ------------------------------------------------------------------- | H* ------------------------------------------------------------------- | |||
I* Additional authors of this source file include: | I* Additional authors of this source file include: | |||
-* | -* | |||
-* | -* | |||
-* | -* | |||
Z* ------------------------------------------------------------------- | Z* ------------------------------------------------------------------- | |||
*/ | */ | |||
#ifndef _H_Block | #ifndef _H_Block | |||
#define _H_Block | #define _H_Block | |||
#include<utility> | ||||
#include "PyMOLGlobals.h" | #include "PyMOLGlobals.h" | |||
typedef struct { | struct BlockRect{ | |||
int top, left, bottom, right; | int top; | |||
} BlockRect; | int left; | |||
int bottom; | ||||
typedef struct Block { | int right; | |||
PyMOLGlobals *G; | }; | |||
struct Block *next, *inside, *parent; | ||||
void *reference; | struct Block { | |||
BlockRect rect, margin; | PyMOLGlobals * m_G; | |||
int active; | Block *next = nullptr, *inside = nullptr, *parent = nullptr; | |||
float BackColor[3]; | void *reference = nullptr; | |||
float TextColor[3]; | BlockRect rect {}, margin {}; | |||
void (*fDraw) (struct Block * block ORTHOCGOARG); | bool active = false; | |||
short (*fFastDraw) (struct Block * block ORTHOCGOARG); | float BackColor[3] = {0.2F, 0.2F, 0.2F }; | |||
void (*fReshape) (struct Block * block, int width, int height); | float TextColor[3] = {1.0F, 1.0F, 1.0F }; | |||
int (*fClick) (struct Block * block, int button, int x, int y, int mod); | ||||
int (*fCursor) (struct Block * block, int x, int y, int mod); | virtual void draw(CGO *orthoCGO) {}; | |||
int (*fDrag) (struct Block * block, int x, int y, int mod); | virtual bool fastDraw(CGO *orthoCGO) { return false; } | |||
int (*fRelease) (struct Block * block, int button, int x, int y, int mod); | virtual void reshape(int width, int height); | |||
int (*fTranslate) (struct Block * block, int dx, int dy); | virtual int click(int button, int x, int y, int mod) { return 0; } | |||
} Block; | virtual int cursor (int x, int y, int mod) { return 0; } | |||
virtual int drag (int x, int y, int mod) { return 0; } | ||||
typedef Block **CBlock; | virtual int release (int button, int x, int y, int mod) { return 0; } | |||
Block(PyMOLGlobals * _G) : m_G(_G){} | ||||
void BlockGlobalToLocal(Block * block, int x, int y, int *lx, int *ly); | ||||
void BlockRecursiveDraw(Block * block ORTHOCGOARG); | void globalToLocal(int x, int y, int *lx, int *ly); | |||
short BlockRecursiveFastDraw(Block * block ORTHOCGOARG); | void recursiveDraw(CGO *orthoCGO); | |||
Block *BlockRecursiveFind(Block * block, int x, int y); | bool recursiveFastDraw(CGO *orthoCGO); | |||
void BlockSetMargin(Block * block, int t, int l, int b, int r); | Block *recursiveFind(int x, int y); | |||
void BlockReshape(Block * block, int width, int height); | void setMargin(int t, int l, int b, int r); | |||
void BlockFill(Block * I ORTHOCGOARG); | void fill(CGO *orthoCGO); | |||
void BlockDrawLeftEdge(Block * I ORTHOCGOARG); | int getWidth() const; | |||
void BlockGetSize(Block * I, int *width, int *height); | int getHeight() const; | |||
void BlockInit(PyMOLGlobals * G, Block * I); | void translate(int dx, int dy); | |||
void BlockTranslate(Block * I, int dx, int dy); | void drawLeftEdge(CGO *orthoCGO); | |||
void BlockDrawTopEdge(Block * I); | void drawTopEdge(); | |||
int BlockRectXYInside(BlockRect *rect, int x, int y); | bool rectXYInside(int x, int y) const; | |||
}; | ||||
typedef Block** CBlock; | ||||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
37 lines changed or deleted | 43 lines changed or added |