"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.05.0-linux-x86_64/include/freebasic/X11/Xcursor/Xcursor.bi" (31 Jan 2016, 11167 Bytes) of package /linux/privat/FreeBASIC-1.05.0-linux-x86_64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' FreeBASIC binding for libXcursor-1.1.14
    2 ''
    3 '' based on the C header files:
    4 ''   Copyright © 2002 Keith Packard
    5 ''
    6 ''   Permission to use, copy, modify, distribute, and sell this software and its
    7 ''   documentation for any purpose is hereby granted without fee, provided that
    8 ''   the above copyright notice appear in all copies and that both that
    9 ''   copyright notice and this permission notice appear in supporting
   10 ''   documentation, and that the name of Keith Packard not be used in
   11 ''   advertising or publicity pertaining to distribution of the software without
   12 ''   specific, written prior permission.  Keith Packard makes no
   13 ''   representations about the suitability of this software for any purpose.  It
   14 ''   is provided "as is" without express or implied warranty.
   15 ''
   16 ''   KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   17 ''   INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
   18 ''   EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
   19 ''   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
   20 ''   DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
   21 ''   TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
   22 ''   PERFORMANCE OF THIS SOFTWARE.
   23 ''
   24 '' translated to FreeBASIC by:
   25 ''   Copyright © 2015 FreeBASIC development team
   26 
   27 #pragma once
   28 
   29 #include once "crt/long.bi"
   30 #include once "crt/stdio.bi"
   31 #include once "X11/Xfuncproto.bi"
   32 #include once "X11/Xlib.bi"
   33 
   34 extern "C"
   35 
   36 #define _XCURSOR_H_
   37 type XcursorBool as long
   38 type XcursorUInt as ulong
   39 type XcursorDim as XcursorUInt
   40 type XcursorPixel as XcursorUInt
   41 
   42 const XcursorTrue = 1
   43 const XcursorFalse = 0
   44 const XCURSOR_MAGIC = &h72756358
   45 const XCURSOR_LIB_MAJOR = 1
   46 const XCURSOR_LIB_MINOR = 1
   47 const XCURSOR_LIB_REVISION = 14
   48 const XCURSOR_LIB_VERSION = ((XCURSOR_LIB_MAJOR * 10000) + (XCURSOR_LIB_MINOR * 100)) + XCURSOR_LIB_REVISION
   49 const XCURSOR_FILE_MAJOR = 1
   50 const XCURSOR_FILE_MINOR = 0
   51 const XCURSOR_FILE_VERSION = (XCURSOR_FILE_MAJOR shl 16) or XCURSOR_FILE_MINOR
   52 const XCURSOR_FILE_HEADER_LEN = 4 * 4
   53 const XCURSOR_FILE_TOC_LEN = 3 * 4
   54 
   55 type _XcursorFileToc
   56     as XcursorUInt type
   57     subtype as XcursorUInt
   58     position as XcursorUInt
   59 end type
   60 
   61 type XcursorFileToc as _XcursorFileToc
   62 
   63 type _XcursorFileHeader
   64     magic as XcursorUInt
   65     header as XcursorUInt
   66     version as XcursorUInt
   67     ntoc as XcursorUInt
   68     tocs as XcursorFileToc ptr
   69 end type
   70 
   71 type XcursorFileHeader as _XcursorFileHeader
   72 const XCURSOR_CHUNK_HEADER_LEN = 4 * 4
   73 
   74 type _XcursorChunkHeader
   75     header as XcursorUInt
   76     as XcursorUInt type
   77     subtype as XcursorUInt
   78     version as XcursorUInt
   79 end type
   80 
   81 type XcursorChunkHeader as _XcursorChunkHeader
   82 const XCURSOR_COMMENT_TYPE = &hfffe0001
   83 const XCURSOR_COMMENT_VERSION = 1
   84 const XCURSOR_COMMENT_HEADER_LEN = XCURSOR_CHUNK_HEADER_LEN + (1 * 4)
   85 const XCURSOR_COMMENT_COPYRIGHT = 1
   86 const XCURSOR_COMMENT_LICENSE = 2
   87 const XCURSOR_COMMENT_OTHER = 3
   88 const XCURSOR_COMMENT_MAX_LEN = &h100000
   89 
   90 type _XcursorComment
   91     version as XcursorUInt
   92     comment_type as XcursorUInt
   93     comment as zstring ptr
   94 end type
   95 
   96 type XcursorComment as _XcursorComment
   97 const XCURSOR_IMAGE_TYPE = &hfffd0002
   98 const XCURSOR_IMAGE_VERSION = 1
   99 const XCURSOR_IMAGE_HEADER_LEN = XCURSOR_CHUNK_HEADER_LEN + (5 * 4)
  100 const XCURSOR_IMAGE_MAX_SIZE = &h7fff
  101 
  102 type _XcursorImage
  103     version as XcursorUInt
  104     size as XcursorDim
  105     width as XcursorDim
  106     height as XcursorDim
  107     xhot as XcursorDim
  108     yhot as XcursorDim
  109     delay as XcursorUInt
  110     pixels as XcursorPixel ptr
  111 end type
  112 
  113 type XcursorImage as _XcursorImage
  114 
  115 type _XcursorImages
  116     nimage as long
  117     images as XcursorImage ptr ptr
  118     name as zstring ptr
  119 end type
  120 
  121 type XcursorImages as _XcursorImages
  122 
  123 type _XcursorCursors
  124     dpy as Display ptr
  125     ref as long
  126     ncursor as long
  127     cursors as Cursor ptr
  128 end type
  129 
  130 type XcursorCursors as _XcursorCursors
  131 
  132 type _XcursorAnimate
  133     cursors as XcursorCursors ptr
  134     sequence as long
  135 end type
  136 
  137 type XcursorAnimate as _XcursorAnimate
  138 type XcursorFile as _XcursorFile
  139 
  140 type _XcursorFile
  141     closure as any ptr
  142     read as function(byval file as XcursorFile ptr, byval buf as ubyte ptr, byval len as long) as long
  143     write as function(byval file as XcursorFile ptr, byval buf as ubyte ptr, byval len as long) as long
  144     seek as function(byval file as XcursorFile ptr, byval offset as clong, byval whence as long) as long
  145 end type
  146 
  147 type _XcursorComments
  148     ncomment as long
  149     comments as XcursorComment ptr ptr
  150 end type
  151 
  152 type XcursorComments as _XcursorComments
  153 #define XCURSOR_CORE_THEME "core"
  154 declare function XcursorImageCreate(byval width as long, byval height as long) as XcursorImage ptr
  155 declare sub XcursorImageDestroy(byval image as XcursorImage ptr)
  156 declare function XcursorImagesCreate(byval size as long) as XcursorImages ptr
  157 declare sub XcursorImagesDestroy(byval images as XcursorImages ptr)
  158 declare sub XcursorImagesSetName(byval images as XcursorImages ptr, byval name as const zstring ptr)
  159 declare function XcursorCursorsCreate(byval dpy as Display ptr, byval size as long) as XcursorCursors ptr
  160 declare sub XcursorCursorsDestroy(byval cursors as XcursorCursors ptr)
  161 declare function XcursorAnimateCreate(byval cursors as XcursorCursors ptr) as XcursorAnimate ptr
  162 declare sub XcursorAnimateDestroy(byval animate as XcursorAnimate ptr)
  163 declare function XcursorAnimateNext(byval animate as XcursorAnimate ptr) as Cursor
  164 declare function XcursorCommentCreate(byval comment_type as XcursorUInt, byval length as long) as XcursorComment ptr
  165 declare sub XcursorCommentDestroy(byval comment as XcursorComment ptr)
  166 declare function XcursorCommentsCreate(byval size as long) as XcursorComments ptr
  167 declare sub XcursorCommentsDestroy(byval comments as XcursorComments ptr)
  168 declare function XcursorXcFileLoadImage(byval file as XcursorFile ptr, byval size as long) as XcursorImage ptr
  169 declare function XcursorXcFileLoadImages(byval file as XcursorFile ptr, byval size as long) as XcursorImages ptr
  170 declare function XcursorXcFileLoadAllImages(byval file as XcursorFile ptr) as XcursorImages ptr
  171 declare function XcursorXcFileLoad(byval file as XcursorFile ptr, byval commentsp as XcursorComments ptr ptr, byval imagesp as XcursorImages ptr ptr) as XcursorBool
  172 declare function XcursorXcFileSave(byval file as XcursorFile ptr, byval comments as const XcursorComments ptr, byval images as const XcursorImages ptr) as XcursorBool
  173 declare function XcursorFileLoadImage(byval file as FILE ptr, byval size as long) as XcursorImage ptr
  174 declare function XcursorFileLoadImages(byval file as FILE ptr, byval size as long) as XcursorImages ptr
  175 declare function XcursorFileLoadAllImages(byval file as FILE ptr) as XcursorImages ptr
  176 declare function XcursorFileLoad(byval file as FILE ptr, byval commentsp as XcursorComments ptr ptr, byval imagesp as XcursorImages ptr ptr) as XcursorBool
  177 declare function XcursorFileSaveImages(byval file as FILE ptr, byval images as const XcursorImages ptr) as XcursorBool
  178 declare function XcursorFileSave(byval file as FILE ptr, byval comments as const XcursorComments ptr, byval images as const XcursorImages ptr) as XcursorBool
  179 declare function XcursorFilenameLoadImage(byval filename as const zstring ptr, byval size as long) as XcursorImage ptr
  180 declare function XcursorFilenameLoadImages(byval filename as const zstring ptr, byval size as long) as XcursorImages ptr
  181 declare function XcursorFilenameLoadAllImages(byval filename as const zstring ptr) as XcursorImages ptr
  182 declare function XcursorFilenameLoad(byval file as const zstring ptr, byval commentsp as XcursorComments ptr ptr, byval imagesp as XcursorImages ptr ptr) as XcursorBool
  183 declare function XcursorFilenameSaveImages(byval filename as const zstring ptr, byval images as const XcursorImages ptr) as XcursorBool
  184 declare function XcursorFilenameSave(byval file as const zstring ptr, byval comments as const XcursorComments ptr, byval images as const XcursorImages ptr) as XcursorBool
  185 declare function XcursorLibraryLoadImage(byval library as const zstring ptr, byval theme as const zstring ptr, byval size as long) as XcursorImage ptr
  186 declare function XcursorLibraryLoadImages(byval library as const zstring ptr, byval theme as const zstring ptr, byval size as long) as XcursorImages ptr
  187 declare function XcursorLibraryPath() as const zstring ptr
  188 declare function XcursorLibraryShape(byval library as const zstring ptr) as long
  189 declare function XcursorImageLoadCursor(byval dpy as Display ptr, byval image as const XcursorImage ptr) as Cursor
  190 declare function XcursorImagesLoadCursors(byval dpy as Display ptr, byval images as const XcursorImages ptr) as XcursorCursors ptr
  191 declare function XcursorImagesLoadCursor(byval dpy as Display ptr, byval images as const XcursorImages ptr) as Cursor
  192 declare function XcursorFilenameLoadCursor(byval dpy as Display ptr, byval file as const zstring ptr) as Cursor
  193 declare function XcursorFilenameLoadCursors(byval dpy as Display ptr, byval file as const zstring ptr) as XcursorCursors ptr
  194 declare function XcursorLibraryLoadCursor(byval dpy as Display ptr, byval file as const zstring ptr) as Cursor
  195 declare function XcursorLibraryLoadCursors(byval dpy as Display ptr, byval file as const zstring ptr) as XcursorCursors ptr
  196 declare function XcursorShapeLoadImage(byval shape as ulong, byval theme as const zstring ptr, byval size as long) as XcursorImage ptr
  197 declare function XcursorShapeLoadImages(byval shape as ulong, byval theme as const zstring ptr, byval size as long) as XcursorImages ptr
  198 declare function XcursorShapeLoadCursor(byval dpy as Display ptr, byval shape as ulong) as Cursor
  199 declare function XcursorShapeLoadCursors(byval dpy as Display ptr, byval shape as ulong) as XcursorCursors ptr
  200 declare function XcursorTryShapeCursor(byval dpy as Display ptr, byval source_font as Font, byval mask_font as Font, byval source_char as ulong, byval mask_char as ulong, byval foreground as const XColor ptr, byval background as const XColor ptr) as Cursor
  201 declare sub XcursorNoticeCreateBitmap(byval dpy as Display ptr, byval pid as Pixmap, byval width as ulong, byval height as ulong)
  202 declare sub XcursorNoticePutBitmap(byval dpy as Display ptr, byval draw as Drawable, byval image as XImage ptr)
  203 declare function XcursorTryShapeBitmapCursor(byval dpy as Display ptr, byval source as Pixmap, byval mask as Pixmap, byval foreground as XColor ptr, byval background as XColor ptr, byval x as ulong, byval y as ulong) as Cursor
  204 const XCURSOR_BITMAP_HASH_SIZE = 16
  205 declare sub XcursorImageHash(byval image as XImage ptr, byval hash as ubyte ptr)
  206 declare function XcursorSupportsARGB(byval dpy as Display ptr) as XcursorBool
  207 declare function XcursorSupportsAnim(byval dpy as Display ptr) as XcursorBool
  208 declare function XcursorSetDefaultSize(byval dpy as Display ptr, byval size as long) as XcursorBool
  209 declare function XcursorGetDefaultSize(byval dpy as Display ptr) as long
  210 declare function XcursorSetTheme(byval dpy as Display ptr, byval theme as const zstring ptr) as XcursorBool
  211 declare function XcursorGetTheme(byval dpy as Display ptr) as zstring ptr
  212 declare function XcursorGetThemeCore(byval dpy as Display ptr) as XcursorBool
  213 declare function XcursorSetThemeCore(byval dpy as Display ptr, byval theme_core as XcursorBool) as XcursorBool
  214 
  215 end extern