From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Stipples support in MS-Windows port Date: Sat, 11 May 2024 11:24:04 +0300 Message-ID: <86r0e83gez.fsf@gnu.org> References: <87a5l49a53.fsf@yahoo.com> <87seyw7udp.fsf@yahoo.com> <87wmo0zzni.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eg642616@gmail.com, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 11 10:25:05 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s5i2R-0007Qy-Vo for ged-emacs-devel@m.gmane-mx.org; Sat, 11 May 2024 10:25:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5i1g-0007Jz-PQ; Sat, 11 May 2024 04:24:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5i1Z-0007JR-RU for emacs-devel@gnu.org; Sat, 11 May 2024 04:24:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5i1X-0003lP-NW; Sat, 11 May 2024 04:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ZmDUFtT+LHbF88Gg8EAl2XXKo90+Am6trNZzkzeeEPM=; b=B8vCVE1ABcPAP4Cm+140 Lb5DD1p9INX/Z4Mr/Ed/FeL9vT4tvtLN0Ulzd1DP9ukMN8XwiiBGed/+FJmV5/J895BSYqo14Vc/0 wfFeaie5PE5nVGAP4lF0Rec5q5dh9Ry5xW0SM1l0Buio/4EJ1wzlKEhl2s8bGecNOuSsjoEu1Ct2T 8b925u7t9rN/wtuonnasQxGRCS1cS+KyEj55QhOrBXFXJa5vCOTGIkW/JNy5wOlwXEV+W0ESkwm5K QdpVxFl9gt2Kv5sOnu7/72ylyv+wKgzi4kj0qAOYNFFOrYiDTDI9DgBeW9xfGa9TypxKuiReyDTwj z3RE+lk/1JnrvQ==; In-Reply-To: <87wmo0zzni.fsf@yahoo.com> (message from Po Lu on Sat, 11 May 2024 13:27:29 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319160 Archived-At: > From: Po Lu > Cc: "Ergus via Emacs development discussions." > Date: Sat, 11 May 2024 13:27:29 +0800 > > Elijah G writes: > > > El sáb., 4 de mayo de 2024 10:30 p. m., Po Lu escribió: > > > > Po Lu writes: > > > > > On Android, for instance, the relevant code exists in two functions > > > defined in EmacsGC.java, prepareStipple and blitOpaqueStipple, which are > > > nothing akin to the X implementation it emulates. The same is true of > > > haikuterm.c, haiku_draw_stipple_background, and BView_DrawBitmapTiled in > > > haiku_draw_support.cc. > > > > Perhaps "pattern brushes" are the tool for the job? > > > > https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createpatternbrush > > > > After some tests, i could execute the snippet sent in this thread without crashes with something similar to a stipple (sadly i cannot send the patch, > > i'm not in my computer), i tried using CreatePatternBrush, however it needs the bitmap as a HBITMAP variable type, i've found some examples in > > the same file (w32term.c) such as fringe bitmap that uses a HBITMAP var. > > I would like to know any idea for make stipple bitmap as a HBITMAP (I'm not sure if i should make it using CreateBitmap). > > Also i would like to know if its a good idea remove XSetFillStyle from w32_draw_glyph_string_background > > (https://git.savannah.gnu.org/cgit/emacs.git/tree/src/w32term.c#n1271), AFAIK it is only for set the fill-style which i dont think it's necessary since > > i'm implementing the stipple fill-style inside a XFillRectangle implementation which i'm working. > > > > Thanks > > I think Eli is better qualified to answer this. That fragment is there only to show what xterm.c does for this, so that the w32 code would follow the same paradigm. If you are implementing the w32 code for doing that, the X-related code can be removed.