RGB UI Diff done using -u
- From: "Gene Z. Ragan" <gzr eazel com>
- To: gnome-components-list gnome org
- Subject: RGB UI Diff done using -u
- Date: Mon, 27 Mar 2000 16:44:54 -0800
My aplogies to the list. Here is a proper diff done using -u.
Gene
? bonobo.patch
Index: configure.in
===================================================================
RCS file: /cvs/gnome/bonobo/configure.in,v
retrieving revision 1.65
diff -u -r1.65 configure.in
--- configure.in 2000/03/27 03:53:34 1.65
+++ configure.in 2000/03/28 00:41:22
@@ -84,10 +84,13 @@
AM_CONDITIONAL(OAF, test "x$enable_oaf" = "xyes")
+AM_PATH_GDK_PIXBUF(0.6.0, ,AC_MSG_ERROR([Need gdk-pixbuf!]))
+
+BONOBO_INCLUDEDIR="$BONOBO_INCLUDEDIR `$GNOME_CONFIG --cflags gnomeui
gdk_pixbuf $GNORBA_LIBNAME` $OAF_CFLAGS"
+BONOBO_LIBS="-lbonobo `$GNOME_CONFIG --libs gnomeui gdk_pixbuf
$GNORBA_LIBNAME` $OAF_LIBS"
+
BONOBO_LIBDIR='-L${libdir}'
BONOBO_INCLUDEDIR='-I${includedir}'
-BONOBO_INCLUDEDIR="$BONOBO_INCLUDEDIR `$GNOME_CONFIG --cflags gnomeui
$GNORBA_LIBNAME` $OAF_CFLAGS"
-BONOBO_LIBS="-lbonobo `$GNOME_CONFIG --libs gnomeui $GNORBA_LIBNAME`
$OAF_LIBS"
AC_SUBST(BONOBO_LIBDIR)
AC_SUBST(BONOBO_INCLUDEDIR)
Index: bonobo/Makefile.am
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/Makefile.am,v
retrieving revision 1.80
diff -u -r1.80 Makefile.am
--- bonobo/Makefile.am 2000/02/22 06:47:45 1.80
+++ bonobo/Makefile.am 2000/03/28 00:41:23
@@ -18,10 +18,13 @@
-I$(srcdir) -I$(top_srcdir) \
-I$(top_builddir) \
-I$(includedir) \
- $(GNOME_INCLUDEDIR)
+ $(GNOME_INCLUDEDIR) \
+ $(GDK_PIXBUF_CFLAGS)
+
gnome_libs = \
$(GNOME_LIBDIR) \
+ $(GDK_PIXBUF_LIBS) \
$(GNOMEUI_LIBS) \
$(OBJECT_DIRECTORY_LIBS) \
$(INTLLIBS)
@@ -74,7 +77,7 @@
$(CORBA_SOURCE): $(idls)
$(ORBIT_IDL) $(top_srcdir)/idl/Bonobo.idl -I$(top_srcdir)/idl
$(idl_flags)
-libbonobo_la_LDFLAGS = -version-info 2:0:1 #-rpath $(libdir)
+libbonobo_la_LDFLAGS = -version-info 2:0:1 $(gnome_libs)
libbonobo_la_SOURCES = \
$(CORBA_SOURCE) \
Index: bonobo/bonobo-ui-handler.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-handler.c,v
retrieving revision 1.55
diff -u -r1.55 bonobo-ui-handler.c
--- bonobo/bonobo-ui-handler.c 2000/03/02 20:05:59 1.55
+++ bonobo/bonobo-ui-handler.c 2000/03/28 00:41:23
@@ -32,6 +32,7 @@
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-ui-handler.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
#include "bonobo-uih-private.h"
static BonoboObjectClass *bonobo_ui_handler_parent_class;
@@ -1177,12 +1178,31 @@
return (gpointer) dest;
}
+static gpointer
+bonobo_ui_handler_pixmap_rgb_copy_data (const gconstpointer src)
+{
+ GdkPixbuf *pixbuf, *copy_pixbuf;
+
+ /* Cast src data to GdkPixbuf */
+ pixbuf = (GdkPixbuf *)src;
+
+ /* Create a copy of the data */
+ copy_pixbuf = gdk_pixbuf_new_from_art_pixbuf
(pixbuf->art_pixbuf);
+
+
+ return (gpointer) copy_pixbuf;
+}
+
+
GtkWidget *
bonobo_ui_handler_toplevel_create_pixmap (GtkWidget
*window,
BonoboUIHandlerPixmapType
pixmap_type,
gpointer
pixmap_info)
{
- GtkWidget *pixmap;
+ GtkWidget *pixmap;
+ GdkPixbuf *pixbuf;
+ GdkPixmap *gdk_pixmap;
+ GdkBitmap *gdk_bitmap;
char *name;
pixmap = NULL;
@@ -1214,8 +1234,15 @@
break;
case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
- case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("Unsupported pixmap type (RGB[A]_DATA)\n");
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ /* Get pointer to GdkPixbuf */
+ pixbuf = (GdkPixbuf *)pixmap_info;
+
+ /* Get GdkPixmap and mask */
+ gdk_pixbuf_render_pixmap_and_mask (pixbuf, &gdk_pixmap,
&gdk_bitmap, 100);
+
+ /* Create GtkPixmap to return */
+ pixmap = gtk_pixmap_new (gdk_pixmap, gdk_bitmap);
break;
default:
@@ -1251,7 +1278,7 @@
case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("Unsupported pixmap type (RGB[A]_DATA)\n");
+ g_free(pixmap_info);
break;
default:
@@ -1276,6 +1303,10 @@
case BONOBO_UI_HANDLER_PIXMAP_XPM_DATA:
return bonobo_ui_handler_pixmap_xpm_copy_data
(pixmap_info);
+ case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ return bonobo_ui_handler_pixmap_rgb_copy_data
(pixmap_info);
+
default:
g_warning ("Unknown pixmap type: %d\n", pixmap_type);
return NULL;
@@ -1411,8 +1442,10 @@
bonobo_ui_handler_pixmap_data_to_corba (BonoboUIHandlerPixmapType type,
gpointer data)
{
Bonobo_UIHandler_iobuf *buffer;
- gpointer temp_xpm_buffer;
-
+ gpointer temp_xpm_buffer;
+ GdkPixbuf *pixbuf;
+ int height, stride;
+
buffer = Bonobo_UIHandler_iobuf__alloc ();
CORBA_sequence_set_release (buffer, TRUE);
@@ -1429,13 +1462,6 @@
strcpy (buffer->_buffer, (char *) data);
return buffer;
- case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
- case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("bonobo_ui_handler_pixmap_data_to_corba:
Pixmap type (RGB[A]) not yet supported!\n");
- buffer->_length = 1;
- buffer->_buffer = CORBA_sequence_CORBA_octet_allocbuf
(1);
- return buffer;
-
case BONOBO_UI_HANDLER_PIXMAP_XPM_DATA:
temp_xpm_buffer = bonobo_ui_handler_pixmap_xpm_flatten
(data, &(buffer->_length));
buffer->_buffer = CORBA_sequence_CORBA_octet_allocbuf
(buffer->_length);
@@ -1443,6 +1469,16 @@
g_free (temp_xpm_buffer);
return buffer;
+ case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ pixbuf = (GdkPixbuf *)data;
+ stride = gdk_pixbuf_get_rowstride (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+ buffer->_length = height * stride;
+ buffer->_buffer =
CORBA_sequence_Bonobo_Unknown_allocbuf(buffer->_length);
+ memcpy (buffer->_buffer, gdk_pixbuf_get_pixels (pixbuf),
buffer->_length);
+ return buffer;
+
default:
g_warning ("bonobo_ui_handler_pixmap_data_to_corba:
Unknown pixmap type [%d]\n", type);
buffer->_length = 1;
@@ -1470,14 +1506,15 @@
case BONOBO_UI_HANDLER_PIXMAP_STOCK:
return g_strdup (corba_pixmap_data->_buffer);
- case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
- case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("pixmap_corba_to_data: Pixmap type (RGB[A])
not yet supported!\n");
- return NULL;
-
case BONOBO_UI_HANDLER_PIXMAP_XPM_DATA:
pixmap_data = bonobo_ui_handler_pixmap_xpm_unflatten (
corba_pixmap_data->_buffer,
corba_pixmap_data->_length);
+ return pixmap_data;
+
+ case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ pixmap_data = g_malloc(corba_pixmap_data->_length);
+ memcpy(pixmap_data, corba_pixmap_data->_buffer,
corba_pixmap_data->_length);
return pixmap_data;
default:
Index: bonobo/bonobo-uih-menu.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-uih-menu.c,v
retrieving revision 1.3
diff -u -r1.3 bonobo-uih-menu.c
--- bonobo/bonobo-uih-menu.c 2000/03/08 00:28:23 1.3
+++ bonobo/bonobo-uih-menu.c 2000/03/28 00:41:24
@@ -724,6 +724,7 @@
{
GtkWidget *menu_widget;
MenuItemInternal *rg;
+ GtkWidget *pixmap;
switch (item->type) {
case BONOBO_UI_HANDLER_MENU_ITEM:
@@ -734,10 +735,9 @@
* a pixmap, create a GtkPixmapMenuItem.
*/
if (item->pixmap_data != NULL && item->pixmap_type !=
BONOBO_UI_HANDLER_PIXMAP_NONE) {
- GtkWidget *pixmap;
-
+
menu_widget = gtk_pixmap_menu_item_new ();
-
+
pixmap =
bonobo_ui_handler_toplevel_create_pixmap (GTK_WIDGET (menu_widget),
item->pixmap_type, item->pixmap_data);
if (pixmap != NULL) {
gtk_pixmap_menu_item_set_pixmap
(GTK_PIXMAP_MENU_ITEM (menu_widget),
Index: components/application-x-gnomine/Makefile.am
===================================================================
RCS file:
/cvs/gnome/bonobo/components/application-x-gnomine/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- components/application-x-gnomine/Makefile.am 2000/02/01
23:55:51 1.5
+++ components/application-x-gnomine/Makefile.am 2000/03/28
00:41:24
@@ -30,7 +30,8 @@
bonobo_application_x_mines_LDADD = \
$(GNOME_LIBDIR) \
$(top_builddir)/bonobo/libbonobo.la \
- $(GNOMEGNORBA_LIBS)
+ $(GNOMEGNORBA_LIBS) \
+ -lgdk_pixbuf
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = application-x-mines.gnorba
? bonobo.patch
Index: configure.in
===================================================================
RCS file: /cvs/gnome/bonobo/configure.in,v
retrieving revision 1.65
diff -u -r1.65 configure.in
--- configure.in 2000/03/27 03:53:34 1.65
+++ configure.in 2000/03/28 00:41:22
@@ -84,10 +84,13 @@
AM_CONDITIONAL(OAF, test "x$enable_oaf" = "xyes")
+AM_PATH_GDK_PIXBUF(0.6.0, ,AC_MSG_ERROR([Need gdk-pixbuf!]))
+
+BONOBO_INCLUDEDIR="$BONOBO_INCLUDEDIR `$GNOME_CONFIG --cflags gnomeui gdk_pixbuf $GNORBA_LIBNAME` $OAF_CFLAGS"
+BONOBO_LIBS="-lbonobo `$GNOME_CONFIG --libs gnomeui gdk_pixbuf $GNORBA_LIBNAME` $OAF_LIBS"
+
BONOBO_LIBDIR='-L${libdir}'
BONOBO_INCLUDEDIR='-I${includedir}'
-BONOBO_INCLUDEDIR="$BONOBO_INCLUDEDIR `$GNOME_CONFIG --cflags gnomeui $GNORBA_LIBNAME` $OAF_CFLAGS"
-BONOBO_LIBS="-lbonobo `$GNOME_CONFIG --libs gnomeui $GNORBA_LIBNAME` $OAF_LIBS"
AC_SUBST(BONOBO_LIBDIR)
AC_SUBST(BONOBO_INCLUDEDIR)
Index: bonobo/Makefile.am
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/Makefile.am,v
retrieving revision 1.80
diff -u -r1.80 Makefile.am
--- bonobo/Makefile.am 2000/02/22 06:47:45 1.80
+++ bonobo/Makefile.am 2000/03/28 00:41:23
@@ -18,10 +18,13 @@
-I$(srcdir) -I$(top_srcdir) \
-I$(top_builddir) \
-I$(includedir) \
- $(GNOME_INCLUDEDIR)
+ $(GNOME_INCLUDEDIR) \
+ $(GDK_PIXBUF_CFLAGS)
+
gnome_libs = \
$(GNOME_LIBDIR) \
+ $(GDK_PIXBUF_LIBS) \
$(GNOMEUI_LIBS) \
$(OBJECT_DIRECTORY_LIBS) \
$(INTLLIBS)
@@ -74,7 +77,7 @@
$(CORBA_SOURCE): $(idls)
$(ORBIT_IDL) $(top_srcdir)/idl/Bonobo.idl -I$(top_srcdir)/idl $(idl_flags)
-libbonobo_la_LDFLAGS = -version-info 2:0:1 #-rpath $(libdir)
+libbonobo_la_LDFLAGS = -version-info 2:0:1 $(gnome_libs)
libbonobo_la_SOURCES = \
$(CORBA_SOURCE) \
Index: bonobo/bonobo-ui-handler.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-handler.c,v
retrieving revision 1.55
diff -u -r1.55 bonobo-ui-handler.c
--- bonobo/bonobo-ui-handler.c 2000/03/02 20:05:59 1.55
+++ bonobo/bonobo-ui-handler.c 2000/03/28 00:41:23
@@ -32,6 +32,7 @@
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-ui-handler.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
#include "bonobo-uih-private.h"
static BonoboObjectClass *bonobo_ui_handler_parent_class;
@@ -1177,12 +1178,31 @@
return (gpointer) dest;
}
+static gpointer
+bonobo_ui_handler_pixmap_rgb_copy_data (const gconstpointer src)
+{
+ GdkPixbuf *pixbuf, *copy_pixbuf;
+
+ /* Cast src data to GdkPixbuf */
+ pixbuf = (GdkPixbuf *)src;
+
+ /* Create a copy of the data */
+ copy_pixbuf = gdk_pixbuf_new_from_art_pixbuf (pixbuf->art_pixbuf);
+
+
+ return (gpointer) copy_pixbuf;
+}
+
+
GtkWidget *
bonobo_ui_handler_toplevel_create_pixmap (GtkWidget *window,
BonoboUIHandlerPixmapType pixmap_type,
gpointer pixmap_info)
{
- GtkWidget *pixmap;
+ GtkWidget *pixmap;
+ GdkPixbuf *pixbuf;
+ GdkPixmap *gdk_pixmap;
+ GdkBitmap *gdk_bitmap;
char *name;
pixmap = NULL;
@@ -1214,8 +1234,15 @@
break;
case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
- case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("Unsupported pixmap type (RGB[A]_DATA)\n");
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ /* Get pointer to GdkPixbuf */
+ pixbuf = (GdkPixbuf *)pixmap_info;
+
+ /* Get GdkPixmap and mask */
+ gdk_pixbuf_render_pixmap_and_mask (pixbuf, &gdk_pixmap, &gdk_bitmap, 100);
+
+ /* Create GtkPixmap to return */
+ pixmap = gtk_pixmap_new (gdk_pixmap, gdk_bitmap);
break;
default:
@@ -1251,7 +1278,7 @@
case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("Unsupported pixmap type (RGB[A]_DATA)\n");
+ g_free(pixmap_info);
break;
default:
@@ -1276,6 +1303,10 @@
case BONOBO_UI_HANDLER_PIXMAP_XPM_DATA:
return bonobo_ui_handler_pixmap_xpm_copy_data (pixmap_info);
+ case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ return bonobo_ui_handler_pixmap_rgb_copy_data (pixmap_info);
+
default:
g_warning ("Unknown pixmap type: %d\n", pixmap_type);
return NULL;
@@ -1411,8 +1442,10 @@
bonobo_ui_handler_pixmap_data_to_corba (BonoboUIHandlerPixmapType type, gpointer data)
{
Bonobo_UIHandler_iobuf *buffer;
- gpointer temp_xpm_buffer;
-
+ gpointer temp_xpm_buffer;
+ GdkPixbuf *pixbuf;
+ int height, stride;
+
buffer = Bonobo_UIHandler_iobuf__alloc ();
CORBA_sequence_set_release (buffer, TRUE);
@@ -1429,13 +1462,6 @@
strcpy (buffer->_buffer, (char *) data);
return buffer;
- case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
- case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("bonobo_ui_handler_pixmap_data_to_corba: Pixmap type (RGB[A]) not yet supported!\n");
- buffer->_length = 1;
- buffer->_buffer = CORBA_sequence_CORBA_octet_allocbuf (1);
- return buffer;
-
case BONOBO_UI_HANDLER_PIXMAP_XPM_DATA:
temp_xpm_buffer = bonobo_ui_handler_pixmap_xpm_flatten (data, &(buffer->_length));
buffer->_buffer = CORBA_sequence_CORBA_octet_allocbuf (buffer->_length);
@@ -1443,6 +1469,16 @@
g_free (temp_xpm_buffer);
return buffer;
+ case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ pixbuf = (GdkPixbuf *)data;
+ stride = gdk_pixbuf_get_rowstride (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+ buffer->_length = height * stride;
+ buffer->_buffer = CORBA_sequence_Bonobo_Unknown_allocbuf(buffer->_length);
+ memcpy (buffer->_buffer, gdk_pixbuf_get_pixels (pixbuf), buffer->_length);
+ return buffer;
+
default:
g_warning ("bonobo_ui_handler_pixmap_data_to_corba: Unknown pixmap type [%d]\n", type);
buffer->_length = 1;
@@ -1470,14 +1506,15 @@
case BONOBO_UI_HANDLER_PIXMAP_STOCK:
return g_strdup (corba_pixmap_data->_buffer);
- case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
- case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
- g_warning ("pixmap_corba_to_data: Pixmap type (RGB[A]) not yet supported!\n");
- return NULL;
-
case BONOBO_UI_HANDLER_PIXMAP_XPM_DATA:
pixmap_data = bonobo_ui_handler_pixmap_xpm_unflatten (
corba_pixmap_data->_buffer, corba_pixmap_data->_length);
+ return pixmap_data;
+
+ case BONOBO_UI_HANDLER_PIXMAP_RGB_DATA:
+ case BONOBO_UI_HANDLER_PIXMAP_RGBA_DATA:
+ pixmap_data = g_malloc(corba_pixmap_data->_length);
+ memcpy(pixmap_data, corba_pixmap_data->_buffer, corba_pixmap_data->_length);
return pixmap_data;
default:
Index: bonobo/bonobo-uih-menu.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-uih-menu.c,v
retrieving revision 1.3
diff -u -r1.3 bonobo-uih-menu.c
--- bonobo/bonobo-uih-menu.c 2000/03/08 00:28:23 1.3
+++ bonobo/bonobo-uih-menu.c 2000/03/28 00:41:24
@@ -724,6 +724,7 @@
{
GtkWidget *menu_widget;
MenuItemInternal *rg;
+ GtkWidget *pixmap;
switch (item->type) {
case BONOBO_UI_HANDLER_MENU_ITEM:
@@ -734,10 +735,9 @@
* a pixmap, create a GtkPixmapMenuItem.
*/
if (item->pixmap_data != NULL && item->pixmap_type != BONOBO_UI_HANDLER_PIXMAP_NONE) {
- GtkWidget *pixmap;
-
+
menu_widget = gtk_pixmap_menu_item_new ();
-
+
pixmap = bonobo_ui_handler_toplevel_create_pixmap (GTK_WIDGET (menu_widget), item->pixmap_type, item->pixmap_data);
if (pixmap != NULL) {
gtk_pixmap_menu_item_set_pixmap (GTK_PIXMAP_MENU_ITEM (menu_widget),
Index: components/application-x-gnomine/Makefile.am
===================================================================
RCS file: /cvs/gnome/bonobo/components/application-x-gnomine/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- components/application-x-gnomine/Makefile.am 2000/02/01 23:55:51 1.5
+++ components/application-x-gnomine/Makefile.am 2000/03/28 00:41:24
@@ -30,7 +30,8 @@
bonobo_application_x_mines_LDADD = \
$(GNOME_LIBDIR) \
$(top_builddir)/bonobo/libbonobo.la \
- $(GNOMEGNORBA_LIBS)
+ $(GNOMEGNORBA_LIBS) \
+ -lgdk_pixbuf
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = application-x-mines.gnorba
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]