/+junk/gjs-vapi

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs-vapi

« back to all changes in this revision

Viewing changes to gjs.vapi

  • Committer: Gustav Hartvigsson
  • Date: 2021-09-12 21:31:34 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210912213134-qp2kypgujoamcnf4
* Inital, untested code

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
 
3
 *
 
4
 * SPDX-FileContributor: Authored By: Gustav Hartvigsson
 
5
 */
 
6
 
 
7
[CCode (cheader_filename = "gjs/gjs.h", cprefix = "Gjs", lower_case_cprefix = "gjs_")]
 
8
namespace Gjs {
 
9
  
 
10
  
 
11
  [CCode (cheader_filename = "gjs/error-types.h", cname = "GjsError", prefix = "GJS_ERROR_", lower_case_cprefix = "gjs_error_")]
 
12
  public errordomain GjsError {
 
13
    FAILED,
 
14
    EXIT,
 
15
  }
 
16
  
 
17
  [CCode (cheader_filename = "gjs/error-types.h", cname = "GjsJSError", prefix = "GJS_JS_ERROR_", lower_case_cprefix = "gjs_js_error_")]
 
18
  public errordomain GjsJSError {
 
19
    ERROR,
 
20
    ERROR,
 
21
    EVAL_ERROR,
 
22
    INTERNAL_ERROR,
 
23
    RANGE_ERROR,
 
24
    REFERENCE_ERROR,
 
25
    STOP_ITERATION,
 
26
    SYNTAX_ERROR,
 
27
    TYPE_ERROR,
 
28
    URI_ERROR,
 
29
  }
 
30
  
 
31
  /*
 
32
   * Gjs.Context is an opaque datastructure with no outward visible
 
33
   * members.
 
34
   */
 
35
  [CCode (cheader_filename = "gjs/context.h", cname = "GjsContext", type_id = "GJS_TYPE_CONTEXT")]
 
36
  public class Context {
 
37
    
 
38
    [CCode (cname = "gjs_context_new")]
 
39
    public Context ();
 
40
    
 
41
    [CCode (cname = "gjs_context_new_with_search_path")]
 
42
    public bool Context.with_search_path (string[] search_path);
 
43
    
 
44
    [CCode (cname = "gjs_context_file")]
 
45
    public bool eval_file (const string filename,
 
46
                      out int exit_status_p)
 
47
                      throws GLib.Error;
 
48
    
 
49
    [CCode (cname = "gjs_context_eval_module_file")]
 
50
    public bool eval_module_file (const string filename,
 
51
                                  out uint8 exit_status_p)
 
52
                                  throws GLib.Error;
 
53
    
 
54
    
 
55
    [CCode (cname = "gjs_context_eval")]
 
56
    public bool eval (const string script,
 
57
                      const string filename,
 
58
                      out exit_status_p)
 
59
                      throws GLib.Error;
 
60
    
 
61
    [CCode (cname = "gjs_context_register_module")]
 
62
    public bool register_module (const string identifier,
 
63
                                 const string uri)
 
64
                                 throws GLib.Error;
 
65
    
 
66
    [CCode (cname = "gjs_context_eval_module")]
 
67
    public bool eval_module (const string identifier,
 
68
                             out uint8 exit_code)
 
69
                             throws GLib.Error;
 
70
    
 
71
    [CCode (cname = "gjs_context_define_string_array")]
 
72
    public bool define_string_array (const string array_name,
 
73
                                     [CCode array_length_pos = 1.1]
 
74
                                     const string[] array_values)
 
75
                                     throws GLib.Error;
 
76
    
 
77
    [CCode (cname = "gjs_context_set_argv")]
 
78
    public void set_argv ([CCode array_length_pos = 0.1]
 
79
                          string[] array_values);
 
80
    
 
81
    [CCode (cname = "gjs_context_get_all")]
 
82
    public GLib.List get_all ();
 
83
    
 
84
    [CCode (cname = "gjs_context_get_current")]
 
85
    public static Context get_current ();
 
86
    
 
87
    [CCode (cname = "gjs_context_make_current")]
 
88
    public void make_current ();
 
89
    
 
90
    [CCode (cname = "gjs_context_get_native_context")]
 
91
    public pointer get_native_context ();
 
92
    
 
93
    [CCode (cname = "gjs_context_print_stack_stderr")]
 
94
    public void print_stack_stderr ();
 
95
    
 
96
    [CCode (cname = "gjs_context_maybe_gc")]
 
97
    public void maybe_gc ();
 
98
    
 
99
    [CCode (cname = "gjs_context_gc")]
 
100
    public void gc ();
 
101
    
 
102
    [CCode (cname = "gjs_context_get_profiler")]
 
103
    public Profiler get_profiler ();
 
104
    
 
105
    [CCode (cname = "gjs_profiler_chain_sgnal")]
 
106
    public bool profiler_chain_signal (Posix.siginfo_t info)
 
107
    
 
108
    [CCode (cname = "gjs_context_setup_debugger_console")]
 
109
    public void setup_debugger_console ();
 
110
  }
 
111
  
 
112
  [CCode (cheader_filename = "gjs/context.h", cname = "gjs_dump_stack")]
 
113
  public void dump_stack ();
 
114
  
 
115
  [CCode (cheader_filename = "gjs/context.h", cname = "gjs_get_js_version")]
 
116
  public const string get_js_version ();
 
117
  
 
118
  /*
 
119
   * This class has no visible _new function, can only be created from
 
120
   * context.
 
121
   */
 
122
  [CCode (cheader_filename = "gjs/profiler.h", cname = "GjsProfiler", type_id = "GJS_TYPE_PROFILER")]
 
123
  public class Profiler {
 
124
    
 
125
    [CCode (cname = "gjs_profiler_set_capture_writer")]
 
126
    set_capture_writer (pointer capture);
 
127
    
 
128
    [CCode (cname = "gjs_profiler_set_filename")]
 
129
    set_filename (const string filename);
 
130
    
 
131
    [CCode (cname = "gjs_profiler_set_fd")]
 
132
    set_fd (int fd);
 
133
    
 
134
    [CCode (cname = "gjs_profiler_start")]
 
135
    start ();
 
136
    
 
137
    [CCode (cname = "gjs_profiler_stop")]
 
138
    stop ();
 
139
  }
 
140
  
 
141
  [CCode (cheader_filename = "gjs/mem.h", cname = "gjs_memory_report")]
 
142
  memory_report (const string where,
 
143
                 bool die_if_fail);
 
144
  
 
145
  [CCode (cheader_filename = "gjs/coverage.h", cname = "GjsProfiler", type_id = "GJS_TYPE_COVERAGE")]
 
146
  public class Coverage {
 
147
    
 
148
    [CCode (cname = "gjs_coverage_new")]
 
149
    public Coverage (const string coverage_prefixes
 
150
                     Context coverage_context,
 
151
                     GLib.File output_dir);
 
152
    
 
153
    [CCode (cname = "gjs_coverage_write_statistics")]
 
154
    public void write_statistics ();
 
155
    
 
156
    [CCode (cname = "gjs_coverage_enable")]
 
157
    public static enable ();
 
158
  }
 
159
}