debug-manager: use g_spawn_sync() instead of fork() and waitpid()
[anjuta.git] / plugins / class-gen / combo-flags.h
blob52b566d76e465d72dbe5c6537d514f8c2a6e3339
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /* combo-flags.h
3 * Copyright (C) 2006 Armin Burgmeier
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __CLASSGEN_COMBO_FLAGS_H__
21 #define __CLASSGEN_COMBO_FLAGS_H__
23 #include <gtk/gtk.h>
25 #include <glib-object.h>
27 G_BEGIN_DECLS
29 #define CG_TYPE_COMBO_FLAGS (cg_combo_flags_get_type ())
30 #define CG_COMBO_FLAGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CG_TYPE_COMBO_FLAGS, CgComboFlags))
31 #define CG_COMBO_FLAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CG_TYPE_COMBO_FLAGS, CgComboFlagsClass))
32 #define CG_IS_COMBO_FLAGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CG_TYPE_COMBO_FLAGS))
33 #define CG_IS_COMBO_FLAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CG_TYPE_COMBO_FLAGS))
34 #define CG_COMBO_FLAGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CG_TYPE_COMBO_FLAGS, CgComboFlagsClass))
36 #define CG_TYPE_COMBO_FLAGS_SELECTION_TYPE (cg_combo_flags_selection_type_get_type ())
38 typedef struct _CgComboFlagsClass CgComboFlagsClass;
39 typedef struct _CgComboFlags CgComboFlags;
41 /* This widget is a simple hbox that is able to launch a popup window
42 * (similar to a combobox) that may be used to select flags. For each
43 * selected flag, the selected signal is emitted. Flags are selected via
44 * clicking on an entry in the popup or move to it using the up and down
45 * keys and then press space.
47 * The popup may be removed in two different ways. Either by a right mouse
48 * click or the enter key which is interpreted as a successful closure or via
49 * a click somewhere else on the screen or the escape key which is
50 * interpreted as cancellation. cg_combo_flags_editing_canceled may be
51 * used to differentiate between the two.
53 * The widget implements the cell editable interface and may thus be used
54 * from within a cell renderer to edit a cell. Such a cell renderer is
55 * cell-renderer-flags. It should also be possible to use the widget as
56 * a standalone widget if you put something in it (remember, it is a hbox)
57 * that displays the current state, but has not been tested as such. */
59 struct _CgComboFlagsClass
61 GtkBoxClass parent_class;
64 struct _CgComboFlags
66 GtkBox parent_instance;
69 typedef enum _CgComboFlagsSelectionType
71 CG_COMBO_FLAGS_SELECTION_NONE,
72 CG_COMBO_FLAGS_SELECTION_UNSELECT,
73 CG_COMBO_FLAGS_SELECTION_SELECT,
74 CG_COMBO_FLAGS_SELECTION_TOGGLE
75 } CgComboFlagsSelectionType;
77 GType cg_combo_flags_selection_type_get_type (void) G_GNUC_CONST;
78 GType cg_combo_flags_get_type (void) G_GNUC_CONST;
80 GtkWidget *cg_combo_flags_new (void);
81 GtkWidget *cg_combo_flags_new_with_model (GtkTreeModel *model);
82 void cg_combo_flags_popup (CgComboFlags *combo);
83 void cg_combo_flags_popdown (CgComboFlags *combo);
84 gboolean cg_combo_flags_editing_canceled (CgComboFlags *combo);
86 G_END_DECLS
88 #endif /* __CLASSGEN_COMBO_FLAGS_H__ */