From: Juerg Billeter Date: Sun, 25 May 2008 09:47:07 +0000 (+0000) Subject: Deprecate static classes, patch by Jared Moore, fixes bug 524509 X-Git-Tag: VALA_0_3_3~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1981f308ce464184d1872e1838ce6ffb8260b68b;p=thirdparty%2Fvala.git Deprecate static classes, patch by Jared Moore, fixes bug 524509 2008-05-25 Juerg Billeter * vala/valaparser.vala: Deprecate static classes, patch by Jared Moore, fixes bug 524509 * vala/valareport.vala: * tests/classes.vala: * tests/structs.vala: * gobject-introspection/gidl.vapi: * vapi/dbus-glib-1.vapi: * vapi/glib-2.0.vapi: * vapi/libxml-2.0.vapi: * vapi/taglib_c.vapi: * vapi/packages/gstreamer-video-0.10/: Replace static classes by namespaces * vapi/gstreamer-video-0.10.vapi: regenerated svn path=/trunk/; revision=1422 --- diff --git a/ChangeLog b/ChangeLog index cee9a687a..8db8514e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-05-25 Jürg Billeter + + * vala/valaparser.vala: + + Deprecate static classes, patch by Jared Moore, fixes bug 524509 + + * vala/valareport.vala: + * tests/classes.vala: + * tests/structs.vala: + * gobject-introspection/gidl.vapi: + * vapi/dbus-glib-1.vapi: + * vapi/glib-2.0.vapi: + * vapi/libxml-2.0.vapi: + * vapi/taglib_c.vapi: + * vapi/packages/gstreamer-video-0.10/: + + Replace static classes by namespaces + + * vapi/gstreamer-video-0.10.vapi: regenerated + 2008-05-25 Jürg Billeter * gobject/valaccodeclassbinding.vala: diff --git a/gobject-introspection/gidl.vapi b/gobject-introspection/gidl.vapi index 933ee44c8..e2bae696b 100644 --- a/gobject-introspection/gidl.vapi +++ b/gobject-introspection/gidl.vapi @@ -23,8 +23,8 @@ [CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h")] namespace GLib { [CCode (cheader_filename = "gidlparser.h")] - public static class Idl { - public static List parse_file (string filename) throws MarkupError; + namespace Idl { + public List parse_file (string filename) throws MarkupError; } [CCode (free_function = "g_idl_module_free", cheader_filename = "gidlmodule.h")] diff --git a/tests/classes.vala b/tests/classes.vala index ff5374469..674c2dadd 100644 --- a/tests/classes.vala +++ b/tests/classes.vala @@ -24,9 +24,6 @@ abstract class AbstractClass { public int field; } -static class StaticClass { -} - class ClassWithCreationMethod { public ClassWithCreationMethod () { stdout.printf ("ClassWithCreationMethod\n"); @@ -86,53 +83,49 @@ class GObjectClassWithNamedCreationMethod : Object { } } -static class ClassesTest { - static int main (string[] args) { - stdout.printf ("Classes Test:\n"); - - stdout.printf ("new SimpleClass ()\n"); - var simple_class = new SimpleClass (); - stdout.printf ("new DerivedClass ()\n"); - var derived_class = new DerivedClass (); - stdout.printf ("new PublicClass ()\n"); - var public_class = new PublicClass (); - stdout.printf ("new ClassWithCreationMethod ()\n"); - var class_with_creation_method = new ClassWithCreationMethod (); - stdout.printf ("new ClassWithNamedCreationMethod ()\n"); - var class_with_named_creation_method = new ClassWithNamedCreationMethod.named (); - stdout.printf ("new ClassWithDestructor ()\n"); - var class_with_destructor = new ClassWithDestructor (); - class_with_destructor = null; - - stdout.printf ("new SimpleGTypeInstanceClass ()\n"); - var simple_gtypeinstance_class = new SimpleGTypeInstanceClass (); - stdout.printf ("new DerivedGTypeInstanceClass ()\n"); - var derived_gtypeinstance_class = new DerivedGTypeInstanceClass (); - stdout.printf ("new PublicGTypeInstanceClass ()\n"); - var public_gtypeinstance_class = new PublicGTypeInstanceClass (); - stdout.printf ("new GTypeInstanceClassWithCreationMethod ()\n"); - var gtypeinstance_class_with_creation_method = new GTypeInstanceClassWithCreationMethod (); - stdout.printf ("new GTypeInstanceClassWithNamedCreationMethod ()\n"); - var gtypeinstance_class_with_named_creation_method = new GTypeInstanceClassWithNamedCreationMethod.named (); - - stdout.printf ("new SimpleGObjectClass ()\n"); - var simple_gobject_class = new SimpleGObjectClass (); - stdout.printf ("new DerivedGObjectClass ()\n"); - var derived_gobject_class = new DerivedGObjectClass (); - stdout.printf ("new PublicGObjectClass ()\n"); - var public_gobject_class = new PublicGObjectClass (); - stdout.printf ("new GObjectClassWithCreationMethod ()\n"); - var gobject_class_with_creation_method = new GObjectClassWithCreationMethod (); - stdout.printf ("new GObjectClassWithNamedCreationMethod ()\n"); - var gobject_class_with_named_creation_method = new GObjectClassWithNamedCreationMethod.named (); - - stdout.printf ("new SimpleClass () { field = 1 }\n"); - simple_class = new SimpleClass () { field = 1 }; - stdout.printf ("simple_class.field = %d\n", simple_class.field); - - stdout.printf (".\n"); - - return 0; - } +void main () { + stdout.printf ("Classes Test:\n"); + + stdout.printf ("new SimpleClass ()\n"); + var simple_class = new SimpleClass (); + stdout.printf ("new DerivedClass ()\n"); + var derived_class = new DerivedClass (); + stdout.printf ("new PublicClass ()\n"); + var public_class = new PublicClass (); + stdout.printf ("new ClassWithCreationMethod ()\n"); + var class_with_creation_method = new ClassWithCreationMethod (); + stdout.printf ("new ClassWithNamedCreationMethod ()\n"); + var class_with_named_creation_method = new ClassWithNamedCreationMethod.named (); + stdout.printf ("new ClassWithDestructor ()\n"); + var class_with_destructor = new ClassWithDestructor (); + class_with_destructor = null; + + stdout.printf ("new SimpleGTypeInstanceClass ()\n"); + var simple_gtypeinstance_class = new SimpleGTypeInstanceClass (); + stdout.printf ("new DerivedGTypeInstanceClass ()\n"); + var derived_gtypeinstance_class = new DerivedGTypeInstanceClass (); + stdout.printf ("new PublicGTypeInstanceClass ()\n"); + var public_gtypeinstance_class = new PublicGTypeInstanceClass (); + stdout.printf ("new GTypeInstanceClassWithCreationMethod ()\n"); + var gtypeinstance_class_with_creation_method = new GTypeInstanceClassWithCreationMethod (); + stdout.printf ("new GTypeInstanceClassWithNamedCreationMethod ()\n"); + var gtypeinstance_class_with_named_creation_method = new GTypeInstanceClassWithNamedCreationMethod.named (); + + stdout.printf ("new SimpleGObjectClass ()\n"); + var simple_gobject_class = new SimpleGObjectClass (); + stdout.printf ("new DerivedGObjectClass ()\n"); + var derived_gobject_class = new DerivedGObjectClass (); + stdout.printf ("new PublicGObjectClass ()\n"); + var public_gobject_class = new PublicGObjectClass (); + stdout.printf ("new GObjectClassWithCreationMethod ()\n"); + var gobject_class_with_creation_method = new GObjectClassWithCreationMethod (); + stdout.printf ("new GObjectClassWithNamedCreationMethod ()\n"); + var gobject_class_with_named_creation_method = new GObjectClassWithNamedCreationMethod.named (); + + stdout.printf ("new SimpleClass () { field = 1 }\n"); + simple_class = new SimpleClass () { field = 1 }; + stdout.printf ("simple_class.field = %d\n", simple_class.field); + + stdout.printf (".\n"); } diff --git a/tests/structs.vala b/tests/structs.vala index 85db4a82f..5656511be 100644 --- a/tests/structs.vala +++ b/tests/structs.vala @@ -24,46 +24,42 @@ struct StructWithNamedCreationMethod { public int field; } -static class StructsTest { - static void test_in_parameter (SimpleStruct st) { - stdout.printf ("test_in_parameter: st.field = %d\n", st.field); - } - - static void test_ref_parameter (ref SimpleStruct st) { - stdout.printf ("test_ref_parameter: st.field = %d\n", st.field); - st.field++; - } - - static void test_out_parameter (out SimpleStruct st) { - st = SimpleStruct (); - st.field = 3; - } - - static int main (string[] args) { - stdout.printf ("Structs Test:\n"); - - stdout.printf ("new SimpleStruct ()\n"); - var simple_struct = SimpleStruct (); - stdout.printf ("new PublicStruct ()\n"); - var public_struct = PublicStruct (); - stdout.printf ("new StructWithCreationMethod ()\n"); - var struct_with_creation_method = StructWithCreationMethod (); - stdout.printf ("new StructWithNamedCreationMethod ()\n"); - var struct_with_named_creation_method = StructWithNamedCreationMethod.named (); - - stdout.printf ("new SimpleStruct () { field = 1 }\n"); - simple_struct = SimpleStruct () { field = 1 }; - stdout.printf ("simple_struct.field = %d\n", simple_struct.field); +void test_in_parameter (SimpleStruct st) { + stdout.printf ("test_in_parameter: st.field = %d\n", st.field); +} - test_in_parameter (simple_struct); - test_ref_parameter (ref simple_struct); - stdout.printf ("after test_ref_parameter: st.field = %d\n", simple_struct.field); - test_out_parameter (out simple_struct); - stdout.printf ("after test_out_parameter: st.field = %d\n", simple_struct.field); +void test_ref_parameter (ref SimpleStruct st) { + stdout.printf ("test_ref_parameter: st.field = %d\n", st.field); + st.field++; +} - stdout.printf (".\n"); +void test_out_parameter (out SimpleStruct st) { + st = SimpleStruct (); + st.field = 3; +} - return 0; - } +void main () { + stdout.printf ("Structs Test:\n"); + + stdout.printf ("new SimpleStruct ()\n"); + var simple_struct = SimpleStruct (); + stdout.printf ("new PublicStruct ()\n"); + var public_struct = PublicStruct (); + stdout.printf ("new StructWithCreationMethod ()\n"); + var struct_with_creation_method = StructWithCreationMethod (); + stdout.printf ("new StructWithNamedCreationMethod ()\n"); + var struct_with_named_creation_method = StructWithNamedCreationMethod.named (); + + stdout.printf ("new SimpleStruct () { field = 1 }\n"); + simple_struct = SimpleStruct () { field = 1 }; + stdout.printf ("simple_struct.field = %d\n", simple_struct.field); + + test_in_parameter (simple_struct); + test_ref_parameter (ref simple_struct); + stdout.printf ("after test_ref_parameter: st.field = %d\n", simple_struct.field); + test_out_parameter (out simple_struct); + stdout.printf ("after test_out_parameter: st.field = %d\n", simple_struct.field); + + stdout.printf (".\n"); } diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 186536a57..c7a3d71e6 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -1902,6 +1902,7 @@ public class Vala.Parser : CodeVisitor { } if (ModifierFlags.STATIC in flags) { cl.is_static = true; + Report.warning (get_last_src (), "static classes are deprecated, use namespaces"); } set_attributes (cl, attrs); foreach (TypeParameter type_param in type_param_list) { diff --git a/vala/valareport.vala b/vala/valareport.vala index c61416bf4..c77c8975d 100644 --- a/vala/valareport.vala +++ b/vala/valareport.vala @@ -23,39 +23,39 @@ using GLib; /** - * Static class to centralize reporting warnings and errors. + * Namespace to centralize reporting warnings and errors. */ -public static class Vala.Report { - private static int warnings; - private static int errors; +namespace Vala.Report { + public int warnings; + public int errors; - private static bool verbose_errors; + public bool verbose_errors; /** * Set the error verbosity. */ - public static void set_verbose_errors (bool verbose) { + public void set_verbose_errors (bool verbose) { verbose_errors = verbose; } /** * Returns the total number of warnings reported. */ - public static int get_warnings () { + public int get_warnings () { return warnings; } /** * Returns the total number of errors reported. */ - public static int get_errors () { + public int get_errors () { return errors; } /** * Pretty-print the actual line of offending code if possible. */ - private static void report_source (SourceReference source) { + public void report_source (SourceReference source) { if (source.first_line != source.last_line) { // FIXME Cannot report multi-line issues currently return; @@ -96,7 +96,7 @@ public static class Vala.Report { * @param source reference to source code * @param message warning message */ - public static void warning (SourceReference? source, string message) { + public void warning (SourceReference? source, string message) { warnings++; if (source == null) { stderr.printf ("warning: %s\n", message); @@ -114,7 +114,7 @@ public static class Vala.Report { * @param source reference to source code * @param message error message */ - public static void error (SourceReference? source, string message) { + public void error (SourceReference? source, string message) { errors++; if (source == null) { stderr.printf ("error: %s\n", message); diff --git a/vapi/dbus-glib-1.vapi b/vapi/dbus-glib-1.vapi index ddf95d90e..660664286 100644 --- a/vapi/dbus-glib-1.vapi +++ b/vapi/dbus-glib-1.vapi @@ -29,7 +29,7 @@ namespace DBus { STARTER } - public static class RawBus { + namespace RawBus { [CCode (cname = "dbus_bus_get")] public static RawConnection get (BusType type, ref RawError error); } diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 18dfed3f0..b619f9175 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -926,8 +926,8 @@ namespace GLib { public struct ValueArray { } - [CCode (cprefix = "", cheader_filename = "math.h")] - public static class Math { + [CCode (lower_case_cprefix = "", cheader_filename = "math.h")] + namespace Math { [CCode (cname = "G_E")] public static double E; @@ -1087,7 +1087,7 @@ namespace GLib { /* Atomic Operations */ - public static class AtomicInt { + namespace AtomicInt { public static int get (ref int atomic); public static void set (ref int atomic, int newval); public static void add (ref int atomic, int val); @@ -1097,7 +1097,7 @@ namespace GLib { public static bool dec_and_test (ref int atomic); } - public static class AtomicPointer { + namespace AtomicPointer { public static void* get (void** atomic); public static void set (void** atomic, void* newval); public static bool compare_and_exchange (void** atomic, void* oldval, void* newval); @@ -1156,7 +1156,7 @@ namespace GLib { public TimeoutSource (uint interval); } - public static class Timeout { + namespace Timeout { public static uint add (uint interval, SourceFunc function); public static uint add_full (int priority, uint interval, SourceFunc function, DestroyNotify? notify); public static uint add_seconds (uint interval, SourceFunc function); @@ -1168,7 +1168,7 @@ namespace GLib { public IdleSource (); } - public static class Idle { + namespace Idle { public static uint add (SourceFunc function); public static uint add_full (int priority, SourceFunc function, DestroyNotify? notify); public static bool remove_by_data (void* data); @@ -1185,7 +1185,7 @@ namespace GLib { public ChildWatchSource (Pid pid, int status, void* data); } - public static class ChildWatch { + namespace ChildWatch { public static uint add (Pid pid, ChildWatchFunc function); public static uint add_full (int priority, Pid pid, ChildWatchFunc function, DestroyNotify? notify); } @@ -1362,7 +1362,7 @@ namespace GLib { public static void free (void* mem); [CCode (cheader_filename = "string.h")] - public static class Memory { + namespace Memory { [CCode (cname = "memcmp")] public static int cmp (void* s1, void* s2, size_t n); [CCode (cname = "memcpy")] @@ -1562,7 +1562,7 @@ namespace GLib { public int close (); } - public static class Filename { + namespace Filename { public static string to_utf8 (string opsysstring, out ulong bytes_read, out ulong bytes_written) throws ConvertError; public static string from_utf8 (string utf8string, long len, out ulong bytes_read, out ulong bytes_written) throws ConvertError; public static string from_uri (string uri, out string hostname = null) throws ConvertError; @@ -1582,7 +1582,7 @@ namespace GLib { /* Base64 Encoding */ - public static class Base64 { + namespace Base64 { public static size_t encode_step (uchar[] _in, bool break_lines, char* _out, ref int state, ref int save); public static size_t encode_close (bool break_lines, char* _out, ref int state, ref int save); public static string encode (uchar[] data); @@ -1788,7 +1788,7 @@ namespace GLib { public double double_range (double begin, double end); } - public static class Random { + namespace Random { public static void set_seed (uint32 seed); public static bool boolean (); [CCode (cname = "g_random_int")] @@ -1801,7 +1801,7 @@ namespace GLib { /* Miscellaneous Utility Functions */ - public static class Environment { + namespace Environment { [CCode (cname = "g_get_application_name")] public static weak string? get_application_name (); [CCode (cname = "g_set_application_name")] @@ -1854,7 +1854,7 @@ namespace GLib { VIDEOS } - public static class Path { + namespace Path { public static bool is_absolute (string file_name); public static weak string skip_root (string file_name); public static string get_basename (string file_name); @@ -1870,13 +1870,13 @@ namespace GLib { public static bool is_dir_separator (unichar c); } - public static class Bit { + namespace Bit { public static int nth_lsf (ulong mask, int nth_bit); public static int nth_msf (ulong mask, int nth_bit); public static uint storage (ulong number); } - public static class SpacedPrimes { + namespace SpacedPrimes { public static uint closest (uint num); } @@ -1939,7 +1939,7 @@ namespace GLib { public uint store_int64; } - public static class CharacterSet { + namespace CharacterSet { [CCode (cname = "G_CSET_A_2_Z")] public const string A_2_Z; [CCode (cname = "G_CSET_a_2_z")] @@ -2060,8 +2060,8 @@ namespace GLib { public delegate void SpawnChildSetupFunc (); - [CCode (cprefix = "g_")] - public static class Process { + [CCode (lower_case_cprefix = "g_")] + namespace Process { [NoArrayLength ()] public static bool spawn_async_with_pipes (string? working_directory, string[] argv, string[]? envp, SpawnFlags _flags, SpawnChildSetupFunc? child_setup, out Pid child_pid, out int standard_input = null, out int standard_output = null, out int standard_error = null) throws SpawnError; [NoArrayLength ()] @@ -2180,8 +2180,8 @@ namespace GLib { public int flush (); } - [CCode (cprefix = "g_file_", cheader_filename = "glib/gstdio.h")] - public static class FileUtils { + [CCode (lower_case_cprefix = "g_file_", cheader_filename = "glib/gstdio.h")] + namespace FileUtils { public static bool get_contents (string filename, out string contents, out ulong length = null) throws FileError; public static bool set_contents (string filename, string contents, long length = -1) throws FileError; public static bool test (string filename, FileTest test); @@ -2212,7 +2212,7 @@ namespace GLib { public void rewind (); } - public static class DirUtils { + namespace DirUtils { [CCode (cname = "g_mkdir")] public static int create (string pathname, int mode); [CCode (cname = "g_mkdir_with_parents")] @@ -2240,7 +2240,7 @@ namespace GLib { /* URI Functions */ - public static class Uri { + namespace Uri { public const string RESERVED_CHARS_ALLOWED_IN_PATH; public const string RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT; public const string RESERVED_CHARS_ALLOWED_IN_USERINFO; @@ -2261,7 +2261,7 @@ namespace GLib { FAILED } - public static class Shell { + namespace Shell { public static bool parse_argv (string command_line, [CCode (array_length_pos = 1.9)] out string[] argvp) throws ShellError; public static string quote (string unquoted_string); public static string unquote (string quoted_string) throws ShellError; @@ -2476,7 +2476,7 @@ namespace GLib { public MarkupParserErrorFunc error; } - public static class Markup { + namespace Markup { public static string escape_text (string text, long length = -1); [PrintfFormat] public static string printf_escaped (string format, ...); @@ -2606,7 +2606,7 @@ namespace GLib { /* Testing */ - public static class Test { + namespace Test { [PrintfFormat] public static void minimized_result (double minimized_quantity, string format, ...); [PrintfFormat] @@ -3044,7 +3044,7 @@ namespace GLib { TIME } - public static class Intl { + namespace Intl { [CCode (cname = "setlocale", cheader_filename = "locale.h")] public static weak string setlocale (LocaleCategory category, string locale); [CCode (cname = "bindtextdomain", cheader_filename = "glib/gi18n-lib.h")] @@ -3053,7 +3053,7 @@ namespace GLib { public static weak string textdomain (string domainname); } - public static class Signal { + namespace Signal { public static void query (uint signal_id, out SignalQuery query); public static uint lookup (string name, Type itype); public static weak string name (uint signal_id); @@ -3078,7 +3078,7 @@ namespace GLib { public static bool parse_name (string detailed_signal, Type itype, out uint signal_id, out Quark detail, bool force_detail_quark); } - public static class SignalHandler { + namespace SignalHandler { public static void block (void* instance, ulong handler_id); public static void unblock (void* instance, ulong handler_id); public static void disconnect (void* instance, ulong handler_id); diff --git a/vapi/gstreamer-video-0.10.vapi b/vapi/gstreamer-video-0.10.vapi index 9e19933db..0cfc4d669 100644 --- a/vapi/gstreamer-video-0.10.vapi +++ b/vapi/gstreamer-video-0.10.vapi @@ -2,29 +2,8 @@ [CCode (cprefix = "Gst", lower_case_cprefix = "gst_")] namespace Gst { - [CCode (cprefix = "GST_VIDEO_FORMAT_", has_type_id = "0", cheader_filename = "gst/video/video.h")] - public enum VideoFormat { - UNKNOWN, - I420, - YV12, - YUY2, - UYVY, - AYUV, - RGBx, - BGRx, - xRGB, - xBGR, - RGBA, - BGRA, - ARGB, - ABGR, - RGB, - BGR, - Y41B, - Y42B - } - [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask32 { + [CCode (cprefix = "GstVideoMask32", lower_case_cprefix = "gst_video_mask32_")] + namespace VideoMask32 { [CCode (cname = "GST_VIDEO_BYTE1_MASK_32")] public const string BYTE1; [CCode (cname = "GST_VIDEO_BYTE2_MASK_32")] @@ -42,8 +21,8 @@ namespace Gst { [CCode (cname = "GST_VIDEO_BYTE4_MASK_32_INT")] public const int BYTE4_INT; } - [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask24 { + [CCode (cprefix = "GstVideoMask24", lower_case_cprefix = "gst_video_mask24_")] + namespace VideoMask24 { [CCode (cname = "GST_VIDEO_BYTE1_MASK_24")] public const string BYTE1; [CCode (cname = "GST_VIDEO_BYTE2_MASK_24")] @@ -57,8 +36,8 @@ namespace Gst { [CCode (cname = "GST_VIDEO_BYTE3_MASK_24_INT")] public const int BYTE3_INT; } - [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask16 { + [CCode (cprefix = "GstVideoMask16", lower_case_cprefix = "gst_video_mask16_")] + namespace VideoMask16 { [CCode (cname = "GST_VIDEO_RED_MASK_16")] public const string RED; [CCode (cname = "GST_VIDEO_GREEN_MASK_16")] @@ -72,8 +51,8 @@ namespace Gst { [CCode (cname = "GST_VIDEO_BLUE_MASK_16_INT")] public const int BLUE_INT; } - [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask15 { + [CCode (cprefix = "GstVideoMask15", lower_case_cprefix = "gst_video_mask15_")] + namespace VideoMask15 { [CCode (cname = "GST_VIDEO_RED_MASK_15")] public const string RED; [CCode (cname = "GST_VIDEO_GREEN_MASK_15")] @@ -87,15 +66,15 @@ namespace Gst { [CCode (cname = "GST_VIDEO_BLUE_MASK_15_INT")] public const int BLUE_INT; } - [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoRange { + [CCode (cprefix = "GstVideoRange", lower_case_cprefix = "gst_video_range_")] + namespace VideoRange { [CCode (cname = "GST_VIDEO_SIZE_RANGE")] public const string SIZE; [CCode (cname = "GST_VIDEO_FPS_RANGE")] public const string FPS; } - [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoCaps { + [CCode (cprefix = "GST_VIDEO_CAPS_", lower_case_cprefix = "gst_video_caps_")] + namespace VideoCaps { public const string RGB; public const string BGR; public const string RGBx; @@ -110,8 +89,30 @@ namespace Gst { public const string BGRx_HOST_ENDIAN; public const string RGB_16; public const string RGB_15; + [CCode (cname = "GST_VIDEO_CAPS_YUV", cheader_filename = "gst/video/video.h,gst/video/video.h,gst/video/video.h,gst/video/video.h")] public static string YUV (string fourcc); } + [CCode (cprefix = "GST_VIDEO_FORMAT_", has_type_id = "0", cheader_filename = "gst/video/video.h")] + public enum VideoFormat { + UNKNOWN, + I420, + YV12, + YUY2, + UYVY, + AYUV, + RGBx, + BGRx, + xRGB, + xBGR, + RGBA, + BGRA, + ARGB, + ABGR, + RGB, + BGR, + Y41B, + Y42B + } [CCode (cheader_filename = "gst/video/gstvideosink.h")] public class VideoRectangle { public int x; diff --git a/vapi/libxml-2.0.vapi b/vapi/libxml-2.0.vapi index 6cf5273e9..409f88627 100644 --- a/vapi/libxml-2.0.vapi +++ b/vapi/libxml-2.0.vapi @@ -160,7 +160,7 @@ namespace Xml { /* parser - the core parser module */ [CCode (cheader_filename = "libxml/parser.h")] - public static class Parser { + namespace Parser { [CCode (cname = "xmlCleanupParser")] public static void cleanup (); @@ -214,7 +214,7 @@ namespace Xml { /* tree - interfaces for tree manipulation */ [CCode (cheader_filename = "libxml/tree.h")] - public static class Tree { + namespace Tree { [CCode (cname = "xmlGetCompressMode")] public static int get_compress_mode (); @@ -1032,7 +1032,7 @@ namespace Xml { /* xpath - XML Path Language implementation */ [CCode (cheader_filename = "libxml/xpath.h")] - public static class XPath { + namespace XPath { [CCode (cname = "xmlXPathOrderDocElems")] public static long order_doc_elements (Doc* doc); } diff --git a/vapi/packages/gstreamer-video-0.10/gstreamer-video-0.10-custom.vala b/vapi/packages/gstreamer-video-0.10/gstreamer-video-0.10-custom.vala index fbd9b30f4..5f2ff3d46 100644 --- a/vapi/packages/gstreamer-video-0.10/gstreamer-video-0.10-custom.vala +++ b/vapi/packages/gstreamer-video-0.10/gstreamer-video-0.10-custom.vala @@ -22,7 +22,7 @@ namespace Gst { [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask32 { + namespace VideoMask32 { [CCode (cname = "GST_VIDEO_BYTE1_MASK_32")] public const string BYTE1; [CCode (cname = "GST_VIDEO_BYTE2_MASK_32")] @@ -42,7 +42,7 @@ namespace Gst { public const int BYTE4_INT; } [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask24 { + namespace VideoMask24 { [CCode (cname = "GST_VIDEO_BYTE1_MASK_24")] public const string BYTE1; [CCode (cname = "GST_VIDEO_BYTE2_MASK_24")] @@ -59,7 +59,7 @@ namespace Gst { } [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask16 { + namespace VideoMask16 { [CCode (cname = "GST_VIDEO_RED_MASK_16")] public const string RED; [CCode (cname = "GST_VIDEO_GREEN_MASK_16")] @@ -76,7 +76,7 @@ namespace Gst { } [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoMask15 { + namespace VideoMask15 { [CCode (cname = "GST_VIDEO_RED_MASK_15")] public const string RED; [CCode (cname = "GST_VIDEO_GREEN_MASK_15")] @@ -93,7 +93,7 @@ namespace Gst { } [CCode (cheader_filename = "gst/video/video.h")] - public static class VideoRange { + namespace VideoRange { [CCode (cname = "GST_VIDEO_SIZE_RANGE")] public const string SIZE; [CCode (cname = "GST_VIDEO_FPS_RANGE")] @@ -101,7 +101,7 @@ namespace Gst { } [CCode (cprefix = "GST_VIDEO_CAPS_", cheader_filename = "gst/video/video.h")] - public static class VideoCaps { + namespace VideoCaps { public const string RGB; public const string BGR; @@ -122,6 +122,6 @@ namespace Gst { public const string RGB_15; [CCode (cname = "GST_VIDEO_CAPS_YUV")] - public static string YUV (string fourcc); + public string YUV (string fourcc); } } diff --git a/vapi/taglib_c.vapi b/vapi/taglib_c.vapi index 5b30ea32a..01ff9e43d 100644 --- a/vapi/taglib_c.vapi +++ b/vapi/taglib_c.vapi @@ -66,7 +66,7 @@ namespace TagLib public int channels (); } - public static class TagLib + namespace TagLib { /* By default all strings coming into or out of TagLib's C API are in UTF8. * However, it may be desirable for TagLib to operate on Latin1 (ISO-8859-1)