summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/luma/main.h32
-rw-r--r--include/luma/main.hh25
-rw-r--r--include/luma/stdlibsock.hh (renamed from include/luma/stdlibsock.h)0
-rw-r--r--include/luma/stdlibsock/gfx.h7
-rw-r--r--include/luma/stdlibsock/gfx.hh13
5 files changed, 38 insertions, 39 deletions
diff --git a/include/luma/main.h b/include/luma/main.h
deleted file mode 100644
index 960ece1..0000000
--- a/include/luma/main.h
+++ /dev/null
@@ -1,32 +0,0 @@
-# if !defined(LUMA__HEADER__MAIN)
-# if (!defined(__STDC_VERSION__) && (__STDC_VERSION__ <= 201710L))
-# error The compiler seems to not have support for C17 or newer (__STDC_VERSION__ is less than 201710L), which is required to build Luma.
-# endif
-# define LUMA__HEADER__MAIN
-# define _ATFILE_SOURCE
-# define _FORTIFY_SOURCE 2
-# define _LARGEFILE_SOURCE
-# define _LARGEFILE64_SOURCE
-# define _ISOC99_SOURCE
-# define _ISOC11_SOURCE
-# define _ISOC2X_SOURCE
-# define _POSIX_C_SOURCE 200809L
-# define _XOPEN_SOURCE
-# define _XOPEN_SOURCE_EXTENDED
-# define __STDC_WANT_IEC_60559_BFP_EXT__
-# define __STDC_WANT_IEC_60559_FUNCS_EXT__
-# define __STDC_WANT_IEC_60559_TYPES_EXT__
-# define __STDC_WANT_LIB_EXT2__ 0x1
-# include <luma/stdlibsock.h>
-# include <luma/stdlibsock/gfx.h>
-# include <stdint.h>
-# include <xcb/xcb.h>
-struct luma__dat_t {
- char * dispsrv;
- xcb_connection_t * xconn;
- xcb_screen_t * xscrn;
- xcb_window_t xwin;
-};
-struct luma__dat_t extern luma__dat;
-void luma__initx(uint32_t * retval);
-# endif
diff --git a/include/luma/main.hh b/include/luma/main.hh
new file mode 100644
index 0000000..86b8e71
--- /dev/null
+++ b/include/luma/main.hh
@@ -0,0 +1,25 @@
+# if !defined(LUMA__HEADER__MAIN)
+# if defined(__cplusplus)
+# if __cplusplus < 202002L
+# error The compiler seems to not have support for C++20 or newer½ (__cplusplus is less than 202002L), which is required to build Luma.
+# endif
+# else
+# error The compiler appears to not support C++ at all (__cplusplus is not defined).
+# endif
+# define LUMA__HEADER__MAIN
+# include <cstdint>
+# include <luma/stdlibsock.hh>
+# include <luma/stdlibsock/gfx.hh>
+# include <string>
+# include <wayland-client.h>
+using namespace std::literals::string_literals;
+namespace luma {
+ class dat_t {
+ public:
+ char * dispsrv;
+ struct wl_display * wldisp;
+ };
+ luma::dat_t extern dat;
+ void initgfx(uint32_t * retval);
+}
+# endif
diff --git a/include/luma/stdlibsock.h b/include/luma/stdlibsock.hh
index 3224e09..3224e09 100644
--- a/include/luma/stdlibsock.h
+++ b/include/luma/stdlibsock.hh
diff --git a/include/luma/stdlibsock/gfx.h b/include/luma/stdlibsock/gfx.h
deleted file mode 100644
index bc36a07..0000000
--- a/include/luma/stdlibsock/gfx.h
+++ /dev/null
@@ -1,7 +0,0 @@
-# if !defined(LUMA__HEADER__STDLIBSOCK__GFX)
-# define LUMA__HEADER__STDLIBSOCK__GFX
-# include <stdbool.h>
-# include <stdint.h>
-uint8_t luma__stdlibsock__gfx__crtwin(char * nm, uint16_t pos_x, uint16_t pos_y, uint16_t res_x, uint16_t res_y, bool flscrn);
-void luma__stdlibsock__gfx__destwin(void);
-# endif
diff --git a/include/luma/stdlibsock/gfx.hh b/include/luma/stdlibsock/gfx.hh
new file mode 100644
index 0000000..a9d7805
--- /dev/null
+++ b/include/luma/stdlibsock/gfx.hh
@@ -0,0 +1,13 @@
+# if !defined(LUMA__HEADER__STDLIBSOCK__GFX)
+# define LUMA__HEADER__STDLIBSOCK__GFX
+# include <cstdint>
+# include <string>
+namespace luma {
+ namespace stdlibsock {
+ namespace gfx {
+ uint8_t crtwin(std::basic_string<char> nm, uint16_t pos_x, uint16_t pos_y, uint16_t res_x, uint16_t res_y, bool flscrn);
+ void destwin();
+ }
+ }
+}
+# endif