From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: More enhancements to fringe bitmaps. Date: Wed, 11 Feb 2004 20:28:17 +0900 Organization: Faculty of Science, Chiba University Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1076501317 32137 80.91.224.253 (11 Feb 2004 12:08:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2004 12:08:37 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Feb 11 13:08:27 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AqtAI-0000gi-00 for ; Wed, 11 Feb 2004 13:08:26 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AqtAH-0008Lp-00 for ; Wed, 11 Feb 2004 13:08:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aqt5o-0003Wp-2S for emacs-devel@quimby.gnus.org; Wed, 11 Feb 2004 07:03:48 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aqt2S-0003HX-K2 for emacs-devel@gnu.org; Wed, 11 Feb 2004 07:00:20 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aqsqi-00025a-Qv for emacs-devel@gnu.org; Wed, 11 Feb 2004 06:48:44 -0500 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AqsXT-00008i-Hw for emacs-devel@gnu.org; Wed, 11 Feb 2004 06:28:19 -0500 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 8A44B1A637B; Wed, 11 Feb 2004 20:28:17 +0900 (JST) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19862 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19862 >>>>> On 11 Feb 2004 12:17:24 +0100, storm@cua.dk (Kim F. Storm) said: > Which probably makes it hard for me to reproduce -- but I'll look into it. > Is TARGET_API_MAC_CARBON defined in the setup that fails? Yes. This variable is defined in Carbon/Carbon.h. Maybe I will look some redisplay-related variables/structures with a debugger to see what's happening. > So the following #ifdef (in fringe.c) shouldn't mention MAC_OS then? Exactly. But then the image support patches have to be modified so as to disable bit-swapping in them. > I do see an explicit 8->16 bit conversion for W32, but not on the > mac port. Do you mean this call? > mac_create_bitmap_from_bitmap_data (&bitmap, bits, p->wd, p->h); Yes. And this is the very function that does bit-swapping in the image support patches. It is also used for converting from xbm data (LSB first, each row is byte aligned) to mac-native bitmap data (MSB first, each row is word aligned). > Supposing that fb->bits was word aligned and 16 bits per row, what > would the code for drawing the bitmap look like then? Just like the following: Functions mac_create_bitmap_from_bitmap_data and mac_free_bitmap are no longer used for drawing fringe bitmaps. The function mac_draw_bitmap additionally takes width and height as arguments. static void mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) Display *display; WindowPtr w; GC gc; int x, y, width, height; unsigned char *bits; int overlay_p; { BitMap bitmap; Rect r; bitmap.rowBytes = (width + 15) / 16 * 2; /* must be on word boundary */ bitmap.baseAddr = bits; SetRect (&(bitmap.bounds), 0, 0, width, height); ... /* same as the original one, but change "bitmap" to "&bitmap" (and "bitmap->" to "bitmap.") */ } static void x_draw_fringe_bitmap (w, row, p) ... { ... if (p->which) { unsigned char *bits = p->bits + p->dh; gcv.foreground = (p->cursor_p ? (p->overlay_p ? face->background : f->output_data.mac->cursor_pixel) : face->foreground); gcv.background = face->background; mac_draw_bitmap (display, window, &gcv, p->x, p->y, p->wd, p->h, bits, p->overlay_p); } ... } YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp