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

« back to all changes in this revision

Viewing changes to libxfsm/xfsm-splash-engine.h

  • 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: xfsm-splash-engine.h 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
#ifndef __XFSM_SPLASH_ENGINE_H__
 
23
#define __XFSM_SPLASH_ENGINE_H__
 
24
 
 
25
#include <time.h>
 
26
 
 
27
#include <gtk/gtk.h>
 
28
 
 
29
#include <libxfsm/xfsm-splash-rc.h>
 
30
 
 
31
 
 
32
#define XFSM_CHOOSE_LOGOUT  0
 
33
#define XFSM_CHOOSE_LOAD    1
 
34
#define XFSM_CHOOSE_NEW     2
 
35
 
 
36
 
 
37
typedef struct _XfsmSplashEngine XfsmSplashEngine;
 
38
typedef struct _XfsmSplashConfig XfsmSplashConfig;
 
39
typedef struct _XfsmSessionInfo  XfsmSessionInfo;
 
40
 
 
41
 
 
42
struct _XfsmSplashEngine
 
43
{
 
44
  /* provided by the session manager */
 
45
  GdkDisplay  *display;
 
46
  GdkScreen   *primary_screen;
 
47
  int          primary_monitor;
 
48
 
 
49
 
 
50
  /* to be filled in by the engine */
 
51
  gpointer     user_data;
 
52
 
 
53
  /* load config from rc and display the splash window */
 
54
  void (*setup)   (XfsmSplashEngine *engine,
 
55
                   XfsmSplashRc     *rc);
 
56
 
 
57
  /* tells the engine that the session will start now, where
 
58
     steps is the approx. number of apps started in the session,
 
59
     name is the name of the session and the preview at 52x42
 
60
     (OPTIONAL) */
 
61
  void (*start)   (XfsmSplashEngine *engine,
 
62
                   const gchar      *name,
 
63
                   GdkPixbuf        *preview,
 
64
                   unsigned          steps);
 
65
 
 
66
  /* place, run, hide the dialog and return the result of the run.
 
67
     override on demand (OPTIONAL) */
 
68
  int  (*run)     (XfsmSplashEngine *engine,
 
69
                   GtkWidget        *dialog);
 
70
 
 
71
  /* display the text (OPTIONAL) */
 
72
  void (*next)    (XfsmSplashEngine *engine,
 
73
                   const gchar      *text);
 
74
 
 
75
  /* choose a session (OPTIONAL), should return XFSM_CHOOSE_* */
 
76
  int  (*choose)  (XfsmSplashEngine *engine,
 
77
                   GList            *sessions,
 
78
                   const gchar      *default_session,
 
79
                   gchar           **name_return);
 
80
 
 
81
  void (*destroy) (XfsmSplashEngine *engine);
 
82
 
 
83
  gpointer _reserved[8];
 
84
};
 
85
 
 
86
 
 
87
struct _XfsmSplashConfig
 
88
{
 
89
  /* provided by the session manager */
 
90
  XfsmSplashRc  *rc;
 
91
 
 
92
 
 
93
  /* to be filled in by the config (freed by the session manager) */
 
94
  gchar   *name;
 
95
  gchar   *description;
 
96
  gchar   *version;
 
97
  gchar   *author;
 
98
  gchar   *homepage;
 
99
 
 
100
  /* config internals (config is responsible for freeing during destroy) */
 
101
  gpointer user_data;
 
102
 
 
103
  /* generate preview for engine, should be 320x240! (OPTIONAL) */
 
104
  GdkPixbuf *(*preview) (XfsmSplashConfig *config);
 
105
 
 
106
  /* display a configuration dialog (OPTIONAL) */
 
107
  void (*configure) (XfsmSplashConfig *config,
 
108
                     GtkWidget        *parent);
 
109
 
 
110
  void (*destroy) (XfsmSplashConfig *config);
 
111
 
 
112
  gpointer _reserved[8];
 
113
};
 
114
 
 
115
 
 
116
struct _XfsmSessionInfo
 
117
{
 
118
  gchar     *name;      /* name of the session */
 
119
  time_t     atime;     /* last access time */
 
120
  GdkPixbuf *preview;   /* preview icon (52x42) */
 
121
};
 
122
 
 
123
 
 
124
#endif /* !__XFSM_SPLASH_ENGINE_H__ */