<commit_before>/*****************************************************************************\
 *                        ANALYSIS PERFORMANCE TOOLS                         *
 *                                  wxparaver                                *
 *              Paraver Trace Visualization and Analysis Tool                *
 *****************************************************************************
 *     ___     This library is free software; you can redistribute it and/or *
 *    /  __         modify it under the terms of the GNU LGPL as published   *
 *   /  /  _____    by the Free Software Foundation; either version 2.1      *
 *  /  /  /     \   of the License, or (at your option) any later version.   *
 * (  (  ( B S C )                                                           *
 *  \  \  \_____/   This library is distributed in 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 LGPL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA          *
 * The GNU LEsser General Public License is contained in the file COPYING.   *
 *                                 ---------                                 *
 *   Barcelona Supercomputing Center - Centro Nacional de Supercomputacion   *
\*****************************************************************************/

/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *\
 | @file: $HeadURL$
 | @last_commit: $Date$
 | @version:     $Revision$
\* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "labelconstructor.h"

// Signal handling
#include <signal.h>
#include <stdio.h>

#include <wx/filefn.h>

#ifdef __WXMAC__
#include <wx/sysopt.h>
#endif

#include "config.h"
#include "wxparaverapp.h"
#include "connection.h"
#include <wx/filename.h>
#include "sessionsaver.h"
#include "helpcontents.h"
#include "gtimeline.h"
#include "ghistogram.h"

////@begin XPM images
////@end XPM images

#ifndef WIN32
struct sigaction act;
#endif

/*!
 * Application instance implementation
 */

////@begin implement app
IMPLEMENT_APP( wxparaverApp )
////@end implement app


/*!
 * wxparaverApp type definition
 */

IMPLEMENT_CLASS( wxparaverApp, wxApp )


/*!
 * wxparaverApp event table definition
 */

BEGIN_EVENT_TABLE( wxparaverApp, wxApp )

////@begin wxparaverApp event table entries
////@end wxparaverApp event table entries

END_EVENT_TABLE()

#if wxMAJOR_VERSION<3
wxCmdLineEntryDesc wxparaverApp::argumentsParseSyntax[] =
{
  { wxCMD_LINE_SWITCH, 
    wxT("v"),
    wxT("version"),
    wxT("Show wxparaver version.") },

  { wxCMD_LINE_SWITCH, 
    wxT("h"),
    wxT("help"),
    wxT("Show this help."),
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_OPTION_HELP },

  { wxCMD_LINE_SWITCH, 
    wxT("i"),
    wxT("image"),
    wxT("Save cfg last window as an image. Once done wxparaver will exit."),
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    wxT("e"),
    wxT("event"),
    wxT("Event type to code linking."),
    wxCMD_LINE_VAL_NUMBER,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    wxT("t"),
    wxT("tutorial"),
    wxT("Load tutorial. <str> can be the path to the tutorial "
        "containing the index.html file, or the whole url, like "
        "path/file.html (then, other names than 'index' are allowed)."),
    wxCMD_LINE_VAL_STRING,
    wxCMD_LINE_PARAM_OPTIONAL },

   { wxCMD_LINE_PARAM, 
    NULL,
    NULL,
    wxT( "(trace.prv | trace.prv.gz) (configuration.cfg)" ),
    wxCMD_LINE_VAL_STRING,
    wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },

  { wxCMD_LINE_NONE }
};
#else
wxCmdLineEntryDesc wxparaverApp::argumentsParseSyntax[] =
{
  { wxCMD_LINE_SWITCH, 
    "v",
    "version",
    "Show wxparaver version." },

  { wxCMD_LINE_SWITCH, 
    "h",
    "help",
    "Show this help.",
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_OPTION_HELP },

  { wxCMD_LINE_SWITCH, 
    "i",
    "image",
    "Save cfg last window as an image; if it's a timeline, also saves its legend",
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    "e",
    "event",
    "Event type to code linking.",
    wxCMD_LINE_VAL_NUMBER,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    "t",
    "tutorial",
    "Load tutorial. <str> can be the path to the tutorial "
      "containing the index.html file, or the whole url, like "
      "path/file.html (then, other names than 'index' are allowed).",
    wxCMD_LINE_VAL_STRING,
    wxCMD_LINE_PARAM_OPTIONAL },

   { wxCMD_LINE_PARAM, 
    NULL,
    NULL,
    "(trace.prv | trace.prv.gz) (configuration.cfg)",<commit_msg>FEAT: Allow PAGEUP/DOWN HOME/END keys in histogram without zoom (usage message)<commit_after>/*****************************************************************************\
 *                        ANALYSIS PERFORMANCE TOOLS                         *
 *                                  wxparaver                                *
 *              Paraver Trace Visualization and Analysis Tool                *
 *****************************************************************************
 *     ___     This library is free software; you can redistribute it and/or *
 *    /  __         modify it under the terms of the GNU LGPL as published   *
 *   /  /  _____    by the Free Software Foundation; either version 2.1      *
 *  /  /  /     \   of the License, or (at your option) any later version.   *
 * (  (  ( B S C )                                                           *
 *  \  \  \_____/   This library is distributed in 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 LGPL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA          *
 * The GNU LEsser General Public License is contained in the file COPYING.   *
 *                                 ---------                                 *
 *   Barcelona Supercomputing Center - Centro Nacional de Supercomputacion   *
\*****************************************************************************/

/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *\
 | @file: $HeadURL$
 | @last_commit: $Date$
 | @version:     $Revision$
\* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "labelconstructor.h"

// Signal handling
#include <signal.h>
#include <stdio.h>

#include <wx/filefn.h>

#ifdef __WXMAC__
#include <wx/sysopt.h>
#endif

#include "config.h"
#include "wxparaverapp.h"
#include "connection.h"
#include <wx/filename.h>
#include "sessionsaver.h"
#include "helpcontents.h"
#include "gtimeline.h"
#include "ghistogram.h"

////@begin XPM images
////@end XPM images

#ifndef WIN32
struct sigaction act;
#endif

/*!
 * Application instance implementation
 */

////@begin implement app
IMPLEMENT_APP( wxparaverApp )
////@end implement app


/*!
 * wxparaverApp type definition
 */

IMPLEMENT_CLASS( wxparaverApp, wxApp )


/*!
 * wxparaverApp event table definition
 */

BEGIN_EVENT_TABLE( wxparaverApp, wxApp )

////@begin wxparaverApp event table entries
////@end wxparaverApp event table entries

END_EVENT_TABLE()

#if wxMAJOR_VERSION<3
wxCmdLineEntryDesc wxparaverApp::argumentsParseSyntax[] =
{
  { wxCMD_LINE_SWITCH, 
    wxT("v"),
    wxT("version"),
    wxT("Show wxparaver version.") },

  { wxCMD_LINE_SWITCH, 
    wxT("h"),
    wxT("help"),
    wxT("Show this help."),
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_OPTION_HELP },

  { wxCMD_LINE_SWITCH, 
    wxT("i"),
    wxT("image"),
    wxT("Save cfg last window as an image. Once done wxparaver will exit."),
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    wxT("e"),
    wxT("event"),
    wxT("Event type to code linking."),
    wxCMD_LINE_VAL_NUMBER,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    wxT("t"),
    wxT("tutorial"),
    wxT("Load tutorial. <str> can be the path to the tutorial "
        "containing the index.html file, or the whole url, like "
        "path/file.html (then, other names than 'index' are allowed)."),
    wxCMD_LINE_VAL_STRING,
    wxCMD_LINE_PARAM_OPTIONAL },

   { wxCMD_LINE_PARAM, 
    NULL,
    NULL,
    wxT( "(trace.prv | trace.prv.gz) (configuration.cfg) | saved_session.session" ),
    wxCMD_LINE_VAL_STRING,
    wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },

  { wxCMD_LINE_NONE }
};
#else
wxCmdLineEntryDesc wxparaverApp::argumentsParseSyntax[] =
{
  { wxCMD_LINE_SWITCH, 
    "v",
    "version",
    "Show wxparaver version." },

  { wxCMD_LINE_SWITCH, 
    "h",
    "help",
    "Show this help.",
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_OPTION_HELP },

  { wxCMD_LINE_SWITCH, 
    "i",
    "image",
    "Save cfg last window as an image; if it's a timeline, also saves its legend",
    wxCMD_LINE_VAL_NONE,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    "e",
    "event",
    "Event type to code linking.",
    wxCMD_LINE_VAL_NUMBER,
    wxCMD_LINE_PARAM_OPTIONAL },

  { wxCMD_LINE_OPTION, 
    "t",
    "tutorial",
    "Load tutorial. <str> can be the path to the tutorial "
      "containing the index.html file, or the whole url, like "
      "path/file.html (then, other names than 'index' are allowed).",
    wxCMD_LINE_VAL_STRING,
    wxCMD_LINE_PARAM_OPTIONAL },

   { wxCMD_LINE_PARAM, 
    NULL,
    NULL,
    "(trace.prv | trace.prv.gz) (configuration.cfg) | saved_session.session",
{'fraction_non_alphanumeric': 0.17259786476868327, 'fraction_numerical': 0.0029968158831241805, 'mean_word_length': 2.3955484896661368, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1162861', 'n_tokens_mistral': 3526, 'n_tokens_neox': 3272, 'n_words': 855}