GrafX2 2.9.3227
The ultimate 256-color painting program
x11screen.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/XKBlib.h>
#include "screen.h"
#include "gfx2surface.h"
#include "loadsave.h"
#include "io.h"
#include "gfx2log.h"
+ Include dependency graph for x11screen.c:

Functions

void GFX2_Set_mode (int *width, int *height, int fullscreen)
 Sets the new screen/window dimensions. More...
 
byte Get_Screen_pixel (int x, int y)
 
void Set_Screen_pixel (int x, int y, byte value)
 
byteGet_Screen_pixel_ptr (int x, int y)
 
void Screen_FillRect (int x, int y, int w, int h, byte color)
 
int GFX2_SetPalette (const T_Components *colors, int firstcolor, int ncolors)
 
void Update_rect (short x, short y, unsigned short width, unsigned short height)
 
void Flush_update (void)
 
void Update_status_line (short char_pos, short width)
 
void Clear_border (byte color)
 Clears the parts of screen that are outside of the editing area. More...
 
void Allow_drag_and_drop (int flag)
 Activates or desactivates file drag-dropping in program window. More...
 
void Define_icon (void)
 Set application icon(s) More...
 
void Set_mouse_position (void)
 set (system) mouse cursor position More...
 
int GFX2_MessageBox (const char *text, const char *caption, unsigned int type)
 Display a modal message. More...
 

Variables

Display * X11_display = NULL
 
Window X11_window = 0
 
static XImage * X11_image = NULL
 
static XTextProperty windowName
 
static GC X11_gc = 0
 
static T_GFX2_Surfacescreen = NULL
 
static T_GFX2_Surfaceicon = NULL
 
volatile int Allow_colorcycling = 0
 

Function Documentation

◆ GFX2_Set_mode()

◆ Get_Screen_pixel()

◆ Set_Screen_pixel()

◆ Get_Screen_pixel_ptr()

byte * Get_Screen_pixel_ptr ( int  x,
int  y 
)

References GFX2_Log(), GFX2_WARNING, NULL, T_GFX2_Surface::pixels, screen, Screen_SDL, and T_GFX2_Surface::w.

Referenced by Clear_brush_double(), Clear_brush_quad(), Clear_brush_simple(), Clear_brush_tall(), Clear_brush_tall2(), Clear_brush_tall3(), Clear_brush_triple(), Clear_brush_wide(), Clear_brush_wide2(), Display_brush_color_double(), Display_brush_color_quad(), Display_brush_color_simple(), Display_brush_color_tall(), Display_brush_color_tall2(), Display_brush_color_tall3(), Display_brush_color_triple(), Display_brush_color_wide(), Display_brush_color_wide2(), Display_brush_color_zoom_double(), Display_brush_color_zoom_quad(), Display_brush_color_zoom_tall(), Display_brush_color_zoom_tall2(), Display_brush_color_zoom_tall3(), Display_brush_color_zoom_triple(), Display_brush_color_zoom_wide2(), Display_brush_double(), Display_brush_mono_double(), Display_brush_mono_quad(), Display_brush_mono_simple(), Display_brush_mono_tall(), Display_brush_mono_tall2(), Display_brush_mono_tall3(), Display_brush_mono_triple(), Display_brush_mono_wide(), Display_brush_mono_wide2(), Display_brush_quad(), Display_brush_simple(), Display_brush_tall(), Display_brush_tall2(), Display_brush_tall3(), Display_brush_triple(), Display_brush_wide(), Display_brush_wide2(), Display_line_on_screen_fast_double(), Display_line_on_screen_fast_quad(), Display_line_on_screen_fast_tall2(), Display_line_on_screen_fast_tall3(), Display_line_on_screen_fast_triple(), Display_line_on_screen_fast_wide(), Display_line_on_screen_fast_wide2(), Display_line_on_screen_quad(), Display_line_on_screen_simple(), Display_line_on_screen_tall(), Display_line_on_screen_tall2(), Display_line_on_screen_tall3(), Display_line_on_screen_triple(), Display_line_on_screen_wide(), Display_line_on_screen_wide2(), Display_part_of_screen_double(), Display_part_of_screen_quad(), Display_part_of_screen_simple(), Display_part_of_screen_tall(), Display_part_of_screen_tall2(), Display_part_of_screen_tall3(), Display_part_of_screen_triple(), Display_part_of_screen_wide(), Display_part_of_screen_wide2(), Display_transparent_line_on_screen_simple(), Display_transparent_line_on_screen_wide(), Display_transparent_mono_line_on_screen_double(), Display_transparent_mono_line_on_screen_quad(), Display_transparent_mono_line_on_screen_simple(), Display_transparent_mono_line_on_screen_tall2(), Display_transparent_mono_line_on_screen_tall3(), Display_transparent_mono_line_on_screen_triple(), Display_transparent_mono_line_on_screen_wide(), Display_transparent_mono_line_on_screen_wide2(), Horizontal_XOR_line_simple(), Horizontal_XOR_line_tall(), Horizontal_XOR_line_wide(), Read_line_screen_double(), Read_line_screen_quad(), Read_line_screen_simple(), Read_line_screen_tall(), Read_line_screen_tall2(), Read_line_screen_tall3(), Read_line_screen_triple(), Read_line_screen_wide(), Read_line_screen_wide2(), Remap_screen_double(), Remap_screen_quad(), Remap_screen_simple(), Remap_screen_tall(), Remap_screen_tall2(), Remap_screen_tall3(), Remap_screen_triple(), Remap_screen_wide(), Remap_screen_wide2(), Screen_FillRect(), and Update_rect().

◆ Screen_FillRect()

◆ GFX2_SetPalette()

int GFX2_SetPalette ( const T_Components colors,
int  firstcolor,
int  ncolors 
)

◆ Update_rect()

void Update_rect ( short  x,
short  y,
unsigned short  width,
unsigned short  height 
)

◆ Flush_update()

◆ Update_status_line()

void Update_status_line ( short  char_pos,
short  width 
)

◆ Clear_border()

void Clear_border ( byte  color)

Clears the parts of screen that are outside of the editing area.

There is such area only if the screen mode is not a multiple of the pixel size, eg: 3x3 pixels in 1024x768 leaves 1 column on the right, 0 rows on bottom.

References Pixel_height, Pixel_width, Screen_height, Screen_SDL, and Screen_width.

Referenced by Init_mode_video(), Remap_menu_sprites(), and Remap_screen_after_menu_colors_change().

◆ Allow_drag_and_drop()

void Allow_drag_and_drop ( int  flag)

Activates or desactivates file drag-dropping in program window.

References FALSE, GFX2_Get_Window_Handle(), GFX2_Log(), GFX2_WARNING, NULL, TRUE, X11_display, and X11_window.

Referenced by Close_window(), Init_program(), and Open_window().

◆ Define_icon()

◆ Set_mouse_position()

void Set_mouse_position ( void  )

◆ GFX2_MessageBox()

int GFX2_MessageBox ( const char *  text,
const char *  caption,
unsigned int  type 
)

Display a modal message.

Parameters
textbody of the modal message
captiontitle of the message
typeone of GFX2_MB_INFO, GFX2_MB_ERROR, GFX2_MB_WARNING
Returns
0 for error

References GFX2_DEBUG, GFX2_ERROR, GFX2_Get_Window_Handle(), GFX2_Log(), NULL, X11_display, and X11_window.

Referenced by Display_syntax(), and Error_function().

Variable Documentation

◆ X11_display

◆ X11_window

◆ X11_image

XImage* X11_image = NULL
static

Referenced by GFX2_Set_mode(), and Update_rect().

◆ windowName

XTextProperty windowName
static

Referenced by GFX2_Set_mode().

◆ X11_gc

GC X11_gc = 0
static

Referenced by GFX2_Set_mode().

◆ screen

◆ icon

◆ Allow_colorcycling

volatile int Allow_colorcycling = 0