1 
2 /*
3 A* -------------------------------------------------------------------
4 B* This file contains source code for the PyMOL computer program
5 C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific.
6 D* -------------------------------------------------------------------
7 E* It is unlawful to modify or remove this copyright notice.
8 F* -------------------------------------------------------------------
9 G* Please see the accompanying LICENSE file for further information.
10 H* -------------------------------------------------------------------
11 I* Additional authors of this source file include:
12 -*
13 -*
14 -*
15 Z* -------------------------------------------------------------------
16 */
17 #ifndef _H_Ortho
18 #define _H_Ortho
19 
20 #define cOrthoSHIFT 1
21 #define cOrthoCTRL 2
22 #define cOrthoALT 4
23 
24 #define cOrthoRightSceneMargin DIP2PIXEL(220)
25 #define cOrthoBottomSceneMargin DIP2PIXEL(18)
26 #define cOrthoLineHeight DIP2PIXEL(12)
27 
28 #include <string>
29 
30 #include"os_gl.h"
31 #include"Block.h"
32 #include"Feedback.h"
33 #include"Deferred.h"
34 #include"Image.h"
35 #include"pymol/memory.h"
36 
37 #define cOrthoScene 1
38 #define cOrthoTool 2
39 #define cOrthoHidden 3
40 
41 int OrthoInit(PyMOLGlobals * G, int showSplash);
42 void OrthoFree(PyMOLGlobals * G);
43 
44 void OrthoAttach(PyMOLGlobals * G, Block * block, int type);
45 void OrthoDetach(PyMOLGlobals * G, Block * block);
46 
47 void OrthoReshape(PyMOLGlobals * G, int width, int height, int force);
48 int OrthoGetWidth(PyMOLGlobals * G);
49 int OrthoGetHeight(PyMOLGlobals * G);
50 void OrthoDoDraw(PyMOLGlobals * G, int render_mode);
51 void OrthoDoViewportWhenReleased(PyMOLGlobals *G);
52 void OrthoPushMatrix(PyMOLGlobals * G);
53 void OrthoPopMatrix(PyMOLGlobals * G);
54 int OrthoGetPushed(PyMOLGlobals * G);
55 
56 int OrthoButton(PyMOLGlobals * G, int button, int state, int x, int y, int mod);
57 int OrthoButtonDefer(PyMOLGlobals * G, int button, int state, int x, int y, int mod);
58 
59 void OrthoKey(PyMOLGlobals * G, unsigned char k, int x, int y, int mod);
60 
61 void OrthoAddOutput(PyMOLGlobals * G, const char *str);
62 void OrthoNewLine(PyMOLGlobals * G, const char *prompt, int crlf);
63 
64 int OrthoDrag(PyMOLGlobals * G, int x, int y, int mod);
65 
66 void OrthoGrab(PyMOLGlobals * G, Block * block);
67 int OrthoGrabbedBy(PyMOLGlobals * G, Block * block);
68 void OrthoUngrab(PyMOLGlobals * G);
69 void OrthoSetLoopRect(PyMOLGlobals * G, int flag, BlockRect * rect);
70 
71 void OrthoRestorePrompt(PyMOLGlobals * G);
72 void OrthoBusyDraw(PyMOLGlobals * G, int force);
73 
74 void OrthoDirty(PyMOLGlobals * G);
75 int OrthoGetDirty(PyMOLGlobals * G);
76 void OrthoClear(PyMOLGlobals * G);
77 void OrthoFakeDrag(PyMOLGlobals * G);
78 void OrthoBusyMessage(PyMOLGlobals * G, const char *message);
79 void OrthoBusySlow(PyMOLGlobals * G, int progress, int total);
80 void OrthoBusyFast(PyMOLGlobals * G, int progress, int total);
81 void OrthoBusyPrime(PyMOLGlobals * G);
82 void OrthoCommandSetBusy(PyMOLGlobals * G, int busy);
83 void OrthoCommandIn(COrtho&, const char *buffer);
OrthoCommandIn(PyMOLGlobals * G,const char * buffer)84 inline void OrthoCommandIn(PyMOLGlobals * G, const char *buffer){
85   OrthoCommandIn(*G->Ortho, buffer);
86 }
87 std::string OrthoCommandOut(COrtho& ortho);
88 void OrthoCommandNest(PyMOLGlobals * G, int dir);
89 bool OrthoCommandIsEmpty(COrtho& ortho);
90 
91 void OrthoFeedbackIn(COrtho& ortho, std::string str);
92 std::string OrthoFeedbackOut(PyMOLGlobals* G, COrtho& ortho);
93 
94 void OrthoSetWizardPrompt(PyMOLGlobals * G, char *vla);
95 
96 int OrthoGetOverlayStatus(PyMOLGlobals * G);
97 void OrthoPasteIn(PyMOLGlobals * G, const char *buffer);
98 
99 void OrthoRemoveSplash(PyMOLGlobals * G);
100 void OrthoRemoveAutoOverlay(PyMOLGlobals * G);
101 
102 void OrthoSplash(PyMOLGlobals * G);
103 int OrthoArrowsGrabbed(PyMOLGlobals * G);
104 void OrthoSpecial(PyMOLGlobals * G, int k, int x, int y, int mod);
105 int OrthoCommandWaiting(PyMOLGlobals * G);
106 
107 int OrthoTextVisible(PyMOLGlobals * G);
108 void OrthoReshapeWizard(PyMOLGlobals * G, ov_size height);
109 void OrthoDefer(PyMOLGlobals * G, std::unique_ptr<CDeferred> && D);
110 void OrthoExecDeferred(PyMOLGlobals * G);
111 int OrthoDeferredWaiting(PyMOLGlobals * G);
112 
113 int OrthoGetRenderMode(PyMOLGlobals * G);
114 void OrthoDrawBuffer(PyMOLGlobals * G, GLenum mode);
115 int OrthoGetWrapClickSide(PyMOLGlobals * G);
116 float *OrthoGetOverlayColor(PyMOLGlobals * G);
117 void OrthoDrawWizardPrompt(PyMOLGlobals * G, CGO *orthoCGO);
118 
119 void bg_grad(PyMOLGlobals * G);
120 GLuint OrthoGetBackgroundTextureID(PyMOLGlobals * G);
121 void OrthoInvalidateBackgroundTexture(PyMOLGlobals * G);
122 void OrthoBackgroundTextureNeedsUpdate(PyMOLGlobals * G);
123 
124 std::pair<int, int> OrthoGetBackgroundSize(const COrtho& ortho);
125 
126 void OrthoSetBackgroundImage(PyMOLGlobals * G, const char *image_data, int width, int height);
127 
128 bool OrthoBackgroundDataIsSet(const COrtho& ortho);
129 std::shared_ptr<pymol::Image> OrthoBackgroundDataGet(const COrtho& ortho);
130 std::pair<int, int> OrthoGetSize(const COrtho& ortho);
131 
132 void OrthoInvalidateDoDraw(PyMOLGlobals * G);
133 void OrthoRenderCGO(PyMOLGlobals * G);
134 
135 #define OrthoLineLength 1024
136 typedef char OrthoLineType[OrthoLineLength];
137 
138 #endif
139