Fresco/Berlin/include/Berlin/Console DirectBuffer.hh,1.4,1.5 GGIDrawableFactory.hh,1.3,1.4 GLContext.hh,1.5,1.6 Renderer.hh,1.3,1.4 SHMDrawableFactory.hh,1.2,1.3
Tobias Hunger <[email protected]> Mon, 29 Dec 2003 09:04:24 +0100
| Newsgroups | gmane.comp.video.fresco.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/fresco/Fresco/Berlin/include/Berlin/Console
In directory purcel:/tmp/cvs-serv30213/include/Berlin/Console
Modified Files:
DirectBuffer.hh GGIDrawableFactory.hh GLContext.hh Renderer.hh
SHMDrawableFactory.hh
Log Message:
* Styleguidify Berlin
* Add namespace Berlin
Both patches are mixed into one since I did not want to commit two such
large and disruptive patches.
Index: DirectBuffer.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Console/DirectBuffer.hh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- DirectBuffer.hh 29 May 2002 06:56:34 -0000 1.4
+++ DirectBuffer.hh 29 Dec 2003 08:03:19 -0000 1.5
@@ -20,61 +20,63 @@
* MA 02139, USA.
*/
-#ifndef _Console_DirectBuffer_hh
-#define _Console_DirectBuffer_hh
+#ifndef _Berlin_Console_DirectBuffer_hh
+#define _Berlin_Console_DirectBuffer_hh
#include <Berlin/config.hh>
#include <Berlin/Console.hh>
-class DirectBuffer : virtual public Console::Drawable::Extension
+namespace Berlin
{
-public:
- typedef Console::Drawable::data_type data_type;
-
- class Guard
+ namespace Console_Extension
{
- public:
- Guard(const Console::Drawable *drawable, data_type *data)
- : _drawable(drawable), _data(data)
- {
- }
-
- ~Guard()
- {
- }
- Guard(const Guard &buffer)
- {
- _data = buffer.release();
- _drawable = buffer._drawable;
- }
- Guard &operator = (const Guard &buffer)
- {
- _data = buffer.release();
- _drawable = buffer._drawable;
- return *this;
- }
-
- data_type *get() const
+ class DirectBuffer : virtual public Console::Drawable::Extension
{
- return _data;
- }
+ public:
+ typedef Console::Drawable::data_type data_type;
+
+ class Guard
+ {
+ public:
+ Guard(const Console::Drawable *drawable, data_type *data) :
+ my_drawable(drawable), my_data(data)
+ { }
+
+ ~Guard() { }
+
+ Guard(const Guard &buffer)
+ {
+ my_data = buffer.release();
+ my_drawable = buffer.my_drawable;
+ }
+ Guard &operator = (const Guard &buffer)
+ {
+ my_data = buffer.release();
+ my_drawable = buffer.my_drawable;
+ return *this;
+ }
- data_type *release() const
- {
- data_type *tmp = _data;
- _data = 0;
- return tmp;
- }
- private:
- const Console::Drawable *_drawable;
- mutable data_type *_data;
- };
+ data_type *get() const { return my_data; }
+
+ data_type *release() const
+ {
+ data_type *tmp = my_data;
+ my_data = 0;
+ return tmp;
+ }
+ private:
+ const Console::Drawable *my_drawable;
+ mutable data_type *my_data;
+ };
+
+ //. Get the read buffer for this Drawable
+ virtual Guard read_buffer() = 0;
+ //. Get the write buffer for this Drawable
+ virtual Guard write_buffer() = 0;
+ };
- //. Get the read buffer for this Drawable
- virtual Guard read_buffer() = 0;
- //. Get the write buffer for this Drawable
- virtual Guard write_buffer() = 0;
-};
+ } // namespace
+} // namespace
#endif
Index: GGIDrawableFactory.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Console/GGIDrawableFactory.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- GGIDrawableFactory.hh 29 May 2002 06:56:34 -0000 1.3
+++ GGIDrawableFactory.hh 29 Dec 2003 08:03:19 -0000 1.4
@@ -20,8 +20,8 @@
* MA 02139, USA.
*/
-#ifndef _Console_GGIDrawableFactory_hh
-#define _Console_GGIDrawableFactory_hh
+#ifndef _Berlin_Console_GGIDrawableFactory_hh
+#define _Berlin_Console_GGIDrawableFactory_hh
#include <Berlin/config.hh>
#include <Berlin/Console.hh>
@@ -31,23 +31,31 @@
#include <ggi/ggi-unix.h>
}
-class GGIDrawable : public virtual ::Console::Drawable
+namespace Berlin
{
-public:
- virtual const std::string &name() const = 0;
- virtual ggi_mode mode() const = 0;
- virtual ggi_visual_t visual() const = 0;
-};
+ namespace Console_Extension
+ {
-class GGIDrawableFactory : virtual public Console::Extension
-{
-public:
- //. Creates a new Drawable of the given size (x, y) and depth. It is accessable
- //. under the given shm-id.
- virtual GGIDrawable *create_drawable(int shmid,
- Fresco::PixelCoord,
- Fresco::PixelCoord,
- Fresco::PixelCoord) = 0;
-};
+ class GGIDrawable : public virtual Berlin::Console::Drawable
+ {
+ public:
+ virtual const std::string &name() const = 0;
+ virtual ggi_mode mode() const = 0;
+ virtual ggi_visual_t visual() const = 0;
+ };
+
+ class GGIDrawableFactory : virtual public Berlin::Console::Extension
+ {
+ public:
+ //. Creates a new Drawable of the given size (x, y) and depth.
+ //. It is accessable under the given shm-id.
+ virtual GGIDrawable *create_drawable(int shmid,
+ Fresco::PixelCoord,
+ Fresco::PixelCoord,
+ Fresco::PixelCoord) = 0;
+ };
+
+ } // namespace
+} // namespace
#endif
Index: GLContext.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Console/GLContext.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- GLContext.hh 27 Oct 2003 17:08:34 -0000 1.5
+++ GLContext.hh 29 Dec 2003 08:03:19 -0000 1.6
@@ -26,15 +26,24 @@
#include <Berlin/config.hh>
#include <Berlin/Console.hh>
-class GLContext : public virtual Console::Extension
+namespace Berlin
{
-public:
- class Callback {
- public:
- virtual void operator()() = 0;
- };
- virtual void add_to_queue(Callback *) = 0;
- virtual void flush() = 0;
-};
+ namespace Console_Extension
+ {
+
+ class GLContext : public virtual Console::Extension
+ {
+ public:
+ class Callback
+ {
+ public:
+ virtual void operator()() = 0;
+ };
+ virtual void add_to_queue(Callback *) = 0;
+ virtual void flush() = 0;
+ };
+
+ } // namespace
+} // namespace
#endif
Index: Renderer.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Console/Renderer.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Renderer.hh 29 May 2002 06:56:34 -0000 1.3
+++ Renderer.hh 29 Dec 2003 08:03:19 -0000 1.4
@@ -26,40 +26,52 @@
#include <Berlin/config.hh>
#include <Berlin/Console.hh>
-class Renderer : virtual public Console::Drawable::Extension
+namespace Berlin
{
-public:
- //. Set the color used for all drawing operations to the one given.
- virtual void set_color(const Fresco::Color &) = 0;
-
- //. Set the pixel at the given position to the current drawing color.
- virtual void draw_pixel(Fresco::PixelCoord, //.< x position
- Fresco::PixelCoord) = 0; //.< y position
+ namespace Console_Extension
+ {
+
+ class Renderer : virtual public Console::Drawable::Extension
+ {
+ public:
+ //. Set the color used for all drawing operations to the one given.
+ virtual void set_color(const Fresco::Color &) = 0;
+
+ //. Set the pixel at the given position to the current drawing
+ //. color.
+ virtual void draw_pixel(Fresco::PixelCoord, //.< x position
+ Fresco::PixelCoord) = 0; //.< y position
+
+ //. Draw a horizontal line starting at the given position with the
+ //. given length using the current drawing color. The line is one
+ //. pixel thick.
+ virtual void draw_hline(Fresco::PixelCoord, //. x position of one end
+ Fresco::PixelCoord, //.< y position
+ Fresco::PixelCoord) = 0; //.< width of the line
+ //. Draw a vertical line starting at the given position with the
+ //. given length using the current drawing color. The line is one
+ //. pixel thick.
+ virtual void draw_vline(Fresco::PixelCoord, //. x positon
+ Fresco::PixelCoord, //. y position of one end
+ Fresco::PixelCoord) = 0; //.< height of the line
+ //. Draw a line starting at the given position using the current
+ //. drawing color. The line is one pixel thick and exact (no more
+ //. then 0.5 pixels from the 'real' position away). It starts at
+ //. the given position and ends at (x + delta_x, y + delta_y).
+ virtual void draw_line(Fresco::PixelCoord, //.< x position of one end
+ Fresco::PixelCoord, //.< y position of that end
+ Fresco::PixelCoord, //.< delta_x
+ Fresco::PixelCoord) = 0; //.< delta_y
+ //. Draws a rectangle filled with the current drawing color. One
+ //. corner of it is at the given position and it has the given
+ //. width and height.
+ virtual void draw_box(Fresco::PixelCoord, //.< x position of a corner
+ Fresco::PixelCoord, //.< y position of that corner
+ Fresco::PixelCoord, //.< width
+ Fresco::PixelCoord) = 0; //.< height
+ };
- //. Draw a horizontal line starting at the given position with the given length
- //. using the current drawing color. The line is one pixel thick.
- virtual void draw_hline(Fresco::PixelCoord, //. x position of one end
- Fresco::PixelCoord, //.< y position
- Fresco::PixelCoord) = 0; //.< width of the line
- //. Draw a vertical line starting at the given position with the given length
- //. using the current drawing color. The line is one pixel thick.
- virtual void draw_vline(Fresco::PixelCoord, //. x positon
- Fresco::PixelCoord, //. y position of one end
- Fresco::PixelCoord) = 0; //.< height of the line
- //. Draw a line starting at the given position using the current drawing color.
- //. The line is one pixel thick and exact (no more then 0.5 pixels from the
- //. 'real' position away). It starts at the given position and ends at
- //. (x + delta_x, y + delta_y).
- virtual void draw_line(Fresco::PixelCoord, //.< x position of one end
- Fresco::PixelCoord, //.< y position of that end
- Fresco::PixelCoord, //.< delta_x
- Fresco::PixelCoord) = 0; //.< delta_y
- //. Draws a rectangle filled with the current drawing color. One corner of it is
- //. at the given position and it has the given width and height.
- virtual void draw_box(Fresco::PixelCoord, //.< x position of a corner
- Fresco::PixelCoord, //.< y position of that corner
- Fresco::PixelCoord, //.< width
- Fresco::PixelCoord) = 0; //.< height
-};
+ } // namespace
+} // namespace
#endif
Index: SHMDrawableFactory.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Console/SHMDrawableFactory.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SHMDrawableFactory.hh 29 May 2002 06:56:34 -0000 1.2
+++ SHMDrawableFactory.hh 29 Dec 2003 08:03:19 -0000 1.3
@@ -26,15 +26,23 @@
#include <Berlin/config.hh>
#include <Berlin/Console.hh>
-class SHMDrawableFactory : virtual public Console::Extension
+namespace Berlin
{
-public:
- //. Creates a new Drawable of the given size (x, y) and depth. It is accessable
- //. under the given shm-id.
- virtual Console::Drawable *create_drawable(int shmid,
- Fresco::PixelCoord,
- Fresco::PixelCoord,
- Fresco::PixelCoord) = 0;
-};
+ namespace Console_Extension
+ {
+
+ class SHMDrawableFactory : virtual public Console::Extension
+ {
+ public:
+ //. Creates a new Drawable of the given size (x, y) and depth. It
+ //. is accessable under the given shm-id.
+ virtual Console::Drawable *create_drawable(int shmid,
+ Fresco::PixelCoord,
+ Fresco::PixelCoord,
+ Fresco::PixelCoord) = 0;
+ };
+
+ } // namespace
+} // namespace
#endif