<commit_before>// $Id$
//
// Copyright (C) 2008  <NAME>
//
// This file is part of PLplot.
//
// PLplot is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as published
// by the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// PLplot 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 Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with PLplot; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//

#ifndef __WXWIDGETS_H__
#define __WXWIDGETS_H__

// some special wxWidgets headers
#include <wx/spinctrl.h>

// freetype headers and macros
#ifdef HAVE_FREETYPE
  #include "plfreetype.h"
#endif

#ifndef max_number_of_grey_levels_used_in_text_smoothing
  #define max_number_of_grey_levels_used_in_text_smoothing    64
#endif

#define NDEV                                                  100 // Max number of output device types in menu

//--------------------------------------------------------------------------
// Physical dimension constants used by the driver

// Virtual coordinate scaling parameter, used to do calculations at
// higher resolution.  Chosen to be 32 for consistency with the PLplot
// metafile (see plplotP.h).
//
// The trick here is to do everything in device coordinates on the driver
// side, but report/receive everything in virtual coordinates to/from the
// PLplot core.
//
#define VSCALE                       ( 32. )

// pixels per mm
#define DEVICE_PIXELS_PER_MM         ( 3.14961 )
#define VIRTUAL_PIXELS_PER_MM        ( DEVICE_PIXELS_PER_MM * VSCALE )

// mm per inch
#define MM_PER_IN                    ( 25.4 )

// pixels per inch
#define DEVICE_PIXELS_PER_IN         ( DEVICE_PIXELS_PER_MM * MM_PER_IN )
#define VIRTUAL_PIXELS_PER_IN        ( VIRTUAL_PIXELS_PER_MM * MM_PER_IN )

// Default dimensions of the canvas (in inches)
#define CANVAS_WIDTH                 ( 10.0 )
#define CANVAS_HEIGHT                ( 7.5 )

// size of plot in pixels on screen if not given
#define PLOT_WIDTH                   ( 800 )
#define PLOT_HEIGHT                  ( 600 )

// These need to be distinguished since the handling is slightly different.
#define LOCATE_INVOKED_VIA_API       1
#define LOCATE_INVOKED_VIA_DRIVER    2

// Available backends
#define wxBACKEND_DC                 0
#define wxBACKEND_AGG                1
#define wxBACKEND_GC                 2

class wxPLplotFrame;

// base device class
class wxPLDevBase
{
public: // methods
    wxPLDevBase( int bcknd );
    virtual ~wxPLDevBase( void );

    // virtual functions which need to implemented<commit_msg>Calculate wxwidget macros in more logical order (inches first) such that the resulting macros involving inches coordinates are exact integers.<commit_after>// $Id$
//
// Copyright (C) 2008  <NAME>
//
// This file is part of PLplot.
//
// PLplot is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as published
// by the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// PLplot 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 Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with PLplot; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//

#ifndef __WXWIDGETS_H__
#define __WXWIDGETS_H__

// some special wxWidgets headers
#include <wx/spinctrl.h>

// freetype headers and macros
#ifdef HAVE_FREETYPE
  #include "plfreetype.h"
#endif

#ifndef max_number_of_grey_levels_used_in_text_smoothing
  #define max_number_of_grey_levels_used_in_text_smoothing    64
#endif

#define NDEV                                                  100 // Max number of output device types in menu

//--------------------------------------------------------------------------
// Physical dimension constants used by the driver

// Virtual coordinate scaling parameter, used to do calculations at
// higher resolution.  Chosen so that maximum plP_setphy coordinate
// is 32000 which is close to but still less than the maximum possible
// which is 32767.
//
// The trick here is to do everything in device coordinates on the driver
// side, but report/receive everything in virtual coordinates to/from the
// PLplot core.
//
#define VSCALE                       ( 40. )

// pixels per inch
#define DEVICE_PIXELS_PER_IN         ( 80. )
#define VIRTUAL_PIXELS_PER_IN        ( DEVICE_PIXELS_PER_IN * VSCALE )


// mm per inch
#define MM_PER_IN                    ( 25.4 )

// pixels per mm
#define DEVICE_PIXELS_PER_MM         ( DEVICE_PIXELS_PER_IN / MM_PER_IN )
#define VIRTUAL_PIXELS_PER_MM        ( VIRTUAL_PIXELS_PER_IN / MM_PER_IN )

// Default dimensions of the canvas (in inches)
#define CANVAS_WIDTH                 ( 10.0 )
#define CANVAS_HEIGHT                ( 7.5 )

// size of plot in pixels on screen if not given
#define PLOT_WIDTH                   ( 800 )
#define PLOT_HEIGHT                  ( 600 )

// These need to be distinguished since the handling is slightly different.
#define LOCATE_INVOKED_VIA_API       1
#define LOCATE_INVOKED_VIA_DRIVER    2

// Available backends
#define wxBACKEND_DC                 0
#define wxBACKEND_AGG                1
#define wxBACKEND_GC                 2

class wxPLplotFrame;

// base device class
class wxPLDevBase
{
public: // methods
    wxPLDevBase( int bcknd );
    virtual ~wxPLDevBase( void );

    // virtual functions which need to implemented
{'fraction_non_alphanumeric': 0.09087893864013268, 'fraction_numerical': 0.01724709784411277, 'mean_word_length': 2.4621125143513205, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3698875', 'n_tokens_mistral': 1836, 'n_tokens_neox': 1709, 'n_words': 674}