public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: guile-gtk@sources.redhat.com
Subject: gdk-color-change params (was: Completed RGB functionality)
Date: Sun, 15 Jun 2003 00:11:00 -0000	[thread overview]
Message-ID: <87u1asw67p.fsf_-_@zip.com.au> (raw)
In-Reply-To: <87bry3iznh.fsf@zip.com.au> (Kevin Ryde's message of "Fri, 16 May 2003 09:00:18 +1000")

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

I wrote:
>
> Another thing field setters would do is mean that gdk-color-change can
> take the same parameters as the C gdk_color_change, ie. a GdkColor
> containing a pixel value.  Unnecessary variations between the C and
> Scheme functions are not good.

I propose to make this change,

        * gdk-1.2.defs (gdk_color_change): Remove separate pixel parameter,
        take scheme-level parameters the same as the C function.
        * gdk-support.c (gdk_color_change_interp): Remove.

Whether a GdkColor structure is a particularly good way to pass
pixel+r+g+b is a matter for debate, personally I think it's sensible
enough in the context of colormap tricks.  Either way if there's a
burning need for some other interface then it should be under a new
name to avoid any possible confusion.


[-- Attachment #2: gdk-1.2.defs.color-change.diff --]
[-- Type: text/plain, Size: 618 bytes --]

--- gdk-1.2.defs.~1.32.~	2003-06-15 09:28:33.000000000 +1000
+++ gdk-1.2.defs	2003-06-15 09:59:06.000000000 +1000
@@ -1413,14 +1413,9 @@
   (GdkColor (copy #f))
   ((string spec)))
 
-(define-func gdk_color_change_interp
+(define-func gdk_color_change
   bool
   ((GdkColormap colormap)
-   ; The cmap_index is not there in gdk_color_change; gdk_color_change
-   ; adopts the ugly XStoreColor hack that stores the index in the pixel
-   ; value of the color. We ignore the pixel value and devote a whole
-   ; parameter for the worthy cause.
-   (int cmap_index)
    (GdkColor color)))
 
 (define-func gdk_color_equal

[-- Attachment #3: gdk-support.c.color-change.diff --]
[-- Type: text/plain, Size: 493 bytes --]

--- gdk-support.c.~1.22.~	2003-06-15 09:31:25.000000000 +1000
+++ gdk-support.c	2003-06-15 10:01:46.000000000 +1000
@@ -1406,16 +1406,6 @@
   return gdk_color_black (colormap, &color) ? gdk_color_copy (&color) : NULL;
 }
 
-int
-gdk_color_change_interp (GdkColormap *colormap, gint cmap_index,
-			 GdkColor *color)
-{
-  GdkColor _color;
-  _color = *color;
-  _color.pixel = cmap_index;
-  return gdk_color_change (colormap, &_color);
-}
-
 guint
 gdk_color_hash_interp (GdkColor *color)
 {

  parent reply	other threads:[~2003-06-15  0:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-07  4:22 Completed RGB functionality Marko Rauhamaa
2003-05-15 23:00 ` Kevin Ryde
2003-05-16  5:42   ` Marko Rauhamaa
2003-06-14 23:46   ` GdkColor field setters (was: Completed RGB functionality) Kevin Ryde
2003-06-15  0:11   ` Kevin Ryde [this message]
2003-06-15  2:38     ` gdk-color-change params " Marko Rauhamaa
2003-08-09  0:47   ` gdk-color-new " Kevin Ryde

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=87u1asw67p.fsf_-_@zip.com.au \
    --to=user42@zip.com.au \
    --cc=guile-gtk@sources.redhat.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.
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).