@@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5353#include " df/renderer_2d.h"
5454#include < VTableInterpose.h>
5555
56- #include " Console .h"
56+ #include " SDLConsoleDriver .h"
5757#include " SDLConsole.h"
5858
5959using namespace DFHack ;
@@ -232,14 +232,14 @@ namespace DFHack
232232 };
233233}
234234
235- Console::Console ()
235+ SDLConsoleDriver::SDLConsoleDriver ()
236236{
237237 d = new Private ();
238238 inited.store (false );
239239 // we can't create the mutex at this time. the SDL functions aren't hooked yet.
240240 wlock = new std::recursive_mutex ();
241241}
242- Console ::~Console ()
242+ SDLConsoleDriver ::~SDLConsoleDriver ()
243243{
244244 assert (!inited);
245245 if (wlock)
@@ -252,7 +252,7 @@ Console::~Console()
252252 * FIXME: Two-stage init because we need to initialize on
253253 * the main thread, but interpose isn't available until later.
254254 */
255- bool Console ::init (bool dont_redirect)
255+ bool SDLConsoleDriver ::init (bool dont_redirect)
256256{
257257 static int init_stage = 0 ;
258258
@@ -276,7 +276,7 @@ bool Console::init(bool dont_redirect)
276276 return inited.load ();
277277}
278278
279- bool Console ::shutdown (void )
279+ bool SDLConsoleDriver ::shutdown (void )
280280{
281281 if (!inited.load ()) return true ;
282282 d->con .shutdown ();
@@ -288,22 +288,22 @@ bool Console::shutdown(void)
288288 * This should be for guarding against interleaving prints to the console.
289289 * The begin_batch() and end_batch() pair does the job on its own.
290290 */
291- void Console ::begin_batch ()
291+ void SDLConsoleDriver ::begin_batch ()
292292{
293293 wlock->lock ();
294294}
295295
296- void Console ::end_batch ()
296+ void SDLConsoleDriver ::end_batch ()
297297{
298298 wlock->unlock ();
299299}
300300
301301/* Don't think we need this? */
302- void Console ::flush_proxy ()
302+ void SDLConsoleDriver ::flush_proxy ()
303303{
304304}
305305
306- void Console ::add_text (color_value color, const std::string &text)
306+ void SDLConsoleDriver ::add_text (color_value color, const std::string &text)
307307{
308308 // I don't think this lock is needed, unless to prevent
309309 // interleaving prints. But we have batch for that?
@@ -314,33 +314,33 @@ void Console::add_text(color_value color, const std::string &text)
314314 fwrite (text.data (), 1 , text.size (), stderr);
315315}
316316
317- int Console ::get_columns (void )
317+ int SDLConsoleDriver ::get_columns (void )
318318{
319319 // returns Console::FAILURE if inactive
320320 return d->con .get_columns ();
321321}
322322
323- int Console ::get_rows (void )
323+ int SDLConsoleDriver ::get_rows (void )
324324{
325325 // returns Console::FAILURE if inactive
326326 return d->con .get_rows ();
327327}
328328
329- void Console ::clear ()
329+ void SDLConsoleDriver ::clear ()
330330{
331331 d->con .clear ();
332332}
333333/* XXX: Not implemented */
334- void Console ::gotoxy (int x, int y)
334+ void SDLConsoleDriver ::gotoxy (int x, int y)
335335{
336336}
337337/* XXX: Not implemented */
338- void Console ::cursor (bool enable)
338+ void SDLConsoleDriver ::cursor (bool enable)
339339{
340340 d->cursor (enable);
341341}
342342
343- int Console ::lineedit (const std::string & prompt, std::string & output, CommandHistory & ch)
343+ int SDLConsoleDriver ::lineedit (const std::string & prompt, std::string & output, CommandHistory & ch)
344344{
345345 // Tell fiothread we are done.
346346 if (!inited.load ())
@@ -349,18 +349,18 @@ int Console::lineedit(const std::string & prompt, std::string & output, CommandH
349349 return d->lineedit (prompt,output,ch);
350350}
351351
352- void Console ::msleep (unsigned int msec)
352+ void SDLConsoleDriver ::msleep (unsigned int msec)
353353{
354354 std::this_thread::sleep_for (std::chrono::milliseconds (msec));
355355}
356356
357- bool Console ::hide ()
357+ bool SDLConsoleDriver ::hide ()
358358{
359359 d->con .hide_window ();
360360 return true ;
361361}
362362
363- bool Console ::show ()
363+ bool SDLConsoleDriver ::show ()
364364{
365365 d->con .show_window ();
366366 return true ;
@@ -373,7 +373,7 @@ bool Console::show()
373373 * NOTE: We do not absolutely have to clean up here. It can be done at exit.
374374 * This is for the ability to shutdown and restart the console at run time.
375375 */
376- bool Console ::sdl_event_hook (SDL_Event &e)
376+ bool SDLConsoleDriver ::sdl_event_hook (SDL_Event &e)
377377{
378378 auto & con = d->con ;
379379 if (con.state .is_active ()) {
@@ -388,7 +388,7 @@ bool Console::sdl_event_hook(SDL_Event &e)
388388 * Cleanup must be done from the main thread.
389389 * NOTE: may be able to do this in the destructor instead.
390390 */
391- void Console ::cleanup ()
391+ void SDLConsoleDriver ::cleanup ()
392392{
393393 INTERPOSE_HOOK (con_render_hook,render).apply (false );
394394 // destroy() will change console's state to inactive
0 commit comments