libgvc: Add missing PrintfFormat annotations
[vala-gnome.git] / vapi / libgvc.vapi
blob75ca714419f413605111f6e10375acb8f754107e
1 /*
2  * libgvc.vapi
3  *
4  * Copyright (C) 2009  Martin Olsson
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
19  *
20  * Author:
21  *      Martin Olsson <martin@minimum.se>
22  */
24 [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "graphviz/gvc.h")]
25 namespace Gvc {
27         [CCode (cname = "aginitlib", cheader_filename="gvc.h")]
28         public void initlib ( size_t graphinfo, size_t nodeinfo, size_t  edgeinfo);
30         [CCode (cname = "aginit")]
31         public void init ();
33         [CCode (cprefix = "", has_type_id = false)]
34         public enum GraphKind {
35                 AGRAPH,
36                 AGRAPHSTRICT,
37                 AGDIGRAPH,
38                 AGDIGRAPHSTRICT,
39                 AGMETAGRAPH,
40         }
42         [CCode (cname = "agerrlevel_t", cheader_filename = "gvc.h", cprefix = "", has_type_id = false)]
43         public enum ErrorLevel {
44                 AGWARN,
45                 AGERR,
46                 AGMAX,
47                 AGPREV
48         }
50         [Compact]
51         [CCode (cname = "GVC_t", free_function = "gvFreeContext")]
52         public class Context {
53                 [CCode (cname = "gvContext")]
54                 public Context ();
56                 [CCode (cname = "gvParseArgs")]
57                 public int parse_args ( [CCode (array_length_pos = 0.9)] string[] argv );
59                 [CCode (cname = "gvLayout")]
60                 public int layout (Graph graph, [CCode (type = "char*")] string layout_engine);
62                 [CCode (cname = "gvFreeLayout")]
63                 public int free_layout (Graph graph);
65                 [CCode (cname = "gvRender")]
66                 public int render (Graph graph, [CCode (type = "char*")] string file_type, GLib.FileStream? file);
68                 [CCode (cname = "gvRenderFilename")]
69                 public int render_filename (Graph graph, [CCode (type = "char*")] string file_type, [CCode (type = "char*")] string filename);
71                 [CCode (cname = "gvLayoutJobs")]
72                 public int layout_jobs (Graph graph);
74                 [CCode (cname = "gvRenderJobs")]
75                 public int render_jobs (Graph graph);
77                 [CCode (cname = "gvRenderData")]
78                 public int render_data (Graph graph, [CCode (type = "char*")] string file_type, [CCode (type = "char**")] out uint8[] output_data);
79         }
81         [Compact]
82         [CCode (cname = "Agnode_t", ref_function = "", unref_function = "", free_function = "")]
83         public class Node {
84                 [CCode (cname = "name")]
85                 public string name;
87                 [CCode (cname = "agget")]
88                 public unowned string? get ([CCode (type = "char*")] string attribute_name);
90                 [CCode (cname = "agset")]
91                 public void set ([CCode (type = "char*")] string attribute_name, [CCode (type = "char*")] string attribute_value);
93                 [CCode (cname = "agsafeset")]
94                 public void safe_set ([CCode (type = "char*")] string attribute_name, [CCode (type = "char*")] string attribute_value, [CCode (type = "char*")] string? default_value);
95         }
97         [Compact]
98         [CCode (cname = "Agedge_t", ref_function = "", unref_function = "", free_function = "")]
99         public class Edge {
100                 [CCode (cname = "agget")]
101                 public unowned string? get ([CCode (type = "char*")] string attribute_name);
103                 [CCode (cname = "agset")]
104                 public int set ([CCode (type = "char*")] string attribute_name, [CCode (type = "char*")] string attribute_value);
106                 [CCode (cname = "agsafeset")]
107                 public int safe_set ([CCode (type = "char*")] string attribute_name, [CCode (type = "char*")] string attribute_value, [CCode (type = "char*")] string? default_value);
108         }
110         [Compact]
111         [CCode (cname = "Agraph_t", free_function = "agclose")]
112         public class Graph {
113                 [CCode (cname = "agopen")]
114                 public Graph ([CCode (type = "char*")] string graph_name, GraphKind kind);
116                 [CCode (cname = "agread")]
117                 public static Graph read (GLib.FileStream file);
119                 [CCode (cname = "agmemread")]
120                 public static Graph read_string (string str);
122                 [CCode (cname = "agnode")]
123                 public Node create_node ([CCode (type = "char*")] string node_name);
125                 [CCode (cname = "agedge")]
126                 public Edge create_edge (Node from, Node to);
128                 [CCode (cname = "agsubg")]
129                 public unowned Graph create_subgraph ([CCode (type = "char*")] string? name);
131                 [CCode (cname = "agfindsubg")]
132                 public Graph find_subgraph ([CCode (type = "char*")] string name);
134                 [CCode (cname = "agidsubg")]
135                 public Graph create_subgraph_id (ulong id);
137                 [CCode (cname = "agfstsubg")]
138                 public Graph get_first_subgraph ();
140                 [CCode (cname = "agnxtsubg")]
141                 public Graph get_next_subgraph ();
143                 [CCode (cname = "agparent")]
144                 public Graph get_parent_graph ();
146                 [CCode (cname = "agdelsubg")]
147                 public int delete_subgraph (Graph subgraph);
149                 [CCode (cname = "agfindnode")]
150                 public Node? find_node ([CCode (type = "char*")] string node_name);
152                 [CCode (cname = "agfstnode")]
153                 public Node? get_first_node ();
155                 [CCode (cname = "agnxtnode")]
156                 public Node? get_next_node (Node node);
158                 [CCode (cname = "agget")]
159                 public unowned string? get ([CCode (type = "char*")] string attribute_name);
161                 [CCode (cname = "agset")]
162                 public int set ([CCode (type = "char*")] string attribute_name, [CCode (type = "char*")] string attribute_value);
164                 [CCode (cname = "agsafeset")]
165                 public int safe_set ([CCode (type = "char*")] string attribute_name, [CCode (type = "char*")] string attribute_value, [CCode (type = "char*")] string? default_value);
167                 [CCode (cname = "AG_IS_DIRECTED")]
168                 public bool is_directed ();
170                 [CCode (cname = "AG_IS_STRICT")]
171                 public bool is_strict ();
173         }
175         [CCode (cname = "char", copy_function = "agdupstr_html", free_function = "agstrfree")]
176         public class HtmlString : string {
177                 [CCode (cname = "agstrdup_html")]
178                 public HtmlString (string markup);
179         }
181         [CCode(cprefix = "ag")]
182         namespace Error {
183                 [CCode (cname = "agerrno")]
184                 public static ErrorLevel errno;
186                 [CCode (cname = "agerr")]
187                 [PrintfFormat]
188                 public static int error (ErrorLevel level, string fmt, ...);
190                 [CCode (cname = "agerrors")]
191                 public static int errors ();
193                 [CCode (cname = "agseterr")]
194                 public static void set_error (ErrorLevel err);
196                 [CCode (cname = "aglasterr")]
197                 public static string? last_error ();
199                 [CCode (cname = "agerrorf")]
200                 [PrintfFormat]
201                 public static void errorf (string format, ...);
203                 [CCode (cname = "agwarningf")]
204                 [PrintfFormat]
205                 void warningf (string fmt, ...);
206         }