emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to make a new pseudovector type?


From: joakim
Subject: How to make a new pseudovector type?
Date: Fri, 15 Jul 2011 12:31:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

In the xwidget branch I use   PVEC_OTHER = 0x400000 from enum pvec_type
to represent an xwidget. It works, except the print loop doesnt like to
print PVEC_OTHER(at least I think thats what happening)

So, anyway.  pvec_type has 14 entires which are all occupied.
PVEC_TYPE_MASK = 0x7ffe00. 1 bit per type. Should I expand this for a
new type? Do I need a new type or is PVEC_OHER enough but I have missed
something? Is pseudovectors the thing I should actually use if I want
lisp to allocate a structure with mixed c and lisp?

I need 2 new types currently, struct xwidget for the model and struct
xwidget_view for the views. BTW I find it remarkable that 14 types are
sufficient. So theres something I maybe dont understand here.

For reference here is the declaration I use:

struct xwidget{
  struct vectorlike_header header;  
  Lisp_Object plist;//auxilliary data
  Lisp_Object type;//the widget type
  Lisp_Object buffer; //buffer where xwidget lives
  Lisp_Object title;//a title that is used for button labels for instance
  
  //here ends the lisp part.
  //"height" is the marker field
  int height;
  int width;

  //for offscreen widgets, unused if not osr
  GtkWidget* widget_osr;
  GtkContainer* widgetwindow_osr;
};

Heres the other one:

//struct for each xwidget view
struct xwidget_view{
  struct vectorlike_header header;
  struct xwidget* model;

  
  //here ends the lisp part.
  //"redisplayed" is the marker field
  int redisplayed; //if touched by redisplay  
  struct window *w; //TODO should be lisp
  int hidden;//if the "live" instance isnt drawn
  int initialized;  
  GtkWidget* widget;
  GtkContainer* widgetwindow;
  GtkContainer* emacswindow;
  int x; int y;
  int clip_right; int clip_bottom; int clip_top; int clip_left;
  long handler_id;
};




-- 
Joakim Verona



reply via email to

[Prev in Thread] Current Thread [Next in Thread]