X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FGenericBackend.java;h=908be1ef8c60400c5f3db36ef34bc62ef8b032b5;hb=a69ed767c9c07cf35cf1c5f7821fc009cfe79cd2;hp=bf27e947607f1c7bea073b4edac0689f300e6067;hpb=88a99379dca67603ee80819cb31716e52aa72362;p=nikiroo-utils.git diff --git a/src/jexer/backend/GenericBackend.java b/src/jexer/backend/GenericBackend.java index bf27e94..908be1e 100644 --- a/src/jexer/backend/GenericBackend.java +++ b/src/jexer/backend/GenericBackend.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -39,11 +39,33 @@ import jexer.event.TInputEvent; */ public abstract class GenericBackend implements Backend { + // ------------------------------------------------------------------------ + // Variables -------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * The session information. */ protected SessionInfo sessionInfo; + /** + * The screen to draw on. + */ + protected Screen screen; + + /** + * Input events are processed by this Terminal. + */ + protected TerminalReader terminal; + + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Backend ---------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * Getter for sessionInfo. * @@ -53,11 +75,6 @@ public abstract class GenericBackend implements Backend { return sessionInfo; } - /** - * The screen to draw on. - */ - protected Screen screen; - /** * Getter for screen. * @@ -75,9 +92,13 @@ public abstract class GenericBackend implements Backend { } /** - * Input events are processed by this Terminal. + * Check if there are events in the queue. + * + * @return if true, getEvents() has something to return to the application */ - protected TerminalReader terminal; + public boolean hasEvents() { + return terminal.hasEvents(); + } /** * Get keyboard, mouse, and screen resize events.