frame.h 2.44 KB
Newer Older
rhp's avatar
...    
rhp committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Metacity X window decorations */

/* 
 * Copyright (C) 2001 Havoc Pennington
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#ifndef META_FRAME_H
#define META_FRAME_H

#include "window.h"

rhp's avatar
...    
rhp committed
27
28
29
30
typedef enum
{
  META_FRAME_ACTION_NONE,
  META_FRAME_ACTION_MOVING,
rhp's avatar
...    
rhp committed
31
  META_FRAME_ACTION_DELETING,
rhp's avatar
...    
rhp committed
32
  META_FRAME_ACTION_TOGGLING_MAXIMIZE,
rhp's avatar
...    
rhp committed
33
  META_FRAME_ACTION_RESIZING_SE
rhp's avatar
...    
rhp committed
34
35
} MetaFrameAction;

rhp's avatar
...    
rhp committed
36
37
typedef struct _MetaFrameActionGrab MetaFrameActionGrab;

rhp's avatar
...    
rhp committed
38
39
40
41
42
43
44
45
struct _MetaFrame
{
  /* window we frame */
  MetaWindow *window;

  /* reparent window */
  Window xwindow;

rhp's avatar
...    
rhp committed
46
  /* This rect is trusted info from where we put the
rhp's avatar
...    
rhp committed
47
48
   * frame, not the result of ConfigureNotify
   */
rhp's avatar
...    
rhp committed
49
  MetaRectangle rect;
rhp's avatar
...    
rhp committed
50
51
  int child_x;
  int child_y;
rhp's avatar
...    
rhp committed
52
53
  int right_width;
  int bottom_height;
rhp's avatar
...    
rhp committed
54
  
rhp's avatar
...    
rhp committed
55
  gpointer theme_data;
rhp's avatar
...    
rhp committed
56
  gulong bg_pixel;
rhp's avatar
...    
rhp committed
57

rhp's avatar
...    
rhp committed
58
59
60
61
62
63
  MetaFrameActionGrab *grab;

  MetaFrameControl current_control;

  guint tooltip_timeout;
  
rhp's avatar
...    
rhp committed
64
  guint theme_acquired : 1;
rhp's avatar
...    
rhp committed
65
  guint mapped : 1;
rhp's avatar
...    
rhp committed
66
67
};

rhp's avatar
...    
rhp committed
68
69
70
71
72
73
void     meta_window_ensure_frame           (MetaWindow *window);
void     meta_window_destroy_frame          (MetaWindow *window);
void     meta_frame_queue_draw              (MetaFrame  *frame);
gboolean meta_frame_event                   (MetaFrame  *frame,
                                             XEvent     *event);

rhp's avatar
...    
rhp committed
74
75
76
77
78
/* These three should ONLY be called from meta_window_move_resize_internal */
void meta_frame_calc_geometry      (MetaFrame         *frame,
                                    int                child_width,
                                    int                child_height,
                                    MetaFrameGeometry *geomp);
rhp's avatar
...    
rhp committed
79
80
81
void meta_frame_sync_to_window     (MetaFrame         *frame,
                                    gboolean           need_move,
                                    gboolean           need_resize);
rhp's avatar
...    
rhp committed
82
83
84


#endif
rhp's avatar
...    
rhp committed
85
86
87
88