Commit 86445e30 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

support base_class attribute

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

	* vapigen/valagidlparser.vala: support base_class attribute

	* vapi/packages/gdk-2.0/gdk-2.0.metadata, vapi/gdk-2.0.vala: set
	  base_class of GdkPixmap, fixes bug 463816

svn path=/trunk/; revision=551
parent 993a8717
2007-08-31 Jürg Billeter <j@bitron.ch>
* vapigen/valagidlparser.vala: support base_class attribute
* vapi/packages/gdk-2.0/gdk-2.0.metadata, vapi/gdk-2.0.vala: set
base_class of GdkPixmap, fixes bug 463816
2007-08-31 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala, vala/valastruct.vala: use G_TYPE_POINTER for
......
......@@ -956,7 +956,7 @@ namespace Gdk {
public PixbufSimpleAnim (int width, int height, float rate);
}
[CCode (cheader_filename = "gdk/gdk.h")]
public class Pixmap : GLib.Object {
public class Pixmap : Gdk.Drawable {
public static weak Gdk.Pixmap colormap_create_from_xpm (Gdk.Drawable drawable, Gdk.Colormap colormap, Gdk.Bitmap mask, out Gdk.Color transparent_color, string filename);
public static weak Gdk.Pixmap colormap_create_from_xpm_d (Gdk.Drawable drawable, Gdk.Colormap colormap, Gdk.Bitmap mask, out Gdk.Color transparent_color, string data);
public static weak Gdk.Pixmap create_from_data (Gdk.Drawable drawable, string data, int width, int height, int depth, out Gdk.Color fg, out Gdk.Color bg);
......@@ -1627,7 +1627,7 @@ namespace Gdk {
}
[CCode (cheader_filename = "gdk/gdk.h")]
public class Cairo {
public static weak Cairo.Context create (Gdk.Drawable drawable);
public static Cairo.Context create (Gdk.Drawable drawable);
public static void rectangle (Cairo.Context cr, out Gdk.Rectangle rectangle);
public static void region (Cairo.Context cr, Gdk.Region region);
public static void set_source_color (Cairo.Context cr, out Gdk.Color color);
......
Gdk cheader_filename="gdk/gdk.h"
GdkAtom is_value_type="1"
gdk_cairo_create transfer_ownership="1"
GdkColor is_value_type="1"
GdkCursor is_value_type="0"
gdk_pixbuf_new_from_xpm_data.data is_array="1"
......@@ -7,6 +8,7 @@ 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"
GdkPixmap base_class="GdkDrawable"
GdkRectangle is_value_type="1"
GdkWindowAttr is_value_type="1"
......@@ -543,6 +543,8 @@ public class Vala.GIdlParser : CodeVisitor {
private void parse_object (IdlNodeInterface! node, Namespace! ns, IdlModule! module) {
string name = fix_type_name (node.gtype_name, module);
string base_class = null;
var cl = ns.scope.lookup (name) as Class;
if (cl == null) {
cl = new Class (name, current_source_reference);
......@@ -554,6 +556,8 @@ public class Vala.GIdlParser : CodeVisitor {
var nv = attr.split ("=", 2);
if (nv[0] == "cheader_filename") {
cl.add_cheader_filename (eval (nv[1]));
} else if (nv[0] == "base_class") {
base_class = eval (nv[1]);
} else if (nv[0] == "hidden") {
if (eval (nv[1]) == "1") {
return;
......@@ -566,7 +570,11 @@ public class Vala.GIdlParser : CodeVisitor {
current_source_file.add_node (cl);
}
if (node.parent != null) {
if (base_class != null) {
var parent = new TypeReference ();
parse_type_string (parent, base_class);
cl.add_base_type (parent);
} else if (node.parent != null) {
var parent = new TypeReference ();
parse_type_string (parent, node.parent);
cl.add_base_type (parent);
......
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