Commit 65c2e7dd authored by Elliot Lee's avatar Elliot Lee

Switch from imlib to pixbuf. Import from gnome-fm. Add a 'main_window'



* libnautils/g*.[ch]: Switch from imlib to pixbuf.
* src/file-manager: Import from gnome-fm.
* idl/nautilus.idl: Add a 'main_window' attribute on a ViewFrame, so that views can talk
to the main window.
parent 45836fc0
1999-12-13 Elliot Lee <sopwith@redhat.com>
* libnautils/g*.[ch]: Switch from imlib to pixbuf.
* src/file-manager: Import from gnome-fm.
* idl/nautilus.idl: Add a 'main_window' attribute on a ViewFrame, so that views can talk to the main window.
1999-12-10 Elliot Lee <sopwith@redhat.com>
* libnautilus/ntl-meta-view.[ch]: Add a convenience function for
......
......@@ -88,7 +88,7 @@ hyperbola_navigation_history_select_row(GtkCList *clist, gint row, gint column,
}
static GnomeObject * make_obj(GnomeGenericFactory *Factory, const char *goad_id, void *closure)
static GnomeObject * make_obj(GnomeGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *client, *clist, *wtmp;
GnomeObject *ctl;
......@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
GNORBA_INIT_SERVER_FUNC, &ev);
bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
factory = gnome_generic_factory_new("ntl_history_view_factory", make_obj, NULL);
factory = gnome_generic_factory_new_multi("ntl_history_view_factory", make_obj, NULL);
gtk_main();
......
......@@ -88,7 +88,7 @@ hyperbola_navigation_history_select_row(GtkCList *clist, gint row, gint column,
}
static GnomeObject * make_obj(GnomeGenericFactory *Factory, const char *goad_id, void *closure)
static GnomeObject * make_obj(GnomeGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *client, *clist, *wtmp;
GnomeObject *ctl;
......@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
GNORBA_INIT_SERVER_FUNC, &ev);
bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
factory = gnome_generic_factory_new("ntl_history_view_factory", make_obj, NULL);
factory = gnome_generic_factory_new_multi("ntl_history_view_factory", make_obj, NULL);
gtk_main();
......
......@@ -40,6 +40,7 @@ AC_C_CONST
AC_OUTPUT([
Makefile
idl/Makefile
libnautilus/Makefile
src/Makefile
src/file-manager/Makefile
......
Makefile.in
EXTRA_DIST= \
GNOME_Desktop_FileOperationService.idl \
nautilus.idl
......@@ -46,7 +46,10 @@ module Nautilus {
interface ContentView : View {
};
interface ViewWindow;
interface ViewFrame : ::GNOME::Unknown {
readonly attribute ViewWindow main_window;
oneway void request_status_change(in StatusRequestInfo statinfo);
oneway void request_location_change(in NavigationRequestInfo navinfo);
oneway void request_selection_change(in SelectionRequestInfo selinfo);
......@@ -57,4 +60,7 @@ module Nautilus {
interface ContentViewFrame : ViewFrame {
};
interface ViewWindow : ::GNOME::Unknown {
};
};
......@@ -28,6 +28,8 @@ libnautilus_la_SOURCES=$(nautilus_idl_sources) \
gtkflist.c \
gtkscrollframe.c
libnautilus_la_LDFLAGS=$(GNOME_LIBS) $(GNORBA_LIBS) $(GDK_PIXBUF_LIBS)
$(nautilus_idl_sources): nautilus_idl_stamp
nautilus_idl_stamp: $(top_srcdir)/idl/nautilus.idl
......
......@@ -26,6 +26,8 @@
#endif
#include <gnome.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include "gnome-icon-container-private.h"
#include "gnome-icon-container-dnd.h"
......@@ -165,8 +167,8 @@ icon_new (GnomeIconContainer *container,
}
static GnomeIconContainerIcon *
icon_new_imlib (GnomeIconContainer *container,
GdkImlibImage *image,
icon_new_pixbuf (GnomeIconContainer *container,
GdkPixbuf *image,
const gchar *text,
gpointer data)
{
......@@ -179,8 +181,8 @@ icon_new_imlib (GnomeIconContainer *container,
new->image_item
= gnome_canvas_item_new (new->item,
gnome_canvas_image_get_type (),
"image", image,
gnome_canvas_pixbuf_get_type (),
"pixbuf", image,
"x", (gdouble) 0,
"y", (gdouble) 0,
NULL);
......@@ -2362,8 +2364,8 @@ gnome_icon_container_new (void)
{
GtkWidget *new;
gtk_widget_push_visual (gdk_imlib_get_visual ());
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
gtk_widget_push_visual (gdk_rgb_get_visual ());
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
new = gtk_type_new (gnome_icon_container_get_type ());
......@@ -2460,8 +2462,8 @@ setup_icon_in_container (GnomeIconContainer *container,
}
void
gnome_icon_container_add_imlib (GnomeIconContainer *container,
GdkImlibImage *image,
gnome_icon_container_add_pixbuf (GnomeIconContainer *container,
GdkPixbuf *image,
const gchar *text,
gint x, gint y,
gpointer data)
......@@ -2476,7 +2478,7 @@ gnome_icon_container_add_imlib (GnomeIconContainer *container,
priv = container->priv;
new_icon = icon_new_imlib (container, image, text, data);
new_icon = icon_new_pixbuf (container, image, text, data);
icon_position (new_icon, container, x, y);
world_to_grid (container, x, y, &grid_x, &grid_y);
......@@ -2496,7 +2498,7 @@ gnome_icon_container_add_imlib (GnomeIconContainer *container,
}
/**
* gnome_icon_container_add_imlib_auto:
* gnome_icon_container_add_pixbuf_auto:
* @container: A GnomeIconContainer
* @image: Image of the icon to add
* @text: Caption
......@@ -2506,8 +2508,8 @@ gnome_icon_container_add_imlib (GnomeIconContainer *container,
* empty spot available.
**/
void
gnome_icon_container_add_imlib_auto (GnomeIconContainer *container,
GdkImlibImage *image,
gnome_icon_container_add_pixbuf_auto (GnomeIconContainer *container,
GdkPixbuf *image,
const gchar *text,
gpointer data)
{
......@@ -2519,7 +2521,7 @@ gnome_icon_container_add_imlib_auto (GnomeIconContainer *container,
g_return_if_fail (image != NULL);
g_return_if_fail (text != NULL);
new_icon = icon_new_imlib (container, image, text, data);
new_icon = icon_new_pixbuf (container, image, text, data);
icon_grid_add_auto (container->priv->grid, new_icon, &grid_x, &grid_y);
......@@ -2532,7 +2534,7 @@ gnome_icon_container_add_imlib_auto (GnomeIconContainer *container,
}
/**
* gnome_icon_container_add_imlib_with_layout:
* gnome_icon_container_add_pixbuf_with_layout:
* @container: A GnomeIconContainer
* @image: Image of the icon to add
* @text: Caption
......@@ -2546,8 +2548,8 @@ gnome_icon_container_add_imlib_auto (GnomeIconContainer *container,
* has not been added); %TRUE otherwise.
**/
gboolean
gnome_icon_container_add_imlib_with_layout (GnomeIconContainer *container,
GdkImlibImage *image,
gnome_icon_container_add_pixbuf_with_layout (GnomeIconContainer *container,
GdkPixbuf *image,
const gchar *text,
gpointer data,
const GnomeIconContainerLayout *layout)
......@@ -2560,7 +2562,7 @@ gnome_icon_container_add_imlib_with_layout (GnomeIconContainer *container,
g_return_val_if_fail (layout != NULL, FALSE);
if (gnome_icon_container_layout_get_position (layout, text, &x, &y)) {
gnome_icon_container_add_imlib (container, image,
gnome_icon_container_add_pixbuf (container, image,
text, x, y, data);
return TRUE;
} else {
......
......@@ -25,6 +25,7 @@
#define _GNOME_ICON_CONTAINER_H
#include <libgnomeui/libgnomeui.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
enum _GnomeIconContainerIconMode {
GNOME_ICON_CONTAINER_NORMAL_ICONS,
......@@ -100,25 +101,25 @@ void gnome_icon_container_set_editable
gboolean gnome_icon_container_get_editable
(GnomeIconContainer *view);
void gnome_icon_container_add_imlib (GnomeIconContainer *view,
GdkImlibImage *image,
void gnome_icon_container_add_pixbuf (GnomeIconContainer *view,
GdkPixbuf *image,
const gchar *text,
gint x, gint y,
gpointer data);
void gnome_icon_container_add_imlib_auto
void gnome_icon_container_add_pixbuf_auto
(GnomeIconContainer *view,
GdkImlibImage *image,
GdkPixbuf *image,
const gchar *text,
gpointer data);
gboolean gnome_icon_container_add_imlib_with_layout
gboolean gnome_icon_container_add_pixbuf_with_layout
(GnomeIconContainer
*container,
GdkImlibImage *image,
*container,
GdkPixbuf *image,
const gchar *text,
gpointer data,
const GnomeIconContainerLayout
*layout);
*layout);
gpointer gnome_icon_container_get_icon_data
(GnomeIconContainer *view,
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* File list widget for the Midnight Commander
*
* Copyright (C) 1999 The Free Software Foundation
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* File list widget for the Midnight Commander
*
* Copyright (C) 1999 The Free Software Foundation
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
......
......@@ -31,5 +31,6 @@
#include <libnautilus/nautilus.h>
#include <libnautilus/ntl-view-client.h>
#include <libnautilus/ntl-meta-view-client.h>
#include <libnautilus/ntl-content-view-client.h>
#endif
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
......
......@@ -55,24 +55,26 @@ static void nautilus_content_view_client_class_init (NautilusContentViewClientCl
GtkType
nautilus_content_view_client_get_type (void)
{
static GtkType view_client_type = 0;
if (!view_client_type) {
const GtkTypeInfo view_client_info = {
"NautilusContentViewClient",
sizeof (NautilusContentViewClient),
sizeof (NautilusContentViewClientClass),
(GtkClassInitFunc) nautilus_content_view_client_class_init,
(GtkObjectInitFunc) nautilus_content_view_client_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
view_client_type = gtk_type_unique (nautilus_view_client_get_type(), &view_client_info);
}
static GtkType view_client_type = 0;
if (!view_client_type)
{
const GtkTypeInfo view_client_info =
{
"NautilusContentViewClient",
sizeof (NautilusContentViewClient),
sizeof (NautilusContentViewClientClass),
(GtkClassInitFunc) nautilus_content_view_client_class_init,
(GtkObjectInitFunc) nautilus_content_view_client_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
view_client_type = gtk_type_unique (nautilus_view_client_get_type(), &view_client_info);
}
return view_client_type;
return view_client_type;
}
static void
......
......@@ -55,24 +55,26 @@ static void nautilus_meta_view_client_class_init (NautilusMetaViewClientClass *k
GtkType
nautilus_meta_view_client_get_type (void)
{
static GtkType view_client_type = 0;
if (!view_client_type) {
const GtkTypeInfo view_client_info = {
"NautilusMetaViewClient",
sizeof (NautilusMetaViewClient),
sizeof (NautilusMetaViewClientClass),
(GtkClassInitFunc) nautilus_meta_view_client_class_init,
(GtkObjectInitFunc) nautilus_meta_view_client_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
view_client_type = gtk_type_unique (nautilus_view_client_get_type(), &view_client_info);
}
static GtkType view_client_type = 0;
if (!view_client_type)
{
const GtkTypeInfo view_client_info =
{
"NautilusMetaViewClient",
sizeof (NautilusMetaViewClient),
sizeof (NautilusMetaViewClientClass),
(GtkClassInitFunc) nautilus_meta_view_client_class_init,
(GtkObjectInitFunc) nautilus_meta_view_client_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
view_client_type = gtk_type_unique (nautilus_view_client_get_type(), &view_client_info);
}
return view_client_type;
return view_client_type;
}
static void
......@@ -105,8 +107,9 @@ void
nautilus_meta_view_set_label(NautilusMetaViewClient *mvc, const char *label)
{
GnomeObject *ctl;
GnomePropertyBag *bag;
ctl = nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(client));
ctl = nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(mvc));
/* set description */
bag = gnome_control_get_property_bag(GNOME_CONTROL(ctl));
gnome_property_bag_add(bag, "label", "string", label, label, _("Label"),
......
......@@ -60,21 +60,21 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
(gpointer) & impl_Nautilus_View_save_state,
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
NULL, /* _private */
(gpointer) & impl_Nautilus_View_save_state,
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
};
static PortableServer_ServantBase__epv base_epv = { NULL};
static POA_Nautilus_View__vepv impl_Nautilus_View_vepv =
{
&base_epv,
NULL,
&libnautilus_Nautilus_View_epv
&base_epv,
NULL,
&libnautilus_Nautilus_View_epv
};
static void
......@@ -120,80 +120,83 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
{
PortableServer_ObjectId *objid;
CORBA_Environment ev;
void (*servant_destroy_func)(PortableServer_Servant servant, CORBA_Environment *ev);
PortableServer_ObjectId *objid;
CORBA_Environment ev;
void (*servant_destroy_func)(PortableServer_Servant servant, CORBA_Environment *ev);
CORBA_exception_init(&ev);
CORBA_exception_init(&ev);
servant_destroy_func = NAUTILUS_VIEW_CLIENT_CLASS(GTK_OBJECT(servant->view)->klass)->servant_destroy_func;
objid = PortableServer_POA_servant_to_id(bonobo_poa(), servant, &ev);
PortableServer_POA_deactivate_object(bonobo_poa(), objid, &ev);
CORBA_free(objid);
obj->servant = NULL;
servant_destroy_func = NAUTILUS_VIEW_CLIENT_CLASS(GTK_OBJECT(servant->view)->klass)->servant_destroy_func;
objid = PortableServer_POA_servant_to_id(bonobo_poa(), servant, &ev);
PortableServer_POA_deactivate_object(bonobo_poa(), objid, &ev);
CORBA_free(objid);
obj->servant = NULL;
servant_destroy_func((PortableServer_Servant) servant, &ev);
g_free(servant);
CORBA_exception_free(&ev);
servant_destroy_func((PortableServer_Servant) servant, &ev);
g_free(servant);
CORBA_exception_free(&ev);
}
static GnomeObject *
impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
{
GnomeObject *retval;
impl_POA_Nautilus_View *newservant;
void (*servant_init_func)(PortableServer_Servant servant, CORBA_Environment *ev);
NautilusViewClientClass *view_class = NAUTILUS_VIEW_CLIENT_CLASS(GTK_OBJECT(view)->klass);
GnomeObject *retval;
impl_POA_Nautilus_View *newservant;
void (*servant_init_func)(PortableServer_Servant servant, CORBA_Environment *ev);
NautilusViewClientClass *view_class = NAUTILUS_VIEW_CLIENT_CLASS(GTK_OBJECT(view)->klass);
servant_init_func = view_class->servant_init_func;
newservant = g_new0(impl_POA_Nautilus_View, 1);
newservant->servant.vepv = view_class->vepv;
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv(FALSE);
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
servant_init_func = view_class->servant_init_func;
newservant = g_new0(impl_POA_Nautilus_View, 1);
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
retval = gnome_object_new_from_servant(newservant);
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
return retval;
return retval;
}
static void nautilus_view_client_init (NautilusViewClient *view);
static void nautilus_view_client_destroy (NautilusViewClient *view);
static void nautilus_view_client_class_init (NautilusViewClientClass *klass);
static void nautilus_view_client_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
GtkArg *arg,
guint arg_id);
static void nautilus_view_client_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
GtkArg *arg,
guint arg_id);
static void nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition);
GtkRequisition *requisition);
static void nautilus_view_client_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
GtkAllocation *allocation);
GtkType
nautilus_view_client_get_type (void)
{
static GtkType view_client_type = 0;
if (!view_client_type) {
const GtkTypeInfo view_client_info = {
"NautilusViewClient",
sizeof (NautilusViewClient),
sizeof (NautilusViewClientClass),
(GtkClassInitFunc) nautilus_view_client_class_init,
(GtkObjectInitFunc) nautilus_view_client_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
view_client_type = gtk_type_unique (gtk_bin_get_type(), &view_client_info);
}
static GtkType view_client_type = 0;
if (!view_client_type)
{
const GtkTypeInfo view_client_info =
{
"NautilusViewClient",
sizeof (NautilusViewClient),
sizeof (NautilusViewClientClass),
(GtkClassInitFunc) nautilus_view_client_class_init,
(GtkObjectInitFunc) nautilus_view_client_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
view_client_type = gtk_type_unique (gtk_bin_get_type(), &view_client_info);
}
return view_client_type;
return view_client_type;
}
#if 0
......@@ -208,13 +211,13 @@ gtk_marshal_NONE__BOXED_OBJECT_BOXED (GtkObject * object,
gpointer func_data,
GtkArg * args)
{
GtkSignal_NONE__BOXED_OBJECT_BOXED rfunc;
rfunc = (GtkSignal_NONE__BOXED_OBJECT_BOXED) func;
(*rfunc) (object,
GTK_VALUE_BOXED (args[0]),
GTK_VALUE_OBJECT (args[1]),
GTK_VALUE_BOXED (args[2]),
func_data);
GtkSignal_NONE__BOXED_OBJECT_BOXED rfunc;
rfunc = (GtkSignal_NONE__BOXED_OBJECT_BOXED) func;
(*rfunc) (object,
GTK_VALUE_BOXED (args[0]),
GTK_VALUE_OBJECT (args[1]),
GTK_VALUE_BOXED (args[2]),
func_data);
}
#endif
......@@ -249,29 +252,29 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("load_state",
GTK_RUN_LAST,
GTK_RUN_LAST,
object_class->type,