unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How to make a new pseudovector type?
@ 2011-07-15 10:31 joakim
  2011-07-18 13:46 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: joakim @ 2011-07-15 10:31 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-18 14:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-15 10:31 How to make a new pseudovector type? joakim
2011-07-18 13:46 ` Stefan Monnier
2011-07-18 13:55   ` joakim
2011-07-18 14:19     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).