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

📄 alltogrx.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 NEW_ALLEGRO
//#include"oldallegro.h"
//#else
//#include"allegro.h"
//#endif

#ifndef __ALLTOGRX_H_INCLUDED__
#define __ALLTOGRX_H_INCLUDED__

#ifdef __cplusplus
extern "C" {
#endif

#ifndef  GRAPHICS_TYPES
#define  GRAPHICS_TYPES
#define  define_nothing
#define  ScreenContext    screen
#define  GrRGB            RGB
#define  GrCOLOR          int
#define  GrCONTEXT        BITMAP
#define  GrRLE_SPRITE     RLE_SPRITE
#define  GrIMAGE          GrCONTEXT
#define  GrFONT           void*
#define  GrFIXED          fixed
#define  GrV3D            V3D
#define  GrV3DF           V3D_f
#define  GrPALETTE        PALETTE

#define  GrRgb            GrRGB
#define  GrColor          GrCOLOR
#define  GrContext        GrCONTEXT
#define  GrRleSprite      GrRLE_SPRITE
#define  GrImage          GrContext
#define  GrFont           GrFONT
#define  GrFixed          GrFIXED
#define  GrV3d            GrV3D
#define  GrV3Df           GrV3DF
#define  GrPalette        GrPALETTE

#define  GrPALETTESIZE    PAL_SIZE

#endif

#ifndef  TX_NOCOLOR
#define  TX_NOCOLOR               -1
#endif

#ifndef  TX_ALIGNS
#define  TX_ALIGNS
#define  TX_ALIGN_LEFT     0x01
#define  TX_ALIGN_TOP      0x02
#define  TX_ALIGN_RIGHT    0x04
#define  TX_ALIGN_BOTTOM   0x08
#define  TX_ALIGN_CENTERX  0x10
#define  TX_ALIGN_CENTERY  0x20
#define  TX_ALIGN_CENTER   (TX_ALIGN_CENTERX|TX_ALIGN_CENTERY)
#define  TX_ALIGN_DEFAULT  (TX_ALIGN_TOP|TX_ALIGN_LEFT) // or 0
#define  TX_UNDERLINE      0x40
#define  TX_STRIKELINE     0x80
#define  TX_NOSMOOTHTEXT   0x100
#endif

#define  CONTEXT_WIDTH(d)  (d?d->w:0)
#define  CONTEXT_HEIGHT(d) (d?d->h:0)
#define  IMAGE_WIDTH(d)    CONTEXT_WIDTH(d)
#define  IMAGE_HEIGHT(d)   CONTEXT_HEIGHT(d)

#define  GET_DATA(d,x) get_datafile_object(d, x)

#define  FONT_DEFAULT_WIDTH   16
#define  FONT_DEFAULT_HEIGHT  16

#define  NOCOLOR_RED           255
#define  NOCOLOR_GREEN           0
#define  NOCOLOR_BLUE          255

#define  ICON_16               16
#define  ICON_32               32

#define  SF_FLIPX              0x01
#define  SF_FLIPY              0x02

extern int   (*textlen)(void *f, unsigned char *text, int len );
extern void  (*change_font_size)(void *f, int w, int h);
extern int   (*textheight)(void *f );
extern void  (*drawtext)(BITMAP *b, void *f, unsigned char *text, int x1, int y1, GrCOLOR color );


/* icon library */

typedef struct ICONLIBRARY {

  int         id;
  DATAFILE   *datfile;
  BITMAP     *icon16;
  BITMAP     *icon32;

  char        rserved[16];

  struct ICONLIBRARY *next;

} ICONLIBRARY;


#ifndef NEW_ALLEGRO
/* only for low-level graphics */

/* begin of my allegro functions */
#ifdef __cplusplus
extern "C" {
#endif
/* mouse */
extern BITMAP *_mouse_sprite;
extern int  _drawing_in_screen;
extern int mouse_mode;
extern int mouse_mode_rect_ax;
extern int mouse_mode_rect_ay;
extern int mouse_mode_rect_bx;
extern int mouse_mode_rect_by;
extern void (*run_mouse_mode)(struct BITMAP *msb, int mdx, int mdy, int erase, int show );
int  mouse_is_block();
int  mouse_is_visible();
int  mouse_block(struct BITMAP *bmp, int x1, int y1, int x2, int y2);
void mouse_unblock(int i);
void get_mouse_focus(int *fx, int *fy);
void get_mouse_range(int *x1, int *y1, int *x2, int *y2);
/* end of my allegro functions */
#ifdef __cplusplus
};
#endif
#endif

#define FR_HOR 0x01
#define FR_VER 0x02

void get_size_of_ftext(char *text, GrFONT *font, int *x, int *y);
void point_vline ( BITMAP *out, int x1, int y1, int y2, GrCOLOR color );
void point_hline ( BITMAP *out, int x1, int y1, int x2, GrCOLOR color );
void fade_rect ( BITMAP *b, int x1, int y1, int x2, int y2, GrCOLOR one, GrCOLOR two, int direct );
void lined_rect ( BITMAP *b, int x1, int y1, int x2, int y2, GrCOLOR one, GrCOLOR two );
void light_image ( BITMAP *b, int x1, int y1, int x2, int y2, int dr, int dg, int db );
void button ( BITMAP *b, int x1, int y1, int x2, int y2, GrCOLOR c1, GrCOLOR c2 );
int  get_depth ( BITMAP *b );
int  get_mask_color ( BITMAP *b );
int  get_width ( BITMAP *b );
int  get_height ( BITMAP *b );
int  get_clip ( BITMAP *b, int *x1, int *y1, int *x2, int *y2 );
void get_real_box ( BITMAP *b, int *x1, int *y1, int *x2, int *y2 );

int  get_char_length ( void *f, unsigned char ch );
void draw_char ( BITMAP *out, GrFONT *f, unsigned char chr, int x1, int y1,
                 GrCOLOR f1, GrCOLOR b1 );
void textout_draw(BITMAP *bmp, void *f, unsigned char *s, int len, int x1, int y1, int align, GrColor color, GrColor bcolor );
void textout_draw_rect_ex(BITMAP *bmp, void *f, unsigned char *s, int len, int x1, int y1, int x2, int y2, int align, GrColor color, GrColor bcolor, int clip, int marge );
void textout_draw_rect(BITMAP *bmp, void *f, unsigned char *s, int len, int x1, int y1, int x2, int y2, int align, GrColor color, GrColor bcolor, int clip );
void textout_printf(BITMAP *bmp, void *f, int len,
                  int x1, int y1, int x2, int y2, int align, GrColor color, GrColor bcolor,
                  int clip, char *s, ... );
void draw_double_text ( BITMAP *out, GrFONT *f, unsigned char *txt, int size,
                        int x1, int y1, int x2, int y2, int align,
                        GrCOLOR f1, GrCOLOR f2, int clip );
void draw_selected_text ( BITMAP *out, GrFONT *f,
                          unsigned char *txt, int size, int sfrom, int sto,
                          int x1, int y1, int x2, int y2, int align,
                          GrCOLOR f1, GrCOLOR b1, GrCOLOR f2, GrCOLOR b2, int clip );

void draw_flip_sprite ( BITMAP *b, BITMAP *s, int x, int y, int flag );
void __blit_hline ( BITMAP *source, BITMAP *dest, int sx, int sy, int dx, int dy, int sw, int dw );
void blit_ex ( BITMAP *source, BITMAP *dest, int sx, int sy, int dx, int dy, int sw, int sh, int dw, int dh );
void blit_hline ( BITMAP *source, BITMAP *dest, int sx, int sy, int dx, int dy, int sw, int dw );
void blit_circlefill(BITMAP *source, BITMAP *dest, int sx, int sy, int dx, int dy, int sw, int radius);
void blit_ellipsefill(BITMAP *source, BITMAP *dest, int sx, int sy, int dx, int dy, int sw, int rx, int ry);
BITMAP *gen_neg ( int depth, BITMAP *src );
BITMAP *gen_emboss ( int depth, BITMAP *src );
BITMAP *conv_to_skipcolor_bitmap ( BITMAP *ctx, int r, int g, int b );
BITMAP  *_fixup_loaded_bitmap ( BITMAP *bmp, PALETTE pal, int bpp );
DATAFILE *conv_to_skipcolor_data ( DATAFILE *f, int r, int g, int b );
DATAFILE *load_skip_datafile ( char *filename, int r, int g, int b );
void     *get_datafile_object ( DATAFILE *dat, int obj_num );
ICONLIBRARY  *convert_to_icon_library ( DATAFILE *dat );
ICONLIBRARY  *load_icon_library ( char *filename, int r, int g, int b );
void  unload_icon_library ( ICONLIBRARY *icl );
BITMAP  *get_icon_from_library ( ICONLIBRARY *icl, int id, int size );
GrIMAGE *gr_load_bitmap ( char *filename );

⌨️ 快捷键说明

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