2
* This file is part of libtile.
4
* Copyright (c) 2006 Novell, Inc.
6
* Libtile is free software; you can redistribute it and/or modify it under the
7
* terms of the GNU Lesser General Public License as published by the Free
8
* Software Foundation; either version 2 of the License, or (at your option)
11
* Libtile is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with libslab; if not, write to the Free Software Foundation, Inc., 51
18
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
#define TILE_TYPE (tile_get_type ())
30
#define TILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TILE_TYPE, Tile))
31
#define TILE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TILE_TYPE, TileClass))
32
#define IS_TILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TILE_TYPE))
33
#define IS_TILE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TILE_TYPE))
34
#define TILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TILE_TYPE, TileClass))
35
#define TILE_ACTION_TYPE (tile_action_get_type ())
36
#define TILE_ACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TILE_ACTION_TYPE, TileAction))
37
#define TILE_ACTION_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TILE_ACTION_TYPE, TileActionClass))
38
#define IS_TILE_ACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TILE_ACTION_TYPE))
39
#define IS_TILE_ACTION_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TILE_ACTION_TYPE))
40
#define TILE_ACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TILE_ACTION_TYPE, TileActionClass))
41
#define TILE_ACTION_CHECK_FLAG(action,flag) ((TILE_ACTION (action)->flags & (flag)) != 0)
42
#define TILE_STATE_ENTERED GTK_STATE_PRELIGHT
43
#define TILE_STATE_FOCUSED GTK_STATE_PRELIGHT
45
typedef struct _Tile Tile;
46
typedef struct _TileClass TileClass;
47
typedef struct _TileAction TileAction;
48
typedef struct _TileActionClass TileActionClass;
49
typedef struct _TileEvent TileEvent;
51
typedef void (*TileActionFunc) (Tile *, TileEvent *, TileAction *);
55
TILE_EVENT_ACTIVATED_SINGLE_CLICK,
56
TILE_EVENT_ACTIVATED_DOUBLE_CLICK,
57
TILE_EVENT_ACTIVATED_KEYBOARD,
58
TILE_EVENT_IMPLICIT_DISABLE,
59
TILE_EVENT_IMPLICIT_ENABLE,
60
TILE_EVENT_ACTION_TRIGGERED
65
TILE_ACTION_OPENS_NEW_WINDOW = 1 << 0,
66
TILE_ACTION_OPENS_HELP = 1 << 1
74
GtkMenu *context_menu;
81
TileAction *default_action;
86
GtkButtonClass gtk_button_class;
88
void (*tile_explicit_enable) (Tile *);
89
void (*tile_explicit_disable) (Tile *);
91
void (*tile_activated) (Tile *, TileEvent *);
92
void (*tile_implicit_enable) (Tile *, TileEvent *);
93
void (*tile_implicit_disable) (Tile *, TileEvent *);
94
void (*tile_action_triggered) (Tile *, TileEvent *, TileAction *);
104
GtkMenuItem *menu_item;
109
struct _TileActionClass
111
GObjectClass parent_class;
120
GType tile_get_type (void);
121
GType tile_action_get_type (void);
123
gint tile_compare (gconstpointer a, gconstpointer b);
125
void tile_explicit_enable (Tile * tile);
126
void tile_explicit_disable (Tile * tile);
128
void tile_implicit_enable (Tile * tile);
129
void tile_implicit_disable (Tile * tile);
130
void tile_implicit_enable_with_time (Tile * tile, guint32 time);
131
void tile_implicit_disable_with_time (Tile * tile, guint32 time);
133
void tile_trigger_action (Tile * tile, TileAction * action);
134
void tile_trigger_action_with_time (Tile * tile, TileAction * action, guint32 time);
136
TileAction *tile_action_new (Tile * tile, TileActionFunc func, const gchar * menu_item_markup,
139
void tile_action_set_menu_item_label (TileAction * action, const gchar * markup);
140
GtkMenuItem *tile_action_get_menu_item (TileAction * action);