<commit_before>.\" Copyright (c) 1997 <NAME>
.\" All rights reserved.
.\" 
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer,
.\"    in this position and unchanged.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\"    derived from this software withough specific prior written permission.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" 
.\" $Id: vgl.3,v 1.2 1997/08/15 12:35:02 sos Exp $

.Dd August 13, 1997
.Dt VGL 3
.Os FreeBSD 3
.Sh NAME
.Nm vgl
.Nd Video Graphics Library functions
.Sh SYNOPSIS
.Fd #include <vgl.h>

.Sh DESCRIPTION
Libvgl is a library that enables the programmer access to the graphics
modes supported by the console driver (syscons). The library takes care of
programming the actual video hardware, and provides a number of simple
functions to do various graphic operations. There is also support for a
mouse via the standard mouse system in FreeBSD, see
.Fn moused
, including the ability to transparantly have a mousepointer superimposed on
the graphic image currently being worked on. 
The library takes care of screenswitching by storing the current image in
memory before swithing to another virtual console, and restoring when the
user switches back. This allows several graphic applications at once, but
on different virtual consoles.

Below is a short description of the various functions:

.Sh AUTHOR
.An <NAME> (<EMAIL>)

.Sh FUNCTIONS

.Ft int 
.Fn VGLInit "int mode"

Initialize the library and set up the graphic mode
.Em mode


.Ft void 
.Fn VGLEnd "void"

Terminate graphic mode, and restore the screenmode that was active before
.Fn VGLInit
was called.


.Ft void 
.Fn VGLCheckSwitch "void"

If the program goes into longer periods of processing without doing
any graphics output, calling this function occasionally will allow 
the system to switch screens.


.Ft int 
.Fn VGLTextSetFontFile "char *filename"

Instruct the char/string functions to use the font in file
.Em filename
instead of the buildin font.


.Ft int 
.Fn VGLMouseInit "int mode"

Initialize the mouse. The optional onscreen mousepointer is shown if the
argument is 
.Em VGL_SHOWMOUSE


.Ft void 
.Fn VGLMouseMode "int mode"

Either shows the mousepointer if the argument is
.Em VGL_SHOWMOUSE
, or hide the mousepointer if the argument is
.Em VGL_HIDEMOUSE


.Ft int 
.Fn VGLMouseStatus "int *x" "int *y" "char *buttons"

Returns the current mousepointer coordiantes and button state in
.Em x, y, buttons. The return value reflects if the mousepointer 
is currently shown on screen or not.


.Ft void 
.Fn VGLMouseSetImage "VGLBitmap *AndMask" "VGLBitmap *OrMask"

With this function it is possible to change the image of the mousepointer
on screen.


.Ft void 
.Fn VGLMouseSetStdImage "void"

This function restores the mousepointer to the standard arrow.


.Ft void 
.Fn VGLLine "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"

Draw a line from
.Em x1, y1
to
.Em x2, y2
in color
.Em color


.Ft void 
.Fn VGLBox "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"

Draw a box with upper left hand corner at
.Em x1, y1
and lower right hand corner at
.Em x2, y2
in color
.Em color


.Ft void 
.Fn VGLFilledBox "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"

Draw a filled (solid) box with upper left hand corner at
.Em x1, y1
and lower right hand corner at
.Em x2, y2
in color
.Em color


.Ft void 
.Fn VGLEllipse "VGLBitmap *object" "int xc" "int yc" "int a" "int b" "byte color"

Draw an ellipse centered at 
.Em xc, yc
make it 
.Em a
pixels wide, and 
.Em b
pixels high in color
.Em color


.Ft void 
.Fn VGLFilledEllipse "VGLBitmap *object" "int xc" "int yc" "int a" "int b" "byte color"

Draw a filled (solid) ellipse centered at 
.Em xc, yc
make it 
.Em a
pixels wide, and 
.Em b
pixels high in color
.Em color


.Ft int 
.Fn VGLBitmapCopy "VGLBitmap *src" "int srcx" "int srcy" "VGLBitmap *dst" "int dstx" "int dsty" "int width" "int hight"

Copy a rectangle of pixels from bitmap
.Em src
upper lefthand corner at 
.Em srcx, srcy
to bitmap
.Em dst
at 
.Em dstx, dsty
of the size
.Em width, hight


.Ft void 
.Fn VGLBitmapPutChar "VGLBitmap *Object" "int x" "int y" "byte ch" "byte fgcol" "byte bgcol" "int fill" "int dir"

Write the character
.Em ch
at position
.Em x, y
in foregroundcolor 
.Em fgcol.
If 
.Em fill
is != 0, use the color
.Em bgcol
as background otherwise the background is transparant.
The character is drawn in the direction specified by the argument
.Em dir<commit_msg>Fix a couble of typos.<commit_after>.\" Copyright (c) 1997 <NAME>
.\" All rights reserved.
.\" 
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer,
.\"    in this position and unchanged.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\"    derived from this software withough specific prior written permission.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" 
.\" $Id: vgl.3,v 1.1 1997/08/17 21:09:35 sos Exp $

.Dd August 13, 1997
.Dt VGL 3
.Os FreeBSD 3
.Sh NAME
.Nm vgl
.Nd Video Graphics Library functions
.Sh SYNOPSIS
.Fd #include <vgl.h>

.Sh DESCRIPTION
Libvgl is a library that enables the programmer access to the graphics
modes supported by the console driver (syscons). The library takes care of
programming the actual video hardware, and provides a number of simple
functions to do various graphic operations. There is also support for a
mouse via the standard mouse system in FreeBSD, see
.Fn moused
, including the ability to transparantly have a mousepointer superimposed on
the graphic image currently being worked on. 
The library takes care of screenswitching by storing the current image in
memory before swithing to another virtual console, and restoring when the
user switches back. This allows several graphic applications at once, but
on different virtual consoles.

Below is a short description of the various functions:

.Sh AUTHOR
.An <NAME> (<EMAIL>)

.Sh FUNCTIONS

.Ft int 
.Fn VGLInit "int mode"

Initialize the library and set up the graphic mode
.Em mode


.Ft void 
.Fn VGLEnd "void"

Terminate graphic mode, and restore the screenmode that was active before
.Fn VGLInit
was called.


.Ft void 
.Fn VGLCheckSwitch "void"

If the program goes into longer periods of processing without doing
any graphics output, calling this function occasionally will allow 
the system to switch screens.


.Ft int 
.Fn VGLTextSetFontFile "char *filename"

Instruct the char/string functions to use the font in file
.Em filename
instead of the buildin font.


.Ft int 
.Fn VGLMouseInit "int mode"

Initialize the mouse. The optional onscreen mousepointer is shown if the
argument is 
.Em VGL_MOUSESHOW


.Ft void 
.Fn VGLMouseMode "int mode"

Either shows the mousepointer if the argument is
.Em VGL_MOUSESHOW
, or hide the mousepointer if the argument is
.Em VGL_MOUSEHIDE


.Ft int 
.Fn VGLMouseStatus "int *x" "int *y" "char *buttons"

Returns the current mousepointer coordinates and button state in
.Em x, y, buttons. The return value reflects if the mousepointer 
is currently shown on screen or not.


.Ft void 
.Fn VGLMouseSetImage "VGLBitmap *AndMask" "VGLBitmap *OrMask"

With this function it is possible to change the image of the mousepointer
on screen.


.Ft void 
.Fn VGLMouseSetStdImage "void"

This function restores the mousepointer to the standard arrow.


.Ft void 
.Fn VGLLine "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"

Draw a line from
.Em x1, y1
to
.Em x2, y2
in color
.Em color


.Ft void 
.Fn VGLBox "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"

Draw a box with upper left hand corner at
.Em x1, y1
and lower right hand corner at
.Em x2, y2
in color
.Em color


.Ft void 
.Fn VGLFilledBox "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"

Draw a filled (solid) box with upper left hand corner at
.Em x1, y1
and lower right hand corner at
.Em x2, y2
in color
.Em color


.Ft void 
.Fn VGLEllipse "VGLBitmap *object" "int xc" "int yc" "int a" "int b" "byte color"

Draw an ellipse centered at 
.Em xc, yc
make it 
.Em a
pixels wide, and 
.Em b
pixels high in color
.Em color


.Ft void 
.Fn VGLFilledEllipse "VGLBitmap *object" "int xc" "int yc" "int a" "int b" "byte color"

Draw a filled (solid) ellipse centered at 
.Em xc, yc
make it 
.Em a
pixels wide, and 
.Em b
pixels high in color
.Em color


.Ft int 
.Fn VGLBitmapCopy "VGLBitmap *src" "int srcx" "int srcy" "VGLBitmap *dst" "int dstx" "int dsty" "int width" "int hight"

Copy a rectangle of pixels from bitmap
.Em src
upper lefthand corner at 
.Em srcx, srcy
to bitmap
.Em dst
at 
.Em dstx, dsty
of the size
.Em width, hight


.Ft void 
.Fn VGLBitmapPutChar "VGLBitmap *Object" "int x" "int y" "byte ch" "byte fgcol" "byte bgcol" "int fill" "int dir"

Write the character
.Em ch
at position
.Em x, y
in foregroundcolor 
.Em fgcol.
If 
.Em fill
is != 0, use the color
.Em bgcol
as background otherwise the background is transparent.
The character is drawn in the direction specified by the argument
.Em dir
{'fraction_non_alphanumeric': 0.07253018418965365, 'fraction_numerical': 0.010046708381069887, 'mean_word_length': 3.7481171548117156, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1305680', 'n_tokens_mistral': 3751, 'n_tokens_neox': 3476, 'n_words': 1799}