From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: How to make a new pseudovector type? Date: Fri, 15 Jul 2011 12:31:07 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310725913 22761 80.91.229.12 (15 Jul 2011 10:31:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2011 10:31:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 15 12:31:46 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QhfgO-0006fb-Tc for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2011 12:31:45 +0200 Original-Received: from localhost ([::1]:34148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhfgN-00035V-J7 for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2011 06:31:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhfg0-00034Z-5y for emacs-devel@gnu.org; Fri, 15 Jul 2011 06:31:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qhffy-0005j1-Us for emacs-devel@gnu.org; Fri, 15 Jul 2011 06:31:19 -0400 Original-Received: from m1.alltele.net ([85.30.0.4]:55472 helo=smtp.alltele.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhffy-0005iL-Ai for emacs-devel@gnu.org; Fri, 15 Jul 2011 06:31:18 -0400 Original-Received: from localhost.localdomain ([87.96.210.139]) by smtp.alltele.net (IceWarp 10.3.1 RC1) with ESMTP id YRU02008 for ; Fri, 15 Jul 2011 12:31:08 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-CTCH: RefID="str=0001.0A0B0204.4E2016EC.01F5,ss=1,re=0.000,fgs=0"; Spam="Unknown"; VOD="Unknown" X-detected-operating-system: by eggs.gnu.org: Windows XP/2000 (RFC1323+, w+, tstamp-) X-Received-From: 85.30.0.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142026 Archived-At: 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