all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Can we use FRAME_RIF to return a Lisp_Object result?
Date: Tue, 31 Oct 2017 11:44:02 -0700	[thread overview]
Message-ID: <m2r2tjqhsd.wl%esq@lawlist.com> (raw)

As part of the multiple fake cursors (22873) and crosshairs (17684) features that I am working on, I am obtaining the red / green / blue values for the buffer default background face by using platform specific functions within nsterm.m, xterm.c, and w32term.c.

I would like `FRAME_RIF (f)->calc_lsl_default_bg (w)` to return a Lisp_Object in the form of a vector consisting of 3 doubles.

All of the examples in redisplay_interface are void, which makes me think that a Lisp_Object result may not be supported.

I have been using window pointers to store the values for red, green and blue.  However, I would like to eliminate the need to use those window pointers in favor of FRAME_RIF returning a Lisp_Object result.  Is this okay to do, or is there a more appropriate way to get the result of those platform specific functions?


/* window.h */
/* Suffixes for the `mc` window pointer prefix. */
struct multiple_cursors
{
  * * *

  /* Values for the background color that are used to erase a glyphless cursor. */
  double bg_red, bg_green, bg_blue;

  * * *
};


/* nsterm.m */
static void
ns_calc_lsl_default_bg (struct window *w)
{
  struct frame *f = XFRAME (WINDOW_FRAME (w));
  /* The default face, possibly remapped. */
  struct face *default_face = FACE_FROM_ID (f, lookup_basic_face (f, DEFAULT_FACE_ID));
  NSColor *background_color = ns_lookup_indexed_color (default_face->background, f);
  EmacsCGFloat red, green, blue;
  * * *
  w->mc.bg_red = red;
  w->mc.bg_green = green;
  w->mc.bg_blue = blue;
  * * *
}


/* dispextern.h */

struct redisplay_interface
{
  /* Handlers for setting frame parameters.  */
  frame_parm_handler *frame_parm_handlers;

  * * * 

  void (*calc_lsl_default_bg) (struct window *w);

  * * *
};

Thanks,

Keith



             reply	other threads:[~2017-10-31 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 18:44 Keith David Bershatsky [this message]
2017-10-31 19:38 ` Can we use FRAME_RIF to return a Lisp_Object result? Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2017-10-31 19:59 Keith David Bershatsky
2017-10-31 20:19 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=m2r2tjqhsd.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.