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

106 lines
3.5 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>
/* ************************************************************************** */
/* 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
/* Platform flags */
# define g1m_platflag_be 0x8000
/* Platform macros */
# define g1m_platform(P) ((P) & 0x7FFF)
/* ************************************************************************** */
/* Helpers */
/* ************************************************************************** */
/* Version */
typedef struct g1m_version_s {
int major, minor, revision;
} g1m_version_t;
/* ************************************************************************** */
/* Handle structure */
/* ************************************************************************** */
typedef struct {
/* file type, the source destination platform */
g1m_type_t type;
g1m_platform_t platform; /* use the `g1m_platorm` macro! */
/* Add-in related data */
char title[17];
char intname[12];
g1m_version_t version;
time_t creation_date;
/* Tab-related properties */
int count;
int _size;
/* MCS list */
g1m_mcsfile_t **files;
/* Storage files list */
g1m_file_t **sfiles;
/* Messages list */
char **messages;
/* Function keys */
uint32_t ***fkeys;
/* Picture-related data (also used for add-in icons */
int width, height;
uint32_t **pixels; /* 0x0RGB */
uint32_t **icon_unsel; /* 0x0RGB */
uint32_t **icon_sel; /* 0x0RGB */
/* E-activities related data */
g1m_line_t *line;
g1m_line_t _linedata;
} g1m_t;
#endif /* LIBG1M_HANDLE_H */