unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Elijah G <eg642616@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: Stipples support in MS-Windows port
Date: Sat, 4 May 2024 21:43:51 -0600	[thread overview]
Message-ID: <CACnP4N+_x6QmYKomKsO83d2E-5eB_6QBOidTm+M891PuSS8P+g@mail.gmail.com> (raw)
In-Reply-To: <s5434qztkr3.fsf@yahoo.com>


[-- Attachment #1.1: Type: text/plain, Size: 3450 bytes --]

On Fri, May 3, 2024 at 1:30 AM Po Lu <luangruo@yahoo.com> wrote:
> > The closest thing i got was using w32_draw_rectangle
> > inside w32_draw_glyph_string_background
> > but for some reason it freezes and crashes after evaling
> > the snippet, I'm not sure if it is related to the way I did it or is
> > anything related to GC.
>
> You appear to fundamentally misunderstand the nature of stipples and
> which component bears the burden of its implementation.  A stipple
> pattern is a repeating bitmap pattern that replaces the solid background
> color of a face, in which pattern "on" pixels are tinted the foreground
> color of the face, and off pixels the background, and whose repetition
> is such that its tiles (instances of its bitmap) extend from a
> conceptual "origin" defined by the position of the drawable.  In X,
> stipples are natively supported by graphics primitives, being simply
> properties of the GC (graphics context), to wit, the fill style, the
> stipple bitmap, and the tile/stipple origin offset, which three
> properties are direct determinants of the imagery produced by
> polygon-filling or stroking operations, and are configured some time
> before x_draw_glyph_string_background is invoked, relieving the latter
> of all responsibility, with respect to stipples, but enabling the
> prepared stipple pattern when appropriate.  This is the reason that the
> disabled code in the related W32 function is no more than a few calls to
> XDrawRectangle, but as the supporting infrastructure, both in Emacs and
> the display server, is not present on MS Windows, enabling just this
> code, even if it does not crash, serves little purpose.

Thank you for explain me, I was a little confused in how stipples works.

> Your task is not to uncomment this handful of lines, but to establish
> how best to express these X concepts in terms of primitives available on
> MS Windows, and implement them in a manner appropriate for _Windows_,
> without regard to the specifics of the X implementation.

Thanks, as far as i understood then should not i touch or even edit those
lines?
I was thinking in define them (since them are only available in X) inside
the same file, similar in how pgtkterm.c or androidterm.c does, i think i
should check again `image_create_bitmap_from_data' and
`prepare_face_for_display' definitions.

> > Below this mail can you get the patch for test it
> > (Also i'm sorry if the patch is too long i accidentally
> > formatted it with clang-format)
>
> I suggest reverting the portions of the patch that are the work of
> clang-format, as we cannot accept such drastic whitespace changes, and
> the substantive changes simply vanish in their midst.

Thank you, i've reverted the changes done by clang-format, reviewing the
test that i made i got notice it works a bit similar to `box' property and
not to a stipple, but anyways i'm sending it here if it can be useful.

> > Also can i ask what is the purpose of this line?
> > ```
> > # include "bitmaps/gray.xbm"
> > ```
>
> It includes the bitmap image, bitmap/gray.xbm, which is a C header
> defining an array and several parameters.  This is not relevant on
> Windows.

Thank you for the help, I wasn't familiar with X.org stuffs (since I'm in
Windows and most of them are not available) and with C (specially in a big
project such as emacs).
But I have faith that I can help in this.

[-- Attachment #1.2: Type: text/html, Size: 4181 bytes --]

[-- Attachment #2: 0001-Test-stipples-in-W32.patch --]
[-- Type: application/x-patch, Size: 1480 bytes --]

  reply	other threads:[~2024-05-05  3:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  2:53 Stipples support in MS-Windows port Elijah G
2024-05-03  6:09 ` Eli Zaretskii
2024-05-03  7:30 ` Po Lu
2024-05-05  3:43   ` Elijah G [this message]
2024-05-05  4:04     ` Po Lu
2024-05-05  4:30       ` Po Lu
2024-05-06  5:17         ` Elijah G
2024-05-11  5:10         ` Elijah G
2024-05-11  5:27           ` Po Lu
2024-05-11  8:24             ` Eli Zaretskii
2024-05-12 23:06               ` Elijah G.
2024-05-14  4:07                 ` Elijah G.
2024-05-14  5:28                   ` Po Lu
2024-05-15  1:43                     ` Elijah G.
2024-05-19 22:37                     ` Elijah G.
2024-05-20 11:15                       ` Eli Zaretskii
2024-05-20 11:19                         ` Po Lu
2024-05-20 12:32                           ` Eli Zaretskii
2024-05-20 13:12                             ` Po Lu
2024-05-20 19:44                         ` Elijah G.
2024-05-21  2:00                           ` Elijah G.
2024-05-21 11:49                             ` Eli Zaretskii
2024-05-22  2:06                               ` Elijah G.
2024-05-24  1:55                                 ` Elijah G.
2024-05-24  6:24                                   ` Po Lu
2024-05-25  7:24                                 ` Eli Zaretskii
2024-05-25 11:30                                   ` Arash Esbati
2024-05-26  2:37                                     ` Po Lu
2024-05-27 15:32                                       ` Arash Esbati
2024-05-26  0:27                                   ` Elijah G.
2024-05-26  8:09                                     ` Yuri Khan
2024-05-27  2:05                                       ` Elijah G.
2024-05-27  6:20                                         ` Yuri Khan
2024-05-28  2:06                                           ` Elijah G.
2024-05-26  8:51                                     ` Eli Zaretskii
2024-05-28  0:23                                       ` Elijah G.

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=CACnP4N+_x6QmYKomKsO83d2E-5eB_6QBOidTm+M891PuSS8P+g@mail.gmail.com \
    --to=eg642616@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /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).