14db4fcc651456904f51bc7de5e1c874887a9537
[pspp-builds.git] / src / ui / gui / customentry.h
1 /*
2    PSPPIRE --- A Graphical User Interface for PSPP
3    Copyright (C) 2005  Free Software Foundation
4
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.
9
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 General Public License for more details.
14
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
18    02110-1301, USA.
19 */
20
21 /*
22    This widget is a subclass of GtkEntry.  It's an entry widget with a
23    button on the right hand side.
24
25    This code is heavily based upon the GtkSpinButton widget.  Therefore
26    the copyright notice of that code is pasted below.
27
28    Please note however,  this code is covered by the GPL, not the LGPL.
29 */
30
31 /* GTK - The GIMP Toolkit
32  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
33  *
34  * GtkSpinButton widget for GTK+
35  * Copyright (C) 1998 Lars Hamann and Stefan Jeske
36  *
37  * This library is free software; you can redistribute it and/or
38  * modify it under the terms of the GNU Lesser General Public
39  * License as published by the Free Software Foundation; either
40  * version 2 of the License, or (at your option) any later version.
41  *
42  * This library is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
45  * Lesser General Public License for more details.
46  *
47  * You should have received a copy of the GNU Lesser General Public
48  * License along with this library; if not, write to the
49  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
50  * Boston, MA 02111-1307, USA.
51  */
52
53 /*
54  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
55  * file for a list of people on the GTK+ Team.  See the ChangeLog
56  * files for a list of changes.  These files are distributed with
57  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
58  */
59
60
61 #ifndef __PSPPIRE_CUSTOM_ENTRY_H__
62 #define __PSPPIRE_CUSTOM_ENTRY_H__
63
64
65 #include <glib.h>
66 #include <glib-object.h>
67
68
69 GType psppire_custom_entry_get_type (void);
70
71 G_BEGIN_DECLS
72
73 #define PSPPIRE_CUSTOM_ENTRY_TYPE (psppire_custom_entry_get_type ())
74
75 #define PSPPIRE_CUSTOM_ENTRY(obj)            \
76      (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPPIRE_CUSTOM_ENTRY_TYPE, PsppireCustomEntry))
77
78 #define PSPPIRE_CUSTOM_ENTRY_CLASS(klass)    \
79      (G_TYPE_CHECK_CLASS_CAST ((klass),PSPPIRE_CUSTOM_ENTRY_TYPE, PsppireCustomEntryClass))
80
81 #define PSPPIRE_IS_CUSTOM_ENTRY(obj)         \
82      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_CUSTOM_ENTRY_TYPE))
83
84 #define IS_PSPPIRE_CUSTOM_ENTRY_CLASS(klass) \
85      (G_TYPE_CHECK_CLASS_TYPE ((klass),  PSPPIRE_CUSTOM_ENTRY_TYPE))
86
87
88 typedef struct _PsppireCustomEntry       PsppireCustomEntry;
89 typedef struct _PsppireCustomEntryClass  PsppireCustomEntryClass;
90
91 struct _PsppireCustomEntry
92 {
93   GtkEntry entry;
94
95   GdkWindow *panel;
96 };
97
98 struct _PsppireCustomEntryClass
99 {
100   GtkEntryClass parent_class;
101
102   void (*clicked)  (PsppireCustomEntry *spin_button);
103
104 };
105
106 GType          custom_entry_get_type        (void);
107 GtkWidget*     custom_entry_new             (void);
108
109 G_END_DECLS
110
111 #endif /* __PSPPIRE_CUSTOM_ENTRY_H__ */