diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2021-03-14 19:24:48 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2021-03-17 19:09:25 -0400 |
commit | a383f6cc5d64715012e7c53c70a624c303103d4d (patch) | |
tree | 79baccc36c5f8f2a7c3830a7aa01931c4bfa6112 | |
parent | 1fd32263c0d11310b7d04f34f43051f802cc8ea7 (diff) |
further formatting fixes. added script to create/find ".so" files which are missing
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | man/Makefile.am | 7 | ||||
-rw-r--r-- | man/Xcursor.man | 140 | ||||
-rw-r--r-- | man/XcursorFileLoad.man | 1 | ||||
-rw-r--r-- | man/XcursorFileLoadAllImages.man | 1 | ||||
-rw-r--r-- | man/XcursorFileLoadImage.man | 1 | ||||
-rw-r--r-- | man/XcursorFileLoadImages.man | 1 | ||||
-rw-r--r-- | man/XcursorFileSave.man | 1 | ||||
-rw-r--r-- | man/XcursorFileSaveImages.man | 1 | ||||
-rw-r--r-- | man/XcursorFilenameLoadCursors.man | 1 | ||||
-rwxr-xr-x | man/makelinks | 121 |
10 files changed, 238 insertions, 37 deletions
diff --git a/man/Makefile.am b/man/Makefile.am index f3f4599..24effcf 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -16,6 +16,13 @@ Xcursor_shadows = \ XcursorXcFileLoadAllImages \ XcursorXcFileLoad \ XcursorXcFileSave \ + XcursorFileLoad \ + XcursorFileLoadAllImages \ + XcursorFileLoadImage \ + XcursorFileLoadImages \ + XcursorFileSave \ + XcursorFileSaveImages \ + XcursorFilenameLoadCursors \ XcursorFilenameLoadImage \ XcursorFilenameLoadImages \ XcursorFilenameLoadAllImages \ diff --git a/man/Xcursor.man b/man/Xcursor.man index fe93b13..137862c 100644 --- a/man/Xcursor.man +++ b/man/Xcursor.man @@ -22,12 +22,14 @@ .de NS .br .ns -.na .TP \\$1 +.na +.nf .. .de NE .br .ad +.fi .. .ie \n(.g .ds `` \(lq .el .ds `` `` @@ -250,132 +252,196 @@ versions. .SH FUNCTIONS .SS Object Management -.TP +.NS XcursorImage *XcursorImageCreate (int width, int height) .NS void XcursorImageDestroy (XcursorImage *image) +.NE Allocate and free images. On allocation, the hotspot and the pixels are left uninitialized. The size is set to the maximum of width and height. -.TP +.NS XcursorImages *XcursorImagesCreate (int size) .NS void XcursorImagesDestroy (XcursorImages *images) +.NE Allocate and free arrays to hold multiple cursor images. On allocation, nimage is set to zero. -.TP +.NS XcursorCursors *XcursorCursorsCreate (Display *dpy, int size) .NS void XcursorCursorsDestroy (XcursorCursors *cursors) +.NE Allocate and free arrays to hold multiple cursors. On allocation, ncursor is set to zero, ref is set to one. .SS Reading and writing images. -.TP +.NS XcursorImage *XcursorXcFileLoadImage (XcursorFile *file, int size) .NS XcursorImages *XcursorXcFileLoadImages (XcursorFile *file, int size) .NS XcursorImages *XcursorXcFileLoadAllImages (XcursorFile *file) .NS -XcursorBool XcursorXcFileLoad (XcursorFile *file, XcursorComments **commentsp, XcursorImages **imagesp) +XcursorBool XcursorXcFileLoad ( + XcursorFile *file, + XcursorComments **commentsp, + XcursorImages **imagesp) .NS -XcursorBool XcursorXcFileSave (XcursorFile *file, const XcursorComments *comments, const XcursorImages *images) +XcursorBool XcursorXcFileSave ( + XcursorFile *file, + const XcursorComments *comments, + const XcursorImages *images) +.NE These read and write cursors from an XcursorFile handle. After reading, the file pointer will be left at some random place in the file. -.TP +.NS XcursorImage *XcursorFileLoadImage (FILE *file, int size) .NS XcursorImages *XcursorFileLoadImages (FILE *file, int size) .NS XcursorImages *XcursorFileLoadAllImages (FILE *file) .NS -XcursorBool XcursorFileLoad (FILE *file, XcursorComments **commentsp, XcursorImages **imagesp) +XcursorBool XcursorFileLoad (FILE *file, + XcursorComments **commentsp, + XcursorImages **imagesp) .NS -XcursorBool XcursorFileSaveImages (FILE *file, const XcursorImages *images) +XcursorBool XcursorFileSaveImages (FILE *file, + const XcursorImages *images) .NS -XcursorBool XcursorFileSave (FILE * file, const XcursorComments *comments, const XcursorImages *images) +XcursorBool XcursorFileSave ( + FILE * file, + const XcursorComments *comments, + const XcursorImages *images) +.NE These read and write cursors from a stdio FILE handle. Writing flushes before returning so that any errors should be detected. -.TP -XcursorImage *XcursorFilenameLoadImage (const char *filename, int size) .NS -XcursorImages *XcursorFilenameLoadImages (const char *filename, int size) +XcursorImage *XcursorFilenameLoadImage ( + const char *filename, + int size) +.NS +XcursorImages *XcursorFilenameLoadImages ( + const char *filename, + int size) .NS XcursorImages *XcursorFilenameLoadAllImages (FILE *file) .NS -XcursorBool XcursorFilenameLoad (const char *file, XcursorComments **commentsp, XcursorImages **imagesp) +XcursorBool XcursorFilenameLoad ( + const char *file, + XcursorComments **commentsp, + XcursorImages **imagesp) .NS -XcursorBool XcursorFilenameSaveImages (const char *filename, const XcursorImages *images) +XcursorBool XcursorFilenameSaveImages ( + const char *filename, + const XcursorImages *images) .NS -XcursorBool XcursorFilenameSave (const char *file, const XcursorComments *comments, const XcursorImages *images) +XcursorBool XcursorFilenameSave ( + const char *file, + const XcursorComments *comments, + const XcursorImages *images) +.NE These parallel the stdio FILE interfaces above, but take filenames. .SS Reading library images -.TP -XcursorImage *XcursorLibraryLoadImage (const char *name, const char *theme, int size) .NS -XcursorImages *XcursorLibraryLoadImages (const char *name, const char *theme, int size) +XcursorImage *XcursorLibraryLoadImage ( + const char *name, + const char *theme, + int size) +.NS +XcursorImages *XcursorLibraryLoadImages ( + const char *name, + const char *theme, + int size) +.NE These search the library path, loading the first file found. If 'theme' is not NULL, these functions first try appending -theme to name and then name alone. .SS Cursor APIs -.TP -Cursor XcursorFilenameLoadCursor (Display *dpy, const char *file) .NS -XcursorCursors *XcursorFilenameLoadCursors (Display *dpy, const char *file) +Cursor XcursorFilenameLoadCursor ( + Display *dpy, + const char *file) +.NS +XcursorCursors *XcursorFilenameLoadCursors ( + Display *dpy, + const char *file) +.NE These load cursors from the specified file. -.TP -Cursor XcursorLibraryLoadCursor (Display *dpy, const char *name) .NS -XcursorCursors *XcursorLibraryLoadCursors (Display *dpy, const char *name) +Cursor XcursorLibraryLoadCursor ( + Display *dpy, + const char *name) +.NS +XcursorCursors *XcursorLibraryLoadCursors ( + Display *dpy, + const char *name) +.NE These load cursors using the specified library name. The theme comes from the display. .SS X Cursor Name APIs -.TP -XcursorImage *XcursorShapeLoadImage (unsigned int shape, const char *theme, int size) .NS -XcursorImages *XcursorShapeLoadImages (unsigned int shape, const char *theme, int size) +XcursorImage *XcursorShapeLoadImage ( + unsigned int shape, + const char *theme, + int size) +.NS +XcursorImages *XcursorShapeLoadImages ( + unsigned int shape, + const char *theme, + int size) +.NE These map 'shape' to a library name using the standard X cursor names and then load the images. -.TP -Cursor XcursorShapeLoadCursor (Display *dpy, unsigned int shape) .NS -XcursorCursors *XcursorShapeLoadCursors (Display *dpy, unsigned int shape) +Cursor XcursorShapeLoadCursor ( + Display *dpy, + unsigned int shape) +.NS +XcursorCursors *XcursorShapeLoadCursors ( + Display *dpy, + unsigned int shape) +.NE These map 'shape' to a library name and then load the cursors. .SS Display Information APIs -.TP +.NS XcursorBool XcursorSupportsARGB (Display *dpy) +.NE Returns whether the display supports ARGB cursors or whether cursors will be mapped to a core X cursor. -.TP +.NS XcursorBool XcursorSetDefaultSize (Display *dpy, int size) +.NE Sets the default size for cursors on the specified display. When loading cursors, those whose nominal size is closest to this size will be preferred. -.TP +.NS int XcursorGetDefaultSize (Display *dpy) +.NE Gets the default cursor size. -.TP +.NS XcursorBool XcursorSetTheme (Display *dpy, const char *theme) +.NE Sets the current theme name. -.TP +.NS char *XcursorGetTheme (Display *dpy) +.NE Gets the current theme name. .SH "ENVIRONMENT VARIABLES" diff --git a/man/XcursorFileLoad.man b/man/XcursorFileLoad.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFileLoad.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/XcursorFileLoadAllImages.man b/man/XcursorFileLoadAllImages.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFileLoadAllImages.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/XcursorFileLoadImage.man b/man/XcursorFileLoadImage.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFileLoadImage.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/XcursorFileLoadImages.man b/man/XcursorFileLoadImages.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFileLoadImages.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/XcursorFileSave.man b/man/XcursorFileSave.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFileSave.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/XcursorFileSaveImages.man b/man/XcursorFileSaveImages.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFileSaveImages.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/XcursorFilenameLoadCursors.man b/man/XcursorFilenameLoadCursors.man new file mode 100644 index 0000000..690dab2 --- /dev/null +++ b/man/XcursorFilenameLoadCursors.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xcursor.__libmansuffix__ diff --git a/man/makelinks b/man/makelinks new file mode 100755 index 0000000..cfed84d --- /dev/null +++ b/man/makelinks @@ -0,0 +1,121 @@ +#!/usr/bin/env perl +#------------------------------------------------------------------------------- +# Copyright 2021, Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +#------------------------------------------------------------------------------- +# Ensure that the function-prototypes listed in Xcursor.man have ".so" files, +# and that those are listed in the makefile. + +use strict; +use warnings; + +our %man_links; + +sub read_file($) { + my $file = shift; + my @data; + if ( open my $fh, $file ) { + @data = <$fh>; + close $fh; + chomp @data; + } + return @data; +} + +sub make_man_link($) { + my $name = shift; + my $link = ".so man__libmansuffix__/Xcursor.__libmansuffix__"; + my $file = $name . ".man"; + if ( -f $file ) { + my @data = &read_file($file); + if ( $#data != 0 or $data[0] ne $link ) { + printf "?? wrong: $file\n"; + } + } + else { + printf "...create: $file\n"; + open my $fh, ">$file" or die "cannot create $file"; + printf $fh "%s\n", $link; + close $fh; + system("git add $file"); + } + $man_links{$name} = $file; +} + +sub scan_man($) { + my $file = shift; + printf "** scan $file\n"; + my @data = &read_file($file); + my $last = ""; + for my $n ( 0 .. $#data ) { + if ( $last =~ /^\.NS\b/ ) { + my $name = $data[$n]; + $name =~ s/^\s*\w+\s*[*]*\s*(\w+)\b.*/$1/; + &make_man_link($name); + } + $last = $data[$n]; + } +} + +sub scan_make($) { + my $find = shift; + my $file = shift; + printf "** find $find in $file\n"; + my @data = &read_file($file); + my %data; + my $state = 0; + for my $n ( 0 .. $#data ) { + if ( $data[$n] =~ /^\s*$find\s*=/ ) { + $state = 1; + } + elsif ( $state == 1 ) { + if ( $data[$n] =~ /\\$/ ) { + } + else { + $state = 2; + } + my $name = $data[$n]; + $name =~ s/^\s*(\w+)\s*[\\]?$/$1/; + $data{$name} = 1; + } + elsif ( $state == 2 ) { + last; + } + } + for my $key ( sort keys %data ) { + printf "manpage needs $key\n", unless ( defined $man_links{$key} ); + } + for my $key ( sort keys %man_links ) { + printf "$file needs $key\n", unless ( defined $data{$key} ); + } +} + +&scan_man("Xcursor.man"); +&scan_make( "Xcursor_shadows", "Makefile.am" ); + +1; |