root/trunk/third/nautilus/components/services/install/nautilus-view/main.c @ 15547

Revision 15547, 2.9 KB (checked in by ghudson, 9 years ago)

This commit was generated by cvs2svn to compensate for changes in r15546,
which included commits to RCS files with non-trunk default branches.

Line 
1/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2/*
3 * Copyright (C) 2000 Eazel, Inc
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
19 *
20 * Author: Maciej Stachowiak <mjs@eazel.com>
21 *         J Shane Culpepper <pepper@eazel.com>
22 */
23
24/* main.c - main function and object activation function for services
25   content view component. */
26
27#include <config.h>
28#include <gnome.h>
29#include <liboaf/liboaf.h>
30#include <bonobo.h>
31#include "nautilus-service-install-view.h"
32
33static int object_count = 0;
34
35static void
36service_install_object_destroyed (GtkObject *obj)
37{
38        object_count--;
39        if (object_count <= 0) {
40                gtk_main_quit ();
41        }
42}
43
44static BonoboObject *
45service_install_make_object (BonoboGenericFactory       *factory, 
46                             const char                 *iid,
47                             void                       *closure)
48{
49
50        NautilusServiceInstallView      *view;
51        NautilusView                    *nautilus_view;
52
53        if (strcmp (iid, "OAFIID:nautilus_service_install_view:886546ca-1115-4ea4-8d30-8cefa2f5070b")) {
54                return NULL;
55        }
56
57        view = NAUTILUS_SERVICE_INSTALL_VIEW (gtk_object_new (NAUTILUS_TYPE_SERVICE_INSTALL_VIEW, NULL));
58
59        object_count++;
60
61        nautilus_view = nautilus_service_install_view_get_nautilus_view (view);
62       
63        gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", service_install_object_destroyed, NULL);
64
65        printf ("Returning new object %p\n", nautilus_view);
66
67        return BONOBO_OBJECT (nautilus_view);
68}
69
70int
71main (int argc, char *argv[])
72{
73        BonoboGenericFactory *factory;
74        CORBA_ORB orb;
75        char *registration_id;
76
77        gnome_init_with_popt_table ("nautilus-service-install-view", VERSION, 
78                                    argc, argv,
79                                    oaf_popt_options, 0, NULL);
80        gdk_rgb_init ();
81
82        orb = oaf_init (argc, argv);
83        bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
84
85        /* log to stderr, for now (but leave debug mode off) */
86        trilobite_set_log_handler (stderr, G_LOG_DOMAIN);
87
88        registration_id = oaf_make_registration_id ("OAFIID:nautilus_service_install_view_factory:e59e53d1-e3d1-46fe-ae28-3ec5c56b7d32", getenv ("DISPLAY"));
89        factory = bonobo_generic_factory_new_multi (registration_id, 
90                                                    service_install_make_object,
91                                                    NULL);
92        g_free (registration_id);
93
94        do {
95                bonobo_main ();
96        } while (object_count > 0);
97
98        return 0;
99}
Note: See TracBrowser for help on using the browser.