⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 object.h

📁 SEAL是DOS 下的32位保护模式的GUI程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************************
 * SEAL 2.0                                                       *
 * Copyright (c) 1999-2002 SEAL Developers. All Rights Reserved.  *
 *                                                                *
 * Web site: http://sealsystem.sourceforge.net/                   *
 * E-mail (current maintainer): orudge@users.sourceforge.net      *
 ******************************************************************/

/*
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program 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 General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __OBJECT_H_INCLUDED__
#define __OBJECT_H_INCLUDED__

#include <stdio.h>
#include <string.h>
#include "dataini.h"

#ifdef __cplusplus
extern "C" {
#endif

extern l_big atimer;

#ifndef TXT_NOTENOUGHMEMEMORYFOROPERATION
#define TXT_NOTENOUGHMEMEMORYFOROPERATION INI_TEXT("Not enough memory for operation")
#endif
#ifndef TXT_PLEASESTOREYOURDATAANDEXITSOMEAPPLICATION
#define TXT_PLEASESTOREYOURDATAANDEXITSOMEAPPLICATION INI_TEXT("Please store your data and exit some application")
#endif

#ifndef strsize
#define strsize(p,v)    ((v)?((v)-(p)):strlen(p))
#endif
#ifndef min
#define min(x,y)    (((x) < (y)) ?  (x) : (y))
#endif
#ifndef max
#define max(x,y)    (((x) > (y)) ?  (x) : (y))
#endif
#ifndef imin
#define imin(x,y)   min((l_int)(x),(l_int)(y))
#endif
#ifndef imax
#define imax(x,y)   max((l_int)(x),(l_int)(y))
#endif
#ifndef umin
#define umin(x,y)   min((l_word)(x),(l_word)(y))
#endif
#ifndef umax
#define umax(x,y)   max((l_word)(x),(l_word)(y))
#endif
#ifndef lmin
#define lmin(x,y)   min((l_long)(x),(l_long)(y))
#endif
#ifndef lmax
#define lmax(x,y)   max((l_long)(x),(l_long)(y))
#endif
#ifndef dmin
#define dmin(x,y)   min((l_dword)(x),(l_dword)(y))
#endif
#ifndef dmax
#define dmax(x,y)   max((l_dword)(x),(l_dword)(y))
#endif
#ifndef abs
#define abs(x)      (((x)<0)?-(x):(x))
#endif
#ifndef labs
#define labs(x)     abs((l_long)(x))
#endif

#ifndef             NULL
#define NULL        ((void*)0)
#endif

#ifndef true
#define true        1
#endif
#ifndef false
#define false       0
#endif

#ifndef TRUE
#define TRUE        true
#endif
#ifndef FALSE
#define FALSE       false
#endif
/*
#define l_bool      int
#define l_long      long
#define l_int       int
#define l_char      char
#define l_rect      long
#define l_color     int

typedef l_char         l_tag[32];

#define l_byte         unsigned l_char
#define l_word         unsigned l_int
#define l_dword        unsigned l_long
#define l_big          l_long l_long
#define l_tag_cpy(x,y) tag_strcpy((l_text)x, (l_text)y, sizeof(l_tag));
#define l_tag_cmp(x,y) (!tag_stricmp(x,y))
#define l_ptr          void*
#define l_text         char*
#define l_process      l_bool
#define l_font         GrFONT
#define l_iconlibrary  ICONLIBRARY */

//#define INI_TEXT(x) x

#define clear_type(t,s)  if (t) memset(t, 0, s)
#define clear_table(t,s) clear_type(t,s)
#define clear_event(t)   clear_type(t,sizeof(t_event))

/* include filter functions */
#include"filter.h"


/* test file */

extern FILE  *seal_debug_file;


#define DEBUG_test(i,x,y) if ( i ) x; else y


/* error types */
#define ET_UNDEFINED    0
#define ET_DONE         1
#define ET_WARNING      2
#define ET_ERROR        3


/* main program, must be defined in program.c file */

extern struct t_object   program;



/* error's types */

#define ERR_NONTHING         0
#define ERR_NONREGULAR       1
#define ERR_INFO             2



/* phase settings */

#define PH_PREPROCESS         0x0000001
#define PH_POSTPROCESS        0x0000002


/* options settings */

#define OB_OF_TOPSELECT       0x0000001 /* object is over the all objects */
#define OB_OF_ENABLE          0x0000002 /* object is enable for group */
#define OB_OF_SELECTABLE      0x0000004 /* object can be selected */
#define OB_OF_NOTACTIVATE     0x0000008
#define OB_OF_STILLPROCESS    0x0000010 /* object is still in process */


/* tag settings */

#define TAG_NONE              0x0000000
#define TAG_DISPOSE           TAG_NONE
#define TAG_OBJECT            0x0000001
#define TAG_VIEW              0x0000002
#define TAG_WINDOW            0x0000004
#define TAG_BUTTON            0x0000008



/* state settings */

#define  OB_SF_MODAL          0x0000001 /* process is call only for this object */
#define  OB_SF_VISIBLE        0x0000002 /* object is visible */
#define  OB_SF_SELECTED       0x0000004 /* object is select */
#define  OB_SF_FOCUSED        0x0000008 /* object is focused */
#define  OB_SF_DRAWBACK       0x0000010 /* object is drawing his background */


typedef struct t_object *p_object;


/*
  event types
*/
#define  EV_NOTHING           0x0000
#define  EV_MOUSE             0x0001
#define  EV_KEYBOARD          0x0002
#define  EV_MESSAGE           0x0004
#define  EV_INFO              0x0008
#define  EV_RETYPE            0x0010

#define  EV_IGNORE_ACTIVE_PROCESS(x) ((x) & EV_RETYPE)


/* standard retype messages */

#define  MSG_RETYPEPATH       1 /* this message redraw files, where event->info = path to file */


#define  RETYPE_FILES_IN_PATH(p)       message_all_info(EV_RETYPE, MSG_RETYPEPATH, NULL, (p))



/*
  standard messages
*/
#define  MSG_NOTHING          0
#define  MSG_QUIT             1
#define  MSG_CLOSE            2
#define  MSG_CANCEL           3
#define  MSG_COPY             4
#define  MSG_PASTE            5
#define  MSG_CUT              6
#define  MSG_OK               7
#define  MSG_YES              8
#define  MSG_NO               9
#define  MSG_HELP            10

#define  MSG_HISTORY         11
#define  MSG_SELECTALL       12

#define  MSG_CONTINUE        13
#define  MSG_EXIT            14
#define  MSG_YESTOALL        15
#define  MSG_NOTOALL         16

#define  MSG_ABOUT           17
#define  MSG_FST_SCR_SHOT    18

#define  MSG_DELETE          19
#define  MSG_SELECT_ALL      20

/*
  data style
*/

#define  DS_ALL        0x00000001  /* get all data from object */
#define  DS_SELECTED   0x00000002  /* get selected data from object */
#define  DS_WHATEVER   0x00000004  /* get data that object want to send */
#define  DS_DELETE     0x00000008  /* delete data from object call for set_data */


typedef struct t_data *p_data;

/*
  data structure
*/
typedef struct t_data {

  l_tag     id;
  l_dword   style;
  l_ptr     data;
  p_object  info_obj;

  l_char    reserved[12];

} t_data;


/* clipboard */

extern t_data  clipboard;

/* clipboard must be freed in all copy function */



typedef struct t_event *p_event;

/*
  event structure
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -