"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "layer1/Ortho.cpp" between
pymol-v1.8.6.0.tar.bz2 and pymol-v2.1.0.tar.bz2

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

Ortho.cpp  (pymol-v1.8.6.0.tar.bz2):Ortho.cpp  (pymol-v2.1.0.tar.bz2)
skipping to change at line 63 skipping to change at line 63
#define true 1 #define true 1
#endif #endif
#ifndef false #ifndef false
#define false 0 #define false 0
#endif #endif
#define OrthoSaveLines 0xFF #define OrthoSaveLines 0xFF
#define OrthoHistoryLines 0xFF #define OrthoHistoryLines 0xFF
#define cOrthoCharWidth 8 #define cOrthoCharWidth DIP2PIXEL(8)
#define cOrthoLeftMargin 3 #define cOrthoLeftMargin DIP2PIXEL(3)
#define cOrthoBottomMargin 5 #define cOrthoBottomMargin DIP2PIXEL(5)
#define CMD_QUEUE_MASK 0x3 #define CMD_QUEUE_MASK 0x3
struct _COrtho { struct _COrtho {
Block *Blocks; Block *Blocks;
Block *GrabbedBy, *ClickedIn; Block *GrabbedBy, *ClickedIn;
int X, Y, Height, Width; int X, Y, Height, Width;
int LastX, LastY, LastModifiers; int LastX, LastY, LastModifiers;
int ActiveButton; int ActiveButton;
int DrawText; int DrawText;
skipping to change at line 486 skipping to change at line 486
OrthoNewLine(G, NULL, true); OrthoNewLine(G, NULL, true);
OrthoRestorePrompt(G); OrthoRestorePrompt(G);
OrthoInvalidateDoDraw(G); OrthoInvalidateDoDraw(G);
OrthoDirty(G); OrthoDirty(G);
} }
/*========================================================================*/ /*========================================================================*/
void OrthoFeedbackIn(PyMOLGlobals * G, const char *buffer) void OrthoFeedbackIn(PyMOLGlobals * G, const char *buffer)
{ {
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
if(G->HaveGUI) { if(G->Option->pmgui) {
if(I->feedback) if(I->feedback)
QueueStrIn(I->feedback, buffer); QueueStrIn(I->feedback, buffer);
} }
} }
/*========================================================================*/ /*========================================================================*/
int OrthoFeedbackOut(PyMOLGlobals * G, char *buffer) int OrthoFeedbackOut(PyMOLGlobals * G, char *buffer)
{ {
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
if(I->feedback) if(!I->feedback)
return (QueueStrOut(I->feedback, buffer)); return 0;
else
return (0); int status = QueueStrOut(I->feedback, buffer);
if (status && !SettingGetGlobal_b(G, cSetting_colored_feedback)) {
UtilStripANSIEscapes(buffer);
}
return status;
} }
/*========================================================================*/ /*========================================================================*/
void OrthoDirty(PyMOLGlobals * G) void OrthoDirty(PyMOLGlobals * G)
{ {
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
PRINTFD(G, FB_Ortho) PRINTFD(G, FB_Ortho)
" OrthoDirty: called.\n" ENDFD; " OrthoDirty: called.\n" ENDFD;
if(!I->DirtyFlag) { if(!I->DirtyFlag) {
I->DirtyFlag = true; I->DirtyFlag = true;
skipping to change at line 898 skipping to change at line 904
OrthoCommandIn(G,"rewind;mplay"); OrthoCommandIn(G,"rewind;mplay");
} else { } else {
OrthoCommandIn(G,"mtoggle"); OrthoCommandIn(G,"mtoggle");
} }
} }
} else { } else {
curLine = add_normal_char(I, k); curLine = add_normal_char(I, k);
} }
break; break;
case 127: /* delete */ case 127: /* delete */
#if !defined(_PYMOL_OSX) || defined(_PYMOL_LIB)
/* this defined(_PYMOL_LIB) should really be for JyMOL, not all _PYMOL_LIB
, AX? */
if((!I->CurChar) || (I->CurChar == I->PromptChar) || !OrthoTextVisible(G)) { if((!I->CurChar) || (I->CurChar == I->PromptChar) || !OrthoTextVisible(G)) {
OrthoKeyControl(G, 4 + 64); OrthoKeyControl(G, 4 + 64);
} else { } else {
if(I->CursorChar >= 0) { if(I->CursorChar > -1 && I->CursorChar < I->CurChar) {
if(I->CursorChar < I->CurChar)
I->CursorChar++;
if(I->CursorChar == I->CurChar)
I->CursorChar = -1;
}
if(I->CurChar > I->PromptChar) {
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
if(I->CursorChar >= 0) { strcpy(buffer, I->Line[curLine] + I->CursorChar + 1);
if(I->CursorChar > I->PromptChar) { I->CurChar--;
strcpy(buffer, I->Line[curLine] + I->CursorChar); strcpy(I->Line[curLine] + I->CursorChar, buffer);
I->CursorChar--;
I->CurChar--;
strcpy(I->Line[curLine] + I->CursorChar, buffer);
}
} else {
I->CurChar--;
I->Line[curLine][I->CurChar] = 0;
}
} }
} }
break; break;
#endif
case 8: /* backspace */ case 8: /* backspace */
if(I->CurChar > I->PromptChar) { if(I->CurChar > I->PromptChar) {
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
if(I->CursorChar >= 0) { if(I->CursorChar >= 0) {
if(I->CursorChar > I->PromptChar) { if(I->CursorChar > I->PromptChar) {
strcpy(buffer, I->Line[curLine] + I->CursorChar); strcpy(buffer, I->Line[curLine] + I->CursorChar);
I->Line[curLine][I->CursorChar] = k; I->Line[curLine][I->CursorChar] = k;
I->CursorChar--; I->CursorChar--;
I->CurChar--; I->CurChar--;
strcpy(I->Line[curLine] + I->CursorChar, buffer); strcpy(I->Line[curLine] + I->CursorChar, buffer);
skipping to change at line 985 skipping to change at line 974
} else { } else {
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
if(I->PromptChar) { if(I->PromptChar) {
strcpy(buffer, I->Line[curLine]); strcpy(buffer, I->Line[curLine]);
if(PComplete(G, buffer + I->PromptChar, sizeof(OrthoLineType) - I->Pro mptChar)) { if(PComplete(G, buffer + I->PromptChar, sizeof(OrthoLineType) - I->Pro mptChar)) {
OrthoRestorePrompt(G); OrthoRestorePrompt(G);
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
strcpy(I->Line[curLine], buffer); strcpy(I->Line[curLine], buffer);
I->CurChar = strlen(I->Line[curLine]); I->CurChar = strlen(I->Line[curLine]);
I->CursorChar = -1;
} }
} }
} }
break; break;
case 27: /* ESCAPE */ case 27: /* ESCAPE */
if(SettingGetGlobal_b(G, cSetting_presentation) if(SettingGetGlobal_b(G, cSetting_presentation)
&& !(mod & (cOrthoCTRL | cOrthoSHIFT))) { && !(mod & (cOrthoCTRL | cOrthoSHIFT))) {
PParse(G, "_quit"); PParse(G, "_quit");
} else { } else {
if(I->SplashFlag) { if(I->SplashFlag) {
skipping to change at line 1109 skipping to change at line 1099
I->PromptChar = 0; I->PromptChar = 0;
I->CurChar = 0; I->CurChar = 0;
I->Line[curLine][0] = 0; I->Line[curLine][0] = 0;
I->InputFlag = 0; I->InputFlag = 0;
} }
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
p = str; p = str;
q = I->Line[curLine] + I->CurChar; q = I->Line[curLine] + I->CurChar;
cc = I->CurChar; cc = I->CurChar;
while(*p) { while(*p) {
if(*p >= 32) { if(*p != '\r' && *p != '\n') {
cc++; cc++;
wrap = SettingGetGlobal_b(G, cSetting_wrap_output); wrap = SettingGetGlobal_b(G, cSetting_wrap_output);
if(wrap > 0) { if(wrap > 0) {
if(cc > wrap) { if(cc > wrap) {
*q = 0; *q = 0;
I->CurChar = cc; I->CurChar = cc;
OrthoNewLine(G, NULL, true); OrthoNewLine(G, NULL, true);
cc = 0; cc = 0;
q = I->Line[I->CurLine & OrthoSaveLines]; q = I->Line[I->CurLine & OrthoSaveLines];
skipping to change at line 1132 skipping to change at line 1122
} }
if(cc >= OrthoLineLength - 6) { /* fail safe */ if(cc >= OrthoLineLength - 6) { /* fail safe */
*q = 0; *q = 0;
I->CurChar = cc; I->CurChar = cc;
OrthoNewLine(G, NULL, false); OrthoNewLine(G, NULL, false);
cc = 0; cc = 0;
q = I->Line[I->CurLine & OrthoSaveLines]; q = I->Line[I->CurLine & OrthoSaveLines];
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
} }
*q++ = *p++; *q++ = *p++;
} else if((*p == 13) || (*p == 10)) { } else {
*q = 0; *q = 0;
I->CurChar = cc; I->CurChar = cc;
OrthoNewLine(G, NULL, true); OrthoNewLine(G, NULL, true);
q = I->Line[I->CurLine & OrthoSaveLines]; q = I->Line[I->CurLine & OrthoSaveLines];
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
p++; p++;
cc = 0; cc = 0;
} else }
p++;
} }
*q = 0; *q = 0;
I->CurChar = strlen(I->Line[curLine]); I->CurChar = strlen(I->Line[curLine]);
if((SettingGetGlobal_i(G, cSetting_internal_feedback) > 1) || if((SettingGetGlobal_i(G, cSetting_internal_feedback) > 1) ||
SettingGetGlobal_i(G, cSetting_overlay) || SettingGetGlobal_i(G, cSetting_a uto_overlay)) SettingGetGlobal_i(G, cSetting_overlay) || SettingGetGlobal_i(G, cSetting_a uto_overlay))
OrthoDirty(G); OrthoDirty(G);
if(I->DrawText) if(I->DrawText)
OrthoInvalidateDoDraw(G); OrthoInvalidateDoDraw(G);
} }
skipping to change at line 1167 skipping to change at line 1156
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
/* printf("orthoNewLine: CC: %d CL:%d PC: %d IF:L %d\n",I->CurChar,I->CurLine , /* printf("orthoNewLine: CC: %d CL:%d PC: %d IF:L %d\n",I->CurChar,I->CurLine ,
I->PromptChar,I->InputFlag); */ I->PromptChar,I->InputFlag); */
/* if(I->CurChar) /* if(I->CurChar)
{ */ { */
if(I->CurChar) if(I->CurChar)
OrthoFeedbackIn(G, I->Line[I->CurLine & OrthoSaveLines]); OrthoFeedbackIn(G, I->Line[I->CurLine & OrthoSaveLines]);
else else
OrthoFeedbackIn(G, " "); OrthoFeedbackIn(G, " ");
if(Feedback(G, FB_Python, FB_Output)) {
if(crlf) { bool do_print = Feedback(G, FB_Python, FB_Output);
printf("%s\n", I->Line[I->CurLine & OrthoSaveLines]); bool do_print_with_escapes = false;
} else {
if (do_print) {
if (!do_print_with_escapes) {
printf("%s", I->Line[I->CurLine & OrthoSaveLines]); printf("%s", I->Line[I->CurLine & OrthoSaveLines]);
} }
if(crlf) {
putchar('\n');
}
fflush(stdout); fflush(stdout);
} }
/* } */ /* } */
/* if(I->Line[I->CurLine&OrthoSaveLines][0]) */ /* if(I->Line[I->CurLine&OrthoSaveLines][0]) */
I->CurLine++; I->CurLine++;
curLine = I->CurLine & OrthoSaveLines; curLine = I->CurLine & OrthoSaveLines;
if(prompt) { if(prompt) {
strcpy(I->Line[curLine], prompt); strcpy(I->Line[curLine], prompt);
skipping to change at line 1497 skipping to change at line 1492
I->OverlayColor[0] = 1.0F - bg_color[0]; I->OverlayColor[0] = 1.0F - bg_color[0];
I->OverlayColor[1] = 1.0F - bg_color[1]; I->OverlayColor[1] = 1.0F - bg_color[1];
I->OverlayColor[2] = 1.0F - bg_color[2]; I->OverlayColor[2] = 1.0F - bg_color[2];
if(diff3f(I->OverlayColor, bg_color) < 0.25) if(diff3f(I->OverlayColor, bg_color) < 0.25)
zero3f(I->OverlayColor); zero3f(I->OverlayColor);
PRINTFD(G, FB_Ortho) PRINTFD(G, FB_Ortho)
" OrthoDoDraw: entered.\n" ENDFD; " OrthoDoDraw: entered.\n" ENDFD;
if(G->HaveGUI && G->ValidContext) { if(G->HaveGUI && G->ValidContext) {
#ifdef GL_FRAMEBUFFER_UNDEFINED
// prevents GL_INVALID_FRAMEBUFFER_OPERATION (0x0506) on macOS
// with external Monitor
if (glCheckFramebufferStatus &&
glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_UNDEFINED)
return;
#endif
if(Feedback(G, FB_OpenGL, FB_Debugging)) if(Feedback(G, FB_OpenGL, FB_Debugging))
PyMOLCheckOpenGLErr("OrthoDoDraw checkpoint 0"); PyMOLCheckOpenGLErr("OrthoDoDraw checkpoint 0");
if(SettingGetGlobal_b(G, cSetting_internal_gui)) { if(SettingGetGlobal_b(G, cSetting_internal_gui)) {
switch (SettingGetGlobal_i(G, cSetting_internal_gui_mode)) { switch (SettingGetGlobal_i(G, cSetting_internal_gui_mode)) {
case 0: case 0:
rightSceneMargin = SettingGetGlobal_i(G, cSetting_internal_gui_width); rightSceneMargin = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui _width));
break; break;
default: default:
rightSceneMargin = 0; rightSceneMargin = 0;
break; break;
} }
} else { } else {
rightSceneMargin = 0; rightSceneMargin = 0;
} }
internal_feedback = SettingGetGlobal_i(G, cSetting_internal_feedback); internal_feedback = SettingGetGlobal_i(G, cSetting_internal_feedback);
skipping to change at line 1681 skipping to change at line 1684
glEnd(); glEnd();
} }
break; break;
} }
} }
PRINTFD(G, FB_Ortho) PRINTFD(G, FB_Ortho)
" OrthoDoDraw: drawing blocks...\n" ENDFD; " OrthoDoDraw: drawing blocks...\n" ENDFD;
if(SettingGetGlobal_b(G, cSetting_internal_gui)) { if(SettingGetGlobal_b(G, cSetting_internal_gui)) {
int internal_gui_width = SettingGetGlobal_i(G, cSetting_internal_gui_wid th); int internal_gui_width = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_intern al_gui_width));
if(internal_gui_mode != 2) { if(internal_gui_mode != 2) {
if (generate_shader_cgo){ if (generate_shader_cgo){
CGOColor(orthoCGO, 0.3f, 0.3f, 0.3f); CGOColor(orthoCGO, 0.3f, 0.3f, 0.3f);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, I->Width - internal_gui_width, 0.f, 0.f); CGOVertex(orthoCGO, I->Width - internal_gui_width, 0.f, 0.f);
CGOVertex(orthoCGO, I->Width - internal_gui_width + 1.f, 0.f, 0.f); CGOVertex(orthoCGO, I->Width - internal_gui_width + 1.f, 0.f, 0.f);
CGOVertex(orthoCGO, I->Width - internal_gui_width, I->Height, 0.f); CGOVertex(orthoCGO, I->Width - internal_gui_width, I->Height, 0.f);
CGOVertex(orthoCGO, I->Width - internal_gui_width + 1.f, I->Height, 0 .f); CGOVertex(orthoCGO, I->Width - internal_gui_width + 1.f, I->Height, 0 .f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
skipping to change at line 2072 skipping to change at line 2075
} }
} }
} }
static void OrthoLayoutPanel(PyMOLGlobals * G, static void OrthoLayoutPanel(PyMOLGlobals * G,
int m_top, int m_left, int m_bottom, int m_right) int m_top, int m_left, int m_bottom, int m_right)
{ {
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
Block *block = NULL; Block *block = NULL;
int controlHeight = 20; int controlHeight = DIP2PIXEL(20);
int butModeHeight = ButModeGetHeight(G); int butModeHeight = ButModeGetHeight(G);
int wizardHeight = I->WizardHeight; int wizardHeight = I->WizardHeight;
int controlBottom = m_bottom; int controlBottom = m_bottom;
int butModeBottom = controlBottom + controlHeight; int butModeBottom = controlBottom + controlHeight;
int wizardBottom = butModeBottom + butModeHeight; int wizardBottom = butModeBottom + butModeHeight;
int executiveBottom = wizardBottom + wizardHeight; int executiveBottom = wizardBottom + wizardHeight;
int height = I->Height; int height = I->Height;
skipping to change at line 2141 skipping to change at line 2144
BlockSetMargin(block, m_right, m_bottom, m_right, m_bottom); BlockSetMargin(block, m_right, m_bottom, m_right, m_bottom);
block->active = false; block->active = false;
} }
} }
/*========================================================================*/ /*========================================================================*/
void OrthoReshape(PyMOLGlobals * G, int width, int height, int force) void OrthoReshape(PyMOLGlobals * G, int width, int height, int force)
{ {
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
if(!G->HaveGUI && width < 0)
return;
Block *block = NULL; Block *block = NULL;
int sceneBottom, sceneRight = 0; int sceneBottom, sceneRight = 0;
int textBottom = 0; int textBottom = 0;
int internal_gui_width; int internal_gui_width;
int internal_feedback; int internal_feedback;
int sceneTop = 0; int sceneTop = 0;
PRINTFD(G, FB_Ortho) PRINTFD(G, FB_Ortho)
" OrthoReshape-Debug: %d %d\n", width, height ENDFD; " OrthoReshape-Debug: %d %d\n", width, height ENDFD;
skipping to change at line 2186 skipping to change at line 2192
textBottom += MovieGetPanelHeight(G); textBottom += MovieGetPanelHeight(G);
I->TextBottom = textBottom; I->TextBottom = textBottom;
internal_feedback = SettingGetGlobal_i(G, cSetting_internal_feedback); internal_feedback = SettingGetGlobal_i(G, cSetting_internal_feedback);
if(internal_feedback) if(internal_feedback)
sceneBottom = sceneBottom =
textBottom + (internal_feedback - 1) * cOrthoLineHeight + cOrthoBottomSc eneMargin; textBottom + (internal_feedback - 1) * cOrthoLineHeight + cOrthoBottomSc eneMargin;
else else
sceneBottom = textBottom; sceneBottom = textBottom;
internal_gui_width = SettingGetGlobal_i(G, cSetting_internal_gui_width); internal_gui_width = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_w idth));
if(!SettingGetGlobal_b(G, cSetting_internal_gui)) { if(!SettingGetGlobal_b(G, cSetting_internal_gui)) {
internal_gui_width = 0; internal_gui_width = 0;
sceneRight = 0; sceneRight = 0;
} else { } else {
switch (SettingGetGlobal_i(G, cSetting_internal_gui_mode)) { switch (SettingGetGlobal_i(G, cSetting_internal_gui_mode)) {
case 2: case 2:
sceneRight = 0; sceneRight = 0;
sceneBottom = 0; sceneBottom = 0;
break; break;
default: default:
skipping to change at line 2265 skipping to change at line 2271
} }
/*========================================================================*/ /*========================================================================*/
void OrthoReshapeWizard(PyMOLGlobals * G, ov_size wizHeight) void OrthoReshapeWizard(PyMOLGlobals * G, ov_size wizHeight)
{ {
COrtho *I = G->Ortho; COrtho *I = G->Ortho;
I->WizardHeight = wizHeight; I->WizardHeight = wizHeight;
if(SettingGetGlobal_b(G, cSetting_internal_gui) > 0.0) { if(SettingGetGlobal_b(G, cSetting_internal_gui) > 0.0) {
Block *block; Block *block;
int internal_gui_width = SettingGetGlobal_i(G, cSetting_internal_gui_width); int internal_gui_width = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_g
ui_width));
OrthoLayoutPanel(G, 0, I->Width - internal_gui_width, I->TextBottom, 0); OrthoLayoutPanel(G, 0, I->Width - internal_gui_width, I->TextBottom, 0);
block = ExecutiveGetBlock(G); block = ExecutiveGetBlock(G);
block->fReshape(block, I->Width, I->Height); block->fReshape(block, I->Width, I->Height);
block = WizardGetBlock(G); block = WizardGetBlock(G);
block->fReshape(block, I->Width, I->Height); block->fReshape(block, I->Width, I->Height);
block->active = wizHeight ? true : false; block->active = wizHeight ? true : false;
} }
} }
 End of changes. 20 change blocks. 
43 lines changed or deleted 50 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)