debian/0000775000000000000000000000000012267512064007175 5ustar debian/libiv-unidraw1.install0000775000000000000000000000007412154370324013422 0ustar #! /usr/bin/dh-exec usr/lib/${DEB_HOST_MULTIARCH}/lib*.so.* debian/ivtools-bin.mime0000664000000000000000000000042412154370324012307 0ustar application/comterp; /usr/bin/comterp run '%s' application/ov-idraw; /usr/bin/drawtool '%s' ; test=test "$DISPLAY" != "" application/frame-idraw; /usr/bin/flipbook '%s' ; test=test "$DISPLAY" != "" application/graph-idraw; /usr/bin/graphdraw '%s' ; test=test "$DISPLAY" != "" debian/ivtools-dev.doc-base0000664000000000000000000000242512154370324013046 0ustar Document: ivtools-reference-manual Title: InterViews Reference Manual Author: Mark A. Linton, Paul R. Calder, John A. Interrante, Steven Tang, John M. Vlissides Abstract: InterViews is a software system for window-based applications. Like most user environments, InterViews is object-oriented in that components such as windows, buttons, menus, and documents are active elements with inherited behavior. The name "InterViews" comes from the idea of a user interface object presenting an interactive view of some data. For example, a text editor implements an interactive view of the contents of a text file. . InterViews provides a set of classes that define the behavior of user interface objects. We distinguish InterViews classes into two groups: protocols and kits. A protocol defines the set of operations that an object can perform, such as drawing or handling input. A kit defines a set of operations for creating other objects. The idea of a kit is also sometimes referred to as an "object factory". Using kits hides the details of object construction and subclassing-instancing tradeoffs made by the implementation, as well as providing a higher-level organizational structure to the system. Section: Programming Format: PDF Files: /usr/share/doc/ivtools-dev/refman.pdf.gz debian/ivtools-bin.install0000664000000000000000000000007512154370324013030 0ustar usr/bin usr/share/ivtools/Idemo usr/share/ivtools/InterViews debian/patches/0000775000000000000000000000000012224551126010617 5ustar debian/patches/0005-nofile-for-hurd.patch0000664000000000000000000000105112224551126015217 0ustar From: "Barak A. Pearlmutter" Date: Thu, 1 Sep 2011 20:25:54 +0100 Subject: nofile for hurd --- src/Dispatch/dispatcher.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Dispatch/dispatcher.cc b/src/Dispatch/dispatcher.cc index ab92d0e..b853e19 100644 --- a/src/Dispatch/dispatcher.cc +++ b/src/Dispatch/dispatcher.cc @@ -393,6 +393,10 @@ void ChildQueue::notify() { #define NOFILE 256 #endif +#ifndef NOFILE +#define NOFILE 256 +#endif + Dispatcher::Dispatcher() { _nfds = 0; _rmask = new FdMask; debian/patches/0008-manpage-dash-slash.patch0000664000000000000000000002463312224551126015672 0ustar From: "Barak A. Pearlmutter" Date: Sun, 26 Jun 2011 23:24:37 +0200 Subject: manpage dash slash In manpages, need to guard dashes before options: not foo --help and foo -h, but foo \-\-help and foo \-h. Ask not what your computer can do for you, but what you can do for your computer. --- src/man/man1/comdraw.1 | 10 +++++----- src/man/man1/drawtool.1 | 42 +++++++++++++++++++++--------------------- src/man/man1/flipbook.1 | 6 +++--- src/man/man3/Deck2_6.3 | 4 ++-- src/man/man3/Rubband.3 | 4 ++-- src/man/man3/UArray.3 | 2 +- src/man/man3/Viewer.3 | 2 +- src/man/man3/World.3 | 2 +- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/man/man1/comdraw.1 b/src/man/man1/comdraw.1 index b359b43..4eed5d3 100644 --- a/src/man/man1/comdraw.1 +++ b/src/man/man1/comdraw.1 @@ -3,7 +3,7 @@ comdraw \- drawtool with distributed command interpreter .SH SYNOPSIS .B comdraw -[-port n] [-import n] ['X-params'] [file] +[\-port n] [\-import n] ['X-params'] [file] .SH DESCRIPTION comdraw is a drawing editor with integrated command interpreter the user can interact with via stdin and stdout (or via telnet if ACE is @@ -161,7 +161,7 @@ barplot([var_str value_float] [...] :title title_str :xtitle xtitle_str .SH OTHER COMMANDS acknowledgebox(msgstr) -- popup an acknowledge dialog box - confirmbox(msgstr) -- popup a confirmation dialog box, and return 1, 0, or -1 if cancelled + confirmbox(msgstr) -- popup a confirmation dialog box, and return 1, 0, or \-1 if cancelled run(filename) -- run commands from file quit() -- quit this interpreter @@ -189,16 +189,16 @@ with ACE. processing. .B \-theight n, -(or "-th n") selects the automatic raster tiling height. +(or "\-th n") selects the automatic raster tiling height. .B \-twidth n, -(or "-tw n") selects the automatic raster tiling width. +(or "\-tw n") selects the automatic raster tiling width. .B \-tile, enables the automatic raster tiling. .PP -Also see the -help message and the drawtool and idraw man pages for +Also see the \-help message and the drawtool and idraw man pages for further options. .SH SEE ALSO diff --git a/src/man/man1/drawtool.1 b/src/man/man1/drawtool.1 index fbf67b0..a57daaf 100644 --- a/src/man/man1/drawtool.1 +++ b/src/man/man1/drawtool.1 @@ -3,7 +3,7 @@ drawtool \- idraw with extensions .SH SYNOPSIS .B drawtool -.I -import n ['X-params'] [file] +.I \-import n ['X-params'] [file] .SH DESCRIPTION drawtool is an extended version of idraw (originally from the InterViews 3.1). Based on the ivtools OverlayUnidraw library, it adds @@ -37,7 +37,7 @@ compress (.Z) and gzip (.gz) is recognized and handled for the script files themselves and the PBM, PGM, and PPM image formats. .PP There is also support for opening (via command line or dialog box) and -importing via the net (to the -import port) any arbitrary PostScript +importing via the net (to the \-import port) any arbitrary PostScript file using the pstoedit filter, and any GIF, TIFF, or JPEG image, using respectively the giftopnm, tifftopnm, or djpeg filters. .PP @@ -63,70 +63,70 @@ multilines if drawtool has been built with the clippoly library .SH OPTIONS .TP -"-import n" +"\-import n" specifies the port number to run the import service on. The import service accepts connections over the net and reads drawtool or idraw documents and pbmplus image formats (PBM/PGM/PPM), plus JPEG, GIF, TIFF, and the non-raster portions of arbitrary PostScript if appropriate filters are available (djpeg, giftopnm, tifftopnm, pstoedit). -"-color5" selects a colormap with 5 values per color or 125 entries (5 +"\-color5" selects a colormap with 5 values per color or 125 entries (5 cubed). .PP -"-nocolor6" overrides the selection of a colormap with 6 values per +"\-nocolor6" overrides the selection of a colormap with 6 values per color or 216 entries (6 cubed). .PP -"-gray5" selects a colormap with 5 bits of gray-level intensity (32 +"\-gray5" selects a colormap with 5 bits of gray-level intensity (32 gray-levels) arranged to maximize rubberband visibility. .PP -"-gray6" selects a colormap with 6 bits of gray-level intensity (64 +"\-gray6" selects a colormap with 6 bits of gray-level intensity (64 gray-levels) arranged to maximize rubberband visibility. .PP -"-gray7" selects a colormap with 7 bits of gray-level intensity (128 +"\-gray7" selects a colormap with 7 bits of gray-level intensity (128 gray-levels) arranged to maximize rubberband visibility. .PP -"-dithermap" causes imported JPEG rasters to be mapped to the standard -colormap (the default without -nocolor6) and dithered to avoid color +"\-dithermap" causes imported JPEG rasters to be mapped to the standard +colormap (the default without \-nocolor6) and dithered to avoid color banding. .PP -"-opaque_off" (or "-opoff") disables the opaque (visible) +"\-opaque_off" (or "\-opoff") disables the opaque (visible) interactive transformations of graphics. .PP -"-pagecols" (or "-ncols") sets the horizontal page extent in pixels. +"\-pagecols" (or "\-ncols") sets the horizontal page extent in pixels. .PP -"-pagerows" (or "-nrows") sets the vertical page extent in pixels. +"\-pagerows" (or "\-nrows") sets the vertical page extent in pixels. .PP -"-panner_align tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc" (or "-pal ...") +"\-panner_align tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc" (or "\-pal ...") selects the alignment of the panner display. .PP -"-panner_off" (or "-poff") disables the panner display. +"\-panner_off" (or "\-poff") disables the panner display. .PP -"-slider_off" (or "-soff") disables the slider display. +"\-slider_off" (or "\-soff") disables the slider display. .PP -"-zoomer_off" (or "-zoff") disables the zoomer display. +"\-zoomer_off" (or "\-zoff") disables the zoomer display. .PP -"-ptrloc" enables display of the current pointer location. +"\-ptrloc" enables display of the current pointer location. .PP -"-scribble_pointer (or "-scrpt") enables continuous line drawing. +"\-scribble_pointer (or "\-scrpt") enables continuous line drawing. .PP -"-toolbarloc r|l" (or "-tbl ...") selects the toolbar location. +"\-toolbarloc r|l" (or "\-tbl ...") selects the toolbar location. .PP -Also see "-help" and the idraw man page for more options. +Also see "\-help" and the idraw man page for more options. .SH SEE ALSO idraw(1) diff --git a/src/man/man1/flipbook.1 b/src/man/man1/flipbook.1 index f390a6e..1bb0aa4 100644 --- a/src/man/man1/flipbook.1 +++ b/src/man/man1/flipbook.1 @@ -53,15 +53,15 @@ background. .SH OPTIONS -"-bookgeom" brings up the flipbook in landscape mode, with a 906 by +"\-bookgeom" brings up the flipbook in landscape mode, with a 906 by 700 pixel page size. Useful for viewing illustrated books prepared in this mode. -"-slideshow sec" continuously plays the contents of a flipbook file +"\-slideshow sec" continuously plays the contents of a flipbook file with "sec" delay between frames (currently only available when built with ACE). -Also see "-help" for more options, and the comdraw, drawtool, and +Also see "\-help" for more options, and the comdraw, drawtool, and idraw man pages. .SH SEE ALSO diff --git a/src/man/man3/Deck2_6.3 b/src/man/man3/Deck2_6.3 index 7a7e03e..540261a 100644 --- a/src/man/man3/Deck2_6.3 +++ b/src/man/man3/Deck2_6.3 @@ -52,7 +52,7 @@ the deck (the components inserted last), and a negative value specifies a component nearer to the ``top''. FlipTo specifies a component by its absolute position in the deck. A positive value of \fIposition\fP specifies a position from the top, starting at 1. A negative value specifies a -position from the bottom, starting at -1. Top and Bottom are equivalent to -FlipTo(1) and FlipTo(-1) respectively. +position from the bottom, starting at \-1. Top and Bottom are equivalent to +FlipTo(1) and FlipTo(\-1) respectively. .SH SEE ALSO Interactor(3I), Scene(3I), Shape(3I) diff --git a/src/man/man3/Rubband.3 b/src/man/man3/Rubband.3 index cb3efb4..43ba398 100644 --- a/src/man/man3/Rubband.3 +++ b/src/man/man3/Rubband.3 @@ -344,9 +344,9 @@ the tracking point. GrowingVertices is an abstract rubberband containing a list of vertices that grows or shrinks dynamically. The \fIpt\fP parameter specifies the index of the vertex that will follow the tracking point; -a value of -1 specifies a vertex after the last one in the list. The +a value of \-1 specifies a vertex after the last one in the list. The \fIhandleSize\fP parameter specifies the size of the handle drawn at -each vertex (as in RubberHandles above); a value of -1 specifies that +each vertex (as in RubberHandles above); a value of \-1 specifies that no handles be drawn. The AddVertex operation adds a new vertex at the tracking point to the diff --git a/src/man/man3/UArray.3 b/src/man/man3/UArray.3 index ae9da66..ea534c8 100644 --- a/src/man/man3/UArray.3 +++ b/src/man/man3/UArray.3 @@ -31,7 +31,7 @@ Insert and remove an object at a particular index, moving the succeeding objects up or down one position as required. .TP .B "int Index(void*)" -Return the given object's index in the UArray, returning -1 if the +Return the given object's index in the UArray, returning \-1 if the object does not appear in the UArray. .TP .B "int Count()" diff --git a/src/man/man3/Viewer.3 b/src/man/man3/Viewer.3 index 13523bf..da2e3f2 100644 --- a/src/man/man3/Viewer.3 +++ b/src/man/man3/Viewer.3 @@ -105,7 +105,7 @@ editor's MagnifVar, if it defines one. Set and get the viewer's orientation parameter, which specifies whether the graphical view, page, and grid will appear in portrait or landscape mode. No transformation will be applied in portrait mode, -while landscape mode will rotate the page -90 degrees and translate it +while landscape mode will rotate the page \-90 degrees and translate it vertically by an amount equal to the width of the page's bounding box. .TP .B "virtual Selection* GetSelection()" diff --git a/src/man/man3/World.3 b/src/man/man3/World.3 index 297bd35..dc0d91b 100644 --- a/src/man/man3/World.3 +++ b/src/man/man3/World.3 @@ -20,7 +20,7 @@ It is currently provided for backward compatibility. .B ")" .br Construct the world object for a display. -The world's instance name comes from the -name option if +The world's instance name comes from the \-name option if it was given; otherwise the instance name comes from the environment variable RESOURCE_NAME if it is nonnil. If the name has still not been defined, then argv[0] with all leading directories stripped is debian/patches/0007-typos.patch0000664000000000000000000001232112224551126013401 0ustar From: "Barak A. Pearlmutter" Date: Mon, 9 May 2011 13:29:19 +0100 Subject: typos Fix spelling errors and typos in strings and man pages and comments. Change "assigment" to "assignment". Change "pallette" to "palette". Change "amout" to "amount". Change "arguement" to "argument". Change "targetted" to "targeted". --- CHANGES-0.8 | 2 +- src/ComTerp/assignfunc.h | 2 +- src/InterViews/hit.cc | 2 +- src/OverlayUnidraw/setattrbyexpr.h | 2 +- src/man/man1/drawtool.1 | 2 +- src/man/man3/Control.3 | 2 +- src/man/man3/Viewer.3 | 2 +- src/man/man3/statevars.3 | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGES-0.8 b/CHANGES-0.8 index c0c602e..120b0f0 100644 --- a/CHANGES-0.8 +++ b/CHANGES-0.8 @@ -777,7 +777,7 @@ Interpreter Changes * add LISP-like symbol assignment semantics to comterp. Now expressions that return a symbol can appear on the right hand - or left hand side of an assigment operator. See new command + or left hand side of an assignment operator. See new command "symvar", and "symbol" has been renamed "symval". * add support for command aliases to comterp, to allow diff --git a/src/ComTerp/assignfunc.h b/src/ComTerp/assignfunc.h index d54db4e..724f3a9 100644 --- a/src/ComTerp/assignfunc.h +++ b/src/ComTerp/assignfunc.h @@ -37,7 +37,7 @@ public: virtual boolean post_eval() { return true; } virtual void execute(); virtual const char* docstring() { - return "= is the assigment operator"; } + return "= is the assignment operator"; } CLASS_SYMID("AssignFunc"); }; diff --git a/src/InterViews/hit.cc b/src/InterViews/hit.cc index b9a79d9..fa6b8c4 100644 --- a/src/InterViews/hit.cc +++ b/src/InterViews/hit.cc @@ -379,7 +379,7 @@ void HitImpl::add_item( /* * The way we specify targets is the opposite of how we store them: - * "item(depth, 0)" is the most recently targetted item at that depth. + * "item(depth, 0)" is the most recently targeted item at that depth. * So, we use "used_ - 1 - t" as the appropriate target index. */ diff --git a/src/OverlayUnidraw/setattrbyexpr.h b/src/OverlayUnidraw/setattrbyexpr.h index 35b03b6..5bd34cf 100644 --- a/src/OverlayUnidraw/setattrbyexpr.h +++ b/src/OverlayUnidraw/setattrbyexpr.h @@ -37,7 +37,7 @@ class AttrDialog; //: command to set attributes on a component by evaluating an expression. // This command checks for a non-empty selection in the current editor, // then pops up a dialog box for entering attribute expressions to evaluate. -// symbols on the right hand side of an assigment operator are used to +// symbols on the right hand side of an assignment operator are used to // look up and return values from the property list (AttributeList) of // a component. symbols on the left-hand side of an assignment operator are // used to create or modify an entry in the same component property list. diff --git a/src/man/man1/drawtool.1 b/src/man/man1/drawtool.1 index 8f6f54d..fbf67b0 100644 --- a/src/man/man1/drawtool.1 +++ b/src/man/man1/drawtool.1 @@ -20,7 +20,7 @@ the following features: - graphical object attribute annotations .PP drawtool is derived from idraw, and implements the same set of -pulldown commands and pallette of toolbuttons. Read the idraw man +pulldown commands and palette of toolbuttons. Read the idraw man page for details on that part of the drawtool user interace. This page lists only the extensions to idraw embodied in drawtool. .PP diff --git a/src/man/man3/Control.3 b/src/man/man3/Control.3 index ca0ba08..633ac3e 100644 --- a/src/man/man3/Control.3 +++ b/src/man/man3/Control.3 @@ -99,7 +99,7 @@ Grab reads input and only passes through an event if its target is an active control. .TP .B "virtual void Skip()" -Skip reads and discards input events until it reads an event targetted +Skip reads and discards input events until it reads an event targeted for a control that is currently grabbing input, as indicated by IsGrabbing (see below). .TP diff --git a/src/man/man3/Viewer.3 b/src/man/man3/Viewer.3 index 37b7ea3..13523bf 100644 --- a/src/man/man3/Viewer.3 +++ b/src/man/man3/Viewer.3 @@ -106,7 +106,7 @@ Set and get the viewer's orientation parameter, which specifies whether the graphical view, page, and grid will appear in portrait or landscape mode. No transformation will be applied in portrait mode, while landscape mode will rotate the page -90 degrees and translate it -vertically by an amout equal to the width of the page's bounding box. +vertically by an amount equal to the width of the page's bounding box. .TP .B "virtual Selection* GetSelection()" Return the enclosing editor's selection object; it is equivalent to diff --git a/src/man/man3/statevars.3 b/src/man/man3/statevars.3 index 3af2428..010a097 100644 --- a/src/man/man3/statevars.3 +++ b/src/man/man3/statevars.3 @@ -102,7 +102,7 @@ operation is performed on the component. .ns .TP .B "virtual void NameVar::SetName(const char*)" -The NameVar constructor takes a string as an optional arguement, while +The NameVar constructor takes a string as an optional argument, while GetName and SetName retrieve and assign the string. .TP .B "CompNameVar(Component* = nil)" debian/patches/0009-gcc-4-int-pointer-warnings.patch0000664000000000000000000002063012224551126017220 0ustar From: "Barak A. Pearlmutter" Date: Wed, 4 Apr 2012 15:34:29 +0100 Subject: gcc 4 int pointer warnings Use intptr_t instead of int for integral values cast to void *, avoiding warnings in at least g++ 4.7. Note that as of g++ 4.7, the header file is needed to declare intptr_t. --- src/IV-2_6/button2_6.cc | 13 +++++++------ src/Unidraw/catalog.cc | 18 +++++++++--------- src/Unidraw/dialogs.cc | 2 +- src/include/IV-2_6/InterViews/button.h | 13 +++++++------ src/include/Unidraw/catalog.h | 11 ++++++----- 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/IV-2_6/button2_6.cc b/src/IV-2_6/button2_6.cc index e9fb518..6bd823f 100644 --- a/src/IV-2_6/button2_6.cc +++ b/src/IV-2_6/button2_6.cc @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -357,7 +358,7 @@ TextButton::~TextButton() { } PushButton::PushButton( - const char* str, ButtonState* s, int v + const char* str, ButtonState* s, intptr_t v ) : TextButton(str, s, (void*)v) { Init(); } @@ -369,7 +370,7 @@ PushButton::PushButton( } PushButton::PushButton( - const char* name, const char* str, ButtonState* s, int v + const char* name, const char* str, ButtonState* s, intptr_t v ) : TextButton(name, str, s, (void*)v) { Init(); } @@ -445,7 +446,7 @@ static Bitmap* radioChosen; static Bitmap* radioBoth; RadioButton::RadioButton( - const char* str, ButtonState* s, int v + const char* str, ButtonState* s, intptr_t v ) : TextButton(str, s, (void*)v) { Init(); } @@ -457,7 +458,7 @@ RadioButton::RadioButton( } RadioButton::RadioButton( - const char* name, const char* str, ButtonState* s, int v + const char* name, const char* str, ButtonState* s, intptr_t v ) : TextButton(name, str, s, (void*)v) { Init(); } @@ -533,7 +534,7 @@ void RadioButton::Refresh() { } CheckBox::CheckBox( - const char* str, ButtonState* s, int on, int off + const char* str, ButtonState* s, intptr_t on, intptr_t off ) : TextButton(str, s, (void*)on) { Init((void*)off); } @@ -545,7 +546,7 @@ CheckBox::CheckBox( } CheckBox::CheckBox( - const char* name, const char* str, ButtonState* s, int on, int off + const char* name, const char* str, ButtonState* s, intptr_t on, intptr_t off ) : TextButton(name, str, s, (void*)on) { Init((void*)off); } diff --git a/src/Unidraw/catalog.cc b/src/Unidraw/catalog.cc index bebb1c8..809992b 100644 --- a/src/Unidraw/catalog.cc +++ b/src/Unidraw/catalog.cc @@ -660,7 +660,7 @@ void Catalog::ReadExtraData ( for (int i = 0; !in.eof() && !FoundDelim(delim, *extra_data); ++i) { char c; in.get(c); - extra_data->Insert((void*)(unsigned int)c, i); + extra_data->Insert((void*)(unsigned intptr_t)c, i); } } @@ -1987,16 +1987,16 @@ void Catalog::Register (Tool* o, const char* name) { class VoidIntElem : public UMapElem { public: - VoidIntElem(void*, int); + VoidIntElem(void*, intptr_t); virtual void* id(); virtual void* tag(); private: void* _object; - int _id; + intptr_t _id; }; -VoidIntElem::VoidIntElem (void* object, int id) { +VoidIntElem::VoidIntElem (void* object, intptr_t id) { _object = object; _id = id; } @@ -2064,7 +2064,7 @@ inline ObjectMapElem* ObjectMap::Find (void* obj) { return (ObjectMapElem*) _objKeys.Find(obj); } -inline ObjectMapElem* ObjectMap::Find (int id) { +inline ObjectMapElem* ObjectMap::Find (intptr_t id) { return (ObjectMapElem*) _idKeys.Find((void*) id); } @@ -2075,7 +2075,7 @@ ObjectMap::ObjectMap ( _id = id; } -void ObjectMap::Register (void* obj, int id) { +void ObjectMap::Register (void* obj, intptr_t id) { VoidIntElem* elem = new VoidIntElem(obj, id); UMap::Register(elem); ObjectMapElem* objElem = new ObjectMapElem(elem); @@ -2085,7 +2085,7 @@ void ObjectMap::Register (void* obj, int id) { } void ObjectMap::Register ( - void* obj, int id, ClassId orig_id, const char* delim, UArray* extra_data + void* obj, intptr_t id, ClassId orig_id, const char* delim, UArray* extra_data ) { VoidIntElem* elem = new VoidIntElem(obj, id); UMap::Register(elem); @@ -2106,7 +2106,7 @@ void ObjectMap::Unregister (void* obj) { } } -void ObjectMap::Unregister (int id) { +void ObjectMap::Unregister (intptr_t id) { ObjectMapElem* idElem = Find(id); if (idElem != nil) { @@ -2118,7 +2118,7 @@ void ObjectMap::Unregister (int id) { void* ObjectMap::GetClient () { return _client; } ClassId ObjectMap::GetClientId () { return _id; } -void* ObjectMap::GetObject (int id) { +void* ObjectMap::GetObject (intptr_t id) { ObjectMapElem* idElem = Find(id); return (idElem == nil) ? nil : idElem->GetObject(); } diff --git a/src/Unidraw/dialogs.cc b/src/Unidraw/dialogs.cc index a7dd2f2..5db3761 100644 --- a/src/Unidraw/dialogs.cc +++ b/src/Unidraw/dialogs.cc @@ -424,7 +424,7 @@ Interactor* PrintDialog::Interior () { "send to printer via a command, or ", _dest, true ), new VGlue(space/3, 0), - new RadioButton("save in file:", _dest, int(false)) + new RadioButton("save in file:", _dest, intptr_t(false)) ) ), new VGlue(space, 0), diff --git a/src/include/IV-2_6/InterViews/button.h b/src/include/IV-2_6/InterViews/button.h index 2e6111f..2bdecf6 100644 --- a/src/include/IV-2_6/InterViews/button.h +++ b/src/include/IV-2_6/InterViews/button.h @@ -30,6 +30,7 @@ #ifndef ivlook2_6_button_h #define ivlook2_6_button_h +#include #include #include @@ -113,9 +114,9 @@ private: class PushButton : public TextButton { public: - PushButton(const char*, ButtonState*, int); + PushButton(const char*, ButtonState*, intptr_t); PushButton(const char*, ButtonState*, void*); - PushButton(const char*, const char*, ButtonState*, int); + PushButton(const char*, const char*, ButtonState*, intptr_t); PushButton(const char*, const char*, ButtonState*, void*); virtual ~PushButton(); @@ -129,9 +130,9 @@ private: class RadioButton : public TextButton { public: - RadioButton(const char*, ButtonState*, int); + RadioButton(const char*, ButtonState*, intptr_t); RadioButton(const char*, ButtonState*, void*); - RadioButton(const char*, const char*, ButtonState*, int); + RadioButton(const char*, const char*, ButtonState*, intptr_t); RadioButton(const char*, const char*, ButtonState*, void*); virtual ~RadioButton(); @@ -145,9 +146,9 @@ private: class CheckBox : public TextButton { public: - CheckBox(const char*, ButtonState*, int, int); + CheckBox(const char*, ButtonState*, intptr_t, intptr_t); CheckBox(const char*, ButtonState*, void*, void*); - CheckBox(const char*, const char*, ButtonState*, int, int); + CheckBox(const char*, const char*, ButtonState*, intptr_t, intptr_t); CheckBox(const char*, const char*, ButtonState*, void*, void*); virtual ~CheckBox(); diff --git a/src/include/Unidraw/catalog.h b/src/include/Unidraw/catalog.h index 5aa3fca..0004394 100644 --- a/src/include/Unidraw/catalog.h +++ b/src/include/Unidraw/catalog.h @@ -27,6 +27,7 @@ #ifndef unidraw_catalog_h #define unidraw_catalog_h +#include #include #include #include @@ -248,18 +249,18 @@ class ObjectMap : public UMap { public: ObjectMap(void* client, ClassId clientId); - void Register(void* obj, int id); + void Register(void* obj, intptr_t id); void Register( - void* obj, int id, ClassId orig_id, const char* delim, + void* obj, intptr_t id, ClassId orig_id, const char* delim, UArray* extra_data ); void Unregister(void* obj); - void Unregister(int id); + void Unregister(intptr_t id); void* GetClient(); ClassId GetClientId(); - void* GetObject(int id); + void* GetObject(intptr_t id); unsigned long GetId(void* obj); ClassId GetOrigClassId(void* obj); @@ -267,7 +268,7 @@ public: UArray* GetExtraData(void* obj); protected: ObjectMapElem* Find(void*); - ObjectMapElem* Find(int); + ObjectMapElem* Find(intptr_t); protected: UHashTable _objKeys, _idKeys; void* _client; debian/patches/series0000664000000000000000000000037512224551074012043 0ustar 0001-include-cstdio-etc.patch 0002-using-std-xxx.patch 0003-autoconf-guard-ioctl.patch 0004-math-atan2-hypot.patch 0005-nofile-for-hurd.patch 0006-manpage-whatis.patch 0007-typos.patch 0008-manpage-dash-slash.patch 0009-gcc-4-int-pointer-warnings.patch debian/patches/0003-autoconf-guard-ioctl.patch0000664000000000000000000000205512224551126016250 0ustar From: "Barak A. Pearlmutter" Date: Fri, 20 May 2011 15:14:42 +0100 Subject: autoconf guard ioctl --- src/IV-X11/xwindow.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/IV-X11/xwindow.cc b/src/IV-X11/xwindow.cc index 094e0d7..63368fd 100644 --- a/src/IV-X11/xwindow.cc +++ b/src/IV-X11/xwindow.cc @@ -26,6 +26,9 @@ * X11-dependent window and display implementation */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "wtable.h" #include #include @@ -56,7 +59,9 @@ #include #include #include +#ifdef HAVE_SYS_IOCTL_H #include +#endif #include #include @@ -69,9 +74,11 @@ using std::cerr; #if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__APPLE__) #if !defined(__linux__) && !defined(__CYGWIN__) /* no standard place for this */ +#ifndef HAVE_SYS_IOCTL_H extern "C" { extern int ioctl(int, int, ...); } +#endif #else #include #endif debian/patches/0004-math-atan2-hypot.patch0000664000000000000000000004111712224551126015322 0ustar From: "Barak A. Pearlmutter" Date: Tue, 17 May 2011 19:06:25 +0100 Subject: math atan2 hypot Smooth numeric code: atan2(y,x) in place of atan(y/x) and logic; hypot(x,y) in place of sqrt(x*x+y*y); define radian/degree conversion centrally, use throughout; more robust #define M_PI guard (Should algebra3.h be deleted? Seems unused.) --- src/IV-2_6/rubband.cc | 24 +++--------------------- src/IV-2_6/rubcurve.cc | 6 +++--- src/IV-2_6/rubline.cc | 2 +- src/IV-2_6/rubrect.cc | 2 +- src/IVGlyph/figure.cc | 11 ++--------- src/IVGlyph/globals.cc | 2 +- src/IVGlyph/globals.h | 5 +---- src/InterViews/bevel.cc | 8 ++++---- src/InterViews/transformer.cc | 4 +--- src/OverlayUnidraw/algebra3.h | 11 +++++++---- src/OverlayUnidraw/ovraster.cc | 2 +- src/TopoFace/fgeomobjs.cc | 2 +- src/UniIdraw/idarrowhead.cc | 2 +- src/UniIdraw/idarrows.cc | 10 +++++----- src/Unidraw/geomobjs.cc | 2 +- src/Unidraw/grblock.cc | 2 +- src/Unidraw/pin.cc | 2 +- src/Unidraw/slot.cc | 2 +- src/glyphs/morpher/glyphviewer.cc | 2 +- src/include/OS/math.h | 16 ++++++++++++++++ src/include/Unidraw/Graphic/util.h | 5 +---- 21 files changed, 54 insertions(+), 68 deletions(-) diff --git a/src/IV-2_6/rubband.cc b/src/IV-2_6/rubband.cc index a0f2ba7..7f6de9e 100644 --- a/src/IV-2_6/rubband.cc +++ b/src/IV-2_6/rubband.cc @@ -28,35 +28,17 @@ #include #include +#include #include -static float DEGS_PER_RAD = 180.0 / M_PI; - float Rubberband::Angle (IntCoord x0, IntCoord y0, IntCoord x1, IntCoord y1) { - float dx, dy, angle; - - dx = float(x1 - x0); - dy = float(y1 - y0); - if (dx != 0) { - angle = DEGS_PER_RAD * atan(dy/dx); - } else if (dy < 0) { - angle = -90; - } else { - angle = 90; - } - if (dx < 0) { - angle += 180; - } - return angle; + return degrees(atan2f(y1 - y0, x1 - x0)); } float Rubberband::Distance( IntCoord x0, IntCoord y0, IntCoord x1, IntCoord y1 ) { - float dx = x0 - x1; - float dy = y0 - y1; - - return sqrt(dx*dx + dy*dy); + return hypotf(x0-x1, y0-y1); } Rubberband::Rubberband (Painter* p, Canvas* c, IntCoord x, IntCoord y) { diff --git a/src/IV-2_6/rubcurve.cc b/src/IV-2_6/rubcurve.cc index ee93817..8e0d85b 100644 --- a/src/IV-2_6/rubcurve.cc +++ b/src/IV-2_6/rubcurve.cc @@ -128,7 +128,7 @@ RubberCircle::RubberCircle( void RubberCircle::OriginalRadii(int& xr, int& yr) { IntCoord dx = radiusx - centerx; IntCoord dy = radiusy - centery; - int radius = Math::round(sqrt(dx*dx + dy*dy)); + int radius = Math::round(hypot(dx, dy)); xr = radius; yr = radius; } @@ -136,7 +136,7 @@ void RubberCircle::OriginalRadii(int& xr, int& yr) { void RubberCircle::CurrentRadii(int& xr, int& yr) { IntCoord dx = trackx - centerx; IntCoord dy = tracky - centery; - int radius = Math::round(sqrt(dx*dx + dy*dy)); + int radius = Math::round(hypot(dx, dy)); xr = radius; yr = radius; } @@ -561,7 +561,7 @@ RotatingLineList::~RotatingLineList() { } void RotatingLineList::Update() { - float angle = (CurrentAngle() - OriginalAngle()) * M_PI/180.0; + float angle = radians(CurrentAngle() - OriginalAngle()); float cosine = cos(angle); float sine = sin(angle); float tx, ty; diff --git a/src/IV-2_6/rubline.cc b/src/IV-2_6/rubline.cc index 44c2a8f..6664e76 100644 --- a/src/IV-2_6/rubline.cc +++ b/src/IV-2_6/rubline.cc @@ -196,7 +196,7 @@ void RotatingLine::GetCurrent( dy1 = double(refy - centery); dx2 = double(trackx - centerx); dy2 = double(tracky - centery); - hprod = sqrt((dx1*dx1 + dy1*dy1) * (dx2*dx2 + dy2*dy2)); + hprod = hypot(dx1,dy1) * hypot(dx2,dy2); if (hprod != 0.0) { cos = (dx1*dx2 + dy1*dy2) / hprod; sin = (dx1*dy2 - dx2*dy1) / hprod; diff --git a/src/IV-2_6/rubrect.cc b/src/IV-2_6/rubrect.cc index ce2ef81..472f01f 100644 --- a/src/IV-2_6/rubrect.cc +++ b/src/IV-2_6/rubrect.cc @@ -286,7 +286,7 @@ void RotatingRect::GetCurrent( dy1 = double(refy - centery); dx2 = double(trackx - centerx); dy2 = double(tracky - centery); - hprod = sqrt((dx1*dx1 + dy1*dy1) * (dx2*dx2 + dy2*dy2)); + hprod = hypot(dx1, dy1) * hypot(dx2, dy2); if (hprod != 0.0) { cos = (dx1*dx2 + dy1*dy2) / hprod; sin = (dx1*dy2 - dx2*dy1) / hprod; diff --git a/src/IVGlyph/figure.cc b/src/IVGlyph/figure.cc index d8c13f9..cac53e6 100644 --- a/src/IVGlyph/figure.cc +++ b/src/IVGlyph/figure.cc @@ -217,15 +217,8 @@ boolean Graphic31::manipulating (const Event& e, Tool31& tool) { float ldy = ly-cy; float ldx = lx-cx; float dy = y-cy; float dx = x-cx; - float cur = atan(ldy/ldx)/pi*180.0; - float last = atan(dy/dx)/pi*180.0; - - if (ldx < 0.0) { - cur += 180.0; - } - if (dx < 0.0) { - last += 180.0; - } + float cur = degrees(atan2f(ldy, ldx)); + float last = degrees(atan2f(dy, dx)); rotate(cur-last, cx, cy); ts._last = e; diff --git a/src/IVGlyph/globals.cc b/src/IVGlyph/globals.cc index d8bfe3a..b7947de 100644 --- a/src/IVGlyph/globals.cc +++ b/src/IVGlyph/globals.cc @@ -15,7 +15,7 @@ PointObj::PointObj (Coord x, Coord y) { _x = x; _y = y; } PointObj::PointObj (PointObj* p) { _x = p->_x; _y = p->_y; } float PointObj::Distance (PointObj& p) { - return sqrt(float(square(_x - p._x) + square(_y - p._y))); + return hypotf(_x - p._x, _y - p._y); } /*****************************************************************************/ diff --git a/src/IVGlyph/globals.h b/src/IVGlyph/globals.h index b3e5467..454478e 100644 --- a/src/IVGlyph/globals.h +++ b/src/IVGlyph/globals.h @@ -150,11 +150,8 @@ inline void exch (int& a, int& b) { inline int square(int a) { return a *= a; } inline Coord square(Coord a) { return a *= a; } -inline Coord degrees(Coord rad) { return rad * 180.0 / M_PI; } -inline Coord radians(Coord deg) { return deg * M_PI / 180.0; } - inline Coord Distance(Coord x0, Coord y0, Coord x1, Coord y1) { - return sqrt(Coord(square(x0 - x1) + square(y0 - y1))); + return hypot(x0-x1,y0-y1); } inline void ArrayCopy ( diff --git a/src/InterViews/bevel.cc b/src/InterViews/bevel.cc index b815b7f..c07153f 100644 --- a/src/InterViews/bevel.cc +++ b/src/InterViews/bevel.cc @@ -247,7 +247,7 @@ void Bevel::left_arrow( ) { Coord center_y = (bottom + top) * 0.5; float slope = ((top - bottom) / (right - left)) * 0.5; - float delta_x = thickness / sqrt(slope * slope + 1); + float delta_x = thickness / hypot(slope, 1); float delta_y = slope * delta_x; c->new_path(); @@ -288,7 +288,7 @@ void Bevel::right_arrow( ) { Coord center_y = (bottom + top) * 0.5; float slope = ((top - bottom) / (right - left)) * 0.5; - float delta_x = thickness / sqrt(slope * slope + 1); + float delta_x = thickness / hypot(slope, 1); float delta_y = slope * delta_x; c->new_path(); @@ -329,7 +329,7 @@ void Bevel::up_arrow( ) { Coord center_x = (left + right) * 0.5; float slope = 2 * ((top - bottom) / (right - left)); - float delta_x = thickness / sqrt(slope * slope + 1); + float delta_x = thickness / hypot(slope, 1); float delta_y = slope * delta_x; c->new_path(); @@ -370,7 +370,7 @@ void Bevel::down_arrow( ) { Coord center_x = (left + right) * 0.5; float slope = 2* ((top - bottom) / (right - left)); - float delta_x = thickness / sqrt(slope * slope + 1); + float delta_x = thickness / hypot(slope, 1); float delta_y = slope * delta_x; c->new_path(); diff --git a/src/InterViews/transformer.cc b/src/InterViews/transformer.cc index 41aaff0..cbd7c82 100644 --- a/src/InterViews/transformer.cc +++ b/src/InterViews/transformer.cc @@ -30,8 +30,6 @@ #include #include -static const double RADPERDEG = M_PI/180.0; - Transformer::Transformer() { identity_ = true; mat00 = mat11 = 1; @@ -141,7 +139,7 @@ void Transformer::skew(float sx, float sy) { void Transformer::rotate(float angle) { float tmp1, tmp2, m00, m01, m10, m11, m20, m21; - angle *= RADPERDEG; + angle = radians(angle); tmp1 = cos(angle); tmp2 = sin(angle); diff --git a/src/OverlayUnidraw/algebra3.h b/src/OverlayUnidraw/algebra3.h index 8a7e283..0097bbe 100644 --- a/src/OverlayUnidraw/algebra3.h +++ b/src/OverlayUnidraw/algebra3.h @@ -59,13 +59,16 @@ enum {PA, PB, PC, PD}; // planes enum {RED, GREEN, BLUE}; // colors enum {KA, KD, KS, ES}; // phong coefficients -// Linux already defines these -#if 0 // // PI // +#ifndef M_PI const double M_PI = 3.14159265358979323846; // per CRC handbook, 14th. ed. +#endif +#ifndef M_PI_2 const double M_PI_2 = (M_PI/2.0); // PI/2 +#endif +#ifndef M2_PI const double M2_PI = (M_PI*2.0); // PI*2 #endif @@ -1239,7 +1242,7 @@ inline mat3 translation2D(const vec2& v) vec3(0.0, 0.0, 1.0)); } inline mat3 rotation2D(const vec2& Center, const double angleDeg) { - double angleRad = angleDeg * M_PI / 180.0, + double angleRad = radians(angleDeg), c = cos(angleRad), s = sin(angleRad); @@ -1266,7 +1269,7 @@ inline mat4 translation3D(const vec3& v) vec4(0.0, 0.0, 0.0, 1.0)); } inline mat4 rotation3D(vec3 Axis, const double angleDeg) { - double angleRad = angleDeg * M_PI / 180.0, + double angleRad = radians(angleDeg), c = cos(angleRad), s = sin(angleRad), t = 1.0 - c; diff --git a/src/OverlayUnidraw/ovraster.cc b/src/OverlayUnidraw/ovraster.cc index 027c233..b78f04c 100644 --- a/src/OverlayUnidraw/ovraster.cc +++ b/src/OverlayUnidraw/ovraster.cc @@ -1845,7 +1845,7 @@ static float dist( ) { float xd = x2 - x1; float yd = y2 - y1; - return sqrt((xd*xd) + (yd*yd)); + return hypot(xd, yd);; } diff --git a/src/TopoFace/fgeomobjs.cc b/src/TopoFace/fgeomobjs.cc index f4027de..a9f211b 100644 --- a/src/TopoFace/fgeomobjs.cc +++ b/src/TopoFace/fgeomobjs.cc @@ -50,7 +50,7 @@ FPointObj::FPointObj (float x, float y) { _x = x; _y = y; } FPointObj::FPointObj (FPointObj* p) { _x = p->_x; _y = p->_y; } float FPointObj::Distance (FPointObj& p) { - return sqrt(float(square(_x - p._x) + square(_y - p._y))); + return hypot(_x - p._x, _y - p._y); } /*****************************************************************************/ diff --git a/src/UniIdraw/idarrowhead.cc b/src/UniIdraw/idarrowhead.cc index 65a2959..a023289 100644 --- a/src/UniIdraw/idarrowhead.cc +++ b/src/UniIdraw/idarrowhead.cc @@ -97,7 +97,7 @@ float Arrowhead::UnscaledLength (float length, Transformer* t) { inverse.Transform(x0, y0, tx0, ty0); inverse.Transform(x1, y1, tx1, ty1); - return hypot(tx0-tx1, ty0-ty1); + return hypot(tx0 - tx1, ty0 - ty1); } void Arrowhead::draw (Canvas* c, Graphic* gs) { diff --git a/src/UniIdraw/idarrows.cc b/src/UniIdraw/idarrows.cc index fcebfe6..92fe120 100644 --- a/src/UniIdraw/idarrows.cc +++ b/src/UniIdraw/idarrows.cc @@ -225,7 +225,7 @@ void ArrowLine::SetArrows (boolean h, boolean t) { _head = h ? new Arrowhead(_x0, _y0, width, height) : nil; _tail = t ? new Arrowhead(_x1, _y1, width, height) : nil; - float angle = atan2(_y0-_y1, _x0-_x1)*180/M_PI; + float angle = degrees(atan2f(_y0-_y1, _x0-_x1)); if (h) _head->Rotate(angle-90, _x0, _y0); if (t) _tail->Rotate(angle+90, _x1, _y1); @@ -429,8 +429,8 @@ void ArrowMultiLine::SetArrows (boolean h, boolean t) { _head = h ? new Arrowhead(x()[0], y()[0], width, height) : nil; _tail = t ? new Arrowhead(x()[l], y()[l], width, height) : nil; - float head_angle = atan2(y()[0]-y()[1], x()[0]-x()[1])*180/M_PI; - float tail_angle = atan2(y()[k]-y()[l], x()[k]-x()[l])*180/M_PI; + float head_angle = degrees(atan2f(y()[0]-y()[1], x()[0]-x()[1])); + float tail_angle = degrees(atan2f(y()[k]-y()[l], x()[k]-x()[l])); if (h) _head->Rotate(head_angle-90, x()[0], y()[0]); if (t) _tail->Rotate(tail_angle+90, x()[l], y()[l]); @@ -623,8 +623,8 @@ void ArrowOpenBSpline::SetArrows (boolean h, boolean t) { _head = h ? new Arrowhead(x()[0], y()[0], width, height) : nil; _tail = t ? new Arrowhead(x()[l], y()[l], width, height) : nil; - float head_angle = atan2(y()[0]-y()[3], x()[0]-x()[3])*180/M_PI; - float tail_angle = atan2(y()[k]-y()[l], x()[k]-x()[l])*180/M_PI; + float head_angle = degrees(atan2f(y()[0]-y()[3], x()[0]-x()[3])); + float tail_angle = degrees(atan2f(y()[k]-y()[l], x()[k]-x()[l])); if (h) _head->Rotate(head_angle-90, x()[0], y()[0]); if (t) _tail->Rotate(tail_angle+90, x()[l], y()[l]); diff --git a/src/Unidraw/geomobjs.cc b/src/Unidraw/geomobjs.cc index 6c4356e..aec2671 100644 --- a/src/Unidraw/geomobjs.cc +++ b/src/Unidraw/geomobjs.cc @@ -53,7 +53,7 @@ PointObj::PointObj (Coord x, Coord y) { _x = x; _y = y; } PointObj::PointObj (PointObj* p) { _x = p->_x; _y = p->_y; } float PointObj::Distance (PointObj& p) { - return sqrt(float(square(_x - p._x) + square(_y - p._y))); + return hypot(_x - p._x, _y - p._y); } /*****************************************************************************/ diff --git a/src/Unidraw/grblock.cc b/src/Unidraw/grblock.cc index 7002800..8a59ee0 100644 --- a/src/Unidraw/grblock.cc +++ b/src/Unidraw/grblock.cc @@ -468,7 +468,7 @@ void GraphicBlock::RateScroll (Event& e) { if (dx == 0 && dy == 0) { SetCursor(origCursor); } else { - double angle = atan2(dy, dx)*180/M_PI; + double angle = degrees(atan2(dy, dx)); if (angle < -157.5) { SetCursor(kit.rfast_cursor()); diff --git a/src/Unidraw/pin.cc b/src/Unidraw/pin.cc index b79d291..2c2816b 100644 --- a/src/Unidraw/pin.cc +++ b/src/Unidraw/pin.cc @@ -386,7 +386,7 @@ void PinGraphic::getExtent ( transform(fx - PIN_RAD, fy, rx, ry, gs); transform(fx, fy, cx, cy, gs); - rad = sqrt(square(rx - cx) + square(ry - cy)); + rad = hypot(rx - cx, ry - cy); l = cx - rad; b = cy - rad; tol = 0; diff --git a/src/Unidraw/slot.cc b/src/Unidraw/slot.cc index dcfc23f..e5b1761 100644 --- a/src/Unidraw/slot.cc +++ b/src/Unidraw/slot.cc @@ -268,7 +268,7 @@ static void Correct ( float x0 = 0, y0 = 0, x1 = length, y1 = 0; corr.TransformRect(x0, y0, x1, y1); - length = Math::round(sqrt(square(x0-x1) + square(y0-y1))); + length = Math::round(hypot(x0 - x1, y0 - y1)); } Command* SlotView::InterpGraphicCompManip (Manipulator* m) { diff --git a/src/glyphs/morpher/glyphviewer.cc b/src/glyphs/morpher/glyphviewer.cc index 5136ce2..3db2ff9 100644 --- a/src/glyphs/morpher/glyphviewer.cc +++ b/src/glyphs/morpher/glyphviewer.cc @@ -272,7 +272,7 @@ void GlyphViewer::rate_scroll () { Coord dy = _y - _ly; if (dx != 0.0 && dy != 0.0) { - double angle = atan2(dy, dx)*180/M_PI; + double angle = degrees(atan2(dy, dx)); if (angle < -157.5) { w->cursor(kit->rfast_cursor()); diff --git a/src/include/OS/math.h b/src/include/OS/math.h index 252441e..67f79b5 100644 --- a/src/include/OS/math.h +++ b/src/include/OS/math.h @@ -107,4 +107,20 @@ inline boolean Math::equal(double x, double y, double e) { return x - y < e && y - x < e; } +#ifndef M_PI +const double M_PI = 3.14159265358979323846; // per CRC handbook, 14th. ed. +#endif +#ifndef M_PI_2 +const double M_PI_2 = (M_PI/2.0); // PI/2 +#endif +#ifndef M2_PI +const double M2_PI = (M_PI*2.0); // PI*2 +#endif + +inline float degrees(float rad) { return rad * (float)(180 / M_PI); } +inline float radians(float deg) { return deg * (float)(M_PI / 180); } + +inline double degrees(double rad) { return rad * (180 / M_PI); } +inline double radians(double deg) { return deg * (M_PI / 180); } + #endif diff --git a/src/include/Unidraw/Graphic/util.h b/src/include/Unidraw/Graphic/util.h index a09b999..a865bdf 100644 --- a/src/include/Unidraw/Graphic/util.h +++ b/src/include/Unidraw/Graphic/util.h @@ -43,11 +43,8 @@ inline void exch (int& a, int& b) { inline int square(int a) { return a *= a; } inline float square(float a) { return a *= a; } -inline float degrees(float rad) { return rad * 180.0 / M_PI; } -inline float radians(float deg) { return deg * M_PI / 180.0; } - inline float Distance(Coord x0, Coord y0, Coord x1, Coord y1) { - return sqrt(float(square(x0 - x1) + square(y0 - y1))); + return hypotf(x0 - x1, y0 - y1); } inline void ArrayCopy ( debian/patches/0006-manpage-whatis.patch0000664000000000000000000000507712224551126015141 0ustar From: "Barak A. Pearlmutter" Date: Sat, 7 May 2011 18:05:45 +0100 Subject: manpage whatis tweak man page headers into conformance with format required by whatis, aka, man -k, and correct any roff syntax errors. --- src/man/man1/comdraw.1 | 2 +- src/man/man1/comterp.1 | 2 +- src/man/man1/drawtool.1 | 4 ++-- src/man/man3/BasicDialog.3 | 2 +- src/man/man3/UnidrawIntro.3 | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/man/man1/comdraw.1 b/src/man/man1/comdraw.1 index 2503151..b359b43 100644 --- a/src/man/man1/comdraw.1 +++ b/src/man/man1/comdraw.1 @@ -1,5 +1,5 @@ .TH COMDRAW 1 -.SH COMDRAW +.SH NAME comdraw \- drawtool with distributed command interpreter .SH SYNOPSIS .B comdraw diff --git a/src/man/man1/comterp.1 b/src/man/man1/comterp.1 index 07cecdd..386d877 100644 --- a/src/man/man1/comterp.1 +++ b/src/man/man1/comterp.1 @@ -1,5 +1,5 @@ .TH COMTERP 1 -.SH COMTERP +.SH NAME comterp \- distributed command interpreter demonstrator .SH SYNOPSIS .B comterp diff --git a/src/man/man1/drawtool.1 b/src/man/man1/drawtool.1 index 0266269..8f6f54d 100644 --- a/src/man/man1/drawtool.1 +++ b/src/man/man1/drawtool.1 @@ -104,8 +104,8 @@ interactive transformations of graphics. "-pagerows" (or "-nrows") sets the vertical page extent in pixels. .PP -"-panner_align tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc" (or "-pal -...") selects the alignment of the panner display. +"-panner_align tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc" (or "-pal ...") +selects the alignment of the panner display. .PP "-panner_off" (or "-poff") disables the panner display. diff --git a/src/man/man3/BasicDialog.3 b/src/man/man3/BasicDialog.3 index 31da5e3..fb00fb9 100644 --- a/src/man/man3/BasicDialog.3 +++ b/src/man/man3/BasicDialog.3 @@ -1,7 +1,7 @@ .TH BasicDialog 3U "23 July 1990" "Unidraw" "InterViews Reference Manual" .SH NAME AcknowledgeDialog, BasicDialog, ConfirmDialog, GridDialog, \ -PrintDialog, UChooser - an assortment of useful dialog boxes +PrintDialog, UChooser \- an assortment of useful dialog boxes .SH SYNOPSIS .B #include .SH DESCRIPTION diff --git a/src/man/man3/UnidrawIntro.3 b/src/man/man3/UnidrawIntro.3 index a9f473b..802a63f 100644 --- a/src/man/man3/UnidrawIntro.3 +++ b/src/man/man3/UnidrawIntro.3 @@ -1,6 +1,6 @@ .TH UnidrawIntro 3U "11 June 1990" "Unidraw" "InterViews Reference Manual" .SH NAME -Unidraw library for graphical object editor development +Unidraw_Intro \- Unidraw library for graphical object editor development .SH SYNOPSIS .B #include .br debian/patches/0002-using-std-xxx.patch0000664000000000000000000000257712224551126014774 0ustar From: "Barak A. Pearlmutter" Date: Sun, 8 May 2011 14:06:25 +0100 Subject: using std xxx explicitly import some std:: qualified identifiers --- src/OverlayUnidraw/clippoly.cc | 3 +++ src/Time/Date.cc | 3 +++ src/Time/Time.cc | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/OverlayUnidraw/clippoly.cc b/src/OverlayUnidraw/clippoly.cc index c239894..60266b2 100644 --- a/src/OverlayUnidraw/clippoly.cc +++ b/src/OverlayUnidraw/clippoly.cc @@ -31,6 +31,9 @@ #include #include +using std::cerr; +using std::endl; + void clippoly(ClipOperation op, int n1, float* x1, float* y1, int n2, float* x2, float* y2, int& npolys, int*& ni, float**& x, float**& y diff --git a/src/Time/Date.cc b/src/Time/Date.cc index b0825f5..1954147 100644 --- a/src/Time/Date.cc +++ b/src/Time/Date.cc @@ -72,6 +72,9 @@ using namespace std; #include #include +using std::setfill; +using std::setw; + #define THIS Date #define BASE Object #define BASE_CLASSES BASE::desc() diff --git a/src/Time/Time.cc b/src/Time/Time.cc index dc3d3ae..80b27e0 100644 --- a/src/Time/Time.cc +++ b/src/Time/Time.cc @@ -35,6 +35,9 @@ seconds since January 1, 1901, GMT. #include using namespace std; +using std::setfill; +using std::setw; + const unsigned VERSION =2; #define THIS Time debian/patches/0001-include-cstdio-etc.patch0000664000000000000000000002431612224551126015703 0ustar From: "Barak A. Pearlmutter" Date: Sat, 7 May 2011 18:05:37 +0100 Subject: include cstdio etc augment and adjust standard C++ I/O-related include directives --- src/Attribute/paramlist.cc | 1 + src/ComTerp/comterp.cc | 1 + src/ComTerp/comvalue.cc | 1 + src/ComTerp/ctrlfunc.cc | 1 + src/ComTerp/debugfunc.cc | 2 ++ src/DrawServ/rcdialog.cc | 2 +- src/GraphUnidraw/graphcatalog.cc | 2 ++ src/IV-X11/xdrag.cc | 2 ++ src/IVGlyph/exportchooser.cc | 3 ++- src/IVGlyph/fieldedit.cc | 2 ++ src/InterViews/printer.cc | 1 + src/InterViews/regexp.cc | 3 +++ src/OS/string.cc | 1 + src/Time/Date.cc | 4 +++- src/Time/Time.cc | 4 ++-- src/Time/obstime.cc | 1 + src/Time/timeglyph.cc | 3 ++- src/TopoFace/fgeomobjs.cc | 1 + src/Unidraw/geomobjs.cc | 2 ++ src/comterp_/main.cc | 2 ++ src/glyphs/examples3.1/print/main.cc | 2 ++ src/iclass/main.cc | 1 + src/include/OS/string.h | 1 + src/include/Unidraw/Graphic/geomobjs.h | 2 ++ src/include/ivstd/fstream.h | 1 + src/include/ivstd/iostream.h | 1 + 26 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/Attribute/paramlist.cc b/src/Attribute/paramlist.cc index 934ff73..ad547f9 100644 --- a/src/Attribute/paramlist.cc +++ b/src/Attribute/paramlist.cc @@ -25,6 +25,7 @@ * Implementation of ParamList class. */ +#include #include #include #include diff --git a/src/ComTerp/comterp.cc b/src/ComTerp/comterp.cc index ff8e554..50867bb 100644 --- a/src/ComTerp/comterp.cc +++ b/src/ComTerp/comterp.cc @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/src/ComTerp/comvalue.cc b/src/ComTerp/comvalue.cc index e5227c7..11cb581 100644 --- a/src/ComTerp/comvalue.cc +++ b/src/ComTerp/comvalue.cc @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/src/ComTerp/ctrlfunc.cc b/src/ComTerp/ctrlfunc.cc index 7973214..dbd37f1 100644 --- a/src/ComTerp/ctrlfunc.cc +++ b/src/ComTerp/ctrlfunc.cc @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/src/ComTerp/debugfunc.cc b/src/ComTerp/debugfunc.cc index f8f5a5b..aa66ddc 100644 --- a/src/ComTerp/debugfunc.cc +++ b/src/ComTerp/debugfunc.cc @@ -22,6 +22,8 @@ * */ +#include + #if __GNUC__==2 && __GNUC_MINOR__<=7 #else #include diff --git a/src/DrawServ/rcdialog.cc b/src/DrawServ/rcdialog.cc index a9445ad..56e8401 100644 --- a/src/DrawServ/rcdialog.cc +++ b/src/DrawServ/rcdialog.cc @@ -49,7 +49,7 @@ #include #include -#include +#include #include using namespace std; #include diff --git a/src/GraphUnidraw/graphcatalog.cc b/src/GraphUnidraw/graphcatalog.cc index ff4b56f..80d764d 100644 --- a/src/GraphUnidraw/graphcatalog.cc +++ b/src/GraphUnidraw/graphcatalog.cc @@ -25,6 +25,8 @@ * GraphCatalog implementation. */ +#include + #include #include diff --git a/src/IV-X11/xdrag.cc b/src/IV-X11/xdrag.cc index 517c78e..d07ccd8 100644 --- a/src/IV-X11/xdrag.cc +++ b/src/IV-X11/xdrag.cc @@ -21,6 +21,8 @@ * SOFTWARE. */ +#include + #include #include #include diff --git a/src/IVGlyph/exportchooser.cc b/src/IVGlyph/exportchooser.cc index 138d053..f662451 100644 --- a/src/IVGlyph/exportchooser.cc +++ b/src/IVGlyph/exportchooser.cc @@ -27,6 +27,8 @@ * ExportChooser -- select a file/command to export graphics to */ +#include + #include #include #include @@ -53,7 +55,6 @@ #include #include -#include #include implementActionCallback(ExportChooserImpl) diff --git a/src/IVGlyph/fieldedit.cc b/src/IVGlyph/fieldedit.cc index 60d8e07..569a269 100644 --- a/src/IVGlyph/fieldedit.cc +++ b/src/IVGlyph/fieldedit.cc @@ -21,6 +21,8 @@ * */ +#include + #include #include #include diff --git a/src/InterViews/printer.cc b/src/InterViews/printer.cc index 69188eb..732731f 100644 --- a/src/InterViews/printer.cc +++ b/src/InterViews/printer.cc @@ -26,6 +26,7 @@ * Printer - draw for PostScript printer */ +#include #include #include #include diff --git a/src/InterViews/regexp.cc b/src/InterViews/regexp.cc index 824ad5d..ebe404c 100644 --- a/src/InterViews/regexp.cc +++ b/src/InterViews/regexp.cc @@ -26,9 +26,12 @@ * Regexp - regular expression searching */ +#include #include #include #include +#include +#include using std::cerr; /* diff --git a/src/OS/string.cc b/src/OS/string.cc index 9e4a76a..b1aee1b 100644 --- a/src/OS/string.cc +++ b/src/OS/string.cc @@ -22,6 +22,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include #include diff --git a/src/Time/Date.cc b/src/Time/Date.cc index cff5274..b0825f5 100644 --- a/src/Time/Date.cc +++ b/src/Time/Date.cc @@ -60,6 +60,8 @@ Log: Date.c,v Modified by Vectaport, Inc. */ +#include + #include