File: shared.h

package info (click to toggle)
libhyprcursor 0.1.13-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 284 kB
  • sloc: cpp: 1,546; ansic: 130; makefile: 16
file content (67 lines) | stat: -rw-r--r-- 1,532 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <cairo/cairo.h>

#ifndef HYPRCURSOR_SHARED_H
#define HYPRCURSOR_SHARED_H

/*!
    struct for a single cursor image
*/
struct SCursorImageData {
    cairo_surface_t* surface;
    int              size;
    int              delay;
    int              hotspotX;
    int              hotspotY;
};

typedef struct SCursorImageData hyprcursor_cursor_image_data;

enum eHyprcursorLogLevel {
    HC_LOG_NONE = 0,
    HC_LOG_TRACE,
    HC_LOG_INFO,
    HC_LOG_WARN,
    HC_LOG_ERR,
    HC_LOG_CRITICAL,
};

enum eHyprcursorDataType {
    HC_DATA_PNG = 0,
    HC_DATA_SVG,
};

enum eHyprcursorResizeAlgo {
    HC_RESIZE_INVALID = 0,
    HC_RESIZE_NONE,
    HC_RESIZE_BILINEAR,
    HC_RESIZE_NEAREST,
};

struct SCursorRawShapeImageC {
    void*             data;
    unsigned long int len;
    int               size;
    int               delay;
};

typedef struct SCursorRawShapeImageC hyprcursor_cursor_raw_shape_image;

struct SCursorRawShapeDataC {
    struct SCursorRawShapeImageC* images;
    unsigned long int             len;
    float                         hotspotX;
    float                         hotspotY;
    char*                         overridenBy;
    enum eHyprcursorResizeAlgo    resizeAlgo;
    enum eHyprcursorDataType      type;
    float                         nominalSize;
};

typedef struct SCursorRawShapeDataC hyprcursor_cursor_raw_shape_data;

/*
    msg is owned by the caller and will be freed afterwards.
*/
typedef void (*PHYPRCURSORLOGFUNC)(enum eHyprcursorLogLevel level, char* msg);

#endif