~ubuntu-branches/ubuntu/dapper/vino/dapper

« back to all changes in this revision

Viewing changes to server/vino-main.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2004-10-12 19:36:40 UTC
  • Revision ID: james.westby@ubuntu.com-20041012193640-ybetkwuqt7e04dke
Tags: upstream-2.8.1
ImportĀ upstreamĀ versionĀ 2.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2003 Sun Microsystems, Inc.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; either version 2 of the
 
7
 * License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful, but
 
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
17
 * 02111-1307, USA.
 
18
 *
 
19
 * Authors:
 
20
 *      Mark McLoughlin <mark@skynet.ie>
 
21
 */
 
22
 
 
23
#include <config.h>
 
24
 
 
25
#include "vino-input.h"
 
26
#include "vino-server.h"
 
27
#include "vino-shell.h"
 
28
#include "vino-prefs.h"
 
29
#include "vino-util.h"
 
30
#include <gtk/gtk.h>
 
31
 
 
32
#ifdef HAVE_GNUTLS
 
33
#include <gnutls/gnutls.h>
 
34
 
 
35
#ifdef G_ENABLE_DEBUG
 
36
static void
 
37
vino_debug_gnutls (int         level,
 
38
                   const char *str)
 
39
{
 
40
  fputs (str, stderr);
 
41
}
 
42
#endif
 
43
#endif /* HAVE_GNUTLS */
 
44
 
 
45
int
 
46
main (int argc, char **argv)
 
47
{
 
48
  GdkDisplay *display;
 
49
  gboolean    view_only;
 
50
  int         i, n_screens;
 
51
 
 
52
  bindtextdomain (GETTEXT_PACKAGE, VINO_LOCALEDIR);
 
53
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
54
  textdomain (GETTEXT_PACKAGE);
 
55
 
 
56
  gtk_init (&argc, &argv);
 
57
 
 
58
  vino_setup_debug_flags ();
 
59
 
 
60
#ifdef HAVE_GNUTLS
 
61
#ifdef G_ENABLE_DEBUG
 
62
  if (_vino_debug_flags & VINO_DEBUG_TLS)
 
63
    {
 
64
      gnutls_global_set_log_level (10);
 
65
      gnutls_global_set_log_function (vino_debug_gnutls);
 
66
    }
 
67
#endif
 
68
#endif /* HAVE_GNUTLS */
 
69
 
 
70
  if (!vino_shell_register (&argc, argv))
 
71
    return 1;
 
72
 
 
73
  display = gdk_display_get_default ();
 
74
 
 
75
  view_only = FALSE;
 
76
  if (!vino_input_init (display))
 
77
    {
 
78
      g_warning (_("Your XServer does not support the XTest extension - "
 
79
                   "remote desktop access will be view-only\n"));
 
80
      view_only = TRUE;
 
81
    }
 
82
 
 
83
  vino_prefs_init (view_only);
 
84
 
 
85
  n_screens = gdk_display_get_n_screens (display);
 
86
  for (i = 0; i < n_screens; i++)
 
87
    vino_prefs_create_server (gdk_display_get_screen (display, i));
 
88
 
 
89
  gtk_main ();
 
90
 
 
91
  vino_prefs_shutdown ();
 
92
 
 
93
  return 0;
 
94
}