From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel Subject: Re: Removing the usage of X structures (or their names) in independent code Date: Fri, 10 May 2019 23:45:51 -0600 Message-ID: <87d0kpilww.fsf@gmail.com> References: <875zqkdzfc.fsf@gmail.com> <83d0ksgo1h.fsf@gnu.org> <87woizd263.fsf@gmail.com> <8336lnh7rw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="220574"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 11 07:46:30 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hPKq6-000vGu-HL for ged-emacs-devel@m.gmane.org; Sat, 11 May 2019 07:46:30 +0200 Original-Received: from localhost ([127.0.0.1]:54674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPKq5-0002gj-ES for ged-emacs-devel@m.gmane.org; Sat, 11 May 2019 01:46:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPKpU-0002gM-E3 for emacs-devel@gnu.org; Sat, 11 May 2019 01:45:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPKpT-0004wk-6j for emacs-devel@gnu.org; Sat, 11 May 2019 01:45:52 -0400 Original-Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:37471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPKpS-0004vw-T2; Sat, 11 May 2019 01:45:51 -0400 Original-Received: by mail-pl1-x631.google.com with SMTP id p15so3787018pll.4; Fri, 10 May 2019 22:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ipC2zbSt23s0C+ZVs0Ajk2fJeiZ1s8MGpp0AjN8HiLs=; b=DuNJTzuRJJgEefAEc7MR1IzL08LKxp0Xv6zSOXLGj6FSO0ktexxdzv5AFY5Kj0sVtM dk1yJtiMtcxP+7aX+Ha5Ue3DDt7I4G/0BfPsaEuWJUEnXwOR1tYlj4dJppxwkBuLFROL Jim3Nm0qtVeK14R71aFxF3H3wt8wHx10fjvhXCgt1VxA10/UpaoFz8zwIvZnV+f61AQ3 UD67hwLQrDRjpmL5HwT1bkVUL/9e+Xjzu6nm1gc81nFnkSfV69KnWCZNjZUVDFC7Z2J/ e+U/cBOr8PyRTfWpDVOrYU1Ru7QChfrRIB7eSoRv8m0Sx3VoDHp8UPSlzJpJeqRY4f6y ZZYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ipC2zbSt23s0C+ZVs0Ajk2fJeiZ1s8MGpp0AjN8HiLs=; b=YWFpZi5dPPo0HE8Uzl0lBaajK+JOuW0p9JJvfWEaOXCoGh4W/ULckwyxpevDAnx59R P67IvPzY1zVw+G3R+bg100+UzdIZAczPgUj50hhlGX0oxy6/uKIZZM+RP0p52cUlOD6c vNLoi1B5d5b0Hu1WeU6trmWbU2qim071xnzzDebA7jGP78yhIHOyXN9Q5j4lxCZOW9CK f63lk1rkaUd8lQA88MKJmY2PU9hrRYEOtLxj4MLbmapY1hGqLq+DnTy/gr2ezbh4WcuN cgKFnFeOtIh+dWh2/pob6OBhtCfqTCg/ChDmUkaH9D544UfeAA4fM3VMUMVV/Pmo6axz 6w2g== X-Gm-Message-State: APjAAAXzW6Zq+rV93edZs8jQmz7hat2RTFy6C1nan3UrxppfUabaaqGz lMheBXIeUYyaVCwTqL+UkOI/P6Zb X-Google-Smtp-Source: APXvYqxXPldJLhXFA0TeYTEBGqkKtXzq2Y0xotYQZ3BJyt3Sx9KqwGysviEF868F2606vnY/MhtzlA== X-Received: by 2002:a17:902:8c8c:: with SMTP id t12mr17964626plo.116.1557553549134; Fri, 10 May 2019 22:45:49 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id p5sm14900065pgs.32.2019.05.10.22.45.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 May 2019 22:45:48 -0700 (PDT) In-Reply-To: <8336lnh7rw.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 09 May 2019 20:12:03 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::631 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236403 Archived-At: Eli Zaretskii writes: > But that's not needed if you use typedef as above for X. And for > non-X platforms we already have a definition of XColor, which just > needs to be renamed to EColor. I meant if one were to use a non-XColor-like struct even in the X case, but there's no reason for that now. >> > For more complex situations, see what we do with 'struct font' and >> > 'struct FOOfont' for font backend FOO. >> >> Could you point me to somewhere specific for this? I'm unsure to what >> you're referring. > > For example, in ftfont.h: > [..] Thanks, that's good to know for the future. I posted a patch series to the scratch/X_Typedefs branch. WDYT? The first few patches are straightforward, but the XChar2b patch is a bit more involved. Regarding the last patch, I don't like the names Emacs_Pix_Container (XImagePtr) and Emacs_Pix_Context (XImagePtr_or_DC), but I'm lost as to better names. AFAIU XImage is a client-side structure holding bitmap/pixmap data[1]. My first thought was "Emacs_Pixmap_Container", but that would be easily confused for a container for Emacs_Pixmap. At least the abbreviation dissociates the two structures a bit. [1] https://tronche.com/gui/x/xlib/graphics/images.html