Remove Mutter namespace prefix
Move all objects and functions namespaced with Mutter into the Meta namespace to get a single consistent namespace. Changes that aren't simply changing mutter to meta: MutterWindow => MetaWindowActor mutter_get_windows => meta_get_window_actors mutter_plugin_get_windows => meta_plugin_get_window_actors https://bugzilla.gnome.org/show_bug.cgi?id=628520
This commit is contained in:
parent
804117c456
commit
1920f211b0
@ -26,21 +26,21 @@ mutter_SOURCES= \
|
|||||||
include/boxes.h \
|
include/boxes.h \
|
||||||
compositor/compositor.c \
|
compositor/compositor.c \
|
||||||
compositor/compositor-private.h \
|
compositor/compositor-private.h \
|
||||||
compositor/mutter-module.c \
|
compositor/meta-module.c \
|
||||||
compositor/mutter-module.h \
|
compositor/meta-module.h \
|
||||||
compositor/mutter-plugin.c \
|
compositor/meta-plugin.c \
|
||||||
compositor/mutter-plugin-manager.c \
|
compositor/meta-plugin-manager.c \
|
||||||
compositor/mutter-plugin-manager.h \
|
compositor/meta-plugin-manager.h \
|
||||||
compositor/mutter-shaped-texture.c \
|
compositor/meta-shaped-texture.c \
|
||||||
compositor/mutter-texture-tower.c \
|
compositor/meta-shaped-texture.h \
|
||||||
compositor/mutter-texture-tower.h \
|
compositor/meta-texture-tower.c \
|
||||||
compositor/mutter-window.c \
|
compositor/meta-texture-tower.h \
|
||||||
compositor/mutter-window-private.h \
|
compositor/meta-window-actor.c \
|
||||||
compositor/mutter-window-group.c \
|
compositor/meta-window-actor-private.h \
|
||||||
compositor/mutter-window-group.h \
|
compositor/meta-window-group.c \
|
||||||
|
compositor/meta-window-group.h \
|
||||||
compositor/shadow.c \
|
compositor/shadow.c \
|
||||||
compositor/shadow.h \
|
compositor/shadow.h \
|
||||||
compositor/mutter-shaped-texture.h \
|
|
||||||
compositor/tidy/tidy-texture-frame.c \
|
compositor/tidy/tidy-texture-frame.c \
|
||||||
compositor/tidy/tidy-texture-frame.h \
|
compositor/tidy/tidy-texture-frame.h \
|
||||||
gdk-compat.h \
|
gdk-compat.h \
|
||||||
@ -48,8 +48,8 @@ mutter_SOURCES= \
|
|||||||
gdk2-drawing-utils.c \
|
gdk2-drawing-utils.c \
|
||||||
gdk2-drawing-utils.h \
|
gdk2-drawing-utils.h \
|
||||||
include/compositor.h \
|
include/compositor.h \
|
||||||
include/mutter-plugin.h \
|
include/meta-plugin.h \
|
||||||
include/mutter-window.h \
|
include/meta-window-actor.h \
|
||||||
include/compositor-mutter.h \
|
include/compositor-mutter.h \
|
||||||
core/constraints.c \
|
core/constraints.c \
|
||||||
core/constraints.h \
|
core/constraints.h \
|
||||||
@ -81,7 +81,7 @@ mutter_SOURCES= \
|
|||||||
core/keybindings.c \
|
core/keybindings.c \
|
||||||
core/keybindings-private.h \
|
core/keybindings-private.h \
|
||||||
core/main.c \
|
core/main.c \
|
||||||
core/mutter-Xatomtype.h \
|
core/mutter-Xatomtype.h \
|
||||||
core/place.c \
|
core/place.c \
|
||||||
core/place.h \
|
core/place.h \
|
||||||
core/prefs.c \
|
core/prefs.c \
|
||||||
@ -177,8 +177,8 @@ libmutterinclude_base_headers = \
|
|||||||
include/display.h \
|
include/display.h \
|
||||||
include/group.h \
|
include/group.h \
|
||||||
include/keybindings.h \
|
include/keybindings.h \
|
||||||
include/mutter-plugin.h \
|
include/meta-plugin.h \
|
||||||
include/mutter-window.h
|
include/meta-window-actor.h
|
||||||
|
|
||||||
# Excluded from scanning for introspection but installed
|
# Excluded from scanning for introspection but installed
|
||||||
# preview-widget.h: only part of libmutter-private
|
# preview-widget.h: only part of libmutter-private
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "mutter-plugin-manager.h"
|
#include "meta-plugin-manager.h"
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
typedef struct _MetaCompScreen MetaCompScreen;
|
typedef struct _MetaCompScreen MetaCompScreen;
|
||||||
@ -23,7 +23,7 @@ struct _MetaCompositor
|
|||||||
|
|
||||||
ClutterActor *shadow_src;
|
ClutterActor *shadow_src;
|
||||||
|
|
||||||
MutterPlugin *modal_plugin;
|
MetaPlugin *modal_plugin;
|
||||||
|
|
||||||
gboolean show_redraw : 1;
|
gboolean show_redraw : 1;
|
||||||
gboolean debug : 1;
|
gboolean debug : 1;
|
||||||
@ -45,24 +45,24 @@ struct _MetaCompScreen
|
|||||||
|
|
||||||
gint switch_workspace_in_progress;
|
gint switch_workspace_in_progress;
|
||||||
|
|
||||||
MutterPluginManager *plugin_mgr;
|
MetaPluginManager *plugin_mgr;
|
||||||
};
|
};
|
||||||
|
|
||||||
void mutter_switch_workspace_completed (MetaScreen *screen);
|
void meta_switch_workspace_completed (MetaScreen *screen);
|
||||||
void mutter_set_stage_input_region (MetaScreen *screen,
|
void meta_set_stage_input_region (MetaScreen *screen,
|
||||||
XserverRegion region);
|
XserverRegion region);
|
||||||
void mutter_empty_stage_input_region (MetaScreen *screen);
|
void meta_empty_stage_input_region (MetaScreen *screen);
|
||||||
|
|
||||||
gboolean mutter_begin_modal_for_plugin (MetaScreen *screen,
|
gboolean meta_begin_modal_for_plugin (MetaScreen *screen,
|
||||||
MutterPlugin *plugin,
|
MetaPlugin *plugin,
|
||||||
Window grab_window,
|
Window grab_window,
|
||||||
Cursor cursor,
|
Cursor cursor,
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
void mutter_end_modal_for_plugin (MetaScreen *screen,
|
void meta_end_modal_for_plugin (MetaScreen *screen,
|
||||||
MutterPlugin *plugin,
|
MetaPlugin *plugin,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
void mutter_check_end_modal (MetaScreen *screen);
|
void meta_check_end_modal (MetaScreen *screen);
|
||||||
|
|
||||||
#endif /* META_COMPOSITOR_PRIVATE_H */
|
#endif /* META_COMPOSITOR_PRIVATE_H */
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
#include "compositor-mutter.h"
|
#include "compositor-mutter.h"
|
||||||
#include "xprops.h"
|
#include "xprops.h"
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "mutter-window-private.h"
|
#include "meta-window-actor-private.h"
|
||||||
#include "mutter-window-group.h"
|
#include "meta-window-group.h"
|
||||||
#include "../core/window-private.h" /* to check window->hidden */
|
#include "../core/window-private.h" /* to check window->hidden */
|
||||||
#include "../core/display-private.h" /* for meta_display_lookup_x_window() */
|
#include "../core/display-private.h" /* for meta_display_lookup_x_window() */
|
||||||
#include <X11/extensions/shape.h>
|
#include <X11/extensions/shape.h>
|
||||||
@ -36,13 +36,13 @@ composite_at_least_version (MetaDisplay *display, int maj, int min)
|
|||||||
static void sync_actor_stacking (GList *windows);
|
static void sync_actor_stacking (GList *windows);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_finish_workspace_switch (MetaCompScreen *info)
|
meta_finish_workspace_switch (MetaCompScreen *info)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
/* Finish hiding and showing actors for the new workspace */
|
/* Finish hiding and showing actors for the new workspace */
|
||||||
for (l = info->windows; l; l = l->next)
|
for (l = info->windows; l; l = l->next)
|
||||||
mutter_window_sync_visibility (l->data);
|
meta_window_actor_sync_visibility (l->data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix up stacking order in case the plugin messed it up.
|
* Fix up stacking order in case the plugin messed it up.
|
||||||
@ -54,7 +54,7 @@ mutter_finish_workspace_switch (MetaCompScreen *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_switch_workspace_completed (MetaScreen *screen)
|
meta_switch_workspace_completed (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ mutter_switch_workspace_completed (MetaScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!info->switch_workspace_in_progress)
|
if (!info->switch_workspace_in_progress)
|
||||||
mutter_finish_workspace_switch (info);
|
meta_finish_workspace_switch (info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -84,7 +84,7 @@ add_win (MetaWindow *window)
|
|||||||
|
|
||||||
g_return_if_fail (info != NULL);
|
g_return_if_fail (info != NULL);
|
||||||
|
|
||||||
mutter_window_new (window);
|
meta_window_actor_new (window);
|
||||||
|
|
||||||
sync_actor_stacking (info->windows);
|
sync_actor_stacking (info->windows);
|
||||||
}
|
}
|
||||||
@ -94,16 +94,16 @@ process_damage (MetaCompositor *compositor,
|
|||||||
XDamageNotifyEvent *event,
|
XDamageNotifyEvent *event,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw;
|
MetaWindowActor *window_actor;
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
if (cw == NULL)
|
if (window_actor == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_process_damage (cw, event);
|
meta_window_actor_process_damage (window_actor, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SHAPE
|
#ifdef HAVE_SHAPE
|
||||||
@ -112,18 +112,18 @@ process_shape (MetaCompositor *compositor,
|
|||||||
XShapeEvent *event,
|
XShapeEvent *event,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw;
|
MetaWindowActor *window_actor;
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
if (cw == NULL)
|
if (window_actor == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event->kind == ShapeBounding)
|
if (event->kind == ShapeBounding)
|
||||||
{
|
{
|
||||||
mutter_window_update_shape (cw, event->shaped);
|
meta_window_actor_update_shape (window_actor, event->shaped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -133,19 +133,19 @@ process_property_notify (MetaCompositor *compositor,
|
|||||||
XPropertyEvent *event,
|
XPropertyEvent *event,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw;
|
MetaWindowActor *window_actor;
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
if (cw == NULL)
|
if (window_actor == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Check for the opacity changing */
|
/* Check for the opacity changing */
|
||||||
if (event->atom == compositor->atom_net_wm_window_opacity)
|
if (event->atom == compositor->atom_net_wm_window_opacity)
|
||||||
{
|
{
|
||||||
mutter_window_update_opacity (cw);
|
meta_window_actor_update_opacity (window_actor);
|
||||||
DEBUG_TRACE ("process_property_notify: net_wm_window_opacity\n");
|
DEBUG_TRACE ("process_property_notify: net_wm_window_opacity\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -185,13 +185,13 @@ get_output_window (MetaScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_get_stage_for_screen:
|
* meta_get_stage_for_screen:
|
||||||
* @screen: a #MetaScreen
|
* @screen: a #MetaScreen
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The #ClutterStage for the screen
|
* Returns: (transfer none): The #ClutterStage for the screen
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_get_stage_for_screen (MetaScreen *screen)
|
meta_get_stage_for_screen (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
@ -202,13 +202,13 @@ mutter_get_stage_for_screen (MetaScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_get_overlay_group_for_screen:
|
* meta_get_overlay_group_for_screen:
|
||||||
* @screen: a #MetaScreen
|
* @screen: a #MetaScreen
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The overlay group corresponding to @screen
|
* Returns: (transfer none): The overlay group corresponding to @screen
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_get_overlay_group_for_screen (MetaScreen *screen)
|
meta_get_overlay_group_for_screen (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
@ -219,13 +219,13 @@ mutter_get_overlay_group_for_screen (MetaScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_get_window_group_for_screen:
|
* meta_get_window_group_for_screen:
|
||||||
* @screen: a #MetaScreen
|
* @screen: a #MetaScreen
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The window group corresponding to @screen
|
* Returns: (transfer none): The window group corresponding to @screen
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_get_window_group_for_screen (MetaScreen *screen)
|
meta_get_window_group_for_screen (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
@ -236,13 +236,13 @@ mutter_get_window_group_for_screen (MetaScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_get_windows:
|
* meta_get_window_actors:
|
||||||
* @screen: a #MetaScreen
|
* @screen: a #MetaScreen
|
||||||
*
|
*
|
||||||
* Returns: (transfer none) (element-type Clutter.Actor): The windows on @screen
|
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @screen
|
||||||
*/
|
*/
|
||||||
GList *
|
GList *
|
||||||
mutter_get_windows (MetaScreen *screen)
|
meta_get_window_actors (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ mutter_get_windows (MetaScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_set_stage_input_region (MetaScreen *screen,
|
do_set_stage_input_region (MetaScreen *screen,
|
||||||
XserverRegion region)
|
XserverRegion region)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
@ -266,8 +266,8 @@ do_set_stage_input_region (MetaScreen *screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_set_stage_input_region (MetaScreen *screen,
|
meta_set_stage_input_region (MetaScreen *screen,
|
||||||
XserverRegion region)
|
XserverRegion region)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
@ -295,7 +295,7 @@ mutter_set_stage_input_region (MetaScreen *screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_empty_stage_input_region (MetaScreen *screen)
|
meta_empty_stage_input_region (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
/* Using a static region here is a bit hacky, but Metacity never opens more than
|
/* Using a static region here is a bit hacky, but Metacity never opens more than
|
||||||
* one XDisplay, so it works fine. */
|
* one XDisplay, so it works fine. */
|
||||||
@ -308,16 +308,16 @@ mutter_empty_stage_input_region (MetaScreen *screen)
|
|||||||
region = XFixesCreateRegion (xdpy, NULL, 0);
|
region = XFixesCreateRegion (xdpy, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutter_set_stage_input_region (screen, region);
|
meta_set_stage_input_region (screen, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mutter_begin_modal_for_plugin (MetaScreen *screen,
|
meta_begin_modal_for_plugin (MetaScreen *screen,
|
||||||
MutterPlugin *plugin,
|
MetaPlugin *plugin,
|
||||||
Window grab_window,
|
Window grab_window,
|
||||||
Cursor cursor,
|
Cursor cursor,
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
/* To some extent this duplicates code in meta_display_begin_grab_op(), but there
|
/* To some extent this duplicates code in meta_display_begin_grab_op(), but there
|
||||||
* are significant differences in how we handle grabs that make it difficult to
|
* are significant differences in how we handle grabs that make it difficult to
|
||||||
@ -382,9 +382,9 @@ mutter_begin_modal_for_plugin (MetaScreen *screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_end_modal_for_plugin (MetaScreen *screen,
|
meta_end_modal_for_plugin (MetaScreen *screen,
|
||||||
MutterPlugin *plugin,
|
MetaPlugin *plugin,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
Display *xdpy = meta_display_get_xdisplay (display);
|
Display *xdpy = meta_display_get_xdisplay (display);
|
||||||
@ -408,15 +408,15 @@ mutter_end_modal_for_plugin (MetaScreen *screen,
|
|||||||
* a left-over modal grab for this screen.
|
* a left-over modal grab for this screen.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_check_end_modal (MetaScreen *screen)
|
meta_check_end_modal (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
MetaCompositor *compositor = display->compositor;
|
MetaCompositor *compositor = display->compositor;
|
||||||
|
|
||||||
if (compositor->modal_plugin &&
|
if (compositor->modal_plugin &&
|
||||||
mutter_plugin_get_screen (compositor->modal_plugin) == screen)
|
meta_plugin_get_screen (compositor->modal_plugin) == screen)
|
||||||
{
|
{
|
||||||
mutter_end_modal_for_plugin (screen,
|
meta_end_modal_for_plugin (screen,
|
||||||
compositor->modal_plugin,
|
compositor->modal_plugin,
|
||||||
CurrentTime);
|
CurrentTime);
|
||||||
}
|
}
|
||||||
@ -492,7 +492,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
|
|
||||||
XSelectInput (xdisplay, xwin, event_mask);
|
XSelectInput (xdisplay, xwin, event_mask);
|
||||||
|
|
||||||
info->window_group = mutter_window_group_new (screen);
|
info->window_group = meta_window_group_new (screen);
|
||||||
info->overlay_group = clutter_group_new ();
|
info->overlay_group = clutter_group_new ();
|
||||||
info->hidden_group = clutter_group_new ();
|
info->hidden_group = clutter_group_new ();
|
||||||
|
|
||||||
@ -505,18 +505,18 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
clutter_actor_hide (info->hidden_group);
|
clutter_actor_hide (info->hidden_group);
|
||||||
|
|
||||||
info->plugin_mgr =
|
info->plugin_mgr =
|
||||||
mutter_plugin_manager_get (screen);
|
meta_plugin_manager_get (screen);
|
||||||
|
|
||||||
if (info->plugin_mgr != mutter_plugin_manager_get_default ())
|
if (info->plugin_mgr != meta_plugin_manager_get_default ())
|
||||||
{
|
{
|
||||||
/* The default plugin manager has been initialized during
|
/* The default plugin manager has been initialized during
|
||||||
* global preferences load.
|
* global preferences load.
|
||||||
*/
|
*/
|
||||||
if (!mutter_plugin_manager_load (info->plugin_mgr))
|
if (!meta_plugin_manager_load (info->plugin_mgr))
|
||||||
g_critical ("failed to load plugins");
|
g_critical ("failed to load plugins");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mutter_plugin_manager_initialize (info->plugin_mgr))
|
if (!meta_plugin_manager_initialize (info->plugin_mgr))
|
||||||
g_critical ("failed to initialize plugins");
|
g_critical ("failed to initialize plugins");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -575,14 +575,14 @@ void
|
|||||||
meta_compositor_remove_window (MetaCompositor *compositor,
|
meta_compositor_remove_window (MetaCompositor *compositor,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = NULL;
|
MetaWindowActor *window_actor = NULL;
|
||||||
|
|
||||||
DEBUG_TRACE ("meta_compositor_remove_window\n");
|
DEBUG_TRACE ("meta_compositor_remove_window\n");
|
||||||
cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_destroy (cw);
|
meta_window_actor_destroy (window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -620,7 +620,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
{
|
{
|
||||||
if (compositor->modal_plugin && is_grabbed_event (event))
|
if (compositor->modal_plugin && is_grabbed_event (event))
|
||||||
{
|
{
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (compositor->modal_plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (compositor->modal_plugin);
|
||||||
|
|
||||||
if (klass->xevent_filter)
|
if (klass->xevent_filter)
|
||||||
klass->xevent_filter (compositor->modal_plugin, event);
|
klass->xevent_filter (compositor->modal_plugin, event);
|
||||||
@ -638,7 +638,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
screen = meta_window_get_screen (window);
|
screen = meta_window_get_screen (window);
|
||||||
info = meta_screen_get_compositor_data (screen);
|
info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, event))
|
if (meta_plugin_manager_xevent_filter (info->plugin_mgr, event))
|
||||||
{
|
{
|
||||||
DEBUG_TRACE ("meta_compositor_process_event (filtered,window==NULL)\n");
|
DEBUG_TRACE ("meta_compositor_process_event (filtered,window==NULL)\n");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -657,7 +657,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
|
|
||||||
info = meta_screen_get_compositor_data (screen);
|
info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, event))
|
if (meta_plugin_manager_xevent_filter (info->plugin_mgr, event))
|
||||||
{
|
{
|
||||||
DEBUG_TRACE ("meta_compositor_process_event (filtered,window==NULL)\n");
|
DEBUG_TRACE ("meta_compositor_process_event (filtered,window==NULL)\n");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -715,12 +715,12 @@ meta_compositor_show_window (MetaCompositor *compositor,
|
|||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaCompEffect effect)
|
MetaCompEffect effect)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
DEBUG_TRACE ("meta_compositor_show_window\n");
|
DEBUG_TRACE ("meta_compositor_show_window\n");
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_show (cw, effect);
|
meta_window_actor_show (window_actor, effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -728,12 +728,12 @@ meta_compositor_hide_window (MetaCompositor *compositor,
|
|||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaCompEffect effect)
|
MetaCompEffect effect)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
DEBUG_TRACE ("meta_compositor_hide_window\n");
|
DEBUG_TRACE ("meta_compositor_hide_window\n");
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_hide (cw, effect);
|
meta_window_actor_hide (window_actor, effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -742,12 +742,12 @@ meta_compositor_maximize_window (MetaCompositor *compositor,
|
|||||||
MetaRectangle *old_rect,
|
MetaRectangle *old_rect,
|
||||||
MetaRectangle *new_rect)
|
MetaRectangle *new_rect)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
DEBUG_TRACE ("meta_compositor_maximize_window\n");
|
DEBUG_TRACE ("meta_compositor_maximize_window\n");
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_maximize (cw, old_rect, new_rect);
|
meta_window_actor_maximize (window_actor, old_rect, new_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -756,12 +756,12 @@ meta_compositor_unmaximize_window (MetaCompositor *compositor,
|
|||||||
MetaRectangle *old_rect,
|
MetaRectangle *old_rect,
|
||||||
MetaRectangle *new_rect)
|
MetaRectangle *new_rect)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
DEBUG_TRACE ("meta_compositor_unmaximize_window\n");
|
DEBUG_TRACE ("meta_compositor_unmaximize_window\n");
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_unmaximize (cw, old_rect, new_rect);
|
meta_window_actor_unmaximize (window_actor, old_rect, new_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -774,7 +774,7 @@ meta_compositor_update_workspace_geometry (MetaCompositor *compositor,
|
|||||||
*/
|
*/
|
||||||
MetaScreen *screen = meta_workspace_get_screen (workspace);
|
MetaScreen *screen = meta_workspace_get_screen (workspace);
|
||||||
MetaCompScreen *info;
|
MetaCompScreen *info;
|
||||||
MutterPluginManager *mgr;
|
MetaPluginManager *mgr;
|
||||||
|
|
||||||
DEBUG_TRACE ("meta_compositor_update_workspace_geometry\n");
|
DEBUG_TRACE ("meta_compositor_update_workspace_geometry\n");
|
||||||
info = meta_screen_get_compositor_data (screen);
|
info = meta_screen_get_compositor_data (screen);
|
||||||
@ -783,7 +783,7 @@ meta_compositor_update_workspace_geometry (MetaCompositor *compositor,
|
|||||||
if (!mgr || !workspace)
|
if (!mgr || !workspace)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_plugin_manager_update_workspace (mgr, workspace);
|
meta_plugin_manager_update_workspace (mgr, workspace);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,7 +809,7 @@ meta_compositor_switch_workspace (MetaCompositor *compositor,
|
|||||||
info->switch_workspace_in_progress++;
|
info->switch_workspace_in_progress++;
|
||||||
|
|
||||||
if (!info->plugin_mgr ||
|
if (!info->plugin_mgr ||
|
||||||
!mutter_plugin_manager_switch_workspace (info->plugin_mgr,
|
!meta_plugin_manager_switch_workspace (info->plugin_mgr,
|
||||||
from_indx,
|
from_indx,
|
||||||
to_indx,
|
to_indx,
|
||||||
direction))
|
direction))
|
||||||
@ -821,7 +821,7 @@ meta_compositor_switch_workspace (MetaCompositor *compositor,
|
|||||||
* necessarily change during the window hiding/unhiding, only their
|
* necessarily change during the window hiding/unhiding, only their
|
||||||
* relative position toward the destkop window.
|
* relative position toward the destkop window.
|
||||||
*/
|
*/
|
||||||
mutter_finish_workspace_switch (info);
|
meta_finish_workspace_switch (info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -834,9 +834,9 @@ sync_actor_stacking (GList *windows)
|
|||||||
|
|
||||||
for (tmp = g_list_last (windows); tmp != NULL; tmp = tmp->prev)
|
for (tmp = g_list_last (windows); tmp != NULL; tmp = tmp->prev)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = tmp->data;
|
MetaWindowActor *window_actor = tmp->data;
|
||||||
|
|
||||||
clutter_actor_lower_bottom (CLUTTER_ACTOR (cw));
|
clutter_actor_lower_bottom (CLUTTER_ACTOR (window_actor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,12 +858,12 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
|
|||||||
|
|
||||||
/* Sources: first window is the highest */
|
/* Sources: first window is the highest */
|
||||||
stack = g_list_copy (stack); /* The new stack of MetaWindow */
|
stack = g_list_copy (stack); /* The new stack of MetaWindow */
|
||||||
old_stack = g_list_reverse (info->windows); /* The old stack of MutterWindow */
|
old_stack = g_list_reverse (info->windows); /* The old stack of MetaWindowActor */
|
||||||
info->windows = NULL;
|
info->windows = NULL;
|
||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
MutterWindow *old_actor = NULL, *stack_actor = NULL, *actor;
|
MetaWindowActor *old_actor = NULL, *stack_actor = NULL, *actor;
|
||||||
MetaWindow *old_window = NULL, *stack_window = NULL, *window;
|
MetaWindow *old_window = NULL, *stack_window = NULL, *window;
|
||||||
|
|
||||||
/* Find the remaining top actor in our existing stack (ignoring
|
/* Find the remaining top actor in our existing stack (ignoring
|
||||||
@ -871,10 +871,10 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
|
|||||||
while (old_stack)
|
while (old_stack)
|
||||||
{
|
{
|
||||||
old_actor = old_stack->data;
|
old_actor = old_stack->data;
|
||||||
old_window = mutter_window_get_meta_window (old_actor);
|
old_window = meta_window_actor_get_meta_window (old_actor);
|
||||||
|
|
||||||
if (old_window->hidden &&
|
if (old_window->hidden &&
|
||||||
!mutter_window_effect_in_progress (old_actor))
|
!meta_window_actor_effect_in_progress (old_actor))
|
||||||
old_stack = g_list_delete_link (old_stack, old_stack);
|
old_stack = g_list_delete_link (old_stack, old_stack);
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -884,10 +884,10 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
|
|||||||
while (stack)
|
while (stack)
|
||||||
{
|
{
|
||||||
stack_window = stack->data;
|
stack_window = stack->data;
|
||||||
stack_actor = MUTTER_WINDOW (meta_window_get_compositor_private (stack_window));
|
stack_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (stack_window));
|
||||||
if (!stack_actor)
|
if (!stack_actor)
|
||||||
{
|
{
|
||||||
meta_verbose ("Failed to find corresponding MutterWindow "
|
meta_verbose ("Failed to find corresponding MetaWindowActor "
|
||||||
"for window %s\n", meta_window_get_description (stack_window));
|
"for window %s\n", meta_window_get_description (stack_window));
|
||||||
stack = g_list_delete_link (stack, stack);
|
stack = g_list_delete_link (stack, stack);
|
||||||
}
|
}
|
||||||
@ -933,41 +933,41 @@ void
|
|||||||
meta_compositor_window_mapped (MetaCompositor *compositor,
|
meta_compositor_window_mapped (MetaCompositor *compositor,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
DEBUG_TRACE ("meta_compositor_window_mapped\n");
|
DEBUG_TRACE ("meta_compositor_window_mapped\n");
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_mapped (cw);
|
meta_window_actor_mapped (window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_window_unmapped (MetaCompositor *compositor,
|
meta_compositor_window_unmapped (MetaCompositor *compositor,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
DEBUG_TRACE ("meta_compositor_window_unmapped\n");
|
DEBUG_TRACE ("meta_compositor_window_unmapped\n");
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_unmapped (cw);
|
meta_window_actor_unmapped (window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window));
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||||
MetaScreen *screen = meta_window_get_screen (window);
|
MetaScreen *screen = meta_window_get_screen (window);
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
DEBUG_TRACE ("meta_compositor_sync_window_geometry\n");
|
DEBUG_TRACE ("meta_compositor_sync_window_geometry\n");
|
||||||
g_return_if_fail (info);
|
g_return_if_fail (info);
|
||||||
|
|
||||||
if (!cw)
|
if (!window_actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_window_sync_actor_position (cw);
|
meta_window_actor_sync_actor_position (window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -994,11 +994,11 @@ pre_paint_windows (MetaCompScreen *info)
|
|||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = info->windows; l; l = l->next)
|
for (l = info->windows; l; l = l->next)
|
||||||
mutter_window_pre_paint (l->data);
|
meta_window_actor_pre_paint (l->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
mutter_repaint_func (gpointer data)
|
meta_repaint_func (gpointer data)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = data;
|
MetaCompositor *compositor = data;
|
||||||
GSList *screens = meta_display_get_screens (compositor->display);
|
GSList *screens = meta_display_get_screens (compositor->display);
|
||||||
@ -1040,7 +1040,7 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
|
|
||||||
compositor->display = display;
|
compositor->display = display;
|
||||||
|
|
||||||
if (g_getenv("MUTTER_DISABLE_MIPMAPS"))
|
if (g_getenv("META_DISABLE_MIPMAPS"))
|
||||||
compositor->no_mipmaps = TRUE;
|
compositor->no_mipmaps = TRUE;
|
||||||
|
|
||||||
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
|
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
|
||||||
@ -1051,7 +1051,7 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
compositor->atom_x_set_root = atoms[1];
|
compositor->atom_x_set_root = atoms[1];
|
||||||
compositor->atom_net_wm_window_opacity = atoms[2];
|
compositor->atom_net_wm_window_opacity = atoms[2];
|
||||||
|
|
||||||
compositor->repaint_func_id = clutter_threads_add_repaint_func (mutter_repaint_func,
|
compositor->repaint_func_id = clutter_threads_add_repaint_func (meta_repaint_func,
|
||||||
compositor,
|
compositor,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
@ -1059,11 +1059,11 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_get_overlay_window: (skip)
|
* meta_get_overlay_window: (skip)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Window
|
Window
|
||||||
mutter_get_overlay_window (MetaScreen *screen)
|
meta_get_overlay_window (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mutter-plugin.h"
|
#include "meta-plugin.h"
|
||||||
#include "mutter-module.h"
|
#include "meta-module.h"
|
||||||
|
|
||||||
#include <gmodule.h>
|
#include <gmodule.h>
|
||||||
|
|
||||||
@ -32,23 +32,23 @@ enum
|
|||||||
PROP_PATH,
|
PROP_PATH,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterModulePrivate
|
struct _MetaModulePrivate
|
||||||
{
|
{
|
||||||
GModule *lib;
|
GModule *lib;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
GType plugin_type;
|
GType plugin_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MUTTER_MODULE_GET_PRIVATE(obj) \
|
#define META_MODULE_GET_PRIVATE(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_MODULE, MutterModulePrivate))
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_MODULE, MetaModulePrivate))
|
||||||
|
|
||||||
G_DEFINE_TYPE (MutterModule, mutter_module, G_TYPE_TYPE_MODULE);
|
G_DEFINE_TYPE (MetaModule, meta_module, G_TYPE_TYPE_MODULE);
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
mutter_module_load (GTypeModule *gmodule)
|
meta_module_load (GTypeModule *gmodule)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv = MUTTER_MODULE (gmodule)->priv;
|
MetaModulePrivate *priv = META_MODULE (gmodule)->priv;
|
||||||
MutterPluginVersion *info = NULL;
|
MetaPluginVersion *info = NULL;
|
||||||
GType (*register_type) (GTypeModule *) = NULL;
|
GType (*register_type) (GTypeModule *) = NULL;
|
||||||
|
|
||||||
if (priv->lib && priv->plugin_type)
|
if (priv->lib && priv->plugin_type)
|
||||||
@ -64,9 +64,9 @@ mutter_module_load (GTypeModule *gmodule)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_module_symbol (priv->lib, "mutter_plugin_version",
|
if (g_module_symbol (priv->lib, "meta_plugin_version",
|
||||||
(gpointer *)(void *)&info) &&
|
(gpointer *)(void *)&info) &&
|
||||||
g_module_symbol (priv->lib, "mutter_plugin_register_type",
|
g_module_symbol (priv->lib, "meta_plugin_register_type",
|
||||||
(gpointer *)(void *)®ister_type) &&
|
(gpointer *)(void *)®ister_type) &&
|
||||||
info && register_type)
|
info && register_type)
|
||||||
{
|
{
|
||||||
@ -97,9 +97,9 @@ mutter_module_load (GTypeModule *gmodule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_unload (GTypeModule *gmodule)
|
meta_module_unload (GTypeModule *gmodule)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv = MUTTER_MODULE (gmodule)->priv;
|
MetaModulePrivate *priv = META_MODULE (gmodule)->priv;
|
||||||
|
|
||||||
g_module_close (priv->lib);
|
g_module_close (priv->lib);
|
||||||
|
|
||||||
@ -108,29 +108,29 @@ mutter_module_unload (GTypeModule *gmodule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_dispose (GObject *object)
|
meta_module_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
G_OBJECT_CLASS (mutter_module_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_module_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_finalize (GObject *object)
|
meta_module_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv = MUTTER_MODULE (object)->priv;
|
MetaModulePrivate *priv = META_MODULE (object)->priv;
|
||||||
|
|
||||||
g_free (priv->path);
|
g_free (priv->path);
|
||||||
priv->path = NULL;
|
priv->path = NULL;
|
||||||
|
|
||||||
G_OBJECT_CLASS (mutter_module_parent_class)->finalize (object);
|
G_OBJECT_CLASS (meta_module_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_set_property (GObject *object,
|
meta_module_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv = MUTTER_MODULE (object)->priv;
|
MetaModulePrivate *priv = META_MODULE (object)->priv;
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@ -145,12 +145,12 @@ mutter_module_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_get_property (GObject *object,
|
meta_module_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv = MUTTER_MODULE (object)->priv;
|
MetaModulePrivate *priv = META_MODULE (object)->priv;
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@ -164,18 +164,18 @@ mutter_module_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_class_init (MutterModuleClass *klass)
|
meta_module_class_init (MetaModuleClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
GTypeModuleClass *gmodule_class = G_TYPE_MODULE_CLASS (klass);
|
GTypeModuleClass *gmodule_class = G_TYPE_MODULE_CLASS (klass);
|
||||||
|
|
||||||
gobject_class->finalize = mutter_module_finalize;
|
gobject_class->finalize = meta_module_finalize;
|
||||||
gobject_class->dispose = mutter_module_dispose;
|
gobject_class->dispose = meta_module_dispose;
|
||||||
gobject_class->set_property = mutter_module_set_property;
|
gobject_class->set_property = meta_module_set_property;
|
||||||
gobject_class->get_property = mutter_module_get_property;
|
gobject_class->get_property = meta_module_get_property;
|
||||||
|
|
||||||
gmodule_class->load = mutter_module_load;
|
gmodule_class->load = meta_module_load;
|
||||||
gmodule_class->unload = mutter_module_unload;
|
gmodule_class->unload = meta_module_unload;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_PATH,
|
PROP_PATH,
|
||||||
@ -186,22 +186,22 @@ mutter_module_class_init (MutterModuleClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT_ONLY));
|
G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
|
||||||
g_type_class_add_private (gobject_class, sizeof (MutterModulePrivate));
|
g_type_class_add_private (gobject_class, sizeof (MetaModulePrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_module_init (MutterModule *self)
|
meta_module_init (MetaModule *self)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv;
|
MetaModulePrivate *priv;
|
||||||
|
|
||||||
self->priv = priv = MUTTER_MODULE_GET_PRIVATE (self);
|
self->priv = priv = META_MODULE_GET_PRIVATE (self);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GType
|
GType
|
||||||
mutter_module_get_plugin_type (MutterModule *module)
|
meta_module_get_plugin_type (MetaModule *module)
|
||||||
{
|
{
|
||||||
MutterModulePrivate *priv = MUTTER_MODULE (module)->priv;
|
MetaModulePrivate *priv = META_MODULE (module)->priv;
|
||||||
|
|
||||||
return priv->plugin_type;
|
return priv->plugin_type;
|
||||||
}
|
}
|
@ -21,37 +21,37 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MUTTER_MODULE_H_
|
#ifndef META_MODULE_H_
|
||||||
#define MUTTER_MODULE_H_
|
#define META_MODULE_H_
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#define MUTTER_TYPE_MODULE (mutter_module_get_type ())
|
#define META_TYPE_MODULE (meta_module_get_type ())
|
||||||
#define MUTTER_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_MODULE, MutterModule))
|
#define META_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MODULE, MetaModule))
|
||||||
#define MUTTER_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_MODULE, MutterModuleClass))
|
#define META_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MODULE, MetaModuleClass))
|
||||||
#define MUTTER_IS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_MODULE_TYPE))
|
#define META_IS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_MODULE_TYPE))
|
||||||
#define MUTTER_IS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_MODULE))
|
#define META_IS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MODULE))
|
||||||
#define MUTTER_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_MODULE, MutterModuleClass))
|
#define META_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MODULE, MetaModuleClass))
|
||||||
|
|
||||||
typedef struct _MutterModule MutterModule;
|
typedef struct _MetaModule MetaModule;
|
||||||
typedef struct _MutterModuleClass MutterModuleClass;
|
typedef struct _MetaModuleClass MetaModuleClass;
|
||||||
typedef struct _MutterModulePrivate MutterModulePrivate;
|
typedef struct _MetaModulePrivate MetaModulePrivate;
|
||||||
|
|
||||||
struct _MutterModule
|
struct _MetaModule
|
||||||
{
|
{
|
||||||
GTypeModule parent;
|
GTypeModule parent;
|
||||||
|
|
||||||
MutterModulePrivate *priv;
|
MetaModulePrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterModuleClass
|
struct _MetaModuleClass
|
||||||
{
|
{
|
||||||
GTypeModuleClass parent_class;
|
GTypeModuleClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GType mutter_module_get_type (void);
|
GType meta_module_get_type (void);
|
||||||
|
|
||||||
GType mutter_module_get_plugin_type (MutterModule *module);
|
GType meta_module_get_plugin_type (MetaModule *module);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -23,11 +23,11 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "compositor-private.h"
|
#include "compositor-private.h"
|
||||||
#include "mutter-plugin-manager.h"
|
#include "meta-plugin-manager.h"
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "mutter-module.h"
|
#include "meta-module.h"
|
||||||
#include "../core/window-private.h"
|
#include "../core/window-private.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -46,16 +46,16 @@ static GHashTable *plugin_modules = NULL;
|
|||||||
* have one plugin manager and only make the plugins per-screen.)
|
* have one plugin manager and only make the plugins per-screen.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static MutterPluginManager *default_plugin_manager;
|
static MetaPluginManager *default_plugin_manager;
|
||||||
|
|
||||||
static gboolean mutter_plugin_manager_reload (MutterPluginManager *plugin_mgr);
|
static gboolean meta_plugin_manager_reload (MetaPluginManager *plugin_mgr);
|
||||||
|
|
||||||
struct MutterPluginManager
|
struct MetaPluginManager
|
||||||
{
|
{
|
||||||
MetaScreen *screen;
|
MetaScreen *screen;
|
||||||
|
|
||||||
GList /* MutterPlugin */ *plugins; /* TODO -- maybe use hash table */
|
GList /* MetaPlugin */ *plugins; /* TODO -- maybe use hash table */
|
||||||
GList *unload; /* Plugins that are disabled and pending unload */
|
GList *unload; /* Plugins that are disabled and pending unload */
|
||||||
|
|
||||||
guint idle_unload_id;
|
guint idle_unload_id;
|
||||||
};
|
};
|
||||||
@ -64,13 +64,13 @@ struct MutterPluginManager
|
|||||||
* Checks that the plugin is compatible with the WM and sets up the plugin
|
* Checks that the plugin is compatible with the WM and sets up the plugin
|
||||||
* struct.
|
* struct.
|
||||||
*/
|
*/
|
||||||
static MutterPlugin *
|
static MetaPlugin *
|
||||||
mutter_plugin_load (MutterPluginManager *mgr,
|
meta_plugin_load (MetaPluginManager *mgr,
|
||||||
MutterModule *module,
|
MetaModule *module,
|
||||||
const gchar *params)
|
const gchar *params)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = NULL;
|
MetaPlugin *plugin = NULL;
|
||||||
GType plugin_type = mutter_module_get_plugin_type (module);
|
GType plugin_type = meta_module_get_plugin_type (module);
|
||||||
|
|
||||||
if (!plugin_type)
|
if (!plugin_type)
|
||||||
{
|
{
|
||||||
@ -91,9 +91,9 @@ mutter_plugin_load (MutterPluginManager *mgr,
|
|||||||
* removal later.
|
* removal later.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
mutter_plugin_unload (MutterPlugin *plugin)
|
meta_plugin_unload (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
if (mutter_plugin_running (plugin))
|
if (meta_plugin_running (plugin))
|
||||||
{
|
{
|
||||||
g_object_set (plugin, "disabled", TRUE, NULL);
|
g_object_set (plugin, "disabled", TRUE, NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -109,16 +109,16 @@ mutter_plugin_unload (MutterPlugin *plugin)
|
|||||||
* pending for removal.
|
* pending for removal.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
mutter_plugin_manager_idle_unload (MutterPluginManager *plugin_mgr)
|
meta_plugin_manager_idle_unload (MetaPluginManager *plugin_mgr)
|
||||||
{
|
{
|
||||||
GList *l = plugin_mgr->unload;
|
GList *l = plugin_mgr->unload;
|
||||||
gboolean dont_remove = TRUE;
|
gboolean dont_remove = TRUE;
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
|
|
||||||
if (mutter_plugin_unload (plugin))
|
if (meta_plugin_unload (plugin))
|
||||||
{
|
{
|
||||||
/* Remove from list */
|
/* Remove from list */
|
||||||
GList *p = l->prev;
|
GList *p = l->prev;
|
||||||
@ -154,23 +154,23 @@ mutter_plugin_manager_idle_unload (MutterPluginManager *plugin_mgr)
|
|||||||
* Unloads all plugins
|
* Unloads all plugins
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
mutter_plugin_manager_unload (MutterPluginManager *plugin_mgr)
|
meta_plugin_manager_unload (MetaPluginManager *plugin_mgr)
|
||||||
{
|
{
|
||||||
GList *plugins = plugin_mgr->plugins;
|
GList *plugins = plugin_mgr->plugins;
|
||||||
|
|
||||||
while (plugins)
|
while (plugins)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = plugins->data;
|
MetaPlugin *plugin = plugins->data;
|
||||||
|
|
||||||
/* If the plugin could not be removed, move it to the unload list */
|
/* If the plugin could not be removed, move it to the unload list */
|
||||||
if (!mutter_plugin_unload (plugin))
|
if (!meta_plugin_unload (plugin))
|
||||||
{
|
{
|
||||||
plugin_mgr->unload = g_list_prepend (plugin_mgr->unload, plugin);
|
plugin_mgr->unload = g_list_prepend (plugin_mgr->unload, plugin);
|
||||||
|
|
||||||
if (!plugin_mgr->idle_unload_id)
|
if (!plugin_mgr->idle_unload_id)
|
||||||
{
|
{
|
||||||
plugin_mgr->idle_unload_id = g_idle_add ((GSourceFunc)
|
plugin_mgr->idle_unload_id = g_idle_add ((GSourceFunc)
|
||||||
mutter_plugin_manager_idle_unload,
|
meta_plugin_manager_idle_unload,
|
||||||
plugin_mgr);
|
plugin_mgr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -186,21 +186,21 @@ static void
|
|||||||
prefs_changed_callback (MetaPreference pref,
|
prefs_changed_callback (MetaPreference pref,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
MutterPluginManager *plugin_mgr = data;
|
MetaPluginManager *plugin_mgr = data;
|
||||||
|
|
||||||
if (pref == META_PREF_CLUTTER_PLUGINS)
|
if (pref == META_PREF_CLUTTER_PLUGINS)
|
||||||
{
|
{
|
||||||
mutter_plugin_manager_reload (plugin_mgr);
|
meta_plugin_manager_reload (plugin_mgr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static MutterModule *
|
static MetaModule *
|
||||||
mutter_plugin_manager_get_module (const gchar *path)
|
meta_plugin_manager_get_module (const gchar *path)
|
||||||
{
|
{
|
||||||
MutterModule *module = g_hash_table_lookup (plugin_modules, path);
|
MetaModule *module = g_hash_table_lookup (plugin_modules, path);
|
||||||
|
|
||||||
if (!module &&
|
if (!module &&
|
||||||
(module = g_object_new (MUTTER_TYPE_MODULE, "path", path, NULL)))
|
(module = g_object_new (META_TYPE_MODULE, "path", path, NULL)))
|
||||||
{
|
{
|
||||||
g_hash_table_insert (plugin_modules, g_strdup (path), module);
|
g_hash_table_insert (plugin_modules, g_strdup (path), module);
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ mutter_plugin_manager_get_module (const gchar *path)
|
|||||||
* Loads all plugins listed in gconf registry.
|
* Loads all plugins listed in gconf registry.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
|
meta_plugin_manager_load (MetaPluginManager *plugin_mgr)
|
||||||
{
|
{
|
||||||
const gchar *dpath = MUTTER_PLUGIN_DIR "/";
|
const gchar *dpath = MUTTER_PLUGIN_DIR "/";
|
||||||
GSList *plugins, *fallback = NULL;
|
GSList *plugins, *fallback = NULL;
|
||||||
@ -237,7 +237,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
|
|||||||
|
|
||||||
if (plugin_string)
|
if (plugin_string)
|
||||||
{
|
{
|
||||||
MutterModule *module;
|
MetaModule *module;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
params = strchr (plugin_string, ':');
|
params = strchr (plugin_string, ':');
|
||||||
@ -253,7 +253,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
|
|||||||
else
|
else
|
||||||
path = g_strconcat (dpath, plugin_string, ".so", NULL);
|
path = g_strconcat (dpath, plugin_string, ".so", NULL);
|
||||||
|
|
||||||
module = mutter_plugin_manager_get_module (path);
|
module = meta_plugin_manager_get_module (path);
|
||||||
|
|
||||||
if (module)
|
if (module)
|
||||||
{
|
{
|
||||||
@ -270,7 +270,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
|
|||||||
|
|
||||||
if (use_succeeded)
|
if (use_succeeded)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = mutter_plugin_load (plugin_mgr, module, params);
|
MetaPlugin *plugin = meta_plugin_load (plugin_mgr, module, params);
|
||||||
|
|
||||||
if (plugin)
|
if (plugin)
|
||||||
plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, plugin);
|
plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, plugin);
|
||||||
@ -305,14 +305,14 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_manager_initialize (MutterPluginManager *plugin_mgr)
|
meta_plugin_manager_initialize (MetaPluginManager *plugin_mgr)
|
||||||
{
|
{
|
||||||
GList *iter;
|
GList *iter;
|
||||||
|
|
||||||
for (iter = plugin_mgr->plugins; iter; iter = iter->next)
|
for (iter = plugin_mgr->plugins; iter; iter = iter->next)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = (MutterPlugin*) iter->data;
|
MetaPlugin *plugin = (MetaPlugin*) iter->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
g_object_set (plugin,
|
g_object_set (plugin,
|
||||||
"screen", plugin_mgr->screen,
|
"screen", plugin_mgr->screen,
|
||||||
@ -329,7 +329,7 @@ mutter_plugin_manager_initialize (MutterPluginManager *plugin_mgr)
|
|||||||
* Reloads all plugins
|
* Reloads all plugins
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
mutter_plugin_manager_reload (MutterPluginManager *plugin_mgr)
|
meta_plugin_manager_reload (MetaPluginManager *plugin_mgr)
|
||||||
{
|
{
|
||||||
/* TODO -- brute force; should we build a list of plugins to load and list of
|
/* TODO -- brute force; should we build a list of plugins to load and list of
|
||||||
* plugins to unload? We are probably not going to have large numbers of
|
* plugins to unload? We are probably not going to have large numbers of
|
||||||
@ -337,16 +337,16 @@ mutter_plugin_manager_reload (MutterPluginManager *plugin_mgr)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Prevent stale grabs on unloaded plugins */
|
/* Prevent stale grabs on unloaded plugins */
|
||||||
mutter_check_end_modal (plugin_mgr->screen);
|
meta_check_end_modal (plugin_mgr->screen);
|
||||||
|
|
||||||
mutter_plugin_manager_unload (plugin_mgr);
|
meta_plugin_manager_unload (plugin_mgr);
|
||||||
return mutter_plugin_manager_load (plugin_mgr);
|
return meta_plugin_manager_load (plugin_mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MutterPluginManager *
|
static MetaPluginManager *
|
||||||
mutter_plugin_manager_new (MetaScreen *screen)
|
meta_plugin_manager_new (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MutterPluginManager *plugin_mgr;
|
MetaPluginManager *plugin_mgr;
|
||||||
|
|
||||||
if (!plugin_modules)
|
if (!plugin_modules)
|
||||||
{
|
{
|
||||||
@ -354,65 +354,65 @@ mutter_plugin_manager_new (MetaScreen *screen)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_mgr = g_new0 (MutterPluginManager, 1);
|
plugin_mgr = g_new0 (MetaPluginManager, 1);
|
||||||
|
|
||||||
plugin_mgr->screen = screen;
|
plugin_mgr->screen = screen;
|
||||||
|
|
||||||
if (screen)
|
if (screen)
|
||||||
g_object_set_data (G_OBJECT (screen), "mutter-plugin-manager", plugin_mgr);
|
g_object_set_data (G_OBJECT (screen), "meta-plugin-manager", plugin_mgr);
|
||||||
|
|
||||||
return plugin_mgr;
|
return plugin_mgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutterPluginManager *
|
MetaPluginManager *
|
||||||
mutter_plugin_manager_get_default (void)
|
meta_plugin_manager_get_default (void)
|
||||||
{
|
{
|
||||||
if (!default_plugin_manager)
|
if (!default_plugin_manager)
|
||||||
{
|
{
|
||||||
default_plugin_manager = mutter_plugin_manager_new (NULL);
|
default_plugin_manager = meta_plugin_manager_new (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return default_plugin_manager;
|
return default_plugin_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutterPluginManager *
|
MetaPluginManager *
|
||||||
mutter_plugin_manager_get (MetaScreen *screen)
|
meta_plugin_manager_get (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MutterPluginManager *plugin_mgr;
|
MetaPluginManager *plugin_mgr;
|
||||||
|
|
||||||
plugin_mgr = g_object_get_data (G_OBJECT (screen), "mutter-plugin-manager");
|
plugin_mgr = g_object_get_data (G_OBJECT (screen), "meta-plugin-manager");
|
||||||
if (plugin_mgr)
|
if (plugin_mgr)
|
||||||
return plugin_mgr;
|
return plugin_mgr;
|
||||||
|
|
||||||
if (!default_plugin_manager)
|
if (!default_plugin_manager)
|
||||||
mutter_plugin_manager_get_default ();
|
meta_plugin_manager_get_default ();
|
||||||
|
|
||||||
if (!default_plugin_manager->screen)
|
if (!default_plugin_manager->screen)
|
||||||
{
|
{
|
||||||
/* The default plugin manager is so far unused, we can recycle it */
|
/* The default plugin manager is so far unused, we can recycle it */
|
||||||
default_plugin_manager->screen = screen;
|
default_plugin_manager->screen = screen;
|
||||||
g_object_set_data (G_OBJECT (screen), "mutter-plugin-manager", default_plugin_manager);
|
g_object_set_data (G_OBJECT (screen), "meta-plugin-manager", default_plugin_manager);
|
||||||
|
|
||||||
return default_plugin_manager;
|
return default_plugin_manager;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return mutter_plugin_manager_new (screen);
|
return meta_plugin_manager_new (screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_manager_kill_window_effects (MutterPluginManager *plugin_mgr,
|
meta_plugin_manager_kill_window_effects (MetaPluginManager *plugin_mgr,
|
||||||
MutterWindow *actor)
|
MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
GList *l = plugin_mgr->plugins;
|
GList *l = plugin_mgr->plugins;
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (!mutter_plugin_disabled (plugin)
|
if (!meta_plugin_disabled (plugin)
|
||||||
&& klass->kill_window_effects)
|
&& klass->kill_window_effects)
|
||||||
klass->kill_window_effects (plugin, actor);
|
klass->kill_window_effects (plugin, actor);
|
||||||
|
|
||||||
@ -421,17 +421,17 @@ mutter_plugin_manager_kill_window_effects (MutterPluginManager *plugin_mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_manager_kill_switch_workspace (MutterPluginManager *plugin_mgr)
|
meta_plugin_manager_kill_switch_workspace (MetaPluginManager *plugin_mgr)
|
||||||
{
|
{
|
||||||
GList *l = plugin_mgr->plugins;
|
GList *l = plugin_mgr->plugins;
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (!mutter_plugin_disabled (plugin)
|
if (!meta_plugin_disabled (plugin)
|
||||||
&& (mutter_plugin_features (plugin) & MUTTER_PLUGIN_SWITCH_WORKSPACE)
|
&& (meta_plugin_features (plugin) & META_PLUGIN_SWITCH_WORKSPACE)
|
||||||
&& klass->kill_switch_workspace)
|
&& klass->kill_switch_workspace)
|
||||||
klass->kill_switch_workspace (plugin);
|
klass->kill_switch_workspace (plugin);
|
||||||
|
|
||||||
@ -449,9 +449,9 @@ mutter_plugin_manager_kill_switch_workspace (MutterPluginManager *plugin_mgr)
|
|||||||
* appropriate post-effect cleanup is carried out.
|
* appropriate post-effect cleanup is carried out.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr,
|
meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr,
|
||||||
MutterWindow *actor,
|
MetaWindowActor *actor,
|
||||||
unsigned long event)
|
unsigned long event)
|
||||||
{
|
{
|
||||||
GList *l = plugin_mgr->plugins;
|
GList *l = plugin_mgr->plugins;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
@ -462,42 +462,42 @@ mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr,
|
|||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (!mutter_plugin_disabled (plugin) &&
|
if (!meta_plugin_disabled (plugin) &&
|
||||||
(mutter_plugin_features (plugin) & event))
|
(meta_plugin_features (plugin) & event))
|
||||||
{
|
{
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
|
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case MUTTER_PLUGIN_MINIMIZE:
|
case META_PLUGIN_MINIMIZE:
|
||||||
if (klass->minimize)
|
if (klass->minimize)
|
||||||
{
|
{
|
||||||
mutter_plugin_manager_kill_window_effects (
|
meta_plugin_manager_kill_window_effects (
|
||||||
plugin_mgr,
|
plugin_mgr,
|
||||||
actor);
|
actor);
|
||||||
|
|
||||||
_mutter_plugin_effect_started (plugin);
|
_meta_plugin_effect_started (plugin);
|
||||||
klass->minimize (plugin, actor);
|
klass->minimize (plugin, actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MUTTER_PLUGIN_MAP:
|
case META_PLUGIN_MAP:
|
||||||
if (klass->map)
|
if (klass->map)
|
||||||
{
|
{
|
||||||
mutter_plugin_manager_kill_window_effects (
|
meta_plugin_manager_kill_window_effects (
|
||||||
plugin_mgr,
|
plugin_mgr,
|
||||||
actor);
|
actor);
|
||||||
|
|
||||||
_mutter_plugin_effect_started (plugin);
|
_meta_plugin_effect_started (plugin);
|
||||||
klass->map (plugin, actor);
|
klass->map (plugin, actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MUTTER_PLUGIN_DESTROY:
|
case META_PLUGIN_DESTROY:
|
||||||
if (klass->destroy)
|
if (klass->destroy)
|
||||||
{
|
{
|
||||||
_mutter_plugin_effect_started (plugin);
|
_meta_plugin_effect_started (plugin);
|
||||||
klass->destroy (plugin, actor);
|
klass->destroy (plugin, actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -522,13 +522,13 @@ mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr,
|
|||||||
* appropriate post-effect cleanup is carried out.
|
* appropriate post-effect cleanup is carried out.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr,
|
meta_plugin_manager_event_maximize (MetaPluginManager *plugin_mgr,
|
||||||
MutterWindow *actor,
|
MetaWindowActor *actor,
|
||||||
unsigned long event,
|
unsigned long event,
|
||||||
gint target_x,
|
gint target_x,
|
||||||
gint target_y,
|
gint target_y,
|
||||||
gint target_width,
|
gint target_width,
|
||||||
gint target_height)
|
gint target_height)
|
||||||
{
|
{
|
||||||
GList *l = plugin_mgr->plugins;
|
GList *l = plugin_mgr->plugins;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
@ -539,37 +539,37 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr,
|
|||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (!mutter_plugin_disabled (plugin) &&
|
if (!meta_plugin_disabled (plugin) &&
|
||||||
(mutter_plugin_features (plugin) & event))
|
(meta_plugin_features (plugin) & event))
|
||||||
{
|
{
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
|
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case MUTTER_PLUGIN_MAXIMIZE:
|
case META_PLUGIN_MAXIMIZE:
|
||||||
if (klass->maximize)
|
if (klass->maximize)
|
||||||
{
|
{
|
||||||
mutter_plugin_manager_kill_window_effects (
|
meta_plugin_manager_kill_window_effects (
|
||||||
plugin_mgr,
|
plugin_mgr,
|
||||||
actor);
|
actor);
|
||||||
|
|
||||||
_mutter_plugin_effect_started (plugin);
|
_meta_plugin_effect_started (plugin);
|
||||||
klass->maximize (plugin, actor,
|
klass->maximize (plugin, actor,
|
||||||
target_x, target_y,
|
target_x, target_y,
|
||||||
target_width, target_height);
|
target_width, target_height);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MUTTER_PLUGIN_UNMAXIMIZE:
|
case META_PLUGIN_UNMAXIMIZE:
|
||||||
if (klass->unmaximize)
|
if (klass->unmaximize)
|
||||||
{
|
{
|
||||||
mutter_plugin_manager_kill_window_effects (
|
meta_plugin_manager_kill_window_effects (
|
||||||
plugin_mgr,
|
plugin_mgr,
|
||||||
actor);
|
actor);
|
||||||
|
|
||||||
_mutter_plugin_effect_started (plugin);
|
_meta_plugin_effect_started (plugin);
|
||||||
klass->unmaximize (plugin, actor,
|
klass->unmaximize (plugin, actor,
|
||||||
target_x, target_y,
|
target_x, target_y,
|
||||||
target_width, target_height);
|
target_width, target_height);
|
||||||
@ -595,10 +595,10 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr,
|
|||||||
* appropriate post-effect cleanup is carried out.
|
* appropriate post-effect cleanup is carried out.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_manager_switch_workspace (MutterPluginManager *plugin_mgr,
|
meta_plugin_manager_switch_workspace (MetaPluginManager *plugin_mgr,
|
||||||
gint from,
|
gint from,
|
||||||
gint to,
|
gint to,
|
||||||
MetaMotionDirection direction)
|
MetaMotionDirection direction)
|
||||||
{
|
{
|
||||||
GList *l = plugin_mgr->plugins;
|
GList *l = plugin_mgr->plugins;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
@ -609,18 +609,18 @@ mutter_plugin_manager_switch_workspace (MutterPluginManager *plugin_mgr,
|
|||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (!mutter_plugin_disabled (plugin) &&
|
if (!meta_plugin_disabled (plugin) &&
|
||||||
(mutter_plugin_features (plugin) & MUTTER_PLUGIN_SWITCH_WORKSPACE))
|
(meta_plugin_features (plugin) & META_PLUGIN_SWITCH_WORKSPACE))
|
||||||
{
|
{
|
||||||
if (klass->switch_workspace)
|
if (klass->switch_workspace)
|
||||||
{
|
{
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
mutter_plugin_manager_kill_switch_workspace (plugin_mgr);
|
meta_plugin_manager_kill_switch_workspace (plugin_mgr);
|
||||||
|
|
||||||
_mutter_plugin_effect_started (plugin);
|
_meta_plugin_effect_started (plugin);
|
||||||
klass->switch_workspace (plugin, from, to, direction);
|
klass->switch_workspace (plugin, from, to, direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -640,8 +640,8 @@ mutter_plugin_manager_switch_workspace (MutterPluginManager *plugin_mgr,
|
|||||||
* appropriate post-effect cleanup is carried out.
|
* appropriate post-effect cleanup is carried out.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_manager_xevent_filter (MutterPluginManager *plugin_mgr,
|
meta_plugin_manager_xevent_filter (MetaPluginManager *plugin_mgr,
|
||||||
XEvent *xev)
|
XEvent *xev)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
gboolean have_plugin_xevent_func;
|
gboolean have_plugin_xevent_func;
|
||||||
@ -671,8 +671,8 @@ mutter_plugin_manager_xevent_filter (MutterPluginManager *plugin_mgr,
|
|||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = l->data;
|
MetaPlugin *plugin = l->data;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (klass->xevent_filter)
|
if (klass->xevent_filter)
|
||||||
{
|
{
|
78
src/compositor/meta-plugin-manager.h
Normal file
78
src/compositor/meta-plugin-manager.h
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2008 Intel Corp.
|
||||||
|
*
|
||||||
|
* Author: Tomas Frydrych <tf@linux.intel.com>
|
||||||
|
*
|
||||||
|
* 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_PLUGIN_MANAGER_H_
|
||||||
|
#define META_PLUGIN_MANAGER_H_
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
#include "screen.h"
|
||||||
|
|
||||||
|
#define META_PLUGIN_FROM_MANAGER_
|
||||||
|
#include "meta-plugin.h"
|
||||||
|
#undef META_PLUGIN_FROM_MANAGER_
|
||||||
|
|
||||||
|
#define META_PLUGIN_MINIMIZE (1<<0)
|
||||||
|
#define META_PLUGIN_MAXIMIZE (1<<1)
|
||||||
|
#define META_PLUGIN_UNMAXIMIZE (1<<2)
|
||||||
|
#define META_PLUGIN_MAP (1<<3)
|
||||||
|
#define META_PLUGIN_DESTROY (1<<4)
|
||||||
|
#define META_PLUGIN_SWITCH_WORKSPACE (1<<5)
|
||||||
|
|
||||||
|
#define META_PLUGIN_ALL_EFFECTS (~0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MetaPluginManager: (skip)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
typedef struct MetaPluginManager MetaPluginManager;
|
||||||
|
|
||||||
|
MetaPluginManager * meta_plugin_manager_get (MetaScreen *screen);
|
||||||
|
MetaPluginManager * meta_plugin_manager_get_default (void);
|
||||||
|
|
||||||
|
gboolean meta_plugin_manager_load (MetaPluginManager *mgr);
|
||||||
|
gboolean meta_plugin_manager_initialize (MetaPluginManager *plugin_mgr);
|
||||||
|
gboolean meta_plugin_manager_event_simple (MetaPluginManager *mgr,
|
||||||
|
MetaWindowActor *actor,
|
||||||
|
unsigned long event);
|
||||||
|
|
||||||
|
gboolean meta_plugin_manager_event_maximize (MetaPluginManager *mgr,
|
||||||
|
MetaWindowActor *actor,
|
||||||
|
unsigned long event,
|
||||||
|
gint target_x,
|
||||||
|
gint target_y,
|
||||||
|
gint target_width,
|
||||||
|
gint target_height);
|
||||||
|
void meta_plugin_manager_update_workspaces (MetaPluginManager *mgr);
|
||||||
|
|
||||||
|
void meta_plugin_manager_update_workspace (MetaPluginManager *mgr,
|
||||||
|
MetaWorkspace *w);
|
||||||
|
|
||||||
|
gboolean meta_plugin_manager_switch_workspace (MetaPluginManager *mgr,
|
||||||
|
gint from,
|
||||||
|
gint to,
|
||||||
|
MetaMotionDirection direction);
|
||||||
|
|
||||||
|
gboolean meta_plugin_manager_xevent_filter (MetaPluginManager *mgr,
|
||||||
|
XEvent *xev);
|
||||||
|
|
||||||
|
#endif
|
@ -21,7 +21,7 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mutter-plugin.h"
|
#include "meta-plugin.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
@ -32,12 +32,12 @@
|
|||||||
#include <clutter/x11/clutter-x11.h>
|
#include <clutter/x11/clutter-x11.h>
|
||||||
|
|
||||||
#include "compositor-private.h"
|
#include "compositor-private.h"
|
||||||
#include "mutter-window-private.h"
|
#include "meta-window-actor-private.h"
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE (MutterPlugin, mutter_plugin, G_TYPE_OBJECT);
|
G_DEFINE_ABSTRACT_TYPE (MetaPlugin, meta_plugin, G_TYPE_OBJECT);
|
||||||
|
|
||||||
#define MUTTER_PLUGIN_GET_PRIVATE(obj) \
|
#define META_PLUGIN_GET_PRIVATE(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_PLUGIN, MutterPluginPrivate))
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_PLUGIN, MetaPluginPrivate))
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -49,7 +49,7 @@ enum
|
|||||||
PROP_DEBUG_MODE,
|
PROP_DEBUG_MODE,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterPluginPrivate
|
struct _MetaPluginPrivate
|
||||||
{
|
{
|
||||||
MetaScreen *screen;
|
MetaScreen *screen;
|
||||||
gchar *params;
|
gchar *params;
|
||||||
@ -62,51 +62,51 @@ struct _MutterPluginPrivate
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_dispose (GObject *object)
|
meta_plugin_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
G_OBJECT_CLASS (mutter_plugin_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_plugin_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_finalize (GObject *object)
|
meta_plugin_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (object)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (object)->priv;
|
||||||
|
|
||||||
g_free (priv->params);
|
g_free (priv->params);
|
||||||
priv->params = NULL;
|
priv->params = NULL;
|
||||||
|
|
||||||
G_OBJECT_CLASS (mutter_plugin_parent_class)->finalize (object);
|
G_OBJECT_CLASS (meta_plugin_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_parse_params (MutterPlugin *plugin)
|
meta_plugin_parse_params (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
gulong features = 0;
|
gulong features = 0;
|
||||||
MutterPluginPrivate *priv = plugin->priv;
|
MetaPluginPrivate *priv = plugin->priv;
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Feature flags: identify events that the plugin can handle; a plugin can
|
* Feature flags: identify events that the plugin can handle; a plugin can
|
||||||
* handle one or more events.
|
* handle one or more events.
|
||||||
*/
|
*/
|
||||||
if (klass->minimize)
|
if (klass->minimize)
|
||||||
features |= MUTTER_PLUGIN_MINIMIZE;
|
features |= META_PLUGIN_MINIMIZE;
|
||||||
|
|
||||||
if (klass->maximize)
|
if (klass->maximize)
|
||||||
features |= MUTTER_PLUGIN_MAXIMIZE;
|
features |= META_PLUGIN_MAXIMIZE;
|
||||||
|
|
||||||
if (klass->unmaximize)
|
if (klass->unmaximize)
|
||||||
features |= MUTTER_PLUGIN_UNMAXIMIZE;
|
features |= META_PLUGIN_UNMAXIMIZE;
|
||||||
|
|
||||||
if (klass->map)
|
if (klass->map)
|
||||||
features |= MUTTER_PLUGIN_MAP;
|
features |= META_PLUGIN_MAP;
|
||||||
|
|
||||||
if (klass->destroy)
|
if (klass->destroy)
|
||||||
features |= MUTTER_PLUGIN_DESTROY;
|
features |= META_PLUGIN_DESTROY;
|
||||||
|
|
||||||
if (klass->switch_workspace)
|
if (klass->switch_workspace)
|
||||||
features |= MUTTER_PLUGIN_SWITCH_WORKSPACE;
|
features |= META_PLUGIN_SWITCH_WORKSPACE;
|
||||||
|
|
||||||
if (priv->params)
|
if (priv->params)
|
||||||
{
|
{
|
||||||
@ -122,22 +122,22 @@ mutter_plugin_parse_params (MutterPlugin *plugin)
|
|||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
if (strstr (d, "minimize"))
|
if (strstr (d, "minimize"))
|
||||||
features &= ~ MUTTER_PLUGIN_MINIMIZE;
|
features &= ~ META_PLUGIN_MINIMIZE;
|
||||||
|
|
||||||
if (strstr (d, "maximize"))
|
if (strstr (d, "maximize"))
|
||||||
features &= ~ MUTTER_PLUGIN_MAXIMIZE;
|
features &= ~ META_PLUGIN_MAXIMIZE;
|
||||||
|
|
||||||
if (strstr (d, "unmaximize"))
|
if (strstr (d, "unmaximize"))
|
||||||
features &= ~ MUTTER_PLUGIN_UNMAXIMIZE;
|
features &= ~ META_PLUGIN_UNMAXIMIZE;
|
||||||
|
|
||||||
if (strstr (d, "map"))
|
if (strstr (d, "map"))
|
||||||
features &= ~ MUTTER_PLUGIN_MAP;
|
features &= ~ META_PLUGIN_MAP;
|
||||||
|
|
||||||
if (strstr (d, "destroy"))
|
if (strstr (d, "destroy"))
|
||||||
features &= ~ MUTTER_PLUGIN_DESTROY;
|
features &= ~ META_PLUGIN_DESTROY;
|
||||||
|
|
||||||
if (strstr (d, "switch-workspace"))
|
if (strstr (d, "switch-workspace"))
|
||||||
features &= ~MUTTER_PLUGIN_SWITCH_WORKSPACE;
|
features &= ~META_PLUGIN_SWITCH_WORKSPACE;
|
||||||
|
|
||||||
g_free (d);
|
g_free (d);
|
||||||
}
|
}
|
||||||
@ -162,12 +162,12 @@ mutter_plugin_parse_params (MutterPlugin *plugin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_set_property (GObject *object,
|
meta_plugin_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (object)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (object)->priv;
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@ -176,7 +176,7 @@ mutter_plugin_set_property (GObject *object,
|
|||||||
break;
|
break;
|
||||||
case PROP_PARAMS:
|
case PROP_PARAMS:
|
||||||
priv->params = g_value_dup_string (value);
|
priv->params = g_value_dup_string (value);
|
||||||
mutter_plugin_parse_params (MUTTER_PLUGIN (object));
|
meta_plugin_parse_params (META_PLUGIN (object));
|
||||||
break;
|
break;
|
||||||
case PROP_DISABLED:
|
case PROP_DISABLED:
|
||||||
priv->disabled = g_value_get_boolean (value);
|
priv->disabled = g_value_get_boolean (value);
|
||||||
@ -191,12 +191,12 @@ mutter_plugin_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_get_property (GObject *object,
|
meta_plugin_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (object)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (object)->priv;
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@ -223,14 +223,14 @@ mutter_plugin_get_property (GObject *object,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_class_init (MutterPluginClass *klass)
|
meta_plugin_class_init (MetaPluginClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
gobject_class->finalize = mutter_plugin_finalize;
|
gobject_class->finalize = meta_plugin_finalize;
|
||||||
gobject_class->dispose = mutter_plugin_dispose;
|
gobject_class->dispose = meta_plugin_dispose;
|
||||||
gobject_class->set_property = mutter_plugin_set_property;
|
gobject_class->set_property = meta_plugin_set_property;
|
||||||
gobject_class->get_property = mutter_plugin_get_property;
|
gobject_class->get_property = meta_plugin_get_property;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_SCREEN,
|
PROP_SCREEN,
|
||||||
@ -273,53 +273,53 @@ mutter_plugin_class_init (MutterPluginClass *klass)
|
|||||||
FALSE,
|
FALSE,
|
||||||
G_PARAM_READABLE));
|
G_PARAM_READABLE));
|
||||||
|
|
||||||
g_type_class_add_private (gobject_class, sizeof (MutterPluginPrivate));
|
g_type_class_add_private (gobject_class, sizeof (MetaPluginPrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_init (MutterPlugin *self)
|
meta_plugin_init (MetaPlugin *self)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv;
|
MetaPluginPrivate *priv;
|
||||||
|
|
||||||
self->priv = priv = MUTTER_PLUGIN_GET_PRIVATE (self);
|
self->priv = priv = META_PLUGIN_GET_PRIVATE (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
gulong
|
gulong
|
||||||
mutter_plugin_features (MutterPlugin *plugin)
|
meta_plugin_features (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return priv->features;
|
return priv->features;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_disabled (MutterPlugin *plugin)
|
meta_plugin_disabled (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return priv->disabled;
|
return priv->disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_running (MutterPlugin *plugin)
|
meta_plugin_running (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return (priv->running > 0);
|
return (priv->running > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_debug_mode (MutterPlugin *plugin)
|
meta_plugin_debug_mode (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return priv->debug;
|
return priv->debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MutterPluginInfo *
|
const MetaPluginInfo *
|
||||||
mutter_plugin_get_info (MutterPlugin *plugin)
|
meta_plugin_get_info (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
|
|
||||||
if (klass && klass->plugin_info)
|
if (klass && klass->plugin_info)
|
||||||
return klass->plugin_info (plugin);
|
return klass->plugin_info (plugin);
|
||||||
@ -328,50 +328,50 @@ mutter_plugin_get_info (MutterPlugin *plugin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_plugin_get_overlay_group (MutterPlugin *plugin)
|
meta_plugin_get_overlay_group (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return mutter_get_overlay_group_for_screen (priv->screen);
|
return meta_get_overlay_group_for_screen (priv->screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_plugin_get_stage (MutterPlugin *plugin)
|
meta_plugin_get_stage (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return mutter_get_stage_for_screen (priv->screen);
|
return meta_get_stage_for_screen (priv->screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_plugin_get_window_group (MutterPlugin *plugin)
|
meta_plugin_get_window_group (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return mutter_get_window_group_for_screen (priv->screen);
|
return meta_get_window_group_for_screen (priv->screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _mutter_plugin_effect_started:
|
* _meta_plugin_effect_started:
|
||||||
* @plugin: the plugin
|
* @plugin: the plugin
|
||||||
*
|
*
|
||||||
* Mark that an effect has started for the plugin. This is called
|
* Mark that an effect has started for the plugin. This is called
|
||||||
* internally by MutterPluginManager.
|
* internally by MetaPluginManager.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mutter_plugin_effect_started (MutterPlugin *plugin)
|
_meta_plugin_effect_started (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
priv->running++;
|
priv->running++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_switch_workspace_completed (MutterPlugin *plugin)
|
meta_plugin_switch_workspace_completed (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
MetaScreen *screen = mutter_plugin_get_screen (plugin);
|
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
||||||
|
|
||||||
if (priv->running-- < 0)
|
if (priv->running-- < 0)
|
||||||
{
|
{
|
||||||
@ -379,15 +379,15 @@ mutter_plugin_switch_workspace_completed (MutterPlugin *plugin)
|
|||||||
priv->running = 0;
|
priv->running = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutter_switch_workspace_completed (screen);
|
meta_switch_workspace_completed (screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_plugin_window_effect_completed (MutterPlugin *plugin,
|
meta_plugin_window_effect_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor,
|
MetaWindowActor *actor,
|
||||||
unsigned long event)
|
unsigned long event)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
if (priv->running-- < 0)
|
if (priv->running-- < 0)
|
||||||
{
|
{
|
||||||
@ -397,82 +397,82 @@ mutter_plugin_window_effect_completed (MutterPlugin *plugin,
|
|||||||
|
|
||||||
if (!actor)
|
if (!actor)
|
||||||
{
|
{
|
||||||
const MutterPluginInfo *info;
|
const MetaPluginInfo *info;
|
||||||
const gchar *name = NULL;
|
const gchar *name = NULL;
|
||||||
|
|
||||||
if (plugin && (info = mutter_plugin_get_info (plugin)))
|
if (plugin && (info = meta_plugin_get_info (plugin)))
|
||||||
name = info->name;
|
name = info->name;
|
||||||
|
|
||||||
g_warning ("Plugin [%s] passed NULL for actor!",
|
g_warning ("Plugin [%s] passed NULL for actor!",
|
||||||
name ? name : "unknown");
|
name ? name : "unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
mutter_window_effect_completed (actor, event);
|
meta_window_actor_effect_completed (actor, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_minimize_completed (MutterPlugin *plugin,
|
meta_plugin_minimize_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor)
|
MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_MINIMIZE);
|
meta_plugin_window_effect_completed (plugin, actor, META_PLUGIN_MINIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_maximize_completed (MutterPlugin *plugin,
|
meta_plugin_maximize_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor)
|
MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_MAXIMIZE);
|
meta_plugin_window_effect_completed (plugin, actor, META_PLUGIN_MAXIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_unmaximize_completed (MutterPlugin *plugin,
|
meta_plugin_unmaximize_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor)
|
MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_UNMAXIMIZE);
|
meta_plugin_window_effect_completed (plugin, actor, META_PLUGIN_UNMAXIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_map_completed (MutterPlugin *plugin,
|
meta_plugin_map_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor)
|
MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_MAP);
|
meta_plugin_window_effect_completed (plugin, actor, META_PLUGIN_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_destroy_completed (MutterPlugin *plugin,
|
meta_plugin_destroy_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor)
|
MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_DESTROY);
|
meta_plugin_window_effect_completed (plugin, actor, META_PLUGIN_DESTROY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_query_screen_size (MutterPlugin *plugin,
|
meta_plugin_query_screen_size (MetaPlugin *plugin,
|
||||||
int *width,
|
int *width,
|
||||||
int *height)
|
int *height)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
meta_screen_get_size (priv->screen, width, height);
|
meta_screen_get_size (priv->screen, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_set_stage_reactive (MutterPlugin *plugin,
|
meta_plugin_set_stage_reactive (MetaPlugin *plugin,
|
||||||
gboolean reactive)
|
gboolean reactive)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
MetaScreen *screen = priv->screen;
|
MetaScreen *screen = priv->screen;
|
||||||
|
|
||||||
if (reactive)
|
if (reactive)
|
||||||
mutter_set_stage_input_region (screen, None);
|
meta_set_stage_input_region (screen, None);
|
||||||
else
|
else
|
||||||
mutter_empty_stage_input_region (screen);
|
meta_empty_stage_input_region (screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_set_stage_input_area (MutterPlugin *plugin,
|
meta_plugin_set_stage_input_area (MetaPlugin *plugin,
|
||||||
gint x, gint y, gint width, gint height)
|
gint x, gint y, gint width, gint height)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
MetaScreen *screen = priv->screen;
|
MetaScreen *screen = priv->screen;
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
Display *xdpy = meta_display_get_xdisplay (display);
|
Display *xdpy = meta_display_get_xdisplay (display);
|
||||||
@ -485,43 +485,43 @@ mutter_plugin_set_stage_input_area (MutterPlugin *plugin,
|
|||||||
rect.height = height;
|
rect.height = height;
|
||||||
|
|
||||||
region = XFixesCreateRegion (xdpy, &rect, 1);
|
region = XFixesCreateRegion (xdpy, &rect, 1);
|
||||||
mutter_set_stage_input_region (screen, region);
|
meta_set_stage_input_region (screen, region);
|
||||||
XFixesDestroyRegion (xdpy, region);
|
XFixesDestroyRegion (xdpy, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_set_stage_input_region (MutterPlugin *plugin,
|
meta_plugin_set_stage_input_region (MetaPlugin *plugin,
|
||||||
XserverRegion region)
|
XserverRegion region)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
MetaScreen *screen = priv->screen;
|
MetaScreen *screen = priv->screen;
|
||||||
|
|
||||||
mutter_set_stage_input_region (screen, region);
|
meta_set_stage_input_region (screen, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_plugin_get_windows:
|
* meta_plugin_get_window_actors:
|
||||||
* @plugin: A #MutterPlugin
|
* @plugin: A #MetaPlugin
|
||||||
*
|
*
|
||||||
* This function returns all of the #MutterWindow objects referenced by Mutter, including
|
* This function returns all of the #MetaWindowActor objects referenced by Mutter, including
|
||||||
* override-redirect windows. The returned list is a snapshot of Mutter's current
|
* override-redirect windows. The returned list is a snapshot of Mutter's current
|
||||||
* stacking order, with the topmost window last.
|
* stacking order, with the topmost window last.
|
||||||
*
|
*
|
||||||
* The 'restacked' signal of #MetaScreen signals when this value has changed.
|
* The 'restacked' signal of #MetaScreen signals when this value has changed.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none) (element-type MutterWindow): Windows in stacking order, topmost last
|
* Returns: (transfer none) (element-type MetaWindowActor): Windows in stacking order, topmost last
|
||||||
*/
|
*/
|
||||||
GList *
|
GList *
|
||||||
mutter_plugin_get_windows (MutterPlugin *plugin)
|
meta_plugin_get_window_actors (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return mutter_get_windows (priv->screen);
|
return meta_get_window_actors (priv->screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_plugin_begin_modal:
|
* meta_plugin_begin_modal:
|
||||||
* @plugin: a #MutterPlugin
|
* @plugin: a #MetaPlugin
|
||||||
* @grab_window: the X window to grab the keyboard and mouse on
|
* @grab_window: the X window to grab the keyboard and mouse on
|
||||||
* @cursor: the cursor to use for the pointer grab, or None,
|
* @cursor: the cursor to use for the pointer grab, or None,
|
||||||
* to use the normal cursor for the grab window and
|
* to use the normal cursor for the grab window and
|
||||||
@ -532,7 +532,7 @@ mutter_plugin_get_windows (MutterPlugin *plugin)
|
|||||||
* This function is used to grab the keyboard and mouse for the exclusive
|
* This function is used to grab the keyboard and mouse for the exclusive
|
||||||
* use of the plugin. Correct operation requires that both the keyboard
|
* use of the plugin. Correct operation requires that both the keyboard
|
||||||
* and mouse are grabbed, or thing will break. (In particular, other
|
* and mouse are grabbed, or thing will break. (In particular, other
|
||||||
* passive X grabs in Mutter can trigger but not be handled by the normal
|
* passive X grabs in Meta can trigger but not be handled by the normal
|
||||||
* keybinding handling code.) However, the plugin can establish the keyboard
|
* keybinding handling code.) However, the plugin can establish the keyboard
|
||||||
* and/or mouse grabs ahead of time and pass in the
|
* and/or mouse grabs ahead of time and pass in the
|
||||||
* %META_MODAL_POINTER_ALREADY_GRABBED and/or %META_MODAL_KEYBOARD_ALREADY_GRABBED
|
* %META_MODAL_POINTER_ALREADY_GRABBED and/or %META_MODAL_KEYBOARD_ALREADY_GRABBED
|
||||||
@ -545,21 +545,21 @@ mutter_plugin_get_windows (MutterPlugin *plugin)
|
|||||||
* mouse and made the plugin modal.
|
* mouse and made the plugin modal.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_begin_modal (MutterPlugin *plugin,
|
meta_plugin_begin_modal (MetaPlugin *plugin,
|
||||||
Window grab_window,
|
Window grab_window,
|
||||||
Cursor cursor,
|
Cursor cursor,
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return mutter_begin_modal_for_plugin (priv->screen, plugin,
|
return meta_begin_modal_for_plugin (priv->screen, plugin,
|
||||||
grab_window, cursor, options, timestamp);
|
grab_window, cursor, options, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_plugin_end_modal
|
* meta_plugin_end_modal
|
||||||
* @plugin: a #MutterPlugin
|
* @plugin: a #MetaPlugin
|
||||||
* @timestamp: the time used for releasing grabs
|
* @timestamp: the time used for releasing grabs
|
||||||
*
|
*
|
||||||
* Ends the modal operation begun with meta_plugin_begin_modal(). This
|
* Ends the modal operation begun with meta_plugin_begin_modal(). This
|
||||||
@ -569,27 +569,27 @@ mutter_plugin_begin_modal (MutterPlugin *plugin,
|
|||||||
* when beginnning the modal operation.
|
* when beginnning the modal operation.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_plugin_end_modal (MutterPlugin *plugin,
|
meta_plugin_end_modal (MetaPlugin *plugin,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
mutter_end_modal_for_plugin (priv->screen, plugin, timestamp);
|
meta_end_modal_for_plugin (priv->screen, plugin, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Display *
|
Display *
|
||||||
mutter_plugin_get_xdisplay (MutterPlugin *plugin)
|
meta_plugin_get_xdisplay (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
MetaDisplay *display = meta_screen_get_display (priv->screen);
|
MetaDisplay *display = meta_screen_get_display (priv->screen);
|
||||||
Display *xdpy = meta_display_get_xdisplay (display);
|
Display *xdpy = meta_display_get_xdisplay (display);
|
||||||
|
|
||||||
return xdpy;
|
return xdpy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_plugin_get_screen:
|
* meta_plugin_get_screen:
|
||||||
* @plugin: a #MutterPlugin
|
* @plugin: a #MetaPlugin
|
||||||
*
|
*
|
||||||
* Gets the #MetaScreen corresponding to a plugin. Each plugin instance
|
* Gets the #MetaScreen corresponding to a plugin. Each plugin instance
|
||||||
* is associated with exactly one screen; if Metacity is managing
|
* is associated with exactly one screen; if Metacity is managing
|
||||||
@ -598,9 +598,9 @@ mutter_plugin_get_xdisplay (MutterPlugin *plugin)
|
|||||||
* Return value: (transfer none): the #MetaScreen for the plugin
|
* Return value: (transfer none): the #MetaScreen for the plugin
|
||||||
*/
|
*/
|
||||||
MetaScreen *
|
MetaScreen *
|
||||||
mutter_plugin_get_screen (MutterPlugin *plugin)
|
meta_plugin_get_screen (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return priv->screen;
|
return priv->screen;
|
||||||
}
|
}
|
@ -25,45 +25,45 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include "mutter-shaped-texture.h"
|
#include "meta-shaped-texture.h"
|
||||||
#include "mutter-texture-tower.h"
|
#include "meta-texture-tower.h"
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static void mutter_shaped_texture_dispose (GObject *object);
|
static void meta_shaped_texture_dispose (GObject *object);
|
||||||
static void mutter_shaped_texture_finalize (GObject *object);
|
static void meta_shaped_texture_finalize (GObject *object);
|
||||||
static void mutter_shaped_texture_notify (GObject *object,
|
static void meta_shaped_texture_notify (GObject *object,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void mutter_shaped_texture_paint (ClutterActor *actor);
|
static void meta_shaped_texture_paint (ClutterActor *actor);
|
||||||
static void mutter_shaped_texture_pick (ClutterActor *actor,
|
static void meta_shaped_texture_pick (ClutterActor *actor,
|
||||||
const ClutterColor *color);
|
const ClutterColor *color);
|
||||||
|
|
||||||
static void mutter_shaped_texture_update_area (ClutterX11TexturePixmap *texture,
|
static void meta_shaped_texture_update_area (ClutterX11TexturePixmap *texture,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height);
|
int height);
|
||||||
|
|
||||||
static void mutter_shaped_texture_dirty_mask (MutterShapedTexture *stex);
|
static void meta_shaped_texture_dirty_mask (MetaShapedTexture *stex);
|
||||||
|
|
||||||
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
||||||
G_DEFINE_TYPE (MutterShapedTexture, mutter_shaped_texture,
|
G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture,
|
||||||
CLUTTER_GLX_TYPE_TEXTURE_PIXMAP);
|
CLUTTER_GLX_TYPE_TEXTURE_PIXMAP);
|
||||||
#else /* HAVE_GLX_TEXTURE_PIXMAP */
|
#else /* HAVE_GLX_TEXTURE_PIXMAP */
|
||||||
G_DEFINE_TYPE (MutterShapedTexture, mutter_shaped_texture,
|
G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture,
|
||||||
CLUTTER_X11_TYPE_TEXTURE_PIXMAP);
|
CLUTTER_X11_TYPE_TEXTURE_PIXMAP);
|
||||||
#endif /* HAVE_GLX_TEXTURE_PIXMAP */
|
#endif /* HAVE_GLX_TEXTURE_PIXMAP */
|
||||||
|
|
||||||
#define MUTTER_SHAPED_TEXTURE_GET_PRIVATE(obj) \
|
#define META_SHAPED_TEXTURE_GET_PRIVATE(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_SHAPED_TEXTURE, \
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_SHAPED_TEXTURE, \
|
||||||
MutterShapedTexturePrivate))
|
MetaShapedTexturePrivate))
|
||||||
|
|
||||||
struct _MutterShapedTexturePrivate
|
struct _MetaShapedTexturePrivate
|
||||||
{
|
{
|
||||||
MutterTextureTower *paint_tower;
|
MetaTextureTower *paint_tower;
|
||||||
CoglHandle mask_texture;
|
CoglHandle mask_texture;
|
||||||
CoglHandle material;
|
CoglHandle material;
|
||||||
CoglHandle material_unshaped;
|
CoglHandle material_unshaped;
|
||||||
@ -78,49 +78,49 @@ struct _MutterShapedTexturePrivate
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_class_init (MutterShapedTextureClass *klass)
|
meta_shaped_texture_class_init (MetaShapedTextureClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = (GObjectClass *) klass;
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
||||||
ClutterActorClass *actor_class = (ClutterActorClass *) klass;
|
ClutterActorClass *actor_class = (ClutterActorClass *) klass;
|
||||||
ClutterX11TexturePixmapClass *x11_texture_class = (ClutterX11TexturePixmapClass *) klass;
|
ClutterX11TexturePixmapClass *x11_texture_class = (ClutterX11TexturePixmapClass *) klass;
|
||||||
|
|
||||||
gobject_class->dispose = mutter_shaped_texture_dispose;
|
gobject_class->dispose = meta_shaped_texture_dispose;
|
||||||
gobject_class->finalize = mutter_shaped_texture_finalize;
|
gobject_class->finalize = meta_shaped_texture_finalize;
|
||||||
gobject_class->notify = mutter_shaped_texture_notify;
|
gobject_class->notify = meta_shaped_texture_notify;
|
||||||
|
|
||||||
actor_class->paint = mutter_shaped_texture_paint;
|
actor_class->paint = meta_shaped_texture_paint;
|
||||||
actor_class->pick = mutter_shaped_texture_pick;
|
actor_class->pick = meta_shaped_texture_pick;
|
||||||
|
|
||||||
x11_texture_class->update_area = mutter_shaped_texture_update_area;
|
x11_texture_class->update_area = meta_shaped_texture_update_area;
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (MutterShapedTexturePrivate));
|
g_type_class_add_private (klass, sizeof (MetaShapedTexturePrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_init (MutterShapedTexture *self)
|
meta_shaped_texture_init (MetaShapedTexture *self)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv;
|
MetaShapedTexturePrivate *priv;
|
||||||
|
|
||||||
priv = self->priv = MUTTER_SHAPED_TEXTURE_GET_PRIVATE (self);
|
priv = self->priv = META_SHAPED_TEXTURE_GET_PRIVATE (self);
|
||||||
|
|
||||||
priv->rectangles = g_array_new (FALSE, FALSE, sizeof (XRectangle));
|
priv->rectangles = g_array_new (FALSE, FALSE, sizeof (XRectangle));
|
||||||
|
|
||||||
priv->paint_tower = mutter_texture_tower_new ();
|
priv->paint_tower = meta_texture_tower_new ();
|
||||||
priv->mask_texture = COGL_INVALID_HANDLE;
|
priv->mask_texture = COGL_INVALID_HANDLE;
|
||||||
priv->create_mipmaps = TRUE;
|
priv->create_mipmaps = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_dispose (GObject *object)
|
meta_shaped_texture_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
MutterShapedTexture *self = (MutterShapedTexture *) object;
|
MetaShapedTexture *self = (MetaShapedTexture *) object;
|
||||||
MutterShapedTexturePrivate *priv = self->priv;
|
MetaShapedTexturePrivate *priv = self->priv;
|
||||||
|
|
||||||
if (priv->paint_tower)
|
if (priv->paint_tower)
|
||||||
mutter_texture_tower_free (priv->paint_tower);
|
meta_texture_tower_free (priv->paint_tower);
|
||||||
priv->paint_tower = NULL;
|
priv->paint_tower = NULL;
|
||||||
|
|
||||||
mutter_shaped_texture_dirty_mask (self);
|
meta_shaped_texture_dirty_mask (self);
|
||||||
|
|
||||||
if (priv->material != COGL_INVALID_HANDLE)
|
if (priv->material != COGL_INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
@ -133,28 +133,28 @@ mutter_shaped_texture_dispose (GObject *object)
|
|||||||
priv->material_unshaped = COGL_INVALID_HANDLE;
|
priv->material_unshaped = COGL_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutter_shaped_texture_set_clip_region (self, NULL);
|
meta_shaped_texture_set_clip_region (self, NULL);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mutter_shaped_texture_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_shaped_texture_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_finalize (GObject *object)
|
meta_shaped_texture_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
MutterShapedTexture *self = (MutterShapedTexture *) object;
|
MetaShapedTexture *self = (MetaShapedTexture *) object;
|
||||||
MutterShapedTexturePrivate *priv = self->priv;
|
MetaShapedTexturePrivate *priv = self->priv;
|
||||||
|
|
||||||
g_array_free (priv->rectangles, TRUE);
|
g_array_free (priv->rectangles, TRUE);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mutter_shaped_texture_parent_class)->finalize (object);
|
G_OBJECT_CLASS (meta_shaped_texture_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_notify (GObject *object,
|
meta_shaped_texture_notify (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
if (G_OBJECT_CLASS (mutter_shaped_texture_parent_class)->notify)
|
if (G_OBJECT_CLASS (meta_shaped_texture_parent_class)->notify)
|
||||||
G_OBJECT_CLASS (mutter_shaped_texture_parent_class)->notify (object, pspec);
|
G_OBJECT_CLASS (meta_shaped_texture_parent_class)->notify (object, pspec);
|
||||||
|
|
||||||
/* It seems like we could just do this out of update_area(), but unfortunately,
|
/* It seems like we could just do this out of update_area(), but unfortunately,
|
||||||
* clutter_glx_texture_pixmap() doesn't call through the vtable on the
|
* clutter_glx_texture_pixmap() doesn't call through the vtable on the
|
||||||
@ -163,21 +163,21 @@ mutter_shaped_texture_notify (GObject *object,
|
|||||||
*/
|
*/
|
||||||
if (strcmp (pspec->name, "cogl-texture") == 0)
|
if (strcmp (pspec->name, "cogl-texture") == 0)
|
||||||
{
|
{
|
||||||
MutterShapedTexture *stex = (MutterShapedTexture *) object;
|
MetaShapedTexture *stex = (MetaShapedTexture *) object;
|
||||||
MutterShapedTexturePrivate *priv = stex->priv;
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
|
|
||||||
mutter_shaped_texture_clear (stex);
|
meta_shaped_texture_clear (stex);
|
||||||
|
|
||||||
if (priv->create_mipmaps)
|
if (priv->create_mipmaps)
|
||||||
mutter_texture_tower_set_base_texture (priv->paint_tower,
|
meta_texture_tower_set_base_texture (priv->paint_tower,
|
||||||
clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex)));
|
clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_dirty_mask (MutterShapedTexture *stex)
|
meta_shaped_texture_dirty_mask (MetaShapedTexture *stex)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv = stex->priv;
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
|
|
||||||
if (priv->mask_texture != COGL_INVALID_HANDLE)
|
if (priv->mask_texture != COGL_INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
@ -199,9 +199,9 @@ mutter_shaped_texture_dirty_mask (MutterShapedTexture *stex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_ensure_mask (MutterShapedTexture *stex)
|
meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv = stex->priv;
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
CoglHandle paint_tex;
|
CoglHandle paint_tex;
|
||||||
guint tex_width, tex_height;
|
guint tex_width, tex_height;
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ mutter_shaped_texture_ensure_mask (MutterShapedTexture *stex)
|
|||||||
recreate it */
|
recreate it */
|
||||||
if (priv->mask_texture != COGL_INVALID_HANDLE
|
if (priv->mask_texture != COGL_INVALID_HANDLE
|
||||||
&& (priv->mask_width != tex_width || priv->mask_height != tex_height))
|
&& (priv->mask_width != tex_width || priv->mask_height != tex_height))
|
||||||
mutter_shaped_texture_dirty_mask (stex);
|
meta_shaped_texture_dirty_mask (stex);
|
||||||
|
|
||||||
/* If we don't have a mask texture yet then create one */
|
/* If we don't have a mask texture yet then create one */
|
||||||
if (priv->mask_texture == COGL_INVALID_HANDLE)
|
if (priv->mask_texture == COGL_INVALID_HANDLE)
|
||||||
@ -290,10 +290,10 @@ mutter_shaped_texture_ensure_mask (MutterShapedTexture *stex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_paint (ClutterActor *actor)
|
meta_shaped_texture_paint (ClutterActor *actor)
|
||||||
{
|
{
|
||||||
MutterShapedTexture *stex = (MutterShapedTexture *) actor;
|
MetaShapedTexture *stex = (MetaShapedTexture *) actor;
|
||||||
MutterShapedTexturePrivate *priv = stex->priv;
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
CoglHandle paint_tex;
|
CoglHandle paint_tex;
|
||||||
guint tex_width, tex_height;
|
guint tex_width, tex_height;
|
||||||
ClutterActorBox alloc;
|
ClutterActorBox alloc;
|
||||||
@ -325,7 +325,7 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
* support for TFP textures will result in fallbacks to XGetImage.
|
* support for TFP textures will result in fallbacks to XGetImage.
|
||||||
*/
|
*/
|
||||||
if (priv->create_mipmaps)
|
if (priv->create_mipmaps)
|
||||||
paint_tex = mutter_texture_tower_get_paint_texture (priv->paint_tower);
|
paint_tex = meta_texture_tower_get_paint_texture (priv->paint_tower);
|
||||||
else
|
else
|
||||||
paint_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex));
|
paint_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex));
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mutter_shaped_texture_ensure_mask (stex);
|
meta_shaped_texture_ensure_mask (stex);
|
||||||
|
|
||||||
if (priv->material == COGL_INVALID_HANDLE)
|
if (priv->material == COGL_INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
@ -434,15 +434,15 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_pick (ClutterActor *actor,
|
meta_shaped_texture_pick (ClutterActor *actor,
|
||||||
const ClutterColor *color)
|
const ClutterColor *color)
|
||||||
{
|
{
|
||||||
MutterShapedTexture *stex = (MutterShapedTexture *) actor;
|
MetaShapedTexture *stex = (MetaShapedTexture *) actor;
|
||||||
MutterShapedTexturePrivate *priv = stex->priv;
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
|
|
||||||
/* If there are no rectangles then use the regular pick */
|
/* If there are no rectangles then use the regular pick */
|
||||||
if (priv->rectangles->len < 1)
|
if (priv->rectangles->len < 1)
|
||||||
CLUTTER_ACTOR_CLASS (mutter_shaped_texture_parent_class)
|
CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class)
|
||||||
->pick (actor, color);
|
->pick (actor, color);
|
||||||
else if (clutter_actor_should_pick_paint (actor))
|
else if (clutter_actor_should_pick_paint (actor))
|
||||||
{
|
{
|
||||||
@ -461,7 +461,7 @@ mutter_shaped_texture_pick (ClutterActor *actor,
|
|||||||
if (tex_width == 0 || tex_height == 0) /* no contents yet */
|
if (tex_width == 0 || tex_height == 0) /* no contents yet */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutter_shaped_texture_ensure_mask (stex);
|
meta_shaped_texture_ensure_mask (stex);
|
||||||
|
|
||||||
cogl_set_source_color4ub (color->red, color->green, color->blue,
|
cogl_set_source_color4ub (color->red, color->green, color->blue,
|
||||||
color->alpha);
|
color->alpha);
|
||||||
@ -478,36 +478,36 @@ mutter_shaped_texture_pick (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_shaped_texture_update_area (ClutterX11TexturePixmap *texture,
|
meta_shaped_texture_update_area (ClutterX11TexturePixmap *texture,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
MutterShapedTexture *stex = (MutterShapedTexture *) texture;
|
MetaShapedTexture *stex = (MetaShapedTexture *) texture;
|
||||||
MutterShapedTexturePrivate *priv = stex->priv;
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
|
|
||||||
CLUTTER_X11_TEXTURE_PIXMAP_CLASS (mutter_shaped_texture_parent_class)->update_area (texture,
|
CLUTTER_X11_TEXTURE_PIXMAP_CLASS (meta_shaped_texture_parent_class)->update_area (texture,
|
||||||
x, y, width, height);
|
x, y, width, height);
|
||||||
|
|
||||||
mutter_texture_tower_update_area (priv->paint_tower, x, y, width, height);
|
meta_texture_tower_update_area (priv->paint_tower, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_shaped_texture_new (void)
|
meta_shaped_texture_new (void)
|
||||||
{
|
{
|
||||||
ClutterActor *self = g_object_new (MUTTER_TYPE_SHAPED_TEXTURE, NULL);
|
ClutterActor *self = g_object_new (META_TYPE_SHAPED_TEXTURE, NULL);
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_shaped_texture_set_create_mipmaps (MutterShapedTexture *stex,
|
meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
|
||||||
gboolean create_mipmaps)
|
gboolean create_mipmaps)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv;
|
MetaShapedTexturePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex));
|
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||||
|
|
||||||
priv = stex->priv;
|
priv = stex->priv;
|
||||||
|
|
||||||
@ -522,7 +522,7 @@ mutter_shaped_texture_set_create_mipmaps (MutterShapedTexture *stex,
|
|||||||
base_texture = create_mipmaps ?
|
base_texture = create_mipmaps ?
|
||||||
clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex)) : COGL_INVALID_HANDLE;
|
clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex)) : COGL_INVALID_HANDLE;
|
||||||
|
|
||||||
mutter_texture_tower_set_base_texture (priv->paint_tower, base_texture);
|
meta_texture_tower_set_base_texture (priv->paint_tower, base_texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,15 +543,15 @@ mutter_shaped_texture_set_create_mipmaps (MutterShapedTexture *stex,
|
|||||||
* that will be very easy to do.
|
* that will be very easy to do.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_shaped_texture_clear (MutterShapedTexture *stex)
|
meta_shaped_texture_clear (MetaShapedTexture *stex)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv;
|
MetaShapedTexturePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex));
|
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||||
|
|
||||||
priv = stex->priv;
|
priv = stex->priv;
|
||||||
|
|
||||||
mutter_texture_tower_set_base_texture (priv->paint_tower, COGL_INVALID_HANDLE);
|
meta_texture_tower_set_base_texture (priv->paint_tower, COGL_INVALID_HANDLE);
|
||||||
|
|
||||||
if (priv->material != COGL_INVALID_HANDLE)
|
if (priv->material != COGL_INVALID_HANDLE)
|
||||||
cogl_material_set_layer (priv->material, 0, COGL_INVALID_HANDLE);
|
cogl_material_set_layer (priv->material, 0, COGL_INVALID_HANDLE);
|
||||||
@ -561,47 +561,47 @@ mutter_shaped_texture_clear (MutterShapedTexture *stex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_shaped_texture_clear_rectangles (MutterShapedTexture *stex)
|
meta_shaped_texture_clear_rectangles (MetaShapedTexture *stex)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv;
|
MetaShapedTexturePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex));
|
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||||
|
|
||||||
priv = stex->priv;
|
priv = stex->priv;
|
||||||
|
|
||||||
g_array_set_size (priv->rectangles, 0);
|
g_array_set_size (priv->rectangles, 0);
|
||||||
mutter_shaped_texture_dirty_mask (stex);
|
meta_shaped_texture_dirty_mask (stex);
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_shaped_texture_add_rectangle (MutterShapedTexture *stex,
|
meta_shaped_texture_add_rectangle (MetaShapedTexture *stex,
|
||||||
const XRectangle *rect)
|
const XRectangle *rect)
|
||||||
{
|
{
|
||||||
g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex));
|
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||||
|
|
||||||
mutter_shaped_texture_add_rectangles (stex, 1, rect);
|
meta_shaped_texture_add_rectangles (stex, 1, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_shaped_texture_add_rectangles (MutterShapedTexture *stex,
|
meta_shaped_texture_add_rectangles (MetaShapedTexture *stex,
|
||||||
size_t num_rects,
|
size_t num_rects,
|
||||||
const XRectangle *rects)
|
const XRectangle *rects)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv;
|
MetaShapedTexturePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex));
|
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||||
|
|
||||||
priv = stex->priv;
|
priv = stex->priv;
|
||||||
|
|
||||||
g_array_append_vals (priv->rectangles, rects, num_rects);
|
g_array_append_vals (priv->rectangles, rects, num_rects);
|
||||||
|
|
||||||
mutter_shaped_texture_dirty_mask (stex);
|
meta_shaped_texture_dirty_mask (stex);
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_shaped_texture_set_clip_region:
|
* meta_shaped_texture_set_clip_region:
|
||||||
* @frame: a #TidyTextureframe
|
* @frame: a #TidyTextureframe
|
||||||
* @clip_region: (transfer full): the region of the texture that
|
* @clip_region: (transfer full): the region of the texture that
|
||||||
* is visible and should be painted. OWNERSHIP IS ASSUMED BY
|
* is visible and should be painted. OWNERSHIP IS ASSUMED BY
|
||||||
@ -616,12 +616,12 @@ mutter_shaped_texture_add_rectangles (MutterShapedTexture *stex,
|
|||||||
* painting its children, and then unset it afterwards.
|
* painting its children, and then unset it afterwards.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_shaped_texture_set_clip_region (MutterShapedTexture *stex,
|
meta_shaped_texture_set_clip_region (MetaShapedTexture *stex,
|
||||||
cairo_region_t *clip_region)
|
cairo_region_t *clip_region)
|
||||||
{
|
{
|
||||||
MutterShapedTexturePrivate *priv;
|
MetaShapedTexturePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex));
|
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||||
|
|
||||||
priv = stex->priv;
|
priv = stex->priv;
|
||||||
|
|
92
src/compositor/meta-shaped-texture.h
Normal file
92
src/compositor/meta-shaped-texture.h
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* shaped texture
|
||||||
|
*
|
||||||
|
* An actor to draw a texture clipped to a list of rectangles
|
||||||
|
*
|
||||||
|
* Authored By Neil Roberts <neil@linux.intel.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Intel Corporation
|
||||||
|
*
|
||||||
|
* 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_SHAPED_TEXTURE_H__
|
||||||
|
#define __META_SHAPED_TEXTURE_H__
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <clutter/clutter.h>
|
||||||
|
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
||||||
|
#include <clutter/glx/clutter-glx.h>
|
||||||
|
#endif /* HAVE_GLX_TEXTURE_PIXMAP */
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define META_TYPE_SHAPED_TEXTURE (meta_shaped_texture_get_type())
|
||||||
|
#define META_SHAPED_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),META_TYPE_SHAPED_TEXTURE, MetaShapedTexture))
|
||||||
|
#define META_SHAPED_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_SHAPED_TEXTURE, MetaShapedTextureClass))
|
||||||
|
#define META_IS_SHAPED_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SHAPED_TEXTURE))
|
||||||
|
#define META_IS_SHAPED_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_SHAPED_TEXTURE))
|
||||||
|
#define META_SHAPED_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_SHAPED_TEXTURE, MetaShapedTextureClass))
|
||||||
|
|
||||||
|
typedef struct _MetaShapedTexture MetaShapedTexture;
|
||||||
|
typedef struct _MetaShapedTextureClass MetaShapedTextureClass;
|
||||||
|
typedef struct _MetaShapedTexturePrivate MetaShapedTexturePrivate;
|
||||||
|
|
||||||
|
struct _MetaShapedTextureClass
|
||||||
|
{
|
||||||
|
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
||||||
|
ClutterGLXTexturePixmapClass parent_class;
|
||||||
|
#else
|
||||||
|
ClutterX11TexturePixmapClass parent_class;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MetaShapedTexture
|
||||||
|
{
|
||||||
|
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
||||||
|
ClutterGLXTexturePixmap parent;
|
||||||
|
#else
|
||||||
|
ClutterX11TexturePixmap parent;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MetaShapedTexturePrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType meta_shaped_texture_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
ClutterActor *meta_shaped_texture_new (void);
|
||||||
|
|
||||||
|
void meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
|
||||||
|
gboolean create_mipmaps);
|
||||||
|
|
||||||
|
void meta_shaped_texture_clear (MetaShapedTexture *stex);
|
||||||
|
|
||||||
|
void meta_shaped_texture_clear_rectangles (MetaShapedTexture *stex);
|
||||||
|
|
||||||
|
void meta_shaped_texture_add_rectangle (MetaShapedTexture *stex,
|
||||||
|
const XRectangle *rect);
|
||||||
|
void meta_shaped_texture_add_rectangles (MetaShapedTexture *stex,
|
||||||
|
size_t num_rects,
|
||||||
|
const XRectangle *rects);
|
||||||
|
|
||||||
|
/* Assumes ownership of clip_region */
|
||||||
|
void meta_shaped_texture_set_clip_region (MetaShapedTexture *stex,
|
||||||
|
cairo_region_t *clip_region);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __META_SHAPED_TEXTURE_H__ */
|
@ -1,6 +1,6 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
/*
|
/*
|
||||||
* MutterTextureTower
|
* MetaTextureTower
|
||||||
*
|
*
|
||||||
* Mipmap emulation by creation of scaled down images
|
* Mipmap emulation by creation of scaled down images
|
||||||
*
|
*
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "mutter-texture-tower.h"
|
#include "meta-texture-tower.h"
|
||||||
|
|
||||||
#ifndef M_LOG2E
|
#ifndef M_LOG2E
|
||||||
#define M_LOG2E 1.4426950408889634074
|
#define M_LOG2E 1.4426950408889634074
|
||||||
@ -55,7 +55,7 @@ typedef struct
|
|||||||
guint16 y2;
|
guint16 y2;
|
||||||
} Box;
|
} Box;
|
||||||
|
|
||||||
struct _MutterTextureTower
|
struct _MetaTextureTower
|
||||||
{
|
{
|
||||||
int n_levels;
|
int n_levels;
|
||||||
CoglHandle textures[MAX_TEXTURE_LEVELS];
|
CoglHandle textures[MAX_TEXTURE_LEVELS];
|
||||||
@ -64,37 +64,37 @@ struct _MutterTextureTower
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_texture_tower_new:
|
* meta_texture_tower_new:
|
||||||
*
|
*
|
||||||
* Creates a new texture tower. The base texture has to be set with
|
* Creates a new texture tower. The base texture has to be set with
|
||||||
* mutter_texture_tower_set_base_texture() before use.
|
* meta_texture_tower_set_base_texture() before use.
|
||||||
*
|
*
|
||||||
* Return value: the new texture tower. Free with mutter_texture_tower_free()
|
* Return value: the new texture tower. Free with meta_texture_tower_free()
|
||||||
*/
|
*/
|
||||||
MutterTextureTower *
|
MetaTextureTower *
|
||||||
mutter_texture_tower_new (void)
|
meta_texture_tower_new (void)
|
||||||
{
|
{
|
||||||
MutterTextureTower *tower;
|
MetaTextureTower *tower;
|
||||||
|
|
||||||
tower = g_slice_new0 (MutterTextureTower);
|
tower = g_slice_new0 (MetaTextureTower);
|
||||||
|
|
||||||
return tower;
|
return tower;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_texture_tower_free:
|
* meta_texture_tower_free:
|
||||||
* @tower: a #MutterTextureTower
|
* @tower: a #MetaTextureTower
|
||||||
*
|
*
|
||||||
* Frees a texture tower created with mutter_texture_tower_new().
|
* Frees a texture tower created with meta_texture_tower_new().
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_texture_tower_free (MutterTextureTower *tower)
|
meta_texture_tower_free (MetaTextureTower *tower)
|
||||||
{
|
{
|
||||||
g_return_if_fail (tower != NULL);
|
g_return_if_fail (tower != NULL);
|
||||||
|
|
||||||
mutter_texture_tower_set_base_texture (tower, COGL_INVALID_HANDLE);
|
meta_texture_tower_set_base_texture (tower, COGL_INVALID_HANDLE);
|
||||||
|
|
||||||
g_slice_free (MutterTextureTower, tower);
|
g_slice_free (MetaTextureTower, tower);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -122,8 +122,8 @@ free_texture (CoglHandle texture)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_texture_tower_update_area:
|
* meta_texture_tower_update_area:
|
||||||
* @tower: a MutterTextureTower
|
* @tower: a MetaTextureTower
|
||||||
* @texture: the new texture used as a base for scaled down versions
|
* @texture: the new texture used as a base for scaled down versions
|
||||||
*
|
*
|
||||||
* Sets the base texture that is the scaled texture that the
|
* Sets the base texture that is the scaled texture that the
|
||||||
@ -132,8 +132,8 @@ free_texture (CoglHandle texture)
|
|||||||
* unset or until the tower is freed.
|
* unset or until the tower is freed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_texture_tower_set_base_texture (MutterTextureTower *tower,
|
meta_texture_tower_set_base_texture (MetaTextureTower *tower,
|
||||||
CoglHandle texture)
|
CoglHandle texture)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ mutter_texture_tower_set_base_texture (MutterTextureTower *tower,
|
|||||||
tower->n_levels = 1 + MAX ((int)(M_LOG2E * log (width)), (int)(M_LOG2E * log (height)));
|
tower->n_levels = 1 + MAX ((int)(M_LOG2E * log (width)), (int)(M_LOG2E * log (height)));
|
||||||
tower->n_levels = MIN(tower->n_levels, MAX_TEXTURE_LEVELS);
|
tower->n_levels = MIN(tower->n_levels, MAX_TEXTURE_LEVELS);
|
||||||
|
|
||||||
mutter_texture_tower_update_area (tower, 0, 0, width, height);
|
meta_texture_tower_update_area (tower, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -185,8 +185,8 @@ mutter_texture_tower_set_base_texture (MutterTextureTower *tower,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_texture_tower_update_area:
|
* meta_texture_tower_update_area:
|
||||||
* @tower: a MutterTextureTower
|
* @tower: a MetaTextureTower
|
||||||
* @x: X coordinate of upper left of rectangle that changed
|
* @x: X coordinate of upper left of rectangle that changed
|
||||||
* @y: Y coordinate of upper left of rectangle that changed
|
* @y: Y coordinate of upper left of rectangle that changed
|
||||||
* @width: width of rectangle that changed
|
* @width: width of rectangle that changed
|
||||||
@ -197,11 +197,11 @@ mutter_texture_tower_set_base_texture (MutterTextureTower *tower,
|
|||||||
* the appropriate area of the scaled down texture will be updated.
|
* the appropriate area of the scaled down texture will be updated.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mutter_texture_tower_update_area (MutterTextureTower *tower,
|
meta_texture_tower_update_area (MetaTextureTower *tower,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
int texture_width, texture_height;
|
int texture_width, texture_height;
|
||||||
Box invalid;
|
Box invalid;
|
||||||
@ -257,7 +257,7 @@ mutter_texture_tower_update_area (MutterTextureTower *tower,
|
|||||||
* If window is being painted at an angle from the viewer, then we have to
|
* If window is being painted at an angle from the viewer, then we have to
|
||||||
* pick a point in the texture; we use the middle of the texture (which is
|
* pick a point in the texture; we use the middle of the texture (which is
|
||||||
* why the width/height are passed in.) This is not the normal case for
|
* why the width/height are passed in.) This is not the normal case for
|
||||||
* Mutter.
|
* Meta.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
get_paint_level (int width, int height)
|
get_paint_level (int width, int height)
|
||||||
@ -369,10 +369,10 @@ is_power_of_two (int x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
texture_tower_create_texture (MutterTextureTower *tower,
|
texture_tower_create_texture (MetaTextureTower *tower,
|
||||||
int level,
|
int level,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
|
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
|
||||||
texture_is_rectangle (tower->textures[level - 1]))
|
texture_is_rectangle (tower->textures[level - 1]))
|
||||||
@ -409,8 +409,8 @@ texture_tower_create_texture (MutterTextureTower *tower,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
texture_tower_revalidate_fbo (MutterTextureTower *tower,
|
texture_tower_revalidate_fbo (MetaTextureTower *tower,
|
||||||
int level)
|
int level)
|
||||||
{
|
{
|
||||||
CoglHandle source_texture = tower->textures[level - 1];
|
CoglHandle source_texture = tower->textures[level - 1];
|
||||||
int source_texture_width = cogl_texture_get_width (source_texture);
|
int source_texture_width = cogl_texture_get_width (source_texture);
|
||||||
@ -487,8 +487,8 @@ fill_scale_down (guchar *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
texture_tower_revalidate_client (MutterTextureTower *tower,
|
texture_tower_revalidate_client (MetaTextureTower *tower,
|
||||||
int level)
|
int level)
|
||||||
{
|
{
|
||||||
CoglHandle source_texture = tower->textures[level - 1];
|
CoglHandle source_texture = tower->textures[level - 1];
|
||||||
int source_texture_width = cogl_texture_get_width (source_texture);
|
int source_texture_width = cogl_texture_get_width (source_texture);
|
||||||
@ -587,16 +587,16 @@ texture_tower_revalidate_client (MutterTextureTower *tower,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
texture_tower_revalidate (MutterTextureTower *tower,
|
texture_tower_revalidate (MetaTextureTower *tower,
|
||||||
int level)
|
int level)
|
||||||
{
|
{
|
||||||
if (!texture_tower_revalidate_fbo (tower, level))
|
if (!texture_tower_revalidate_fbo (tower, level))
|
||||||
texture_tower_revalidate_client (tower, level);
|
texture_tower_revalidate_client (tower, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mutter_texture_tower_get_paint_texture:
|
* meta_texture_tower_get_paint_texture:
|
||||||
* @tower: a MutterTextureTower
|
* @tower: a MetaTextureTower
|
||||||
*
|
*
|
||||||
* Gets the texture from the tower that best matches the current
|
* Gets the texture from the tower that best matches the current
|
||||||
* rendering scale. (On the assumption here the texture is going to
|
* rendering scale. (On the assumption here the texture is going to
|
||||||
@ -608,7 +608,7 @@ texture_tower_revalidate (MutterTextureTower *tower,
|
|||||||
* %COGL_INVALID_HANDLE if no base texture has yet been set.
|
* %COGL_INVALID_HANDLE if no base texture has yet been set.
|
||||||
*/
|
*/
|
||||||
CoglHandle
|
CoglHandle
|
||||||
mutter_texture_tower_get_paint_texture (MutterTextureTower *tower)
|
meta_texture_tower_get_paint_texture (MetaTextureTower *tower)
|
||||||
{
|
{
|
||||||
int texture_width, texture_height;
|
int texture_width, texture_height;
|
||||||
int level;
|
int level;
|
@ -1,6 +1,6 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
/*
|
/*
|
||||||
* MutterTextureTower
|
* MetaTextureTower
|
||||||
*
|
*
|
||||||
* Mipmap emulation by creation of scaled down images
|
* Mipmap emulation by creation of scaled down images
|
||||||
*
|
*
|
||||||
@ -22,18 +22,18 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __MUTTER_TEXTURE_TOWER_H__
|
#ifndef __META_TEXTURE_TOWER_H__
|
||||||
#define __MUTTER_TEXTURE_TOWER_H__
|
#define __META_TEXTURE_TOWER_H__
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:MutterTextureTower
|
* SECTION:MetaTextureTower
|
||||||
* @short_description: mipmap emulation by creation of scaled down images
|
* @short_description: mipmap emulation by creation of scaled down images
|
||||||
*
|
*
|
||||||
* A #MutterTextureTower is used to get good looking scaled down images when
|
* A #MetaTextureTower is used to get good looking scaled down images when
|
||||||
* we can't use the GL drivers mipmap support. There are two separate reasons
|
* we can't use the GL drivers mipmap support. There are two separate reasons
|
||||||
*
|
*
|
||||||
* - Some cards (including radeon cards <= r5xx) only support
|
* - Some cards (including radeon cards <= r5xx) only support
|
||||||
@ -51,19 +51,19 @@ G_BEGIN_DECLS
|
|||||||
* scale for the entire texture.)
|
* scale for the entire texture.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _MutterTextureTower MutterTextureTower;
|
typedef struct _MetaTextureTower MetaTextureTower;
|
||||||
|
|
||||||
MutterTextureTower *mutter_texture_tower_new (void);
|
MetaTextureTower *meta_texture_tower_new (void);
|
||||||
void mutter_texture_tower_free (MutterTextureTower *tower);
|
void meta_texture_tower_free (MetaTextureTower *tower);
|
||||||
void mutter_texture_tower_set_base_texture (MutterTextureTower *tower,
|
void meta_texture_tower_set_base_texture (MetaTextureTower *tower,
|
||||||
CoglHandle texture);
|
CoglHandle texture);
|
||||||
void mutter_texture_tower_update_area (MutterTextureTower *tower,
|
void meta_texture_tower_update_area (MetaTextureTower *tower,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height);
|
int height);
|
||||||
CoglHandle mutter_texture_tower_get_paint_texture (MutterTextureTower *tower);
|
CoglHandle meta_texture_tower_get_paint_texture (MetaTextureTower *tower);
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#endif /* __MUTTER_TEXTURE_TOWER_H__ */
|
#endif /* __META_TEXTURE_TOWER_H__ */
|
51
src/compositor/meta-window-actor-private.h
Normal file
51
src/compositor/meta-window-actor-private.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
#ifndef META_WINDOW_ACTOR_PRIVATE_H
|
||||||
|
#define META_WINDOW_ACTOR_PRIVATE_H
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <X11/extensions/Xdamage.h>
|
||||||
|
#include "compositor-mutter.h"
|
||||||
|
|
||||||
|
MetaWindowActor *meta_window_actor_new (MetaWindow *window);
|
||||||
|
|
||||||
|
void meta_window_actor_destroy (MetaWindowActor *self);
|
||||||
|
|
||||||
|
void meta_window_actor_show (MetaWindowActor *self,
|
||||||
|
MetaCompEffect effect);
|
||||||
|
void meta_window_actor_hide (MetaWindowActor *self,
|
||||||
|
MetaCompEffect effect);
|
||||||
|
|
||||||
|
void meta_window_actor_maximize (MetaWindowActor *self,
|
||||||
|
MetaRectangle *old_rect,
|
||||||
|
MetaRectangle *new_rect);
|
||||||
|
void meta_window_actor_unmaximize (MetaWindowActor *self,
|
||||||
|
MetaRectangle *old_rect,
|
||||||
|
MetaRectangle *new_rect);
|
||||||
|
|
||||||
|
void meta_window_actor_process_damage (MetaWindowActor *self,
|
||||||
|
XDamageNotifyEvent *event);
|
||||||
|
void meta_window_actor_pre_paint (MetaWindowActor *self);
|
||||||
|
|
||||||
|
gboolean meta_window_actor_effect_in_progress (MetaWindowActor *self);
|
||||||
|
void meta_window_actor_sync_actor_position (MetaWindowActor *self);
|
||||||
|
void meta_window_actor_sync_visibility (MetaWindowActor *self);
|
||||||
|
void meta_window_actor_update_shape (MetaWindowActor *self,
|
||||||
|
gboolean shaped);
|
||||||
|
void meta_window_actor_update_opacity (MetaWindowActor *self);
|
||||||
|
void meta_window_actor_mapped (MetaWindowActor *self);
|
||||||
|
void meta_window_actor_unmapped (MetaWindowActor *self);
|
||||||
|
|
||||||
|
cairo_region_t *meta_window_actor_get_obscured_region (MetaWindowActor *self);
|
||||||
|
|
||||||
|
void meta_window_actor_set_visible_region (MetaWindowActor *self,
|
||||||
|
cairo_region_t *visible_region);
|
||||||
|
void meta_window_actor_set_visible_region_beneath (MetaWindowActor *self,
|
||||||
|
cairo_region_t *beneath_region);
|
||||||
|
void meta_window_actor_reset_visible_regions (MetaWindowActor *self);
|
||||||
|
|
||||||
|
void meta_window_actor_effect_completed (MetaWindowActor *actor,
|
||||||
|
gulong event);
|
||||||
|
|
||||||
|
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
|
File diff suppressed because it is too large
Load Diff
@ -5,22 +5,22 @@
|
|||||||
#define _ISOC99_SOURCE /* for roundf */
|
#define _ISOC99_SOURCE /* for roundf */
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "mutter-window-private.h"
|
#include "meta-window-actor-private.h"
|
||||||
#include "mutter-window-group.h"
|
#include "meta-window-group.h"
|
||||||
|
|
||||||
struct _MutterWindowGroupClass
|
struct _MetaWindowGroupClass
|
||||||
{
|
{
|
||||||
ClutterGroupClass parent_class;
|
ClutterGroupClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterWindowGroup
|
struct _MetaWindowGroup
|
||||||
{
|
{
|
||||||
ClutterGroup parent;
|
ClutterGroup parent;
|
||||||
|
|
||||||
MetaScreen *screen;
|
MetaScreen *screen;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (MutterWindowGroup, mutter_window_group, CLUTTER_TYPE_GROUP);
|
G_DEFINE_TYPE (MetaWindowGroup, meta_window_group, CLUTTER_TYPE_GROUP);
|
||||||
|
|
||||||
/* We want to find out if the window is "close enough" to
|
/* We want to find out if the window is "close enough" to
|
||||||
* 1:1 transform. We do that by converting the transformed coordinates
|
* 1:1 transform. We do that by converting the transformed coordinates
|
||||||
@ -98,9 +98,9 @@ actor_is_untransformed (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_window_group_paint (ClutterActor *actor)
|
meta_window_group_paint (ClutterActor *actor)
|
||||||
{
|
{
|
||||||
MutterWindowGroup *window_group = MUTTER_WINDOW_GROUP (actor);
|
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
|
||||||
cairo_region_t *visible_region;
|
cairo_region_t *visible_region;
|
||||||
cairo_rectangle_int_t screen_rect = { 0 };
|
cairo_rectangle_int_t screen_rect = { 0 };
|
||||||
GList *children, *l;
|
GList *children, *l;
|
||||||
@ -122,73 +122,73 @@ mutter_window_group_paint (ClutterActor *actor)
|
|||||||
|
|
||||||
for (l = children; l; l = l->next)
|
for (l = children; l; l = l->next)
|
||||||
{
|
{
|
||||||
MutterWindow *cw;
|
MetaWindowActor *window_actor;
|
||||||
gboolean x, y;
|
gboolean x, y;
|
||||||
|
|
||||||
if (!MUTTER_IS_WINDOW (l->data) || !CLUTTER_ACTOR_IS_VISIBLE (l->data))
|
if (!META_IS_WINDOW_ACTOR (l->data) || !CLUTTER_ACTOR_IS_VISIBLE (l->data))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cw = l->data;
|
window_actor = l->data;
|
||||||
|
|
||||||
if (!actor_is_untransformed (CLUTTER_ACTOR (cw), &x, &y))
|
if (!actor_is_untransformed (CLUTTER_ACTOR (window_actor), &x, &y))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Temporarily move to the coordinate system of the actor */
|
/* Temporarily move to the coordinate system of the actor */
|
||||||
cairo_region_translate (visible_region, - x, - y);
|
cairo_region_translate (visible_region, - x, - y);
|
||||||
|
|
||||||
mutter_window_set_visible_region (cw, visible_region);
|
meta_window_actor_set_visible_region (window_actor, visible_region);
|
||||||
|
|
||||||
if (clutter_actor_get_paint_opacity (CLUTTER_ACTOR (cw)) == 0xff)
|
if (clutter_actor_get_paint_opacity (CLUTTER_ACTOR (window_actor)) == 0xff)
|
||||||
{
|
{
|
||||||
cairo_region_t *obscured_region = mutter_window_get_obscured_region (cw);
|
cairo_region_t *obscured_region = meta_window_actor_get_obscured_region (window_actor);
|
||||||
if (obscured_region)
|
if (obscured_region)
|
||||||
cairo_region_subtract (visible_region, obscured_region);
|
cairo_region_subtract (visible_region, obscured_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutter_window_set_visible_region_beneath (cw, visible_region);
|
meta_window_actor_set_visible_region_beneath (window_actor, visible_region);
|
||||||
cairo_region_translate (visible_region, x, y);
|
cairo_region_translate (visible_region, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_region_destroy (visible_region);
|
cairo_region_destroy (visible_region);
|
||||||
|
|
||||||
CLUTTER_ACTOR_CLASS (mutter_window_group_parent_class)->paint (actor);
|
CLUTTER_ACTOR_CLASS (meta_window_group_parent_class)->paint (actor);
|
||||||
|
|
||||||
/* Now that we are done painting, unset the visible regions (they will
|
/* Now that we are done painting, unset the visible regions (they will
|
||||||
* mess up painting clones of our actors)
|
* mess up painting clones of our actors)
|
||||||
*/
|
*/
|
||||||
for (l = children; l; l = l->next)
|
for (l = children; l; l = l->next)
|
||||||
{
|
{
|
||||||
MutterWindow *cw;
|
MetaWindowActor *window_actor;
|
||||||
|
|
||||||
if (!MUTTER_IS_WINDOW (l->data))
|
if (!META_IS_WINDOW_ACTOR (l->data))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cw = l->data;
|
window_actor = l->data;
|
||||||
mutter_window_reset_visible_regions (cw);
|
meta_window_actor_reset_visible_regions (window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (children);
|
g_list_free (children);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_window_group_class_init (MutterWindowGroupClass *klass)
|
meta_window_group_class_init (MetaWindowGroupClass *klass)
|
||||||
{
|
{
|
||||||
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
||||||
|
|
||||||
actor_class->paint = mutter_window_group_paint;
|
actor_class->paint = meta_window_group_paint;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_window_group_init (MutterWindowGroup *window_group)
|
meta_window_group_init (MetaWindowGroup *window_group)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_window_group_new (MetaScreen *screen)
|
meta_window_group_new (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MutterWindowGroup *window_group;
|
MetaWindowGroup *window_group;
|
||||||
|
|
||||||
window_group = g_object_new (MUTTER_TYPE_WINDOW_GROUP, NULL);
|
window_group = g_object_new (META_TYPE_WINDOW_GROUP, NULL);
|
||||||
|
|
||||||
window_group->screen = screen;
|
window_group->screen = screen;
|
||||||
|
|
@ -1,17 +1,17 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
#ifndef MUTTER_WINDOW_GROUP_H
|
#ifndef META_WINDOW_GROUP_H
|
||||||
#define MUTTER_WINDOW_GROUP_H
|
#define META_WINDOW_GROUP_H
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MutterWindowGroup:
|
* MetaWindowGroup:
|
||||||
*
|
*
|
||||||
* This class is a subclass of ClutterGroup with special handling for
|
* This class is a subclass of ClutterGroup with special handling for
|
||||||
* MutterWindow when painting the group. When we are painting a stack
|
* MetaWindowActor when painting the group. When we are painting a stack
|
||||||
* of 5-10 maximized windows, the standard bottom-to-top method of
|
* of 5-10 maximized windows, the standard bottom-to-top method of
|
||||||
* drawing every actor results in a tremendous amount of overdraw
|
* drawing every actor results in a tremendous amount of overdraw
|
||||||
* and can easily max out the available memory bandwidth on a low-end
|
* and can easily max out the available memory bandwidth on a low-end
|
||||||
@ -21,7 +21,7 @@
|
|||||||
* The basic technique applied here is to do a pre-pass before painting
|
* The basic technique applied here is to do a pre-pass before painting
|
||||||
* where we walk window from top to bottom and compute the visible area
|
* where we walk window from top to bottom and compute the visible area
|
||||||
* at each step by subtracting out the windows above it. The visible
|
* at each step by subtracting out the windows above it. The visible
|
||||||
* area is passed to MutterWindow which uses it to clip the portion of
|
* area is passed to MetaWindowActor which uses it to clip the portion of
|
||||||
* the window which drawn and avoid redrawing the shadow if it is completely
|
* the window which drawn and avoid redrawing the shadow if it is completely
|
||||||
* obscured.
|
* obscured.
|
||||||
*
|
*
|
||||||
@ -34,19 +34,19 @@
|
|||||||
* we have lots of memory and bandwidth.)
|
* we have lots of memory and bandwidth.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MUTTER_TYPE_WINDOW_GROUP (mutter_window_group_get_type ())
|
#define META_TYPE_WINDOW_GROUP (meta_window_group_get_type ())
|
||||||
#define MUTTER_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_WINDOW_GROUP, MutterWindowGroup))
|
#define META_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroup))
|
||||||
#define MUTTER_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_WINDOW_GROUP, MutterWindowGroupClass))
|
#define META_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass))
|
||||||
#define MUTTER_IS_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_TYPE_WINDOW_GROUP))
|
#define META_IS_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW_GROUP))
|
||||||
#define MUTTER_IS_WINDOW_GROU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_WINDOW_GROUP))
|
#define META_IS_WINDOW_GROU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_WINDOW_GROUP))
|
||||||
#define MUTTER_WINDOW_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_WINDOW_GROUP, MutterWindowGroupClass))
|
#define META_WINDOW_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass))
|
||||||
|
|
||||||
typedef struct _MutterWindowGroup MutterWindowGroup;
|
typedef struct _MetaWindowGroup MetaWindowGroup;
|
||||||
typedef struct _MutterWindowGroupClass MutterWindowGroupClass;
|
typedef struct _MetaWindowGroupClass MetaWindowGroupClass;
|
||||||
typedef struct _MutterWindowGroupPrivate MutterWindowGroupPrivate;
|
typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate;
|
||||||
|
|
||||||
GType mutter_window_group_get_type (void);
|
GType meta_window_group_get_type (void);
|
||||||
|
|
||||||
ClutterActor *mutter_window_group_new (MetaScreen *screen);
|
ClutterActor *meta_window_group_new (MetaScreen *screen);
|
||||||
|
|
||||||
#endif /* MUTTER_WINDOW_GROUP_H */
|
#endif /* META_WINDOW_GROUP_H */
|
@ -1,77 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2008 Intel Corp.
|
|
||||||
*
|
|
||||||
* Author: Tomas Frydrych <tf@linux.intel.com>
|
|
||||||
*
|
|
||||||
* 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 MUTTER_PLUGIN_MANAGER_H_
|
|
||||||
#define MUTTER_PLUGIN_MANAGER_H_
|
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "screen.h"
|
|
||||||
|
|
||||||
#define MUTTER_PLUGIN_FROM_MANAGER_
|
|
||||||
#include "mutter-plugin.h"
|
|
||||||
#undef MUTTER_PLUGIN_FROM_MANAGER_
|
|
||||||
|
|
||||||
#define MUTTER_PLUGIN_MINIMIZE (1<<0)
|
|
||||||
#define MUTTER_PLUGIN_MAXIMIZE (1<<1)
|
|
||||||
#define MUTTER_PLUGIN_UNMAXIMIZE (1<<2)
|
|
||||||
#define MUTTER_PLUGIN_MAP (1<<3)
|
|
||||||
#define MUTTER_PLUGIN_DESTROY (1<<4)
|
|
||||||
#define MUTTER_PLUGIN_SWITCH_WORKSPACE (1<<5)
|
|
||||||
|
|
||||||
#define MUTTER_PLUGIN_ALL_EFFECTS (~0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MutterPluginManager: (skip)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef struct MutterPluginManager MutterPluginManager;
|
|
||||||
|
|
||||||
MutterPluginManager * mutter_plugin_manager_get (MetaScreen *screen);
|
|
||||||
MutterPluginManager * mutter_plugin_manager_get_default (void);
|
|
||||||
|
|
||||||
gboolean mutter_plugin_manager_load (MutterPluginManager *mgr);
|
|
||||||
gboolean mutter_plugin_manager_initialize (MutterPluginManager *plugin_mgr);
|
|
||||||
gboolean mutter_plugin_manager_event_simple (MutterPluginManager *mgr,
|
|
||||||
MutterWindow *actor,
|
|
||||||
unsigned long event);
|
|
||||||
|
|
||||||
gboolean mutter_plugin_manager_event_maximize (MutterPluginManager *mgr,
|
|
||||||
MutterWindow *actor,
|
|
||||||
unsigned long event,
|
|
||||||
gint target_x,
|
|
||||||
gint target_y,
|
|
||||||
gint target_width,
|
|
||||||
gint target_height);
|
|
||||||
void mutter_plugin_manager_update_workspaces (MutterPluginManager *mgr);
|
|
||||||
|
|
||||||
void mutter_plugin_manager_update_workspace (MutterPluginManager *mgr, MetaWorkspace *w);
|
|
||||||
|
|
||||||
gboolean mutter_plugin_manager_switch_workspace (MutterPluginManager *mgr,
|
|
||||||
gint from,
|
|
||||||
gint to,
|
|
||||||
MetaMotionDirection direction);
|
|
||||||
|
|
||||||
gboolean mutter_plugin_manager_xevent_filter (MutterPluginManager *mgr,
|
|
||||||
XEvent *xev);
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,106 +0,0 @@
|
|||||||
/*
|
|
||||||
* shaped texture
|
|
||||||
*
|
|
||||||
* An actor to draw a texture clipped to a list of rectangles
|
|
||||||
*
|
|
||||||
* Authored By Neil Roberts <neil@linux.intel.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008 Intel Corporation
|
|
||||||
*
|
|
||||||
* 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 __MUTTER_SHAPED_TEXTURE_H__
|
|
||||||
#define __MUTTER_SHAPED_TEXTURE_H__
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
|
||||||
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
|
||||||
#include <clutter/glx/clutter-glx.h>
|
|
||||||
#endif /* HAVE_GLX_TEXTURE_PIXMAP */
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define MUTTER_TYPE_SHAPED_TEXTURE \
|
|
||||||
(mutter_shaped_texture_get_type())
|
|
||||||
#define MUTTER_SHAPED_TEXTURE(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
||||||
MUTTER_TYPE_SHAPED_TEXTURE, \
|
|
||||||
MutterShapedTexture))
|
|
||||||
#define MUTTER_SHAPED_TEXTURE_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
||||||
MUTTER_TYPE_SHAPED_TEXTURE, \
|
|
||||||
MutterShapedTextureClass))
|
|
||||||
#define MUTTER_IS_SHAPED_TEXTURE(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
||||||
MUTTER_TYPE_SHAPED_TEXTURE))
|
|
||||||
#define MUTTER_IS_SHAPED_TEXTURE_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
||||||
MUTTER_TYPE_SHAPED_TEXTURE))
|
|
||||||
#define MUTTER_SHAPED_TEXTURE_GET_CLASS(obj) \
|
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
||||||
MUTTER_TYPE_SHAPED_TEXTURE, \
|
|
||||||
MutterShapedTextureClass))
|
|
||||||
|
|
||||||
typedef struct _MutterShapedTexture MutterShapedTexture;
|
|
||||||
typedef struct _MutterShapedTextureClass MutterShapedTextureClass;
|
|
||||||
typedef struct _MutterShapedTexturePrivate MutterShapedTexturePrivate;
|
|
||||||
|
|
||||||
struct _MutterShapedTextureClass
|
|
||||||
{
|
|
||||||
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
|
||||||
ClutterGLXTexturePixmapClass parent_class;
|
|
||||||
#else
|
|
||||||
ClutterX11TexturePixmapClass parent_class;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MutterShapedTexture
|
|
||||||
{
|
|
||||||
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
|
||||||
ClutterGLXTexturePixmap parent;
|
|
||||||
#else
|
|
||||||
ClutterX11TexturePixmap parent;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MutterShapedTexturePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
GType mutter_shaped_texture_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
ClutterActor *mutter_shaped_texture_new (void);
|
|
||||||
|
|
||||||
void mutter_shaped_texture_set_create_mipmaps (MutterShapedTexture *stex,
|
|
||||||
gboolean create_mipmaps);
|
|
||||||
|
|
||||||
void mutter_shaped_texture_clear (MutterShapedTexture *stex);
|
|
||||||
|
|
||||||
void mutter_shaped_texture_clear_rectangles (MutterShapedTexture *stex);
|
|
||||||
|
|
||||||
void mutter_shaped_texture_add_rectangle (MutterShapedTexture *stex,
|
|
||||||
const XRectangle *rect);
|
|
||||||
void mutter_shaped_texture_add_rectangles (MutterShapedTexture *stex,
|
|
||||||
size_t num_rects,
|
|
||||||
const XRectangle *rects);
|
|
||||||
|
|
||||||
/* Assumes ownership of clip_region */
|
|
||||||
void mutter_shaped_texture_set_clip_region (MutterShapedTexture *stex,
|
|
||||||
cairo_region_t *clip_region);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __MUTTER_SHAPED_TEXTURE_H__ */
|
|
@ -1,51 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
#ifndef MUTTER_WINDOW_PRIVATE_H
|
|
||||||
#define MUTTER_WINDOW_PRIVATE_H
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include <X11/extensions/Xdamage.h>
|
|
||||||
#include "compositor-mutter.h"
|
|
||||||
|
|
||||||
MutterWindow *mutter_window_new (MetaWindow *window);
|
|
||||||
|
|
||||||
void mutter_window_destroy (MutterWindow *cw);
|
|
||||||
|
|
||||||
void mutter_window_show (MutterWindow *cw,
|
|
||||||
MetaCompEffect effect);
|
|
||||||
void mutter_window_hide (MutterWindow *cw,
|
|
||||||
MetaCompEffect effect);
|
|
||||||
|
|
||||||
void mutter_window_maximize (MutterWindow *cw,
|
|
||||||
MetaRectangle *old_rect,
|
|
||||||
MetaRectangle *new_rect);
|
|
||||||
void mutter_window_unmaximize (MutterWindow *cw,
|
|
||||||
MetaRectangle *old_rect,
|
|
||||||
MetaRectangle *new_rect);
|
|
||||||
|
|
||||||
void mutter_window_process_damage (MutterWindow *cw,
|
|
||||||
XDamageNotifyEvent *event);
|
|
||||||
void mutter_window_pre_paint (MutterWindow *self);
|
|
||||||
|
|
||||||
gboolean mutter_window_effect_in_progress (MutterWindow *cw);
|
|
||||||
void mutter_window_sync_actor_position (MutterWindow *cw);
|
|
||||||
void mutter_window_sync_visibility (MutterWindow *cw);
|
|
||||||
void mutter_window_update_shape (MutterWindow *cw,
|
|
||||||
gboolean shaped);
|
|
||||||
void mutter_window_update_opacity (MutterWindow *cw);
|
|
||||||
void mutter_window_mapped (MutterWindow *cw);
|
|
||||||
void mutter_window_unmapped (MutterWindow *cw);
|
|
||||||
|
|
||||||
cairo_region_t *mutter_window_get_obscured_region (MutterWindow *cw);
|
|
||||||
|
|
||||||
void mutter_window_set_visible_region (MutterWindow *cw,
|
|
||||||
cairo_region_t *visible_region);
|
|
||||||
void mutter_window_set_visible_region_beneath (MutterWindow *cw,
|
|
||||||
cairo_region_t *beneath_region);
|
|
||||||
void mutter_window_reset_visible_regions (MutterWindow *cw);
|
|
||||||
|
|
||||||
void mutter_window_effect_completed (MutterWindow *actor,
|
|
||||||
gulong event);
|
|
||||||
|
|
||||||
#endif /* MUTTER_WINDOW_PRIVATE_H */
|
|
@ -21,7 +21,7 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mutter-plugin.h"
|
#include "meta-plugin.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
@ -40,63 +40,70 @@
|
|||||||
|
|
||||||
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
|
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
|
||||||
|
|
||||||
#define MUTTER_TYPE_DEFAULT_PLUGIN (mutter_default_plugin_get_type ())
|
#define META_TYPE_DEFAULT_PLUGIN (meta_default_plugin_get_type ())
|
||||||
#define MUTTER_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPlugin))
|
#define META_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPlugin))
|
||||||
#define MUTTER_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPluginClass))
|
#define META_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginClass))
|
||||||
#define MUTTER_IS_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_DEFAULT_PLUGIN_TYPE))
|
#define META_IS_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_DEFAULT_PLUGIN_TYPE))
|
||||||
#define MUTTER_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_DEFAULT_PLUGIN))
|
#define META_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_DEFAULT_PLUGIN))
|
||||||
#define MUTTER_DEFAULT_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPluginClass))
|
#define META_DEFAULT_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginClass))
|
||||||
|
|
||||||
#define MUTTER_DEFAULT_PLUGIN_GET_PRIVATE(obj) \
|
#define META_DEFAULT_PLUGIN_GET_PRIVATE(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPluginPrivate))
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginPrivate))
|
||||||
|
|
||||||
typedef struct _MutterDefaultPlugin MutterDefaultPlugin;
|
typedef struct _MetaDefaultPlugin MetaDefaultPlugin;
|
||||||
typedef struct _MutterDefaultPluginClass MutterDefaultPluginClass;
|
typedef struct _MetaDefaultPluginClass MetaDefaultPluginClass;
|
||||||
typedef struct _MutterDefaultPluginPrivate MutterDefaultPluginPrivate;
|
typedef struct _MetaDefaultPluginPrivate MetaDefaultPluginPrivate;
|
||||||
|
|
||||||
struct _MutterDefaultPlugin
|
struct _MetaDefaultPlugin
|
||||||
{
|
{
|
||||||
MutterPlugin parent;
|
MetaPlugin parent;
|
||||||
|
|
||||||
MutterDefaultPluginPrivate *priv;
|
MetaDefaultPluginPrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterDefaultPluginClass
|
struct _MetaDefaultPluginClass
|
||||||
{
|
{
|
||||||
MutterPluginClass parent_class;
|
MetaPluginClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
static GQuark actor_data_quark = 0;
|
static GQuark actor_data_quark = 0;
|
||||||
|
|
||||||
static void minimize (MutterPlugin *plugin,
|
static void minimize (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
static void map (MutterPlugin *plugin,
|
static void map (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
static void destroy (MutterPlugin *plugin,
|
static void destroy (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
static void maximize (MutterPlugin *plugin,
|
static void maximize (MetaPlugin *plugin,
|
||||||
MutterWindow *actor,
|
MetaWindowActor *actor,
|
||||||
gint x, gint y, gint width, gint height);
|
gint x,
|
||||||
static void unmaximize (MutterPlugin *plugin,
|
gint y,
|
||||||
MutterWindow *actor,
|
gint width,
|
||||||
gint x, gint y, gint width, gint height);
|
gint height);
|
||||||
|
static void unmaximize (MetaPlugin *plugin,
|
||||||
|
MetaWindowActor *actor,
|
||||||
|
gint x,
|
||||||
|
gint y,
|
||||||
|
gint width,
|
||||||
|
gint height);
|
||||||
|
|
||||||
static void switch_workspace (MutterPlugin *plugin,
|
static void switch_workspace (MetaPlugin *plugin,
|
||||||
gint from, gint to,
|
gint from,
|
||||||
MetaMotionDirection direction);
|
gint to,
|
||||||
|
MetaMotionDirection direction);
|
||||||
|
|
||||||
static void kill_window_effects (MutterPlugin *plugin,
|
static void kill_window_effects (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
static void kill_switch_workspace (MutterPlugin *plugin);
|
static void kill_switch_workspace (MetaPlugin *plugin);
|
||||||
|
|
||||||
static const MutterPluginInfo * plugin_info (MutterPlugin *plugin);
|
static const MetaPluginInfo * plugin_info (MetaPlugin *plugin);
|
||||||
|
|
||||||
MUTTER_PLUGIN_DECLARE(MutterDefaultPlugin, mutter_default_plugin);
|
META_PLUGIN_DECLARE(MetaDefaultPlugin, meta_default_plugin);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Plugin private data that we store in the .plugin_private member.
|
* Plugin private data that we store in the .plugin_private member.
|
||||||
*/
|
*/
|
||||||
struct _MutterDefaultPluginPrivate
|
struct _MetaDefaultPluginPrivate
|
||||||
{
|
{
|
||||||
/* Valid only when switch_workspace effect is in progress */
|
/* Valid only when switch_workspace effect is in progress */
|
||||||
ClutterTimeline *tml_switch_workspace1;
|
ClutterTimeline *tml_switch_workspace1;
|
||||||
@ -104,7 +111,7 @@ struct _MutterDefaultPluginPrivate
|
|||||||
ClutterActor *desktop1;
|
ClutterActor *desktop1;
|
||||||
ClutterActor *desktop2;
|
ClutterActor *desktop2;
|
||||||
|
|
||||||
MutterPluginInfo info;
|
MetaPluginInfo info;
|
||||||
|
|
||||||
gboolean debug_mode : 1;
|
gboolean debug_mode : 1;
|
||||||
};
|
};
|
||||||
@ -129,26 +136,26 @@ typedef struct _ActorPrivate
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
MutterPlugin *plugin;
|
MetaPlugin *plugin;
|
||||||
} EffectCompleteData;
|
} EffectCompleteData;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_default_plugin_dispose (GObject *object)
|
meta_default_plugin_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
/* MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (object)->priv;
|
/* MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (object)->priv;
|
||||||
*/
|
*/
|
||||||
G_OBJECT_CLASS (mutter_default_plugin_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_default_plugin_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_default_plugin_finalize (GObject *object)
|
meta_default_plugin_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
G_OBJECT_CLASS (mutter_default_plugin_parent_class)->finalize (object);
|
G_OBJECT_CLASS (meta_default_plugin_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_default_plugin_set_property (GObject *object,
|
meta_default_plugin_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
@ -162,7 +169,7 @@ mutter_default_plugin_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_default_plugin_get_property (GObject *object,
|
meta_default_plugin_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
@ -176,9 +183,9 @@ mutter_default_plugin_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
start (MutterPlugin *plugin)
|
start (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
guint destroy_timeout = DESTROY_TIMEOUT;
|
guint destroy_timeout = DESTROY_TIMEOUT;
|
||||||
guint minimize_timeout = MINIMIZE_TIMEOUT;
|
guint minimize_timeout = MINIMIZE_TIMEOUT;
|
||||||
@ -186,7 +193,7 @@ start (MutterPlugin *plugin)
|
|||||||
guint map_timeout = MAP_TIMEOUT;
|
guint map_timeout = MAP_TIMEOUT;
|
||||||
guint switch_timeout = SWITCH_TIMEOUT;
|
guint switch_timeout = SWITCH_TIMEOUT;
|
||||||
|
|
||||||
if (mutter_plugin_debug_mode (plugin))
|
if (meta_plugin_debug_mode (plugin))
|
||||||
{
|
{
|
||||||
g_debug ("Plugin %s: Entering debug mode.", priv->info.name);
|
g_debug ("Plugin %s: Entering debug mode.", priv->info.name);
|
||||||
|
|
||||||
@ -204,15 +211,15 @@ start (MutterPlugin *plugin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_default_plugin_class_init (MutterDefaultPluginClass *klass)
|
meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
MutterPluginClass *plugin_class = MUTTER_PLUGIN_CLASS (klass);
|
MetaPluginClass *plugin_class = META_PLUGIN_CLASS (klass);
|
||||||
|
|
||||||
gobject_class->finalize = mutter_default_plugin_finalize;
|
gobject_class->finalize = meta_default_plugin_finalize;
|
||||||
gobject_class->dispose = mutter_default_plugin_dispose;
|
gobject_class->dispose = meta_default_plugin_dispose;
|
||||||
gobject_class->set_property = mutter_default_plugin_set_property;
|
gobject_class->set_property = meta_default_plugin_set_property;
|
||||||
gobject_class->get_property = mutter_default_plugin_get_property;
|
gobject_class->get_property = meta_default_plugin_get_property;
|
||||||
|
|
||||||
plugin_class->start = start;
|
plugin_class->start = start;
|
||||||
plugin_class->map = map;
|
plugin_class->map = map;
|
||||||
@ -225,15 +232,15 @@ mutter_default_plugin_class_init (MutterDefaultPluginClass *klass)
|
|||||||
plugin_class->kill_window_effects = kill_window_effects;
|
plugin_class->kill_window_effects = kill_window_effects;
|
||||||
plugin_class->kill_switch_workspace = kill_switch_workspace;
|
plugin_class->kill_switch_workspace = kill_switch_workspace;
|
||||||
|
|
||||||
g_type_class_add_private (gobject_class, sizeof (MutterDefaultPluginPrivate));
|
g_type_class_add_private (gobject_class, sizeof (MetaDefaultPluginPrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_default_plugin_init (MutterDefaultPlugin *self)
|
meta_default_plugin_init (MetaDefaultPlugin *self)
|
||||||
{
|
{
|
||||||
MutterDefaultPluginPrivate *priv;
|
MetaDefaultPluginPrivate *priv;
|
||||||
|
|
||||||
self->priv = priv = MUTTER_DEFAULT_PLUGIN_GET_PRIVATE (self);
|
self->priv = priv = META_DEFAULT_PLUGIN_GET_PRIVATE (self);
|
||||||
|
|
||||||
priv->info.name = "Default Effects";
|
priv->info.name = "Default Effects";
|
||||||
priv->info.version = "0.1";
|
priv->info.version = "0.1";
|
||||||
@ -253,7 +260,7 @@ free_actor_private (gpointer data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ActorPrivate *
|
static ActorPrivate *
|
||||||
get_actor_private (MutterWindow *actor)
|
get_actor_private (MetaWindowActor *actor)
|
||||||
{
|
{
|
||||||
ActorPrivate *priv = g_object_get_qdata (G_OBJECT (actor), actor_data_quark);
|
ActorPrivate *priv = g_object_get_qdata (G_OBJECT (actor), actor_data_quark);
|
||||||
|
|
||||||
@ -275,15 +282,15 @@ get_actor_private (MutterWindow *actor)
|
|||||||
static void
|
static void
|
||||||
on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = MUTTER_PLUGIN (data);
|
MetaPlugin *plugin = META_PLUGIN (data);
|
||||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
GList *l = mutter_plugin_get_windows (plugin);
|
GList *l = meta_plugin_get_window_actors (plugin);
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
ClutterActor *a = l->data;
|
ClutterActor *a = l->data;
|
||||||
MutterWindow *mc_window = MUTTER_WINDOW (a);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (a);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
if (apriv->orig_parent)
|
if (apriv->orig_parent)
|
||||||
{
|
{
|
||||||
@ -302,27 +309,27 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
|||||||
priv->desktop1 = NULL;
|
priv->desktop1 = NULL;
|
||||||
priv->desktop2 = NULL;
|
priv->desktop2 = NULL;
|
||||||
|
|
||||||
mutter_plugin_switch_workspace_completed (plugin);
|
meta_plugin_switch_workspace_completed (plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
switch_workspace (MutterPlugin *plugin,
|
switch_workspace (MetaPlugin *plugin,
|
||||||
gint from, gint to,
|
gint from, gint to,
|
||||||
MetaMotionDirection direction)
|
MetaMotionDirection direction)
|
||||||
{
|
{
|
||||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
GList *l;
|
GList *l;
|
||||||
gint n_workspaces;
|
gint n_workspaces;
|
||||||
ClutterActor *workspace0 = clutter_group_new ();
|
ClutterActor *workspace0 = clutter_group_new ();
|
||||||
ClutterActor *workspace1 = clutter_group_new ();
|
ClutterActor *workspace1 = clutter_group_new ();
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
int screen_width, screen_height;
|
int screen_width, screen_height;
|
||||||
MetaScreen *screen = mutter_plugin_get_screen (plugin);
|
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
||||||
ClutterAnimation *animation;
|
ClutterAnimation *animation;
|
||||||
|
|
||||||
stage = mutter_plugin_get_stage (plugin);
|
stage = meta_plugin_get_stage (plugin);
|
||||||
|
|
||||||
mutter_plugin_query_screen_size (plugin,
|
meta_plugin_query_screen_size (plugin,
|
||||||
&screen_width,
|
&screen_width,
|
||||||
&screen_height);
|
&screen_height);
|
||||||
clutter_actor_set_anchor_point (workspace1,
|
clutter_actor_set_anchor_point (workspace1,
|
||||||
@ -339,31 +346,31 @@ switch_workspace (MutterPlugin *plugin,
|
|||||||
|
|
||||||
if (from == to)
|
if (from == to)
|
||||||
{
|
{
|
||||||
mutter_plugin_switch_workspace_completed (plugin);
|
meta_plugin_switch_workspace_completed (plugin);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
n_workspaces = meta_screen_get_n_workspaces (screen);
|
n_workspaces = meta_screen_get_n_workspaces (screen);
|
||||||
|
|
||||||
l = g_list_last (mutter_plugin_get_windows (plugin));
|
l = g_list_last (meta_plugin_get_window_actors (plugin));
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
MutterWindow *mc_window = l->data;
|
MetaWindowActor *window_actor = l->data;
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
ClutterActor *window = CLUTTER_ACTOR (mc_window);
|
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||||
gint win_workspace;
|
gint win_workspace;
|
||||||
|
|
||||||
win_workspace = mutter_window_get_workspace (mc_window);
|
win_workspace = meta_window_actor_get_workspace (window_actor);
|
||||||
|
|
||||||
if (win_workspace == to || win_workspace == from)
|
if (win_workspace == to || win_workspace == from)
|
||||||
{
|
{
|
||||||
apriv->orig_parent = clutter_actor_get_parent (window);
|
apriv->orig_parent = clutter_actor_get_parent (actor);
|
||||||
|
|
||||||
clutter_actor_reparent (window,
|
clutter_actor_reparent (actor,
|
||||||
win_workspace == to ? workspace1 : workspace0);
|
win_workspace == to ? workspace1 : workspace0);
|
||||||
clutter_actor_show_all (window);
|
clutter_actor_show_all (actor);
|
||||||
clutter_actor_raise_top (window);
|
clutter_actor_raise_top (actor);
|
||||||
}
|
}
|
||||||
else if (win_workspace < 0)
|
else if (win_workspace < 0)
|
||||||
{
|
{
|
||||||
@ -373,7 +380,7 @@ switch_workspace (MutterPlugin *plugin,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Window on some other desktop */
|
/* Window on some other desktop */
|
||||||
clutter_actor_hide (window);
|
clutter_actor_hide (actor);
|
||||||
apriv->orig_parent = NULL;
|
apriv->orig_parent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,11 +421,11 @@ on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
|||||||
* Must reverse the effect of the effect; must hide it first to ensure
|
* Must reverse the effect of the effect; must hide it first to ensure
|
||||||
* that the restoration will not be visible.
|
* that the restoration will not be visible.
|
||||||
*/
|
*/
|
||||||
MutterPlugin *plugin = data->plugin;
|
MetaPlugin *plugin = data->plugin;
|
||||||
ActorPrivate *apriv;
|
ActorPrivate *apriv;
|
||||||
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor);
|
||||||
|
|
||||||
apriv = get_actor_private (MUTTER_WINDOW (data->actor));
|
apriv = get_actor_private (META_WINDOW_ACTOR (data->actor));
|
||||||
apriv->tml_minimize = NULL;
|
apriv->tml_minimize = NULL;
|
||||||
|
|
||||||
clutter_actor_hide (data->actor);
|
clutter_actor_hide (data->actor);
|
||||||
@ -430,7 +437,7 @@ on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
|||||||
CLUTTER_GRAVITY_NORTH_WEST);
|
CLUTTER_GRAVITY_NORTH_WEST);
|
||||||
|
|
||||||
/* Now notify the manager that we are done with this effect */
|
/* Now notify the manager that we are done with this effect */
|
||||||
mutter_plugin_minimize_completed (plugin, mc_window);
|
meta_plugin_minimize_completed (plugin, window_actor);
|
||||||
|
|
||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
@ -440,11 +447,11 @@ on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
|||||||
* completion).
|
* completion).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
minimize (MutterPlugin *plugin, MutterWindow *mc_window)
|
minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||||
{
|
{
|
||||||
MetaWindowType type;
|
MetaWindowType type;
|
||||||
MetaWindow *meta_window = mutter_window_get_meta_window (mc_window);
|
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||||
|
|
||||||
|
|
||||||
type = meta_window_get_window_type (meta_window);
|
type = meta_window_get_window_type (meta_window);
|
||||||
@ -453,7 +460,7 @@ minimize (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
{
|
{
|
||||||
ClutterAnimation *animation;
|
ClutterAnimation *animation;
|
||||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
apriv->is_minimized = TRUE;
|
apriv->is_minimized = TRUE;
|
||||||
|
|
||||||
@ -475,7 +482,7 @@ minimize (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mutter_plugin_minimize_completed (plugin, mc_window);
|
meta_plugin_minimize_completed (plugin, window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -488,9 +495,9 @@ on_maximize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
|||||||
/*
|
/*
|
||||||
* Must reverse the effect of the effect.
|
* Must reverse the effect of the effect.
|
||||||
*/
|
*/
|
||||||
MutterPlugin * plugin = data->plugin;
|
MetaPlugin *plugin = data->plugin;
|
||||||
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
apriv->tml_maximize = NULL;
|
apriv->tml_maximize = NULL;
|
||||||
|
|
||||||
@ -500,7 +507,7 @@ on_maximize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
|||||||
CLUTTER_GRAVITY_NORTH_WEST);
|
CLUTTER_GRAVITY_NORTH_WEST);
|
||||||
|
|
||||||
/* Now notify the manager that we are done with this effect */
|
/* Now notify the manager that we are done with this effect */
|
||||||
mutter_plugin_maximize_completed (plugin, mc_window);
|
meta_plugin_maximize_completed (plugin, window_actor);
|
||||||
|
|
||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
@ -514,13 +521,13 @@ on_maximize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
|||||||
* (Something like a sound would be more appropriate.)
|
* (Something like a sound would be more appropriate.)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
maximize (MutterPlugin *plugin,
|
maximize (MetaPlugin *plugin,
|
||||||
MutterWindow *mc_window,
|
MetaWindowActor *window_actor,
|
||||||
gint end_x, gint end_y, gint end_width, gint end_height)
|
gint end_x, gint end_y, gint end_width, gint end_height)
|
||||||
{
|
{
|
||||||
MetaWindowType type;
|
MetaWindowType type;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||||
MetaWindow *meta_window = mutter_window_get_meta_window (mc_window);
|
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||||
|
|
||||||
gdouble scale_x = 1.0;
|
gdouble scale_x = 1.0;
|
||||||
gdouble scale_y = 1.0;
|
gdouble scale_y = 1.0;
|
||||||
@ -533,7 +540,7 @@ maximize (MutterPlugin *plugin,
|
|||||||
{
|
{
|
||||||
ClutterAnimation *animation;
|
ClutterAnimation *animation;
|
||||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
gfloat width, height;
|
gfloat width, height;
|
||||||
gfloat x, y;
|
gfloat x, y;
|
||||||
|
|
||||||
@ -571,7 +578,7 @@ maximize (MutterPlugin *plugin,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutter_plugin_maximize_completed (plugin, mc_window);
|
meta_plugin_maximize_completed (plugin, window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -580,22 +587,22 @@ maximize (MutterPlugin *plugin,
|
|||||||
* (Just a skeleton code.)
|
* (Just a skeleton code.)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
unmaximize (MutterPlugin *plugin,
|
unmaximize (MetaPlugin *plugin,
|
||||||
MutterWindow *mc_window,
|
MetaWindowActor *window_actor,
|
||||||
gint end_x, gint end_y, gint end_width, gint end_height)
|
gint end_x, gint end_y, gint end_width, gint end_height)
|
||||||
{
|
{
|
||||||
MetaWindow *meta_window = mutter_window_get_meta_window (mc_window);
|
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||||
MetaWindowType type = meta_window_get_window_type (meta_window);
|
MetaWindowType type = meta_window_get_window_type (meta_window);
|
||||||
|
|
||||||
if (type == META_WINDOW_NORMAL)
|
if (type == META_WINDOW_NORMAL)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
apriv->is_maximized = FALSE;
|
apriv->is_maximized = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do this conditionally, if the effect requires completion callback. */
|
/* Do this conditionally, if the effect requires completion callback. */
|
||||||
mutter_plugin_unmaximize_completed (plugin, mc_window);
|
meta_plugin_unmaximize_completed (plugin, window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -604,9 +611,9 @@ on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
|||||||
/*
|
/*
|
||||||
* Must reverse the effect of the effect.
|
* Must reverse the effect of the effect.
|
||||||
*/
|
*/
|
||||||
MutterPlugin *plugin = data->plugin;
|
MetaPlugin *plugin = data->plugin;
|
||||||
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
apriv->tml_map = NULL;
|
apriv->tml_map = NULL;
|
||||||
|
|
||||||
@ -614,7 +621,7 @@ on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
|||||||
CLUTTER_GRAVITY_NORTH_WEST);
|
CLUTTER_GRAVITY_NORTH_WEST);
|
||||||
|
|
||||||
/* Now notify the manager that we are done with this effect */
|
/* Now notify the manager that we are done with this effect */
|
||||||
mutter_plugin_map_completed (plugin, mc_window);
|
meta_plugin_map_completed (plugin, window_actor);
|
||||||
|
|
||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
@ -624,11 +631,11 @@ on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
|||||||
* completion).
|
* completion).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
map (MutterPlugin *plugin, MutterWindow *mc_window)
|
map (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||||
{
|
{
|
||||||
MetaWindowType type;
|
MetaWindowType type;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||||
MetaWindow *meta_window = mutter_window_get_meta_window (mc_window);
|
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||||
|
|
||||||
type = meta_window_get_window_type (meta_window);
|
type = meta_window_get_window_type (meta_window);
|
||||||
|
|
||||||
@ -636,7 +643,7 @@ map (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
{
|
{
|
||||||
ClutterAnimation *animation;
|
ClutterAnimation *animation;
|
||||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
clutter_actor_move_anchor_point_from_gravity (actor,
|
clutter_actor_move_anchor_point_from_gravity (actor,
|
||||||
CLUTTER_GRAVITY_CENTER);
|
CLUTTER_GRAVITY_CENTER);
|
||||||
@ -661,7 +668,7 @@ map (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mutter_plugin_map_completed (plugin, mc_window);
|
meta_plugin_map_completed (plugin, window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -671,24 +678,24 @@ map (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
static void
|
static void
|
||||||
on_destroy_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
on_destroy_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
||||||
{
|
{
|
||||||
MutterPlugin *plugin = data->plugin;
|
MetaPlugin *plugin = data->plugin;
|
||||||
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
apriv->tml_destroy = NULL;
|
apriv->tml_destroy = NULL;
|
||||||
|
|
||||||
mutter_plugin_destroy_completed (plugin, mc_window);
|
meta_plugin_destroy_completed (plugin, window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simple TV-out like effect.
|
* Simple TV-out like effect.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
destroy (MutterPlugin *plugin, MutterWindow *mc_window)
|
destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||||
{
|
{
|
||||||
MetaWindowType type;
|
MetaWindowType type;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||||
MetaWindow *meta_window = mutter_window_get_meta_window (mc_window);
|
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||||
|
|
||||||
type = meta_window_get_window_type (meta_window);
|
type = meta_window_get_window_type (meta_window);
|
||||||
|
|
||||||
@ -696,7 +703,7 @@ destroy (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
{
|
{
|
||||||
ClutterAnimation *animation;
|
ClutterAnimation *animation;
|
||||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||||
ActorPrivate *apriv = get_actor_private (mc_window);
|
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
clutter_actor_move_anchor_point_from_gravity (actor,
|
clutter_actor_move_anchor_point_from_gravity (actor,
|
||||||
CLUTTER_GRAVITY_CENTER);
|
CLUTTER_GRAVITY_CENTER);
|
||||||
@ -715,13 +722,13 @@ destroy (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mutter_plugin_destroy_completed (plugin, mc_window);
|
meta_plugin_destroy_completed (plugin, window_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
kill_switch_workspace (MutterPlugin *plugin)
|
kill_switch_workspace (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
if (priv->tml_switch_workspace1)
|
if (priv->tml_switch_workspace1)
|
||||||
{
|
{
|
||||||
@ -732,11 +739,12 @@ kill_switch_workspace (MutterPlugin *plugin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
kill_window_effects (MutterPlugin *plugin, MutterWindow *mc_window)
|
kill_window_effects (MetaPlugin *plugin,
|
||||||
|
MetaWindowActor *window_actor)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv;
|
ActorPrivate *apriv;
|
||||||
|
|
||||||
apriv = get_actor_private (mc_window);
|
apriv = get_actor_private (window_actor);
|
||||||
|
|
||||||
if (apriv->tml_minimize)
|
if (apriv->tml_minimize)
|
||||||
{
|
{
|
||||||
@ -763,10 +771,10 @@ kill_window_effects (MutterPlugin *plugin, MutterWindow *mc_window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const MutterPluginInfo *
|
static const MetaPluginInfo *
|
||||||
plugin_info (MutterPlugin *plugin)
|
plugin_info (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return &priv->info;
|
return &priv->info;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
static unsigned char* shadow_gaussian_make_tile (void);
|
static unsigned char* shadow_gaussian_make_tile (void);
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_create_shadow_frame (MetaCompositor *compositor)
|
meta_create_shadow_frame (MetaCompositor *compositor)
|
||||||
{
|
{
|
||||||
ClutterActor *frame;
|
ClutterActor *frame;
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
|
|
||||||
ClutterActor *mutter_create_shadow_frame (MetaCompositor *compositor);
|
ClutterActor *meta_create_shadow_frame (MetaCompositor *compositor);
|
||||||
|
|
||||||
#endif /* SHADOW_H */
|
#endif /* SHADOW_H */
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_INTROSPECTION
|
#ifdef HAVE_INTROSPECTION
|
||||||
#include <girepository.h>
|
#include <girepository.h>
|
||||||
#include "compositor/mutter-plugin-manager.h"
|
#include "compositor/meta-plugin-manager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -586,8 +586,8 @@ main (int argc, char **argv)
|
|||||||
* is initialized at this point, and we don't plan to run any real
|
* is initialized at this point, and we don't plan to run any real
|
||||||
* plugin code.
|
* plugin code.
|
||||||
*/
|
*/
|
||||||
MutterPluginManager *mgr = mutter_plugin_manager_get_default ();
|
MetaPluginManager *mgr = meta_plugin_manager_get_default ();
|
||||||
if (!mutter_plugin_manager_load (mgr))
|
if (!meta_plugin_manager_load (mgr))
|
||||||
g_critical ("failed to load plugins");
|
g_critical ("failed to load plugins");
|
||||||
}
|
}
|
||||||
if (!g_irepository_dump (meta_args.introspect, &error))
|
if (!g_irepository_dump (meta_args.introspect, &error))
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "compositor/mutter-plugin-manager.h"
|
#include "compositor/meta-plugin-manager.h"
|
||||||
#ifdef HAVE_GCONF
|
#ifdef HAVE_GCONF
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1058,7 +1058,7 @@ meta_prefs_init (void)
|
|||||||
#ifdef HAVE_GCONF
|
#ifdef HAVE_GCONF
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
gchar **gconf_dir_cursor;
|
gchar **gconf_dir_cursor;
|
||||||
MutterPluginManager *plugin_manager;
|
MetaPluginManager *plugin_manager;
|
||||||
|
|
||||||
if (default_client != NULL)
|
if (default_client != NULL)
|
||||||
return;
|
return;
|
||||||
@ -1087,8 +1087,8 @@ meta_prefs_init (void)
|
|||||||
|
|
||||||
/* We now initialize plugins so that they can override any preference locations */
|
/* We now initialize plugins so that they can override any preference locations */
|
||||||
|
|
||||||
plugin_manager = mutter_plugin_manager_get_default ();
|
plugin_manager = meta_plugin_manager_get_default ();
|
||||||
mutter_plugin_manager_load (plugin_manager);
|
meta_plugin_manager_load (plugin_manager);
|
||||||
|
|
||||||
/* Pick up initial values. */
|
/* Pick up initial values. */
|
||||||
|
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
#include "mutter-window.h"
|
#include "meta-window-actor.h"
|
||||||
|
|
||||||
/* Public compositor API */
|
/* Public compositor API */
|
||||||
ClutterActor * mutter_get_stage_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_stage_for_screen (MetaScreen *screen);
|
||||||
ClutterActor * mutter_get_overlay_group_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_overlay_group_for_screen (MetaScreen *screen);
|
||||||
Window mutter_get_overlay_window (MetaScreen *screen);
|
Window meta_get_overlay_window (MetaScreen *screen);
|
||||||
GList * mutter_get_windows (MetaScreen *screen);
|
GList *meta_get_window_actors (MetaScreen *screen);
|
||||||
ClutterActor * mutter_get_window_group_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_window_group_for_screen (MetaScreen *screen);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MUTTER_PLUGIN_H_
|
#ifndef META_PLUGIN_H_
|
||||||
#define MUTTER_PLUGIN_H_
|
#define META_PLUGIN_H_
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
@ -32,64 +32,64 @@
|
|||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
#include <gmodule.h>
|
#include <gmodule.h>
|
||||||
|
|
||||||
#define MUTTER_TYPE_PLUGIN (mutter_plugin_get_type ())
|
#define META_TYPE_PLUGIN (meta_plugin_get_type ())
|
||||||
#define MUTTER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_PLUGIN, MutterPlugin))
|
#define META_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_PLUGIN, MetaPlugin))
|
||||||
#define MUTTER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_PLUGIN, MutterPluginClass))
|
#define META_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_PLUGIN, MetaPluginClass))
|
||||||
#define MUTTER_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_TYPE_PLUGIN))
|
#define META_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_PLUGIN))
|
||||||
#define MUTTER_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_PLUGIN))
|
#define META_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_PLUGIN))
|
||||||
#define MUTTER_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_PLUGIN, MutterPluginClass))
|
#define META_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_PLUGIN, MetaPluginClass))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MutterPlugin: (skip)
|
* MetaPlugin: (skip)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef struct _MutterPlugin MutterPlugin;
|
typedef struct _MetaPlugin MetaPlugin;
|
||||||
/**
|
/**
|
||||||
* MutterPluginClass: (skip)
|
* MetaPluginClass: (skip)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef struct _MutterPluginClass MutterPluginClass;
|
typedef struct _MetaPluginClass MetaPluginClass;
|
||||||
typedef struct _MutterPluginVersion MutterPluginVersion;
|
typedef struct _MetaPluginVersion MetaPluginVersion;
|
||||||
typedef struct _MutterPluginInfo MutterPluginInfo;
|
typedef struct _MetaPluginInfo MetaPluginInfo;
|
||||||
typedef struct _MutterPluginPrivate MutterPluginPrivate;
|
typedef struct _MetaPluginPrivate MetaPluginPrivate;
|
||||||
|
|
||||||
struct _MutterPlugin
|
struct _MetaPlugin
|
||||||
{
|
{
|
||||||
GObject parent;
|
GObject parent;
|
||||||
|
|
||||||
MutterPluginPrivate *priv;
|
MetaPluginPrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterPluginClass
|
struct _MetaPluginClass
|
||||||
{
|
{
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
void (*start) (MutterPlugin *plugin);
|
void (*start) (MetaPlugin *plugin);
|
||||||
|
|
||||||
void (*minimize) (MutterPlugin *plugin,
|
void (*minimize) (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void (*maximize) (MutterPlugin *plugin,
|
void (*maximize) (MetaPlugin *plugin,
|
||||||
MutterWindow *actor,
|
MetaWindowActor *actor,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
void (*unmaximize) (MutterPlugin *plugin,
|
void (*unmaximize) (MetaPlugin *plugin,
|
||||||
MutterWindow *actor,
|
MetaWindowActor *actor,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
void (*map) (MutterPlugin *plugin,
|
void (*map) (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void (*destroy) (MutterPlugin *plugin,
|
void (*destroy) (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void (*switch_workspace) (MutterPlugin *plugin,
|
void (*switch_workspace) (MetaPlugin *plugin,
|
||||||
gint from,
|
gint from,
|
||||||
gint to,
|
gint to,
|
||||||
MetaMotionDirection direction);
|
MetaMotionDirection direction);
|
||||||
@ -98,21 +98,21 @@ struct _MutterPluginClass
|
|||||||
* Called if an effects should be killed prematurely; the plugin must
|
* Called if an effects should be killed prematurely; the plugin must
|
||||||
* call the completed() callback as if the effect terminated naturally.
|
* call the completed() callback as if the effect terminated naturally.
|
||||||
*/
|
*/
|
||||||
void (*kill_window_effects) (MutterPlugin *plugin,
|
void (*kill_window_effects) (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void (*kill_switch_workspace) (MutterPlugin *plugin);
|
void (*kill_switch_workspace) (MetaPlugin *plugin);
|
||||||
|
|
||||||
/* General XEvent filter. This is fired *before* mutter itself handles
|
/* General XEvent filter. This is fired *before* meta itself handles
|
||||||
* an event. Return TRUE to block any further processing.
|
* an event. Return TRUE to block any further processing.
|
||||||
*/
|
*/
|
||||||
gboolean (*xevent_filter) (MutterPlugin *plugin,
|
gboolean (*xevent_filter) (MetaPlugin *plugin,
|
||||||
XEvent *event);
|
XEvent *event);
|
||||||
|
|
||||||
const MutterPluginInfo * (*plugin_info) (MutterPlugin *plugin);
|
const MetaPluginInfo * (*plugin_info) (MetaPlugin *plugin);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MutterPluginInfo
|
struct _MetaPluginInfo
|
||||||
{
|
{
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
const gchar *version;
|
const gchar *version;
|
||||||
@ -121,18 +121,19 @@ struct _MutterPluginInfo
|
|||||||
const gchar *description;
|
const gchar *description;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType mutter_plugin_get_type (void);
|
GType meta_plugin_get_type (void);
|
||||||
|
|
||||||
gulong mutter_plugin_features (MutterPlugin *plugin);
|
gulong meta_plugin_features (MetaPlugin *plugin);
|
||||||
gboolean mutter_plugin_disabled (MutterPlugin *plugin);
|
gboolean meta_plugin_disabled (MetaPlugin *plugin);
|
||||||
gboolean mutter_plugin_running (MutterPlugin *plugin);
|
gboolean meta_plugin_running (MetaPlugin *plugin);
|
||||||
gboolean mutter_plugin_debug_mode (MutterPlugin *plugin);
|
gboolean meta_plugin_debug_mode (MetaPlugin *plugin);
|
||||||
const MutterPluginInfo * mutter_plugin_get_info (MutterPlugin *plugin);
|
|
||||||
|
|
||||||
struct _MutterPluginVersion
|
const MetaPluginInfo * meta_plugin_get_info (MetaPlugin *plugin);
|
||||||
|
|
||||||
|
struct _MetaPluginVersion
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Version information; the first three numbers match the Mutter version
|
* Version information; the first three numbers match the Meta version
|
||||||
* with which the plugin was compiled (see clutter-plugins/simple.c for sample
|
* with which the plugin was compiled (see clutter-plugins/simple.c for sample
|
||||||
* code).
|
* code).
|
||||||
*/
|
*/
|
||||||
@ -151,13 +152,13 @@ struct _MutterPluginVersion
|
|||||||
/*
|
/*
|
||||||
* Convenience macro to set up the plugin type. Based on GEdit.
|
* Convenience macro to set up the plugin type. Based on GEdit.
|
||||||
*/
|
*/
|
||||||
#define MUTTER_PLUGIN_DECLARE(ObjectName, object_name) \
|
#define META_PLUGIN_DECLARE(ObjectName, object_name) \
|
||||||
G_MODULE_EXPORT MutterPluginVersion mutter_plugin_version = \
|
G_MODULE_EXPORT MetaPluginVersion meta_plugin_version = \
|
||||||
{ \
|
{ \
|
||||||
MUTTER_MAJOR_VERSION, \
|
MUTTER_MAJOR_VERSION, \
|
||||||
MUTTER_MINOR_VERSION, \
|
MUTTER_MINOR_VERSION, \
|
||||||
MUTTER_MICRO_VERSION, \
|
MUTTER_MICRO_VERSION, \
|
||||||
MUTTER_PLUGIN_API_VERSION \
|
MUTTER_PLUGIN_API_VERSION \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
static GType g_define_type_id = 0; \
|
static GType g_define_type_id = 0; \
|
||||||
@ -170,7 +171,7 @@ struct _MutterPluginVersion
|
|||||||
GType object_name##_register_type (GTypeModule *type_module); \
|
GType object_name##_register_type (GTypeModule *type_module); \
|
||||||
\
|
\
|
||||||
G_MODULE_EXPORT \
|
G_MODULE_EXPORT \
|
||||||
GType mutter_plugin_register_type (GTypeModule *type_module); \
|
GType meta_plugin_register_type (GTypeModule *type_module); \
|
||||||
\
|
\
|
||||||
GType \
|
GType \
|
||||||
object_name##_get_type () \
|
object_name##_get_type () \
|
||||||
@ -204,7 +205,7 @@ struct _MutterPluginVersion
|
|||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
g_define_type_id = g_type_module_register_type (type_module, \
|
g_define_type_id = g_type_module_register_type (type_module, \
|
||||||
MUTTER_TYPE_PLUGIN, \
|
META_TYPE_PLUGIN, \
|
||||||
#ObjectName, \
|
#ObjectName, \
|
||||||
&our_info, \
|
&our_info, \
|
||||||
0); \
|
0); \
|
||||||
@ -214,59 +215,59 @@ struct _MutterPluginVersion
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
G_MODULE_EXPORT GType \
|
G_MODULE_EXPORT GType \
|
||||||
mutter_plugin_register_type (GTypeModule *type_module) \
|
meta_plugin_register_type (GTypeModule *type_module) \
|
||||||
{ \
|
{ \
|
||||||
return object_name##_register_type (type_module); \
|
return object_name##_register_type (type_module); \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_switch_workspace_completed (MutterPlugin *plugin);
|
meta_plugin_switch_workspace_completed (MetaPlugin *plugin);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_minimize_completed (MutterPlugin *plugin,
|
meta_plugin_minimize_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_maximize_completed (MutterPlugin *plugin,
|
meta_plugin_maximize_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_unmaximize_completed (MutterPlugin *plugin,
|
meta_plugin_unmaximize_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_map_completed (MutterPlugin *plugin,
|
meta_plugin_map_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_destroy_completed (MutterPlugin *plugin,
|
meta_plugin_destroy_completed (MetaPlugin *plugin,
|
||||||
MutterWindow *actor);
|
MetaWindowActor *actor);
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_plugin_get_overlay_group (MutterPlugin *plugin);
|
meta_plugin_get_overlay_group (MetaPlugin *plugin);
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_plugin_get_window_group (MutterPlugin *plugin);
|
meta_plugin_get_window_group (MetaPlugin *plugin);
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
mutter_plugin_get_stage (MutterPlugin *plugin);
|
meta_plugin_get_stage (MetaPlugin *plugin);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_query_screen_size (MutterPlugin *plugin,
|
meta_plugin_query_screen_size (MetaPlugin *plugin,
|
||||||
int *width,
|
int *width,
|
||||||
int *height);
|
int *height);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_set_stage_reactive (MutterPlugin *plugin,
|
meta_plugin_set_stage_reactive (MetaPlugin *plugin,
|
||||||
gboolean reactive);
|
gboolean reactive);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_set_stage_input_area (MutterPlugin *plugin,
|
meta_plugin_set_stage_input_area (MetaPlugin *plugin,
|
||||||
gint x, gint y, gint width, gint height);
|
gint x, gint y, gint width, gint height);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_set_stage_input_region (MutterPlugin *plugin,
|
meta_plugin_set_stage_input_region (MetaPlugin *plugin,
|
||||||
XserverRegion region);
|
XserverRegion region);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaModalOptions:
|
* MetaModalOptions:
|
||||||
@ -275,7 +276,7 @@ mutter_plugin_set_stage_input_region (MutterPlugin *plugin,
|
|||||||
* @META_MODAL_KEYBOARD_ALREADY_GRABBED: if set the keyboard is already
|
* @META_MODAL_KEYBOARD_ALREADY_GRABBED: if set the keyboard is already
|
||||||
* grabbed by the plugin and should not be grabbed again.
|
* grabbed by the plugin and should not be grabbed again.
|
||||||
*
|
*
|
||||||
* Options that can be provided when calling mutter_plugin_begin_modal().
|
* Options that can be provided when calling meta_plugin_begin_modal().
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
META_MODAL_POINTER_ALREADY_GRABBED = 1 << 0,
|
META_MODAL_POINTER_ALREADY_GRABBED = 1 << 0,
|
||||||
@ -283,26 +284,21 @@ typedef enum {
|
|||||||
} MetaModalOptions;
|
} MetaModalOptions;
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mutter_plugin_begin_modal (MutterPlugin *plugin,
|
meta_plugin_begin_modal (MetaPlugin *plugin,
|
||||||
Window grab_window,
|
Window grab_window,
|
||||||
Cursor cursor,
|
Cursor cursor,
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
void
|
void
|
||||||
mutter_plugin_end_modal (MutterPlugin *plugin,
|
meta_plugin_end_modal (MetaPlugin *plugin,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
GList *
|
GList * meta_plugin_get_window_actors (MetaPlugin *plugin);
|
||||||
mutter_plugin_get_windows (MutterPlugin *plugin);
|
Display * meta_plugin_get_xdisplay (MetaPlugin *plugin);
|
||||||
|
MetaScreen *meta_plugin_get_screen (MetaPlugin *plugin);
|
||||||
Display *
|
|
||||||
mutter_plugin_get_xdisplay (MutterPlugin *plugin);
|
|
||||||
|
|
||||||
MetaScreen *
|
|
||||||
mutter_plugin_get_screen (MutterPlugin *plugin);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_mutter_plugin_effect_started (MutterPlugin *plugin);
|
_meta_plugin_effect_started (MetaPlugin *plugin);
|
||||||
|
|
||||||
#endif /* MUTTER_PLUGIN_H_ */
|
#endif /* META_PLUGIN_H_ */
|
69
src/include/meta-window-actor.h
Normal file
69
src/include/meta-window-actor.h
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2008 Matthew Allum
|
||||||
|
* Copyright (C) 2007 Iain Holmes
|
||||||
|
* Based on xcompmgr - (c) 2003 Keith Packard
|
||||||
|
* xfwm4 - (c) 2005-2007 Olivier Fourdan
|
||||||
|
*
|
||||||
|
* 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_WINDOW_ACTOR_H_
|
||||||
|
#define META_WINDOW_ACTOR_H_
|
||||||
|
|
||||||
|
#include <clutter/clutter.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
#include "compositor.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MetaWindowActor object (ClutterGroup sub-class)
|
||||||
|
*/
|
||||||
|
#define META_TYPE_WINDOW_ACTOR (meta_window_actor_get_type ())
|
||||||
|
#define META_WINDOW_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW_ACTOR, MetaWindowActor))
|
||||||
|
#define META_WINDOW_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_WINDOW_ACTOR, MetaWindowActorClass))
|
||||||
|
#define META_IS_WINDOW_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW_ACTOR))
|
||||||
|
#define META_IS_WINDOW_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_WINDOW_ACTOR))
|
||||||
|
#define META_WINDOW_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_WINDOW_ACTOR, MetaWindowActorClass))
|
||||||
|
|
||||||
|
typedef struct _MetaWindowActor MetaWindowActor;
|
||||||
|
typedef struct _MetaWindowActorClass MetaWindowActorClass;
|
||||||
|
typedef struct _MetaWindowActorPrivate MetaWindowActorPrivate;
|
||||||
|
|
||||||
|
struct _MetaWindowActorClass
|
||||||
|
{
|
||||||
|
ClutterGroupClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MetaWindowActor
|
||||||
|
{
|
||||||
|
ClutterGroup parent;
|
||||||
|
|
||||||
|
MetaWindowActorPrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType meta_window_actor_get_type (void);
|
||||||
|
|
||||||
|
Window meta_window_actor_get_x_window (MetaWindowActor *self);
|
||||||
|
gint meta_window_actor_get_workspace (MetaWindowActor *self);
|
||||||
|
MetaWindow * meta_window_actor_get_meta_window (MetaWindowActor *self);
|
||||||
|
ClutterActor * meta_window_actor_get_texture (MetaWindowActor *self);
|
||||||
|
gboolean meta_window_actor_is_override_redirect (MetaWindowActor *self);
|
||||||
|
const char * meta_window_actor_get_description (MetaWindowActor *self);
|
||||||
|
gboolean meta_window_actor_showing_on_its_workspace (MetaWindowActor *self);
|
||||||
|
|
||||||
|
#endif /* META_WINDOW_ACTOR_H */
|
@ -1,70 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2008 Matthew Allum
|
|
||||||
* Copyright (C) 2007 Iain Holmes
|
|
||||||
* Based on xcompmgr - (c) 2003 Keith Packard
|
|
||||||
* xfwm4 - (c) 2005-2007 Olivier Fourdan
|
|
||||||
*
|
|
||||||
* 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 MUTTER_WINDOW_H_
|
|
||||||
#define MUTTER_WINDOW_H_
|
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
|
|
||||||
#include "compositor.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MutterWindow object (ClutterGroup sub-class)
|
|
||||||
*/
|
|
||||||
#define MUTTER_TYPE_COMP_WINDOW (mutter_window_get_type ())
|
|
||||||
#define MUTTER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_COMP_WINDOW, MutterWindow))
|
|
||||||
#define MUTTER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_COMP_WINDOW, MutterWindowClass))
|
|
||||||
#define MUTTER_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_TYPE_COMP_WINDOW))
|
|
||||||
#define MUTTER_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_COMP_WINDOW))
|
|
||||||
#define MUTTER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_COMP_WINDOW, MutterWindowClass))
|
|
||||||
|
|
||||||
typedef struct _MutterWindow MutterWindow;
|
|
||||||
typedef struct _MutterWindowClass MutterWindowClass;
|
|
||||||
typedef struct _MutterWindowPrivate MutterWindowPrivate;
|
|
||||||
|
|
||||||
struct _MutterWindowClass
|
|
||||||
{
|
|
||||||
ClutterGroupClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MutterWindow
|
|
||||||
{
|
|
||||||
ClutterGroup parent;
|
|
||||||
|
|
||||||
MutterWindowPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
GType mutter_window_get_type (void);
|
|
||||||
|
|
||||||
Window mutter_window_get_x_window (MutterWindow *mcw);
|
|
||||||
gint mutter_window_get_workspace (MutterWindow *mcw);
|
|
||||||
gboolean mutter_window_is_hidden (MutterWindow *mcw);
|
|
||||||
MetaWindow * mutter_window_get_meta_window (MutterWindow *mcw);
|
|
||||||
ClutterActor * mutter_window_get_texture (MutterWindow *mcw);
|
|
||||||
gboolean mutter_window_is_override_redirect (MutterWindow *mcw);
|
|
||||||
const char * mutter_window_get_description (MutterWindow *mcw);
|
|
||||||
gboolean mutter_window_showing_on_its_workspace (MutterWindow *mcw);
|
|
||||||
|
|
||||||
#endif /* MUTTER_WINDOW_H */
|
|
Loading…
Reference in New Issue
Block a user