summaryrefslogtreecommitdiff
path: root/libwinnie/src
diff options
context:
space:
mode:
Diffstat (limited to 'libwinnie/src')
-rw-r--r--libwinnie/src/gfx.cc1
-rw-r--r--libwinnie/src/gfx.h52
-rw-r--r--libwinnie/src/sdl/gfx.cc2
-rw-r--r--libwinnie/src/sdl/gfx.h32
-rw-r--r--libwinnie/src/winnie.cc12
-rw-r--r--libwinnie/src/winnie.h8
-rw-r--r--libwinnie/src/wm.cc1
7 files changed, 60 insertions, 48 deletions
diff --git a/libwinnie/src/gfx.cc b/libwinnie/src/gfx.cc
index a054e4c..0ecf8ed 100644
--- a/libwinnie/src/gfx.cc
+++ b/libwinnie/src/gfx.cc
@@ -24,6 +24,7 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
#include <string.h>
#include "geom.h"
+#include "gfx.h"
#include "sdl/gfx.h"
// used by the polygon rasterizer
diff --git a/libwinnie/src/gfx.h b/libwinnie/src/gfx.h
new file mode 100644
index 0000000..2d77fce
--- /dev/null
+++ b/libwinnie/src/gfx.h
@@ -0,0 +1,52 @@
+/*
+winnie - an experimental window system
+
+Copyright (C) 2013 Eleni Maria Stea
+
+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 3 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, see <http://www.gnu.org/licenses/>.
+
+Author: Eleni Maria Stea <elene.mst@gmail.com>
+*/
+
+#ifndef GFX_H_
+#define GFX_H_
+
+#include "geom.h"
+#include "pixmap.h"
+void clear_screen(int r, int g, int b);
+void fill_rect(const Rect &rect, int r, int g, int b);
+
+void blit(unsigned char *src_img,
+ const Rect &src_rect,
+ unsigned char *dest_img,
+ const Rect &dest_rect,
+ int dest_x,
+ int dest_y);
+void blit_key(unsigned char *src_img,
+ const Rect &src_rect,
+ unsigned char *dest_img,
+ const Rect &dest_rect,
+ int dest_x,
+ int dest_y,
+ int key_r,
+ int key_g,
+ int key_b);
+
+void
+draw_line(Pixmap *pixmap, int x0, int y0, int x1, int y1, int r, int g, int b);
+void draw_polygon(
+ Pixmap *pixmap, int *vpos, int *vtex, int num_verts, int r, int g, int b);
+
+void gfx_update(const Rect &rect);
+#endif // GFX_H_
diff --git a/libwinnie/src/sdl/gfx.cc b/libwinnie/src/sdl/gfx.cc
index 531eb58..644c9d4 100644
--- a/libwinnie/src/sdl/gfx.cc
+++ b/libwinnie/src/sdl/gfx.cc
@@ -25,7 +25,7 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
#include <stdio.h>
#include <stdlib.h>
-#include "sdl/gfx.h"
+#include "gfx.h"
#include "winnie.h"
static SDL_Surface *fbsurf;
diff --git a/libwinnie/src/sdl/gfx.h b/libwinnie/src/sdl/gfx.h
index 3674d86..36e7e36 100644
--- a/libwinnie/src/sdl/gfx.h
+++ b/libwinnie/src/sdl/gfx.h
@@ -19,11 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Author: Eleni Maria Stea <elene.mst@gmail.com>
*/
-#ifndef GFX_H_
-#define GFX_H_
+#ifndef _SDL_GFX_H_
+#define _SDL_GFX_H_
-#include "geom.h"
-#include "pixmap.h"
+#include "../pixmap.h"
bool init_gfx();
void destroy_gfx();
@@ -37,33 +36,8 @@ int get_color_depth();
void set_clipping_rect(const Rect &clip_rect);
const Rect &get_clipping_rect();
-void clear_screen(int r, int g, int b);
-void fill_rect(const Rect &rect, int r, int g, int b);
-
void set_cursor_visibility(bool visible);
-void blit(unsigned char *src_img,
- const Rect &src_rect,
- unsigned char *dest_img,
- const Rect &dest_rect,
- int dest_x,
- int dest_y);
-
-void blit_key(unsigned char *src_img,
- const Rect &src_rect,
- unsigned char *dest_img,
- const Rect &dest_rect,
- int dest_x,
- int dest_y,
- int key_r,
- int key_g,
- int key_b);
-
-void
-draw_line(Pixmap *pixmap, int x0, int y0, int x1, int y1, int r, int g, int b);
-void draw_polygon(
- Pixmap *pixmap, int *vpos, int *vtex, int num_verts, int r, int g, int b);
-
void gfx_update(const Rect &rect);
void wait_vsync(); // vertical synchronization
diff --git a/libwinnie/src/winnie.cc b/libwinnie/src/winnie.cc
index 5023978..69f1510 100644
--- a/libwinnie/src/winnie.cc
+++ b/libwinnie/src/winnie.cc
@@ -28,6 +28,7 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
#include <sys/mman.h>
#include <sys/time.h>
+#include "sdl/gfx.h"
#include "sdl/keyboard.h"
#include "sdl/mouse.h"
#include "winnie.h"
@@ -69,17 +70,6 @@ winnie_shutdown()
destroy_window_manager();
}
-bool
-winnie_open()
-{
- return true;
-}
-
-void
-winnie_close()
-{
-}
-
long
winnie_get_time()
{
diff --git a/libwinnie/src/winnie.h b/libwinnie/src/winnie.h
index 263c657..104b028 100644
--- a/libwinnie/src/winnie.h
+++ b/libwinnie/src/winnie.h
@@ -22,11 +22,8 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
#ifndef WINNIE_H_
#define WINNIE_H_
-#include "geom.h"
-#include "sdl/event.h"
+#include "gfx.h"
#include "sdl/gfx.h"
-#include "sdl/keyboard.h"
-#include "sdl/mouse.h"
#include "text.h"
#include "window.h"
#include "wm.h"
@@ -34,9 +31,6 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
bool winnie_init();
void winnie_shutdown();
-bool winnie_open();
-void winnie_close();
-
long winnie_get_time();
#endif
diff --git a/libwinnie/src/wm.cc b/libwinnie/src/wm.cc
index 315d599..25a7e43 100644
--- a/libwinnie/src/wm.cc
+++ b/libwinnie/src/wm.cc
@@ -25,6 +25,7 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
#include <stdint.h>
#include <stdio.h>
+#include "gfx.h"
#include "mouse_cursor.h"
#include "sdl/gfx.h"
#include "sdl/mouse.h"