<commit_before>//
//	
//    The Laxkit, a windowing toolkit
//    Please consult http://laxkit.sourceforge.net about where to send any
//    correspondence about this software.
//
//    This library 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.
//
//    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
//    Library General Public License for more details.
//
//    You should have received a copy of the GNU Library 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
//
//    Copyright (C) 2004-2010,2015 by <NAME>
//



#include <lax/textxeditbase-utf8.h>
#include <lax/utf8utils.h>
#include <lax/laxutils.h>
#include <lax/strmanip.h>

// DBG !!!!!
#include <lax/displayer-cairo.h>

#include <iostream>
using namespace std;
#define DBG 

namespace Laxkit {


//----------------------------------------------------------------------------
/*! \class TextXEditBaseUtf8
 * \brief The window base class for text edits using Latin-1 characters.
 *
 * This class provides basic text drawing utilities for subclasses to use. Mainly this means
 * providing textrect to say what portion of the actual window is to be used for drawing text in,
 * and functions to aid drawing single lines of text which take into account 
 * left, right, center, and numeric tabs.
 * 
 * Subclasses must define their own DrawText(). DrawLineOfText() can be called from DrawText(), once
 * the subclass determines what part of thetext is supposed to be shown.
 * a default DrawCaret done here, docaret done here, subclasses must upkeep oldx,oldy and cx,cy.
 * Cursor events must be handled in subclasses.
 *   
 * \todo *** a utf8 must have different simple get extent for compound characters???
 * \todo how best to standardize text controls? 
 * \todo *** snafus with really long lines
 * \todo *** makeinwindow if it can fit, it should fit
 * \todo *** map space to tab for TABS_SPACES in charwidth(), tabwidth=' '*4
 * \todo *** color in the pad space, put little bevel, etc
 * \todo *** NO_TAB
 * \todo *** paste nl conversion
 * \todo *** DrawLineOfText should use a maxpix and a maxpos for refreshing and word wrapping convenience respectively
 */
/*! \var int TextXEditBaseUtf8::curlineoffset
 * \brief The pixel horizontal offset the text is shifted.
 *
 * Say it is 10, then the 10th pixel of the text from the left is located at the edge of textrect.x+pad.
 */<commit_msg>minor doc change<commit_after>//
//	
//    The Laxkit, a windowing toolkit
//    Please consult http://laxkit.sourceforge.net about where to send any
//    correspondence about this software.
//
//    This library 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.
//
//    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
//    Library General Public License for more details.
//
//    You should have received a copy of the GNU Library 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
//
//    Copyright (C) 2004-2010,2015 by <NAME>
//



#include <lax/textxeditbase-utf8.h>
#include <lax/utf8utils.h>
#include <lax/laxutils.h>
#include <lax/strmanip.h>

// DBG !!!!!
#include <lax/displayer-cairo.h>

#include <iostream>
using namespace std;
#define DBG 

namespace Laxkit {


//----------------------------------------------------------------------------
/*! \class TextXEditBaseUtf8
 * \brief The window base class for text edits.
 *
 * This class provides basic text drawing utilities for subclasses to use. Mainly this means
 * providing textrect to say what portion of the actual window is to be used for drawing text in,
 * and functions to aid drawing single lines of text which take into account 
 * left, right, center, and numeric tabs.
 * 
 * Subclasses must define their own DrawText(). DrawLineOfText() can be called from DrawText(), once
 * the subclass determines what part of thetext is supposed to be shown.
 * a default DrawCaret done here, docaret done here, subclasses must upkeep oldx,oldy and cx,cy.
 * Cursor events must be handled in subclasses.
 *   
 * \todo how best to standardize text controls? 
 * \todo *** snafus with really long lines
 * \todo *** makeinwindow if it can fit, it should fit
 * \todo *** map space to tab for TABS_SPACES in charwidth(), tabwidth=' '*4
 * \todo *** color in the pad space, put little bevel, etc
 * \todo *** NO_TAB
 * \todo *** paste nl conversion
 * \todo *** DrawLineOfText should use a maxpix and a maxpos for refreshing and word wrapping convenience respectively
 */
/*! \var int TextXEditBaseUtf8::curlineoffset
 * \brief The pixel horizontal offset the text is shifted.
 *
 * Say it is 10, then the 10th pixel of the text from the left is located at the edge of textrect.x+pad.
 */
{'fraction_non_alphanumeric': 0.11075210913660025, 'fraction_numerical': 0.013283073056901813, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 17, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7188515', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1520, 'n_words': 745}