<commit_before>// -*-c++-*- osgWidget - Code by: <NAME> (cubicool) 2007-2008
// $Id: WindowManager.cpp 66 2008-07-14 21:54:09Z cubicool $

#include <iostream>
#include <algorithm>
#include <osg/io_utils>
#include <osgWidget/Types>
#include <osgWidget/Util>
#include <osgWidget/WindowManager>
#include <osgWidget/Lua>
#include <osgWidget/Python>
#include <osgWidget/Box>
#include <osgWidget/Label>

namespace osgWidget {

WindowManager::WindowManager(
	osgViewer::View* view,
	point_type       width,
	point_type       height,
	unsigned int     nodeMask,
	unsigned int     flags
):
_width          (width),
_height         (height),
_zNear          (0.0f),
_zFar           (-1.0f),
_numForeground  (0.0f),
_numBackground  (0.0f),
_flags          (flags),
_nodeMask       (nodeMask),
_view           (view),
_lastX          (0.0f),
_lastY          (0.0f),
_lastEvent      (0),
_lastPush       (0),
_lastVertical   (PD_NONE),
_lastHorizontal (PD_NONE),
_focusMode      (PFM_FOCUS),
_leftDown       (false),
_middleDown     (false),
_rightDown      (false),
_scrolling      (osgGA::GUIEventAdapter::SCROLL_NONE),
_styleManager   (new StyleManager()) {
	_name = generateRandomName("WindowManager");

	if(_flags & WM_USE_LUA) {
		_lua = new LuaEngine(this);

		if(!_lua->initialize()) warn() << "Error creating LuaEngine." << std::endl;
	}

	if(_flags & WM_USE_PYTHON) {
		_python = new PythonEngine(this);

		if(!_python->initialize()) warn() << "Error creating PythonEngine." << std::endl;
	}

	// Setup our picking debug (is debug the right word here?) Window...
	if(_flags & WM_PICK_DEBUG) {
		_pickWindow = new Box("PickWindow", Box::VERTICAL);
		
		Label* label = new Label("PickLabel");

		label->setFontSize(13);
		label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
		label->setFont("fonts/monospace.ttf");
		label->setPadding(5.0f);
		label->setCanFill(true);

		_pickWindow->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.85f);
		_pickWindow->addWidget(label);
		_pickWindow->setNodeMask(~_nodeMask);
		_pickWindow->removeEventMask(EVENT_MASK_FOCUS);
		_pickWindow->setStrata(Window::STRATA_FOREGROUND);
<commit_msg>Fixed path to font<commit_after>// -*-c++-*- osgWidget - Code by: <NAME> (cubicool) 2007-2008
// $Id: WindowManager.cpp 66 2008-07-14 21:54:09Z cubicool $

#include <iostream>
#include <algorithm>
#include <osg/io_utils>
#include <osgWidget/Types>
#include <osgWidget/Util>
#include <osgWidget/WindowManager>
#include <osgWidget/Lua>
#include <osgWidget/Python>
#include <osgWidget/Box>
#include <osgWidget/Label>

namespace osgWidget {

WindowManager::WindowManager(
	osgViewer::View* view,
	point_type       width,
	point_type       height,
	unsigned int     nodeMask,
	unsigned int     flags
):
_width          (width),
_height         (height),
_zNear          (0.0f),
_zFar           (-1.0f),
_numForeground  (0.0f),
_numBackground  (0.0f),
_flags          (flags),
_nodeMask       (nodeMask),
_view           (view),
_lastX          (0.0f),
_lastY          (0.0f),
_lastEvent      (0),
_lastPush       (0),
_lastVertical   (PD_NONE),
_lastHorizontal (PD_NONE),
_focusMode      (PFM_FOCUS),
_leftDown       (false),
_middleDown     (false),
_rightDown      (false),
_scrolling      (osgGA::GUIEventAdapter::SCROLL_NONE),
_styleManager   (new StyleManager()) {
	_name = generateRandomName("WindowManager");

	if(_flags & WM_USE_LUA) {
		_lua = new LuaEngine(this);

		if(!_lua->initialize()) warn() << "Error creating LuaEngine." << std::endl;
	}

	if(_flags & WM_USE_PYTHON) {
		_python = new PythonEngine(this);

		if(!_python->initialize()) warn() << "Error creating PythonEngine." << std::endl;
	}

	// Setup our picking debug (is debug the right word here?) Window...
	if(_flags & WM_PICK_DEBUG) {
		_pickWindow = new Box("PickWindow", Box::VERTICAL);
		
		Label* label = new Label("PickLabel");

		label->setFontSize(13);
		label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
		label->setFont("fonts/VeraMono.ttf");
		label->setPadding(5.0f);
		label->setCanFill(true);

		_pickWindow->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.85f);
		_pickWindow->addWidget(label);
		_pickWindow->setNodeMask(~_nodeMask);
		_pickWindow->removeEventMask(EVENT_MASK_FOCUS);
		_pickWindow->setStrata(Window::STRATA_FOREGROUND);

{'fraction_non_alphanumeric': 0.15271867612293144, 'fraction_numerical': 0.027895981087470448, 'mean_word_length': 3.852064220183486, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 51, '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': '1056142', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1537, 'n_words': 309}