ui/ui/icons.h

Sat, 04 Jan 2025 16:39:35 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 04 Jan 2025 16:39:35 +0100
branch
newapi
changeset 432
ccbcf98047de
parent 337
2904fba2708b
permissions
-rw-r--r--

close newapi branch

285
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2024 Olaf Wintermann. All rights reserved.
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #ifndef UI_ICONS_H
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #define UI_ICONS_H
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include "toolkit.h"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #ifdef __cplusplus
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 extern "C" {
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #endif
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37
311
450a813dc2a5 implement GTK4 gmenu item and item list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 295
diff changeset
38 #ifdef UI_GTK
285
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39
295
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
40 #define UI_ICON_HOME "go-home"
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
41 #define UI_ICON_NEW_WINDOW "list-add"
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
42 #define UI_ICON_REFRESH "view-refresh"
285
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 #define UI_ICON_NEW_FOLDER "folder-new"
295
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
44 #define UI_ICON_ADD "document-new"
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
45 #define UI_ICON_UPLOAD "document-open"
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
46 #define UI_ICON_SAVE_LOCAL "document-save-as"
35d6e9b5d4b3 update gtk icons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
47 #define UI_ICON_DELETE "edit-delete"
285
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 #define UI_ICON_DOCK_LEFT ""
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 #define UI_ICON_DOCK_RIGHT ""
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 #define UI_ICON_GO_BACK "go-previous"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 #define UI_ICON_GO_FORWARD "go-next"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52
311
450a813dc2a5 implement GTK4 gmenu item and item list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 295
diff changeset
53 #endif /* UI_GTK */
285
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 #ifdef UI_WINUI
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 #define UI_ICON_HOME "Home"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 #define UI_ICON_NEW_WINDOW "NewWindow"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 #define UI_ICON_REFRESH "Refresh"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 #define UI_ICON_NEW_FOLDER "NewFolder"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 #define UI_ICON_ADD "Add"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 #define UI_ICON_UPLOAD "Upload"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 #define UI_ICON_SAVE_LOCAL "SaveLocal"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 #define UI_ICON_DELETE "Delete"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 #define UI_ICON_DOCK_LEFT "DockLeft"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 #define UI_ICON_DOCK_RIGHT "DockRight"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 #define UI_ICON_GO_BACK "Back"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 #define UI_ICON_GO_FORWARD "Forward"
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 #endif /* UI_WINUI */
337
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
73
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
74
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
75 UIEXPORT UiIcon* ui_icon(const char* name, size_t size);
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
76 UIEXPORT UiIcon* ui_icon_unscaled(const char *name, int size);
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
77 UIEXPORT UiIcon* ui_imageicon(const char* file);
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
78 UIEXPORT void ui_icon_free(UiIcon* icon);
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
79
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
80 UIEXPORT UiIcon* ui_foldericon(size_t size);
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 311
diff changeset
81 UIEXPORT UiIcon* ui_fileicon(size_t size);
285
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 #ifdef __cplusplus
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 }
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 #endif
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 #endif /* UI_ICONS_H */
034015dfd3de add icons.h for icon name macros
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89

mercurial