~ubuntu-branches/ubuntu/karmic/xfce4-session/karmic

« back to all changes in this revision

Viewing changes to engines/balou/engine.c

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2005-11-06 22:01:12 UTC
  • mto: (4.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051106220112-5rusox237ymjghsp
Tags: upstream-4.2.3
ImportĀ upstreamĀ versionĀ 4.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: engine.c 4711 2004-11-01 16:10:55Z benny $ */
 
2
/*-
 
3
 * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org>
 
4
 * All rights reserved.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2, or (at your option)
 
9
 * any later version.
 
10
 *                                                                              
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *                                                                              
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
19
 * 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifdef HAVE_CONFIG_H
 
23
#include <config.h>
 
24
#endif
 
25
 
 
26
#include <gmodule.h>
 
27
 
 
28
#include <libxfsm/xfsm-splash-engine.h>
 
29
 
 
30
#include <engines/balou/balou.h>
 
31
 
 
32
 
 
33
#define DEFAULT_THEME   "Default"
 
34
 
 
35
 
 
36
static void
 
37
engine_setup (XfsmSplashEngine *engine,
 
38
              XfsmSplashRc     *rc)
 
39
{
 
40
  const gchar *theme_name;
 
41
  BalouTheme  *theme;
 
42
 
 
43
  theme_name = xfsm_splash_rc_read_entry (rc, "Theme", DEFAULT_THEME);
 
44
  theme = balou_theme_load (theme_name);
 
45
 
 
46
  balou_init (BALOU (engine->user_data),
 
47
              engine->display,
 
48
              engine->primary_screen,
 
49
              engine->primary_monitor,
 
50
              theme);
 
51
}
 
52
 
 
53
 
 
54
static void
 
55
engine_next (XfsmSplashEngine *engine, 
 
56
             const gchar      *text)
 
57
{
 
58
  Balou *balou = BALOU (engine->user_data);
 
59
 
 
60
  balou_fadeout (balou);
 
61
  balou_fadein (balou, text);
 
62
}
 
63
 
 
64
 
 
65
static int
 
66
engine_run (XfsmSplashEngine *engine,
 
67
            GtkWidget        *dialog)
 
68
{
 
69
  return balou_run (BALOU (engine->user_data), dialog);
 
70
}
 
71
 
 
72
 
 
73
static void
 
74
engine_destroy (XfsmSplashEngine *engine)
 
75
{
 
76
  Balou *balou = BALOU (engine->user_data);
 
77
 
 
78
  if (G_LIKELY (balou != NULL))
 
79
    {
 
80
      balou_destroy (balou);
 
81
      g_free (balou);
 
82
    }
 
83
}
 
84
 
 
85
 
 
86
G_MODULE_EXPORT void
 
87
engine_init (XfsmSplashEngine *engine)
 
88
{
 
89
  engine->user_data   = g_new0 (Balou, 1);
 
90
  engine->setup       = engine_setup;
 
91
  engine->next        = engine_next;
 
92
  engine->run         = engine_run;
 
93
  engine->destroy     = engine_destroy;
 
94
}
 
95
 
 
96