| author | Jens Thoms Toerring <jt@toerring.de> | 2015年11月27日 14:20:27 +0100 |
|---|---|---|
| committer | Jens Thoms Toerring <jt@toerring.de> | 2015年11月27日 14:20:27 +0100 |
| commit | e8adf11c06f4b8f54967da4ee4460d45fed2c50f (patch) | |
| tree | a4310e11de370329a44419a32df91c2b6009286e | |
| parent | e13d5ea4066ecc1f5069e102158e4cb47b4918cb (diff) | |
| download | xforms-e8adf11c06f4b8f54967da4ee4460d45fed2c50f.tar.gz | |
| -rw-r--r-- | README.rpmbuild | 2 | ||||
| -rwxr-xr-x | config/compile | 347 | ||||
| -rw-r--r-- | demos/colbrowser.c | 2 | ||||
| -rw-r--r-- | doc/part1_getting_started.texi | 4 | ||||
| -rw-r--r-- | lib/browser.c | 32 | ||||
| -rw-r--r-- | lib/flcolor.c | 1 | ||||
| -rw-r--r-- | lib/include/Basic.h | 4 | ||||
| -rw-r--r-- | lib/objects.c | 20 | ||||
| -rw-r--r-- | lib/tbox.c | 8 | ||||
| -rw-r--r-- | libforms.spec.in | 13 |
diff --git a/README.rpmbuild b/README.rpmbuild index 9529ac4..aae62a7 100644 --- a/README.rpmbuild +++ b/README.rpmbuild @@ -10,7 +10,7 @@ packages for the XForms library and its documetation. 2) After having run - ./configure --enable docs + ./configure --enable-docs successfully create the rpm package with diff --git a/config/compile b/config/compile new file mode 100755 index 0000000..531136b --- /dev/null +++ b/config/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012年10月14日.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# 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, 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 <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=1ドル + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,2,ドル in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/1円/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "1ドル" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=1ドル + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case 1ドル in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case 2ドル in + *.o | *.[oO][bB][jJ]) + func_file_conv "2ドル" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "2ドル" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "2ドル" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "2ドル" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "2ドル" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts 2ドル" + ;; + -*) + set x "$@" "1ドル" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "1ドル" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "1ドル" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "1ドル" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case 1ドル in + '') + echo "0ドル: No command. Try '0ドル --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case 1ドル in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case 2ドル in + *.o | *.obj) + ofile=2ドル + ;; + *) + set x "$@" -o "2ドル" + shift + ;; + esac + ;; + *.c) + cfile=1ドル + set x "$@" "1ドル" + shift + ;; + *) + set x "$@" "1ドル" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/demos/colbrowser.c b/demos/colbrowser.c index 38a27a2..d6bb691 100644 --- a/demos/colbrowser.c +++ b/demos/colbrowser.c @@ -118,6 +118,7 @@ set_entry( int i ) fl_freeze_form( cl ); fl_mapcolor( FL_FREE_COL4 + i, db->r, db->g, db->b ); fl_mapcolor( FL_FREE_COL4, db->r, db->g, db->b ); + fl_redraw_object( rescol ); fl_set_slider_value( rs, db->r ); fl_set_slider_value( gs, db->g ); fl_set_slider_value( bs, db->b ); @@ -309,6 +310,7 @@ search_rgb( FL_OBJECT * ob FL_UNUSED_ARG, fl_freeze_form( cl ); fl_mapcolor( FL_FREE_COL4, r, g, b ); + fl_redraw_object( rescol ); i = search_entry( r, g, b ); /* Change topline only if necessary */ diff --git a/doc/part1_getting_started.texi b/doc/part1_getting_started.texi index 0cdd0d9..7685164 100644 --- a/doc/part1_getting_started.texi +++ b/doc/part1_getting_started.texi @@ -237,11 +237,11 @@ have exactly the same effect. The above program only shows one of the event handling methods provided by the library. The direct method of event handling shown is appropriate for simple programs. But, obviously, already for a program -with just a few nmore objects it would become rather tedious to have +with just a few more objects it would become rather tedious to have to check each time @code{@ref{fl_do_forms()}} returns each of those objects to find out which of them was responsible and react accordingly. Utilizing object callback functions is then typically -much easier and thus os strongly recommended. +much easier and thus is strongly recommended. We demonstrate the use of object callbacks using the previous example with some modifications so that event processing via callbacks is diff --git a/lib/browser.c b/lib/browser.c index 4ce9be6..102c0d5 100644 --- a/lib/browser.c +++ b/lib/browser.c @@ -507,14 +507,14 @@ fl_create_browser( int type, FL_Coord h, const char * label ) { - FL_OBJECT *ob; + FL_OBJECT *obj; FLI_BROWSER_SPEC *sp; int D; - ob = fl_make_object( FL_BROWSER, type, x, y, w, h, label, - handle_browser ); + obj = fl_make_object( FL_BROWSER, type, x, y, w, h, label, + handle_browser ); - sp = ob->spec = fl_calloc( 1, sizeof *sp ); + sp = obj->spec = fl_calloc( 1, sizeof *sp ); sp->tb = fli_create_tbox( type, x, y, w, h, NULL ); sp->callback = NULL; @@ -527,11 +527,11 @@ fl_create_browser( int type, /* Copy browser attributes from textbox */ - ob->boxtype = sp->tb->boxtype; - ob->lcol = sp->tb->lcol; - ob->col1 = sp->tb->col1; - ob->col2 = sp->tb->col2; - ob->align = sp->tb->align; + obj->boxtype = sp->tb->boxtype; + obj->lcol = sp->tb->lcol; + obj->col1 = sp->tb->col1; + obj->col2 = sp->tb->col2; + obj->align = sp->tb->align; /* Textbox handlers */ @@ -542,7 +542,7 @@ fl_create_browser( int type, /* Scrollbars */ - D = sp->vw_def = sp->hh_def = fli_get_default_scrollbarsize( ob ); + D = sp->vw_def = sp->hh_def = fli_get_default_scrollbarsize( obj ); sp->v_pref = sp->h_pref = FL_AUTO; sp->hsl = fl_create_scrollbar( fli_context->hscb, x, y + h - D, @@ -561,9 +561,9 @@ fl_create_browser( int type, fl_set_scrollbar_bounds( sp->hsl, 0.0, 1.0 ); sp->vsl->resize = FL_RESIZE_NONE; - fl_add_child( ob, sp->tb ); - fl_add_child( ob, sp->hsl ); - fl_add_child( ob, sp->vsl ); + fl_add_child( obj, sp->tb ); + fl_add_child( obj, sp->hsl ); + fl_add_child( obj, sp->vsl ); /* In older versions scrollbars and browsers weren't returned to e.g. fl_do_forms() but still a callback associated with the object @@ -573,16 +573,16 @@ fl_create_browser( int type, in fl_set_object_callback()) */ #if ! USE_BWC_BS_HACK - fl_set_object_return( ob, FL_RETURN_SELECTION | FL_RETURN_DESELECTION ); + fl_set_object_return( obj, FL_RETURN_SELECTION | FL_RETURN_DESELECTION ); #else - fl_set_object_return( ob, FL_RETURN_NONE ); + fl_set_object_return( obj, FL_RETURN_NONE ); #endif fl_set_object_return( sp->hsl, FL_RETURN_ALWAYS ); fl_set_object_return( sp->vsl, FL_RETURN_ALWAYS ); fl_set_object_return( sp->tb, FL_RETURN_ALWAYS ); - return ob; + return obj; } diff --git a/lib/flcolor.c b/lib/flcolor.c index 77b0460..c6902b0 100644 --- a/lib/flcolor.c +++ b/lib/flcolor.c @@ -231,6 +231,7 @@ static FLI_IMAP fli_imap[ FL_MAX_COLS ] = { NV( FL_VIOLET ), 238, 130, 238, 0, 0 }, { NV( FL_WHITESMOKE ), 245, 245, 245, 0, 0 }, { NV( FL_YELLOWGREEN ), 154, 205, 50, 0, 0 }, + { NV( FL_COLOR_CHOOSER_COLOR ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL1 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL2 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL3 ), 0, 0, 0, 0, 0 }, diff --git a/lib/include/Basic.h b/lib/include/Basic.h index 46da14e..6e587f7 100644 --- a/lib/include/Basic.h +++ b/lib/include/Basic.h @@ -458,8 +458,8 @@ typedef enum { FL_VIOLET, FL_WHITESMOKE, FL_YELLOWGREEN, - FL_COLOR_CHOOSER_COLOR = 255, - FL_FREE_COL1 = 256, + FL_COLOR_CHOOSER_COLOR, + FL_FREE_COL1, FL_FREE_COL2, FL_FREE_COL3, FL_FREE_COL4, diff --git a/lib/objects.c b/lib/objects.c index bc119c5..51af15b 100644 --- a/lib/objects.c +++ b/lib/objects.c @@ -2163,14 +2163,16 @@ mark_object_for_redraw( FL_OBJECT * obj ) obj->redraw = 1; + /* Also mark all child objects for redraw */ + for ( o = obj->child; o; o = o->nc ) mark_object_for_redraw( o ); /* If an object is marked as being under another object we have to find the object(s) it is beneath and also mark them for a redraw. For the - special case that the object to be redraw is the first object of + special case that the object to be redrawn is the first object of the form (i.e. the one for the background) we don't have to check - if the other object are on top of it, they all are. */ + if the other objects are on top of it, they all are. */ if ( obj == bg_object( obj->form ) ) { @@ -3140,17 +3142,21 @@ object_is_under( const FL_OBJECT * obj ) /* The first object of a form is always below all others */ if ( obj == bg_object( obj->form ) ) - return 1; + { + for ( o = obj->next; o; o = o->next ) + if ( obj->objclass != FL_BEGIN_GROUP + && obj->objclass != FL_END_GROUP ) + cnt++; + return cnt; + } - if ( obj->parent - || obj->objclass == FL_BEGIN_GROUP + if ( obj->objclass == FL_BEGIN_GROUP || obj->objclass == FL_END_GROUP ) return 0; for ( o = obj->next; o; o = o->next ) { - if ( o->parent - || o->objclass == FL_BEGIN_GROUP + if ( o->objclass == FL_BEGIN_GROUP || o->objclass == FL_END_GROUP ) continue; @@ -614,7 +614,7 @@ fli_tbox_add_chars( FL_OBJECT * obj, would be to re-evaluate the combined string to mean "@C37", setting a different color. But since in older versions this didn't happen (and some users may rely on this), it is assumed that this isn't the - users intention and to avoid the two digits to become collated and + user's intention and to avoid the two digits to become collated and interpreted as the number of a different color "@ " is inserted in between the digits, with "@ " treated as a separator between digits (the intended use of "@ " is to allow lines like "@C3@ 2. Chapter", i. @@ -2245,7 +2245,7 @@ handle_mouse( FL_OBJECT * obj, ret |= FL_RETURN_DESELECTION; } } - else + else if ( line != last_multi ) { /* Mouse may have been moved that fast that one or more lines got skipped */ @@ -2278,7 +2278,6 @@ handle_mouse( FL_OBJECT * obj, && ! sp->lines[ line ]->selected ) { fli_tbox_select_line( obj, line ); - last_multi = line; ret |= FL_RETURN_SELECTION; } else if ( mode == DESELECT @@ -2286,8 +2285,9 @@ handle_mouse( FL_OBJECT * obj, { fli_tbox_deselect_line( obj, line ); ret |= FL_RETURN_DESELECTION; - last_multi = line; } + + last_multi = line; } if ( ev == FL_RELEASE ) diff --git a/libforms.spec.in b/libforms.spec.in index 914b801..00775f5 100644 --- a/libforms.spec.in +++ b/libforms.spec.in @@ -19,12 +19,19 @@ Source0: %{name}-%{version}.tar.gz License: LGPLv2+ Group: Development/Libraries -# To build the libraries we need the libXpm and libjpeg development -# packages (which in turn depend on the corresponding library packages) +# To build the libraries we need the libXpm, libjpeg and libGL development +# packages (which in turn depend on the corresponding library packages). +# The package names seem to differ a bit between distributions, though... -BuildRequires: libXpm-devel BuildRequires: libjpeg-devel + +%if %{_host_vendor} == mageia +BuildRequires: libxpm-devel +BuildRequires: libmesagl1-devel +%else +BuildRequires: libXpm-devel BuildRequires: mesa-libGL-devel +%endif BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} |