Commit 8a4487f2 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

fix generated string out and string array parameters add g_listenv

2007-08-24  Juerg Billeter  <j@bitron.ch>

	* vapigen/valagidlparser.vala, vapi/gdk-2.0.vala,
	  vapi/gio-standalone.vala,
	  vapi/gnome-desktop-2.0.vala, vapi/gstreamer-0.10.vala,
	  vapi/gtk+-2.0.vala, vapi/libsoup-2.2.vala,
	  vapi/packages/gdk-2.0/gdk-2.0.metadata,
	  vapi/packages/gio-standalone/gio-standalone.metadata,
	  vapi/packages/gnome-desktop-2.0/gnome-desktop-2.0.metadata,
	  vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata,
	  vapi/packages/gtk+-2.0/gtk+-2.0.metadata,
	  vapi/packages/vte/vte.metadata, vapi/pango.vala, vapi/vte.vala:
	  fix generated string out and string array parameters
	* vapi/glib-2.0.vala: add g_listenv

svn path=/trunk/; revision=502
parent 867086f4
2007-08-24 Jürg Billeter <j@bitron.ch>
* vapigen/valagidlparser.vala, vapi/gdk-2.0.vala,
vapi/gio-standalone.vala,
vapi/gnome-desktop-2.0.vala, vapi/gstreamer-0.10.vala,
vapi/gtk+-2.0.vala, vapi/libsoup-2.2.vala,
vapi/packages/gdk-2.0/gdk-2.0.metadata,
vapi/packages/gio-standalone/gio-standalone.metadata,
vapi/packages/gnome-desktop-2.0/gnome-desktop-2.0.metadata,
vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata,
vapi/packages/gtk+-2.0/gtk+-2.0.metadata,
vapi/packages/vte/vte.metadata, vapi/pango.vala, vapi/vte.vala:
fix generated string out and string array parameters
* vapi/glib-2.0.vala: add g_listenv
2007-08-24 Jürg Billeter <j@bitron.ch>
* vapigen/valagidlparser.vala, vapi/Makefile.am,
......
......@@ -858,7 +858,8 @@ namespace Gdk {
public Pixbuf.from_file_at_size (string filename, int width, int height, GLib.Error error);
[NoArrayLength]
public Pixbuf.from_inline (int data_length, uchar[] data, bool copy_pixels, GLib.Error error);
public Pixbuf.from_xpm_data (string data);
[NoArrayLength]
public Pixbuf.from_xpm_data (string[] data);
public Pixbuf.subpixbuf (int src_x, int src_y, int width, int height);
public void render_pixmap_and_mask (Gdk.Pixmap pixmap_return, Gdk.Bitmap mask_return, int alpha_threshold);
public void render_pixmap_and_mask_for_colormap (Gdk.Colormap colormap, Gdk.Pixmap pixmap_return, Gdk.Bitmap mask_return, int alpha_threshold);
......@@ -867,10 +868,12 @@ namespace Gdk {
public void saturate_and_pixelate (Gdk.Pixbuf dest, float saturation, bool pixelate);
public bool save (string filename, string type, GLib.Error error);
public bool save_to_buffer (string buffer, ulong buffer_size, string type, GLib.Error error);
public bool save_to_bufferv (string buffer, ulong buffer_size, string type, string option_keys, string option_values, GLib.Error error);
[NoArrayLength]
public bool save_to_bufferv (string buffer, ulong buffer_size, string type, string[] option_keys, string[] option_values, GLib.Error error);
public bool save_to_callback (Gdk.PixbufSaveFunc save_func, pointer user_data, string type, GLib.Error error);
public bool save_to_callbackv (Gdk.PixbufSaveFunc save_func, pointer user_data, string type, string option_keys, string option_values, GLib.Error error);
public bool savev (string filename, string type, string option_keys, string option_values, GLib.Error error);
[NoArrayLength]
public bool save_to_callbackv (Gdk.PixbufSaveFunc save_func, pointer user_data, string type, string[] option_keys, string[] option_values, GLib.Error error);
public bool savev (string filename, string type, out string option_keys, out string option_values, GLib.Error error);
public void scale (Gdk.Pixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, Gdk.InterpType interp_type);
public weak Gdk.Pixbuf scale_simple (int dest_width, int dest_height, Gdk.InterpType interp_type);
[NoAccessorMethod]
......
......@@ -396,7 +396,8 @@ namespace GLib {
public weak string get_names ();
public static GLib.Type get_type ();
public ThemedIcon (string iconname);
public ThemedIcon.from_names (string iconnames);
[NoArrayLength]
public ThemedIcon.from_names (string[] iconnames);
}
[CCode (cheader_filename = "gio/gvfs.h")]
public class UnionDrive : GLib.Object, GLib.Drive {
......@@ -468,8 +469,10 @@ namespace GLib {
public abstract weak string get_icon ();
public abstract weak string get_name ();
public static GLib.Type get_type ();
public abstract bool launch (GLib.List filenames, string envp, GLib.Error error);
public abstract bool launch_uris (GLib.List uris, string envp, GLib.Error error);
[NoArrayLength]
public abstract bool launch (GLib.List filenames, string[] envp, GLib.Error error);
[NoArrayLength]
public abstract bool launch_uris (GLib.List uris, string[] envp, GLib.Error error);
public abstract bool set_as_default_for_type (string content_type, GLib.Error error);
public abstract bool should_show (string desktop_env);
public abstract bool supports_uris ();
......@@ -557,9 +560,9 @@ namespace GLib {
[CCode (cheader_filename = "gio/gvfs.h")]
public interface LoadableIcon {
public static GLib.Type get_type ();
public abstract weak GLib.InputStream load (int size, string type, GLib.Cancellable cancellable, GLib.Error error);
public abstract weak GLib.InputStream load (int size, out string type, GLib.Cancellable cancellable, GLib.Error error);
public abstract void load_async (int size, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public abstract weak GLib.InputStream load_finish (GLib.AsyncResult res, string type, GLib.Error error);
public abstract weak GLib.InputStream load_finish (GLib.AsyncResult res, out string type, GLib.Error error);
}
[CCode (cheader_filename = "gio/gvfs.h")]
public interface Seekable {
......
......@@ -1334,6 +1334,9 @@ namespace GLib {
public static weak string get_variable (string! variable);
[CCode (cname = "g_setenv")]
public static bool set_variable (string! variable, string! value, bool overwrite);
[CCode (cname = "g_listenv")]
[NoArrayLength]
public static string[] list_variables ();
[CCode (cname = "g_get_user_name")]
public static weak string get_user_name ();
[CCode (cname = "g_get_user_data_dir")]
......
......@@ -62,7 +62,8 @@ namespace Gnome {
public void clear_section (string section);
public weak Gnome.DesktopItem copy ();
public int drop_uri_list (string uri_list, Gnome.DesktopItemLaunchFlags flags, GLib.Error error);
public int drop_uri_list_with_env (string uri_list, Gnome.DesktopItemLaunchFlags flags, string envp, GLib.Error error);
[NoArrayLength]
public int drop_uri_list_with_env (string uri_list, Gnome.DesktopItemLaunchFlags flags, string[] envp, GLib.Error error);
public static GLib.Quark error_quark ();
public bool exists ();
public static weak string find_icon (Gtk.IconTheme icon_theme, string icon, int desired_size, int flags);
......@@ -80,7 +81,8 @@ namespace Gnome {
public static GLib.Type get_type ();
public int launch (GLib.List file_list, Gnome.DesktopItemLaunchFlags flags, GLib.Error error);
public int launch_on_screen (GLib.List file_list, Gnome.DesktopItemLaunchFlags flags, Gdk.Screen screen, int workspace, GLib.Error error);
public int launch_with_env (GLib.List file_list, Gnome.DesktopItemLaunchFlags flags, string envp, GLib.Error error);
[NoArrayLength]
public int launch_with_env (GLib.List file_list, Gnome.DesktopItemLaunchFlags flags, string[] envp, GLib.Error error);
public DesktopItem ();
public DesktopItem.from_basename (string basename, Gnome.DesktopItemLoadFlags flags, GLib.Error error);
public DesktopItem.from_file (string file, Gnome.DesktopItemLoadFlags flags, GLib.Error error);
......@@ -95,6 +97,7 @@ namespace Gnome {
public void set_location (string location);
public void set_location_file (string file);
public void set_string (string attr, string value);
public void set_strings (string attr, string strings);
[NoArrayLength]
public void set_strings (string attr, string[] strings);
}
}
......@@ -1790,7 +1790,8 @@ namespace Gst {
public static weak Gst.Element parse_bin_from_description (string bin_description, bool ghost_unconnected_pads, GLib.Error err);
public static GLib.Quark parse_error_quark ();
public static weak Gst.Element parse_launch (string pipeline_description, GLib.Error error);
public static weak Gst.Element parse_launchv (string argv, GLib.Error error);
[NoArrayLength]
public static weak Gst.Element parse_launchv (string[] argv, GLib.Error error);
public static GLib.Quark resource_error_quark ();
public static GLib.Quark stream_error_quark ();
public static bool update_registry ();
......
......@@ -913,11 +913,14 @@ namespace Gtk {
public weak string get_website_label ();
public bool get_wrap_license ();
public AboutDialog ();
public void set_artists (string artists);
public void set_authors (string authors);
[NoArrayLength]
public void set_artists (string[] artists);
[NoArrayLength]
public void set_authors (string[] authors);
public void set_comments (string comments);
public void set_copyright (string copyright);
public void set_documenters (string documenters);
[NoArrayLength]
public void set_documenters (string[] documenters);
public static Gtk.AboutDialogActivateLinkFunc set_email_hook (Gtk.AboutDialogActivateLinkFunc func, pointer data, GLib.DestroyNotify destroy);
public void set_license (string license);
public void set_logo (Gdk.Pixbuf logo);
......@@ -2314,7 +2317,7 @@ namespace Gtk {
public class Image : Gtk.Misc {
public void clear ();
public weak Gdk.PixbufAnimation get_animation ();
public void get_icon_name (string icon_name, Gtk.IconSize size);
public void get_icon_name (out string icon_name, Gtk.IconSize size);
public void get_icon_set (Gtk.IconSet icon_set, Gtk.IconSize size);
public void get_image (Gdk.Image gdk_image, Gdk.Bitmap mask);
public weak Gdk.Pixbuf get_pixbuf ();
......@@ -3414,9 +3417,11 @@ namespace Gtk {
public weak Gtk.Adjustment get_adjustment ();
public static GLib.Type get_type ();
public double get_value ();
public ScaleButton (Gtk.IconSize size, double min, double max, double step, string icons);
[NoArrayLength]
public ScaleButton (Gtk.IconSize size, double min, double max, double step, string[] icons);
public void set_adjustment (Gtk.Adjustment adjustment);
public void set_icons (string icons);
[NoArrayLength]
public void set_icons (string[] icons);
public void set_value (double value);
public weak double value { get; set; }
[NoAccessorMethod]
......@@ -6094,11 +6099,15 @@ namespace Gtk {
[ReferenceType]
[CCode (cheader_filename = "gtk/gtk.h")]
public struct Init {
public static void abi_check (int argc, string argv, int num_checks, ulong sizeof_GtkWindow, ulong sizeof_GtkBox);
[NoArrayLength]
public static void abi_check (int argc, string[] argv, int num_checks, ulong sizeof_GtkWindow, ulong sizeof_GtkBox);
public static void add (Gtk.Function function, pointer data);
public static bool check (int argc, string argv);
public static bool check_abi_check (int argc, string argv, int num_checks, ulong sizeof_GtkWindow, ulong sizeof_GtkBox);
public static bool with_args (int argc, string argv, string parameter_string, out GLib.OptionEntry entries, string translation_domain, GLib.Error error);
[NoArrayLength]
public static bool check (int argc, string[] argv);
[NoArrayLength]
public static bool check_abi_check (int argc, string[] argv, int num_checks, ulong sizeof_GtkWindow, ulong sizeof_GtkBox);
[NoArrayLength]
public static bool with_args (int argc, string[] argv, string parameter_string, out GLib.OptionEntry entries, string translation_domain, GLib.Error error);
}
[ReferenceType]
[CCode (cheader_filename = "gtk/gtk.h")]
......@@ -6417,7 +6426,8 @@ namespace Gtk {
public static void paint_slider (Gtk.Style style, Gdk.Window window, Gtk.StateType state_type, Gtk.ShadowType shadow_type, out Gdk.Rectangle area, Gtk.Widget widget, string detail, int x, int y, int width, int height, Gtk.Orientation orientation);
public static void paint_tab (Gtk.Style style, Gdk.Window window, Gtk.StateType state_type, Gtk.ShadowType shadow_type, out Gdk.Rectangle area, Gtk.Widget widget, string detail, int x, int y, int width, int height);
public static void paint_vline (Gtk.Style style, Gdk.Window window, Gtk.StateType state_type, out Gdk.Rectangle area, Gtk.Widget widget, string detail, int y1_, int y2_, int x);
public static bool parse_args (int argc, string argv);
[NoArrayLength]
public static bool parse_args (int argc, string[] argv);
public static GLib.Type private_flags_get_type ();
public static void propagate_event (Gtk.Widget widget, Gdk.Event event);
public static void rgb_to_hsv (double r, double g, double b, double h, double s, double v);
......
......@@ -211,7 +211,7 @@ namespace Soup {
}
[CCode (cheader_filename = "libsoup/soup.h")]
public class Connection : GLib.Object {
public void authenticate (Soup.Message msg, string auth_type, string auth_realm, string username, string password);
public void authenticate (Soup.Message msg, string auth_type, string auth_realm, out string username, out string password);
public void connect_async (Soup.ConnectionCallback callback, pointer user_data);
public uint connect_sync ();
public void disconnect ();
......@@ -219,7 +219,7 @@ namespace Soup {
public bool is_in_use ();
public ulong last_used ();
public Connection (string propname1);
public void reauthenticate (Soup.Message msg, string auth_type, string auth_realm, string username, string password);
public void reauthenticate (Soup.Message msg, string auth_type, string auth_realm, out string username, out string password);
public void release ();
public void reserve ();
public virtual void send_request (Soup.Message req);
......@@ -579,16 +579,16 @@ namespace Soup {
[CCode (cheader_filename = "libsoup/soup.h")]
public struct Header {
public static weak string param_copy_token (GLib.HashTable tokens, string t);
public static weak string param_decode_token (string @in);
public static weak string param_decode_token (out string @in);
public static void param_destroy_hash (GLib.HashTable table);
public static weak GLib.HashTable param_parse_list (string header);
}
[ReferenceType]
[CCode (cheader_filename = "libsoup/soup.h")]
public struct Headers {
public static bool parse_request (string str, int len, GLib.HashTable dest, string req_method, string req_path, Soup.HttpVersion ver);
public static bool parse_response (string str, int len, GLib.HashTable dest, Soup.HttpVersion ver, uint status_code, string reason_phrase);
public static bool parse_status_line (string status_line, Soup.HttpVersion ver, uint status_code, string reason_phrase);
public static bool parse_request (string str, int len, GLib.HashTable dest, out string req_method, out string req_path, Soup.HttpVersion ver);
public static bool parse_response (string str, int len, GLib.HashTable dest, Soup.HttpVersion ver, uint status_code, out string reason_phrase);
public static bool parse_status_line (string status_line, Soup.HttpVersion ver, uint status_code, out string reason_phrase);
}
[ReferenceType]
[CCode (cheader_filename = "libsoup/soup.h")]
......
......@@ -2,6 +2,11 @@ Gdk cheader_filename="gdk/gdk.h"
GdkAtom is_value_type="1"
GdkColor is_value_type="1"
GdkCursor is_value_type="0"
gdk_pixbuf_new_from_xpm_data.data is_array="1"
gdk_pixbuf_save_to_bufferv.option_keys is_array="1"
gdk_pixbuf_save_to_bufferv.option_values is_array="1"
gdk_pixbuf_save_to_callbackv.option_keys is_array="1"
gdk_pixbuf_save_to_callbackv.option_values is_array="1"
GdkRectangle is_value_type="1"
GdkWindowAttr is_value_type="1"
GLib cprefix="G" lower_case_cprefix="g_" cheader_filename="gio/gvfs.h"
g_app_info_launch.envp is_array="1"
g_app_info_launch_uris.envp is_array="1"
GFile cheader_filename="gio/gfile.h"
GMountOperation::reply has_emitter="1"
g_themed_icon_new_from_names.iconnames is_array="1"
Gnome cheader_filename="libgnome/gnome-desktop-item.h"
gnome_desktop_item_drop_uri_list_with_env.envp is_array="1"
gnome_desktop_item_launch_with_env.envp is_array="1"
gnome_desktop_item_set_strings.strings is_array="1"
GnomeDItemEdit cheader_filename="libgnomeui/gnome-ditem-edit.h"
GnomeHint cheader_filename="libgnomeui/gnome-hint.h"
......@@ -8,5 +8,6 @@ gst_iterator_resync hidden="1"
GstPad.querytypefunc hidden="1"
gst_pad_set_query_type_function hidden="1"
GstPadTemplate::pad_created has_emitter="1"
gst_parse_launchv.argv is_array="1"
gst_type_register_static_full hidden="1"
Gtk cheader_filename="gtk/gtk.h"
gtk_about_dialog_set_artists.artists is_array="1"
gtk_about_dialog_set_authors.authors is_array="1"
gtk_about_dialog_set_documenters.documenters is_array="1"
GtkAction::activate has_emitter="1"
GtkActionEntry is_value_type="1"
GtkAdjustment::changed has_emitter="1"
......@@ -29,6 +32,10 @@ GtkIconView::item_activated has_emitter="1"
gtk_icon_view_select_all hidden="1" experimental="1"
gtk_icon_view_unselect_all hidden="1" experimental="1"
GtkIMContext::delete_surrounding has_emitter="1"
gtk_init_abi_check.argv is_array="1"
gtk_init_check.argv is_array="1"
gtk_init_check_abi_check.argv is_array="1"
gtk_init_with_args.argv is_array="1"
GtkItem::deselect has_emitter="1"
GtkItem::select has_emitter="1"
GtkItem::toggle has_emitter="1"
......@@ -41,6 +48,7 @@ GtkMenuItem::toggle_size_request has_emitter="1"
GtkMenuShell::cancel has_emitter="1"
GtkMenuShell::deactivate has_emitter="1"
gtk_object_destroy hidden="1" experimental="1"
gtk_parse_args.argv is_array="1"
GtkPlug::embedded hidden="1"
gtk_printer_accepts_pdf hidden="1" experimental="1"
gtk_printer_accepts_ps hidden="1" experimental="1"
......@@ -48,6 +56,8 @@ gtk_printer_is_virtual hidden="1" experimental="1"
gtk_quit_add_full hidden="1"
GtkRadioActionEntry is_value_type="1"
GtkRequisition is_value_type="1"
gtk_scale_button_new.icons is_array="1"
gtk_scale_button_set_icons.icons is_array="1"
gtk_show_about_dialog ellipsis="1"
GtkStyle.fg weak="0" is_array="1"
GtkStyle.bg weak="0" is_array="1"
......
Vte cheader_filename="vte/vte.h"
VteReaper cheader_filename="vte/reaper.h"
VteTerminalAccessible cheader_filename="vte/vteaccess.h"
vte_terminal_fork_command.argv is_array="1"
vte_terminal_fork_command.envv is_array="1"
vte_terminal_forkpty.envv is_array="1"
......@@ -732,7 +732,7 @@ namespace Pango {
[ReferenceType]
[CCode (cheader_filename = "pango/pango.h")]
public struct ScriptIter {
public void get_range (string start, string end, Pango.Script script);
public void get_range (out string start, out string end, Pango.Script script);
public ScriptIter (string text, int length);
public bool next ();
}
......@@ -826,8 +826,8 @@ namespace Pango {
public static double gravity_to_rotation (Pango.Gravity gravity);
public static bool is_zero_width (unichar ch);
public static weak GLib.List itemize_with_base_dir (Pango.Context context, Pango.Direction base_dir, string text, int start_index, int length, Pango.AttrList attrs, Pango.AttrIterator cached_iter);
public static bool parse_enum (GLib.Type type, string str, int value, bool warn, string possible_values);
public static bool parse_markup (string markup_text, int length, unichar accel_marker, Pango.AttrList attr_list, string text, unichar accel_char, GLib.Error error);
public static bool parse_enum (GLib.Type type, string str, int value, bool warn, out string possible_values);
public static bool parse_markup (string markup_text, int length, unichar accel_marker, Pango.AttrList attr_list, out string text, unichar accel_char, GLib.Error error);
public static bool parse_stretch (string str, Pango.Stretch stretch, bool warn);
public static bool parse_style (string str, Pango.Style style, bool warn);
public static bool parse_variant (string str, Pango.Variant variant, bool warn);
......@@ -835,12 +835,12 @@ namespace Pango {
public static void quantize_line_geometry (int thickness, int position);
public static int read_line (GLib.FileStream stream, GLib.String str);
public static weak GLib.List reorder_items (GLib.List logical_items);
public static bool scan_int (string pos, int @out);
public static bool scan_string (string pos, GLib.String @out);
public static bool scan_word (string pos, GLib.String @out);
public static bool scan_int (out string pos, int @out);
public static bool scan_string (out string pos, GLib.String @out);
public static bool scan_word (out string pos, GLib.String @out);
public static Pango.Script script_for_unichar (unichar ch);
public static weak Pango.Language script_get_sample_language (Pango.Script script);
public static bool skip_space (string pos);
public static bool skip_space (out string pos);
public static weak string split_file_list (string str);
public static weak string trim_string (string str);
public static Pango.Direction unichar_direction (unichar ch);
......
......@@ -36,8 +36,10 @@ namespace Vte {
public void feed (string data, long length);
public void feed_child (string text, long length);
public void feed_child_binary (string data, long length);
public int fork_command (string command, string argv, string envv, string directory, bool lastlog, bool utmp, bool wtmp);
public int forkpty (string envv, string directory, bool lastlog, bool utmp, bool wtmp);
[NoArrayLength]
public int fork_command (string command, string[] argv, string[] envv, string directory, bool lastlog, bool utmp, bool wtmp);
[NoArrayLength]
public int forkpty (string[] envv, string directory, bool lastlog, bool utmp, bool wtmp);
public weak Gtk.Adjustment get_adjustment ();
public bool get_allow_bold ();
public bool get_audible_bell ();
......
......@@ -657,6 +657,9 @@ public class Vala.GIdlParser : CodeVisitor {
if (type_node.is_pointer &&
(n == "gchar" || n == "char")) {
type.type_name = "string";
if (type_node.unparsed.has_suffix ("**")) {
type.is_out = true;
}
} else if (n == "gunichar") {
type.type_name = "unichar";
} else if (n == "gchar") {
......@@ -895,6 +898,17 @@ public class Vala.GIdlParser : CodeVisitor {
var p = new FormalParameter (param_node.name, parse_param (param));
m.add_parameter (p);
var attributes = get_attributes ("%s.%s".printf (f.symbol, param_node.name));
if (attributes != null) {
foreach (string attr in attributes) {
var nv = attr.split ("=", 2);
if (nv[0] == "is_array") {
p.type_reference.array_rank = 1;
p.type_reference.is_out = false;
}
}
}
if (last_param != null && p.name == "n_" + last_param.name) {
// last_param is array, p is array length
last_param.type_reference.array_rank = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment