<commit_before>/*
    Copyright (C) 1998 by <NAME>
    Written by <NAME> <<EMAIL>>
    Ported to COM by <NAME> <<EMAIL>>

    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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __IGRAPH2D_H__
#define __IGRAPH2D_H__

#include "cscom/com.h"
#include "itexture.h"

class csRect;
interface ISystem;

enum FontType
{
  csFontParent = -1,
  csFontPolice,
  csFontPoliceFixed,
  csFontItalic,
  csFontItalicFixed,
  csFontCourier,
  csFontCourierFixed,
  csFontTiny,
  csFontTinyFixed
};

/// This structure is used for saving/restoring areas of screen
struct ImageArea
{
  int x, y, w, h;
  char *data;

  // @@@ not sure if this has binary compatibility in all cases - DAN
  inline ImageArea (int sx, int sy, int sw, int sh)
  { x = sx; y = sy; w = sw; h = sh; data = NULL; }
};

/// A RGB palette entry
struct RGBpaletteEntry
{
  UByte red;
  UByte green;
  UByte blue;
  UByte flags;
};

/**
 * Standard mouse cursor IDs
 */
enum csMouseCursorID
{
  /// No cursor
  csmcNone = -1,
  /// Arrow cursor
  csmcArrow = 0,
  /// Lens cursor
  csmcLens,
  /// Cross-hatch cursor
  csmcCross,
  /// Pen cursor
  csmcPen,
  /// Window move cursor
  csmcMove,
  /// Diagonal (\) resizing cursor
  csmcSizeNWSE,
  /// Diagonal (/) resizing cursor
  csmcSizeNESW,
  /// Vertical sizing cursor
  csmcSizeNS,
  /// Horizontal sizing cursor
  csmcSizeEW,
  /// Invalid operation cursor
  csmcStop,
  /// Wait (longplay operation) cursor
  csmcWait
};

/**
 * Structure describing the pixel format.
 */
struct csPixelFormat
{
  /**
   * The masks to extract the color information from a pixel (truecolor mode only).
   * Currently only masks for 16-bit/15-bit colors are supported.
   * Ignore the Mask and Shift fields of this structure if PalEntries != 0.
   */
  long RedMask, GreenMask, BlueMask;
  /// The shifts to extract the color information from a pixel (truecolor mode only).
  int RedShift, GreenShift, BlueShift;
  /// The number of significant bits for every color.
  int RedBits, GreenBits, BlueBits;

  /**
   * Number of palette entries. 0 for truecolor, else the number of palette
   * entries (this number should be equal to 256 even if not all of these 256
   * colors can be modified (like is the case in Windows)).
   * Currently only 0 and 256 are supported here.
   */
  int PalEntries;

  /**
   * Number of bytes for every pixel.
   * The only supported values currently are:<p>
   * <ul>
   * <li>1: for palette mode (256 palette entries)
   * <li>2: for truecolor 15/16-bit mode (no palette entries)
   * <li>4: for truecolor 32-bit mode (no palette entries)
   * </ul><commit_msg>Fixed an accidental sign-extension bug in csPixelFormat.<commit_after>/*
    Copyright (C) 1998 by <NAME>
    Written by <NAME> <<EMAIL>>
    Ported to COM by <NAME> <<EMAIL>>

    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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __IGRAPH2D_H__
#define __IGRAPH2D_H__

#include "cscom/com.h"
#include "itexture.h"

class csRect;
interface ISystem;

enum FontType
{
  csFontParent = -1,
  csFontPolice,
  csFontPoliceFixed,
  csFontItalic,
  csFontItalicFixed,
  csFontCourier,
  csFontCourierFixed,
  csFontTiny,
  csFontTinyFixed
};

/// This structure is used for saving/restoring areas of screen
struct ImageArea
{
  int x, y, w, h;
  char *data;

  // @@@ not sure if this has binary compatibility in all cases - DAN
  inline ImageArea (int sx, int sy, int sw, int sh)
  { x = sx; y = sy; w = sw; h = sh; data = NULL; }
};

/// A RGB palette entry
struct RGBpaletteEntry
{
  UByte red;
  UByte green;
  UByte blue;
  UByte flags;
};

/**
 * Standard mouse cursor IDs
 */
enum csMouseCursorID
{
  /// No cursor
  csmcNone = -1,
  /// Arrow cursor
  csmcArrow = 0,
  /// Lens cursor
  csmcLens,
  /// Cross-hatch cursor
  csmcCross,
  /// Pen cursor
  csmcPen,
  /// Window move cursor
  csmcMove,
  /// Diagonal (\) resizing cursor
  csmcSizeNWSE,
  /// Diagonal (/) resizing cursor
  csmcSizeNESW,
  /// Vertical sizing cursor
  csmcSizeNS,
  /// Horizontal sizing cursor
  csmcSizeEW,
  /// Invalid operation cursor
  csmcStop,
  /// Wait (longplay operation) cursor
  csmcWait
};

/**
 * Structure describing the pixel format.
 */
struct csPixelFormat
{
  /**
   * The masks to extract the color information from a pixel (truecolor mode only).
   * Currently only masks for 16-bit/15-bit colors are supported.
   * Ignore the Mask and Shift fields of this structure if PalEntries != 0.
   */
  ULong RedMask, GreenMask, BlueMask;
  /// The shifts to extract the color information from a pixel (truecolor mode only).
  int RedShift, GreenShift, BlueShift;
  /// The number of significant bits for every color.
  int RedBits, GreenBits, BlueBits;

  /**
   * Number of palette entries. 0 for truecolor, else the number of palette
   * entries (this number should be equal to 256 even if not all of these 256
   * colors can be modified (like is the case in Windows)).
   * Currently only 0 and 256 are supported here.
   */
  int PalEntries;

  /**
   * Number of bytes for every pixel.
   * The only supported values currently are:<p>
   * <ul>
   * <li>1: for palette mode (256 palette entries)
   * <li>2: for truecolor 15/16-bit mode (no palette entries)
   * <li>4: for truecolor 32-bit mode (no palette entries)
   * </ul>
{'fraction_non_alphanumeric': 0.08613891416439187, 'fraction_numerical': 0.013952077646345162, 'mean_word_length': 3.043531575720417, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6229469', 'n_tokens_mistral': 2152, 'n_tokens_neox': 2026, 'n_words': 857}