libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
Functions
cursor.h File Reference
#include "core.h"
Include dependency graph for cursor.h:

Go to the source code of this file.

Functions

cursor_t * cursor_read_from_file (const char *filename_png)
 
void cursor_free (cursor_t *cursor)
 
void cursor_make_current (cursor_t *cursor)
 

Detailed Description

Generic implementation to let you directly set the OS-provided mouse cursor. For Mac & Linux, you need a PNG of your cursor. The cursor image is assumed to be symmetrical with its hotspot in the center of the image. For Windows, the provided filename's '.png' extension is automatically replcated with '.cur' and you must provide a cursor in Windows .cur cursor format. Simply place both the PNG and CUR versions of the cursor side-by-side and the library will select the correct one depending on the host platform.

Definition in file cursor.h.

Function Documentation

◆ cursor_free()

void cursor_free ( cursor_t *  cursor)

Frees a cursor previously created using cursor_read_from_file().

Definition at line 76 of file cursor-lin.c.

◆ cursor_make_current()

void cursor_make_current ( cursor_t *  cursor)

Sets the cursor to be the current cursor. Be sure to ask X-Plane not to draw its own cursor. This function should be called in the window mouse cursor handler callback.

Definition at line 94 of file cursor-lin.c.

◆ cursor_read_from_file()

cursor_t * cursor_read_from_file ( const char *  filename_png)

Loads a cursor from a PNG file. The cursor hotspot is assumed to be directly in the center of the image. On Windows, the PNG extension is automatically replaced by '.cur', so you need to provide both a PNG and CUR version of your cursor.

You must free the returned cursor object using cursor_free().

Definition at line 39 of file cursor-lin.c.