all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: joakim@verona.se
To: emacs-devel@gnu.org
Subject: How to make a new pseudovector type?
Date: Fri, 15 Jul 2011 12:31:07 +0200	[thread overview]
Message-ID: <m362n36djo.fsf@verona.se> (raw)

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	other threads:[~2011-07-15 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 10:31 joakim [this message]
2011-07-18 13:46 ` How to make a new pseudovector type? Stefan Monnier
2011-07-18 13:55   ` joakim
2011-07-18 14:19     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m362n36djo.fsf@verona.se \
    --to=joakim@verona.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.