summaryrefslogtreecommitdiff
path: root/components/help/hyperbola-main.c
blob: 666bb2c20d08aebf591fd4713ea7b85cd551bbeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

#include <config.h>

#include <libnautilus-extensions/libnautilus-extensions.h>
#include <gnome.h>
#include <liboaf/liboaf.h>

/* In hyperbola-nav-tree.c */
extern BonoboObject *hyperbola_navigation_tree_new(void);
/* in hyperbola-nav-index.c */
extern BonoboObject *hyperbola_navigation_index_new(void);
/* in hyperbola-nav-search.c */
extern BonoboObject *hyperbola_navigation_search_new(void);

static int object_count = 0;

static void
do_destroy(GtkObject *obj)
{
  object_count--;

  if(object_count <= 0)
    gtk_main_quit();
}

static BonoboObject *
make_obj(BonoboGenericFactory *Factory, const char *goad_id, void *closure)
{
  BonoboObject *retval = NULL;

  if(!strcmp(goad_id, "OAFIID:hyperbola_navigation_tree:57542ce0-71ff-442d-a764-462c92514234"))
    retval = hyperbola_navigation_tree_new();
  else if(!strcmp(goad_id, "OAFIID:hyperbola_navigation_index:0bafadc7-09f1-4f10-8c8e-dad53124fc49"))
    retval = hyperbola_navigation_index_new();
  else if(!strcmp(goad_id, "OAFIID:hyperbola_navigation_search:89b2f3b8-4f09-49c8-9a7b-ccb14d034813"))
    retval = hyperbola_navigation_search_new();

  if(retval)
    {
      object_count++;
      gtk_signal_connect(GTK_OBJECT(retval), "destroy", do_destroy, NULL);
    }

  return retval;
}

int
main(int argc, char *argv[])
{
  BonoboGenericFactory *factory;
  CORBA_ORB orb;

  /* Initialize gettext support */
  bindtextdomain (PACKAGE, GNOMELOCALEDIR);
  textdomain (PACKAGE);
	

  gnome_init_with_popt_table("hyperbola", VERSION, 
			     argc, argv,
			     oaf_popt_options, 0, NULL); 
  
  orb = oaf_init (argc, argv);


  bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);

  factory = bonobo_generic_factory_new_multi("OAFIID:hyperbola_factory:02b54c63-101b-4b27-a285-f99ed332ecdb", make_obj, NULL);

  do {
    bonobo_main();
  } while(object_count > 0);

  return 0;
}