Line data Source code
1 : /* File: pos_nav_tree_node_type.inl; Copyright and License: see below */
2 :
3 : #include <assert.h>
4 :
5 15 : static inline GdkTexture * pos_nav_tree_node_type_get_icon( pos_nav_tree_node_type_t this_,
6 : bool highlight,
7 : const gui_resources_t *resources )
8 : {
9 15 : assert( resources != NULL );
10 : GdkTexture * result;
11 15 : switch( this_ )
12 : {
13 1 : case POS_NAV_TREE_NODE_TYPE_ANCESTOR:
14 : {
15 1 : result = gui_resources_get_navigate_breadcrumb_folder( resources );
16 : }
17 1 : break;
18 :
19 5 : case POS_NAV_TREE_NODE_TYPE_OPEN:
20 : {
21 5 : result = gui_resources_get_navigate_open_folder( resources );
22 : }
23 5 : break;
24 :
25 3 : case POS_NAV_TREE_NODE_TYPE_CLOSED:
26 : {
27 3 : result = gui_resources_get_navigate_closed_folder( resources );
28 : }
29 3 : break;
30 :
31 1 : case POS_NAV_TREE_NODE_TYPE_NEW_ROOT:
32 : {
33 : /* same icon as for POS_NAV_TREE_NODE_TYPE_NEW_SIBLING */
34 : result
35 : = highlight
36 0 : ? gui_resources_get_navigate_create_sibling( resources )
37 1 : : gui_resources_get_navigate_create_sibling_0( resources );
38 : }
39 1 : break;
40 :
41 2 : case POS_NAV_TREE_NODE_TYPE_NEW_SIBLING:
42 : {
43 : result
44 : = highlight
45 0 : ? gui_resources_get_navigate_create_sibling( resources )
46 2 : : gui_resources_get_navigate_create_sibling_0( resources );
47 : }
48 2 : break;
49 :
50 3 : case POS_NAV_TREE_NODE_TYPE_NEW_CHILD:
51 : {
52 : result
53 : = highlight
54 0 : ? gui_resources_get_navigate_create_child( resources )
55 3 : : gui_resources_get_navigate_create_child_0( resources );
56 : }
57 3 : break;
58 :
59 0 : default:
60 : {
61 : /* e.g. POS_NAV_TREE_NODE_TYPE_VOID */
62 0 : result = gui_resources_get_type_undef( resources );
63 : }
64 : }
65 15 : return result;
66 : }
67 :
68 :
69 : /*
70 : Copyright 2021-2025 Andreas Warnke
71 :
72 : Licensed under the Apache License, Version 2.0 (the "License");
73 : you may not use this file except in compliance with the License.
74 : You may obtain a copy of the License at
75 :
76 : http://www.apache.org/licenses/LICENSE-2.0
77 :
78 : Unless required by applicable law or agreed to in writing, software
79 : distributed under the License is distributed on an "AS IS" BASIS,
80 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81 : See the License for the specific language governing permissions and
82 : limitations under the License.
83 : */
|