cake
/
libg1m
Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libg1m/include/libg1m/handle.h

118 lines
4.6 KiB
C

/* *****************************************************************************
* libg1m/handle.h -- libg1m handle header.
* Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libg1m.
* libg1m is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libg1m 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libg1m; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
#ifndef LIBG1M_HANDLE_H
# define LIBG1M_HANDLE_H
# include <libg1m/mcs.h>
# include <libg1m/file.h>
# include <libg1m/eact.h>
# include <time.h>
/* ************************************************************************** */
/* Handle types and platforms */
/* ************************************************************************** */
/* General type */
typedef unsigned int g1m_type_t;
# define g1m_type_addin 0x0001
# define g1m_type_mcs 0x0002
# define g1m_type_eact 0x0004
# define g1m_type_picture 0x0008
# define g1m_type_lang 0x0010
# define g1m_type_fkey 0x0020
# define g1m_type_storage 0x0040
/* General type aliases */
# define g1m_type_pict g1m_type_picture
# define g1m_type_eactivity g1m_type_eact
# define g1m_type_add_in g1m_type_addin
/* Platform */
typedef unsigned int g1m_platform_t;
# define g1m_platform_none 0x0000
# define g1m_platform_fx 0x0001
# define g1m_platform_cp 0x0002
# define g1m_platform_cg 0x0004
# define g1m_platform_cas 0x0008
# define g1m_platform_casemul 0x0010
/* ************************************************************************** */
/* Version */
/* ************************************************************************** */
/* Zone (localization) */
# define g1m_versionzone_none 0x00 /* (international) */
# define g1m_versionzone_aus 0x01 /* Australia */
# define g1m_versionzone_fr 0x02 /* France */
# define g1m_versionzone_nam 0x03 /* North america */
# define g1m_versionzone_ch 0x04 /* China */
# define g1m_versionzone_sing 0x05 /* Singapour */
/* Math input/output features */
# define g1m_versionmath_slim 0x01 /* Slim */
# define g1m_versionmath_all 0x02 /* All features (e.g. fx-9860GII-2) */
# define g1m_versionmath_reduced 0x03 /* Reduced features (fx-7400GII) */
# define g1m_versionmath_none 0x07 /* No math features? */
/* Flags */
# define g1m_versionflag_indev 0x01 /* is an in-development/special version */
# define g1m_versionflag_spe 0x02 /* special OS builds (SH-4A) */
/* Version */
typedef struct g1m_version_s {
int g1m_version_major;
int g1m_version_minor;
unsigned char g1m_version_zone;
unsigned char g1m_version_math;
unsigned char g1m_version_flags;
} g1m_version_t;
/* ************************************************************************** */
/* Handle structure */
/* ************************************************************************** */
typedef struct {
/* file type, the source destination platform */
g1m_type_t g1m_handle_type;
g1m_platform_t g1m_handle_platform;
/* Add-in related data */
char g1m_handle_title[17];
char g1m_handle_intname[12];
g1m_version_t g1m_handle_version;
time_t g1m_handle_creation_date;
unsigned char *g1m_handle_content;
size_t g1m_handle_size;
/* Lists for various purposes */
int g1m_handle_count;
int g1m_handle__size;
g1m_mcsfile_t **g1m_handle_files;
g1m_file_t **g1m_handle_sfiles;
char **g1m_handle_messages;
uint32_t ***g1m_handle_fkeys;
/* Picture-related data (also used for add-in icons */
int g1m_handle_width;
int g1m_handle_height;
uint32_t **g1m_handle_pixels; /* 0x0RGB */
uint32_t **g1m_handle_icon_unsel; /* 0x0RGB */
uint32_t **g1m_handle_icon_sel; /* 0x0RGB */
/* E-activities related data */
g1m_line_t *g1m_handle_line;
g1m_line_t g1m_handle__linedata;
} g1m_handle_t;
#endif /* LIBG1M_HANDLE_H */