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