unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: emacs-devel@gnu.org
Subject: Re: More enhancements to fringe bitmaps.
Date: Wed, 11 Feb 2004 20:28:17 +0900	[thread overview]
Message-ID: <wl4qtxam9a.wl@church.math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <m3vfmdg917.fsf@kfs-l.imdomain.dk>

>>>>> 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-><fieldname>" to "bitmap.<fieldname>") */
}


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

  reply	other threads:[~2004-02-11 11:28 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09  1:01 More enhancements to fringe bitmaps Kim F. Storm
2004-02-09  2:48 ` YAMAMOTO Mitsuharu
2004-02-09 14:54   ` Kim F. Storm
2004-02-09 14:27     ` Jason Rumney
2004-02-09 20:09       ` Harald Maier
2004-02-11  2:54     ` YAMAMOTO Mitsuharu
2004-02-11 11:17       ` Kim F. Storm
2004-02-11 11:28         ` YAMAMOTO Mitsuharu [this message]
2004-02-11 14:03           ` Stefan Monnier
2004-02-12  0:58             ` YAMAMOTO Mitsuharu
2004-02-14  0:39           ` Kim F. Storm
2004-02-14  8:08             ` Harald Maier
2004-02-14 15:31             ` YAMAMOTO Mitsuharu
2004-02-15 17:19               ` Kim F. Storm
2004-02-16 10:22       ` YAMAMOTO Mitsuharu
2004-02-16 13:22         ` Kim F. Storm
2004-02-17  3:13           ` YAMAMOTO Mitsuharu
2004-02-17 22:41             ` Kim F. Storm
2004-02-18  2:32               ` YAMAMOTO Mitsuharu
2004-02-18 22:04                 ` Kim F. Storm
2004-02-19  4:28                   ` YAMAMOTO Mitsuharu
2004-02-19  8:38                     ` Jason Rumney
2004-02-19  9:52                     ` Kim F. Storm
2004-02-09  8:54 ` Masatake YAMATO
2004-02-09 16:49   ` Kim F. Storm
2004-02-10  1:28     ` Johan Bockgård
2004-02-14  0:58       ` Kim F. Storm
2004-02-09 15:02 ` Matt Hodges
2004-02-14  0:46   ` Kim F. Storm
2004-02-09 19:54 ` Tak Ota
2004-02-09 20:37   ` Tak Ota
2004-03-08 13:48 ` Marco Munari 16447.64651
2004-03-08 23:52   ` Kim F. Storm
2004-03-11 15:27     ` Miles Bader
2004-03-17 13:59       ` Marco Munari
2004-03-11 17:06     ` Marco Munari 16464.32679
2004-03-11  0:22 ` Marco Munari 16447.64651
2004-03-17  3:56   ` Miles Bader
2004-03-18  5:08     ` Marc Munari 16473.4929
2004-03-18 13:27       ` Kim F. Storm
2004-03-18 19:05         ` Marco Munari 16473.54072
2004-03-18 23:43           ` Kim F. Storm
2004-03-19  3:44             ` Marco Munari
2004-03-19 14:04               ` Kim F. Storm
2004-03-21  3:27                 ` Marco Munari
2004-03-22 10:59                   ` Kim F. Storm
2004-03-23  2:27                     ` Marco Munari 16479.36044
  -- strict thread matches above, loose matches on Subject: below --
2004-02-11 23:41 Nick Roberts
2004-02-12  1:18 ` Miles Bader
2004-02-12 11:55   ` Kim F. Storm
2004-02-12 12:32     ` Miles Bader
2004-02-13 17:34     ` Richard Stallman
2004-02-13 21:53       ` Kim F. Storm
2004-02-12 16:42   ` Nick Roberts
2004-02-12 20:55     ` Miles Bader
2004-02-12 12:07 ` Kim F. Storm
2004-02-12 16:59   ` Nick Roberts
2004-02-12 23:35     ` Kim F. Storm
2004-02-13 19:25       ` Nick Roberts

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=wl4qtxam9a.wl@church.math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --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 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).