From 242857b07b9ba3a0ae656e60a429bc3bb1fe77c6 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 15 May 2004 08:07:20 +0000 Subject: [PATCH] reorganized Msg() a little ("a la getdp" + colorize solver and direct messages) --- Box/Main.cpp | 8 +-- Common/License.cpp | 122 ++++++++++++++++++++++----------------------- Common/Message.h | 20 +++----- Fltk/Callbacks.cpp | 22 ++++---- Fltk/GUI.cpp | 30 +++++------ Fltk/Main.cpp | 34 ++++++------- Fltk/Message.cpp | 50 ++++++++++--------- Fltk/Solvers.cpp | 6 +-- 8 files changed, 143 insertions(+), 149 deletions(-) diff --git a/Box/Main.cpp b/Box/Main.cpp index 7508ae9f0b..92ff243a30 100644 --- a/Box/Main.cpp +++ b/Box/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.40 2004-05-12 20:16:49 geuzaine Exp $ +// $Id: Main.cpp,v 1.41 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -200,8 +200,8 @@ void Msg(int level, char *fmt, ...) case FATAL3: abort = 1; case FATAL1: case FATAL2: - fprintf(stderr, "On processor %d : ", ParUtil::Instance()->rank()); fprintf(stderr, FATAL_STR); + fprintf(stderr, "[on processor %d] ", ParUtil::Instance()->rank()); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); break; @@ -210,8 +210,8 @@ void Msg(int level, char *fmt, ...) case GERROR1: case GERROR2: case GERROR3: - fprintf(stderr, "On processor %d : ", ParUtil::Instance()->rank()); fprintf(stderr, ERROR_STR); + fprintf(stderr, "[on processor %d] ", ParUtil::Instance()->rank()); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); break; @@ -221,8 +221,8 @@ void Msg(int level, char *fmt, ...) case WARNING2: case WARNING3: if(CTX.verbosity >= 1) { - fprintf(stderr, "On processor %d : ", ParUtil::Instance()->rank()); fprintf(stderr, WARNING_STR); + fprintf(stderr, "[on processor %d] ", ParUtil::Instance()->rank()); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); } diff --git a/Common/License.cpp b/Common/License.cpp index 195462ce5f..894fe28919 100644 --- a/Common/License.cpp +++ b/Common/License.cpp @@ -1,4 +1,4 @@ -// $Id: License.cpp,v 1.3 2004-02-07 01:40:17 geuzaine Exp $ +// $Id: License.cpp,v 1.4 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -25,14 +25,14 @@ void print_license(void) { Msg(DIRECT, " GNU GENERAL PUBLIC LICENSE"); Msg(DIRECT, " Version 2, June 1991"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " Copyright (C) 1989, 1991 Free Software Foundation, Inc."); Msg(DIRECT, " 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"); Msg(DIRECT, " Everyone is permitted to copy and distribute verbatim copies"); Msg(DIRECT, " of this license document, but changing it is not allowed."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " Preamble"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " The licenses for most software are designed to take away your"); Msg(DIRECT, "freedom to share and change it. By contrast, the GNU General Public"); Msg(DIRECT, "License is intended to guarantee your freedom to share and change free"); @@ -42,65 +42,65 @@ void print_license(void) Msg(DIRECT, "using it. (Some other Free Software Foundation software is covered by"); Msg(DIRECT, "the GNU Library General Public License instead.) You can apply it to"); Msg(DIRECT, "your programs, too."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " When we speak of free software, we are referring to freedom, not"); Msg(DIRECT, "price. Our General Public Licenses are designed to make sure that you"); Msg(DIRECT, "have the freedom to distribute copies of free software (and charge for"); Msg(DIRECT, "this service if you wish), that you receive source code or can get it"); Msg(DIRECT, "if you want it, that you can change the software or use pieces of it"); Msg(DIRECT, "in new free programs; and that you know you can do these things."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " To protect your rights, we need to make restrictions that forbid"); Msg(DIRECT, "anyone to deny you these rights or to ask you to surrender the rights."); Msg(DIRECT, "These restrictions translate to certain responsibilities for you if you"); Msg(DIRECT, "distribute copies of the software, or if you modify it."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " For example, if you distribute copies of such a program, whether"); Msg(DIRECT, "gratis or for a fee, you must give the recipients all the rights that"); Msg(DIRECT, "you have. You must make sure that they, too, receive or can get the"); Msg(DIRECT, "source code. And you must show them these terms so they know their"); Msg(DIRECT, "rights."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " We protect your rights with two steps: (1) copyright the software, and"); Msg(DIRECT, "(2) offer you this license which gives you legal permission to copy,"); Msg(DIRECT, "distribute and/or modify the software."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " Also, for each author's protection and ours, we want to make certain"); Msg(DIRECT, "that everyone understands that there is no warranty for this free"); Msg(DIRECT, "software. If the software is modified by someone else and passed on, we"); Msg(DIRECT, "want its recipients to know that what they have is not the original, so"); Msg(DIRECT, "that any problems introduced by others will not reflect on the original"); Msg(DIRECT, "authors' reputations."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " Finally, any free program is threatened constantly by software"); Msg(DIRECT, "patents. We wish to avoid the danger that redistributors of a free"); Msg(DIRECT, "program will individually obtain patent licenses, in effect making the"); Msg(DIRECT, "program proprietary. To prevent this, we have made it clear that any"); Msg(DIRECT, "patent must be licensed for everyone's free use or not licensed at all."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " The precise terms and conditions for copying, distribution and"); Msg(DIRECT, "modification follow."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " GNU GENERAL PUBLIC LICENSE"); Msg(DIRECT, " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 0. This License applies to any program or other work which contains"); Msg(DIRECT, "a notice placed by the copyright holder saying it may be distributed"); Msg(DIRECT, "under the terms of this General Public License. The \"Program\", below,"); - Msg(DIRECT, "refers to any such program or work, and a \"work based on the Program\""); + Msg(DIRECT, "refers to any such program or work, and a \"work based on the Program\" "); Msg(DIRECT, "means either the Program or any derivative work under copyright law:"); Msg(DIRECT, "that is to say, a work containing the Program or a portion of it,"); Msg(DIRECT, "either verbatim or with modifications and/or translated into another"); Msg(DIRECT, "language. (Hereinafter, translation is included without limitation in"); Msg(DIRECT, "the term \"modification\".) Each licensee is addressed as \"you\"."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "Activities other than copying, distribution and modification are not"); Msg(DIRECT, "covered by this License; they are outside its scope. The act of"); Msg(DIRECT, "running the Program is not restricted, and the output from the Program"); Msg(DIRECT, "is covered only if its contents constitute a work based on the"); Msg(DIRECT, "Program (independent of having been made by running the Program)."); Msg(DIRECT, "Whether that is true depends on what the Program does."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 1. You may copy and distribute verbatim copies of the Program's"); Msg(DIRECT, "source code as you receive it, in any medium, provided that you"); Msg(DIRECT, "conspicuously and appropriately publish on each copy an appropriate"); @@ -108,23 +108,23 @@ void print_license(void) Msg(DIRECT, "notices that refer to this License and to the absence of any warranty;"); Msg(DIRECT, "and give any other recipients of the Program a copy of this License"); Msg(DIRECT, "along with the Program."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "You may charge a fee for the physical act of transferring a copy, and"); Msg(DIRECT, "you may at your option offer warranty protection in exchange for a fee."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 2. You may modify your copy or copies of the Program or any portion"); Msg(DIRECT, "of it, thus forming a work based on the Program, and copy and"); Msg(DIRECT, "distribute such modifications or work under the terms of Section 1"); Msg(DIRECT, "above, provided that you also meet all of these conditions:"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " a) You must cause the modified files to carry prominent notices"); Msg(DIRECT, " stating that you changed the files and the date of any change."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " b) You must cause any work that you distribute or publish, that in"); Msg(DIRECT, " whole or in part contains or is derived from the Program or any"); Msg(DIRECT, " part thereof, to be licensed as a whole at no charge to all third"); Msg(DIRECT, " parties under the terms of this License."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " c) If the modified program normally reads commands interactively"); Msg(DIRECT, " when run, you must cause it, when started running for such"); Msg(DIRECT, " interactive use in the most ordinary way, to print or display an"); @@ -135,7 +135,7 @@ void print_license(void) Msg(DIRECT, " License. (Exception: if the Program itself is interactive but"); Msg(DIRECT, " does not normally print such an announcement, your work based on"); Msg(DIRECT, " the Program is not required to print an announcement.)"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "These requirements apply to the modified work as a whole. If"); Msg(DIRECT, "identifiable sections of that work are not derived from the Program,"); Msg(DIRECT, "and can be reasonably considered independent and separate works in"); @@ -145,38 +145,38 @@ void print_license(void) Msg(DIRECT, "on the Program, the distribution of the whole must be on the terms of"); Msg(DIRECT, "this License, whose permissions for other licensees extend to the"); Msg(DIRECT, "entire whole, and thus to each and every part regardless of who wrote it."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "Thus, it is not the intent of this section to claim rights or contest"); Msg(DIRECT, "your rights to work written entirely by you; rather, the intent is to"); Msg(DIRECT, "exercise the right to control the distribution of derivative or"); Msg(DIRECT, "collective works based on the Program."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "In addition, mere aggregation of another work not based on the Program"); Msg(DIRECT, "with the Program (or with a work based on the Program) on a volume of"); Msg(DIRECT, "a storage or distribution medium does not bring the other work under"); Msg(DIRECT, "the scope of this License."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 3. You may copy and distribute the Program (or a work based on it,"); Msg(DIRECT, "under Section 2) in object code or executable form under the terms of"); Msg(DIRECT, "Sections 1 and 2 above provided that you also do one of the following:"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " a) Accompany it with the complete corresponding machine-readable"); Msg(DIRECT, " source code, which must be distributed under the terms of Sections"); Msg(DIRECT, " 1 and 2 above on a medium customarily used for software interchange; or,"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " b) Accompany it with a written offer, valid for at least three"); Msg(DIRECT, " years, to give any third party, for a charge no more than your"); Msg(DIRECT, " cost of physically performing source distribution, a complete"); Msg(DIRECT, " machine-readable copy of the corresponding source code, to be"); Msg(DIRECT, " distributed under the terms of Sections 1 and 2 above on a medium"); Msg(DIRECT, " customarily used for software interchange; or,"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " c) Accompany it with the information you received as to the offer"); Msg(DIRECT, " to distribute corresponding source code. (This alternative is"); Msg(DIRECT, " allowed only for noncommercial distribution and only if you"); Msg(DIRECT, " received the program in object code or executable form with such"); Msg(DIRECT, " an offer, in accord with Subsection b above.)"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "The source code for a work means the preferred form of the work for"); Msg(DIRECT, "making modifications to it. For an executable work, complete source"); Msg(DIRECT, "code means all the source code for all modules it contains, plus any"); @@ -187,13 +187,13 @@ void print_license(void) Msg(DIRECT, "form) with the major components (compiler, kernel, and so on) of the"); Msg(DIRECT, "operating system on which the executable runs, unless that component"); Msg(DIRECT, "itself accompanies the executable."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "If distribution of executable or object code is made by offering"); Msg(DIRECT, "access to copy from a designated place, then offering equivalent"); Msg(DIRECT, "access to copy the source code from the same place counts as"); Msg(DIRECT, "distribution of the source code, even though third parties are not"); Msg(DIRECT, "compelled to copy the source along with the object code."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 4. You may not copy, modify, sublicense, or distribute the Program"); Msg(DIRECT, "except as expressly provided under this License. Any attempt"); Msg(DIRECT, "otherwise to copy, modify, sublicense or distribute the Program is"); @@ -201,7 +201,7 @@ void print_license(void) Msg(DIRECT, "However, parties who have received copies, or rights, from you under"); Msg(DIRECT, "this License will not have their licenses terminated so long as such"); Msg(DIRECT, "parties remain in full compliance."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 5. You are not required to accept this License, since you have not"); Msg(DIRECT, "signed it. However, nothing else grants you permission to modify or"); Msg(DIRECT, "distribute the Program or its derivative works. These actions are"); @@ -210,7 +210,7 @@ void print_license(void) Msg(DIRECT, "Program), you indicate your acceptance of this License to do so, and"); Msg(DIRECT, "all its terms and conditions for copying, distributing or modifying"); Msg(DIRECT, "the Program or works based on it."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 6. Each time you redistribute the Program (or any work based on the"); Msg(DIRECT, "Program), the recipient automatically receives a license from the"); Msg(DIRECT, "original licensor to copy, distribute or modify the Program subject to"); @@ -218,7 +218,7 @@ void print_license(void) Msg(DIRECT, "restrictions on the recipients' exercise of the rights granted herein."); Msg(DIRECT, "You are not responsible for enforcing compliance by third parties to"); Msg(DIRECT, "this License."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 7. If, as a consequence of a court judgment or allegation of patent"); Msg(DIRECT, "infringement or for any other reason (not limited to patent issues),"); Msg(DIRECT, "conditions are imposed on you (whether by court order, agreement or"); @@ -231,12 +231,12 @@ void print_license(void) Msg(DIRECT, "all those who receive copies directly or indirectly through you, then"); Msg(DIRECT, "the only way you could satisfy both it and this License would be to"); Msg(DIRECT, "refrain entirely from distribution of the Program."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "If any portion of this section is held invalid or unenforceable under"); Msg(DIRECT, "any particular circumstance, the balance of the section is intended to"); Msg(DIRECT, "apply and the section as a whole is intended to apply in other"); Msg(DIRECT, "circumstances."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "It is not the purpose of this section to induce you to infringe any"); Msg(DIRECT, "patents or other property right claims or to contest validity of any"); Msg(DIRECT, "such claims; this section has the sole purpose of protecting the"); @@ -247,10 +247,10 @@ void print_license(void) Msg(DIRECT, "system; it is up to the author/donor to decide if he or she is willing"); Msg(DIRECT, "to distribute software through any other system and a licensee cannot"); Msg(DIRECT, "impose that choice."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "This section is intended to make thoroughly clear what is believed to"); Msg(DIRECT, "be a consequence of the rest of this License."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 8. If the distribution and/or use of the Program is restricted in"); Msg(DIRECT, "certain countries either by patents or by copyrighted interfaces, the"); Msg(DIRECT, "original copyright holder who places the Program under this License"); @@ -258,12 +258,12 @@ void print_license(void) Msg(DIRECT, "those countries, so that distribution is permitted only in or among"); Msg(DIRECT, "countries not thus excluded. In such case, this License incorporates"); Msg(DIRECT, "the limitation as if written in the body of this License."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 9. The Free Software Foundation may publish revised and/or new versions"); Msg(DIRECT, "of the General Public License from time to time. Such new versions will"); Msg(DIRECT, "be similar in spirit to the present version, but may differ in detail to"); Msg(DIRECT, "address new problems or concerns."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "Each version is given a distinguishing version number. If the Program"); Msg(DIRECT, "specifies a version number of this License which applies to it and \"any"); Msg(DIRECT, "later version\", you have the option of following the terms and conditions"); @@ -271,7 +271,7 @@ void print_license(void) Msg(DIRECT, "Software Foundation. If the Program does not specify a version number of"); Msg(DIRECT, "this License, you may choose any version ever published by the Free Software"); Msg(DIRECT, "Foundation."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 10. If you wish to incorporate parts of the Program into other free"); Msg(DIRECT, "programs whose distribution conditions are different, write to the author"); Msg(DIRECT, "to ask for permission. For software which is copyrighted by the Free"); @@ -279,9 +279,9 @@ void print_license(void) Msg(DIRECT, "make exceptions for this. Our decision will be guided by the two goals"); Msg(DIRECT, "of preserving the free status of all derivatives of our free software and"); Msg(DIRECT, "of promoting the sharing and reuse of software generally."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " NO WARRANTY"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY"); Msg(DIRECT, "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN"); Msg(DIRECT, "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES"); @@ -291,7 +291,7 @@ void print_license(void) Msg(DIRECT, "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE"); Msg(DIRECT, "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,"); Msg(DIRECT, "REPAIR OR CORRECTION."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING"); Msg(DIRECT, "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR"); Msg(DIRECT, "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,"); @@ -301,63 +301,63 @@ void print_license(void) Msg(DIRECT, "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER"); Msg(DIRECT, "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE"); Msg(DIRECT, "POSSIBILITY OF SUCH DAMAGES."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " END OF TERMS AND CONDITIONS"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " How to Apply These Terms to Your New Programs"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " If you develop a new program, and you want it to be of the greatest"); Msg(DIRECT, "possible use to the public, the best way to achieve this is to make it"); Msg(DIRECT, "free software which everyone can redistribute and change under these terms."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " To do so, attach the following notices to the program. It is safest"); Msg(DIRECT, "to attach them to the start of each source file to most effectively"); Msg(DIRECT, "convey the exclusion of warranty; and each file should have at least"); Msg(DIRECT, "the \"copyright\" line and a pointer to where the full notice is found."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " <one line to give the program's name and a brief idea of what it does.>"); Msg(DIRECT, " Copyright (C) <year> <name of author>"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " This program is free software; you can redistribute it and/or modify"); Msg(DIRECT, " it under the terms of the GNU General Public License as published by"); Msg(DIRECT, " the Free Software Foundation; either version 2 of the License, or"); Msg(DIRECT, " (at your option) any later version."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " This program is distributed in the hope that it will be useful,"); Msg(DIRECT, " but WITHOUT ANY WARRANTY; without even the implied warranty of"); Msg(DIRECT, " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"); Msg(DIRECT, " GNU General Public License for more details."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " You should have received a copy of the GNU General Public License"); Msg(DIRECT, " along with this program; if not, write to the Free Software"); Msg(DIRECT, " Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"); - Msg(DIRECT, ""); - Msg(DIRECT, ""); + Msg(DIRECT, " "); + Msg(DIRECT, " "); Msg(DIRECT, "Also add information on how to contact you by electronic and paper mail."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "If the program is interactive, make it output a short notice like this"); Msg(DIRECT, "when it starts in an interactive mode:"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " Gnomovision version 69, Copyright (C) year name of author"); Msg(DIRECT, " Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'."); Msg(DIRECT, " This is free software, and you are welcome to redistribute it"); Msg(DIRECT, " under certain conditions; type `show c' for details."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "The hypothetical commands `show w' and `show c' should show the appropriate"); Msg(DIRECT, "parts of the General Public License. Of course, the commands you use may"); Msg(DIRECT, "be called something other than `show w' and `show c'; they could even be"); Msg(DIRECT, "mouse-clicks or menu items--whatever suits your program."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "You should also get your employer (if you work as a programmer) or your"); Msg(DIRECT, "school, if any, to sign a \"copyright disclaimer\" for the program, if"); Msg(DIRECT, "necessary. Here is a sample; alter the names:"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " Yoyodyne, Inc., hereby disclaims all copyright interest in the program"); Msg(DIRECT, " `Gnomovision' (which makes passes at compilers) written by James Hacker."); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " <signature of Ty Coon>, 1 April 1989"); Msg(DIRECT, " Ty Coon, President of Vice"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "This General Public License does not permit incorporating your program into"); Msg(DIRECT, "proprietary programs. If your program is a subroutine library, you may"); Msg(DIRECT, "consider it more useful to permit linking proprietary applications with the"); diff --git a/Common/Message.h b/Common/Message.h index b35c00871a..40933e7032 100644 --- a/Common/Message.h +++ b/Common/Message.h @@ -55,21 +55,17 @@ #define STATUS2N 25 // Same as STATUS2, but not going into the log file #define STATUS3N 26 // Same as STATUS3, but not going into the log file -#define LOG_INFO 29 // Info put only in the logfile - #define DIRECT 30 // Direct message (no special formatting) -#define FATAL_STR "Fatal Error : " -#define FATAL_NIL " : " -#define ERROR_STR "Error : " -#define ERROR_NIL " : " +#define SOLVER 31 // Solver message + +#define WHITE_STR " : " +#define FATAL_STR "Fatal : " +#define ERROR_STR "Error : " #define WARNING_STR "Warning : " -#define WARNING_NIL " : " -#define INFO_STR "Info : " -#define INFO_NIL " : " -#define DEBUG_STR "Debug : " -#define DEBUG_NIL " : " -#define STATUS_STR "Info : " +#define INFO_STR "Info : " +#define DEBUG_STR "Debug : " +#define STATUS_STR "Info : " void Signal (int signum); void Msg (int level, char *fmt, ...); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 0ecaeb223c..28c92556c2 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.228 2004-05-12 16:47:26 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.229 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -1549,9 +1549,9 @@ void visibility_number_cb(CALLBACK_ARGS) void help_short_cb(CALLBACK_ARGS) { // *INDENT-OFF* - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "Mouse:"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " move - highlight the elementary geometrical entity"); Msg(DIRECT, " currently under the mouse pointer and display"); Msg(DIRECT, " its properties in the status bar"); @@ -1566,12 +1566,12 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " - cancel a rubber zoom"); Msg(DIRECT, " - pop up menu on post-processing view button"); Msg(DIRECT, " "XX"+Right button reset to default viewpoint"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " For a 2 button mouse, Middle button = Shift+Left button"); Msg(DIRECT, " For a 1 button mouse, Middle button = Shift+Left button, Right button = Alt+Left button"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "Menu bar shortcuts:"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " < go back to previous context"); Msg(DIRECT, " > go forward to next context"); Msg(DIRECT, " Shift+a raise (show) all open windows"); @@ -1591,9 +1591,9 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " "XX"+s save mesh in default format"); Msg(DIRECT, " "XX"+Shift+s save file as"); Msg(DIRECT, " Shift+w show current post-processing view options"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, "Other shortcuts"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); Msg(DIRECT, " 0 or Esc reload geometry input file"); Msg(DIRECT, " 1 or F1 mesh lines"); Msg(DIRECT, " 2 or F2 mesh surfaces"); @@ -1626,7 +1626,7 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " Right arrow go to next time step"); Msg(DIRECT, " Up arrow make previous view visible"); Msg(DIRECT, " Down arrow make next view visible"); - Msg(DIRECT, ""); + Msg(DIRECT, " "); // *INDENT-ON* WID->create_message_window(); } @@ -1635,7 +1635,7 @@ void help_short_cb(CALLBACK_ARGS) void help_command_line_cb(CALLBACK_ARGS) { - Msg(DIRECT, ""); + Msg(DIRECT, " "); Print_Usage("gmsh"); WID->create_message_window(); } @@ -1643,7 +1643,7 @@ void help_command_line_cb(CALLBACK_ARGS) void help_license_cb(CALLBACK_ARGS) { extern void print_license(); - Msg(DIRECT, ""); + Msg(DIRECT, " "); print_license(); WID->create_message_window(); } diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 48abb7f751..5b289ba6a3 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.296 2004-05-12 03:46:16 geuzaine Exp $ +// $Id: GUI.cpp,v 1.297 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -1068,7 +1068,7 @@ void GUI::set_context(Context_Item * menu_asked, int flag) return; } - Msg(STATUS2, menu[0].label + 1); + Msg(STATUS2N, menu[0].label + 1); switch (m_module_butt->value()) { case 3: // post-processing contexts @@ -2766,7 +2766,7 @@ void GUI::add_multiline_in_browser(Fl_Browser * o, char *prefix, char *str) int start = 0, len; char *buff; if(!str || !strlen(str) || !strcmp(str, "\n")) { - o->add(""); + o->add(" "); return; } for(unsigned int i = 0; i < strlen(str); i++) { @@ -2837,14 +2837,14 @@ PluginDialogBox *GUI::create_plugin_window(GMSH_Plugin * p) Fl_Browser *o = new Fl_Browser(2 * WB, 2 * WB + 1 * BH, width - 4 * WB, height - 5 * WB - 2 * BH); - o->add(""); + o->add(" "); add_multiline_in_browser(o, "@c@b@.", namep); - o->add(""); + o->add(" "); add_multiline_in_browser(o, "", help); - o->add(""); + o->add(" "); add_multiline_in_browser(o, "Author: ", author); add_multiline_in_browser(o, "Copyright (C) ", copyright); - o->add(""); + o->add(" "); g->end(); } @@ -3091,21 +3091,21 @@ void GUI::create_about_window() { Fl_Browser *o = new Fl_Browser(WB + 80, WB, width - 2 * WB - 80, height - 3 * WB - BH); - o->add(""); + o->add(" "); o->add("@c@b@.Gmsh"); o->add("@c@.A three-dimensional finite element mesh generator"); o->add("@c@.with built-in pre- and post-processing facilities"); - o->add(""); + o->add(" "); o->add("@c@.Copyright (C) 1997-2004"); #if defined(__APPLE__) o->add("@c@.Christophe Geuzaine and Jean-Francois Remacle"); #else o->add("@c@.Christophe Geuzaine and Jean-François Remacle"); #endif - o->add(""); + o->add(" "); o->add("@c@.Please send all questions and bug reports to"); o->add("@c@b@.gmsh@geuz.org"); - o->add(""); + o->add(" "); sprintf(buffer, "@c@.Version: %s", GMSH_VERSION); o->add(buffer); sprintf(buffer, "@c@.License: %s", GMSH_SHORT_LICENSE); @@ -3123,9 +3123,9 @@ void GUI::create_about_window() o->add(buffer); sprintf(buffer, "@c@.Packaged by: %s", GMSH_PACKAGER); o->add(buffer); - o->add(""); + o->add(" "); o->add("@c@.Visit http://www.geuz.org/gmsh/ for more information"); - o->add(""); + o->add(" "); } { @@ -3447,9 +3447,9 @@ void GUI::create_solver_window(int num) Fl_Browser *o = new Fl_Browser(2 * WB, 2 * WB + 1 * BH, width - 4 * WB, height - (5 + newrow) * WB - (2 + newrow) * BH); - o->add(""); + o->add(" "); add_multiline_in_browser(o, "@c@b@.", SINFO[num].name); - o->add(""); + o->add(" "); add_multiline_in_browser(o, "@c@. ", SINFO[num].help); g[2]->end(); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index dd261afe34..95043c74bc 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.65 2004-05-12 20:16:49 geuzaine Exp $ +// $Id: Main.cpp,v 1.66 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -113,13 +113,6 @@ int main(int argc, char *argv[]) if(CTX.batch) CTX.terminal = 1; - if(CTX.verbosity && CTX.terminal) - fprintf(stderr, "Gmsh %s, started %s\n", GMSH_VERSION, currtime); - - // Register Default Plugins - - - // Signal handling signal(SIGINT, Signal); @@ -130,7 +123,7 @@ int main(int argc, char *argv[]) if(CTX.batch) { check_gsl(); - Msg(DIRECT, "Command line : %s", cmdline); + Msg(INFO, "Running '%s'", cmdline); OpenProblem(CTX.filename); if(yyerrorstate) exit(1); @@ -182,20 +175,21 @@ int main(int argc, char *argv[]) // Say welcome! Msg(STATUS3N, "Ready"); - Msg(STATUS1, "Gmsh %s", GMSH_VERSION); + Msg(STATUS1N, "Gmsh %s", GMSH_VERSION); // Log the following for bug reports - Msg(LOG_INFO, "-------------------------------------------------------"); - Msg(LOG_INFO, gmsh_os); - Msg(LOG_INFO, "%s%s", gmsh_options, Get_BuildOptions()); - Msg(LOG_INFO, gmsh_date); - Msg(LOG_INFO, gmsh_host); - Msg(LOG_INFO, gmsh_packager); - Msg(LOG_INFO, "Home directory : %s", CTX.home_dir); - Msg(LOG_INFO, "Launch date : %s", currtime); - Msg(LOG_INFO, "Command line : %s", cmdline); - Msg(LOG_INFO, "-------------------------------------------------------"); + Msg(INFO, "-------------------------------------------------------"); + Msg(INFO, "Gmsh version : %s", GMSH_VERSION); + Msg(INFO, gmsh_os); + Msg(INFO, "%s%s", gmsh_options, Get_BuildOptions()); + Msg(INFO, gmsh_date); + Msg(INFO, gmsh_host); + Msg(INFO, gmsh_packager); + Msg(INFO, "Home directory : %s", CTX.home_dir); + Msg(INFO, "Launch date : %s", currtime); + Msg(INFO, "Command line : %s", cmdline); + Msg(INFO, "-------------------------------------------------------"); Free(cmdline); diff --git a/Fltk/Message.cpp b/Fltk/Message.cpp index 78809ed37e..294a07edf1 100644 --- a/Fltk/Message.cpp +++ b/Fltk/Message.cpp @@ -1,4 +1,4 @@ -// $Id: Message.cpp,v 1.48 2004-05-12 03:22:13 geuzaine Exp $ +// $Id: Message.cpp,v 1.49 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -75,51 +75,53 @@ void Debug() void Msg(int level, char *fmt, ...) { va_list args; - int abort = 0, verb = 0, window = -1, log = 1; + int abort = 0, verb = 0, window = -1, log = 1, color = 0; char *str = NULL; // *INDENT-OFF* switch(level){ - case DIRECT : verb = 2; break ; + case DIRECT : color = 5; verb = 2; break ; + case SOLVER : color = 4; verb = 2; break ; case STATUS1N : log = 0; //fallthrough - case STATUS1 : verb = 1; window = 0; break ; + case STATUS1 : str = INFO_STR; verb = 1; window = 0; break ; case STATUS2N : log = 0; //fallthrough - case STATUS2 : verb = 1; window = 1; break ; + case STATUS2 : str = INFO_STR; verb = 1; window = 1; break ; case STATUS3N : log = 0; //fallthrough - case STATUS3 : verb = 1; window = 2; break ; + case STATUS3 : str = INFO_STR; verb = 1; window = 2; break ; case FATAL : str = FATAL_STR; abort = 1; break ; case FATAL1 : str = FATAL_STR; break ; - case FATAL2 : str = FATAL_NIL; break ; - case FATAL3 : str = FATAL_NIL; abort = 1; break ; + case FATAL2 : str = WHITE_STR; break ; + case FATAL3 : str = WHITE_STR; abort = 1; break ; case GERROR : case GERROR1 : str = ERROR_STR; break ; case GERROR2 : - case GERROR3 : str = ERROR_NIL; break ; + case GERROR3 : str = WHITE_STR; break ; case WARNING : case WARNING1 : str = WARNING_STR; verb = 1; break ; case WARNING2 : - case WARNING3 : str = WARNING_NIL; verb = 1; break ; + case WARNING3 : str = WHITE_STR; verb = 1; break ; case INFO : case INFO1 : str = INFO_STR; verb = 2; break ; case INFO2 : - case INFO3 : str = INFO_NIL; verb = 2; break ; + case INFO3 : str = WHITE_STR; verb = 2; break ; case DEBUG : case DEBUG1 : str = DEBUG_STR; verb = 3; break ; case DEBUG2 : - case DEBUG3 : str = DEBUG_NIL; verb = 3; break ; - - case LOG_INFO : verb = 2 ; window = 3; break ; + case DEBUG3 : str = WHITE_STR; verb = 3; break ; default : return; } // *INDENT-ON* + if(verb < 2) + color = 1; + #define BUFFSIZE 1024 static char buff1[BUFFSIZE], buff2[BUFFSIZE], buff[4][BUFFSIZE]; @@ -155,15 +157,17 @@ void Msg(int level, char *fmt, ...) #else vsnprintf(buff[window], BUFFSIZE, fmt, args); #endif - if(window <= 2) - WID->set_status(buff[window], window); - if(log && strlen(buff[window])) - WID->add_message(buff[window]); + WID->set_status(buff[window], window); + if(log && strlen(buff[window])){ + strcpy(buff1, str ? str : ""); + strncat(buff1, buff[window], BUFFSIZE-strlen(buff1)); + WID->add_message(buff1); + } } else if(log) { - strcpy(buff1, "@C1"); + sprintf(buff1, "@C%d", color); if(str) - strncat(buff1, str, BUFFSIZE-4); + strncat(buff1, str, BUFFSIZE-strlen(buff1)); #if defined(HAVE_NO_VSNPRINTF) vsprintf(buff2, fmt, args); @@ -174,7 +178,7 @@ void Msg(int level, char *fmt, ...) if(CTX.terminal) fprintf(stderr, "%s\n", &buff1[3]); if(WID) { - if(verb < 2) + if(color) WID->add_message(buff1); else WID->add_message(&buff1[3]); @@ -257,9 +261,9 @@ void GetResources(long *s, long *us, long *mem) *mem = (long)r.ru_maxrss; } -void PrintResources(char *fmt, long s, long us, long mem) +void PrintResources(long s, long us, long mem) { - Msg(DIRECT, "Resources = %scpu %ld.%ld s / mem %ld kb\n", fmt, s, us, mem); + Msg(INFO, "cpu %ld.%ld s / mem %ld kb\n", s, us, mem); } double Cpu(void) diff --git a/Fltk/Solvers.cpp b/Fltk/Solvers.cpp index 758f569467..c2cb439fbf 100644 --- a/Fltk/Solvers.cpp +++ b/Fltk/Solvers.cpp @@ -1,4 +1,4 @@ -// $Id: Solvers.cpp,v 1.21 2004-02-07 01:40:17 geuzaine Exp $ +// $Id: Solvers.cpp,v 1.22 2004-05-15 08:07:20 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -125,12 +125,12 @@ int Solver(int num, char *args) case GMSH_CLIENT_INFO: case GMSH_CLIENT_WARNING: case GMSH_CLIENT_ERROR: - Msg(DIRECT, "%s : %s", SINFO[num].name, str); + Msg(SOLVER, "%-7s : %s", SINFO[num].name, str); break; default: Msg(WARNING, "Unknown type of message received from %s", SINFO[num].name); - Msg(DIRECT, "%s : %s", SINFO[num].name, str); + Msg(SOLVER, "%-7s : %s", SINFO[num].name, str); break; } if(stop) -- GitLab