<?php
namespace Veno\QrCdr\Lib;

/**
 * QRcdr Plugin - Internal QR Code Engine
 *
 * All responsibility for its maintenance, security, and compatibility within
 * this plugin is assumed by the plugin author.
 *
 * Key Modifications:
 * - Full PHP 8+ compatibility.
 * - Strict namespacing (Veno\QrCdr\Lib) to prevent conflicts.
 * - Removal of all file-based caching and logging for enhanced security.
 * - Replaced GD image functions with a direct-to-SVG vector output engine.
 *
 * @package    QrCdr
 * @subpackage QrCdr\Lib
 * @version    1.0.0
 * @author     Nicola Franchini <info@veno.es> (Plugin Author and Library Maintainer)
 * @copyright  2024 Nicola Franchini
 * @license    LGPL-3.0-or-later
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/*
 * -------------------------------------------------------------------------
 * CONSTANTS
 * -------------------------------------------------------------------------
 */
// Encoding modes.
define( 'QRCDR_MODE_NUL', -1 );
define( 'QRCDR_MODE_NUM', 0 );
define( 'QRCDR_MODE_AN', 1 );
define( 'QRCDR_MODE_8', 2 );
define( 'QRCDR_MODE_KANJI', 3 );
define( 'QRCDR_MODE_STRUCTURE', 4 );

// Error correction levels.
define( 'QRCDR_ECLEVEL_L', 0 );
define( 'QRCDR_ECLEVEL_M', 1 );
define( 'QRCDR_ECLEVEL_Q', 2 );
define( 'QRCDR_ECLEVEL_H', 3 );

// Supported output formats.
define( 'QRCDR_FORMAT_TEXT', 0 );
define( 'QRCDR_FORMAT_PNG', 1 ); // Kept for internal logic compatibility, even if we use SVG.

// Internal configurations (File caching and logging removed for security and performance).
define( 'QRCDR_FIND_BEST_MASK', true );
define( 'QRCDR_FIND_FROM_RANDOM', 2 );
define( 'QRCDR_DEFAULT_MASK', 2 );

// Maximum size (used for scaling calculations).
define( 'QRCDR_PNG_MAXIMUM_SIZE', 1024 );


/*
 * -------------------------------------------------------------------------
 * HELPER CLASSES
 * -------------------------------------------------------------------------
 */
require __DIR__ . '/class-qrcdrstr.php';

/*
 * -------------------------------------------------------------------------
 * LIBRARY MODULES LOADER
 * -------------------------------------------------------------------------
 */
require __DIR__ . '/class-qrcdrtools.php';
require __DIR__ . '/class-qrcdrspec.php';
require __DIR__ . '/class-qrcdrinputitem.php';
require __DIR__ . '/class-qrcdrinput.php';
require __DIR__ . '/class-qrcdrbitstream.php';
require __DIR__ . '/class-qrcdrsplit.php';
require __DIR__ . '/class-qrcdrrsitem.php';
require __DIR__ . '/class-qrcdrrs.php';
require __DIR__ . '/class-qrcdrmask.php';
require __DIR__ . '/class-qrcdrrsblock.php';
require __DIR__ . '/class-qrcdrrawcode.php';
require __DIR__ . '/class-qrcdrcode.php';
require __DIR__ . '/class-qrcdrframefiller.php';
require __DIR__ . '/class-qrcdrencode.php';
require __DIR__ . '/class-qrcdrvect.php';
