]> Pileus Git - ~andy/gtk/blob - gtk/gtkwidgetprivate.h
Merge branch 'master' into broadway2
[~andy/gtk] / gtk / gtkwidgetprivate.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #ifndef __GTK_WIDGET_PRIVATE_H__
28 #define __GTK_WIDGET_PRIVATE_H__
29
30 G_BEGIN_DECLS
31
32 /* With GtkWidget, a widget may be requested
33  * its width for 2 or maximum 3 heights in one resize
34  * (Note this define is limited by the bitfield sizes
35  * defined on the SizeRequestCache structure).
36  */
37 #define GTK_SIZE_REQUEST_CACHED_SIZES   (3)
38
39 typedef struct
40 {
41   /* the size this request is for */
42   gint for_size;
43
44   gint minimum_size;
45   gint natural_size;
46 } SizeRequest;
47
48 typedef struct {
49   SizeRequest widths[GTK_SIZE_REQUEST_CACHED_SIZES];
50   SizeRequest heights[GTK_SIZE_REQUEST_CACHED_SIZES];
51
52   guint       cached_widths      : 2;
53   guint       cached_heights     : 2;
54   guint       last_cached_width  : 2;
55   guint       last_cached_height : 2;
56 } SizeRequestCache;
57
58 void         _gtk_widget_set_visible_flag   (GtkWidget *widget,
59                                              gboolean   visible);
60 gboolean     _gtk_widget_get_resize_pending (GtkWidget *widget);
61 void         _gtk_widget_set_resize_pending (GtkWidget *widget,
62                                              gboolean   resize_pending);
63 gboolean     _gtk_widget_get_in_reparent    (GtkWidget *widget);
64 void         _gtk_widget_set_in_reparent    (GtkWidget *widget,
65                                              gboolean   in_reparent);
66 gboolean     _gtk_widget_get_anchored       (GtkWidget *widget);
67 void         _gtk_widget_set_anchored       (GtkWidget *widget,
68                                              gboolean   anchored);
69 gboolean     _gtk_widget_get_shadowed       (GtkWidget *widget);
70 void         _gtk_widget_set_shadowed       (GtkWidget *widget,
71                                              gboolean   shadowed);
72 gboolean     _gtk_widget_get_alloc_needed   (GtkWidget *widget);
73 void         _gtk_widget_set_alloc_needed   (GtkWidget *widget,
74                                              gboolean   alloc_needed);
75 gboolean     _gtk_widget_get_width_request_needed  (GtkWidget *widget);
76 void         _gtk_widget_set_width_request_needed  (GtkWidget *widget,
77                                                     gboolean   width_request_needed);
78 gboolean     _gtk_widget_get_height_request_needed (GtkWidget *widget);
79 void         _gtk_widget_set_height_request_needed (GtkWidget *widget,
80                                                     gboolean   height_request_needed);
81
82 void _gtk_widget_override_size_request (GtkWidget *widget,
83                                         int        width,
84                                         int        height,
85                                         int       *old_width,
86                                         int       *old_height);
87 void _gtk_widget_restore_size_request  (GtkWidget *widget,
88                                         int        old_width,
89                                         int        old_height);
90
91 gboolean _gtk_widget_get_translation_to_window (GtkWidget      *widget,
92                                                 GdkWindow      *window,
93                                                 int            *x,
94                                                 int            *y);
95
96 G_END_DECLS
97
98 #endif /* __GTK_WIDGET_PRIVATE_H__ */