From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: Re: [patch] add "underwave" face attribute Date: Fri, 3 Feb 2012 20:37:03 +0100 Message-ID: References: <037B3467A9FE4EC9B681DF3B1171A539@us.oracle.com> <87obtii1y4.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1328297837 16726 80.91.229.3 (3 Feb 2012 19:37:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Feb 2012 19:37:17 +0000 (UTC) Cc: Juri Linkov , Stefan Monnier , Drew Adams , emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 03 20:37:16 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RtOwd-0001ju-ET for ged-emacs-devel@m.gmane.org; Fri, 03 Feb 2012 20:37:16 +0100 Original-Received: from localhost ([::1]:43709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtOwZ-0004be-M9 for ged-emacs-devel@m.gmane.org; Fri, 03 Feb 2012 14:37:11 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtOwU-0004PW-T2 for emacs-devel@gnu.org; Fri, 03 Feb 2012 14:37:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtOwS-0004uz-HE for emacs-devel@gnu.org; Fri, 03 Feb 2012 14:37:06 -0500 Original-Received: from mail-tul01m020-f169.google.com ([209.85.214.169]:64071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtOwS-0004uR-Bz for emacs-devel@gnu.org; Fri, 03 Feb 2012 14:37:04 -0500 Original-Received: by obbta7 with SMTP id ta7so5936488obb.0 for ; Fri, 03 Feb 2012 11:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=v9SIZRFlGu1JhyOQYqDbmeO+ZP9JSgY2EbXAuJvEG+g=; b=GRWiXhheZtYG3jrsI4f6wo/NMPiEkLMzNifApm06FxCCFXFFBP9Dm2FJUPF1eLooes CdZhtPyI/g0BGVJRjSDMDCyrEvsaITP3l1UqIfEHN/uSNbnRn3vnXeiFr2wKsLGs61bd l09W2ccObiRENZnqmt34ri00+/HKfcOyMS60s= Original-Received: by 10.182.36.35 with SMTP id n3mr7725175obj.66.1328297823373; Fri, 03 Feb 2012 11:37:03 -0800 (PST) Original-Received: by 10.182.11.166 with HTTP; Fri, 3 Feb 2012 11:37:03 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: fjhTPFFOH20ucZDHZ7sxar3oC1o X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 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:148154 Archived-At: Time for some updates. I've fixed most of the bugs related to X11/Windows but I think I'll have to change the approach to underwave. Drawing chunk of waves (when width of the underwave < width of one wave) often ends up with (little) artifacts due to rounding problem. To have a perfect wave no matter the position or size I should clip the region of the underwave and only draw full waves, letting the clipping do the work. On X11, I know how to change the clipping region but I don't know how to restore it. The clipping region is stored in the GC but it *can't* be requested with XGetGCValues() [1]. I could just remove the clipping region altogether when I'm done it but I'm pretty sure this will have some side effects. I've asked about it on stackoverflow[2] but I haven't got any satisfying answer yet. On Windows, I've looked at the GDI documentation[3] (which is what w32term.c currently use) on MSDN and it looks doable. On Mac OSX, I still don't know if my patch compile/works (could someone please report back?). I haven't looked at the clipping stuff either. I was hoping someone who actually knows what he's doing in Objective C/COCOA could help me. 1: http://tronche.com/gui/x/xlib/GC/XGetGCValues.html 2: http://stackoverflow.com/questions/9037676/how-can-i-limit-the-surface-in-which-xlib-graphics-primitives-draw 3: http://msdn.microsoft.com/en-us/library/dd145203%28v=vs.85%29.aspx