Commit f141692c authored by Iain Holmes's avatar Iain Holmes Committed by Iain Holmes
Browse files

src/include/frame.h src/include/display.h src/include/xprops.h

2008-05-19  Iain Holmes  <iain@gnome.org>

        * src/include/frame.h
        * src/include/display.h
        * src/include/xprops.h
        * src/include/compositor.h
        * src/include/types.h
        * src/include/window.h
        * src/include/errors.h
        * src/include/screen.h: New basic public API for compositor.

        * src/compositor/*: Separate the compositor out into its own 
separate
        directory and set it up for backends. Initial XRender backend.

        * src/core/compositor.[ch]: Remove

        * src/core/frame.h
        * src/core/screen.h
        * src/core/display.h
        * src/core/window.h: Rename to -private.h so as not to clash 
with the
        new files in include

        * src/core/delete.c
        * src/core/workspace.h
        * src/core/stack.[ch]
        * src/core/keybindings.[ch]
        * src/core/errors.c
        * src/core/effects.[ch]
        * src/core/core.c
        * src/core/group.h
        * src/core/edge-resistance.[ch]
        * src/core/window-props.[ch]
        * src/core/constraints.h
        * src/core/bell.[ch]
        * src/core/iconcache.h
        * src/core/session.[ch]
        * src/core/main.c
        * src/core/place.h
        * src/core/xprops.c
        * src/ui/tabpopup.c: Use the new -private headers

        * src/core/display.c
        * src/core/frame.c
        * src/core/window.c
        * src/core/screen.c: Add the API functions required by the 
compositor

        * src/Makefile.am: Relocate the new files



svn path=/trunk/; revision=3715
parent fe292078
2008-05-19 Iain Holmes <iain@gnome.org>
* src/include/frame.h
* src/include/display.h
* src/include/xprops.h
* src/include/compositor.h
* src/include/types.h
* src/include/window.h
* src/include/errors.h
* src/include/screen.h: New basic public API for compositor.
* src/compositor/*: Separate the compositor out into its own separate
directory and set it up for backends. Initial XRender backend.
* src/core/compositor.[ch]: Remove
* src/core/frame.h
* src/core/screen.h
* src/core/display.h
* src/core/window.h: Rename to -private.h so as not to clash with the
new files in include
* src/core/delete.c
* src/core/workspace.h
* src/core/stack.[ch]
* src/core/keybindings.[ch]
* src/core/errors.c
* src/core/effects.[ch]
* src/core/core.c
* src/core/group.h
* src/core/edge-resistance.[ch]
* src/core/window-props.[ch]
* src/core/constraints.h
* src/core/bell.[ch]
* src/core/iconcache.h
* src/core/session.[ch]
* src/core/main.c
* src/core/place.h
* src/core/xprops.c
* src/ui/tabpopup.c: Use the new -private headers
* src/core/display.c
* src/core/frame.c
* src/core/window.c
* src/core/screen.c: Add the API functions required by the compositor
* src/Makefile.am: Relocate the new files
2008-05-13 Robert Escriva <me@robescriva.com>
* src/ui/theme.h (struct): remove color_set flag
......
......@@ -12,14 +12,17 @@ metacity_SOURCES= \
core/bell.h \
core/boxes.c \
include/boxes.h \
core/compositor.c \
core/compositor.h \
compositor/compositor.c \
compositor/compositor-private.h \
compositor/compositor-xrender.c \
include/compositor.h \
core/constraints.c \
core/constraints.h \
core/core.c \
core/delete.c \
core/display.c \
core/display.h \
core/display-private.h \
include/display.h \
ui/draw-workspace.c \
ui/draw-workspace.h \
core/edge-resistance.c \
......@@ -27,11 +30,12 @@ metacity_SOURCES= \
core/effects.c \
core/effects.h \
core/errors.c \
core/errors.h \
include/errors.h \
core/eventqueue.c \
core/eventqueue.h \
core/frame.c \
core/frame.h \
core/frame-private.h \
include/frame.h \
ui/gradient.c \
ui/gradient.h \
core/group-private.h \
......@@ -51,7 +55,8 @@ metacity_SOURCES= \
core/prefs.c \
include/prefs.h \
core/screen.c \
core/screen.h \
core/screen-private.h \
include/screen.h \
core/session.c \
core/session.h \
core/stack.c \
......@@ -61,11 +66,12 @@ metacity_SOURCES= \
core/window-props.c \
core/window-props.h \
core/window.c \
core/window.h \
core/window-private.h \
include/window.h \
core/workspace.c \
core/workspace.h \
core/xprops.c \
core/xprops.h \
include/xprops.h \
include/common.h \
include/core.h \
include/ui.h \
......
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2008 Iain Holmes
*
* 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_PRIVATE_H
#define META_COMPOSITOR_PRIVATE_H
#include "compositor.h"
struct _MetaCompositor
{
void (* destroy) (MetaCompositor *compositor);
void (*manage_screen) (MetaCompositor *compositor,
MetaScreen *screen);
void (*unmanage_screen) (MetaCompositor *compositor,
MetaScreen *screen);
void (*add_window) (MetaCompositor *compositor,
MetaWindow *window,
Window xwindow,
XWindowAttributes *attrs);
void (*remove_window) (MetaCompositor *compositor,
Window xwindow);
void (*set_updates) (MetaCompositor *compositor,
MetaWindow *window,
gboolean update);
void (*process_event) (MetaCompositor *compositor,
XEvent *event,
MetaWindow *window);
Pixmap (*get_window_pixmap) (MetaCompositor *compositor,
MetaWindow *window);
void (*set_active_window) (MetaCompositor *compositor,
MetaScreen *screen,
MetaWindow *window);
};
#endif
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* 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_XRENDER_H_
#define META_COMPOSITOR_XRENDER_H_
#include "types.h"
MetaCompositor *meta_compositor_xrender_new (MetaDisplay *display);
#endif
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2008 Iain Holmes
*
* 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.
*/
#include <config.h>
#include "compositor-private.h"
MetaCompositor *
meta_compositor_new (MetaDisplay *display)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
/* At some point we would have a way to select between backends */
return meta_compositor_xrender_new (display);
#else
return NULL;
#endif
}
void
meta_compositor_destroy (MetaCompositor *compositor)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->destroy)
compositor->destroy (compositor);
#endif
}
void
meta_compositor_add_window (MetaCompositor *compositor,
MetaWindow *window,
Window xwindow,
XWindowAttributes *attrs)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->add_window)
compositor->add_window (compositor, window, xwindow, attrs);
#endif
}
void
meta_compositor_remove_window (MetaCompositor *compositor,
Window xwindow)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->remove_window)
compositor->remove_window (compositor, xwindow);
#endif
}
void
meta_compositor_manage_screen (MetaCompositor *compositor,
MetaScreen *screen)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->manage_screen)
compositor->manage_screen (compositor, screen);
#endif
}
void
meta_compositor_unmanage_screen (MetaCompositor *compositor,
MetaScreen *screen)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->unmanage_screen)
compositor->unmanage_screen (compositor, screen);
#endif
}
void
meta_compositor_set_updates (MetaCompositor *compositor,
MetaWindow *window,
gboolean updates)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->set_updates)
compositor->set_updates (compositor, window, updates);
#endif
}
void
meta_compositor_process_event (MetaCompositor *compositor,
XEvent *event,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->process_event)
compositor->process_event (compositor, event, window);
#endif
}
Pixmap
meta_compositor_get_window_pixmap (MetaCompositor *compositor,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->get_window_pixmap)
compositor->get_window_pixmap (compositor, window);
else
return None;
#else
return None;
#endif
}
void
meta_compositor_set_active_window (MetaCompositor *compositor,
MetaScreen *screen,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
if (compositor->set_active_window)
compositor->set_active_window (compositor, screen, window);
#endif
}
/* These functions are unused at the moment */
void meta_compositor_begin_move (MetaCompositor *compositor,
MetaWindow *window,
MetaRectangle *initial,
int grab_x,
int grab_y)
{
}
void meta_compositor_update_move (MetaCompositor *compositor,
MetaWindow *window,
int x,
int y)
{
}
void meta_compositor_end_move (MetaCompositor *compositor,
MetaWindow *window)
{
}
void meta_compositor_free_window (MetaCompositor *compositor,
MetaWindow *window)
{
}
......@@ -52,7 +52,7 @@
#include <config.h>
#include "bell.h"
#include "screen.h"
#include "screen-private.h"
#include "prefs.h"
/**
......
......@@ -24,8 +24,8 @@
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif
#include "display.h"
#include "frame.h"
#include "display-private.h"
#include "frame-private.h"
#ifdef HAVE_XKB
void meta_bell_notify (MetaDisplay *display, XkbAnyEvent *xkb_ev);
......
......@@ -26,8 +26,8 @@
#define META_CONSTRAINTS_H
#include "util.h"
#include "window.h"
#include "frame.h"
#include "window-private.h"
#include "frame-private.h"
typedef enum
{
......
......@@ -25,7 +25,7 @@
#include <config.h>
#include "core.h"
#include "frame.h"
#include "frame-private.h"
#include "workspace.h"
#include "prefs.h"
......
......@@ -27,7 +27,7 @@
#include <config.h>
#include "util.h"
#include "window.h"
#include "window-private.h"
#include "errors.h"
#include "workspace.h"
......
......@@ -24,8 +24,8 @@
* 02111-1307, USA.
*/
#ifndef META_DISPLAY_H
#define META_DISPLAY_H
#ifndef META_DISPLAY_PRIVATE_H
#define META_DISPLAY_PRIVATE_H
#ifndef PACKAGE
#error "config.h not included"
......@@ -36,6 +36,7 @@
#include "eventqueue.h"
#include "common.h"
#include "boxes.h"
#include "display.h"
#ifdef HAVE_STARTUP_NOTIFICATION
#include <libsn/sn.h>
......@@ -45,16 +46,9 @@
#include <X11/extensions/sync.h>
#endif
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
typedef struct _MetaCompositor MetaCompositor;
typedef struct _MetaDisplay MetaDisplay;
typedef struct _MetaFrame MetaFrame;
typedef struct _MetaKeyBinding MetaKeyBinding;
typedef struct _MetaScreen MetaScreen;
typedef struct _MetaStack MetaStack;
typedef struct _MetaUISlave MetaUISlave;
typedef struct _MetaWindow MetaWindow;
typedef struct _MetaWorkspace MetaWorkspace;
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
......@@ -330,8 +324,6 @@ struct _MetaDisplay
gboolean meta_display_open (void);
void meta_display_close (MetaDisplay *display,
guint32 timestamp);
MetaScreen* meta_display_screen_for_root (MetaDisplay *display,
Window xroot);
MetaScreen* meta_display_screen_for_x_screen (MetaDisplay *display,
Screen *screen);
MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display,
......
......@@ -31,14 +31,14 @@
*/
#include <config.h>
#include "display.h"
#include "display-private.h"
#include "util.h"
#include "main.h"
#include "screen.h"
#include "window.h"
#include "screen-private.h"
#include "window-private.h"
#include "window-props.h"
#include "group-props.h"
#include "frame.h"
#include "frame-private.h"
#include "errors.h"
#include "keybindings.h"
#include "prefs.h"
......@@ -5115,3 +5115,54 @@ meta_display_remove_autoraise_callback (MetaDisplay *display)
display->autoraise_window = NULL;
}
}
void
meta_display_get_compositor_version (MetaDisplay *display,
int *major,
int *minor)
{
*major = display->composite_major_version;
*minor = display->composite_minor_version;
}
Display *
meta_display_get_xdisplay (MetaDisplay *display)
{
return display->xdisplay;
}
MetaCompositor *
meta_display_get_compositor (MetaDisplay *display)
{
return display->compositor;
}
GSList *
meta_display_get_screens (MetaDisplay *display)
{
return display->screens;
}
gboolean
meta_display_has_shape (MetaDisplay *display)
{
return META_DISPLAY_HAS_SHAPE (display);
}
MetaWindow *
meta_display_get_focus_window (MetaDisplay *display)
{
return display->focus_window;
}
int
meta_display_get_damage_event_base (MetaDisplay *display)
{
return display->damage_event_base;
}
int
meta_display_get_shape_event_base (MetaDisplay *display)
{
return display->shape_event_base;
}
......@@ -21,9 +21,10 @@
* 02111-1307, USA.
*/
#include <config.h>
#include "edge-resistance.h"
#include "boxes.h"
#include "display.h"
#include "display-private.h"
#include "workspace.h"
/* A simple macro for whether a given window's edges are potentially
......
......@@ -24,7 +24,7 @@
#ifndef META_EDGE_RESISTANCE_H
#define META_EDGE_RESISTANCE_H
#include "window.h"
#include "window-private.h"
void meta_window_edge_resistance_for_move (MetaWindow *window,
int old_x,
......
......@@ -33,9 +33,9 @@
#include <config.h>
#include "effects.h"
#include "display.h"
#include "display-private.h"
#include "ui.h"
#include "window.h"
#include "window-private.h"
#ifdef HAVE_SHAPE
#include <X11/extensions/shape.h>
......
......@@ -25,7 +25,7 @@
#define META_EFFECTS_H
#include "util.h"
#include "screen.h"
#include "screen-private.h"
typedef struct MetaEffect MetaEffect;
typedef struct MetaEffectPriv MetaEffectPriv;
......
......@@ -24,6 +24,7 @@
#include <config.h>
#include "errors.h"
#include "display-private.h"
#include <errno.h>
#include <stdlib.h>
#include <gdk/gdk.h>
......
......@@ -21,10 +21,11 @@
* 02111-1307, USA.
*/
#ifndef META_FRAME_H
#define META_FRAME_H
#ifndef META_FRAME_PRIVATE_H
#define META_FRAME_PRIVATE_H
#include "window.h"
#include "frame.h"
#include "window-private.h"
typedef struct _MetaFrameGeometry MetaFrameGeometry;
......
......@@ -24,7 +24,7 @@
*/
#include <config.h>
#include "frame.h"
#include "frame-private.h"
#include "bell.h"
#include "errors.h"
#include "keybindings.h"
......@@ -413,3 +413,8 @@ meta_frame_set_screen_cursor (MetaFrame *frame,
}
}
Window
meta_frame_get_xwindow (MetaFrame *frame)
{
return frame->xwindow;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment