<commit_before>/* GG is a GUI for SDL and OpenGL.
   Copyright (C) 2003 <NAME>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.
   
   This library 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
   Lesser General Public License for more details.
    
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA

   If you do not wish to comply with the terms of the LGPL please
   contact the author as other terms are available for a fee.
    
   <NAME>
   <EMAIL> */
   
/* $Header$ */

#ifndef _GGApp_h_ 
#define _GGApp_h_

#ifndef _GGBase_h_
#include "GGBase.h"
#endif

#ifndef _GGText_h_
#include "GGText.h"
#endif

#ifndef _LOG4CPP_CATEGORY_HH
#include <log4cpp/Category.hh>
#endif

namespace GG {

class Wnd;
class Texture;
class XMLElement;
struct AppImplData;

/** An abstract base for an application framework class to drive the GG GUI.  
    This class has all the essential services that GG requires: 
    - application initialization and emergency exit
    - GG event handling
    - rendering of GUI windows
    - entry into and cleanup after a "2D" mode, in case the app also uses non-orthographic 3D projections
    - registration into, removal from, and movement within a z-ordering of windows, including handling of "always-on-top" windows
    - handling of modal windows
    - inter-frame time updates and FPS calculations
    - access to the dimensions of the application window or screen
    - mouse state information
    - application-wide management of fonts and textures
    - creation of polymorphic Wnd-derived objects from XML-formatted text
    - logging of debug info to log files
    
    The user is required to provide several functions.  The most vital functions the user is required to provide are: Enter2DMode(),
    Exit2DMode(), DeltaT(), PollAndRender() [virtual private], and Run() [virtual private].  Without these App is pretty useless.  
    In addition, HandleEvent() must be driven from PollAndRender().  The code driving HandleEvent() must interact with the hardware 
    and operating system, and supply the appropriate EventType's, key presses, and mouse position info to HandleEvent().  It is 
    the author's recommendation that the user use SDL to do this.  See http://www.libsdl.org for more info.
   
    A note about "mouse drag repeat".  When you click on the down-button on a scroll-bar, you probably expect 
    the the button's action (scrolling down one increment) to repeat when you hold down the button, much like
    the way kestrokes are repeated when you hold down a keyboard key.  But if you just press the button and 
    keep the mouse perfectly still, there will probably be no events sent to the scrollbar control after the first 
    button-down event.  When enabled, mouse drag repeat sends messages to the scrollbar when there otherwise would be none.
*/
class App
{
public: 
    /// these are the only events absolutely necessary for GG to function properly
    enum EventType {KEYPRESS,    ///< a down key press or key repeat, with or without modifiers like Alt, Ctrl, Meta, etc.
                    LPRESS,      ///< a left mouse button press
                    MPRESS,      ///< a middle mouse button press
                    RPRESS,      ///< a right mouse button press
                    LRELEASE,    ///< a left mouse button release
                    MRELEASE,    ///< a middle mouse button release
                    RRELEASE,    ///< a right mouse button release
                    MOUSEMOVE,   ///< movement of the mouse
                    MOUSEWHEEL   ///< rolling of the mouse wheel; this event is accompanied by the amount of roll in the y-component of the mouse's relative position (+ is up, - is down)
                   };

    /** \name Structors */ //@{
    virtual ~App(); ///< virtual dtor
    //@}

    /** \name Accessors */ //@{
    const string&  AppName() const;              ///< returns the user-defined name of the application<commit_msg>Changed #include of GGText.h to GGFont.h.<commit_after>/* GG is a GUI for SDL and OpenGL.
   Copyright (C) 2003 <NAME>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.
   
   This library 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
   Lesser General Public License for more details.
    
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA

   If you do not wish to comply with the terms of the LGPL please
   contact the author as other terms are available for a fee.
    
   <NAME>
   <EMAIL> */
   
/* $Header$ */

#ifndef _GGApp_h_ 
#define _GGApp_h_

#ifndef _GGBase_h_
#include "GGBase.h"
#endif

#ifndef _GGFont_h_
#include "GGFont.h"
#endif

#ifndef _LOG4CPP_CATEGORY_HH
#include <log4cpp/Category.hh>
#endif

namespace GG {

class Wnd;
class Texture;
class XMLElement;
struct AppImplData;

/** An abstract base for an application framework class to drive the GG GUI.  
    This class has all the essential services that GG requires: 
    - application initialization and emergency exit
    - GG event handling
    - rendering of GUI windows
    - entry into and cleanup after a "2D" mode, in case the app also uses non-orthographic 3D projections
    - registration into, removal from, and movement within a z-ordering of windows, including handling of "always-on-top" windows
    - handling of modal windows
    - inter-frame time updates and FPS calculations
    - access to the dimensions of the application window or screen
    - mouse state information
    - application-wide management of fonts and textures
    - creation of polymorphic Wnd-derived objects from XML-formatted text
    - logging of debug info to log files
    
    The user is required to provide several functions.  The most vital functions the user is required to provide are: Enter2DMode(),
    Exit2DMode(), DeltaT(), PollAndRender() [virtual private], and Run() [virtual private].  Without these App is pretty useless.  
    In addition, HandleEvent() must be driven from PollAndRender().  The code driving HandleEvent() must interact with the hardware 
    and operating system, and supply the appropriate EventType's, key presses, and mouse position info to HandleEvent().  It is 
    the author's recommendation that the user use SDL to do this.  See http://www.libsdl.org for more info.
   
    A note about "mouse drag repeat".  When you click on the down-button on a scroll-bar, you probably expect 
    the the button's action (scrolling down one increment) to repeat when you hold down the button, much like
    the way kestrokes are repeated when you hold down a keyboard key.  But if you just press the button and 
    keep the mouse perfectly still, there will probably be no events sent to the scrollbar control after the first 
    button-down event.  When enabled, mouse drag repeat sends messages to the scrollbar when there otherwise would be none.
*/
class App
{
public: 
    /// these are the only events absolutely necessary for GG to function properly
    enum EventType {KEYPRESS,    ///< a down key press or key repeat, with or without modifiers like Alt, Ctrl, Meta, etc.
                    LPRESS,      ///< a left mouse button press
                    MPRESS,      ///< a middle mouse button press
                    RPRESS,      ///< a right mouse button press
                    LRELEASE,    ///< a left mouse button release
                    MRELEASE,    ///< a middle mouse button release
                    RRELEASE,    ///< a right mouse button release
                    MOUSEMOVE,   ///< movement of the mouse; may include relative motion in addition to absolute position
                    MOUSEWHEEL   ///< rolling of the mouse wheel; this event is accompanied by the amount of roll in the y-component of the mouse's relative position (+ is up, - is down)
                   };

    /** \name Structors */ //@{
    virtual ~App(); ///< virtual dtor
    //@}

    /** \name Accessors */ //@{
    const string&  AppName() const;              ///< returns the user-defined name of the application
{'fraction_non_alphanumeric': 0.06101355856857079, 'fraction_numerical': 0.00577906201378084, 'mean_word_length': 2.7155243600330308, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3047363', 'n_tokens_mistral': 2351, 'n_tokens_neox': 2231, 'n_words': 1209}