core: show some visible feedback when dragging titlebars
[luccawm.git] / layout / lucca-layout-private.h
bloba579d4562dd5ff343cd98dd96186acfc9408f204
1 /* Copyright (c) 2008 Vincent Povirk
3 Permission is hereby granted, free of charge, to any person
4 obtaining a copy of this software and associated documentation
5 files (the "Software"), to deal in the Software without
6 restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following
10 conditions:
12 The above copyright notice and this permission notice shall be
13 included in all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef LUCCA_LAYOUT_PRIVATE_H
26 #define LUCCA_LAYOUT_PRIVATE_H
28 #include "lucca-layout.h"
29 #include "lucca-rect.h"
31 /* Private definitons for the Layout module */
33 struct _LuccaLayout {
34 GObject parent;
35 /* instance members */
36 guint width;
37 guint height;
38 guint border_size;
39 GSList* tiles;
41 LuccaRect rect;
43 gboolean dispose_has_run;
45 /* temporary variables used when resizing */
46 GSList* to_resize;
47 GSList* to_delete;
50 struct _LuccaLayoutClass {
51 GObjectClass parent;
52 /* class members */
53 guint new_tile_signal_id;
56 struct _LuccaLayoutTile {
57 GObject parent;
58 /* instance members */
59 gboolean valid;
60 LuccaLayout* layout;
61 LuccaRect rect;
62 GdkGeometry geometry;
63 GdkWindowHints geom_mask;
65 gboolean dispose_has_run;
67 /* temporary variables used when resizing */
68 LuccaRect new_rect;
69 gboolean new_valid;
72 struct _LuccaLayoutTileClass {
73 GObjectClass parent;
74 /* class members */
75 guint delete_signal_id;
76 guint configure_signal_id;
79 /* Convenience functions */
81 /* lucca_layout_newtile_at_point: returns the tile at a point using new_rect and new_valid */
82 LuccaLayoutTile* lucca_layout_newtile_at_point(LuccaLayout* layout, gint x, gint y);
84 /* tile_rect: returns a LuccaRect containing only the space in a tile that is not part of a border */
85 static LuccaRect tile_rect(LuccaLayoutTile* t) {
86 LuccaRect result = t->rect;
87 result.c[LUCCA_SIDE_RIGHT] -= t->layout->border_size;
88 result.c[LUCCA_SIDE_BOTTOM] -= t->layout->border_size;
89 return result;
92 /* lucca_layouttile_ensure_size: Make sure the given tile is at least as big as its geometry, resizing as necessary
93 This function does not emit the 'configure' or 'delete' signals; configured and deleted are linked lists that this function will update with tiles for which signals must be emitted. The caller must unref all deleted tiles.
95 void lucca_layouttile_ensure_size(LuccaLayoutTile* tile, GSList** configured, GSList** deleted);
97 /* lucca_layouttile_calc_resize: update temporary variables for a resize */
98 void lucca_layouttile_calc_resize(LuccaLayoutTile* tile, gint x, gint y, gint width, gint height);
100 #endif