@@ -21,54 +21,60 @@ namespace DFHack
2121 SDL_Rect* rect; // from which coords (NULL to draw whole surface)
2222 SDL_Rect* dstResize; // if not NULL dst rect will be resized (x/y/w/h will be added to original dst)
2323 };
24+ }
2425
2526/* *
2627 * The DFSDL module - provides access to SDL functions without actually
2728 * requiring build-time linkage to SDL
2829 * \ingroup grp_modules
2930 * \ingroup grp_dfsdl
3031 */
31- namespace DFSDL
32+ namespace DFHack :: DFSDL
3233{
34+ /* *
35+ * Call this on DFHack init so we can load the SDL functions. Returns false on
36+ * failure.
37+ */
38+ bool init (DFHack::color_ostream& out);
3339
34- /* *
35- * Call this on DFHack init so we can load the SDL functions. Returns false on
36- * failure.
37- */
38- bool init (DFHack::color_ostream &out);
40+ /* *
41+ * Call this when DFHack is being unloaded.
42+ */
43+ void cleanup ();
3944
40- /* *
41- * Call this when DFHack is being unloaded.
42- */
43- void cleanup ();
45+ DFHACK_EXPORT SDL_Surface* DFIMG_Load (const char * file);
46+ DFHACK_EXPORT SDL_Surface* DFSDL_CreateRGBSurface (uint32_t flags, int width, int height, int depth, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask);
47+ DFHACK_EXPORT SDL_Surface* DFSDL_CreateRGBSurfaceFrom (void * pixels, int width, int height, int depth, int pitch, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask);
48+ DFHACK_EXPORT int DFSDL_UpperBlit (SDL_Surface* src, const SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect);
49+ DFHACK_EXPORT SDL_Surface* DFSDL_ConvertSurface (SDL_Surface* src, const SDL_PixelFormat* fmt, uint32_t flags);
50+ DFHACK_EXPORT void DFSDL_FreeSurface (SDL_Surface* surface);
51+ // DFHACK_EXPORT int DFSDL_SemWait(SDL_sem *sem);
52+ // DFHACK_EXPORT int DFSDL_SemPost(SDL_sem *sem);
53+ DFHACK_EXPORT int DFSDL_PushEvent (SDL_Event* event);
54+ DFHACK_EXPORT void DFSDL_free (void * ptr);
55+ DFHACK_EXPORT SDL_PixelFormat* DFSDL_AllocFormat (uint32_t pixel_format);
56+ DFHACK_EXPORT SDL_Surface* DFSDL_CreateRGBSurfaceWithFormat (uint32_t flags, int width, int height, int depth, uint32_t format);
57+ DFHACK_EXPORT int DFSDL_ShowSimpleMessageBox (uint32_t flags, const char * title, const char * message, SDL_Window* window);
4458
45- DFHACK_EXPORT SDL_Surface * DFIMG_Load (const char *file);
46- DFHACK_EXPORT SDL_Surface * DFSDL_CreateRGBSurface (uint32_t flags, int width, int height, int depth, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask);
47- DFHACK_EXPORT SDL_Surface * DFSDL_CreateRGBSurfaceFrom (void *pixels, int width, int height, int depth, int pitch, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask);
48- DFHACK_EXPORT int DFSDL_UpperBlit (SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
49- DFHACK_EXPORT SDL_Surface * DFSDL_ConvertSurface (SDL_Surface *src, const SDL_PixelFormat *fmt, uint32_t flags);
50- DFHACK_EXPORT void DFSDL_FreeSurface (SDL_Surface *surface);
51- // DFHACK_EXPORT int DFSDL_SemWait(SDL_sem *sem);
52- // DFHACK_EXPORT int DFSDL_SemPost(SDL_sem *sem);
53- DFHACK_EXPORT int DFSDL_PushEvent (SDL_Event *event);
54- DFHACK_EXPORT void DFSDL_free (void *ptr);
55- DFHACK_EXPORT SDL_PixelFormat* DFSDL_AllocFormat (uint32_t pixel_format);
56- DFHACK_EXPORT SDL_Surface* DFSDL_CreateRGBSurfaceWithFormat (uint32_t flags, int width, int height, int depth, uint32_t format);
57- DFHACK_EXPORT int DFSDL_ShowSimpleMessageBox (uint32_t flags, const char *title, const char *message, SDL_Window *window);
59+ // submitted and returned text is UTF-8
60+ // see wrapper functions below for cp-437 variants
61+ DFHACK_EXPORT char * DFSDL_GetClipboardText ();
62+ DFHACK_EXPORT int DFSDL_SetClipboardText (const char * text);
5863
59- // submitted and returned text is UTF-8
60- // see wrapper functions below for cp-437 variants
61- DFHACK_EXPORT char * DFSDL_GetClipboardText ();
62- DFHACK_EXPORT int DFSDL_SetClipboardText (const char *text);
64+ DFHACK_EXPORT char * DFSDL_GetPrefPath (const char * org, const char * app);
65+ DFHACK_EXPORT char * DFSDL_GetBasePath ();
6366
6467}
6568
66- // System clipboard -- submitted and returned text must be in CP437
67- DFHACK_EXPORT std::string getClipboardTextCp437 ();
68- DFHACK_EXPORT bool setClipboardTextCp437 (std::string text);
69+ namespace DFHack
70+ {
71+
72+ // System clipboard -- submitted and returned text must be in CP437
73+ DFHACK_EXPORT std::string getClipboardTextCp437 ();
74+ DFHACK_EXPORT bool setClipboardTextCp437 (std::string text);
6975
70- // interprets 0xa as newline instead of usual CP437 char
71- DFHACK_EXPORT bool getClipboardTextCp437Multiline (std::vector<std::string> * lines);
72- DFHACK_EXPORT bool setClipboardTextCp437Multiline (std::string text);
76+ // interprets 0xa as newline instead of usual CP437 char
77+ DFHACK_EXPORT bool getClipboardTextCp437Multiline (std::vector<std::string> * lines);
78+ DFHACK_EXPORT bool setClipboardTextCp437Multiline (std::string text);
7379
7480}
0 commit comments