2005-06-22 11:20:32 -07:00
|
|
|
/*
|
2005-10-13 07:08:18 -07:00
|
|
|
* mootoggleaction.h
|
2005-06-22 11:20:32 -07:00
|
|
|
*
|
2006-02-23 06:03:17 -08:00
|
|
|
* Copyright (C) 2004-2006 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-06-22 11:20:32 -07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#ifndef __MOO_TOGGLE_ACTION_H__
|
|
|
|
#define __MOO_TOGGLE_ACTION_H__
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#include <mooutils/mooaction.h>
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_TOGGLE_ACTION (moo_toggle_action_get_type ())
|
|
|
|
#define MOO_TOGGLE_ACTION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_TOGGLE_ACTION, MooToggleAction))
|
|
|
|
#define MOO_TOGGLE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_TOGGLE_ACTION, MooToggleActionClass))
|
|
|
|
#define MOO_IS_TOGGLE_ACTION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_TOGGLE_ACTION))
|
|
|
|
#define MOO_IS_TOGGLE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_TOGGLE_ACTION))
|
|
|
|
#define MOO_TOGGLE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_TOGGLE_ACTION, MooToggleActionClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _MooToggleAction MooToggleAction;
|
|
|
|
typedef struct _MooToggleActionClass MooToggleActionClass;
|
|
|
|
|
|
|
|
typedef void (*MooToggleActionFunc) (gpointer data, gboolean active);
|
|
|
|
|
|
|
|
struct _MooToggleAction
|
|
|
|
{
|
|
|
|
MooAction parent;
|
2005-11-19 19:59:01 -08:00
|
|
|
MooToggleActionFunc callback;
|
|
|
|
gpointer data;
|
|
|
|
guint object : 1;
|
2005-06-22 11:20:32 -07:00
|
|
|
guint active : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooToggleActionClass
|
|
|
|
{
|
|
|
|
MooActionClass parent_class;
|
|
|
|
|
|
|
|
/* signals */
|
|
|
|
void (*toggled) (MooToggleAction *action,
|
|
|
|
gboolean active);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-11-18 12:07:56 -08:00
|
|
|
GType moo_toggle_action_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
void moo_toggle_action_set_active (MooToggleAction *action,
|
|
|
|
gboolean active);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#endif /* __MOO_TOGGLE_ACTION_H__ */
|
2005-06-22 11:20:32 -07:00
|
|
|
|