Commit 38d90699 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

use abstract instead of virtual methods in generated interfaces

2007-07-30  Juerg Billeter  <j@bitron.ch>

	* vala/valasemanticanalyzer.vala, vapi/atk.vala,
	  vapi/gio-standalone.vala, vapi/gstreamer-0.10.vala,
	  vapi/gtk+-2.0.vala,
	  vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala,
	  vapi/packages/gtk+-2.0/gtk+-2.0-custom.vala,
	  vapigen/valagidlparser.vala: use abstract instead of virtual methods
	  in generated interfaces

svn path=/trunk/; revision=415
parent 361d2179
2007-07-30 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala, vapi/atk.vala,
vapi/gio-standalone.vala, vapi/gstreamer-0.10.vala,
vapi/gtk+-2.0.vala,
vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala,
vapi/packages/gtk+-2.0/gtk+-2.0-custom.vala,
vapigen/valagidlparser.vala: use abstract instead of virtual methods
in generated interfaces
2007-07-30 Jürg Billeter <j@bitron.ch> 2007-07-30 Jürg Billeter <j@bitron.ch>
* gobject/valacodegeneratormethod.vala: support array length parameters * gobject/valacodegeneratormethod.vala: support array length parameters
......
...@@ -178,44 +178,45 @@ public class Vala.SemanticAnalyzer : CodeVisitor { ...@@ -178,44 +178,45 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
Report.error (cl.source_reference, error_string); Report.error (cl.source_reference, error_string);
} }
/* all abstract symbols defined in base types have to be at least defined (or implemented) also in this type */ /* VAPI classes don't have to specify overridden methods */
foreach (TypeReference base_type in cl.get_base_types ()) { if (!cl.source_reference.file.pkg) {
if (base_type.data_type is Interface) { /* all abstract symbols defined in base types have to be at least defined (or implemented) also in this type */
Interface iface = (Interface) base_type.data_type; foreach (TypeReference base_type in cl.get_base_types ()) {
if (base_type.data_type is Interface) {
/* We do not need to do expensive equality checking here since this is done Interface iface = (Interface) base_type.data_type;
* already. We only need to guarantee the symbols are present.
*/ /* We do not need to do expensive equality checking here since this is done
* already. We only need to guarantee the symbols are present.
/* check methods */ */
foreach (Method m in iface.get_methods ()) {
if (m.is_abstract) { /* check methods */
var sym = cl.scope.lookup (m.name); foreach (Method m in iface.get_methods ()) {
if (sym == null || !(sym is Method) || ((Method) sym).base_interface_method != m) { if (m.is_abstract) {
cl.error = true; var sym = cl.scope.lookup (m.name);
Report.error (cl.source_reference, "`%s' does not implement interface method `%s'".printf (cl.get_full_name (), m.get_full_name ())); if (sym == null || !(sym is Method) || ((Method) sym).base_interface_method != m) {
cl.error = true;
Report.error (cl.source_reference, "`%s' does not implement interface method `%s'".printf (cl.get_full_name (), m.get_full_name ()));
}
} }
} }
} }
} }
}
/* all abstract symbols defined in base classes have to be implemented in non-abstract classes /* all abstract symbols defined in base classes have to be implemented in non-abstract classes */
* VAPI classes don't have to specify overridden methods if (!cl.is_abstract) {
*/ var base_class = cl.base_class;
if (!cl.is_abstract && !cl.source_reference.file.pkg) { while (base_class != null && base_class.is_abstract) {
var base_class = cl.base_class; foreach (Method m in base_class.get_methods ()) {
while (base_class != null && base_class.is_abstract) { if (m.is_abstract) {
foreach (Method m in base_class.get_methods ()) { var sym = cl.scope.lookup (m.name);
if (m.is_abstract) { if (sym == null || !(sym is Method) || ((Method) sym).base_method != m) {
var sym = cl.scope.lookup (m.name); cl.error = true;
if (sym == null || !(sym is Method) || ((Method) sym).base_method != m) { Report.error (cl.source_reference, "`%s' does not implement abstract method `%s'".printf (cl.get_full_name (), m.get_full_name ()));
cl.error = true; }
Report.error (cl.source_reference, "`%s' does not implement abstract method `%s'".printf (cl.get_full_name (), m.get_full_name ()));
} }
} }
base_class = base_class.base_class;
} }
base_class = base_class.base_class;
} }
} }
...@@ -386,7 +387,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { ...@@ -386,7 +387,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
if (sym is Method) { if (sym is Method) {
var base_method = (Method) sym; var base_method = (Method) sym;
if (base_method.is_abstract || base_method.is_virtual) { if (base_method.is_abstract || base_method.is_virtual) {
if (!m.equals (base_method)) { if (!cl.source_reference.file.pkg && !m.equals (base_method)) {
m.error = true; m.error = true;
Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.get_full_name (), base_method.get_full_name ())); Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.get_full_name (), base_method.get_full_name ()));
return; return;
...@@ -410,7 +411,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { ...@@ -410,7 +411,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
if (sym is Method) { if (sym is Method) {
var base_method = (Method) sym; var base_method = (Method) sym;
if (base_method.is_abstract) { if (base_method.is_abstract) {
if (!m.equals (base_method)) { if (!cl.source_reference.file.pkg && !m.equals (base_method)) {
m.error = true; m.error = true;
Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.get_full_name (), base_method.get_full_name ())); Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.get_full_name (), base_method.get_full_name ()));
return; return;
......
...@@ -399,40 +399,40 @@ namespace Atk { ...@@ -399,40 +399,40 @@ namespace Atk {
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Action { public interface Action {
public virtual bool do_action (int i); public abstract bool do_action (int i);
public virtual weak string get_description (int i); public abstract weak string get_description (int i);
public virtual weak string get_keybinding (int i); public abstract weak string get_keybinding (int i);
public virtual weak string get_localized_name (int i); public abstract weak string get_localized_name (int i);
public virtual int get_n_actions (); public abstract int get_n_actions ();
public virtual weak string get_name (int i); public abstract weak string get_name (int i);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool set_description (int i, string desc); public abstract bool set_description (int i, string desc);
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Component { public interface Component {
public virtual uint add_focus_handler (Atk.FocusHandler handler); public abstract uint add_focus_handler (Atk.FocusHandler handler);
public virtual bool contains (int x, int y, Atk.CoordType coord_type); public abstract bool contains (int x, int y, Atk.CoordType coord_type);
public virtual double get_alpha (); public abstract double get_alpha ();
public virtual void get_extents (int x, int y, int width, int height, Atk.CoordType coord_type); public abstract void get_extents (int x, int y, int width, int height, Atk.CoordType coord_type);
public virtual Atk.Layer get_layer (); public abstract Atk.Layer get_layer ();
public virtual int get_mdi_zorder (); public abstract int get_mdi_zorder ();
public virtual void get_position (int x, int y, Atk.CoordType coord_type); public abstract void get_position (int x, int y, Atk.CoordType coord_type);
public virtual void get_size (int width, int height); public abstract void get_size (int width, int height);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool grab_focus (); public abstract bool grab_focus ();
public virtual weak Atk.Object ref_accessible_at_point (int x, int y, Atk.CoordType coord_type); public abstract weak Atk.Object ref_accessible_at_point (int x, int y, Atk.CoordType coord_type);
public virtual void remove_focus_handler (uint handler_id); public abstract void remove_focus_handler (uint handler_id);
public virtual bool set_extents (int x, int y, int width, int height, Atk.CoordType coord_type); public abstract bool set_extents (int x, int y, int width, int height, Atk.CoordType coord_type);
public virtual bool set_position (int x, int y, Atk.CoordType coord_type); public abstract bool set_position (int x, int y, Atk.CoordType coord_type);
public virtual bool set_size (int width, int height); public abstract bool set_size (int width, int height);
public signal void bounds_changed (out Atk.Rectangle bounds); public signal void bounds_changed (out Atk.Rectangle bounds);
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Document { public interface Document {
public weak string get_attribute_value (string attribute_name); public weak string get_attribute_value (string attribute_name);
public weak GLib.SList get_attributes (); public weak GLib.SList get_attributes ();
public virtual pointer get_document (); public abstract pointer get_document ();
public virtual weak string get_document_type (); public abstract weak string get_document_type ();
public weak string get_locale (); public weak string get_locale ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public bool set_attribute_value (string attribute_name, string attribute_value); public bool set_attribute_value (string attribute_name, string attribute_value);
...@@ -442,94 +442,94 @@ namespace Atk { ...@@ -442,94 +442,94 @@ namespace Atk {
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface EditableText { public interface EditableText {
public virtual void copy_text (int start_pos, int end_pos); public abstract void copy_text (int start_pos, int end_pos);
public virtual void cut_text (int start_pos, int end_pos); public abstract void cut_text (int start_pos, int end_pos);
public virtual void delete_text (int start_pos, int end_pos); public abstract void delete_text (int start_pos, int end_pos);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual void insert_text (string string, int length, int position); public abstract void insert_text (string string, int length, int position);
public virtual void paste_text (int position); public abstract void paste_text (int position);
public virtual bool set_run_attributes (GLib.SList attrib_set, int start_offset, int end_offset); public abstract bool set_run_attributes (GLib.SList attrib_set, int start_offset, int end_offset);
public virtual void set_text_contents (string string); public abstract void set_text_contents (string string);
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface HyperlinkImpl { public interface HyperlinkImpl {
public virtual weak Atk.Hyperlink get_hyperlink (); public abstract weak Atk.Hyperlink get_hyperlink ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Hypertext { public interface Hypertext {
public virtual weak Atk.Hyperlink get_link (int link_index); public abstract weak Atk.Hyperlink get_link (int link_index);
public virtual int get_link_index (int char_index); public abstract int get_link_index (int char_index);
public virtual int get_n_links (); public abstract int get_n_links ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public signal void link_selected (int link_index); public signal void link_selected (int link_index);
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Image { public interface Image {
public virtual weak string get_image_description (); public abstract weak string get_image_description ();
public virtual weak string get_image_locale (); public abstract weak string get_image_locale ();
public virtual void get_image_position (int x, int y, Atk.CoordType coord_type); public abstract void get_image_position (int x, int y, Atk.CoordType coord_type);
public virtual void get_image_size (int width, int height); public abstract void get_image_size (int width, int height);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool set_image_description (string description); public abstract bool set_image_description (string description);
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Implementor { public interface Implementor {
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual weak Atk.Object ref_accessible (); public abstract weak Atk.Object ref_accessible ();
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Selection { public interface Selection {
public virtual bool add_selection (int i); public abstract bool add_selection (int i);
public virtual bool clear_selection (); public abstract bool clear_selection ();
public virtual int get_selection_count (); public abstract int get_selection_count ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool is_child_selected (int i); public abstract bool is_child_selected (int i);
public virtual weak Atk.Object ref_selection (int i); public abstract weak Atk.Object ref_selection (int i);
public virtual bool remove_selection (int i); public abstract bool remove_selection (int i);
public virtual bool select_all_selection (); public abstract bool select_all_selection ();
public signal void selection_changed (); public signal void selection_changed ();
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface StreamableContent { public interface StreamableContent {
public virtual weak string get_mime_type (int i); public abstract weak string get_mime_type (int i);
public virtual int get_n_mime_types (); public abstract int get_n_mime_types ();
public virtual weak GLib.IOChannel get_stream (string mime_type); public abstract weak GLib.IOChannel get_stream (string mime_type);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual weak string get_uri (string mime_type); public abstract weak string get_uri (string mime_type);
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Table { public interface Table {
public virtual bool add_column_selection (int column); public abstract bool add_column_selection (int column);
public virtual bool add_row_selection (int row); public abstract bool add_row_selection (int row);
public virtual weak Atk.Object get_caption (); public abstract weak Atk.Object get_caption ();
public virtual int get_column_at_index (int index_); public abstract int get_column_at_index (int index_);
public virtual weak string get_column_description (int column); public abstract weak string get_column_description (int column);
public virtual int get_column_extent_at (int row, int column); public abstract int get_column_extent_at (int row, int column);
public virtual weak Atk.Object get_column_header (int column); public abstract weak Atk.Object get_column_header (int column);
public virtual int get_index_at (int row, int column); public abstract int get_index_at (int row, int column);
public virtual int get_n_columns (); public abstract int get_n_columns ();
public virtual int get_n_rows (); public abstract int get_n_rows ();
public virtual int get_row_at_index (int index_); public abstract int get_row_at_index (int index_);
public virtual weak string get_row_description (int row); public abstract weak string get_row_description (int row);
public virtual int get_row_extent_at (int row, int column); public abstract int get_row_extent_at (int row, int column);
public virtual weak Atk.Object get_row_header (int row); public abstract weak Atk.Object get_row_header (int row);
public virtual int get_selected_columns (int selected); public abstract int get_selected_columns (int selected);
public virtual int get_selected_rows (int selected); public abstract int get_selected_rows (int selected);
public virtual weak Atk.Object get_summary (); public abstract weak Atk.Object get_summary ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool is_column_selected (int column); public abstract bool is_column_selected (int column);
public virtual bool is_row_selected (int row); public abstract bool is_row_selected (int row);
public virtual bool is_selected (int row, int column); public abstract bool is_selected (int row, int column);
public virtual weak Atk.Object ref_at (int row, int column); public abstract weak Atk.Object ref_at (int row, int column);
public virtual bool remove_column_selection (int column); public abstract bool remove_column_selection (int column);
public virtual bool remove_row_selection (int row); public abstract bool remove_row_selection (int row);
public virtual void set_caption (Atk.Object caption); public abstract void set_caption (Atk.Object caption);
public virtual void set_column_description (int column, string description); public abstract void set_column_description (int column, string description);
public virtual void set_column_header (int column, Atk.Object header); public abstract void set_column_header (int column, Atk.Object header);
public virtual void set_row_description (int row, string description); public abstract void set_row_description (int row, string description);
public virtual void set_row_header (int row, Atk.Object header); public abstract void set_row_header (int row, Atk.Object header);
public virtual void set_summary (Atk.Object accessible); public abstract void set_summary (Atk.Object accessible);
public signal void row_inserted (int row, int num_inserted); public signal void row_inserted (int row, int num_inserted);
public signal void column_inserted (int column, int num_inserted); public signal void column_inserted (int column, int num_inserted);
public signal void row_deleted (int row, int num_deleted); public signal void row_deleted (int row, int num_deleted);
...@@ -540,31 +540,31 @@ namespace Atk { ...@@ -540,31 +540,31 @@ namespace Atk {
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Text { public interface Text {
public virtual bool add_selection (int start_offset, int end_offset); public abstract bool add_selection (int start_offset, int end_offset);
public static Atk.TextAttribute attribute_for_name (string name); public static Atk.TextAttribute attribute_for_name (string name);
public static weak string attribute_get_name (Atk.TextAttribute attr); public static weak string attribute_get_name (Atk.TextAttribute attr);
public static weak string attribute_get_value (Atk.TextAttribute attr, int index_); public static weak string attribute_get_value (Atk.TextAttribute attr, int index_);
public static Atk.TextAttribute attribute_register (string name); public static Atk.TextAttribute attribute_register (string name);
public static void free_ranges (Atk.TextRange ranges); public static void free_ranges (Atk.TextRange ranges);
public virtual weak Atk.TextRange get_bounded_ranges (Atk.TextRectangle rect, Atk.CoordType coord_type, Atk.TextClipType x_clip_type, Atk.TextClipType y_clip_type); public abstract weak Atk.TextRange get_bounded_ranges (Atk.TextRectangle rect, Atk.CoordType coord_type, Atk.TextClipType x_clip_type, Atk.TextClipType y_clip_type);
public virtual int get_caret_offset (); public abstract int get_caret_offset ();
public virtual unichar get_character_at_offset (int offset); public abstract unichar get_character_at_offset (int offset);
public virtual int get_character_count (); public abstract int get_character_count ();
public virtual void get_character_extents (int offset, int x, int y, int width, int height, Atk.CoordType coords); public abstract void get_character_extents (int offset, int x, int y, int width, int height, Atk.CoordType coords);
public virtual weak GLib.SList get_default_attributes (); public abstract weak GLib.SList get_default_attributes ();
public virtual int get_n_selections (); public abstract int get_n_selections ();
public virtual int get_offset_at_point (int x, int y, Atk.CoordType coords); public abstract int get_offset_at_point (int x, int y, Atk.CoordType coords);
public virtual void get_range_extents (int start_offset, int end_offset, Atk.CoordType coord_type, Atk.TextRectangle rect); public abstract void get_range_extents (int start_offset, int end_offset, Atk.CoordType coord_type, Atk.TextRectangle rect);
public virtual weak GLib.SList get_run_attributes (int offset, int start_offset, int end_offset); public abstract weak GLib.SList get_run_attributes (int offset, int start_offset, int end_offset);
public virtual weak string get_selection (int selection_num, int start_offset, int end_offset); public abstract weak string get_selection (int selection_num, int start_offset, int end_offset);
public virtual weak string get_text (int start_offset, int end_offset); public abstract weak string get_text (int start_offset, int end_offset);
public virtual weak string get_text_after_offset (int offset, Atk.TextBoundary boundary_type, int start_offset, int end_offset); public abstract weak string get_text_after_offset (int offset, Atk.TextBoundary boundary_type, int start_offset, int end_offset);
public virtual weak string get_text_at_offset (int offset, Atk.TextBoundary boundary_type, int start_offset, int end_offset); public abstract weak string get_text_at_offset (int offset, Atk.TextBoundary boundary_type, int start_offset, int end_offset);
public virtual weak string get_text_before_offset (int offset, Atk.TextBoundary boundary_type, int start_offset, int end_offset); public abstract weak string get_text_before_offset (int offset, Atk.TextBoundary boundary_type, int start_offset, int end_offset);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool remove_selection (int selection_num); public abstract bool remove_selection (int selection_num);
public virtual bool set_caret_offset (int offset); public abstract bool set_caret_offset (int offset);
public virtual bool set_selection (int selection_num, int start_offset, int end_offset); public abstract bool set_selection (int selection_num, int start_offset, int end_offset);
public signal void text_changed (int position, int length); public signal void text_changed (int position, int length);
public signal void text_caret_moved (int location); public signal void text_caret_moved (int location);
public signal void text_selection_changed (); public signal void text_selection_changed ();
...@@ -572,12 +572,12 @@ namespace Atk { ...@@ -572,12 +572,12 @@ namespace Atk {
} }
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
public interface Value { public interface Value {
public virtual void get_current_value (GLib.Value value); public abstract void get_current_value (GLib.Value value);
public virtual void get_maximum_value (GLib.Value value); public abstract void get_maximum_value (GLib.Value value);
public virtual void get_minimum_increment (GLib.Value value); public abstract void get_minimum_increment (GLib.Value value);
public virtual void get_minimum_value (GLib.Value value); public abstract void get_minimum_value (GLib.Value value);
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool set_current_value (GLib.Value value); public abstract bool set_current_value (GLib.Value value);
} }
[ReferenceType] [ReferenceType]
[CCode (cheader_filename = "atk/atk.h")] [CCode (cheader_filename = "atk/atk.h")]
......
...@@ -462,136 +462,136 @@ namespace GLib { ...@@ -462,136 +462,136 @@ namespace GLib {
[CCode (cheader_filename = "gio/gvfs.h,glib.h")] [CCode (cheader_filename = "gio/gvfs.h,glib.h")]
public interface AppInfo { public interface AppInfo {
public static weak GLib.AppInfo create_from_commandline (string commandline, string application_name, GLib.Error error); public static weak GLib.AppInfo create_from_commandline (string commandline, string application_name, GLib.Error error);
public virtual weak GLib.AppInfo dup (); public abstract weak GLib.AppInfo dup ();
public virtual bool equal (GLib.AppInfo appinfo2); public abstract bool equal (GLib.AppInfo appinfo2);
public virtual weak string get_description (); public abstract weak string get_description ();
public virtual weak string get_icon (); public abstract weak string get_icon ();
public virtual weak string get_name (); public abstract weak string get_name ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual bool launch (GLib.List filenames, string envp, GLib.Error error); public abstract bool launch (GLib.List filenames, string envp, GLib.Error error);
public virtual bool launch_uris (GLib.List uris, string envp, GLib.Error error); public abstract bool launch_uris (GLib.List uris, string envp, GLib.Error error);
public virtual bool set_as_default_for_type (string content_type, GLib.Error error); public abstract bool set_as_default_for_type (string content_type, GLib.Error error);
public virtual bool should_show (string desktop_env); public abstract bool should_show (string desktop_env);
public virtual bool supports_uris (); public abstract bool supports_uris ();
public virtual bool supports_xdg_startup_notify (); public abstract bool supports_xdg_startup_notify ();
} }
[CCode (cheader_filename = "gio/gvfs.h,glib.h")] [CCode (cheader_filename = "gio/gvfs.h,glib.h")]
public interface AsyncResult { public interface AsyncResult {
public virtual weak GLib.Object get_source_object (); public abstract weak GLib.Object get_source_object ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual pointer get_user_data (); public abstract pointer get_user_data ();
} }
[CCode (cheader_filename = "gio/gvfs.h,glib.h")] [CCode (cheader_filename = "gio/gvfs.h,glib.h")]
public interface Drive { public interface Drive {
public virtual bool can_eject (); public abstract bool can_eject ();
public virtual bool can_mount (); public abstract bool can_mount ();
public virtual void eject (GLib.AsyncReadyCallback callback, pointer user_data); public abstract void eject (GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool eject_finish (GLib.AsyncResult result, GLib.Error error); public abstract bool eject_finish (GLib.AsyncResult result, GLib.Error error);
public virtual weak string get_icon (); public abstract weak string get_icon ();
public virtual weak string get_name (); public abstract weak string get_name ();
public weak string get_platform_id (); public weak string get_platform_id ();
public static GLib.Type get_type (); public static GLib.Type get_type ();
public virtual weak GLib.List get_volumes (); public abstract weak GLib.List get_volumes ();
public virtual bool is_automounted (); public abstract bool is_automounted ();
public virtual void mount (GLib.MountOperation mount_operation, GLib.AsyncReadyCallback callback, pointer user_data); public abstract void mount (GLib.MountOperation mount_operation, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool mount_finish (GLib.AsyncResult result, GLib.Error error); public abstract bool mount_finish (GLib.AsyncResult result, GLib.Error error);
public signal void changed (); public signal void changed ();
} }
[CCode (cheader_filename = "gio/gfile.h")] [CCode (cheader_filename = "gio/gfile.h")]
public interface File { public interface File {
public virtual weak GLib.FileOutputStream append_to (GLib.Cancellable cancellable, GLib.Error error); public abstract weak GLib.FileOutputStream append_to (GLib.Cancellable cancellable, GLib.Error error);
public virtual bool copy (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.Error error); public abstract bool copy (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.Error error);
public virtual weak GLib.FileOutputStream create (GLib.Cancellable cancellable, GLib.Error error); public abstract weak GLib.FileOutputStream create (GLib.Cancellable cancellable, GLib.Error error);
public bool delete (GLib.Cancellable cancellable, GLib.Error error); public bool delete (GLib.Cancellable cancellable, GLib.Error error);
public virtual weak GLib.File dup (); public abstract weak GLib.File dup ();
public virtual void eject_mountable (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data); public abstract void eject_mountable (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool eject_mountable_finish (GLib.AsyncResult result, GLib.Error error); public abstract bool eject_mountable_finish (GLib.AsyncResult result, GLib.Error error);
public virtual weak GLib.FileEnumerator enumerate_children (string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error); public abstract weak GLib.FileEnumerator enumerate_children (string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
public virtual bool equal (GLib.File file2); public abstract bool equal (GLib.File file2);
public virtual weak string get_basename (); public abstract weak string get_basename ();
public weak GLib.File get_child (string name); public weak GLib.File get_child (string name);
public virtual weak GLib.File get_child_for_display_name (string display_name, GLib.Error error); public abstract weak GLib.File get_child_for_display_name (string display_name, GLib.Error error);
public void get_contents_async (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data); public void get_contents_async (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public bool get_contents_finish (GLib.AsyncResult res, string contents, ulong length, GLib.Error error); public bool get_contents_finish (GLib.AsyncResult res, string contents, ulong length, GLib.Error error);
public virtual weak GLib.FileInfo get_filesystem_info (string attributes, GLib.Cancellable cancellable, GLib.Error error); public abstract weak GLib.FileInfo get_filesystem_info (string attributes, GLib.Cancellable cancellable, GLib.Error error);
public static weak GLib.File get_for_commandline_arg (string arg); public static weak GLib.File get_for_commandline_arg (string arg);
public static weak GLib.File get_for_path (string path); public static weak GLib.File get_for_path (string path);
public static weak GLib.File get_for_uri (string uri); public static weak GLib.File get_for_uri (string uri);
public virtual weak GLib.FileInfo get_info (string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error); public abstract weak GLib.FileInfo get_info (string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
public virtual weak GLib.File get_parent (); public abstract weak GLib.File get_parent ();
public virtual weak string get_parse_name (); public abstract weak string get_parse_name ();
public virtual weak string get_path (); public