2
* Copyright (C) 2007 Intel
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
19
* Authored by Neil Jagdish Patel <njp@o-hand.com>
23
#include "launcher-behave.h"
25
G_DEFINE_TYPE (LauncherBehave, launcher_behave, CLUTTER_TYPE_BEHAVIOUR);
27
#define LAUNCHER_BEHAVE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\
28
LAUNCHER_TYPE_BEHAVE, \
29
LauncherBehavePrivate))
31
struct _LauncherBehavePrivate
33
LauncherBehaveAlphaFunc func;
38
launcher_behave_alpha_notify (ClutterBehaviour *behave, guint32 alpha_value)
40
LauncherBehave *launcher_behave = LAUNCHER_BEHAVE(behave);
41
LauncherBehavePrivate *priv;
43
priv = LAUNCHER_BEHAVE_GET_PRIVATE (launcher_behave);
45
if (priv->func != NULL)
46
priv->func (behave, alpha_value, priv->data);
50
launcher_behave_class_init (LauncherBehaveClass *klass)
52
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
53
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
55
behave_class->alpha_notify = launcher_behave_alpha_notify;
57
g_type_class_add_private (gobject_class, sizeof (LauncherBehavePrivate));
61
launcher_behave_init (LauncherBehave *self)
63
LauncherBehavePrivate *priv;
65
priv = LAUNCHER_BEHAVE_GET_PRIVATE (self);
72
launcher_behave_new (ClutterAlpha *alpha,
73
LauncherBehaveAlphaFunc func,
76
LauncherBehave *behave;
77
LauncherBehavePrivate *priv;
79
behave = g_object_new (LAUNCHER_TYPE_BEHAVE,
83
priv = LAUNCHER_BEHAVE_GET_PRIVATE (behave);
88
return CLUTTER_BEHAVIOUR(behave);