2015-07-26 11:16:05 +02:00
|
|
|
#ifndef _X48_X11_H
|
|
|
|
#define _X48_X11_H 1
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#ifdef HAVE_XSHM
|
2022-03-24 13:41:22 +01:00
|
|
|
#include <X11/extensions/XShm.h>
|
2015-07-26 11:16:05 +02:00
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/shm.h>
|
|
|
|
#endif
|
|
|
|
|
2022-03-24 13:41:22 +01:00
|
|
|
#define WHITE 0
|
|
|
|
#define LEFT 1
|
|
|
|
#define RIGHT 2
|
|
|
|
#define BUT_TOP 3
|
|
|
|
#define BUTTON 4
|
|
|
|
#define BUT_BOT 5
|
|
|
|
#define LCD 6
|
|
|
|
#define PIXEL 7
|
|
|
|
#define PAD_TOP 8
|
|
|
|
#define PAD 9
|
|
|
|
#define PAD_BOT 10
|
|
|
|
#define DISP_PAD_TOP 11
|
|
|
|
#define DISP_PAD 12
|
|
|
|
#define DISP_PAD_BOT 13
|
|
|
|
#define LOGO 14
|
|
|
|
#define LOGO_BACK 15
|
|
|
|
#define LABEL 16
|
|
|
|
#define FRAME 17
|
|
|
|
#define UNDERLAY 18
|
|
|
|
#define BLACK 19
|
2015-07-26 11:16:05 +02:00
|
|
|
|
|
|
|
typedef struct color_t {
|
2023-04-27 12:15:59 +02:00
|
|
|
char* name;
|
|
|
|
int r, g, b;
|
|
|
|
int mono_rgb;
|
|
|
|
int gray_rgb;
|
|
|
|
XColor xcolor;
|
2015-07-26 11:16:05 +02:00
|
|
|
} color_t;
|
|
|
|
|
2023-04-27 12:15:59 +02:00
|
|
|
extern color_t* colors;
|
2015-07-26 11:16:05 +02:00
|
|
|
|
2023-04-27 12:15:59 +02:00
|
|
|
#define COLOR( c ) ( colors[ ( c ) ].xcolor.pixel )
|
2015-07-26 11:16:05 +02:00
|
|
|
|
2022-03-24 13:41:22 +01:00
|
|
|
#define UPDATE_MENU 1
|
|
|
|
#define UPDATE_DISP 2
|
2015-07-26 11:16:05 +02:00
|
|
|
|
|
|
|
typedef struct disp_t {
|
2023-04-27 12:15:59 +02:00
|
|
|
unsigned int w, h;
|
|
|
|
Window win;
|
|
|
|
GC gc;
|
|
|
|
short mapped;
|
|
|
|
int offset;
|
|
|
|
int lines;
|
2015-07-26 11:16:05 +02:00
|
|
|
#ifdef HAVE_XSHM
|
2023-04-27 12:15:59 +02:00
|
|
|
int display_update;
|
|
|
|
XShmSegmentInfo disp_info;
|
|
|
|
XImage* disp_image;
|
|
|
|
XShmSegmentInfo menu_info;
|
|
|
|
XImage* menu_image;
|
2015-07-26 11:16:05 +02:00
|
|
|
#endif
|
|
|
|
} disp_t;
|
|
|
|
|
2022-03-24 13:41:22 +01:00
|
|
|
extern disp_t disp;
|
2015-07-26 11:16:05 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
extern int shm_flag;
|
|
|
|
#endif
|
|
|
|
|
2023-04-27 12:15:59 +02:00
|
|
|
extern Display* dpy;
|
2022-03-24 13:41:22 +01:00
|
|
|
extern int screen;
|
2015-07-26 11:16:05 +02:00
|
|
|
|
2023-04-27 12:30:36 +02:00
|
|
|
extern int InitDisplay( int argc, char** argv );
|
|
|
|
extern int CreateWindows( int argc, char** argv );
|
|
|
|
extern int GetEvent( void );
|
2015-07-26 11:16:05 +02:00
|
|
|
|
2023-04-27 12:30:36 +02:00
|
|
|
extern void adjust_contrast( int contrast );
|
|
|
|
extern void refresh_icon( void );
|
2015-07-26 11:16:05 +02:00
|
|
|
|
2023-04-27 12:30:36 +02:00
|
|
|
extern void ShowConnections( char* w, char* i );
|
2015-07-26 11:16:05 +02:00
|
|
|
|
2023-04-27 12:30:36 +02:00
|
|
|
extern void exit_x48( int tell_x11 );
|
2015-07-26 11:16:05 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
2023-04-27 12:30:36 +02:00
|
|
|
extern void refresh_display( void );
|
2015-07-26 11:16:05 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !_X48_X11_H */
|