summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@gtk.org>1998-06-13 15:51:34 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-06-13 15:51:34 +0000
commite17f31db8f295f229a992fcd45912d3ef2b08b57 (patch)
treead9fee68f26c349be64a5b7656c2559c83ff08c9
parent2e5dda7c62a5c55481e1f26c4426926283583879 (diff)
downloadgtk+-e17f31db8f295f229a992fcd45912d3ef2b08b57.tar.gz
Patch from Tom Bech <tomb@ii.uib.no>, to handle color specs of the form c
Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkpixmap.c (gdk_pixmap_extract_color): Patch from Tom Bech <tomb@ii.uib.no>, to handle color specs of the form c #abcdef [ more keys ] properly.
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-2-06
-rw-r--r--ChangeLog.pre-2-106
-rw-r--r--ChangeLog.pre-2-26
-rw-r--r--ChangeLog.pre-2-46
-rw-r--r--ChangeLog.pre-2-66
-rw-r--r--ChangeLog.pre-2-86
-rw-r--r--gdk/gdkpixmap.c13
-rw-r--r--gdk/x11/gdkpixmap-x11.c13
9 files changed, 66 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 27da5da24c..567b193529 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 27da5da24c..567b193529 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 27da5da24c..567b193529 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 27da5da24c..567b193529 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 27da5da24c..567b193529 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 27da5da24c..567b193529 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 27da5da24c..567b193529 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gdk/gdkpixmap.c (gdk_pixmap_extract_color):
+ Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+ specs of the form c #abcdef [ more keys ] properly.
+
Sat Jun 13 10:51:56 1998 Stefan Jeske <stefan@gtk.org>
* gtkspinbutton.h gtkspinbutton.c testgtk.c
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index 7ba8727885..799bd8d462 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -340,7 +340,18 @@ gdk_pixmap_extract_color (gchar *buffer)
return NULL;
else if (ptr[0] == '#')
{
- retcol = g_strdup (ptr);
+ counter = 1;
+ while (ptr[counter] != 0 &&
+ ((ptr[counter] >= '0' && ptr[counter] <= '9') ||
+ (ptr[counter] >= 'a' && ptr[counter] <= 'f') ||
+ (ptr[counter] >= 'A' && ptr[counter] <= 'F')))
+ counter++;
+
+ retcol = g_new (gchar, counter+1);
+ strncpy (retcol, ptr, counter);
+
+ retcol[counter] = 0;
+
return retcol;
}
diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c
index 7ba8727885..799bd8d462 100644
--- a/gdk/x11/gdkpixmap-x11.c
+++ b/gdk/x11/gdkpixmap-x11.c
@@ -340,7 +340,18 @@ gdk_pixmap_extract_color (gchar *buffer)
return NULL;
else if (ptr[0] == '#')
{
- retcol = g_strdup (ptr);
+ counter = 1;
+ while (ptr[counter] != 0 &&
+ ((ptr[counter] >= '0' && ptr[counter] <= '9') ||
+ (ptr[counter] >= 'a' && ptr[counter] <= 'f') ||
+ (ptr[counter] >= 'A' && ptr[counter] <= 'F')))
+ counter++;
+
+ retcol = g_new (gchar, counter+1);
+ strncpy (retcol, ptr, counter);
+
+ retcol[counter] = 0;
+
return retcol;
}