Merge branch 'moblin-plugin' into clutter
Conflicts: src/compositor/clutter/compositor-clutter-plugin-manager.c src/compositor/mutter/plugins/Makefile.am src/compositor/mutter/plugins/moblin.c src/include/compositor-clutter-plugin.h src/include/compositor-clutter.h
This commit is contained in:
255
src/include/compositor-clutter-plugin.h
Normal file
255
src/include/compositor-clutter-plugin.h
Normal file
@ -0,0 +1,255 @@
|
||||
/* -*- 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_COMPOSITOR_CLUTTER_PLUGIN_H_
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "config.h"
|
||||
#include "compositor.h"
|
||||
#include "compositor-clutter.h"
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
/*
|
||||
* This file defines the plugin API.
|
||||
*
|
||||
* Effects plugin is shared library loaded via dlopen(); it is recommended
|
||||
* that the GModule API is used (otherwise you are on your own to do proper
|
||||
* plugin clean up when the module is unloaded).
|
||||
*
|
||||
* The plugin interface is exported via the MetaCompositorClutterPlugin struct.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Alias MetaRectangle to PluginWorkspaceRectangle in anticipation of
|
||||
* making this file metacity-independent (we want the plugins to be portable
|
||||
* between different WMs.
|
||||
*/
|
||||
typedef MetaRectangle PluginWorkspaceRectangle;
|
||||
|
||||
/*
|
||||
* The name of the header struct; use as:
|
||||
*
|
||||
* MetaCompositorClutterPlugin META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT =
|
||||
* {
|
||||
* ...
|
||||
* };
|
||||
*
|
||||
* See clutter-plugins/simple.c for example code.
|
||||
*/
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT MCCPS__
|
||||
|
||||
/*
|
||||
* Definition for the plugin init function; use as:
|
||||
*
|
||||
* META_COMPOSITOR_CLUTTER_PLUGIN_INIT_FUNC
|
||||
* {
|
||||
* init code ...
|
||||
* }
|
||||
*
|
||||
* See clutter-plugins/simple.c for example code.
|
||||
*/
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_INIT_FUNC \
|
||||
gboolean mccp_init__(void); \
|
||||
gboolean mccp_init__()
|
||||
|
||||
|
||||
/* Private; must match the above */
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT_NAME "MCCPS__"
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_INIT_FUNC_NAME "mccp_init__"
|
||||
|
||||
typedef struct MetaCompositorClutterPlugin MetaCompositorClutterPlugin;
|
||||
|
||||
/*
|
||||
* Feature flags: identify events that the plugin can handle; a plugin can
|
||||
* handle one or more events.
|
||||
*/
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE 0x00000001UL
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE 0x00000002UL
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE 0x00000004UL
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_MAP 0x00000008UL
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY 0x00000010UL
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE 0x00000020UL
|
||||
|
||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_ALL_EFFECTS 0xffffffffUL
|
||||
|
||||
struct MetaCompositorClutterPlugin
|
||||
{
|
||||
/*
|
||||
* Version information; the first three numbers match the Metacity version
|
||||
* with which the plugin was compiled (see clutter-plugins/simple.c for sample
|
||||
* code).
|
||||
*/
|
||||
guint version_major;
|
||||
guint version_minor;
|
||||
guint version_micro;
|
||||
|
||||
/*
|
||||
* Version of the plugin API; this is unrelated to the matacity version
|
||||
* per se. The API version is checked by the plugin manager and must match
|
||||
* the one used by it (see clutter-plugins/simple.c for sample code).
|
||||
*/
|
||||
guint version_api;
|
||||
|
||||
#ifndef META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN
|
||||
const
|
||||
#endif
|
||||
gchar *name; /* Human-readable name for UI */
|
||||
gulong features; /* or-ed feature flags */
|
||||
|
||||
/*
|
||||
* Event handlers
|
||||
*
|
||||
* Plugins must not make any special assumptions about the nature of
|
||||
* ClutterActor, as the implementation details can change.
|
||||
*
|
||||
* Plugins must restore actor properties on completion (i.e., fade effects
|
||||
* must restore opacity back to the original value, scale effects scale,
|
||||
* etc.).
|
||||
*
|
||||
* On completion, each event handler must call the manager completed()
|
||||
* callback function.
|
||||
*/
|
||||
void (*minimize) (MetaCompWindow *actor);
|
||||
|
||||
void (*maximize) (MetaCompWindow *actor,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
void (*unmaximize) (MetaCompWindow *actor,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
void (*map) (MetaCompWindow *actor);
|
||||
|
||||
void (*destroy) (MetaCompWindow *actor);
|
||||
|
||||
/*
|
||||
* Each actor in the list has a workspace number attached to it using
|
||||
* g_object_set_data() with key META_COMPOSITOR_CLUTTER_PLUGIN_WORKSPACE_KEY;
|
||||
* workspace < 0 indicates the window is sticky (i.e., on all desktops).
|
||||
*/
|
||||
void (*switch_workspace) (const GList **actors,
|
||||
gint from,
|
||||
gint to,
|
||||
MetaMotionDirection direction);
|
||||
|
||||
/*
|
||||
* Called if an effect should be killed prematurely; the plugin must
|
||||
* call the completed() callback as if the effect terminated naturally.
|
||||
* The events parameter is a bitmask indicating which effects are to be
|
||||
* killed.
|
||||
*/
|
||||
void (*kill_effect) (MetaCompWindow *actor,
|
||||
gulong events);
|
||||
|
||||
|
||||
/*
|
||||
* The plugin manager will call this function when module should be reloaded.
|
||||
* This happens, for example, when the parameters for the plugin changed.
|
||||
*/
|
||||
gboolean (*reload) (void);
|
||||
|
||||
/* General XEvent filter. This is fired *before* metacity itself handles
|
||||
* an event. Return TRUE to block any further processing.
|
||||
*/
|
||||
gboolean (*xevent_filter) (XEvent *event);
|
||||
|
||||
|
||||
#ifdef META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN
|
||||
const
|
||||
#endif
|
||||
gchar *params; /* String containing additional parameters for the plugin;
|
||||
* this is specified after the pluing name in the gconf
|
||||
* database, separated by a colon.
|
||||
*
|
||||
* The following parameter tokens need to be handled by all
|
||||
* plugins:
|
||||
*
|
||||
* 'debug'
|
||||
* Indicates running in debug mode; the plugin
|
||||
* might want to print useful debug info, or
|
||||
* extend effect duration, etc.
|
||||
*
|
||||
* 'disable: ...;'
|
||||
*
|
||||
* The disable token indicates that the effects
|
||||
* listed after the colon should be disabled.
|
||||
*
|
||||
* The list is comma-separated, terminated by a
|
||||
* semicolon and consisting of the following
|
||||
* tokens:
|
||||
*
|
||||
* minimize
|
||||
* maximize
|
||||
* unmaximize
|
||||
* map
|
||||
* destroy
|
||||
* switch-workspace
|
||||
*/
|
||||
|
||||
gint screen_width;
|
||||
gint screen_height;
|
||||
|
||||
GList *work_areas; /* List of PluginWorkspaceRectangles defining the
|
||||
* geometry of individual workspaces.
|
||||
*/
|
||||
|
||||
gint running; /* Plugin must increase this counter for each effect it starts
|
||||
* decrease it again once the effect finishes.
|
||||
*/
|
||||
|
||||
void *plugin_private; /* Plugin private data go here; use the plugin init
|
||||
* function to allocate and initialize any private
|
||||
* data.
|
||||
*/
|
||||
|
||||
/* Private; manager private data. */
|
||||
void *manager_private;
|
||||
};
|
||||
|
||||
void
|
||||
meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin,
|
||||
MetaCompWindow *actor,
|
||||
unsigned long event);
|
||||
|
||||
ClutterActor *
|
||||
meta_comp_clutter_plugin_get_overlay_group (MetaCompositorClutterPlugin *plugin);
|
||||
|
||||
ClutterActor *
|
||||
meta_comp_clutter_plugin_get_stage (MetaCompositorClutterPlugin *plugin);
|
||||
|
||||
void
|
||||
meta_comp_clutter_plugin_set_stage_reactive (MetaCompositorClutterPlugin *plugin,
|
||||
gboolean reactive);
|
||||
|
||||
void
|
||||
meta_comp_clutter_plugin_set_stage_input_area (MetaCompositorClutterPlugin *plugin,
|
||||
gint x, gint y, gint width, gint height);
|
||||
|
||||
#endif
|
76
src/include/compositor-clutter.h
Normal file
76
src/include/compositor-clutter.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* -*- 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_COMPOSITOR_CLUTTER_H_
|
||||
#define META_COMPOSITOR_CLUTTER_H_
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
/*
|
||||
* MetaCompWindow object (ClutterGroup sub-class)
|
||||
*/
|
||||
#define META_TYPE_COMP_WINDOW (meta_comp_window_get_type ())
|
||||
#define META_COMP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_COMP_WINDOW, MetaCompWindow))
|
||||
#define META_COMP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_COMP_WINDOW, MetaCompWindowClass))
|
||||
#define IS_META_COMP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_COMP_WINDOW_TYPE))
|
||||
#define META_IS_COMP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_COMP_WINDOW))
|
||||
#define META_COMP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_COMP_WINDOW, MetaCompWindowClass))
|
||||
|
||||
typedef struct _MetaCompWindow MetaCompWindow;
|
||||
typedef struct _MetaCompWindowClass MetaCompWindowClass;
|
||||
typedef struct _MetaCompWindowPrivate MetaCompWindowPrivate;
|
||||
|
||||
struct _MetaCompWindowClass
|
||||
{
|
||||
ClutterGroupClass parent_class;
|
||||
};
|
||||
|
||||
struct _MetaCompWindow
|
||||
{
|
||||
ClutterGroup parent;
|
||||
|
||||
MetaCompWindowPrivate *priv;
|
||||
};
|
||||
|
||||
GType meta_comp_window_get_type (void);
|
||||
|
||||
Window meta_comp_window_get_x_window (MetaCompWindow *mcw);
|
||||
MetaCompWindowType meta_comp_window_get_window_type (MetaCompWindow *mcw);
|
||||
gint meta_comp_window_get_workspace (MetaCompWindow *mcw);
|
||||
|
||||
|
||||
/* Compositor API */
|
||||
MetaCompositor *meta_compositor_clutter_new (MetaDisplay *display);
|
||||
|
||||
void meta_compositor_clutter_window_effect_completed (MetaCompWindow *actor, gulong event);
|
||||
|
||||
ClutterActor * meta_compositor_clutter_get_stage_for_screen (MetaScreen *screen);
|
||||
ClutterActor * meta_compositor_clutter_get_overlay_group_for_screen (MetaScreen *screen);
|
||||
|
||||
Window meta_compositor_clutter_get_overlay_window (MetaScreen *screen);
|
||||
|
||||
|
||||
#endif
|
@ -69,5 +69,6 @@ void mutter_window_effect_completed (MutterWindow *actor, gulong event);
|
||||
|
||||
ClutterActor * mutter_get_stage_for_screen (MetaScreen *screen);
|
||||
ClutterActor * mutter_get_overlay_group_for_screen (MetaScreen *screen);
|
||||
Window mutter_get_overlay_window (MetaScreen *screen);
|
||||
|
||||
#endif
|
||||
|
@ -79,8 +79,8 @@ struct MutterPlugin
|
||||
#endif
|
||||
gchar *name; /* Human-readable name for UI */
|
||||
gulong features; /* or-ed feature flags */
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* This function is called once the plugin has been loaded.
|
||||
*
|
||||
* @params is a string containing additional parameters for the plugin and is
|
||||
@ -94,7 +94,7 @@ struct MutterPlugin
|
||||
* Indicates running in debug mode; the plugin
|
||||
* might want to print useful debug info, or
|
||||
* extend effect duration, etc.
|
||||
*
|
||||
*
|
||||
* 'disable: ...;'
|
||||
*
|
||||
* The disable token indicates that the effects
|
||||
@ -185,8 +185,8 @@ struct MutterPlugin
|
||||
|
||||
/* List of PluginWorkspaceRectangles defining the geometry of individual
|
||||
* workspaces. */
|
||||
GList *work_areas;
|
||||
|
||||
GList *work_areas;
|
||||
|
||||
/* FIXME: It should be possible to hide this from plugins */
|
||||
gint running; /* Plugin must increase this counter for each effect it starts
|
||||
* decrease it again once the effect finishes.
|
||||
@ -202,19 +202,33 @@ struct MutterPlugin
|
||||
};
|
||||
|
||||
void
|
||||
meta_comp_clutter_plugin_effect_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor,
|
||||
unsigned long event);
|
||||
mutter_plugin_effect_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor,
|
||||
unsigned long event);
|
||||
|
||||
ClutterActor *
|
||||
meta_comp_clutter_plugin_get_overlay_group (MutterPlugin *plugin);
|
||||
mutter_plugin_get_overlay_group (MutterPlugin *plugin);
|
||||
|
||||
ClutterActor *
|
||||
meta_comp_clutter_plugin_get_stage (MutterPlugin *plugin);
|
||||
mutter_plugin_get_stage (MutterPlugin *plugin);
|
||||
|
||||
void
|
||||
meta_comp_clutter_plugin_query_screen_size (MutterPlugin *plugin,
|
||||
int *width,
|
||||
int *height);
|
||||
mutter_plugin_query_screen_size (MutterPlugin *plugin,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
ClutterActor *
|
||||
mutter_plugin_get_overlay_group (MutterPlugin *plugin);
|
||||
|
||||
ClutterActor *
|
||||
mutter_plugin_get_stage (MutterPlugin *plugin);
|
||||
|
||||
void
|
||||
mutter_plugin_set_stage_reactive (MutterPlugin *plugin,
|
||||
gboolean reactive);
|
||||
|
||||
void
|
||||
mutter_plugin_set_stage_input_area (MutterPlugin *plugin,
|
||||
gint x, gint y, gint width, gint height);
|
||||
|
||||
#endif /* MUTTER_PLUGIN_H_ */
|
||||
|
Reference in New Issue
Block a user