aboutsummaryrefslogtreecommitdiff
path: root/util/fbcompose/OpenGLPlugin.cc
diff options
context:
space:
mode:
authorGediminas Liktaras <gliktaras@gmail.com>2011-12-08 13:34:09 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2011-12-10 16:13:19 (GMT)
commitcd339169d1961eb508ea89cee2609ec6d0fc0c15 (patch)
tree01acd158a03fb17a72e067ff0b36701da75e49dc /util/fbcompose/OpenGLPlugin.cc
parent85ac5c4b2c6a526992f483a6e91867dc2f82a19e (diff)
downloadfluxbox_paul-cd339169d1961eb508ea89cee2609ec6d0fc0c15.zip
fluxbox_paul-cd339169d1961eb508ea89cee2609ec6d0fc0c15.tar.bz2
fbcompose - A compositing addon for fluxbox window manager.
fbcompose(1) is an optional compositing addon for fluxbox window manager. It augments fluxbox with a number of graphical features. Most notably, fbcompose allows fluxbox to properly display applications that require compositing (docky, for example), adds support for true window transparency (as opposed to fluxbox's pseudo transparency) and provides a plugin framework to extend the compositor's functionality. As this is still a beta version of the compositor, the bugs are likely.
Diffstat (limited to 'util/fbcompose/OpenGLPlugin.cc')
-rw-r--r--util/fbcompose/OpenGLPlugin.cc111
1 files changed, 111 insertions, 0 deletions
diff --git a/util/fbcompose/OpenGLPlugin.cc b/util/fbcompose/OpenGLPlugin.cc
new file mode 100644
index 0000000..3b42a88
--- /dev/null
+++ b/util/fbcompose/OpenGLPlugin.cc
@@ -0,0 +1,111 @@
1/** OpenGLPlugin.cc file for the fluxbox compositor. */
2
3// Copyright (c) 2011 Gediminas Liktaras (gliktaras at gmail dot com)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23
24#include "OpenGLPlugin.hh"
25
26#include "Exceptions.hh"
27#include "OpenGLScreen.hh"
28#include "OpenGLWindow.hh"
29
30using namespace FbCompositor;
31
32
33//--- CONSTRUCTORS AND DESTRUCTORS ---------------------------------------------
34
35// Costructor.
36OpenGLPlugin::OpenGLPlugin(const BaseScreen &screen, const std::vector<FbTk::FbString> &args) :
37 BasePlugin(screen, args) {
38}
39
40// Destructor.
41OpenGLPlugin::~OpenGLPlugin() { }
42
43
44//--- OTHER INITIALIZATION -----------------------------------------------------
45
46// Initialize OpenGL-specific code.
47void OpenGLPlugin::initOpenGL(OpenGLShaderProgramPtr /*shader_program*/) { }
48
49
50//--- ACCESSORS ----------------------------------------------------------------
51
52// Returns a reference screen object, cast into the correct class.
53const OpenGLScreen &OpenGLPlugin::openGLScreen() const {
54 static const OpenGLScreen &s = dynamic_cast<const OpenGLScreen&>(BasePlugin::screen());
55 return s;
56}
57
58
59//--- RENDERING ACTIONS --------------------------------------------------------
60
61// Background rendering initialization.
62void OpenGLPlugin::backgroundRenderInit(int /*part_id*/) { }
63
64// Background rendering cleanup.
65void OpenGLPlugin::backgroundRenderCleanup(int /*part_id*/) { }
66
67// Post background rendering actions.
68const std::vector<OpenGLRenderingJob> &OpenGLPlugin::postBackgroundRenderActions() {
69 static std::vector<OpenGLRenderingJob> jobs;
70 return jobs;
71}
72
73
74// Pre window rendering actions and jobs.
75const std::vector<OpenGLRenderingJob> &OpenGLPlugin::preWindowRenderActions(const OpenGLWindow &/*window*/) {
76 static std::vector<OpenGLRenderingJob> jobs;
77 return jobs;
78}
79
80// Window rendering initialization.
81void OpenGLPlugin::windowRenderInit(const OpenGLWindow &/*window*/, int /*part_id*/) { }
82
83// Window rendering cleanup.
84void OpenGLPlugin::windowRenderCleanup(const OpenGLWindow &/*window*/, int /*part_id*/) { }
85
86// Post window rendering actions and jobs.
87const std::vector<OpenGLRenderingJob> &OpenGLPlugin::postWindowRenderActions(const OpenGLWindow &/*window*/) {
88 static std::vector<OpenGLRenderingJob> jobs;
89 return jobs;
90}
91
92
93// Reconfigure rectangle rendering initialization.
94void OpenGLPlugin::recRectRenderInit(const XRectangle &/*rec_rect*/) { }
95
96// Reconfigure rectangle rendering cleanup.
97void OpenGLPlugin::recRectRenderCleanup(const XRectangle &/*rec_rect*/) { }
98
99
100// Extra rendering actions and jobs.
101const std::vector<OpenGLRenderingJob> &OpenGLPlugin::extraRenderingActions() {
102 static std::vector<OpenGLRenderingJob> jobs;
103 return jobs;
104}
105
106// Post extra rendering actions.
107void OpenGLPlugin::postExtraRenderingActions() { }
108
109
110// Null rendering job initialization.
111void OpenGLPlugin::nullRenderInit() { }