Debian Codegraph @

src/af/xap/gtk/xap_UnixTableWidget.h

raw
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3 * xap_TableWidget.h
4 * Copyright 2002, Joaquin Cuenca Abela
5 *
6 * Authors:
7 * Joaquin Cuenca Abela ([email protected])
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License, version 2, as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA.
22 */
23
24 #ifndef ABI_TABLE_H
25 #define ABI_TABLE_H
26
27 #include <gtk/gtk.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define ABITABLE_TYPE_WIDGET (abi_table_get_type ())
34 #define ABITABLE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ABITABLE_TYPE_WIDGET, AbiTable))
35 #define IS_ABITABLE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ABITABLE_TYPE_WIDGET))
36 #define IS_ABITABLE_WIDGET_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST((obj), ABITABLE_TYPE_WIDGET))
37 #define ABITABLE_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ABITABLE_TYPE_WIDGET,AbiTableClass))
38
39 typedef struct _AbiTable
40 {
41 GtkButton button;
42
43 /*<private>*/
44 GtkStockItem stock_item;
45
46 GtkWidget* button_box;
47 GtkWidget* label;
48 GtkWidget* icon;
49
50 GtkWindow* window;
51 GtkBox* window_vbox;
52 GtkDrawingArea* area;
53 GtkLabel* window_label;
54 GSList* handlers;
55
56 #if !GTK_CHECK_VERSION(3,0,0)
57 GdkGC* selected_gc;
58 #else
59 GtkStyleContext* style_context;
60 #endif
61
62 gint pos_x;
63 gint pos_y;
64 guint selected_rows;
65 guint selected_cols;
66
67 guint total_rows;
68 guint total_cols;
69
70 guint max_rows;
71 guint max_cols;
72 gchar * szTable;
73 gchar * szCancel;
74 } AbiTable;
75
76 typedef struct
77 {
78 GtkButtonClass parent_class;
79
80 /* Signals emited by this widget */
81 void (* selected) (AbiTable *abi_table, guint rows, guint cols);
82 } AbiTableClass;
83
84
85 GType abi_table_get_type (void);
86 GtkWidget *abi_table_new (void);
87
88 /* sets the number of selected rows & cols */
89 void abi_table_set_selected (AbiTable* abi_table, guint rows, guint cols);
90 /* gets the number of selected rows & cols */
91 void abi_table_get_selected (const AbiTable* abi_table, guint* rows, guint* cols);
92
93 /* sets the maximum number of selected rows & cols */
94 void abi_table_set_max_size (AbiTable* abi_table, guint rows, guint cols);
95 /* gets the maximum number of selected rows & cols */
96 void abi_table_get_max_size (const AbiTable* abi_table, guint* rows, guint* cols);
97
98 /* Sets the labels */
99 void abi_table_set_labels(AbiTable* abi_table, const gchar * szTable, const gchar * szCancel);
100
101 /* Returns the label widget */
102
103 GtkWidget * abi_table_get_label(AbiTable* abi_table);
104
105 /* Sets the table icon to the gtk_image cast as GtkWidget */
106
107 void abi_table_set_icon(AbiTable* abi_table, GtkWidget* icon);
108
109 #ifdef __cplusplus
110 }
111 #endif
112
113 #endif /* ABI_TABLE_H */