1with agar.core.types;
2with agar.gui.surface;
3with agar.gui.types;
4
5package agar.gui.widget.icon is
6
7  use type c.unsigned;
8
9  subtype flags_t is agar.gui.types.widget_icon_flags_t;
10  ICON_REGEN_LABEL : constant flags_t := 16#01#;
11  ICON_DND         : constant flags_t := 16#02#;
12  ICON_DBLCLICKED  : constant flags_t := 16#04#;
13  ICON_BGFILL      : constant flags_t := 16#08#;
14
15  subtype icon_t is agar.gui.types.widget_icon_t;
16  subtype icon_access_t is agar.gui.types.widget_icon_access_t;
17
18  -- API
19
20  function allocate
21    (parent : widget_access_t;
22     flags  : flags_t) return icon_access_t;
23  pragma import (c, allocate, "AG_IconNew");
24
25  function allocate_from_surface
26    (surface : agar.gui.surface.surface_access_t) return icon_access_t;
27  pragma import (c, allocate_from_surface, "AG_IconFromSurface");
28
29  function allocate_from_bitmap
30    (filename : string) return icon_access_t;
31  pragma inline (allocate_from_bitmap);
32
33--  procedure set_padding
34--    (icon   : icon_access_t;
35--     left   : natural;
36--     right  : natural;
37--     top    : natural;
38--     bottom : natural);
39--  pragma inline (set_padding);
40
41  procedure set_surface
42    (icon    : icon_access_t;
43     surface : agar.gui.surface.surface_access_t);
44  pragma import (c, set_surface, "AG_IconSetSurface");
45
46  procedure set_surface_no_copy
47    (icon    : icon_access_t;
48     surface : agar.gui.surface.surface_access_t);
49  pragma import (c, set_surface_no_copy, "AG_IconSetSurfaceNODUP");
50
51  procedure set_text
52    (icon : icon_access_t;
53     text : string);
54  pragma inline (set_text);
55
56  procedure set_background_fill
57    (icon  : icon_access_t;
58     fill  : boolean;
59     color : agar.core.types.uint32_t);
60  pragma inline (set_background_fill);
61
62  function widget (icon : icon_access_t) return widget_access_t renames
63    agar.gui.types.widget_icon_widget;
64
65end agar.gui.widget.icon;
66