1 /*
2                                     __
3                                    / _|
4   __ _ _   _ _ __ ___  _ __ __ _  | |_ ___  ___ ___
5  / _` | | | | '__/ _ \| '__/ _` | |  _/ _ \/ __/ __|
6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \
7  \__,_|\__,_|_|  \___/|_|  \__,_| |_| \___/|___/___/
8 
9 Copyright (C) 2002 Keith Packard.
10 Copyright (C) 2018-2019 Aurora Free Open Source Software.
11 
12 This file is part of the Aurora Free Open Source Software. This
13 organization promote free and open source software that you can
14 redistribute and/or modify under the terms of the GNU Lesser General
15 Public License Version 3 as published by the Free Software Foundation or
16 (at your option) any later version approved by the Aurora Free Open Source
17 Software Organization. The license is available in the package root path
18 as 'LICENSE' file. Please review the following information to ensure the
19 GNU Lesser General Public License version 3 requirements will be met:
20 https://www.gnu.org/licenses/lgpl.html .
21 
22 Alternatively, this file may be used under the terms of the GNU General
23 Public License version 3 or later as published by the Free Software
24 Foundation. Please review the following information to ensure the GNU
25 General Public License requirements will be met:
26 http://www.gnu.org/licenses/gpl-3.0.html.
27 
28 NOTE: All products, services or anything associated to trademarks and
29 service marks used or referenced on this file are the property of their
30 respective companies/owners or its subsidiaries. Other names and brands
31 may be claimed as the property of others.
32 
33 For more info about intellectual property visit: aurorafoss.org or
34 directly send an email to: contact (at) aurorafoss.org .
35 
36 This file is part of X11 Xcursor implementation from X.Org Foundation.
37 */
38 
39 module aurorafw.gui.platform.x11.xcursor.statfun;
40 
41 import aurorafw.gui.platform.x11.x;
42 import aurorafw.gui.platform.x11.xlib;
43 
44 public import aurorafw.gui.platform.x11.xcursor.types;
45 
46 extern(C) @nogc nothrow {
47 	/**
48 	* Manage Image objects
49 	*/
50 	XcursorImage* XcursorImageCreate(int width, int height);
51 	///
52 	void XcursorImageDestroy(XcursorImage* image);
53 
54 	/**
55 	* Manage Images objects
56 	*/
57 	XcursorImages* XcursorImagesCreate(int size);
58 	///
59 	void XcursorImagesDestroy(XcursorImages* images);
60 	///
61 	void XcursorImagesSetName(XcursorImages* images, const char* name);
62 
63 	/**
64 	* Manage Cursor objects
65 	*/
66 	XcursorCursors* XcursorCursorsCreate(Display* dpy, int size);
67 	///
68 	void XcursorCursorsDestroy(XcursorCursors* cursors);
69 
70 	/**
71 	* Manage Animate objects
72 	*/
73 	XcursorAnimate* XcursorAnimateCreate(XcursorCursors* cursors);
74 	///
75 	void XcursorAnimateDestroy(XcursorAnimate* animate);
76 	///
77 	Cursor XcursorAnimateNext(XcursorAnimate* animate);
78 
79 	//TODO: Change to C-like function style.
80 
81 	/**
82 	* Manage Comment objects
83 	*/
84 	XcursorComment* function(XcursorUInt comment_type, int length) XcursorCommentCreate;
85 	///
86 	void function(XcursorComment* comment) XcursorCommentDestroy;
87 	///
88 	XcursorComments* function(int size) XcursorCommentsCreate;
89 	///
90 	void function(XcursorComments* comments) XcursorCommentsDestroy;
91 
92 	/**
93 	* XcursorFile/Image APIs
94 	*/
95 	XcursorImage* function(XcursorFile* file, int size) XcursorXcFileLoadImage;
96 	///
97 	XcursorImages* function(XcursorFile* file, int size) XcursorXcFileLoadImages;
98 	///
99 	XcursorImages* function(XcursorFile* file) XcursorXcFileLoadAllImages;
100 	///
101 	XcursorBool function(XcursorFile* file, XcursorComments** commentsp, XcursorImages** imagesp) XcursorXcFileLoad;
102 	///
103 	XcursorBool function(XcursorFile* file, const XcursorComments* comments, const XcursorImages* images) XcursorXcFileSave;
104 
105 	/**
106 	* FILE/Image APIs
107 	*/
108 	XcursorImage* function(FILE* file, int size) XcursorFileLoadImage;
109 	///
110 	XcursorImages* function(FILE* file, int size) XcursorFileLoadImages;
111 	///
112 	XcursorImages* function(FILE* file) XcursorFileLoadAllImages;
113 	///
114 	XcursorBool function(FILE* file, XcursorComments** commentsp, XcursorImages** imagesp) XcursorFileLoad;
115 	///
116 	XcursorBool function(FILE* file, const XcursorImages* images) XcursorFileSaveImages;
117 	///
118 	XcursorBool function(FILE* file, const XcursorComments* comments, const XcursorImages* images) XcursorFileSave;
119 
120 	/**
121 	* Filename/Image APIs
122 	*/
123 	XcursorImage* function(const char* filename, int size) XcursorFilenameLoadImage;
124 	///
125 	XcursorImages* function(const char* filename, int size) XcursorFilenameLoadImages;
126 	///
127 	XcursorImages* function(const char* filename) XcursorFilenameLoadAllImages;
128 	///
129 	XcursorBool function(const char* file, XcursorComments** commentsp, XcursorImages** imagesp) XcursorFilenameLoad;
130 	///
131 	XcursorBool function(const char* filename, const XcursorImages* images) XcursorFilenameSaveImages;
132 	///
133 	XcursorBool function(const char* file, const XcursorComments* comments, const XcursorImages* images) XcursorFilenameSave;
134 
135 	/**
136 	* Library/Image APIs
137 	*/
138 	XcursorImage* function(const char* library, const char* theme, int size) XcursorLibraryLoadImage;
139 	///
140 	XcursorImages* function(const char* library, const char* theme, int size) XcursorLibraryLoadImages;
141 
142 	/**
143 	* Library/shape API
144 	*/
145 	const char* function() XcursorLibraryPath;
146 	///
147 	int function(const char* library) XcursorLibraryShape;
148 
149 	/**
150 	* Image/Cursor APIs
151 	*/
152 	Cursor function(Display* dpy, const XcursorImage* image) XcursorImageLoadCursor;
153 	///
154 	XcursorCursors* function(Display* dpy, const XcursorImages* images) XcursorImagesLoadCursors;
155 	///
156 	Cursor function(Display* dpy, const XcursorImages* images) XcursorImagesLoadCursor;
157 
158 	/**
159 	* Filename/Cursor APIs
160 	*/
161 	Cursor function(Display* dpy, const char* file) XcursorFilenameLoadCursor;
162 	///
163 	XcursorCursors* function(Display* dpy, const char* file) XcursorFilenameLoadCursors;
164 
165 	/**
166 	* Library/Cursor APIs
167 	*/
168 	Cursor function(Display* dpy, const char* file) XcursorLibraryLoadCursor;
169 	///
170 	XcursorCursors* function(Display* dpy, const char* file) XcursorLibraryLoadCursors;
171 
172 	/**
173 	* Shape/Image APIs
174 	*/
175 	XcursorImage* function(uint shape, const char* theme, int size) XcursorShapeLoadImage;
176 	///
177 	XcursorImages* function(uint shape, const char* theme, int size) XcursorShapeLoadImages;
178 
179 	/**
180 	* Shape/Cursor APIs
181 	*/
182 	Cursor function(Display* dpy, uint shape) XcursorShapeLoadCursor;
183 	///
184 	XcursorCursors* function(Display* dpy, uint shape) XcursorShapeLoadCursors;
185 
186 	/**
187 	* This is the function called by Xlib when attempting to
188 	* load cursors from XCreateGlyphCursor.  The interface must
189 	* not change as Xlib loads 'libXcursor.so' instead of
190 	* a specific major version
191 	*/
192 	Cursor function(Display* dpy, Font source_font, Font mask_font, uint source_char, uint mask_char, const XColor* foreground, const XColor* background) XcursorTryShapeCursor;
193 	///
194 	void function(Display* dpy,Pixmap pid, uint width, uint height) XcursorNoticeCreateBitmap;
195 	///
196 	void function(Display* dpy, Drawable draw, XImage* image) XcursorNoticePutBitmap;
197 	///
198 	Cursor function(Display* dpy, Pixmap source, Pixmap mask, XColor* foreground, XColor* background, uint x, uint y) XcursorTryShapeBitmapCursor;
199 	///
200 	void function(XImage* image, ubyte[XCURSOR_BITMAP_HASH_SIZE] hash) XcursorImageHash;
201 
202 	/**
203 	* Display information APIs
204 	*/
205 	XcursorBool function(Display* dpy) XcursorSupportsARGB;
206 	///
207 	XcursorBool function(Display* dpy) XcursorSupportsAnim;
208 	///
209 	XcursorBool function(Display* dpy, int size) XcursorSetDefaultSize;
210 	///
211 	int function(Display* dpy) XcursorGetDefaultSize;
212 	///
213 	XcursorBool function(Display* dpy, const char* theme) XcursorSetTheme;
214 	///
215 	char* function(Display* dpy) XcursorGetTheme;
216 	///
217 	XcursorBool function(Display* dpy) XcursorGetThemeCore;
218 	///
219 	XcursorBool function(Display* dpy, XcursorBool theme_core) XcursorSetThemeCore;
220 }