marco 1.29.1
Window manager
Loading...
Searching...
No Matches
tabpopup.c File Reference
View source
#include <config.h>
#include "util.h"
#include "core.h"
#include "tabpopup.h"
#include "theme.h"
#include "prefs.h"
#include "screen.h"
#include "../core/workspace.h"
#include "../core/frame-private.h"
#include "draw-workspace.h"
#include <gtk/gtk.h>
#include <gtk/gtk-a11y.h>
#include <gdk/gdkx.h>
#include <math.h>
Include dependency graph for tabpopup.c:

Data Structures

struct  _TabEntry
 
struct  _MetaTabPopup
 
struct  _MetaSelectImage
 
struct  _MetaSelectImageClass
 
struct  _MetaSelectWorkspace
 
struct  _MetaSelectWorkspaceClass
 

Macros

#define OUTSIDE_SELECT_RECT   8
 
#define INSIDE_SELECT_RECT   8
 
#define META_TYPE_SELECT_IMAGE   (meta_select_image_get_type ())
 
#define META_SELECT_IMAGE(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_IMAGE, MetaSelectImage))
 
#define META_TYPE_SELECT_WORKSPACE   (meta_select_workspace_get_type ())
 
#define META_SELECT_WORKSPACE(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_WORKSPACE, MetaSelectWorkspace))
 
#define SELECT_OUTLINE_WIDTH   2
 
#define MINI_WORKSPACE_SCREEN_FRACTION   0.33
 

Typedefs

typedef struct _TabEntry TabEntry
 
typedef GtkWindowAccessibleClass MetaTabPopupWindowAccessibleClass
 
typedef GtkWindowAccessible MetaTabPopupWindowAccessible
 
typedef GtkWindowClass MetaTabPopupWindowClass
 
typedef GtkWindow MetaTabPopupWindow
 
typedef struct _MetaSelectImage MetaSelectImage
 
typedef struct _MetaSelectImageClass MetaSelectImageClass
 
typedef struct _MetaSelectWorkspace MetaSelectWorkspace
 
typedef struct _MetaSelectWorkspaceClass MetaSelectWorkspaceClass
 

Functions

static GType meta_tab_popup_window_get_type (void)
 
static GType meta_tab_popup_window_accessible_get_type (void)
 
static GtkWidget * selectable_image_new (GdkPixbuf *pixbuf, cairo_surface_t *win_surface)
 
static void select_image (GtkWidget *widget)
 
static void unselect_image (GtkWidget *widget)
 
static GtkWidget * selectable_workspace_new (MetaWorkspace *workspace, int entry_count)
 
static void select_workspace (GtkWidget *widget)
 
static void unselect_workspace (GtkWidget *widget)
 
static AtkStateSet * meta_tab_popup_window_accessible_ref_state_set (AtkObject *accessible)
 
static void meta_tab_popup_window_accessible_class_init (MetaTabPopupWindowAccessibleClass *cls)
 
static void meta_tab_popup_window_accessible_init (MetaTabPopupWindowAccessible *self)
 
static void meta_tab_popup_window_class_init (MetaTabPopupWindowClass *cls)
 
static void meta_tab_popup_window_init (MetaTabPopupWindow *self)
 
static GtkWidget * meta_tab_popup_window_new (void)
 
static gboolean outline_window_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
 
static void popup_window_screen_changed (GtkWidget *widget, GdkScreen *old_screen, gpointer data)
 
static GdkPixbuf * dimm_icon (GdkPixbuf *pixbuf)
 
static TabEntry * tab_entry_new (const MetaTabEntry *entry, gboolean outline, gint scale)
 
static gboolean screen_use_osd_style (MetaScreen *screen)
 
MetaTabPopup * meta_ui_tab_popup_new (const MetaTabEntry *entries, MetaScreen *meta_screen, int entry_count, int width, gboolean expand_for_titles, gint border)
 
static void free_tab_entry (gpointer data, gpointer user_data)
 
void meta_ui_tab_popup_free (MetaTabPopup *popup)
 
void meta_ui_tab_popup_set_showing (MetaTabPopup *popup, gboolean showing)
 
static void display_entry (MetaTabPopup *popup, TabEntry *te)
 
void meta_ui_tab_popup_forward (MetaTabPopup *popup)
 
void meta_ui_tab_popup_backward (MetaTabPopup *popup)
 
static void display_widget (MetaTabPopup *popup, GtkWidget *w)
 
void meta_ui_tab_popup_down (MetaTabPopup *popup)
 
void meta_ui_tab_popup_up (MetaTabPopup *popup)
 
MetaTabEntryKey meta_ui_tab_popup_get_selected (MetaTabPopup *popup)
 
void meta_ui_tab_popup_select (MetaTabPopup *popup, MetaTabEntryKey key)
 
GtkWidget * meta_ui_tab_popup_get_widget (MetaTabPopup *popup)
 
void meta_ui_tab_popup_mouse_press (MetaTabPopup *popup, gint x, gint y)
 
static GType meta_select_image_get_type (void)
 
static void meta_select_image_class_init (MetaSelectImageClass *klass, void *data)
 
static gboolean meta_select_image_draw (GtkWidget *widget, cairo_t *cr)
 
static void meta_select_image_get_preferred_width (GtkWidget *widget, gint *minimum_width, gint *natural_width)
 
static void meta_select_image_get_preferred_height (GtkWidget *widget, gint *minimum_height, gint *natural_height)
 
static GType meta_select_workspace_get_type (void)
 
static void meta_select_workspace_class_init (MetaSelectWorkspaceClass *klass, void *data)
 
static gboolean meta_select_workspace_draw (GtkWidget *widget, cairo_t *cr)
 
static WnckWindowDisplayInfo meta_convert_meta_to_wnck (MetaWindow *window, MetaScreen *screen)
 meta_convert_meta_to_wnck() converts a MetaWindow to a WnckWindowDisplayInfo window that is used to build a thumbnail of a workspace.
 

Variables

static GtkImageClass * parent_class
 

Macro Definition Documentation

◆ INSIDE_SELECT_RECT

#define INSIDE_SELECT_RECT   8

◆ META_SELECT_IMAGE

#define META_SELECT_IMAGE (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_IMAGE, MetaSelectImage))

◆ META_SELECT_WORKSPACE

#define META_SELECT_WORKSPACE (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_WORKSPACE, MetaSelectWorkspace))

◆ META_TYPE_SELECT_IMAGE

#define META_TYPE_SELECT_IMAGE   (meta_select_image_get_type ())

◆ META_TYPE_SELECT_WORKSPACE

#define META_TYPE_SELECT_WORKSPACE   (meta_select_workspace_get_type ())

◆ MINI_WORKSPACE_SCREEN_FRACTION

#define MINI_WORKSPACE_SCREEN_FRACTION   0.33

◆ OUTSIDE_SELECT_RECT

#define OUTSIDE_SELECT_RECT   8

◆ SELECT_OUTLINE_WIDTH

#define SELECT_OUTLINE_WIDTH   2

Typedef Documentation

◆ MetaSelectImage

◆ MetaSelectImageClass

◆ MetaSelectWorkspace

◆ MetaSelectWorkspaceClass

◆ MetaTabPopupWindow

typedef GtkWindow MetaTabPopupWindow

◆ MetaTabPopupWindowAccessible

typedef GtkWindowAccessible MetaTabPopupWindowAccessible

◆ MetaTabPopupWindowAccessibleClass

typedef GtkWindowAccessibleClass MetaTabPopupWindowAccessibleClass

◆ MetaTabPopupWindowClass

typedef GtkWindowClass MetaTabPopupWindowClass

◆ TabEntry

typedef struct _TabEntry TabEntry

Function Documentation

◆ dimm_icon()

static GdkPixbuf * dimm_icon ( GdkPixbuf *  pixbuf)
static

References FALSE.

Referenced by tab_entry_new().

◆ display_entry()

◆ display_widget()

static void display_widget ( MetaTabPopup *  popup,
GtkWidget *  w 
)
static

References _MetaTabPopup::current, display_entry(), _MetaTabPopup::entries, and NULL.

Referenced by meta_ui_tab_popup_down(), and meta_ui_tab_popup_up().

Here is the call graph for this function:

◆ free_tab_entry()

static void free_tab_entry ( gpointer  data,
gpointer  user_data 
)
static

◆ meta_convert_meta_to_wnck()

◆ meta_select_image_class_init()

static void meta_select_image_class_init ( MetaSelectImageClass *  klass,
void *  data 
)
static

References meta_select_image_draw(), meta_select_image_get_preferred_height(), meta_select_image_get_preferred_width(), and parent_class.

Referenced by meta_select_image_get_type().

Here is the call graph for this function:

◆ meta_select_image_draw()

static gboolean meta_select_image_draw ( GtkWidget *  widget,
cairo_t *  cr 
)
static

References INSIDE_SELECT_RECT, meta_gtk_style_get_dark_color(), meta_gtk_style_get_light_color(), meta_screen_for_x_screen(), META_SELECT_IMAGE, OUTSIDE_SELECT_RECT, parent_class, screen, and screen_use_osd_style().

Referenced by meta_select_image_class_init().

Here is the call graph for this function:

◆ meta_select_image_get_preferred_height()

static void meta_select_image_get_preferred_height ( GtkWidget *  widget,
gint *  minimum_height,
gint *  natural_height 
)
static

◆ meta_select_image_get_preferred_width()

static void meta_select_image_get_preferred_width ( GtkWidget *  widget,
gint *  minimum_width,
gint *  natural_width 
)
static

◆ meta_select_image_get_type()

GType meta_select_image_get_type ( void  )
static

References meta_select_image_class_init(), and NULL.

Referenced by selectable_image_new().

Here is the call graph for this function:

◆ meta_select_workspace_class_init()

static void meta_select_workspace_class_init ( MetaSelectWorkspaceClass *  klass,
void *  data 
)
static

References meta_select_workspace_draw().

Referenced by meta_select_workspace_get_type().

Here is the call graph for this function:

◆ meta_select_workspace_draw()

◆ meta_select_workspace_get_type()

GType meta_select_workspace_get_type ( void  )
static

References meta_select_workspace_class_init(), and NULL.

Referenced by selectable_workspace_new().

Here is the call graph for this function:

◆ meta_tab_popup_window_accessible_class_init()

static void meta_tab_popup_window_accessible_class_init ( MetaTabPopupWindowAccessibleClass *  cls)
static

References meta_tab_popup_window_accessible_ref_state_set().

Here is the call graph for this function:

◆ meta_tab_popup_window_accessible_get_type()

static GType meta_tab_popup_window_accessible_get_type ( void  )
static

◆ meta_tab_popup_window_accessible_init()

static void meta_tab_popup_window_accessible_init ( MetaTabPopupWindowAccessible *  self)
static

◆ meta_tab_popup_window_accessible_ref_state_set()

static AtkStateSet * meta_tab_popup_window_accessible_ref_state_set ( AtkObject *  accessible)
static

◆ meta_tab_popup_window_class_init()

static void meta_tab_popup_window_class_init ( MetaTabPopupWindowClass *  cls)
static

References meta_tab_popup_window_accessible_get_type().

Here is the call graph for this function:

◆ meta_tab_popup_window_get_type()

static GType meta_tab_popup_window_get_type ( void  )
static

◆ meta_tab_popup_window_init()

static void meta_tab_popup_window_init ( MetaTabPopupWindow *  self)
static

◆ meta_tab_popup_window_new()

static GtkWidget * meta_tab_popup_window_new ( void  )
static

References meta_tab_popup_window_get_type(), and NULL.

Referenced by meta_ui_tab_popup_new().

Here is the call graph for this function:

◆ meta_ui_tab_popup_backward()

void meta_ui_tab_popup_backward ( MetaTabPopup *  popup)

References _MetaTabPopup::current, display_entry(), _MetaTabPopup::entries, and NULL.

Referenced by process_tab_grab().

Here is the call graph for this function:

◆ meta_ui_tab_popup_down()

void meta_ui_tab_popup_down ( MetaTabPopup *  popup)

References _MetaTabPopup::current, display_widget(), _MetaTabPopup::grid, _TabEntry::grid_left, _TabEntry::grid_top, and NULL.

Referenced by process_tab_grab().

Here is the call graph for this function:

◆ meta_ui_tab_popup_forward()

void meta_ui_tab_popup_forward ( MetaTabPopup *  popup)

References _MetaTabPopup::current, display_entry(), _MetaTabPopup::entries, and NULL.

Referenced by process_tab_grab().

Here is the call graph for this function:

◆ meta_ui_tab_popup_free()

void meta_ui_tab_popup_free ( MetaTabPopup *  popup)

References _MetaTabPopup::entries, free_tab_entry(), NULL, _MetaTabPopup::outline_window, and _MetaTabPopup::window.

Referenced by meta_display_end_grab_op(), and on_monitors_changed().

Here is the call graph for this function:

◆ meta_ui_tab_popup_get_selected()

MetaTabEntryKey meta_ui_tab_popup_get_selected ( MetaTabPopup *  popup)

◆ meta_ui_tab_popup_get_widget()

GtkWidget * meta_ui_tab_popup_get_widget ( MetaTabPopup *  popup)

References NULL, and _MetaTabPopup::window.

Referenced by mouse_event_is_in_tab_popup().

◆ meta_ui_tab_popup_mouse_press()

void meta_ui_tab_popup_mouse_press ( MetaTabPopup *  popup,
gint  x,
gint  y 
)

References _MetaTabPopup::current, display_entry(), _MetaTabPopup::entries, FALSE, NULL, _TabEntry::widget, and _MetaTabPopup::window.

Referenced by event_callback().

Here is the call graph for this function:

◆ meta_ui_tab_popup_new()

◆ meta_ui_tab_popup_select()

void meta_ui_tab_popup_select ( MetaTabPopup *  popup,
MetaTabEntryKey  key 
)

References _MetaTabPopup::current, display_entry(), _MetaTabPopup::entries, _TabEntry::key, and NULL.

Referenced by do_choose_window(), handle_workspace_switch_or_move(), and process_workspace_switch_grab().

Here is the call graph for this function:

◆ meta_ui_tab_popup_set_showing()

void meta_ui_tab_popup_set_showing ( MetaTabPopup *  popup,
gboolean  showing 
)

References meta_core_increment_event_serial(), and _MetaTabPopup::window.

Referenced by do_choose_window(), and handle_workspace_switch_or_move().

Here is the call graph for this function:

◆ meta_ui_tab_popup_up()

void meta_ui_tab_popup_up ( MetaTabPopup *  popup)

References _MetaTabPopup::current, display_widget(), _MetaTabPopup::grid, _TabEntry::grid_left, _TabEntry::grid_top, and NULL.

Referenced by process_tab_grab().

Here is the call graph for this function:

◆ outline_window_draw()

static gboolean outline_window_draw ( GtkWidget *  widget,
cairo_t *  cr,
gpointer  data 
)
static

◆ popup_window_screen_changed()

static void popup_window_screen_changed ( GtkWidget *  widget,
GdkScreen *  old_screen,
gpointer  data 
)
static

References screen.

Referenced by meta_ui_tab_popup_new().

◆ screen_use_osd_style()

static gboolean screen_use_osd_style ( MetaScreen *  screen)
static

References meta_display_get_compositor(), meta_prefs_get_compositing_manager(), meta_screen_get_display(), and screen.

Referenced by meta_select_image_draw(), meta_select_workspace_draw(), and meta_ui_tab_popup_new().

Here is the call graph for this function:

◆ select_image()

static void select_image ( GtkWidget *  widget)
static

References META_SELECT_IMAGE, and TRUE.

Referenced by display_entry().

◆ select_workspace()

static void select_workspace ( GtkWidget *  widget)
static

References META_SELECT_WORKSPACE, and TRUE.

Referenced by display_entry().

◆ selectable_image_new()

static GtkWidget * selectable_image_new ( GdkPixbuf *  pixbuf,
cairo_surface_t *  win_surface 
)
static

References meta_select_image_get_type(), and NULL.

Referenced by meta_ui_tab_popup_new().

Here is the call graph for this function:

◆ selectable_workspace_new()

static GtkWidget * selectable_workspace_new ( MetaWorkspace *  workspace,
int  entry_count 
)
static

References _MetaRectangle::height, meta_screen_get_current_xinerama(), META_SELECT_WORKSPACE, meta_select_workspace_get_type(), MINI_WORKSPACE_SCREEN_FRACTION, NULL, _MetaXineramaScreenInfo::rect, _MetaScreen::rect, _MetaWorkspace::screen, SELECT_OUTLINE_WIDTH, and _MetaRectangle::width.

Referenced by meta_ui_tab_popup_new().

Here is the call graph for this function:

◆ tab_entry_new()

◆ unselect_image()

static void unselect_image ( GtkWidget *  widget)
static

References FALSE, and META_SELECT_IMAGE.

Referenced by display_entry().

◆ unselect_workspace()

static void unselect_workspace ( GtkWidget *  widget)
static

References FALSE, and META_SELECT_WORKSPACE.

Referenced by display_entry().

Variable Documentation

◆ parent_class