OSDN Git Service

Compiler warnings are mostly removed.
authorToshi Nagata <alchemist.2005@nifty.com>
Mon, 19 Sep 2022 07:31:07 +0000 (16:31 +0900)
committerToshi Nagata <alchemist.2005@nifty.com>
Mon, 19 Sep 2022 07:31:07 +0000 (16:31 +0900)
45 files changed:
Documents/src/doc_source.html
MolLib/MD/MDForce.c
MolLib/MD/MDPressure.c
MolLib/MainView.c
MolLib/MolAction.c
MolLib/Molecule.c
MolLib/Parameter.c
MolLib/Ruby_bind/ruby_bind.c
MolLib/Ruby_bind/ruby_dialog.c
README
Version
bitmaps/jump_to_end.xpm
bitmaps/jump_to_start.xpm
bitmaps/pi00.xpm
bitmaps/pi01.xpm
bitmaps/pi02.xpm
bitmaps/pi03.xpm
bitmaps/pi04.xpm
bitmaps/pi05.xpm
bitmaps/pi06.xpm
bitmaps/pi07.xpm
bitmaps/pi08.xpm
bitmaps/pi09.xpm
bitmaps/pi10.xpm
bitmaps/pi11.xpm
bitmaps/play_backward.xpm
bitmaps/play_forward.xpm
bitmaps/rotate_bond.xpm
bitmaps/rotate_x.xpm
bitmaps/rotate_y.xpm
bitmaps/stop_mini.xpm
bitmaps/stop_mini_dark.xpm
bitmaps/stop_mini_grey.xpm
build-win/molby64.iss
build-win32/molby32.iss
build-xcode/Molby-Info.plist
build-xcode/Molby.xcodeproj/project.pbxproj
wxSources/ConsoleFrame.cpp
wxSources/MoleculeView.cpp
wxSources/MyApp.cpp
wxSources/MyApp.h
wxSources/MyVersion.c
wxSources/OpenGL_extensions.c
wxSources/ProgressFrame.cpp
wxSources/RubyDialogFrame.cpp

index 85bf8ff..608bad8 100644 (file)
 <div class="centered" lang="en">
 <h1>Molby</h1>
 <h2>Interactive Molecular Modeling Software<br />with Integrated Ruby Interpreter</h2>
-<h3>Version 1.0.2</h3> <!-- version -->
+<h3>Version 1.1.0</h3> <!-- version -->
 <h3>Toshi Nagata</h3>
 <p><a href="http://molby.osdn.jp/index-en.html">http://molby.osdn.jp/index-en.html</a></p>
 </div>
 <div class="centered" lang="ja">
 <h1>Molby</h1>
 <h2>対話型分子モデリングソフトウェア<br />(Ruby インタプリタ内蔵)</h2>
-<h3>Version 1.0.2</h3> <!-- version -->
+<h3>Version 1.1.0</h3> <!-- version -->
 <h3>永田 央</h3>
 <p><a href="http://molby.osdn.jp/index.html">http://molby.osdn.jp/index.html</a></p>
 </div>
@@ -96,8 +96,8 @@ Molby は、分子を 3D 表示して、画面上で分子モデルを構築す
 Molby runs on the following platforms.
 </p>
 <ul>
-<li>Microsoft Windows (XP or later, 32 bit or 64 bit).</li>
-<li>Mac OS X (10.6 or later, 64 bit Intel).</li>
+<li>Microsoft Windows (7 or later, 32 bit or 64 bit).</li>
+<li>Mac OS X (10.12 or later, 64 bit Intel).</li>
 </ul>
 
 <p>
@@ -114,7 +114,7 @@ Download from the official distribution web site, <a href="http://en.osdn.jp/pro
 <h3>3-1. Microsoft Windows</h3>
 
 <p>
-The Windows version is provided either as a zip archive (<code>MolbyWin.zip</code>) or a standard setup package (<code>SetupMolbyWin.exe</code>).
+The Windows version is provided either as a zip archive (<code>MolbyWin32.zip</code>, <code>MolbyWin64.zip</code>) or a standard setup package (<code>SetupMolbyWin32.exe</code>, <code>SetupMolbyWin.exe</code>).
 </p>
 <p>
 To use the zip archive, expand all contents in your favorite place, and double-click the "Molby" icon.
@@ -125,10 +125,7 @@ To install on your PC, start the setup package, and follow the instructions. Aft
 
 <h3>3-2. Mac OS X</h3>
 <p>
-The Mac version is provided as a zip archive (<code>MolbyMac.zip</code>). Double-click the archive, and you will get a folder including the Molby application. Drag it to the "Applications" folder in your hard drive.
-</p>
-<p>
-<span class="italic">Note:</span> The Mac version is provided as a universal binary, which runs natively on both PowerPC and Intel platforms.
+The Mac version is provided as a zip archive (<code>MolbyMac.zip</code>, <code>MolbyMacLegacy.zip</code> for MacOS 10.6 to 10.11). Double-click the archive, and you will get a folder including the Molby application. Drag it to the "Applications" folder in your hard drive.
 </p>
 
 <h2>4. Uninstallation</h2>
@@ -149,8 +146,8 @@ Trash the Molby application in the "Applications" folder.
 Molbyは以下のプラットフォームで動作します。
 </p>
 <ul>
-<li>Microsoft Windows (XPまたはそれ以降, 32ビットまたは64ビット).</li>
-<li>Mac OS X (10.6 またはそれ以降、64ビット).</li>
+<li>Microsoft Windows (7またはそれ以降, 32ビットまたは64ビット).</li>
+<li>Mac OS X (10.12 またはそれ以降、64ビット).</li>
 </ul>
 
 <p>
@@ -167,7 +164,7 @@ Molbyは以下のプラットフォームで動作します。
 <h3>3-1. Microsoft Windows</h3>
 
 <p>
-Windows版は、zip アーカイブ(<code>MolbyWin32.zip</code>:32 ビット版, <code>MolbyWin64.zip</code>: 64ビット版)、または標準のセットアップパッケージ (<code>SetupMolbyWin32.exe</code>: 32ビット版、<code>SetupMolbyWin64.exe</code>: 64ビット版) で配布されています。どちらも内容は同じです。
+Windows版は、zip アーカイブ(<code>MolbyWin32.zip</code>:32 ビット版, <code>MolbyWin64.zip</code>: 64ビット版)、または標準のセットアップパッケージ (<code>SetupMolbyWin32.exe</code>: 32ビット版、<code>SetupMolbyWin64.exe</code>: 64ビット版) で配布されています。
 </p>
 <p>
 Zip アーカイブを使う時は、最初に内容をすべて展開してください。展開したフォルダの中に Molby アプリケーションがあるので、ダブルクリックして起動してください。
@@ -178,10 +175,7 @@ Zip アーカイブを使う時は、最初に内容をすべて展開してく
 
 <h3>3-2. Mac OS X</h3>
 <p>
-Mac版は、zip アーカイブ (<code>MolbyMac.zip</code>) で配布されています。アーカイブをダブルクリックすると、内容が展開されて新しいフォルダができます。Molby アプリケーションがその中にありますので、ハードディスクの「アプリケーション」フォルダにドラッグコピーしてください。
-</p>
-<p>
-<span class="italic">注:</span> Version 1.0 から、Mac 版は 64 bit のみになりました。
+Mac版は、zip アーカイブ (<code>MolbyMac.zip</code>, <code>MolbyMacLegacy.zip</code> [10.6〜10.11用]) で配布されています。アーカイブをダブルクリックすると、内容が展開されて新しいフォルダができます。Molby アプリケーションがその中にありますので、ハードディスクの「アプリケーション」フォルダにドラッグコピーしてください。
 </p>
 
 <h2>4. アンインストール</h2>
@@ -218,7 +212,7 @@ I ask for citation of the following paper in published works that utilize Molby:
 <p>
 Toshi Nagata, "Molby - Graphical Molecular Modeling Software with Integrated Ruby Interpreter," 
 <br />
-<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> in press. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
+<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> <i>87,</i> 902-904. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
 </p>
 </blockquote>
 <p>
@@ -229,7 +223,7 @@ Molby includes the following softwares, which are copyrighted products as descri
 <a href="http://ambermd.org/">AmberTools 1.3</a>: Copyright (C) Junmei Wang, Ross C. Walker, Michael F. Crowley, Scott Brozell and David A. Case
 </li>
 <li>
-<a href="http://www.wxwidgets.org/">wxWidgets 3.0.0</a>: Copyright (C) 1992-2013 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
+<a href="http://www.wxwidgets.org/">wxWidgets 3.2.0</a>: Copyright (C) 1992-2022 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
 </li>
 <li>
 <a href="http://www.ruby-lang.org/">Ruby 2.0.0</a>: Copyright (C) 1993-2013 Yukihiro Matsumoto
@@ -248,7 +242,7 @@ Burnett, M. N.; Johnson, C. K. <i>ORTEP-III: Oak Ridge Thermal Ellipsoid Plot Pr
 
 <h2>2. License</h2>
 <p>
-Molby is distributed under the GNU General Public License (version 2).
+Molby is distributed under the GNU General Public License (version 3).
 </p>
 <blockquote>
 <p>
@@ -260,7 +254,7 @@ Copyright (C) 2008-2022 Toshi Nagata <!-- copyright -->
 <p>
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 </p>
 <p>
@@ -286,7 +280,7 @@ Molby を利用した成果を発表される際は、以下の論文を引用
 <blockquote>
 <p>
 Toshi Nagata, "Molby - Graphical Molecular Modeling Software with Integrated Ruby Interpreter," <br />
-<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> in press. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
+<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> <i>87,</i> 902-904. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
 </p>
 </blockquote>
 <p>
@@ -297,7 +291,7 @@ Molby は以下のソフトウェアを含んでいます。それぞれの著
 <a href="http://ambermd.org/">AmberTools 1.3</a>: Copyright (C) Junmei Wang, Ross C. Walker, Michael F. Crowley, Scott Brozell and David A. Case
 </li>
 <li>
-<a href="http://www.wxwidgets.org/">wxWidgets 3.0.0</a>: Copyright (C) 1992-2013 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
+<a href="http://www.wxwidgets.org/">wxWidgets 3.2.0</a>: Copyright (C) 1992-2022 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
 </li>
 <li>
 <a href="http://www.ruby-lang.org/">Ruby 2.0.0</a>: Copyright (C) 1993-2013 Yukihiro Matsumoto
@@ -316,7 +310,7 @@ Burnett, M. N.; Johnson, C. K. <i>ORTEP-III: Oak Ridge Thermal Ellipsoid Plot Pr
 
 <h2>2. ライセンス</h2>
 <p>
-Molby は <a href="../etc/gpl.txt">GNU General Public License (GNU 一般公衆利用許諾契約書, version 2)</a> に従って配布します。
+Molby は <a href="../etc/gpl.txt">GNU General Public License (GNU 一般公衆利用許諾契約書, version 3)</a> に従って配布します。
 </p>
 <blockquote>
 <p>
@@ -326,7 +320,7 @@ Molby: 対話型分子モデルソフトウェア(Ruby インタプリタ内
 Copyright (C) 2008-2022 Toshi Nagata <!-- copyright -->
 </p>
 <p>
-このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された GNU 一般公衆利用許諾契約書(バージョン2か、希望によってはそれ以降のバージョンのうちどれか)の定める条件の下で再頒布または改変することができます。
+このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された GNU 一般公衆利用許諾契約書(バージョン3か、希望によってはそれ以降のバージョンのうちどれか)の定める条件の下で再頒布または改変することができます。
 </p>
 <p>
 このプログラムは有用であることを願って頒布されますが、*全くの無保証* です。商業可能性の保証や特定の目的への適合性は、言外に示されたものも含め全く存在しません。詳しくはGNU 一般公衆利用許諾契約書をご覧ください。
index 1e05e17..0196609 100644 (file)
@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "Missing.h"
+
 extern int do_custom_bond_callback(MDArena *arena, Double r, void *procObj, Double *energy, Double *force);
 
 static void
index 6cef9a8..bb011c8 100644 (file)
@@ -126,7 +126,7 @@ pressure_control(MDArena *arena)
        Transform tf;
        Vector v;
        Vector cello_new;
-       Mat33 celltr_save;
+       Transform celltr_save;
        Double w, w0;
        int i;
        int needs_cell_recalculate = 0;
index d493c4c..7ced70e 100755 (executable)
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <math.h>
 
 #define biso2radius(r) ((r) > 0.5 ? sqrt((r) / 78.9568352087147) : 0.08)
 
 /*  Invalid bond/angle/torsion value, used in internal cache  */
 const Double kInvalidValue = -10000000.0;
 
+#pragma mark ==== OpenGL utility functions ===
+
+static void __gluMultMatrixVecf(const GLdouble matrix[16], const GLdouble in[4], GLdouble out[4])
+{
+    int i;
+    for (i = 0; i < 4; i++) {
+        out[i] = in[0] * matrix[0*4+i] + in[1] * matrix[1*4+i] + in[2] * matrix[2*4+i] + in[3] * matrix[3*4+i];
+    }
+}
+
+static int __gluInvertMatrixf(const GLdouble m[16], GLdouble invOut[16])
+{
+    GLdouble inv[16], det;
+    int i;
+    
+    inv[0] =   m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15]
+    + m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10];
+    inv[4] =  -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15]
+    - m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10];
+    inv[8] =   m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15]
+    + m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9];
+    inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14]
+    - m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9];
+    inv[1] =  -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15]
+    - m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10];
+    inv[5] =   m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15]
+    + m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10];
+    inv[9] =  -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15]
+    - m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9];
+    inv[13] =  m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14]
+    + m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9];
+    inv[2] =   m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15]
+    + m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6];
+    inv[6] =  -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15]
+    - m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6];
+    inv[10] =  m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15]
+    + m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5];
+    inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14]
+    - m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5];
+    inv[3] =  -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11]
+    - m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6];
+    inv[7] =   m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11]
+    + m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6];
+    inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11]
+    - m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5];
+    inv[15] =  m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10]
+    + m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5];
+    
+    det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12];
+    if (det == 0)
+        return GL_FALSE;
+    
+    det = 1.0 / det;
+    
+    for (i = 0; i < 16; i++)
+        invOut[i] = inv[i] * det;
+    
+    return GL_TRUE;
+}
+
+static void __gluMultMatricesf(const GLdouble a[16], const GLdouble b[16],
+                               GLdouble r[16])
+{
+    int i, j;
+    for (i = 0; i < 4; i++) {
+        for (j = 0; j < 4; j++) {
+            r[i*4+j] = a[i*4+0]*b[0*4+j] + a[i*4+1]*b[1*4+j] + a[i*4+2]*b[2*4+j] + a[i*4+3]*b[3*4+j];
+        }
+    }
+}
+
+GLint
+myGluProject(GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz)
+{
+    GLdouble in[4];
+    GLdouble out[4];
+    
+    in[0] = objx;
+    in[1] = objy;
+    in[2] = objz;
+    in[3] = 1.0;
+    __gluMultMatrixVecf(modelMatrix, in, out);
+    __gluMultMatrixVecf(projMatrix, out, in);
+    if (in[3] == 0.0)
+        return(GL_FALSE);
+    in[0] /= in[3];
+    in[1] /= in[3];
+    in[2] /= in[3];
+    /* Map x, y and z to range 0-1 */
+    in[0] = in[0] * 0.5 + 0.5;
+    in[1] = in[1] * 0.5 + 0.5;
+    in[2] = in[2] * 0.5 + 0.5;
+    /* Map x,y to viewport */
+    in[0] = in[0] * viewport[2] + viewport[0];
+    in[1] = in[1] * viewport[3] + viewport[1];
+    *winx = in[0];
+    *winy = in[1];
+    *winz = in[2];
+    return(GL_TRUE);
+}
+
+GLint
+myGluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz)
+{
+    GLdouble finalMatrix[16];
+    GLdouble in[4];
+    GLdouble out[4];
+    
+    __gluMultMatricesf(modelMatrix, projMatrix, finalMatrix);
+    if (!__gluInvertMatrixf(finalMatrix, finalMatrix))
+        return(GL_FALSE);
+    
+    in[0] = winx;
+    in[1] = winy;
+    in[2] = winz;
+    in[3] = 1.0;
+    
+    /* Map x and y from window coordinates */
+    in[0] = (in[0] - viewport[0]) / viewport[2];
+    in[1] = (in[1] - viewport[1]) / viewport[3];
+    
+    /* Map to range -1 to 1 */
+    in[0] = in[0] * 2 - 1;
+    in[1] = in[1] * 2 - 1;
+    in[2] = in[2] * 2 - 1;
+    
+    __gluMultMatrixVecf(finalMatrix, in, out);
+    if (out[3] == 0.0) return(GL_FALSE);
+    out[0] /= out[3];
+    out[1] /= out[3];
+    out[2] /= out[3];
+    *objx = out[0];
+    *objy = out[1];
+    *objz = out[2];
+    return(GL_TRUE);
+}
+
+void
+myGluPerspective(GLdouble fovy_degree, GLdouble aspect, GLdouble zNear, GLdouble zFar) {
+    GLdouble m[16];
+    GLdouble fovy_rad = fovy_degree * (3.14159265358979 / 180.0);
+    GLdouble f = 1.0 / tan(fovy_rad / (GLdouble)2.0);
+    m[0] = f / aspect;
+    m[1] = 0.0;
+    m[2] = 0.0;
+    m[3] = 0.0;
+    m[4] = 0.0;
+    m[5] = f;
+    m[6] = 0.0;
+    m[7] = 0.0;
+    m[8] = 0.0;
+    m[9] = 0.0;
+    m[10] = (zFar + zNear) / (zNear - zFar);
+    m[11] = -1.0;
+    m[12] = 0.0;
+    m[13] = 0.0;
+    m[14] = (2 * zFar * zNear) / (zNear - zFar);
+    m[15] = 0.0;
+    glMatrixMode(GL_PROJECTION);
+    glLoadMatrixd(m);
+}
+
 #pragma mark ==== MainView public methods ====
 
 void
@@ -298,7 +461,7 @@ MainView_convertScreenPositionToObjectPosition(MainView *mview, const GLfloat *s
         winZ = screenPos[2];
     else
         glReadPixels(screenPos[0] * scale, screenPos[1] * scale, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ);
-    gluUnProject(screenPos[0] * scale, screenPos[1] * scale, winZ, mview->modelview_matrix, mview->projection_matrix, viewport, &posX, &posY, &posZ);
+    myGluUnProject(screenPos[0] * scale, screenPos[1] * scale, winZ, mview->modelview_matrix, mview->projection_matrix, viewport, &posX, &posY, &posZ);
     n = glGetError();
        MainViewCallback_unlockFocus(mview);
        objectPos[0] = posX;
@@ -323,7 +486,7 @@ MainView_convertObjectPositionToScreenPosition(MainView *mview, const double *ob
     viewport[0] = viewport[1] = 0;
     viewport[2] = (GLint)(rect[2] - rect[0]) * scale;
     viewport[3] = (GLint)(rect[3] - rect[1]) * scale;
-    gluProject(objectPos[0], objectPos[1], objectPos[2], mview->modelview_matrix, mview->projection_matrix, viewport, &objX, &objY, &objZ);
+    myGluProject(objectPos[0], objectPos[1], objectPos[2], mview->modelview_matrix, mview->projection_matrix, viewport, &objX, &objY, &objZ);
     if (glGetError() == GL_NO_ERROR) {
                screenPos[0] = objX / scale;
                screenPos[1] = objY / scale;
@@ -1777,7 +1940,7 @@ MainView_drawModel(MainView *mview)
     mview->perspective_vector[1] = width / height;
     mview->perspective_vector[2] = dimension;
     mview->perspective_vector[3] = distance + 200.0 * dimension;
-    gluPerspective(mview->perspective_vector[0], mview->perspective_vector[1], mview->perspective_vector[2], mview->perspective_vector[3]);
+    myGluPerspective(mview->perspective_vector[0], mview->perspective_vector[1], mview->perspective_vector[2], mview->perspective_vector[3]);
 
     /*  Set up the model view  */
     glMatrixMode(GL_MODELVIEW);
index 44acba4..17e43a8 100644 (file)
@@ -634,7 +634,7 @@ s_MolActionLog(Molecule *mol, MolAction *action, FILE *fp)
                                MoleculeCallback_displayName(argp->u.mval, buf, sizeof buf);
                                if (buf[0] == 0) {
                                        /*  No associated document  */
-                                       snprintf(buf, sizeof buf, "#<Molecule:0x%lx>", (long unsigned)(void *)argp->u.mval);
+                                       snprintf(buf, sizeof buf, "#<Molecule:0x%lx>", (uintptr_t)(void *)argp->u.mval);
                                }
                                fprintf(fp, "%s", buf);
                                break;
index 0fe2954..0dd48b1 100755 (executable)
@@ -9387,12 +9387,12 @@ MoleculeChangeResidueNumberWithArray(Molecule *mp, IntGroup *group, Int *resSeqs
        Atom *ap;
        
        /*  If LSB of resSeqs is 1, then a constant value is used for all specified atoms  */
-       if (((int)resSeqs & 1) == 0) {
+       if (((uintptr_t)resSeqs & 1) == 0) {
                withArray = 1;
                resSeq = 0;
        } else {
                withArray = 0;
-               resSeq = ((int)resSeqs - 1) / 2;
+               resSeq = ((uintptr_t)resSeqs - 1) / 2;
        }
        
        IntGroupIteratorInit(group, &iter);
index 0f28809..2b7bbc9 100755 (executable)
@@ -21,6 +21,7 @@
 #include <stdarg.h>
 #include <math.h>
 #include <float.h>
+#include "Missing.h"
 
 /*  Global parameter: it is initialized by the first call to ParameterReadFromFile()  */
 Parameter *gBuiltinParameters = NULL;
index 3cf97c4..a37282f 100644 (file)
@@ -789,7 +789,7 @@ static VALUE
 s_Ruby_UpdateUI_handler(VALUE data)
 {
        void **p = (void **)data;
-       int index = (int)p[0];
+       int index = (intptr_t)p[0];
        Molecule *mol = (Molecule *)p[1];
        int *outChecked = (int *)p[2];
        char **outTitle = (char **)p[3];
@@ -8626,7 +8626,7 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
        VALUE gval, rval, wval;
        IntGroup *ig;
        IntGroupIterator iter;
-       int nn, errno, i, j, in, status;
+       int nn, errnum, i, j, in, status;
        Vector *ref;
        Double *weights, dval[3];
        Transform tr;
@@ -8647,7 +8647,7 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
        if (rb_obj_is_kind_of(rval, rb_cNumeric)) {
                int fn = NUM2INT(rb_Integer(rval));
                if (fn < 0 || fn >= MoleculeGetNumberOfFrames(mol)) {
-                       errno = 1;
+                       errnum = 1;
                        status = fn;
                        goto err;
                }
@@ -8660,7 +8660,7 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
        } else if (rb_obj_is_kind_of(rval, rb_cLAMatrix)) {
                LAMatrix *m = LAMatrixFromValue(rval, NULL, 0, 0);
                if (m->row * m->column < nn * 3) {
-                       errno = 2;
+                       errnum = 2;
                        goto err;
                }
                for (i = 0; i < nn; i++) {
@@ -8672,24 +8672,24 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
                VALUE aval;
                rval = rb_protect(rb_ary_to_ary, rval, &status);
                if (status != 0) {
-                       errno = 3;
+                       errnum = 3;
                        goto err;
                }
                if (RARRAY_LEN(rval) < nn) {
-                       errno = 2;
+                       errnum = 2;
                        goto err;
                }
                if (rb_obj_is_kind_of((RARRAY_PTR(rval))[0], rb_cNumeric)) {
                        /*  Array of 3*nn numbers  */
                        if (RARRAY_LEN(rval) < nn * 3) {
-                               errno = 2;
+                               errnum = 2;
                                goto err;
                        }
                        for (i = 0; i < nn; i++) {
                                for (j = 0; j < 3; j++) {
                                        aval = rb_protect(rb_Float, (RARRAY_PTR(rval))[i * 3 + j], &status);
                                        if (status != 0) {
-                                               errno = 3;
+                                               errnum = 3;
                                                goto err;
                                        }
                                        dval[j] = NUM2DBL(aval);
@@ -8707,18 +8707,18 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
                                } else {
                                        aval = rb_protect(rb_ary_to_ary, aval, &status);
                                        if (status != 0) {
-                                               errno = 3;
+                                               errnum = 3;
                                                goto err;
                                        }
                                        if (RARRAY_LEN(aval) < 3) {
-                                               errno = 4;
+                                               errnum = 4;
                                                status = i;
                                                goto err;
                                        }
                                        for (j = 0; j < 3; j++) {
                                                VALUE aaval = rb_protect(rb_Float, (RARRAY_PTR(aval))[j], &status);
                                                if (status != 0) {
-                                                       errno = 3;
+                                                       errnum = 3;
                                                        goto err;
                                                }
                                                dval[j] = NUM2DBL(aaval);
@@ -8740,17 +8740,17 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
        } else {
                wval = rb_protect(rb_ary_to_ary, wval, &status);
                if (status != 0) {
-                       errno = 3;
+                       errnum = 3;
                        goto err;
                }
                if (RARRAY_LEN(wval) < nn) {
-                       errno = 5;
+                       errnum = 5;
                        goto err;
                }
                for (i = 0; i < nn; i++) {
                        VALUE wwval = rb_protect(rb_Float, (RARRAY_PTR(wval))[i], &status);
                        if (status != 0) {
-                               errno = 3;
+                               errnum = 3;
                                goto err;
                        }
                        weights[i] = NUM2DBL(wwval);
@@ -8758,27 +8758,27 @@ s_Molecule_FitCoordinates(int argc, VALUE *argv, VALUE self)
        }
        dval[0] = s_Molecule_FitCoordinates_Sub(mol, ig, ref, weights, tr);
        if (dval[0] < 0) {
-               errno = 6;
+               errnum = 6;
                goto err;
        }
-       errno = 0;
+       errnum = 0;
 err:
        IntGroupIteratorRelease(&iter);
        free(ref);
        free(weights);
-       if (errno == 0) {
+       if (errnum == 0) {
                return rb_ary_new3(2, ValueFromTransform(&tr), rb_float_new(dval[0]));
-       } else if (errno == 1) {
+       } else if (errnum == 1) {
                rb_raise(rb_eMolbyError, "frame index (%d) is out of range", status);
-       } else if (errno == 2) {
+       } else if (errnum == 2) {
                rb_raise(rb_eMolbyError, "insufficient number of reference coordinates");
-       } else if (errno == 3) {
+       } else if (errnum == 3) {
                rb_jump_tag(status);
-       } else if (errno == 4) {
+       } else if (errnum == 4) {
                rb_raise(rb_eMolbyError, "less than 3 elements for index %d of reference coordinates", status);
-       } else if (errno == 5) {
+       } else if (errnum == 5) {
                rb_raise(rb_eMolbyError, "insufficient number of weight values");
-       } else if (errno == 6) {
+       } else if (errnum == 6) {
                rb_raise(rb_eMolbyError, "matrix calculation failed during coordinate fitting");
        }
        return Qnil;  /*  Not reached  */
index f8bcda0..fd77b59 100644 (file)
@@ -1773,26 +1773,26 @@ s_RubyDialog_doTableAction(VALUE val)
                vp[3] = (void *)(intptr_t)(NUM2INT(rb_Integer(retval)));
                return retval;
        } else if (sym == sOnGetValueSymbol) {
-               args[1] = INT2NUM((int)vp[3]);
-               args[2] = INT2NUM((int)vp[4]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
+               args[2] = INT2NUM((intptr_t)vp[4]);
                retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
                retval = rb_str_to_str(retval);
                vp[5] = strdup(EncodedStringValuePtr(retval));
                return retval;
        } else if (sym == sOnSetValueSymbol) {
-               args[1] = INT2NUM((int)vp[3]);
-               args[2] = INT2NUM((int)vp[4]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
+               args[2] = INT2NUM((intptr_t)vp[4]);
                args[3] = Ruby_NewEncodedStringValue2((char *)vp[5]);
                retval = s_RubyDialog_CallActionProc(self, pval, 4, args);
                vp[6] = (void *)(intptr_t)(NUM2INT(rb_Integer(retval)));
                return retval;
        } else if (sym == sOnDragSelectionToRowSymbol) {
-               args[1] = INT2NUM((int)vp[3]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
                retval = s_RubyDialog_CallActionProc(self, pval, 2, args);
                return retval;
        } else if (sym == sIsItemEditableSymbol) {
-               args[1] = INT2NUM((int)vp[3]);
-               args[2] = INT2NUM((int)vp[4]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
+               args[2] = INT2NUM((intptr_t)vp[4]);
                retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
                vp[5] = (void *)(intptr_t)(RTEST(retval) ? 1 : 0);
                return retval;
@@ -1809,8 +1809,8 @@ s_RubyDialog_doTableAction(VALUE val)
                float *bg = (float *)vp[6];
                int i, n = 0;
                VALUE cval;
-               args[1] = INT2NUM((int)vp[3]);
-               args[2] = INT2NUM((int)vp[4]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
+               args[2] = INT2NUM((intptr_t)vp[4]);
                retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
                if (retval == Qnil)
                        return Qnil;
@@ -1834,8 +1834,8 @@ s_RubyDialog_doTableAction(VALUE val)
                vp[7] = (void *)(intptr_t)n;
                return retval;
        } else if (sym == sHasPopUpMenuSymbol) {
-               args[1] = INT2NUM((int)vp[3]);
-               args[2] = INT2NUM((int)vp[4]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
+               args[2] = INT2NUM((intptr_t)vp[4]);
                retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
                if (retval == Qnil) {
                        vp[6] = (void *)0;
@@ -1854,9 +1854,9 @@ s_RubyDialog_doTableAction(VALUE val)
                }
                return retval;
        } else if (sym == sOnPopUpMenuSelectedSymbol) {
-               args[1] = INT2NUM((int)vp[3]);
-               args[2] = INT2NUM((int)vp[4]);
-               args[3] = INT2NUM((int)vp[5]);
+               args[1] = INT2NUM((intptr_t)vp[3]);
+               args[2] = INT2NUM((intptr_t)vp[4]);
+               args[3] = INT2NUM((intptr_t)vp[5]);
                retval = s_RubyDialog_CallActionProc(self, pval, 4, args);
                return retval;
        } else return Qnil;
@@ -1873,7 +1873,7 @@ RubyDialog_GetTableItemCount(RubyValue self, RDItem *ip)
                return 0;
        } else if (val == Qnil)
                return 0;
-       else return (int)vp[3]; 
+       else return (intptr_t)vp[3];
 }
 
 void
@@ -1899,7 +1899,7 @@ RubyDialog_SetTableItemText(RubyValue self, RDItem *ip, int row, int column, con
        if (status != 0 || val == Qnil) {
                return -1;
        } else
-               return (int)vp[6];
+               return (intptr_t)vp[6];
 }
 
 void
@@ -1920,7 +1920,7 @@ RubyDialog_IsTableItemEditable(RubyValue self, RDItem *ip, int row, int column)
        VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
        if (status != 0 || val == Qnil)
                return 0;
-       else return (int)vp[5]; 
+       else return (intptr_t)vp[5];
 }
 
 int
@@ -1931,7 +1931,7 @@ RubyDialog_IsTableDragAndDropEnabled(RubyValue self, RDItem *ip, int row)
        VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
        if (status != 0 || val == Qnil)
                return 0;
-       else return (int)vp[3]; 
+       else return (intptr_t)vp[3];
 }
 
 void
@@ -1952,7 +1952,7 @@ RubyDialog_SetTableItemColor(RubyValue self, RDItem *ip, int row, int column, fl
        VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
        if (status != 0 || val == Qnil)
                return 0;
-       else return (int)vp[7];
+       else return (intptr_t)vp[7];
 }
 
 int
@@ -1963,7 +1963,7 @@ RubyDialog_HasPopUpMenu(RubyValue self, RDItem *ip, int row, int column, char **
        VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
        if (status != 0 || val == Qnil)
                return 0;
-       else return (int)vp[6];
+       else return (intptr_t)vp[6];
 }
 
 void
@@ -2026,7 +2026,7 @@ s_RubyDialog_doItemAction(VALUE val)
        VALUE flag;
        RDItem *ip = (RDItem *)vp[1];
        RDItem *ip2;
-       int options = (int)vp[2];
+       int options = (intptr_t)vp[2];
        VALUE ival, itval, actval, tval, aval;
        RubyDialog *dref = s_RubyDialog_GetController(self);
        VALUE items = rb_iv_get(self, "_items");
@@ -2210,7 +2210,7 @@ s_RubyDialog_doKeyAction(VALUE val)
 {
        void **values = (void **)val;
        VALUE self = (VALUE)values[0];
-       int keyCode = (int)values[1];
+       int keyCode = (intptr_t)values[1];
        VALUE actval = rb_iv_get(self, "_key_action");
        if (actval != Qnil) {
                if (TYPE(actval) == T_SYMBOL)
@@ -2268,7 +2268,7 @@ RubyDialog_getFlexFlags(RubyValue self, RDItem *ip)
                return -1;
        else if (rval == Qnil)
                return -1;
-       else return (int)args[2];
+       else return (intptr_t)args[2];
 }
 
 static VALUE
@@ -2276,7 +2276,7 @@ s_RubyDialog_doCloseWindow(VALUE val)
 {
        void **values = (void **)val;
        VALUE self = (VALUE)values[0];
-       int isModal = (int)values[1];
+       int isModal = (intptr_t)values[1];
        if (isModal) {
                rb_funcall(self, rb_intern("end_modal"), 1, INT2NUM(1));
                return Qnil;
diff --git a/README b/README
index 1a01767..6f3032d 100644 (file)
--- a/README
+++ b/README
@@ -5,7 +5,7 @@
     An Interactive Molecular Modeling Software
         with Integrated Ruby Interpreter
   
-          Version 1.0.2
+          Version 1.1.0
 
                   Toshi Nagata
 
diff --git a/Version b/Version
index 4098653..b2b60a5 100644 (file)
--- a/Version
+++ b/Version
@@ -1 +1 @@
-version = "1.0.2"
+version = "1.1.0"
index 3b8c834..d1311a9 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *jump_to_end_xpm[] = {
+static const char *jump_to_end_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "9 9 7 1",
 /* colors */
index febe404..00c95e1 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *jump_to_start_xpm[] = {
+static const char *jump_to_start_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "9 9 8 1",
 /* colors */
index 7e7fa3e..72e9123 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi00[] = {\r
+static const char *pi00[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 20 1",\r
 /* colors */\r
index 1a042bf..daf16a7 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi01[] = {\r
+static const char *pi01[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 23 1",\r
 /* colors */\r
index 74e17cf..63a803b 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi02[] = {\r
+static const char *pi02[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 19 1",\r
 /* colors */\r
index 2741589..43f860f 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi03[] = {\r
+static const char *pi03[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 20 1",\r
 /* colors */\r
index 52685bb..058d040 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi04[] = {\r
+static const char *pi04[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 24 1",\r
 /* colors */\r
index 031001b..1456a30 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi05[] = {\r
+static const char *pi05[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 19 1",\r
 /* colors */\r
index 059d6fa..4adc71c 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi06[] = {\r
+static const char *pi06[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 19 1",\r
 /* colors */\r
index 99f34bf..9287c57 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi07[] = {\r
+static const char *pi07[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 24 1",\r
 /* colors */\r
index 0b6686e..00d23ce 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi08[] = {\r
+static const char *pi08[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 20 1",\r
 /* colors */\r
index 5491fcc..340db47 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi09[] = {\r
+static const char *pi09[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 20 1",\r
 /* colors */\r
index 55eb0bd..012eaae 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi10[] = {\r
+static const char *pi10[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 23 1",\r
 /* colors */\r
index e0b0d58..2908544 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *pi11[] = {\r
+static const char *pi11[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 19 1",\r
 /* colors */\r
index ad4db8a..9391e98 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *play_backward_xpm[] = {
+static const char *play_backward_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "9 9 12 1",
 /* colors */
index 0acea49..e62db24 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *play_forward_xpm[] = {
+static const char *play_forward_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "9 9 12 1",
 /* colors */
index b130a37..f36a6ec 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *rotate_bond_xpm[] = {
+static const char *rotate_bond_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "18 18 30 2",
 /* colors */
index a290bb0..bf68d1a 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *rotate_x_xpm[] = {
+static const char *rotate_x_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "18 18 29 2",
 /* colors */
index 3cf16ca..322527f 100755 (executable)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *rotate_y_xpm[] = {
+static const char *rotate_y_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "18 18 26 1",
 /* colors */
index 9378667..956d6c5 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *stop_mini[] = {\r
+static const char *stop_mini[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 34 2",\r
 /* colors */\r
index 922b161..a3ad71f 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *stop_mini_dark[] = {\r
+static const char *stop_mini_dark[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 42 2",\r
 /* colors */\r
index 7e63911..eb86fd6 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */\r
-static char *stop_mini_grey[] = {\r
+static const char *stop_mini_grey[] = {\r
 /* width height ncolors chars_per_pixel */\r
 "12 12 71 2",\r
 /* colors */\r
index f77a3a4..65ba693 100644 (file)
@@ -1,7 +1,7 @@
 ;  Create an installer that can install both 32bit and 64bit versions
 [Setup]
 AppName = Molby
-AppVerName = Molby (v1.0.2)
+AppVerName = Molby (v1.1.0)
 DefaultDirName = {pf}\Molby
 DefaultGroupName = Molby
 UninstallDisplayIcon = {app}\Molby.exe
index 4120948..4293c06 100644 (file)
@@ -1,6 +1,6 @@
 [Setup]
 AppName = Molby
-AppVerName = Molby (v1.0.2)
+AppVerName = Molby (v1.1.0)
 DefaultDirName = {pf}\Molby (32bit)
 DefaultGroupName = Molby (32bit)
 UninstallDisplayIcon = {app}\Molby.exe
index 05ed060..bd7f719 100644 (file)
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-       <string>Version 1.0.2</string>
+       <string>Version 1.1.0</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>v1.0.2</string>
+       <string>v1.1.0</string>
        <key>NSHumanReadableCopyright</key>
        <string>Copyright 2008-2022 Toshi Nagata</string>
        <key>NSPrincipalClass</key>
index 0f4f7ae..cdc147d 100644 (file)
@@ -25,7 +25,6 @@
 
 /* Begin PBXBuildFile section */
                E403568428CF6A3D008E2C46 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E403568328CF6A3D008E2C46 /* QuartzCore.framework */; };
-               E403568528D0AD7E008E2C46 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4FC7845183E51180064FB2E /* Carbon.framework */; };
                E403568628D0B7B0008E2C46 /* MyListCtrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41251B728CD92A100E12983 /* MyListCtrl.cpp */; };
                E4059F9B28C46A6E0052B36B /* molby_icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E4FC77D4183E4FF20064FB2E /* molby_icon.icns */; };
                E4059F9C28C46A6E0052B36B /* Scripts in Resources */ = {isa = PBXBuildFile; fileRef = E4FC77D6183E4FFE0064FB2E /* Scripts */; };
                E4589CEF28D5FD6400F55785 /* MyToggleButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4589CEE28D5FD6400F55785 /* MyToggleButton.cpp */; };
                E4589CF028D5FD6400F55785 /* MyToggleButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4589CEE28D5FD6400F55785 /* MyToggleButton.cpp */; };
                E4589CF228D6E89900F55785 /* docview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45B94611A170B9A008E95EB /* docview.cpp */; };
+               E4589CF528D82A5200F55785 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4FC7845183E51180064FB2E /* Carbon.framework */; };
                E4653CB118A0CC7D0022377B /* textctrl_addition.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4653CB018A0CC7D0022377B /* textctrl_addition.mm */; };
                E4ACACE718C6D32300F08B67 /* ortep3 in Resources */ = {isa = PBXBuildFile; fileRef = E4ACACE418C6D32300F08B67 /* ortep3 */; };
                E4D379A219C87C2200636D28 /* modalwindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D379A119C87C2200636D28 /* modalwindow.cpp */; };
                                E4FC784D183E51180064FB2E /* Cocoa.framework in Frameworks */,
                                E4FC784E183E51180064FB2E /* GLUT.framework in Frameworks */,
                                E4FC784F183E51180064FB2E /* IOKit.framework in Frameworks */,
-                               E403568528D0AD7E008E2C46 /* Carbon.framework in Frameworks */,
+                               E4589CF528D82A5200F55785 /* Carbon.framework in Frameworks */,
                                E4FC7850183E51180064FB2E /* OpenGL.framework in Frameworks */,
                                E4FC7852183E51180064FB2E /* System.framework in Frameworks */,
                                E4FC7A17183E51570064FB2E /* AppKit.framework in Frameworks */,
index d2d3d0b..87171d7 100755 (executable)
@@ -387,7 +387,7 @@ ConsoleFrame::OnEnterPressed()
 void
 ConsoleFrame::ShowHistory(bool up, bool option)
 {
-       char *p;
+       const char *p;
        if (commandHistoryIndex == -1 && valueHistoryIndex == -1) {
                if (!up)
                        return;
index a047857..1bd0e79 100755 (executable)
@@ -407,7 +407,6 @@ MoleculeView::OnDraw(wxDC *dc)
                        wxImage *img = CaptureGLCanvas(scale);
                        if (img != NULL) {
                                wxBitmap bitmap(*img);
-                               wxSize ppi = dc->GetPPI();
                                double sx, sy;
                                dc->GetUserScale(&sx, &sy);
                                dc->SetUserScale(sx / scale, sy / scale);
@@ -930,7 +929,8 @@ MoleculeView::OnLeftDClickInListCtrl(wxMouseEvent &event)
        if (mview->tableIndex >= kMainViewBondTableIndex && mview->tableIndex <= kMainViewImproperTableIndex /* && mview->mol->par != NULL */ ) {
                int row, col, i;
                char indices[64], names[64], types[64], value[20], partypes[64], params[3][20];
-               char *ptype, *parstr;
+        const char *ptype;
+        char *parstr;
                wxPoint pos = event.GetPosition();
                if (!listctrl->FindItemAtPosition(pos, &row, &col) || col < 4)
                        return;
@@ -952,6 +952,7 @@ MoleculeView::OnLeftDClickInListCtrl(wxMouseEvent &event)
                }
                asprintf(&parstr, "%s %s %s", params[0], params[1], params[2]);
                MolActionCreateAndPerform(mview->mol, SCRIPT_ACTION("sssssss"), "cmd_edit_local_parameter_in_mainview", ptype, indices, names, types, value, partypes, parstr);
+        free(parstr);
        }
 }
 
index 756f0dd..c8f2414 100755 (executable)
@@ -627,7 +627,7 @@ MyApp::CreateMenuBar(int kind, wxMenu **out_file_history_menu, wxMenu **out_edit
        return menu_bar;
 }
 
-#if __WXMAC__
+#if defined(__WXMAC__) || defined(__WXOSX__)
 /*  When the application is launched without any documents, an empty document is opened.
     This should be implemented by overriding this special method; parsing argc/argv does
     not work, because the list of files is passed through an Apple Event.  */
@@ -646,53 +646,21 @@ MyApp::MacOpenFile(const wxString &fileName)
        RequestOpenFilesByEvent(file);
 }
 
-/*  Open given files: instead of calling MacOpenFile() for each entry, build a file list
-    and call MyApp::OnOpenFiles()  */
-short
-MyApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply))
-{
-    AEDescList docList;
-    AEKeyword keywd;
-    DescType returnedType;
-    Size actualSize;
-    long itemsInList;
-    OSErr err;
-    short i;
-       
-       return noErr;  /*  TODO: handle open Apple event  */
-       
-    err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList, &docList);
-    if (err != noErr)
-        return err;
-       
-    err = AECountItems(&docList, &itemsInList);
-    if (err != noErr)
-        return err;
-       
-    ProcessSerialNumber PSN ;
-    PSN.highLongOfPSN = 0 ;
-    PSN.lowLongOfPSN = kCurrentProcess ;
-    SetFrontProcess( &PSN ) ;
-       
-    wxString fName, fNameList;
-    FSRef theRef ;
-       
-    for (i = 1; i <= itemsInList; i++)
-    {
-        AEGetNthPtr(
-                                       &docList, i, typeFSRef, &keywd, &returnedType,
-                                       (Ptr)&theRef, sizeof(theRef), &actualSize);
-    //    fName = wxMacFSRefToPath( &theRef ) ;
-               fNameList.append(fName);
-               fNameList.append(wxT("\n"));
+void
+MyApp::MacOpenFiles(const wxArrayString &fileNames)
+{
+    wxString fnames;
+    int i, n;
+    n = fileNames.GetCount();
+    for (i = 0; i < n; i++) {
+        fnames = fnames + fileNames[i];
+        if (i < n - 1)
+            fnames = fnames + wxT("\n");
     }
-       
-       OnOpenFiles(fNameList);
-       
-    return noErr;
+    OnOpenFiles(fnames);
 }
 
-#endif
+#endif  // WXMAC
 
 int
 MyApp::OnExit(void)
@@ -1444,10 +1412,8 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback)
 {
        int status = 0;
        int callback_result = 0;
-       int count = 0;
        bool progress_panel = false;
        char buf[256];
-       size_t len, len_total;
        wxString cmdstr(cmdline, WX_DEFAULT_CONV);
        wxLongLong startTime;
 
@@ -1817,7 +1783,8 @@ AboutDialog::AboutDialog():
     //          |
     //          |-> copyright messages
 
-    char *s1, *s2, *s3;
+    const char *s1;
+    char *s2, *s3;
     s1 = "Molby";
     Molby_getDescription(&s2, &s3);
     wxString str1(s1, WX_DEFAULT_CONV);
index 54be592..e3a3764 100755 (executable)
@@ -239,7 +239,7 @@ class MyApp: public wxApp
 #if defined(__WXMAC__)
        virtual void MacNewFile();
        virtual void MacOpenFile(const wxString &fileName);
-       virtual short MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply));
+    virtual void MacOpenFiles(const wxArrayString &fileNames);
 #endif
        
        void EnableTimerForDocument(MyDocument *doc);
index b8c1452..6f1dff8 100644 (file)
@@ -15,7 +15,7 @@
  GNU General Public License for more details.
  */
 
-const char *gVersionString = "v1.0.2";
+const char *gVersionString = "v1.1.0";
 const char *gCopyrightString = "Copyright (c) 2008-2022 Toshi Nagata";
 /*  The following are now defined in build/buildInfo.c, generated by record_build_date.sh  */
 /*int gRevisionNumber = 0;
index 7066ade..e50caa7 100644 (file)
@@ -63,7 +63,7 @@ InitializeOpenGLExtensions(void)
 {
     int n = 0;
     if (p_inited != 0)
-        return;
+        return 0;
     p_glIsRenderbufferEXT = (t_glIsRenderbufferEXT)wglGetProcAddress("glIsRenderbufferEXT");
     if (p_glIsRenderbufferEXT == NULL)
         n++;
index b2b6805..9ac57ce 100755 (executable)
@@ -108,7 +108,7 @@ ProgressFrame::SetInterruptValue(int value)
 int
 ProgressFrame::CheckInterrupt()
 {
-       if (this != NULL && m_interruptValue) {
+       if (m_interruptValue) {
                int save = m_interruptValue;
                m_interruptValue = 0;
                return save;
index 714613b..5b07ce4 100644 (file)
@@ -1294,38 +1294,41 @@ RubyDialogCallback_setFontForItem(RDItem *item, int size, int family, int style,
        } else return;
        if (size == 0)
                size = font.GetPointSize();
+    wxFontFamily ffamily;
+    wxFontStyle fstyle;
+    wxFontWeight fweight;
        if (family == 0)
-        family = wxFONTFAMILY_DEFAULT;
+        ffamily = wxFONTFAMILY_DEFAULT;
        else {
-               family = (family == 2 ? wxFONTFAMILY_ROMAN :
+               ffamily = (family == 2 ? wxFONTFAMILY_ROMAN :
                                  (family == 3 ? wxFONTFAMILY_SWISS :
                                   (family == 4 ? wxFONTFAMILY_MODERN :
                                        wxFONTFAMILY_DEFAULT)));
        }
        if (style == 0)
-        style = wxFONTSTYLE_NORMAL;
+        fstyle = wxFONTSTYLE_NORMAL;
        else {
-               style = (style == 2 ? wxFONTSTYLE_SLANT :
+               fstyle = (style == 2 ? wxFONTSTYLE_SLANT :
                                 (style == 3 ? wxFONTSTYLE_ITALIC :
                                  wxFONTSTYLE_NORMAL));
        }
        if (weight == 0)
-        weight = wxFONTWEIGHT_NORMAL;
+        fweight = wxFONTWEIGHT_NORMAL;
        else {
-               weight = (weight == 2 ? wxFONTWEIGHT_BOLD :
+               fweight = (weight == 2 ? wxFONTWEIGHT_BOLD :
                                  (weight == 3 ? wxFONTWEIGHT_LIGHT :
                                   wxFONTWEIGHT_NORMAL));
        }
        if (textctrl != NULL) {
                wxTextAttr newAttr;
-               wxFont newFont(size, family, style, weight);
+        wxFont newFont(size, ffamily, fstyle, fweight);
                newAttr.SetFont(newFont);
                textctrl->SetDefaultStyle(newAttr);
 #if __WXMAC__
                textctrl->SetFont(newFont);
 #endif
        } else {
-               ctrl->SetFont(wxFont(size, family, style, weight));
+        ctrl->SetFont(wxFont(size, ffamily, fstyle, fweight));
                wxString label = ctrl->GetLabel();
                ctrl->SetLabel(_(""));
                ctrl->SetLabel(label);  /*  Update the control size  */
@@ -1757,14 +1760,15 @@ RubyDialogCallback_setFont(RDDeviceContext *dc, void **args)
             float size = FromDCDIP(dcp, *((float *)(args[i + 1])));
                        font.SetPointSize((int)size);
                } else if (strcmp((const char *)args[i], "style") == 0) {
-                       long style = (intptr_t)(args[i + 1]);
+                       int style = (intptr_t)(args[i + 1]);
+            wxFontStyle fstyle;
                        switch (style) {
-                               case 0: style = wxFONTSTYLE_NORMAL; break;
-                               case 1: style = wxFONTSTYLE_ITALIC; break;
-                               case 2: style = wxFONTSTYLE_SLANT; break;
-                               default: style = wxFONTSTYLE_NORMAL; break;
+                               case 0: fstyle = wxFONTSTYLE_NORMAL; break;
+                               case 1: fstyle = wxFONTSTYLE_ITALIC; break;
+                               case 2: fstyle = wxFONTSTYLE_SLANT; break;
+                               default: fstyle = wxFONTSTYLE_NORMAL; break;
                        }
-                       font.SetStyle(style);
+                       font.SetStyle(fstyle);
                } else if (strcmp((const char *)args[i], "family") == 0) {
                        wxFontFamily family;
                        j = (intptr_t)(args[i + 1]);
@@ -1811,16 +1815,17 @@ RubyDialogCallback_setPen(RDDeviceContext *dc, void **args)
                                pen.SetWidth((int)width);
                        } else if (strcmp((const char *)args[i], "style") == 0) {
                                long style = (intptr_t)(args[i + 1]);
+                wxPenStyle pstyle;
                                switch (style) {
-                                       case 0: style = wxSOLID; break;
-                                       case 1: style = wxTRANSPARENT; break;
-                                       case 2: style = wxDOT; break;
-                                       case 3: style = wxLONG_DASH; break; 
-                                       case 4: style = wxSHORT_DASH; break;
-                                       case 5: style = wxDOT_DASH; break;
-                                       default: style = wxSOLID; break;
+                                       case 0: pstyle = wxPENSTYLE_SOLID; break;
+                                       case 1: pstyle = wxPENSTYLE_TRANSPARENT; break;
+                                       case 2: pstyle = wxPENSTYLE_DOT; break;
+                                       case 3: pstyle = wxPENSTYLE_LONG_DASH; break;
+                                       case 4: pstyle = wxPENSTYLE_SHORT_DASH; break;
+                                       case 5: pstyle = wxPENSTYLE_DOT_DASH; break;
+                                       default: pstyle = wxPENSTYLE_SOLID; break;
                                }
-                               pen.SetStyle(style);
+                               pen.SetStyle(pstyle);
                        }
                }
        }