Add MIN, MAX, and GParamSpec* bindings
authorJürg Billeter <j@bitron.ch>
Tue, 1 Jul 2008 12:11:39 +0000 (12:11 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 1 Jul 2008 12:11:39 +0000 (12:11 +0000)
2008-07-01  Jürg Billeter  <j@bitron.ch>

* vapi/glib-2.0.vapi:

Add MIN, MAX, and GParamSpec* bindings

svn path=/trunk/; revision=1669

ChangeLog
vapi/glib-2.0.vapi

index dd1ad80..6f9548c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-07-01  Jürg Billeter  <j@bitron.ch>
 
+       * vapi/glib-2.0.vapi:
+
+       Add MIN, MAX, and GParamSpec* bindings
+
+2008-07-01  Jürg Billeter  <j@bitron.ch>
+
        * vala/valaerrorcode.vala:
        * vala/valaparser.vala:
 
index b78ba5a..6bb1b04 100644 (file)
@@ -55,6 +55,10 @@ public struct char {
        public char tolower ();
        public char toupper ();
 
+       [CCode (cname = "MIN")]
+       public static char min (char a, char b);
+       [CCode (cname = "MAX")]
+       public static char max (char a, char b);
        [CCode (cname = "CLAMP")]
        public char clamp (char low, char high);
 }
@@ -66,6 +70,10 @@ public struct uchar {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hhu");
 
+       [CCode (cname = "MIN")]
+       public static uchar min (uchar a, uchar b);
+       [CCode (cname = "MAX")]
+       public static uchar max (uchar a, uchar b);
        [CCode (cname = "CLAMP")]
        public uchar clamp (uchar low, uchar high);
 }
@@ -82,6 +90,10 @@ public struct int {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%i");
 
+       [CCode (cname = "MIN")]
+       public static int min (int a, int b);
+       [CCode (cname = "MAX")]
+       public static int max (int a, int b);
        [CCode (cname = "CLAMP")]
        public int clamp (int low, int high);
 
@@ -101,6 +113,10 @@ public struct uint {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%u");
 
+       [CCode (cname = "MIN")]
+       public static uint min (uint a, uint b);
+       [CCode (cname = "MAX")]
+       public static uint max (uint a, uint b);
        [CCode (cname = "CLAMP")]
        public uint clamp (uint low, uint high);
 
@@ -120,6 +136,10 @@ public struct short {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hi");
 
+       [CCode (cname = "MIN")]
+       public static short min (short a, short b);
+       [CCode (cname = "MAX")]
+       public static short max (short a, short b);
        [CCode (cname = "CLAMP")]
        public short clamp (short low, short high);
 }
@@ -136,6 +156,10 @@ public struct ushort {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hu");
 
+       [CCode (cname = "MIN")]
+       public static ushort min (ushort a, ushort b);
+       [CCode (cname = "MAX")]
+       public static ushort max (ushort a, ushort b);
        [CCode (cname = "CLAMP")]
        public ushort clamp (ushort low, ushort high);
 }
@@ -152,6 +176,10 @@ public struct long {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%li");
 
+       [CCode (cname = "MIN")]
+       public static long min (long a, long b);
+       [CCode (cname = "MAX")]
+       public static long max (long a, long b);
        [CCode (cname = "CLAMP")]
        public long clamp (long low, long high);
 }
@@ -168,6 +196,10 @@ public struct ulong {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%lu");
 
+       [CCode (cname = "MIN")]
+       public static ulong min (ulong a, ulong b);
+       [CCode (cname = "MAX")]
+       public static ulong max (ulong a, ulong b);
        [CCode (cname = "CLAMP")]
        public ulong clamp (ulong low, ulong high);
 }
@@ -192,6 +224,10 @@ public struct size_t {
        [CCode (cname = "GSIZE_TO_POINTER")]
        public void* to_pointer ();
 
+       [CCode (cname = "MIN")]
+       public static size_t min (size_t a, size_t b);
+       [CCode (cname = "MAX")]
+       public static size_t max (size_t a, size_t b);
        [CCode (cname = "CLAMP")]
        public size_t clamp (size_t low, size_t high);
 }
@@ -213,6 +249,10 @@ public struct ssize_t {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%zi");
 
+       [CCode (cname = "MIN")]
+       public static ssize_t min (ssize_t a, ssize_t b);
+       [CCode (cname = "MAX")]
+       public static ssize_t max (ssize_t a, ssize_t b);
        [CCode (cname = "CLAMP")]
        public ssize_t clamp (ssize_t low, ssize_t high);
 }
@@ -229,6 +269,10 @@ public struct int8 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hhi");
 
+       [CCode (cname = "MIN")]
+       public static int8 min (int8 a, int8 b);
+       [CCode (cname = "MAX")]
+       public static int8 max (int8 a, int8 b);
        [CCode (cname = "CLAMP")]
        public int8 clamp (int8 low, int8 high);
 }
@@ -245,6 +289,10 @@ public struct uint8 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hhu");
 
+       [CCode (cname = "MIN")]
+       public static uint8 min (uint8 a, uint8 b);
+       [CCode (cname = "MAX")]
+       public static uint8 max (uint8 a, uint8 b);
        [CCode (cname = "CLAMP")]
        public uint8 clamp (uint8 low, uint8 high);
 }
@@ -266,6 +314,10 @@ public struct int16 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hi");
 
+       [CCode (cname = "MIN")]
+       public static int16 min (int16 a, int16 b);
+       [CCode (cname = "MAX")]
+       public static int16 max (int16 a, int16 b);
        [CCode (cname = "CLAMP")]
        public int16 clamp (int16 low, int16 high);
 }
@@ -287,6 +339,10 @@ public struct uint16 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%hu");
 
+       [CCode (cname = "MIN")]
+       public static uint16 min (uint16 a, uint16 b);
+       [CCode (cname = "MAX")]
+       public static uint16 max (uint16 a, uint16 b);
        [CCode (cname = "CLAMP")]
        public uint16 clamp (uint16 low, uint16 high);
 }
@@ -308,6 +364,10 @@ public struct int32 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%i");
 
+       [CCode (cname = "MIN")]
+       public static int32 min (int32 a, int32 b);
+       [CCode (cname = "MAX")]
+       public static int32 max (int32 a, int32 b);
        [CCode (cname = "CLAMP")]
        public int32 clamp (int32 low, int32 high);
 }
@@ -329,6 +389,10 @@ public struct uint32 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%u");
 
+       [CCode (cname = "MIN")]
+       public static uint32 min (uint32 a, uint32 b);
+       [CCode (cname = "MAX")]
+       public static uint32 max (uint32 a, uint32 b);
        [CCode (cname = "CLAMP")]
        public uint32 clamp (uint32 low, uint32 high);
 }
@@ -350,6 +414,10 @@ public struct int64 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%lli");
 
+       [CCode (cname = "MIN")]
+       public static int64 min (int64 a, int64 b);
+       [CCode (cname = "MAX")]
+       public static int64 max (int64 a, int64 b);
        [CCode (cname = "CLAMP")]
        public int64 clamp (int64 low, int64 high);
 }
@@ -371,6 +439,10 @@ public struct uint64 {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%llu");
 
+       [CCode (cname = "MIN")]
+       public static uint64 min (uint64 a, uint64 b);
+       [CCode (cname = "MAX")]
+       public static uint64 max (uint64 a, uint64 b);
        [CCode (cname = "CLAMP")]
        public uint64 clamp (uint64 low, uint64 high);
 }
@@ -418,6 +490,10 @@ public struct float {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%g");
 
+       [CCode (cname = "MIN")]
+       public static float min (float a, float b);
+       [CCode (cname = "MAX")]
+       public static float max (float a, float b);
        [CCode (cname = "CLAMP")]
        public float clamp (float low, float high);
 }
@@ -465,6 +541,10 @@ public struct double {
        [CCode (cname = "g_strdup_printf", instance_pos = -1)]
        public string to_string (string format = "%g");
 
+       [CCode (cname = "MIN")]
+       public static double min (double a, double b);
+       [CCode (cname = "MAX")]
+       public static double max (double a, double b);
        [CCode (cname = "CLAMP")]
        public double clamp (double low, double high);
 }
@@ -506,6 +586,10 @@ public struct unichar {
 
        public int to_utf8 (string? outbuf);
 
+       [CCode (cname = "MIN")]
+       public static unichar min (unichar a, unichar b);
+       [CCode (cname = "MAX")]
+       public static unichar max (unichar a, unichar b);
        [CCode (cname = "CLAMP")]
        public unichar clamp (unichar low, unichar high);
 }
@@ -776,6 +860,26 @@ namespace GLib {
                public Type owner_type;
        }
 
+       public class ParamSpecEnum : ParamSpec {
+               [CCode (cname = "g_param_spec_enum")]
+               public ParamSpecEnum (string name, string nick, string blurb, Type enum_type, int default_value, ParamFlags flags);
+       }
+
+       public class ParamSpecFloat : ParamSpec {
+               [CCode (cname = "g_param_spec_float")]
+               public ParamSpecFloat (string name, string nick, string blurb, float minimum, float maximum, float default_value, ParamFlags flags);
+       }
+
+       public class ParamSpecInt : ParamSpec {
+               [CCode (cname = "g_param_spec_int")]
+               public ParamSpecInt (string name, string nick, string blurb, int minimum, int maximum, int default_value, ParamFlags flags);
+       }
+
+       public class ParamSpecUInt : ParamSpec {
+               [CCode (cname = "g_param_spec_uint")]
+               public ParamSpecUInt (string name, string nick, string blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags);
+       }
+
        [CCode (cprefix = "G_PARAM_")]
        public enum ParamFlags {
                READABLE,
@@ -785,7 +889,9 @@ namespace GLib {
                LAX_VALIDATION,
                STATIC_NAME,
                STATIC_NICK,
-               STATIC_BLURB
+               STATIC_BLURB,
+               READWRITE,
+               STATIC_STRINGS
        }
 
        [CCode (lower_case_csuffix = "object_class")]