frames.c File Reference

Go to the source code of this file.

Data Structures

struct  CachedFramePiece
struct  CachedPixels

Defines

#define DEFAULT_INNER_BUTTON_BORDER   3
#define TIP_DELAY   450
#define DECORATING_BORDER   100
#define RESIZE_EXTENDS   15
#define TOP_RESIZE_HEIGHT   2

Functions

static void meta_frames_class_init (MetaFramesClass *klass)
static void meta_frames_init (MetaFrames *frames)
static void meta_frames_destroy (GtkObject *object)
static void meta_frames_finalize (GObject *object)
static void meta_frames_style_set (GtkWidget *widget, GtkStyle *prev_style)
static void meta_frames_realize (GtkWidget *widget)
static void meta_frames_unrealize (GtkWidget *widget)
static void meta_frames_update_prelit_control (MetaFrames *frames, MetaUIFrame *frame, MetaFrameControl control)
static gboolean meta_frames_button_press_event (GtkWidget *widget, GdkEventButton *event)
static gboolean meta_frames_button_release_event (GtkWidget *widget, GdkEventButton *event)
static gboolean meta_frames_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
static gboolean meta_frames_destroy_event (GtkWidget *widget, GdkEventAny *event)
static gboolean meta_frames_expose_event (GtkWidget *widget, GdkEventExpose *event)
static gboolean meta_frames_enter_notify_event (GtkWidget *widget, GdkEventCrossing *event)
static gboolean meta_frames_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event)
static void meta_frames_paint_to_drawable (MetaFrames *frames, MetaUIFrame *frame, GdkDrawable *drawable, GdkRegion *region, int x_offset, int y_offset)
static void meta_frames_set_window_background (MetaFrames *frames, MetaUIFrame *frame)
static void meta_frames_calc_geometry (MetaFrames *frames, MetaUIFrame *frame, MetaFrameGeometry *fgeom)
static void meta_frames_ensure_layout (MetaFrames *frames, MetaUIFrame *frame)
static MetaUIFramemeta_frames_lookup_window (MetaFrames *frames, Window xwindow)
static void meta_frames_font_changed (MetaFrames *frames)
static void meta_frames_button_layout_changed (MetaFrames *frames)
static GdkRectangle * control_rect (MetaFrameControl control, MetaFrameGeometry *fgeom)
static MetaFrameControl get_control (MetaFrames *frames, MetaUIFrame *frame, int x, int y)
static void clear_tip (MetaFrames *frames)
static void invalidate_all_caches (MetaFrames *frames)
static void invalidate_whole_window (MetaFrames *frames, MetaUIFrame *frame)
GtkType meta_frames_get_type (void)
static gint unsigned_long_equal (gconstpointer v1, gconstpointer v2)
static guint unsigned_long_hash (gconstpointer v)
static void prefs_changed_callback (MetaPreference pref, void *data)
static void listify_func (gpointer key, gpointer value, gpointer data)
static CachedPixelsget_cache (MetaFrames *frames, MetaUIFrame *frame)
static void invalidate_cache (MetaFrames *frames, MetaUIFrame *frame)
static gboolean invalidate_cache_timeout (gpointer data)
static void queue_recalc_func (gpointer key, gpointer value, gpointer data)
static void queue_draw_func (gpointer key, gpointer value, gpointer data)
MetaFramesmeta_frames_new (int screen_number)
void meta_frames_manage_window (MetaFrames *frames, Window xwindow, GdkWindow *window)
void meta_frames_unmanage_window (MetaFrames *frames, Window xwindow)
void meta_frames_get_geometry (MetaFrames *frames, Window xwindow, int *top_height, int *bottom_height, int *left_width, int *right_width)
void meta_frames_reset_bg (MetaFrames *frames, Window xwindow)
static void set_background_none (Display *xdisplay, Window xwindow)
void meta_frames_unflicker_bg (MetaFrames *frames, Window xwindow, int target_width, int target_height)
void meta_frames_apply_shapes (MetaFrames *frames, Window xwindow, int new_window_width, int new_window_height, gboolean window_has_shape)
void meta_frames_move_resize_frame (MetaFrames *frames, Window xwindow, int x, int y, int width, int height)
void meta_frames_queue_draw (MetaFrames *frames, Window xwindow)
void meta_frames_set_title (MetaFrames *frames, Window xwindow, const char *title)
void meta_frames_repaint_frame (MetaFrames *frames, Window xwindow)
static void show_tip_now (MetaFrames *frames)
static gboolean tip_timeout_func (gpointer data)
static void queue_tip (MetaFrames *frames)
static void redraw_control (MetaFrames *frames, MetaUIFrame *frame, MetaFrameControl control)
static gboolean meta_frame_titlebar_event (MetaUIFrame *frame, GdkEventButton *event, int action)
static gboolean meta_frame_double_click_event (MetaUIFrame *frame, GdkEventButton *event)
static gboolean meta_frame_middle_click_event (MetaUIFrame *frame, GdkEventButton *event)
static gboolean meta_frame_right_click_event (MetaUIFrame *frame, GdkEventButton *event)
void meta_frames_notify_menu_hide (MetaFrames *frames)
static GdkGC * get_bg_gc (GdkWindow *window, int x_offset, int y_offset)
static void clear_backing (GdkPixmap *pixmap, GdkWindow *window, int xoffset, int yoffset)
static GdkPixmap * generate_pixmap (MetaFrames *frames, MetaUIFrame *frame, MetaRectangle rect)
static void populate_cache (MetaFrames *frames, MetaUIFrame *frame)
static void clip_to_screen (GdkRegion *region, MetaUIFrame *frame)
static void subtract_from_region (GdkRegion *region, GdkDrawable *drawable, gint x, gint y)
static void cached_pixels_draw (CachedPixels *pixels, GdkWindow *window, GdkRegion *region)
void meta_frames_push_delay_exposes (MetaFrames *frames)
static void queue_pending_exposes_func (gpointer key, gpointer value, gpointer data)
void meta_frames_pop_delay_exposes (MetaFrames *frames)

Variables

static GtkWidgetClass * parent_class = NULL


Define Documentation

#define DECORATING_BORDER   100

Definition at line 2246 of file frames.c.

Referenced by meta_frames_paint_to_drawable().

#define DEFAULT_INNER_BUTTON_BORDER   3

Definition at line 42 of file frames.c.

#define RESIZE_EXTENDS   15

Definition at line 2640 of file frames.c.

Referenced by get_control().

#define TIP_DELAY   450

Definition at line 1172 of file frames.c.

Referenced by queue_tip().

#define TOP_RESIZE_HEIGHT   2

Definition at line 2641 of file frames.c.

Referenced by get_control().


Function Documentation

static void cached_pixels_draw ( CachedPixels pixels,
GdkWindow *  window,
GdkRegion *  region 
) [static]

static void clear_backing ( GdkPixmap *  pixmap,
GdkWindow *  window,
int  xoffset,
int  yoffset 
) [static]

Definition at line 2009 of file frames.c.

References get_bg_gc(), and TRUE.

Referenced by generate_pixmap().

static void clear_tip ( MetaFrames frames  )  [static]

static void clip_to_screen ( GdkRegion *  region,
MetaUIFrame frame 
) [static]

static GdkRectangle * control_rect ( MetaFrameControl  control,
MetaFrameGeometry fgeom 
) [static]

static GdkPixmap* generate_pixmap ( MetaFrames frames,
MetaUIFrame frame,
MetaRectangle  rect 
) [static]

static GdkGC* get_bg_gc ( GdkWindow *  window,
int  x_offset,
int  y_offset 
) [static]

Definition at line 1973 of file frames.c.

Referenced by clear_backing().

static CachedPixels* get_cache ( MetaFrames frames,
MetaUIFrame frame 
) [static]

Definition at line 296 of file frames.c.

References _MetaFrames::cache.

Referenced by invalidate_cache(), meta_frames_expose_event(), and populate_cache().

static MetaFrameControl get_control ( MetaFrames frames,
MetaUIFrame frame,
int  x,
int  y 
) [static]

Definition at line 2643 of file frames.c.

References _MetaFrameGeometry::above_rect, _MetaFrameGeometry::bottom_height, _MetaButtonSpace::clickable, _MetaFrameGeometry::close_rect, _MetaFrameGeometry::height, _MetaFrameGeometry::left_width, _MetaFrameGeometry::max_rect, _MetaFrameGeometry::menu_rect, meta_core_get(), META_CORE_GET_END, META_CORE_GET_FRAME_FLAGS, META_FRAME_ALLOWS_HORIZONTAL_RESIZE, META_FRAME_ALLOWS_VERTICAL_RESIZE, META_FRAME_CONTROL_ABOVE, META_FRAME_CONTROL_CLIENT_AREA, META_FRAME_CONTROL_DELETE, META_FRAME_CONTROL_MAXIMIZE, META_FRAME_CONTROL_MENU, META_FRAME_CONTROL_MINIMIZE, META_FRAME_CONTROL_NONE, META_FRAME_CONTROL_RESIZE_E, META_FRAME_CONTROL_RESIZE_N, META_FRAME_CONTROL_RESIZE_NE, META_FRAME_CONTROL_RESIZE_NW, META_FRAME_CONTROL_RESIZE_S, META_FRAME_CONTROL_RESIZE_SE, META_FRAME_CONTROL_RESIZE_SW, META_FRAME_CONTROL_RESIZE_W, META_FRAME_CONTROL_SHADE, META_FRAME_CONTROL_STICK, META_FRAME_CONTROL_TITLE, META_FRAME_CONTROL_UNABOVE, META_FRAME_CONTROL_UNMAXIMIZE, META_FRAME_CONTROL_UNSHADE, META_FRAME_CONTROL_UNSTICK, META_FRAME_MAXIMIZED, meta_frames_calc_geometry(), _MetaFrameGeometry::min_rect, POINT_IN_RECT, RESIZE_EXTENDS, _MetaFrameGeometry::right_width, _MetaFrameGeometry::shade_rect, _MetaFrameGeometry::stick_rect, _MetaFrameGeometry::title_rect, _MetaFrameGeometry::top_height, TOP_RESIZE_HEIGHT, _MetaFrameGeometry::unabove_rect, _MetaFrameGeometry::unshade_rect, _MetaFrameGeometry::unstick_rect, _MetaFrameGeometry::width, and _MetaUIFrame::xwindow.

Referenced by meta_frames_button_press_event(), meta_frames_button_release_event(), meta_frames_enter_notify_event(), meta_frames_motion_notify_event(), and show_tip_now().

static void invalidate_all_caches ( MetaFrames frames  )  [static]

static void invalidate_cache ( MetaFrames frames,
MetaUIFrame frame 
) [static]

static gboolean invalidate_cache_timeout ( gpointer  data  )  [static]

Definition at line 344 of file frames.c.

References FALSE, invalidate_all_caches(), and _MetaFrames::invalidate_cache_timeout_id.

Referenced by populate_cache().

static void invalidate_whole_window ( MetaFrames frames,
MetaUIFrame frame 
) [static]

static void listify_func ( gpointer  key,
gpointer  value,
gpointer  data 
) [static]

Definition at line 223 of file frames.c.

static gboolean meta_frame_double_click_event ( MetaUIFrame frame,
GdkEventButton *  event 
) [static]

static gboolean meta_frame_middle_click_event ( MetaUIFrame frame,
GdkEventButton *  event 
) [static]

static gboolean meta_frame_right_click_event ( MetaUIFrame frame,
GdkEventButton *  event 
) [static]

static gboolean meta_frame_titlebar_event ( MetaUIFrame frame,
GdkEventButton *  event,
int  action 
) [static]

void meta_frames_apply_shapes ( MetaFrames frames,
Window  xwindow,
int  new_window_width,
int  new_window_height,
gboolean  window_has_shape 
)

static void meta_frames_button_layout_changed ( MetaFrames frames  )  [static]

Definition at line 417 of file frames.c.

References _MetaFrames::frames, and queue_draw_func().

Referenced by prefs_changed_callback().

static gboolean meta_frames_button_press_event ( GtkWidget *  widget,
GdkEventButton *  event 
) [static]

Definition at line 1345 of file frames.c.

References clear_tip(), control_rect(), FALSE, get_control(), meta_core_begin_grab_op(), meta_core_get(), META_CORE_GET_END, META_CORE_GET_FRAME_FLAGS, meta_core_get_grab_op(), META_CORE_IS_TITLEBAR_ONSCREEN, meta_core_show_window_menu(), meta_core_user_focus(), META_DEBUG_FOCUS, META_FRAME_ALLOWS_MOVE, META_FRAME_CONTROL_ABOVE, META_FRAME_CONTROL_CLIENT_AREA, META_FRAME_CONTROL_DELETE, META_FRAME_CONTROL_MAXIMIZE, META_FRAME_CONTROL_MENU, META_FRAME_CONTROL_MINIMIZE, META_FRAME_CONTROL_RESIZE_E, META_FRAME_CONTROL_RESIZE_N, META_FRAME_CONTROL_RESIZE_NE, META_FRAME_CONTROL_RESIZE_NW, META_FRAME_CONTROL_RESIZE_S, META_FRAME_CONTROL_RESIZE_SE, META_FRAME_CONTROL_RESIZE_SW, META_FRAME_CONTROL_RESIZE_W, META_FRAME_CONTROL_SHADE, META_FRAME_CONTROL_STICK, META_FRAME_CONTROL_TITLE, META_FRAME_CONTROL_UNABOVE, META_FRAME_CONTROL_UNMAXIMIZE, META_FRAME_CONTROL_UNSHADE, META_FRAME_CONTROL_UNSTICK, meta_frame_double_click_event(), meta_frame_middle_click_event(), meta_frame_right_click_event(), META_FRAMES, meta_frames_calc_geometry(), meta_frames_lookup_window(), META_GRAB_OP_CLICKING_ABOVE, META_GRAB_OP_CLICKING_DELETE, META_GRAB_OP_CLICKING_MAXIMIZE, META_GRAB_OP_CLICKING_MENU, META_GRAB_OP_CLICKING_MINIMIZE, META_GRAB_OP_CLICKING_SHADE, META_GRAB_OP_CLICKING_STICK, META_GRAB_OP_CLICKING_UNABOVE, META_GRAB_OP_CLICKING_UNMAXIMIZE, META_GRAB_OP_CLICKING_UNSHADE, META_GRAB_OP_CLICKING_UNSTICK, META_GRAB_OP_MOVING, META_GRAB_OP_NONE, META_GRAB_OP_RESIZING_E, META_GRAB_OP_RESIZING_N, META_GRAB_OP_RESIZING_NE, META_GRAB_OP_RESIZING_NW, META_GRAB_OP_RESIZING_S, META_GRAB_OP_RESIZING_SE, META_GRAB_OP_RESIZING_SW, META_GRAB_OP_RESIZING_W, META_UI_DIRECTION_RTL, meta_ui_get_direction(), NULL, _MetaUIFrame::prelit_control, redraw_control(), TRUE, and _MetaUIFrame::xwindow.

Referenced by meta_frames_class_init().

static gboolean meta_frames_button_release_event ( GtkWidget *  widget,
GdkEventButton *  event 
) [static]

static void meta_frames_calc_geometry ( MetaFrames frames,
MetaUIFrame frame,
MetaFrameGeometry fgeom 
) [static]

static void meta_frames_class_init ( MetaFramesClass klass  )  [static]

static void meta_frames_destroy ( GtkObject *  object  )  [static]

static gboolean meta_frames_destroy_event ( GtkWidget *  widget,
GdkEventAny *  event 
) [static]

Definition at line 1956 of file frames.c.

References FALSE, META_FRAMES, meta_frames_lookup_window(), NULL, and TRUE.

Referenced by meta_frames_class_init().

static void meta_frames_ensure_layout ( MetaFrames frames,
MetaUIFrame frame 
) [static]

static gboolean meta_frames_enter_notify_event ( GtkWidget *  widget,
GdkEventCrossing *  event 
) [static]

static gboolean meta_frames_expose_event ( GtkWidget *  widget,
GdkEventExpose *  event 
) [static]

static void meta_frames_finalize ( GObject *  object  )  [static]

static void meta_frames_font_changed ( MetaFrames frames  )  [static]

void meta_frames_get_geometry ( MetaFrames frames,
Window  xwindow,
int *  top_height,
int *  bottom_height,
int *  left_width,
int *  right_width 
)

GtkType meta_frames_get_type ( void   ) 

Definition at line 109 of file frames.c.

References meta_frames_class_init(), meta_frames_init(), and NULL.

static void meta_frames_init ( MetaFrames frames  )  [static]

static gboolean meta_frames_leave_notify_event ( GtkWidget *  widget,
GdkEventCrossing *  event 
) [static]

static MetaUIFrame * meta_frames_lookup_window ( MetaFrames frames,
Window  xwindow 
) [static]

void meta_frames_manage_window ( MetaFrames frames,
Window  xwindow,
GdkWindow *  window 
)

static gboolean meta_frames_motion_notify_event ( GtkWidget *  widget,
GdkEventMotion *  event 
) [static]

void meta_frames_move_resize_frame ( MetaFrames frames,
Window  xwindow,
int  x,
int  y,
int  width,
int  height 
)

MetaFrames* meta_frames_new ( int  screen_number  ) 

Definition at line 552 of file frames.c.

References META_TYPE_FRAMES, NULL, and screen.

Referenced by meta_ui_new().

void meta_frames_notify_menu_hide ( MetaFrames frames  ) 

static void meta_frames_paint_to_drawable ( MetaFrames frames,
MetaUIFrame frame,
GdkDrawable *  drawable,
GdkRegion *  region,
int  x_offset,
int  y_offset 
) [static]

Definition at line 2249 of file frames.c.

References button_layout, DECORATING_BORDER, _MetaUIFrame::layout, META_BUTTON_STATE_NORMAL, META_BUTTON_STATE_PRELIGHT, META_BUTTON_STATE_PRESSED, META_BUTTON_TYPE_ABOVE, META_BUTTON_TYPE_CLOSE, META_BUTTON_TYPE_LAST, META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND, META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND, META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND, META_BUTTON_TYPE_MAXIMIZE, META_BUTTON_TYPE_MENU, META_BUTTON_TYPE_MINIMIZE, META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND, META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND, META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND, META_BUTTON_TYPE_SHADE, META_BUTTON_TYPE_STICK, META_BUTTON_TYPE_UNABOVE, META_BUTTON_TYPE_UNSHADE, META_BUTTON_TYPE_UNSTICK, meta_core_get(), META_CORE_GET_CLIENT_HEIGHT, META_CORE_GET_CLIENT_WIDTH, META_CORE_GET_END, META_CORE_GET_FRAME_FLAGS, META_CORE_GET_FRAME_TYPE, meta_core_get_grab_frame(), meta_core_get_grab_op(), META_CORE_GET_ICON, META_CORE_GET_MINI_ICON, META_CORE_GET_SCREEN_HEIGHT, META_CORE_GET_SCREEN_WIDTH, META_FRAME_CONTROL_ABOVE, META_FRAME_CONTROL_DELETE, META_FRAME_CONTROL_MAXIMIZE, META_FRAME_CONTROL_MENU, META_FRAME_CONTROL_MINIMIZE, META_FRAME_CONTROL_SHADE, META_FRAME_CONTROL_STICK, META_FRAME_CONTROL_UNABOVE, META_FRAME_CONTROL_UNMAXIMIZE, META_FRAME_CONTROL_UNSHADE, META_FRAME_CONTROL_UNSTICK, meta_frames_ensure_layout(), META_GRAB_OP_CLICKING_ABOVE, META_GRAB_OP_CLICKING_DELETE, META_GRAB_OP_CLICKING_MAXIMIZE, META_GRAB_OP_CLICKING_MENU, META_GRAB_OP_CLICKING_MINIMIZE, META_GRAB_OP_CLICKING_SHADE, META_GRAB_OP_CLICKING_STICK, META_GRAB_OP_CLICKING_UNABOVE, META_GRAB_OP_CLICKING_UNMAXIMIZE, META_GRAB_OP_CLICKING_UNSHADE, META_GRAB_OP_CLICKING_UNSTICK, META_GRAB_OP_NONE, meta_prefs_get_button_layout(), meta_theme_draw_frame(), meta_theme_get_current(), meta_theme_get_frame_borders(), NULL, _MetaUIFrame::prelit_control, screen_height, screen_width, _MetaUIFrame::text_height, and _MetaUIFrame::xwindow.

Referenced by generate_pixmap(), meta_frames_expose_event(), and meta_frames_unflicker_bg().

void meta_frames_pop_delay_exposes ( MetaFrames frames  ) 

void meta_frames_push_delay_exposes ( MetaFrames frames  ) 

Definition at line 2798 of file frames.c.

References _MetaFrames::expose_delay_count.

Referenced by meta_ui_push_delay_exposes().

void meta_frames_queue_draw ( MetaFrames frames,
Window  xwindow 
)

Definition at line 999 of file frames.c.

References invalidate_whole_window(), and meta_frames_lookup_window().

Referenced by meta_ui_queue_frame_draw().

static void meta_frames_realize ( GtkWidget *  widget  )  [static]

Definition at line 644 of file frames.c.

References parent_class.

Referenced by meta_frames_class_init().

void meta_frames_repaint_frame ( MetaFrames frames,
Window  xwindow 
)

Definition at line 1033 of file frames.c.

References meta_frames_lookup_window().

Referenced by meta_ui_repaint_frame().

void meta_frames_reset_bg ( MetaFrames frames,
Window  xwindow 
)

Definition at line 706 of file frames.c.

References meta_frames_lookup_window(), and meta_frames_set_window_background().

Referenced by meta_ui_reset_frame_bg().

void meta_frames_set_title ( MetaFrames frames,
Window  xwindow,
const char *  title 
)

static void meta_frames_set_window_background ( MetaFrames frames,
MetaUIFrame frame 
) [static]

static void meta_frames_style_set ( GtkWidget *  widget,
GtkStyle *  prev_style 
) [static]

Definition at line 424 of file frames.c.

References META_FRAMES, meta_frames_font_changed(), and parent_class.

Referenced by meta_frames_class_init().

void meta_frames_unflicker_bg ( MetaFrames frames,
Window  xwindow,
int  target_width,
int  target_height 
)

void meta_frames_unmanage_window ( MetaFrames frames,
Window  xwindow 
)

static void meta_frames_unrealize ( GtkWidget *  widget  )  [static]

Definition at line 651 of file frames.c.

References parent_class.

Referenced by meta_frames_class_init().

static void meta_frames_update_prelit_control ( MetaFrames frames,
MetaUIFrame frame,
MetaFrameControl  control 
) [static]

static void populate_cache ( MetaFrames frames,
MetaUIFrame frame 
) [static]

static void prefs_changed_callback ( MetaPreference  pref,
void *  data 
) [static]

static void queue_draw_func ( gpointer  key,
gpointer  value,
gpointer  data 
) [static]

static void queue_pending_exposes_func ( gpointer  key,
gpointer  value,
gpointer  data 
) [static]

static void queue_recalc_func ( gpointer  key,
gpointer  value,
gpointer  data 
) [static]

static void queue_tip ( MetaFrames frames  )  [static]

static void redraw_control ( MetaFrames frames,
MetaUIFrame frame,
MetaFrameControl  control 
) [static]

static void set_background_none ( Display *  xdisplay,
Window  xwindow 
) [static]

Definition at line 717 of file frames.c.

Referenced by meta_frames_unflicker_bg().

static void show_tip_now ( MetaFrames frames  )  [static]

static void subtract_from_region ( GdkRegion *  region,
GdkDrawable *  drawable,
gint  x,
gint  y 
) [static]

Definition at line 2161 of file frames.c.

Referenced by cached_pixels_draw().

static gboolean tip_timeout_func ( gpointer  data  )  [static]

Definition at line 1161 of file frames.c.

References FALSE, and show_tip_now().

Referenced by queue_tip().

static gint unsigned_long_equal ( gconstpointer  v1,
gconstpointer  v2 
) [static]

Definition at line 164 of file frames.c.

Referenced by meta_frames_init().

static guint unsigned_long_hash ( gconstpointer  v  )  [static]

Definition at line 171 of file frames.c.

Referenced by meta_frames_init().


Variable Documentation

GtkWidgetClass* parent_class = NULL [static]


Generated on Sat Aug 23 22:04:22 2008 for metacity by  doxygen 1.5.5