mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcursor.git
synced 2025-12-25 22:20:07 +01:00
further formatting fixes. added script to create/find ".so" files which are missing
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
This commit is contained in:
parent
1fd32263c0
commit
a383f6cc5d
10 changed files with 238 additions and 37 deletions
|
|
@ -16,6 +16,13 @@ Xcursor_shadows = \
|
||||||
XcursorXcFileLoadAllImages \
|
XcursorXcFileLoadAllImages \
|
||||||
XcursorXcFileLoad \
|
XcursorXcFileLoad \
|
||||||
XcursorXcFileSave \
|
XcursorXcFileSave \
|
||||||
|
XcursorFileLoad \
|
||||||
|
XcursorFileLoadAllImages \
|
||||||
|
XcursorFileLoadImage \
|
||||||
|
XcursorFileLoadImages \
|
||||||
|
XcursorFileSave \
|
||||||
|
XcursorFileSaveImages \
|
||||||
|
XcursorFilenameLoadCursors \
|
||||||
XcursorFilenameLoadImage \
|
XcursorFilenameLoadImage \
|
||||||
XcursorFilenameLoadImages \
|
XcursorFilenameLoadImages \
|
||||||
XcursorFilenameLoadAllImages \
|
XcursorFilenameLoadAllImages \
|
||||||
|
|
|
||||||
140
man/Xcursor.man
140
man/Xcursor.man
|
|
@ -22,12 +22,14 @@
|
||||||
.de NS
|
.de NS
|
||||||
.br
|
.br
|
||||||
.ns
|
.ns
|
||||||
.na
|
|
||||||
.TP \\$1
|
.TP \\$1
|
||||||
|
.na
|
||||||
|
.nf
|
||||||
..
|
..
|
||||||
.de NE
|
.de NE
|
||||||
.br
|
.br
|
||||||
.ad
|
.ad
|
||||||
|
.fi
|
||||||
..
|
..
|
||||||
.ie \n(.g .ds `` \(lq
|
.ie \n(.g .ds `` \(lq
|
||||||
.el .ds `` ``
|
.el .ds `` ``
|
||||||
|
|
@ -250,132 +252,196 @@ versions.
|
||||||
.SH FUNCTIONS
|
.SH FUNCTIONS
|
||||||
|
|
||||||
.SS Object Management
|
.SS Object Management
|
||||||
.TP
|
.NS
|
||||||
XcursorImage *XcursorImageCreate (int width, int height)
|
XcursorImage *XcursorImageCreate (int width, int height)
|
||||||
.NS
|
.NS
|
||||||
void XcursorImageDestroy (XcursorImage *image)
|
void XcursorImageDestroy (XcursorImage *image)
|
||||||
|
.NE
|
||||||
Allocate and free images. On allocation, the hotspot and the pixels are
|
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.
|
left uninitialized. The size is set to the maximum of width and height.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorImages *XcursorImagesCreate (int size)
|
XcursorImages *XcursorImagesCreate (int size)
|
||||||
.NS
|
.NS
|
||||||
void XcursorImagesDestroy (XcursorImages *images)
|
void XcursorImagesDestroy (XcursorImages *images)
|
||||||
|
.NE
|
||||||
Allocate and free arrays to hold multiple cursor images. On allocation,
|
Allocate and free arrays to hold multiple cursor images. On allocation,
|
||||||
nimage is set to zero.
|
nimage is set to zero.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorCursors *XcursorCursorsCreate (Display *dpy, int size)
|
XcursorCursors *XcursorCursorsCreate (Display *dpy, int size)
|
||||||
.NS
|
.NS
|
||||||
void XcursorCursorsDestroy (XcursorCursors *cursors)
|
void XcursorCursorsDestroy (XcursorCursors *cursors)
|
||||||
|
.NE
|
||||||
Allocate and free arrays to hold multiple cursors. On allocation,
|
Allocate and free arrays to hold multiple cursors. On allocation,
|
||||||
ncursor is set to zero, ref is set to one.
|
ncursor is set to zero, ref is set to one.
|
||||||
|
|
||||||
.SS Reading and writing images.
|
.SS Reading and writing images.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorImage *XcursorXcFileLoadImage (XcursorFile *file, int size)
|
XcursorImage *XcursorXcFileLoadImage (XcursorFile *file, int size)
|
||||||
.NS
|
.NS
|
||||||
XcursorImages *XcursorXcFileLoadImages (XcursorFile *file, int size)
|
XcursorImages *XcursorXcFileLoadImages (XcursorFile *file, int size)
|
||||||
.NS
|
.NS
|
||||||
XcursorImages *XcursorXcFileLoadAllImages (XcursorFile *file)
|
XcursorImages *XcursorXcFileLoadAllImages (XcursorFile *file)
|
||||||
.NS
|
.NS
|
||||||
XcursorBool XcursorXcFileLoad (XcursorFile *file, XcursorComments **commentsp, XcursorImages **imagesp)
|
XcursorBool XcursorXcFileLoad (
|
||||||
|
XcursorFile *file,
|
||||||
|
XcursorComments **commentsp,
|
||||||
|
XcursorImages **imagesp)
|
||||||
.NS
|
.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
|
These read and write cursors from an XcursorFile handle. After reading, the
|
||||||
file pointer will be left at some random place in the file.
|
file pointer will be left at some random place in the file.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorImage *XcursorFileLoadImage (FILE *file, int size)
|
XcursorImage *XcursorFileLoadImage (FILE *file, int size)
|
||||||
.NS
|
.NS
|
||||||
XcursorImages *XcursorFileLoadImages (FILE *file, int size)
|
XcursorImages *XcursorFileLoadImages (FILE *file, int size)
|
||||||
.NS
|
.NS
|
||||||
XcursorImages *XcursorFileLoadAllImages (FILE *file)
|
XcursorImages *XcursorFileLoadAllImages (FILE *file)
|
||||||
.NS
|
.NS
|
||||||
XcursorBool XcursorFileLoad (FILE *file, XcursorComments **commentsp, XcursorImages **imagesp)
|
XcursorBool XcursorFileLoad (FILE *file,
|
||||||
|
XcursorComments **commentsp,
|
||||||
|
XcursorImages **imagesp)
|
||||||
.NS
|
.NS
|
||||||
XcursorBool XcursorFileSaveImages (FILE *file, const XcursorImages *images)
|
XcursorBool XcursorFileSaveImages (FILE *file,
|
||||||
|
const XcursorImages *images)
|
||||||
.NS
|
.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
|
These read and write cursors from a stdio FILE handle. Writing flushes
|
||||||
before returning so that any errors should be detected.
|
before returning so that any errors should be detected.
|
||||||
|
|
||||||
.TP
|
|
||||||
XcursorImage *XcursorFilenameLoadImage (const char *filename, int size)
|
|
||||||
.NS
|
.NS
|
||||||
XcursorImages *XcursorFilenameLoadImages (const char *filename, int size)
|
XcursorImage *XcursorFilenameLoadImage (
|
||||||
|
const char *filename,
|
||||||
|
int size)
|
||||||
|
.NS
|
||||||
|
XcursorImages *XcursorFilenameLoadImages (
|
||||||
|
const char *filename,
|
||||||
|
int size)
|
||||||
.NS
|
.NS
|
||||||
XcursorImages *XcursorFilenameLoadAllImages (FILE *file)
|
XcursorImages *XcursorFilenameLoadAllImages (FILE *file)
|
||||||
.NS
|
.NS
|
||||||
XcursorBool XcursorFilenameLoad (const char *file, XcursorComments **commentsp, XcursorImages **imagesp)
|
XcursorBool XcursorFilenameLoad (
|
||||||
|
const char *file,
|
||||||
|
XcursorComments **commentsp,
|
||||||
|
XcursorImages **imagesp)
|
||||||
.NS
|
.NS
|
||||||
XcursorBool XcursorFilenameSaveImages (const char *filename, const XcursorImages *images)
|
XcursorBool XcursorFilenameSaveImages (
|
||||||
|
const char *filename,
|
||||||
|
const XcursorImages *images)
|
||||||
.NS
|
.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.
|
These parallel the stdio FILE interfaces above, but take filenames.
|
||||||
|
|
||||||
.SS Reading library images
|
.SS Reading library images
|
||||||
.TP
|
|
||||||
XcursorImage *XcursorLibraryLoadImage (const char *name, const char *theme, int size)
|
|
||||||
.NS
|
.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
|
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
|
not NULL, these functions first try appending -theme to name and then
|
||||||
name alone.
|
name alone.
|
||||||
|
|
||||||
.SS Cursor APIs
|
.SS Cursor APIs
|
||||||
|
|
||||||
.TP
|
|
||||||
Cursor XcursorFilenameLoadCursor (Display *dpy, const char *file)
|
|
||||||
.NS
|
.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.
|
These load cursors from the specified file.
|
||||||
|
|
||||||
.TP
|
|
||||||
Cursor XcursorLibraryLoadCursor (Display *dpy, const char *name)
|
|
||||||
.NS
|
.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
|
These load cursors using the specified library name. The theme
|
||||||
comes from the display.
|
comes from the display.
|
||||||
|
|
||||||
.SS X Cursor Name APIs
|
.SS X Cursor Name APIs
|
||||||
|
|
||||||
.TP
|
|
||||||
XcursorImage *XcursorShapeLoadImage (unsigned int shape, const char *theme, int size)
|
|
||||||
.NS
|
.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
|
These map 'shape' to a library name using the standard X cursor names and
|
||||||
then load the images.
|
then load the images.
|
||||||
|
|
||||||
.TP
|
|
||||||
Cursor XcursorShapeLoadCursor (Display *dpy, unsigned int shape)
|
|
||||||
.NS
|
.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.
|
These map 'shape' to a library name and then load the cursors.
|
||||||
|
|
||||||
.SS Display Information APIs
|
.SS Display Information APIs
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorBool XcursorSupportsARGB (Display *dpy)
|
XcursorBool XcursorSupportsARGB (Display *dpy)
|
||||||
|
.NE
|
||||||
Returns whether the display supports ARGB cursors or whether cursors will be
|
Returns whether the display supports ARGB cursors or whether cursors will be
|
||||||
mapped to a core X cursor.
|
mapped to a core X cursor.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorBool XcursorSetDefaultSize (Display *dpy, int size)
|
XcursorBool XcursorSetDefaultSize (Display *dpy, int size)
|
||||||
|
.NE
|
||||||
Sets the default size for cursors on the specified display. When loading
|
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.
|
cursors, those whose nominal size is closest to this size will be preferred.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
int XcursorGetDefaultSize (Display *dpy)
|
int XcursorGetDefaultSize (Display *dpy)
|
||||||
|
.NE
|
||||||
Gets the default cursor size.
|
Gets the default cursor size.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
XcursorBool XcursorSetTheme (Display *dpy, const char *theme)
|
XcursorBool XcursorSetTheme (Display *dpy, const char *theme)
|
||||||
|
.NE
|
||||||
Sets the current theme name.
|
Sets the current theme name.
|
||||||
|
|
||||||
.TP
|
.NS
|
||||||
char *XcursorGetTheme (Display *dpy)
|
char *XcursorGetTheme (Display *dpy)
|
||||||
|
.NE
|
||||||
Gets the current theme name.
|
Gets the current theme name.
|
||||||
|
|
||||||
.SH "ENVIRONMENT VARIABLES"
|
.SH "ENVIRONMENT VARIABLES"
|
||||||
|
|
|
||||||
1
man/XcursorFileLoad.man
Normal file
1
man/XcursorFileLoad.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
1
man/XcursorFileLoadAllImages.man
Normal file
1
man/XcursorFileLoadAllImages.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
1
man/XcursorFileLoadImage.man
Normal file
1
man/XcursorFileLoadImage.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
1
man/XcursorFileLoadImages.man
Normal file
1
man/XcursorFileLoadImages.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
1
man/XcursorFileSave.man
Normal file
1
man/XcursorFileSave.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
1
man/XcursorFileSaveImages.man
Normal file
1
man/XcursorFileSaveImages.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
1
man/XcursorFilenameLoadCursors.man
Normal file
1
man/XcursorFilenameLoadCursors.man
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.so man__libmansuffix__/Xcursor.__libmansuffix__
|
||||||
121
man/makelinks
Executable file
121
man/makelinks
Executable file
|
|
@ -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;
|
||||||
Loading…
Add table
Reference in a new issue