pax_global_header00006660000000000000000000000064136560136600014520gustar00rootroot0000000000000052 comment=3662a044831ef2301c99bfb7b0b067416c3bff85 screentest-2.1/000077500000000000000000000000001365601366000135415ustar00rootroot00000000000000screentest-2.1/.gitignore000066400000000000000000000002641365601366000155330ustar00rootroot00000000000000*.o *.tar.gz *.gmo *~ # Autoconf cruft ;) /.deps/ /aclocal.m4 /autom4te.cache/ /build-aux/ /config.* /configure /libtool /po/POTFILES Makefile Makefile.in Makefile.in.in stamp-* screentest-2.1/.travis.yml000066400000000000000000000003051365601366000156500ustar00rootroot00000000000000language: c os: linux dist: bionic addons: apt: packages: - automake - intltool - libgtk2.0-dev - libtool-bin compiler: - clang - gcc script: ./autogen.sh && make screentest-2.1/AUTHORS000066400000000000000000000010671365601366000146150ustar00rootroot00000000000000This program is written by Jan "Yenya" Kasprzak & Tobias Gruetzmacher. Tobias Gruetzmacher URL: http://23.gs/ E-mail: tobias-screentest@23.gs Jan "Yenya" Kasprzak E-mail: kas@fi.muni.cz Snail: Jan Kasprzak Faculty of Informatics, Masaryk University Botanicka' 68a 602 00 Brno Czech Republic Translators: - Czech: Michal Simunek - Danish: Joe Hansen - German: Tobias Gruetzmacher - Finnish: Juhani Numminen - French: Mami Hicham screentest-2.1/COPYING000066400000000000000000000436131365601366000146030ustar00rootroot00000000000000*** This software is postcardware: if you like it, please send a nice *** *** postcard to the author's address (see the file AUTHORS). Sending *** *** the postcard is optional. The real usage terms are below: *** GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. screentest-2.1/Makefile.am000066400000000000000000000011371365601366000155770ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = po AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) -DDATADIR=\"$(pkgdatadir)\" EXTRA_DIST = screentest.ui NEW_TESTS.md README.md pkgdata_DATA = screentest.ui bin_PROGRAMS = screentest screentest_SOURCES = main.c main.h callbacks.c callbacks.h test_basic.c \ test_blink.c test_grid.c test_horizontal.c test_text.c \ test_vertical.c test_lcdalign.c gettext.h screentest_LDADD = $(GLIB_LIBS) $(GTK_LIBS) if WIN32 screentest_LDFLAGS = -mwindows else screentest_LDFLAGS = -export-dynamic endif ACLOCAL_AMFLAGS = -I build-aux screentest-2.1/NEWS000066400000000000000000000007771365601366000142530ustar00rootroot00000000000000Version 2.1 * Switches from Glade to GtkBuilder * Might compile under Windows * New test: LCD Alignment * Import translations from Debian Version 2.0 * Major overhaul. Now uses GTK+ 2.x and libglade * I18N - Please translate! (Has some issues with international characaters, should be solved in the next version) * More flexible colour selection, now pops up a colour picker for colours. * Make it easier to write new tests. Version 1.0 * This is a new program, so first news is this very existence :-) screentest-2.1/NEW_TESTS.md000066400000000000000000000121021365601366000154720ustar00rootroot00000000000000# ADDING A NEW TEST MODE The process of adding new modes to screentest is not very complicated. Follow these steps (let's assume you want to add a test called "circle"). Create the new test's source file, `test_circle.c`. You should copy the top of the file with copyright notice and #include statements from another source file (say `test_text.c`), so it looks like this: ```c /* [...] * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "callbacks.h" ``` Add the source file name (`test_circle.c`) to the `screentest_SOURCES` variable in `Makefile.am`. In `test_circle.c` you have to define the (non-static!) structure ```c G_MODULE_EXPORT struct test_ops circle_ops = { ``` Make sure the name of the structure ends in "_ops". This structure, which have four member functions, defines the basic operations of your test mode. The structure members are: ```c void circle_init(GtkWidget *widget); ``` This function is called when screentest is switched to your "circle" test. The argument is GtkWidget of type DrawingArea, which covers the whole screen. This function is optional, you can set it to NULL. ```c void circle_draw(GtkWidget *widget, gboolean clear); ``` This function is called when screentest decides to redraw the screen (either when mode/fgcolor/bgcolor changes, or the Expose event from the X server is received). The first argument is the same DrawingArea as above, the second one is True, when the screentest wants you to clear the window before you start drawing. This function is not optional. You must define it (after all, your test wants to draw something, doesn't it?). ```c void circle_cycle(GtkWidget *widget); ``` Screentest calls this function when user presses the left mouse button. You can use it to cycle through values of some parameter (let's say, the circle diameter). You don't need to redraw the screen. The `circle_draw()` function will be called afterwards. This function is optional, you can set the "cycle" member of `circle_ops` to `NULL`. The widget argument is the same as above. ```c void circle_close(GtkWidget *widget); ``` This function is called when screentest wants to switch to another mode (and is called before the new mode's `init()` function). You can use it to deallocate fonts, colors, timers or other resources you have allocated (for example in `circle_init()` function). This function is optional, you can set the "cycle" member of `circle_ops` to `NULL`. The widget argument is the same as above. You can use the following global variables in the above functions: ```c GdkGC *gc, *backgc; ``` These are two graphic contexts. The first one has the foreground color set to the current foreground color (default white) and background color to the current background color (default black). The second one has its foreground color set to the current background color (default black) and the background color to the current foreground color (default white). So you can use the first to draw with the foreground color and the second to draw with the background color. You can (ab)use these contexts for your own colors, but remember to set the color back to its original value before your return from the `circle_*` function. ```c GdkColor fgcolors[COLOR_MAX]; ``` The GdkColor array with preinitialized color values (see the enum `test_color` in callbacks.h). ```c GdkColor grays[GRAYS_MAX]; ``` The GdkColor array with pixels preinitialized to the shades of gray. `grays[0]` is black, `grays[GRAYS_MAX-1]` is white. Currently the `GRAYS_MAX` is #defined to `COLOR_MAX`, but do not depend on it. Use glade to add the new mode to the menu (alternatively, edit `screentest.ui` by hand). Make sure the name of the menu item is the name of your `_ops` struct without the "_ops" ending. Run ./autogen.sh and make. ## Contributing your changes If you want to distribute the resulting program: Beware this program is under the GNU General Public License, so if you distribute the modified version, you have to distribute the source code of all your modifications. See the file COPYING for details. You must make the `test_circle.c` available, but you don't have to send it to the author of this program. However, the author of this program kindly asks you to contribute any modifications. Please send your modifications to the author of screentest, Tobias Gruetzmacher . The preferred form of the contribution is either a GitHub pull request or an unified diff. To make a unified diff, follow these steps: - rename your directory with modified sources (for example `mv screentest-2.0 screentest-2.0-circle`). - run `make distclean` in this directory. - unpack the clean sources again: `zcat screentest-2.0.tar.gz | tar xvf -` - create the patch with the following command: `diff -uNr screentest-2.0 screentest-2.0-circle > screentest-circle.patch` - mail the screentest-circle.patch to the author. Thanks, - Tobias Gruetzmacher (current maintainer) - Jan "Yenya" Kasprzak (previous maintainer) screentest-2.1/README.md000066400000000000000000000052351365601366000150250ustar00rootroot00000000000000# Screentest This is a program for tesing the quality of CRT/LCD screens. It displays various patterns and allows you to estimate the quality of your CRT/LCD monitor. See the file [NEW_TESTS.md](NEW_TESTS.md) for details on adding a new test screens. The homepage of this program is https://tobix.github.io/screentest/ ### IF YOU LIKE IT This program is postcardware. Read the top of the file "COPYING" and send me a postcard, if you want. Let me know on what system you have tested it, so I can estimate the userbase and portability of the program. ### IF YOU DON'T LIKE IT Please let me know what can I do for improving screentest. Use the e-mail or report an issue on [GitHub](https://github.com/TobiX/screentest/issues/new). ## Authors - Tobias Gruetzmacher (current maintainer) - Jan "Yenya" Kasprzak (previous maintainer) ## Installation The installation of this program is pretty straightforward if you are familiar with using the command line: ### 0. PREREQUISITIES You will need the following libraries to compile this program: - GTK+ >= 2.0 (tested on 2.10.13) - glib >= 2.0 (tested on 2.12.13) You will need both the libraries (either in static or dynamic form), and their header files (which may not be installed on your system by default; for example, check for gtk+-devel, glib-devel and XFree86-devel packages on Red Hat Linux or Mandrake Linux). This also assumes that the "pkg-config" command is in your PATH. The source of screentest is available at the GitHub release page: https://github.com/TobiX/screentest/releases You will also need the ISO C9x-compliant C compiler. This program uses ISO C9x-style structure initializers, so this is a NECESSARY CONDITION. You can use for example gcc-3 or later, which is available on most Unices. The build process has been tested on Debian unstable (www.debian.org), but should work on any recent version of UNIX-compatible system. ### 1. PREPARING THE SOURCES Unpack the distribution using the following command: tar xvzf screentest-.tar.gz Change the directory to the source directory: cd screentest- Set it up for your system: ./configure You can run "./configure --help" for details of the configuration process. ### 2. COMPILING THE PROGRAM Run "make" (On BSD systems, you might want to use "gmake"). This will compile the "screentest" program. Since the program is mostly standalone, you can now verify their function by running them in the current directory (calling "./screentest"). ### 3. INSTALLING Run "make install". - Tobias Gruetzmacher (current maintainer) - Jan "Yenya" Kasprzak (previous maintainer) screentest-2.1/autogen.sh000077500000000000000000000106311365601366000155430ustar00rootroot00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 if [ -n "$GNOME2_DIR" ]; then ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" PATH="$GNOME2_DIR/bin:$PATH" export PATH export LD_LIBRARY_PATH fi (test -f $srcdir/configure.ac) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level package directory" exit 1 } (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && { (intltoolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`intltool' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/" DIE=1 } } (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && { (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`xml-i18n-toolize' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/" DIE=1 } } (grep "^AC_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 } } (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && { (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \ (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`glib' installed." echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" DIE=1 } } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -name _darcs -prune , -name configure.ac -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize... Ignore non-fatal messages." echo "no" | glib-gettextize --force --copy echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then echo "Running xml-i18n-toolize..." xml-i18n-toolize --copy --force --automake fi if grep "^AC_PROG_LIBTOOL" configure.ac >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then echo "Running libtoolize..." libtoolize --force --copy fi fi echo "Running aclocal $aclocalinclude ..." aclocal $aclocalinclude if grep "^AC_CONFIG_HEADER" configure.ac >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --copy --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile. || exit 1 else echo Skipping configure process. fi screentest-2.1/callbacks.c000066400000000000000000000156251365601366000156350ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include "callbacks.h" #include "main.h" #include "gettext.h" #define _(String) gettext(String) GdkColor fgcolors[COLOR_MAX]; GdkColor *fg_color, *bg_color; GdkColor grays[GRAYS_MAX]; GdkGC *gc, *backgc; int fg_count = COLOR_WHITE; static GtkWidget *mainwin = NULL; static struct test_ops *current_test = &basic_ops; G_MODULE_EXPORT void on_mainwin_realize(GtkWidget * widget, G_GNUC_UNUSED gpointer user_data) { gint i; #ifndef DEBUG gtk_window_fullscreen(GTK_WINDOW(widget)); #endif memset(fgcolors, 0, COLOR_MAX * sizeof(GdkColor)); fgcolors[COLOR_WHITE].red = fgcolors[COLOR_WHITE].green = fgcolors[COLOR_WHITE].blue = 65535; fgcolors[COLOR_RED].red = 65535; fgcolors[COLOR_GREEN].green = 65535; fgcolors[COLOR_BLUE].blue = 65535; fgcolors[COLOR_CYAN].green = 65535; fgcolors[COLOR_CYAN].blue = 65535; fgcolors[COLOR_MAGENTA].red = 65535; fgcolors[COLOR_MAGENTA].blue = 65535; fgcolors[COLOR_YELLOW].red = 65535; fgcolors[COLOR_YELLOW].green = 65535; /* COLOR_BLACK is 0 already */ fg_color = gdk_color_copy(&fgcolors[COLOR_WHITE]); bg_color = gdk_color_copy(&fgcolors[COLOR_BLACK]); for (i = 0; i < GRAYS_MAX; i++) grays[i].red = grays[i].green = grays[i].blue = i * ((1 << 16) - 1) / (GRAYS_MAX - 1); mainwin = widget; gc = gdk_gc_new(gtk_widget_get_window(mainwin)); backgc = gdk_gc_new(gtk_widget_get_window(mainwin)); if (current_test->init != NULL) current_test->init(widget); } static void update_fg_color(void) { gdk_gc_set_rgb_fg_color(gc, fg_color); gdk_gc_set_rgb_bg_color(backgc, fg_color); gdk_window_invalidate_rect(gtk_widget_get_window(mainwin), NULL, FALSE); } static void update_bg_color(void) { gdk_rgb_find_color(gtk_widget_get_colormap(GTK_WIDGET(mainwin)), bg_color); gdk_gc_set_rgb_bg_color(gc, bg_color); gdk_gc_set_rgb_fg_color(backgc, bg_color); gdk_window_invalidate_rect(gtk_widget_get_window(mainwin), NULL, FALSE); } G_MODULE_EXPORT gboolean on_mainwin_button_press_event(GtkWidget *widget, GdkEventButton *event, G_GNUC_UNUSED gpointer user_data) { GObject *popup; switch (event->button) { case 1: if (current_test->cycle != NULL) { current_test->cycle(widget); gdk_window_invalidate_rect(gtk_widget_get_window(mainwin), NULL, FALSE); } break; case 2: if (++fg_count >= COLOR_MAX) fg_count = COLOR_WHITE; gdk_color_free(fg_color); fg_color = gdk_color_copy(&fgcolors[fg_count]); update_fg_color(); break; case 3: popup = gtk_builder_get_object(builder, "popup"); gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL, event->button, event->time); break; } return TRUE; } /* * FIXME: GTK_WINDOW_POPUP does not seem to be able to receive * KeyPress events. How to enable this? */ G_MODULE_EXPORT gboolean on_mainwin_key_press_event(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED GdkEventKey *event, G_GNUC_UNUSED gpointer user_data) { gtk_main_quit(); return FALSE; } G_MODULE_EXPORT gboolean on_mainwin_expose_event(GtkWidget *widget, G_GNUC_UNUSED GdkEventExpose *event, G_GNUC_UNUSED gpointer user_data) { gdk_window_set_background(gtk_widget_get_window(widget), bg_color); gdk_window_clear(gtk_widget_get_window(widget)); if (current_test && current_test->draw) current_test->draw(widget); return TRUE; } G_MODULE_EXPORT void on_mode_change(GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) { GtkCheckMenuItem *checkmenuitem = GTK_CHECK_MENU_ITEM(menuitem); if (!gtk_check_menu_item_get_active(checkmenuitem)) { if (current_test->close != NULL) { current_test->close(mainwin); current_test = NULL; } } else { const char *test_name = gtk_buildable_get_name(GTK_BUILDABLE(menuitem)); g_assert(test_name != NULL); GModule *exe = g_module_open(NULL, 0); g_assert(exe != NULL); gchar *test_struct = g_strconcat(test_name, "_ops", NULL); if (g_module_symbol(exe, test_struct, (gpointer) ¤t_test) != TRUE) { GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(mainwin), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("No implementation for the test \"%s\" found."), test_name); gtk_window_set_title(GTK_WINDOW(dialog), PACKAGE_NAME); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_main_quit(); } free(test_struct); g_module_close(exe); if (current_test != NULL && current_test->init != NULL) { current_test->init(mainwin); } on_mainwin_expose_event(mainwin, NULL, NULL); } } G_MODULE_EXPORT void on_fg_color_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) { GtkColorSelection *colorsel; GObject *fg_color_selector; fg_color_selector = gtk_builder_get_object(builder, "fg_color_selector"); colorsel = GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(fg_color_selector))); gtk_color_selection_set_current_color(colorsel, fg_color); switch (gtk_dialog_run(GTK_DIALOG(fg_color_selector))) { case GTK_RESPONSE_OK: gtk_color_selection_get_current_color(colorsel, fg_color); update_fg_color(); break; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_DELETE_EVENT: break; default: g_assert_not_reached(); } gtk_widget_hide(GTK_WIDGET(fg_color_selector)); } G_MODULE_EXPORT void on_bg_color_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) { GtkColorSelection *colorsel; GObject *bg_color_selector; bg_color_selector = gtk_builder_get_object(builder, "bg_color_selector"); colorsel = GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(bg_color_selector))); gtk_color_selection_set_current_color(colorsel, bg_color); switch (gtk_dialog_run(GTK_DIALOG(bg_color_selector))) { case GTK_RESPONSE_OK: gtk_color_selection_get_current_color(colorsel, bg_color); update_bg_color(); break; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_DELETE_EVENT: break; default: g_assert_not_reached(); } gtk_widget_hide(GTK_WIDGET(bg_color_selector)); } screentest-2.1/callbacks.h000066400000000000000000000025671365601366000156430ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include struct test_ops { void (*init) (GtkWidget * widget); void (*draw) (GtkWidget * widget); void (*cycle) (GtkWidget * widget); void (*close) (GtkWidget * widget); }; extern struct test_ops basic_ops; enum test_color { COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_CYAN, COLOR_MAGENTA, COLOR_YELLOW, COLOR_BLACK, COLOR_MAX }; #define GRAYS_MAX COLOR_MAX extern GdkGC *gc, *backgc; extern GdkColor fgcolors[]; extern GdkColor *fg_color; extern GdkColor grays[]; screentest-2.1/configure.ac000066400000000000000000000017221365601366000160310ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(screentest, 2.1) AC_CONFIG_MACRO_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([screentest.ui]) AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE AC_CONFIG_HEADER(config.h) AC_ISC_POSIX AC_PROG_CC AC_PROG_CC_C99 AC_PROG_LIBTOOL AC_HEADER_STDC # FIXME: earlier version? AM_PATH_GLIB_2_0(2.36.0,,,gmodule) AM_PATH_GTK_2_0(2.16.0) ALL_LINGUAS="cs da de fi fr" AM_GLIB_GNU_GETTEXT IT_PROG_INTLTOOL([0.40.0]) AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR) GETTEXT_PACKAGE=$PACKAGE AC_SUBST(GETTEXT_PACKAGE) dnl Use -Wall if we have gcc. if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[[\ \ ]]-Wall[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac fi dnl Windows-detection case $host in i[[3456789]]86-*-mingw32*) WIN32="yes" ;; *cygwin*) WIN32="yes" ;; *) WIN32="no" ;; esac AM_CONDITIONAL([WIN32], test "x$WIN32" = "xyes") AC_CONFIG_FILES([Makefile po/Makefile.in]) AC_OUTPUT screentest-2.1/gettext.h000066400000000000000000000234331365601366000154030ustar00rootroot00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software Foundation, Inc. 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # undef gettext # define gettext(Msgid) ((const char *) (Msgid)) # undef dgettext # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # undef dcgettext # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # undef dngettext # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # undef dcngettext # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) # undef textdomain # define textdomain(Domainname) ((const char *) (Domainname)) # undef bindtextdomain # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # undef bind_textdomain_codeset # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* Prefer gnulib's setlocale override over libintl's setlocale override. */ #ifdef GNULIB_defined_setlocale # undef setlocale # define setlocale rpl_setlocale #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 #endif #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ screentest-2.1/main.c000066400000000000000000000037041365601366000146350ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "main.h" #include "gettext.h" #define _(String) gettext(String) GtkBuilder *builder; int main(int argc, char *argv[]) { guint err; bindtextdomain(PACKAGE, LOCALEDIR); bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); gtk_init(&argc, &argv); builder = gtk_builder_new(); err = gtk_builder_add_from_file(builder, DATADIR "/screentest.ui", NULL); if (err == 0) err = gtk_builder_add_from_file(builder, "screentest.ui", NULL); if (err == 0) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("The interface definition file was not found.\n" "Please make sure this program is installed correctly.")); gtk_window_set_title(GTK_WINDOW(dialog), PACKAGE_NAME); gtk_dialog_run(GTK_DIALOG(dialog)); exit(1); } gtk_builder_connect_signals(builder, NULL); gtk_widget_show_all(GTK_WIDGET(gtk_builder_get_object(builder, "mainwin"))); gtk_main(); return 0; } screentest-2.1/main.h000066400000000000000000000017511365601366000146420ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef _MAIN_H #define _MAIN_H 1 #include extern GtkBuilder *builder; #endif /* _MAIN_H */ screentest-2.1/po/000077500000000000000000000000001365601366000141575ustar00rootroot00000000000000screentest-2.1/po/ChangeLog000066400000000000000000000000001365601366000157170ustar00rootroot00000000000000screentest-2.1/po/POTFILES.in000066400000000000000000000001751365601366000157370ustar00rootroot00000000000000# List of source files containing translatable strings. main.c callbacks.c test_basic.c [type: gettext/glade] screentest.ui screentest-2.1/po/cs.po000066400000000000000000000043641365601366000151330ustar00rootroot00000000000000# Czech translation for package screentest. # Copyright (C) 2007-2017 Tobias Gruetzmacher # This file is distributed under the same license as the screentest package. # Michal Simunek , 2012. # msgid "" msgstr "" "Project-Id-Version: screentest 2.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-10 13:52+0100\n" "PO-Revision-Date: 2012-05-16 11:31+0200\n" "Last-Translator: Michal Simunek \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../main.c:52 #, fuzzy msgid "" "The interface definition file was not found.\n" "Please make sure this program is installed correctly." msgstr "" "Nebyl nalezen definiční soubor pro rozhraní GLADE.\n" "Ujistěte se prosím, že je program správně nainstalován." #: ../callbacks.c:182 #, c-format msgid "No implementation for the test \"%s\" found." msgstr "Pro test \"%s\" nebyla nalezena žádná implementace." #: ../test_basic.c:75 msgid "Left Button - param cycle, if any" msgstr "Levé tlačítko - rotování parametrů, jsou-li nějaké" #: ../test_basic.c:76 msgid "Middle Button - color cycle" msgstr "Prostřední tlačítko - rotování barev" #: ../test_basic.c:77 msgid "Right Button - menu" msgstr "Pravé tlačítko - nabídka" #: ../screentest.ui.h:1 msgid "Screen test" msgstr "Test obrazovky" #: ../screentest.ui.h:2 msgid "Select Foreground color" msgstr "Vybrat barvu popředí" #: ../screentest.ui.h:3 msgid "Select Background color" msgstr "Vybrat barvu pozadí" #: ../screentest.ui.h:4 msgid "Mode" msgstr "Režim" #: ../screentest.ui.h:5 msgid "Basic" msgstr "Základní" #: ../screentest.ui.h:6 msgid "Grid" msgstr "Mřížka" #: ../screentest.ui.h:7 msgid "Horizontal" msgstr "Horizontální" #: ../screentest.ui.h:8 msgid "Vertical" msgstr "Vertikální" #: ../screentest.ui.h:9 msgid "Blink" msgstr "Obnovovací frekvence" #: ../screentest.ui.h:10 msgid "Text" msgstr "Text" #: ../screentest.ui.h:11 msgid "LCD Alignment" msgstr "" #: ../screentest.ui.h:12 msgid "Foreground Color" msgstr "Barva popředí" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "Barva pozadí" screentest-2.1/po/da.po000066400000000000000000000041651365601366000151110ustar00rootroot00000000000000# screentest translation. # Copyright (C) 2007 Tobias Gruetzmacher # This file is distributed under the same license as the screentest package. # Joe Hansen , 2012. # msgid "" msgstr "" "Project-Id-Version: screentest 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-10 13:52+0100\n" "PO-Revision-Date: 2012-04-29 17:30+01:00\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../main.c:52 #, fuzzy msgid "" "The interface definition file was not found.\n" "Please make sure this program is installed correctly." msgstr "" "Definitionsfilen for GLADE-grænsefladen blev ikke fundet.\n" "Sikr dig at dette program er korrekt installeret." #: ../callbacks.c:182 #, c-format msgid "No implementation for the test \"%s\" found." msgstr "Ingen implementering for testen »%s« blev fundet." #: ../test_basic.c:75 msgid "Left Button - param cycle, if any" msgstr "Venstre knap - parametercyklus, hvis nogen" #: ../test_basic.c:76 msgid "Middle Button - color cycle" msgstr "Midterste knap - farvecyklus" #: ../test_basic.c:77 msgid "Right Button - menu" msgstr "Højre knap - menu" #: ../screentest.ui.h:1 msgid "Screen test" msgstr "Skærmtest" #: ../screentest.ui.h:2 msgid "Select Foreground color" msgstr "Vælg forgrundsfarve" #: ../screentest.ui.h:3 msgid "Select Background color" msgstr "Vælg baggrundsfarve" #: ../screentest.ui.h:4 msgid "Mode" msgstr "Tilstand" #: ../screentest.ui.h:5 msgid "Basic" msgstr "Basis" #: ../screentest.ui.h:6 msgid "Grid" msgstr "Gitter" #: ../screentest.ui.h:7 msgid "Horizontal" msgstr "Vandret" #: ../screentest.ui.h:8 msgid "Vertical" msgstr "Lodret" #: ../screentest.ui.h:9 msgid "Blink" msgstr "Blink" #: ../screentest.ui.h:10 msgid "Text" msgstr "Tekst" #: ../screentest.ui.h:11 msgid "LCD Alignment" msgstr "" #: ../screentest.ui.h:12 msgid "Foreground Color" msgstr "Forgrundsfarve" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "Baggrundsfarve" screentest-2.1/po/de.po000066400000000000000000000043061365601366000151120ustar00rootroot00000000000000# Translation of screentest to german. # Copyright (C) 2007-2017 Tobias Gruetzmacher # This file is distributed under the same license as the screentest package. # Tobias Gruetzmacher , 2007-2017 # msgid "" msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-10 13:52+0100\n" "PO-Revision-Date: 2017-12-10 14:15+0100\n" "Last-Translator: Tobias Gruetzmacher \n" "Language-Team: german \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.4\n" #: ../main.c:52 msgid "" "The interface definition file was not found.\n" "Please make sure this program is installed correctly." msgstr "" "Die Interface-Definitions-Datei wurde nicht gefunden.\n" "Bitte stellen Sie sicher, dass dieses Programm korrekt installiert wurde." #: ../callbacks.c:182 #, c-format msgid "No implementation for the test \"%s\" found." msgstr "Keine Implementierung für den Test \"%s\" gefunden." #: ../test_basic.c:75 msgid "Left Button - param cycle, if any" msgstr "Linke Taste - Param. wechseln, wenn vorhanden" #: ../test_basic.c:76 msgid "Middle Button - color cycle" msgstr "Mittlere Taste - Farbe wechseln" #: ../test_basic.c:77 msgid "Right Button - menu" msgstr "Rechte Taste - Menü" #: ../screentest.ui.h:1 msgid "Screen test" msgstr "Bildschirmprüfung" #: ../screentest.ui.h:2 msgid "Select Foreground color" msgstr "Wähle Vordergrundfarbe" #: ../screentest.ui.h:3 msgid "Select Background color" msgstr "Wähle Hintergrundfarbe" #: ../screentest.ui.h:4 msgid "Mode" msgstr "Modus" #: ../screentest.ui.h:5 msgid "Basic" msgstr "Einfach" #: ../screentest.ui.h:6 msgid "Grid" msgstr "Gitter" #: ../screentest.ui.h:7 msgid "Horizontal" msgstr "Horizontal" #: ../screentest.ui.h:8 msgid "Vertical" msgstr "Vertikal" #: ../screentest.ui.h:9 msgid "Blink" msgstr "Blinken" #: ../screentest.ui.h:10 msgid "Text" msgstr "Text" #: ../screentest.ui.h:11 msgid "LCD Alignment" msgstr "LCD-Ausrichtung" #: ../screentest.ui.h:12 msgid "Foreground Color" msgstr "Vordergrundfarbe" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "Hintergrundfarbe" screentest-2.1/po/fi.po000066400000000000000000000042351365601366000151210ustar00rootroot00000000000000# screentest translation. # Copyright (C) 2007-2017 Tobias Gruetzmacher # This file is distributed under the same license as the screentest package. # Juhani Numminen , 2012. # msgid "" msgstr "" "Project-Id-Version: screentest 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-10 13:52+0100\n" "PO-Revision-Date: 2012-05-06 08:49+0300\n" "Last-Translator: Juhani Numminen \n" "Language-Team: Finnish\n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../main.c:52 #, fuzzy msgid "" "The interface definition file was not found.\n" "Please make sure this program is installed correctly." msgstr "" "GLADE-käyttöliittymätiedostoa ei löydetty.\n" "Varmista, että ohjelma on asennettu kunnolla." #: ../callbacks.c:182 #, c-format msgid "No implementation for the test \"%s\" found." msgstr "Testille \"%s\" ei löydetty toteutusta." #: ../test_basic.c:75 msgid "Left Button - param cycle, if any" msgstr "Vasen painike - parametrien pyöritys, jos on" #: ../test_basic.c:76 msgid "Middle Button - color cycle" msgstr "Keskipainike - värien pyöritys" #: ../test_basic.c:77 msgid "Right Button - menu" msgstr "Oikea painike - valikko" #: ../screentest.ui.h:1 msgid "Screen test" msgstr "Näyttötesti" #: ../screentest.ui.h:2 msgid "Select Foreground color" msgstr "Valitse edustaväri" #: ../screentest.ui.h:3 msgid "Select Background color" msgstr "Valitse taustaväri" #: ../screentest.ui.h:4 msgid "Mode" msgstr "Tila" #: ../screentest.ui.h:5 msgid "Basic" msgstr "Tavallinen" #: ../screentest.ui.h:6 msgid "Grid" msgstr "Ruudukko" #: ../screentest.ui.h:7 msgid "Horizontal" msgstr "Vaakasuuntainen" #: ../screentest.ui.h:8 msgid "Vertical" msgstr "Pystysuuntainen" #: ../screentest.ui.h:9 msgid "Blink" msgstr "Vilkkuva" #: ../screentest.ui.h:10 msgid "Text" msgstr "Teksti" #: ../screentest.ui.h:11 msgid "LCD Alignment" msgstr "" #: ../screentest.ui.h:12 msgid "Foreground Color" msgstr "Edustaväri" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "Taustaväri" screentest-2.1/po/fr.po000066400000000000000000000045321365601366000151320ustar00rootroot00000000000000# Translation of screentest to French. # Copyright (C) 2007-2017 Tobias Gruetzmacher # This file is distributed under the same license as the screentest package. # # Translator: # Mami Hicham , 2009 msgid "" msgstr "" "Project-Id-Version: screentest 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-10 13:52+0100\n" "PO-Revision-Date: 2009-06-22 20:02+0200\n" "Last-Translator: Mami Hicham \n" "Language-Team: french\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Virtaal 0.3.1\n" #: ../main.c:52 #, fuzzy msgid "" "The interface definition file was not found.\n" "Please make sure this program is installed correctly." msgstr "" "Le fichier de définition de l'interface de GLADE n'a pas été trouvé.\n" "Veuillez vérifier que le programme a été correctement installé." #: ../callbacks.c:182 #, c-format msgid "No implementation for the test \"%s\" found." msgstr "Pas d'implémentation trouvée pour le test « %s »." #: ../test_basic.c:75 msgid "Left Button - param cycle, if any" msgstr "Bouton gauche - cycle de paramétrage, s'il y en a un" #: ../test_basic.c:76 msgid "Middle Button - color cycle" msgstr "Bouton du milieu - couleur du cycle" #: ../test_basic.c:77 msgid "Right Button - menu" msgstr "Bouton droit - menu" #: ../screentest.ui.h:1 msgid "Screen test" msgstr "Test d'écran" #: ../screentest.ui.h:2 msgid "Select Foreground color" msgstr "Définir la couleur de premier plan" #: ../screentest.ui.h:3 msgid "Select Background color" msgstr "Définir la couleur d'arrière-plan" #: ../screentest.ui.h:4 msgid "Mode" msgstr "Mode" #: ../screentest.ui.h:5 msgid "Basic" msgstr "Basique" #: ../screentest.ui.h:6 msgid "Grid" msgstr "Grille" #: ../screentest.ui.h:7 msgid "Horizontal" msgstr "Horizontal" #: ../screentest.ui.h:8 msgid "Vertical" msgstr "Vertical" #: ../screentest.ui.h:9 msgid "Blink" msgstr "Clignotant" #: ../screentest.ui.h:10 msgid "Text" msgstr "Texte" #: ../screentest.ui.h:11 msgid "LCD Alignment" msgstr "" #: ../screentest.ui.h:12 msgid "Foreground Color" msgstr "Couleur de premier plan" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "Couleur d'arrière-plan" screentest-2.1/po/screentest.pot000066400000000000000000000033201365601366000170600ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-10 13:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../main.c:52 msgid "" "The interface definition file was not found.\n" "Please make sure this program is installed correctly." msgstr "" #: ../callbacks.c:182 #, c-format msgid "No implementation for the test \"%s\" found." msgstr "" #: ../test_basic.c:75 msgid "Left Button - param cycle, if any" msgstr "" #: ../test_basic.c:76 msgid "Middle Button - color cycle" msgstr "" #: ../test_basic.c:77 msgid "Right Button - menu" msgstr "" #: ../screentest.ui.h:1 msgid "Screen test" msgstr "" #: ../screentest.ui.h:2 msgid "Select Foreground color" msgstr "" #: ../screentest.ui.h:3 msgid "Select Background color" msgstr "" #: ../screentest.ui.h:4 msgid "Mode" msgstr "" #: ../screentest.ui.h:5 msgid "Basic" msgstr "" #: ../screentest.ui.h:6 msgid "Grid" msgstr "" #: ../screentest.ui.h:7 msgid "Horizontal" msgstr "" #: ../screentest.ui.h:8 msgid "Vertical" msgstr "" #: ../screentest.ui.h:9 msgid "Blink" msgstr "" #: ../screentest.ui.h:10 msgid "Text" msgstr "" #: ../screentest.ui.h:11 msgid "LCD Alignment" msgstr "" #: ../screentest.ui.h:12 msgid "Foreground Color" msgstr "" #: ../screentest.ui.h:13 msgid "Background Color" msgstr "" screentest-2.1/screentest.ui000066400000000000000000000220321365601366000162560ustar00rootroot00000000000000 True GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK Screen test Select Foreground color False True dialog mainwin True False False False False False False Select Background color False True dialog mainwin True False False False False False False True accelgroup1 True Mode True True Basic True True True True Grid True True basic True Horizontal True True basic True Vertical True True basic True Blink True True basic True Text True True basic True LCD Alignment True True basic Foreground Color True image1 False Background Color True image2 False True gtk-quit True True True True gtk-select-color True gtk-select-color screentest-2.1/test_basic.c000066400000000000000000000111311365601366000160220ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "callbacks.h" #include "gettext.h" #define _(String) gettext(String) #define N_(String) gettext_noop(String) #define BASIC_STEP 40 static gchar fontname[] = "-adobe-helvetica-bold-r-normal-*-14-*-*-*-p-*-iso8859-1"; static GdkFont *font; static void basic_init(G_GNUC_UNUSED GtkWidget * widget) { font = gdk_font_load(fontname); if (!font) { printf("Cannot load font %s, trying 'fixed'.\n", fontname); font = gdk_font_load("fixed"); } } static void draw_boxes(GdkWindow * win, GdkColor * colors, gint ncols, gint x, gint y, gint d) { int i; for (i = 0; i < ncols; i++) { gdk_gc_set_rgb_fg_color(gc, &colors[i]); gdk_draw_rectangle(win, gc, TRUE, x, y, d, d); x += d; } gdk_gc_set_rgb_fg_color(gc, fg_color); } static void basic_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); gint w, h; gint i, b, d; gint maxwidth, maxheight; gint widths[6]; static gchar *text[] = { "Screentest v" VERSION, "(C) 2001 Jan \"Yenya\" Kasprzak ", "(C) 2006-2017 Tobias Gruetzmacher ", N_("Left Button - param cycle, if any"), N_("Middle Button - color cycle"), N_("Right Button - menu"), }; gdk_drawable_get_size(win, &w, &h); for (i = ((w - 1) % BASIC_STEP) / 2; i < w; i += BASIC_STEP) gdk_draw_line(win, gc, i, 0, i, h - 1); for (i = ((h - 1) % BASIC_STEP) / 2; i < h; i += BASIC_STEP) gdk_draw_line(win, gc, 0, i, w - 1, i); d = w / 4; if (d > h / 4) d = h / 4; maxheight = 0; for (i = 0; i < 5; i++) { int x = gdk_string_height(font, gettext(text[i])); if (x > maxheight) maxheight = x; } maxwidth = 0; for (i = 0; i < 6; i++) { widths[i] = gdk_string_width(font, gettext(text[i])); if (widths[i] > maxwidth) maxwidth = widths[i]; } maxwidth += 20; maxheight = 3 * maxheight / 2; gdk_draw_rectangle(win, gc, FALSE, (w - maxwidth) / 2, d / 2 - 2 * maxheight, maxwidth, 4 * maxheight); gdk_draw_rectangle(win, gc, FALSE, (w - maxwidth) / 2, h - d / 2 - 2 * maxheight, maxwidth, 4 * maxheight); gdk_draw_rectangle(win, backgc, TRUE, (w - maxwidth) / 2 + 1, d / 2 - 2 * maxheight + 1, maxwidth - 1, 4 * maxheight - 1); gdk_draw_rectangle(win, backgc, TRUE, (w - maxwidth) / 2 + 1, h - d / 2 - 2 * maxheight + 1, maxwidth - 1, 4 * maxheight - 1); gdk_draw_string(win, font, gc, (w - widths[0]) / 2, d / 2 - 2 * maxheight / 3, gettext(text[0])); gdk_draw_string(win, font, gc, (w - widths[1]) / 2, d / 2 + maxheight / 3, gettext(text[1])); gdk_draw_string(win, font, gc, (w - widths[2]) / 2, d / 2 + 4 * maxheight / 3, gettext(text[2])); gdk_draw_string(win, font, gc, (w - widths[3]) / 2, h - d / 2 - 2 * maxheight / 3, gettext(text[3])); gdk_draw_string(win, font, gc, (w - widths[4]) / 2, h - d / 2 + maxheight / 3, gettext(text[4])); gdk_draw_string(win, font, gc, (w - widths[5]) / 2, h - d / 2 + 4 * maxheight / 3, gettext(text[5])); b = 7 * d / 4; draw_boxes(win, fgcolors, COLOR_MAX, (w - b) / 2, h / 2 - b / COLOR_MAX, b / COLOR_MAX); draw_boxes(win, grays, GRAYS_MAX, (w - b) / 2, h / 2, b / GRAYS_MAX); w--; h--; gdk_draw_arc(win, gc, FALSE, 0, 0, d, d, 0, 360 * 64); gdk_draw_arc(win, gc, FALSE, 0, h - d, d, d, 0, 360 * 64); gdk_draw_arc(win, gc, FALSE, w - d, h - d, d, d, 0, 360 * 64); gdk_draw_arc(win, gc, FALSE, w - d, 0, d, d, 0, 360 * 64); gdk_draw_arc(win, gc, FALSE, w / 2 - d, h / 2 - d, d * 2, d * 2, 0, 360 * 64); } static void basic_close(G_GNUC_UNUSED GtkWidget * widget) { gdk_font_unref(font); } G_MODULE_EXPORT struct test_ops basic_ops = { .init = basic_init, .draw = basic_draw, .cycle = NULL, .close = basic_close }; screentest-2.1/test_blink.c000066400000000000000000000046201365601366000160450ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include "callbacks.h" static guint timeout; static gint blink_type; static gint blink_step; static void blink_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); gint w, h; GdkGC *gc1, *gc2; gdk_drawable_get_size(win, &w, &h); if (blink_step) { gc1 = backgc; gc2 = gc; } else { gc1 = gc; gc2 = backgc; } if (blink_type) { gdk_draw_rectangle(win, gc1, TRUE, 5, 5, w / 3 - 5, h - 10); gdk_draw_rectangle(win, gc2, TRUE, w / 3, 5, w / 3, h - 10); gdk_draw_rectangle(win, gc1, TRUE, 2 * w / 3, 5, w / 3 - 5, h - 10); } else { gdk_draw_rectangle(win, gc1, TRUE, 5, 5, w - 10, h / 3 - 5); gdk_draw_rectangle(win, gc2, TRUE, 5, h / 3, w - 10, h / 3); gdk_draw_rectangle(win, gc1, TRUE, 5, 2 * h / 3, w - 10, h / 3 - 5); } gdk_draw_rectangle(win, gc, FALSE, 0, 0, w - 1, h - 1); } static gboolean blink_timeout(gpointer data) { GtkWidget *widget = (GtkWidget *) data; blink_step = !blink_step; blink_draw(widget); return TRUE; } static void blink_init(GtkWidget * widget) { blink_type = 0; blink_step = 0; timeout = gtk_timeout_add(1000, blink_timeout, widget); } void blink_cycle(G_GNUC_UNUSED GtkWidget * widget) { blink_type = !blink_type; } static void blink_close(G_GNUC_UNUSED GtkWidget * widget) { gtk_timeout_remove(timeout); } G_MODULE_EXPORT struct test_ops blink_ops = { .init = blink_init, .draw = blink_draw, .cycle = blink_cycle, .close = blink_close }; screentest-2.1/test_grid.c000066400000000000000000000034321365601366000156730ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include "callbacks.h" #define GRID_STEP 64 #define GRID_STEP_MIN 2 static gint grid_step; static void grid_init(G_GNUC_UNUSED GtkWidget * widget) { grid_step = GRID_STEP; } static void grid_cycle(G_GNUC_UNUSED GtkWidget * widget) { grid_step /= 2; if (grid_step < GRID_STEP_MIN) grid_step = GRID_STEP; } static void grid_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); gint w, h; gint i; gint d; gdk_drawable_get_size(win, &w, &h); d = w / 4; if (d > h / 4) d = h / 4; for (i = ((w - 1) % grid_step) / 2; i < w; i += grid_step) gdk_draw_line(win, gc, i, 0, i, h - 1); for (i = ((h - 1) % grid_step) / 2; i < h; i += grid_step) gdk_draw_line(win, gc, 0, i, w - 1, i); } G_MODULE_EXPORT struct test_ops grid_ops = { .init = grid_init, .draw = grid_draw, .cycle = grid_cycle, .close = NULL }; screentest-2.1/test_horizontal.c000066400000000000000000000034161365601366000171410ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include "callbacks.h" #define GRID_STEP 64 #define GRID_STEP_MIN 2 static gint horizontal_step; static void horizontal_init(G_GNUC_UNUSED GtkWidget * widget) { horizontal_step = GRID_STEP; } static void horizontal_cycle(G_GNUC_UNUSED GtkWidget * widget) { horizontal_step /= 2; if (horizontal_step < GRID_STEP_MIN) horizontal_step = GRID_STEP; } static void horizontal_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); gint w, h; gint i; gint d; gdk_drawable_get_size(win, &w, &h); d = w / 4; if (d > h / 4) d = h / 4; for (i = ((h - 1) % horizontal_step) / 2; i < h; i += horizontal_step) gdk_draw_line(win, gc, 0, i, w - 1, i); } G_MODULE_EXPORT struct test_ops horizontal_ops = { .init = horizontal_init, .draw = horizontal_draw, .cycle = horizontal_cycle, .close = NULL }; screentest-2.1/test_lcdalign.c000066400000000000000000000033231365601366000165220ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2011-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include "callbacks.h" static void lcdalign_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); GdkGC *linegc = gdk_gc_new(win); gint w, h; gint i; gint8 d[] = {1, 1}; gdk_drawable_get_size(win, &w, &h); /* Border */ gdk_draw_line(win, gc, 0, 0, w - 1, 0); gdk_draw_line(win, gc, 0, 0, 0, h - 1); gdk_draw_line(win, gc, w - 1, 0, w - 1, h - 1); gdk_draw_line(win, gc, 0, h - 1, w - 1, h - 1); /* Pattern */ gdk_gc_copy(linegc, gc); gdk_gc_set_line_attributes(linegc, 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_NOT_LAST, GDK_JOIN_MITER); gdk_gc_set_dashes(linegc, 0, d, 2); for (i = 1; i < h - 1; i++) gdk_draw_line(win, linegc, (i % 2) + 1, i, w - 1, i); g_object_unref(linegc); } G_MODULE_EXPORT struct test_ops lcdalign_ops = { .init = NULL, .draw = lcdalign_draw, .cycle = NULL, .close = NULL }; screentest-2.1/test_text.c000066400000000000000000000053651365601366000157410ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "callbacks.h" static gchar *fontnames[] = { "-adobe-times-medium-r-normal-*-*-80-*-*-p-*-iso8859-1", "-adobe-times-medium-r-normal-*-*-100-*-*-p-*-iso8859-1", "-adobe-times-medium-r-normal-*-*-120-*-*-p-*-iso8859-1", "-adobe-times-medium-r-normal-*-*-140-*-*-p-*-iso8859-1", "-adobe-times-medium-r-normal-*-*-180-*-*-p-*-iso8859-1", "-adobe-times-medium-r-normal-*-*-240-*-*-p-*-iso8859-1", NULL }; static gint font_num; static gchar text[] = "The Screentest home page: https://tobix.github.io/screentest/"; GdkFont *font; gint baselineskip, textwidth; static void font_init(G_GNUC_UNUSED GtkWidget * widget) { gint lbear, rbear, width, asc, desc; font = gdk_font_load(fontnames[font_num]); if (!font) { printf("Cannot load font %s, trying 'fixed'.\n", fontnames[font_num]); font = gdk_font_load("fixed"); } gdk_string_extents(font, text, &lbear, &rbear, &width, &asc, &desc); baselineskip = 6 * (asc + desc) / 5; /* 1.2x text height */ textwidth = width + baselineskip; /* the actual width plus space */ } static void text_init(GtkWidget * widget) { font_num = 1; font_init(widget); } static void text_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); gint w, h; gint x, y; gdk_drawable_get_size(win, &w, &h); x = w + textwidth; for (y = 0; y < h; y += baselineskip) for (x -= w + textwidth; x < w; x += textwidth) gdk_draw_string(win, font, gc, x, y, text); } static void text_close(G_GNUC_UNUSED GtkWidget * widget) { gdk_font_unref(font); } static void text_cycle(GtkWidget * widget) { gdk_font_unref(font); if (fontnames[++font_num] == NULL) font_num = 0; font_init(widget); } G_MODULE_EXPORT struct test_ops text_ops = { .init = text_init, .draw = text_draw, .cycle = text_cycle, .close = text_close, }; screentest-2.1/test_vertical.c000066400000000000000000000033541365601366000165620ustar00rootroot00000000000000/* * Screentest - CRT/LCD monitor testing utility. * https://tobix.github.io/screentest/ * Copyright (C) 2001 Jan "Yenya" Kasprzak * Copyright (C) 2006-2017 Tobias Gruetzmacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include "callbacks.h" #define GRID_STEP 64 #define GRID_STEP_MIN 2 static gint vertical_step; static void vertical_init(G_GNUC_UNUSED GtkWidget * widget) { vertical_step = GRID_STEP; } static void vertical_cycle(G_GNUC_UNUSED GtkWidget * widget) { vertical_step /= 2; if (vertical_step < GRID_STEP_MIN) vertical_step = GRID_STEP; } static void vertical_draw(GtkWidget * widget) { GdkWindow *win = gtk_widget_get_window(widget); gint w, h; gint i; gint d; gdk_drawable_get_size(win, &w, &h); d = w / 4; if (d > h / 4) d = h / 4; for (i = ((w - 1) % vertical_step) / 2; i < w; i += vertical_step) gdk_draw_line(win, gc, i, 0, i, h - 1); } G_MODULE_EXPORT struct test_ops vertical_ops = { .init = vertical_init, .draw = vertical_draw, .cycle = vertical_cycle, .close = NULL };