eog/viewer/sample-container.c
Michael Meeks f2abe5f457 only ref if image != NULL.
2000-12-09  Michael Meeks  <michael@helixcode.com>

	* eog-image.c (eog_image_get_image): only ref if image != NULL.

	* eog-image-view.c (eog_image_view_new),
	(eog_image_view_construct): add control, add image_set_image_cb
	call, so we can actualy see the image if we load data then request
	a view, or create new views later on.

	* eog-embeddable-view.c (eog_embeddable_view_destroy): upd.
	(eog_embeddable_view_construct): upd.

	* eog-embeddable.c (eog_embeddable_construct): update.

	* eog-image-view.c (eog_image_view_set_dither),
	(eog_image_view_get_interpolation),
	(eog_image_view_set_interpolation),
	(eog_image_view_get_dither),
	(eog_image_view_set_check_type),
	(eog_image_view_get_check_type),
	(eog_image_view_get_check_size),
	(eog_image_view_set_check_size): kill warnings.
	misc. cleans.

	* eog-control.c (eog_control_construct): drasticaly prune.
	(eog_control_destroy): prune with a hook.

	* eog-image.c (eog_image_add_interfaces): split from
	(eog_image_construct): here.
	(eog_image_destroy): don't double unref item container.

	* main.c (bonobo_object_data_t): expunge
	substantial cleans.

	* eog-image.c (eog_image_construct): use bonobo_object_unref.

	* eog-util.c (eog_util_add_interfaces): remove.

	* GNOME_EOG.oafinfo: update naming convention.

	* main.c (eog_image_viewer_factory): ditto.

2000-12-08  Michael Meeks  <michael@helixcode.com>

	* eog-image-view.c (eog_image_view_destroy): don't unref other
	parts of the aggregate, they are fused with the view.

	* sample-container.c (main): frendlify
2000-12-09 22:22:55 +00:00

84 lines
1.7 KiB
C

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* sample-container.c
*
* Authors:
* Martin Baulig (baulig@suse.de)
*
* Copyright 2000 SuSE GmbH.
*/
#include <config.h>
#include <gnome.h>
#include <liboaf/liboaf.h>
#include <bonobo.h>
#include <eog-util.h>
int
main (int argc, char *argv [])
{
Bonobo_Unknown x, y, z;
CORBA_Environment ev;
CORBA_ORB orb;
gchar *url;
CORBA_exception_init (&ev);
if (argc != 2) {
g_print ("Usage: %s url\n", argv [0]);
exit (1);
}
gnome_init ("sample-container", "1.0", argc, (char **) argv);
orb = oaf_init (argc, argv);
if (bonobo_init (orb, NULL, NULL) == FALSE)
g_error ("Cannot init bonobo");
url = g_strdup_printf ("file:%s", argv [1]);
g_message ("Querying %s", url);
x = bonobo_get_object (url, "IDL:GNOME/EOG/Image:1.0", &ev);
if (BONOBO_EX (&ev))
g_warning ("Failed to get object: %s",
bonobo_exception_get_text (&ev));
g_message ("x = %p", x);
if (x)
g_message ("x is a %s", x->object_id);
g_free (url);
url = g_strdup_printf ("file:%s!control", argv [1]);
g_message ("Querying %s", url);
y = bonobo_get_object (url, "IDL:Bonobo/Control:1.0", &ev);
if (ev._major != CORBA_NO_EXCEPTION)
g_warning ("Failed to get object: %s",
bonobo_exception_get_text (&ev));
g_message ("y = %p", y);
if (y)
g_message ("y is a %s", y->object_id);
g_free (url);
url = g_strdup_printf ("file:%s!embeddable", argv [1]);
g_message ("Querying %s", url);
z = bonobo_get_object (url, "IDL:Bonobo/Embeddable:1.0", &ev);
if (ev._major != CORBA_NO_EXCEPTION)
g_warning ("Failed to get object: %s",
bonobo_exception_get_text (&ev));
g_message ("z = %p", z);
if (z)
g_message ("z is a %s", z->object_id);
g_free (url);
return 0;
}