ReactOS 0.4.15-dev-7942-gd23573b
qtewin.cpp File Reference
#include <qapplication.h>
#include <qcursor.h>
#include <qmainwindow.h>
#include <qwidget.h>
#include <qpainter.h>
#include <qimage.h>
#include <qsocketnotifier.h>
#include <qscrollview.h>
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qfile.h>
#include <qcheckbox.h>
#include <qpopupmenu.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <pwd.h>
#include "../rdesktop.h"
#include "qtewin.h"
Include dependency graph for qtewin.cpp:

Go to the source code of this file.

Classes

struct  QColorMap
 
struct  bitmap
 

Macros

#define QT_OPTI
 
#define BPP   ((g_server_bpp + 7) / 8)
 
#define GETPIXEL8(d, x, y, w)   (*(((uint8*)d) + ((y) * (w) + (x))))
 
#define GETPIXEL16(d, x, y, w)   (*(((uint16*)d) + ((y) * (w) + (x))))
 
#define GETPIXEL32(d, x, y, w)   (*(((uint32*)d) + ((y) * (w) + (x))))
 
#define SETPIXEL8(d, x, y, w, v)   *(((uint8*)d) + ((y) * (w) + (x))) = v
 
#define SETPIXEL16(d, x, y, w, v)   *(((uint16*)d) + ((y) * (w) + (x))) = v
 
#define SETPIXEL32(d, x, y, w, v)   *(((uint32*)d) + ((y) * (w) + (x))) = v
 
#define NOT(x)   (~x)
 
#define DO_GLYPH(ttext, idx)
 

Functions

void CleanString (QString *Item)
 
void WriteString (QFile *File, QString *Line)
 
void GetScanCode (QKeyEvent *e, int *ScanCode, int *code)
 
int rd (double in)
 
int c2sx (int cx)
 
int c2sy (int cy)
 
int rop (int rop, int src, int dst)
 
int get_pixel (int x, int y)
 
void set_pixel (int x, int y, int pixel, int op=0xc)
 
bool WarpCoords (int *x, int *y, int *cx, int *cy, int *srcx, int *srcy)
 
void redraw (int x, int y, int cx, int cy)
 
int ui_select (int rdp_socket)
 
void ui_move_pointer (int, int)
 
void ui_set_null_cursor (void)
 
HBITMAP ui_create_bitmap (int width, int height, uint8 *data)
 
void ui_paint_bitmap (int x, int y, int cx, int cy, int width, int height, uint8 *data)
 
void ui_destroy_bitmap (HBITMAP bmp)
 
bool is_pixel_on (uint8 *data, int x, int y, int width, int bpp)
 
void set_pixel_on (uint8 *data, int x, int y, int width, int bpp, uint8 pixel)
 
HGLYPH ui_create_glyph (int width, int height, uint8 *data)
 
void ui_destroy_glyph (HGLYPH glyph)
 
HCURSOR ui_create_cursor (uint32 x, uint32 y, int width, int height, uint8 *andmask, uint8 *xormask)
 
void ui_set_cursor (HCURSOR)
 
uint16 ui_get_numlock_state (uint32 state)
 
unsigned int read_keyboard_state (void)
 
void ui_resize_window (void)
 
void ui_polygon (uint8 opcode, uint8 fillmode, POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_polyline (uint8 opcode, POINT *points, int npoints, PEN *pen)
 
void ui_ellipse (uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_destroy_cursor (HCURSOR)
 
HCOLOURMAP ui_create_colourmap (COLOURMAP *colours)
 
void ui_set_colourmap (HCOLOURMAP map)
 
void ui_destroy_colourmap (HCOLOURMAP map)
 
void ui_begin_update (void)
 
void ui_end_update (void)
 
void ui_set_clip (int x, int y, int cx, int cy)
 
void ui_reset_clip (void)
 
void ui_bell (void)
 
void ui_destblt (uint8 opcode, int x, int y, int cx, int cy)
 
void fill_rect (int x, int y, int cx, int cy, int colour, int opcode=0xc)
 
void ui_rect (int x, int y, int cx, int cy, int colour)
 
void ui_patblt (uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_screenblt (uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
 
void ui_memblt (uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
 
void ui_triblt (uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_line (uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
 
void draw_glyph (int x, int y, HGLYPH glyph, int fgcolour)
 
void ui_draw_text (uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, BRUSH *brush, int bgcolour, int fgcolour, uint8 *text, uint8 length)
 
void ui_desktop_save (uint32 offset, int x, int y, int cx, int cy)
 
void ui_desktop_restore (uint32 offset, int x, int y, int cx, int cy)
 
voidxrealloc (void *in_val, int size)
 
voidxmalloc (int size)
 
void xfree (void *in_val)
 
charxstrdup (const char *s)
 
void warning (char *format,...)
 
void unimpl (char *format,...)
 
void error (char *format,...)
 
BOOL rd_pstcache_mkdir (void)
 
int rd_open_file (char *filename)
 
void rd_close_file (int fd)
 
int rd_read_file (int fd, void *ptr, int len)
 
int rd_write_file (int fd, void *ptr, int len)
 
int rd_lseek_file (int fd, int offset)
 
BOOL rd_lock_file (int fd, int start, int len)
 
int load_licence (uint8 **data)
 
void save_licence (uint8 *data, int length)
 
void generate_random (uint8 *random)
 
void hexdump (uint8 *p, uint32 len)
 
void get_username_and_hostname (void)
 
void out_params (void)
 
int parse_parameters (int in_argc, char **in_argv)
 
int param_connect (void)
 
int main (int argc, char **argv)
 

Variables

int g_tcp_port_rdp
 
int g_encryption = 1
 
int g_bitmap_cache = 1
 
int g_bitmap_cache_persist_enable = 0
 
int g_bitmap_cache_precache = 1
 
int g_use_rdp5 = 1
 
int g_desktop_save = 1
 
int g_bitmap_compression = 1
 
int g_polygon_ellipse_orders = 0
 
int g_rdp5_performanceflags
 
int g_console_session = 0
 
int g_keylayout = 0x409
 
int g_keyboard_type = 0x4
 
int g_keyboard_subtype = 0x0
 
int g_keyboard_functionkeys = 0xc
 
int g_width = 640
 
int g_height = 480
 
int g_server_bpp = 8
 
char g_hostname [16] = ""
 
char g_username [100] = ""
 
static int g_client_width = 640
 
static int g_client_height = 480
 
static uint32 g_flags = RDP_LOGON_NORMAL
 
static char g_server [64] = ""
 
static char g_domain [16] = ""
 
static char g_password [16] = ""
 
static char g_shell [128] = ""
 
static char g_directory [32] = ""
 
static int g_fullscreen = 0
 
static int g_global_sock = 0
 
static int g_deactivated = 0
 
static uint32 g_ext_disc_reason = 0
 
static QSocketNotifier * g_SocketNotifier = 0
 
static QApplication * g_App = 0
 
static QMyMainWindowg_MW = 0
 
static QMyScrollViewg_SV = 0
 
static struct QColorMapg_CM = 0
 
static uint8g_BS = 0
 
static int g_clipx = 0
 
static int g_clipy = 0
 
static int g_clipcx = 0
 
static int g_clipcy = 0
 
BOOL g_redirect = False
 
char g_redirect_server [64]
 
char g_redirect_domain [16]
 
char g_redirect_password [64]
 
char g_redirect_username [64]
 
char g_redirect_cookie [128]
 
uint32 g_redirect_flags = 0
 

Macro Definition Documentation

◆ BPP

#define BPP   ((g_server_bpp + 7) / 8)

Definition at line 134 of file qtewin.cpp.

◆ DO_GLYPH

#define DO_GLYPH (   ttext,
  idx 
)
Value:
{\
glyph = cache_get_font (font, ttext[idx]);\
{\
xyoffset = ttext[++idx];\
if ((xyoffset & 0x80))\
{\
y += ttext[idx+1] | (ttext[idx+2] << 8);\
else\
x += ttext[idx+1] | (ttext[idx+2] << 8);\
idx += 2;\
}\
else\
{\
y += xyoffset;\
else\
x += xyoffset;\
}\
}\
if (glyph != NULL)\
{\
draw_glyph (x + glyph->offset, y + glyph->baseline, glyph->pixmap, fgcolour);\
x += glyph->width;\
}\
}
FONTGLYPH * cache_get_font(uint8 font, uint16 character)
Definition: cache.c:279
#define TEXT2_IMPLICIT_X
Definition: constants.h:276
#define TEXT2_VERTICAL
Definition: constants.h:275
#define NULL
Definition: types.h:112
unsigned int idx
Definition: utils.c:41
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLbitfield flags
Definition: glext.h:7161
Definition: mk_font.cpp:20

Definition at line 1957 of file qtewin.cpp.

◆ GETPIXEL16

#define GETPIXEL16 (   d,
  x,
  y,
  w 
)    (*(((uint16*)d) + ((y) * (w) + (x))))

Definition at line 136 of file qtewin.cpp.

◆ GETPIXEL32

#define GETPIXEL32 (   d,
  x,
  y,
  w 
)    (*(((uint32*)d) + ((y) * (w) + (x))))

Definition at line 137 of file qtewin.cpp.

◆ GETPIXEL8

#define GETPIXEL8 (   d,
  x,
  y,
  w 
)    (*(((uint8*)d) + ((y) * (w) + (x))))

Definition at line 135 of file qtewin.cpp.

◆ NOT

#define NOT (   x)    (~x)

Definition at line 1003 of file qtewin.cpp.

◆ QT_OPTI

#define QT_OPTI

Definition at line 52 of file qtewin.cpp.

◆ SETPIXEL16

#define SETPIXEL16 (   d,
  x,
  y,
  w,
  v 
)    *(((uint16*)d) + ((y) * (w) + (x))) = v

Definition at line 139 of file qtewin.cpp.

◆ SETPIXEL32

#define SETPIXEL32 (   d,
  x,
  y,
  w,
  v 
)    *(((uint32*)d) + ((y) * (w) + (x))) = v

Definition at line 140 of file qtewin.cpp.

◆ SETPIXEL8

#define SETPIXEL8 (   d,
  x,
  y,
  w,
  v 
)    *(((uint8*)d) + ((y) * (w) + (x))) = v

Definition at line 138 of file qtewin.cpp.

Function Documentation

◆ c2sx()

int c2sx ( int  cx)

Definition at line 847 of file qtewin.cpp.

848{
849 double sx;
850
851 sx = (double)g_client_width / (double)g_width;
852 return rd(cx / sx);
853}
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
_Out_opt_ int * cx
Definition: commctrl.h:585
int g_width
Definition: qtewin.cpp:70
static int g_client_width
Definition: qtewin.cpp:97
int rd
Definition: scanf.h:134

Referenced by QMyMainWindow::MemuClicked(), QMyMainWindow::mouseMoveEvent(), QMyMainWindow::mousePressEvent(), QMyMainWindow::mouseReleaseEvent(), QMyMainWindow::timerEvent(), and QMyMainWindow::wheelEvent().

◆ c2sy()

int c2sy ( int  cy)

Definition at line 856 of file qtewin.cpp.

857{
858 double sy;
859
860 sy = (double)g_client_height / (double)g_height;
861 return rd(cy / sy);
862}
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
int g_height
Definition: qtewin.cpp:71
static int g_client_height
Definition: qtewin.cpp:98

Referenced by QMyMainWindow::MemuClicked(), QMyMainWindow::mouseMoveEvent(), QMyMainWindow::mousePressEvent(), QMyMainWindow::mouseReleaseEvent(), QMyMainWindow::timerEvent(), and QMyMainWindow::wheelEvent().

◆ CleanString()

void CleanString ( QString *  Item)

Definition at line 143 of file qtewin.cpp.

144{
145 int i;
146
147 i = Item->length() - 1;
148 while (i >= 0)
149 {
150 if (Item->at(i) == 10 || Item->at(i) == 13)
151 {
152 Item->remove(i, 1);
153 }
154 i--;
155 }
156}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

Referenced by QMyDialog::QMyDialog().

◆ draw_glyph()

void draw_glyph ( int  x,
int  y,
HGLYPH  glyph,
int  fgcolour 
)

Definition at line 1943 of file qtewin.cpp.

1944{
1945 struct bitmap *the_glyph;
1946 int i, j;
1947
1948 the_glyph = (struct bitmap*)glyph;
1949 if (the_glyph == NULL)
1950 return;
1951 for (i = 0; i < the_glyph->h; i++)
1952 for (j = 0; j < the_glyph->w; j++)
1953 if (is_pixel_on(the_glyph->data, j, i, the_glyph->w, 8))
1954 set_pixel(x + j, y + i, fgcolour);
1955}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
bool is_pixel_on(uint8 *data, int x, int y, int width, int bpp)
Definition: qtewin.cpp:1379
void set_pixel(int x, int y, int pixel, int op=0xc)
Definition: qtewin.cpp:1049
Definition: uimain.c:89
int h
Definition: qtewin.cpp:93
uint8 * data
Definition: uimain.c:90
int w
Definition: qtewin.cpp:92

◆ error()

void error ( char format,
  ... 
)

Definition at line 2204 of file qtewin.cpp.

2205{
2206 va_list ap;
2207
2208 fprintf(stderr, "ERROR: ");
2209 va_start(ap, format);
2211 va_end(ap);
2212}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

◆ fill_rect()

void fill_rect ( int  x,
int  y,
int  cx,
int  cy,
int  colour,
int  opcode = 0xc 
)

Definition at line 1599 of file qtewin.cpp.

1600{
1601 int i, j;
1602
1603 if (x + cx > g_width)
1604 cx = g_width - x;
1605 if (y + cy > g_height)
1606 cy = g_height - y;
1607#ifdef QT_OPTI
1608 if (opcode == 0xc) /* optimize */
1609 {
1610 if (WarpCoords(&x, &y, &cx, &cy, 0, 0))
1611 {
1612 if (g_server_bpp == 8)
1613 {
1614 for (i = 0; i < cy; i++)
1615 for (j = 0; j < cx; j++)
1616 SETPIXEL8(g_BS, x + j, y + i, g_width, colour);
1617 }
1618 else if (g_server_bpp == 16)
1619 {
1620 for (i = 0; i < cy; i++)
1621 for (j = 0; j < cx; j++)
1622 SETPIXEL16(g_BS, x + j, y + i, g_width, colour);
1623 }
1624 else if (g_server_bpp == 24)
1625 {
1626 for (i = 0; i < cy; i++)
1627 for (j = 0; j < cx; j++)
1628 SETPIXEL32(g_BS, x + j, y + i, g_width, colour);
1629 }
1630 }
1631 }
1632 else
1633#endif
1634 {
1635 for (i = 0; i < cy; i++)
1636 for (j = 0; j < cx; j++)
1637 set_pixel(x + j, y + i, colour, opcode);
1638 }
1639}
#define SETPIXEL8(d, x, y, w, v)
Definition: qtewin.cpp:138
int g_server_bpp
Definition: qtewin.cpp:72
bool WarpCoords(int *x, int *y, int *cx, int *cy, int *srcx, int *srcy)
Definition: qtewin.cpp:1100
#define SETPIXEL16(d, x, y, w, v)
Definition: qtewin.cpp:139
#define SETPIXEL32(d, x, y, w, v)
Definition: qtewin.cpp:140
static uint8 * g_BS
Definition: qtewin.cpp:119

Referenced by IntDrawRectEdge(), ui_draw_text(), ui_patblt(), and ui_rect().

◆ generate_random()

void generate_random ( uint8 random)

Definition at line 2268 of file qtewin.cpp.

2269{
2270 QFile File("/dev/random");
2271 File.open(IO_ReadOnly);
2272 if (File.readBlock((char*)random, 32) == 32)
2273 {
2274 return;
2275 }
2276 warning("no /dev/random\n");
2277 memcpy(random, "12345678901234567890123456789012", 32);
2278}
Definition: File.h:16
bool open(const char *filename, const char *mode)
Definition: File.cpp:10
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define random
Definition: rosdhcp.h:81
#define warning(s)
Definition: debug.h:83

◆ get_pixel()

int get_pixel ( int  x,
int  y 
)

Definition at line 1031 of file qtewin.cpp.

1032{
1033 if (x >= 0 && x < g_width && y >= 0 && y < g_height)
1034 {
1035 if (g_server_bpp == 8)
1036 return GETPIXEL8(g_BS, x, y, g_width);
1037 else if (g_server_bpp == 16)
1038 return GETPIXEL16(g_BS, x, y, g_width);
1039 else if (g_server_bpp == 24)
1040 return GETPIXEL32(g_BS, x, y, g_width);
1041 else
1042 return 0;
1043 }
1044 else
1045 return 0;
1046}
#define GETPIXEL16(d, x, y, w)
Definition: qtewin.cpp:136
#define GETPIXEL32(d, x, y, w)
Definition: qtewin.cpp:137
#define GETPIXEL8(d, x, y, w)
Definition: qtewin.cpp:135

Referenced by ui_desktop_save(), ui_destblt(), and ui_screenblt().

◆ get_username_and_hostname()

void get_username_and_hostname ( void  )

Definition at line 2315 of file qtewin.cpp.

2316{
2317 char fullhostname[64];
2318 char * p;
2319 struct passwd * pw;
2320
2321 STRNCPY(g_username, "unknown", sizeof(g_username));
2322 STRNCPY(g_hostname, "unknown", sizeof(g_hostname));
2323 pw = getpwuid(getuid());
2324 if (pw != NULL && pw->pw_name != NULL)
2325 {
2326 STRNCPY(g_username, pw->pw_name, sizeof(g_username));
2327 }
2328 if (gethostname(fullhostname, sizeof(fullhostname)) != -1)
2329 {
2330 p = strchr(fullhostname, '.');
2331 if (p != NULL)
2332 {
2333 *p = 0;
2334 }
2335 STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
2336 }
2337}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define STRNCPY(dst, src, n)
Definition: rdesktop.h:168
uid_t getuid()
Definition: uid.c:27
INT WSAAPI gethostname(OUT char FAR *name, IN INT namelen)
Definition: getxbyxx.c:397
GLfloat GLfloat p
Definition: glext.h:8902
char g_hostname[16]
Definition: qtewin.cpp:73
char g_username[100]
Definition: qtewin.cpp:74

Referenced by main().

◆ GetScanCode()

void GetScanCode ( QKeyEvent *  e,
int ScanCode,
int code 
)

Definition at line 518 of file qtewin.cpp.

519{
520 int key;
521 int mod;
522 int ascii;
523
524 key = e->key();
525 mod = e->state();
526 ascii = e->ascii();
527
528 *ScanCode = 0;
529 *code = mod; // 8 shift, 16 control, 32 alt
530
531 switch (key)
532 {
533 case 4096: // esc
534 case 4097: // tab
535 case 4099: // backspace
536 case 4100: // enter
537 case 4101: // enter
538 case 4103: // delete
539 ascii = 0;
540 }
541
542 if (ascii == 0)
543 {
544 switch (key)
545 {
546 case 4096: *ScanCode = 0x01; break; // esc
547 case 4097: *ScanCode = 0x0f; break; // tab
548 case 4099: *ScanCode = 0x0e; break; // backspace
549 case 4100: *ScanCode = 0x1c; break; // enter
550 case 4101: *ScanCode = 0x1c; break; // enter
551 case 4112: *ScanCode = 0xc7; break; // home
552 case 4113: *ScanCode = 0xcf; break; // end
553 case 4102: *ScanCode = 0xd2; break; // insert
554 case 4103: *ScanCode = 0xd3; break; // delete
555 case 4118: *ScanCode = 0xc9; break; // page up
556 case 4119: *ScanCode = 0xd1; break; // page down
557 case 4117: *ScanCode = 0xd0; break; // down arrow
558 case 4115: *ScanCode = 0xc8; break; // up arrow
559 case 4114: *ScanCode = 0xcb; break; // left arrow
560 case 4116: *ScanCode = 0xcd; break; // right arrow
561 case 4128: *ScanCode = 0x2a; break; // shift
562 case 4131: *ScanCode = 0x38; break; // alt
563 case 4129: *ScanCode = 0x1d; break; // ctrl
564 }
565 if (*ScanCode != 0)
566 return;
567 }
568
569 switch (ascii)
570 {
571 // first row
572 case 'q': *ScanCode = 0x10; break;
573 case 'Q': *ScanCode = 0x10; *code |= 8; break;
574 case '1': *ScanCode = 0x02; break;
575 case 'w': *ScanCode = 0x11; break;
576 case 'W': *ScanCode = 0x11; *code |= 8; break;
577 case '2': *ScanCode = 0x03; break;
578 case 'e': *ScanCode = 0x12; break;
579 case 'E': *ScanCode = 0x12; *code |= 8; break;
580 case '3': *ScanCode = 0x04; break;
581 case 'r': *ScanCode = 0x13; break;
582 case 'R': *ScanCode = 0x13; *code |= 8; break;
583 case '4': *ScanCode = 0x05; break;
584 case 't': *ScanCode = 0x14; break;
585 case 'T': *ScanCode = 0x14; *code |= 8; break;
586 case '5': *ScanCode = 0x06; break;
587 case 'y': *ScanCode = 0x15; break;
588 case 'Y': *ScanCode = 0x15; *code |= 8; break;
589 case '6': *ScanCode = 0x07; break;
590 case 'u': *ScanCode = 0x16; break;
591 case 'U': *ScanCode = 0x16; *code |= 8; break;
592 case '7': *ScanCode = 0x08; break;
593 case 'i': *ScanCode = 0x17; break;
594 case 'I': *ScanCode = 0x17; *code |= 8; break;
595 case '8': *ScanCode = 0x09; break;
596 case 'o': *ScanCode = 0x18; break;
597 case 'O': *ScanCode = 0x18; *code |= 8; break;
598 case '9': *ScanCode = 0x0a; break;
599 case 'p': *ScanCode = 0x19; break;
600 case 'P': *ScanCode = 0x19; *code |= 8; break;
601 case '0': *ScanCode = 0x0b; break;
602 // second row
603 case 'a': *ScanCode = 0x1e; break;
604 case 'A': *ScanCode = 0x1e; *code |= 8; break;
605 case '!': *ScanCode = 0x02; *code |= 8; break;
606 case 's': *ScanCode = 0x1f; break;
607 case 'S': *ScanCode = 0x1f; *code |= 8; break;
608 case '@': *ScanCode = 0x03; *code |= 8; break;
609 case 'd': *ScanCode = 0x20; break;
610 case 'D': *ScanCode = 0x20; *code |= 8; break;
611 case '#': *ScanCode = 0x04; *code |= 8; break;
612 case 'f': *ScanCode = 0x21; break;
613 case 'F': *ScanCode = 0x21; *code |= 8; break;
614 case '$': *ScanCode = 0x05; *code |= 8; break;
615 case 'g': *ScanCode = 0x22; break;
616 case 'G': *ScanCode = 0x22; *code |= 8; break;
617 case '%': *ScanCode = 0x06; *code |= 8; break;
618 case 'h': *ScanCode = 0x23; break;
619 case 'H': *ScanCode = 0x23; *code |= 8; break;
620 case '_': *ScanCode = 0x0c; *code |= 8; break;
621 case 'j': *ScanCode = 0x24; break;
622 case 'J': *ScanCode = 0x24; *code |= 8; break;
623 case '&': *ScanCode = 0x08; *code |= 8; break;
624 case 'k': *ScanCode = 0x25; break;
625 case 'K': *ScanCode = 0x25; *code |= 8; break;
626 case '*': *ScanCode = 0x09; *code |= 8; break;
627 case 'l': *ScanCode = 0x26; break;
628 case 'L': *ScanCode = 0x26; *code |= 8; break;
629 case '(': *ScanCode = 0x0a; *code |= 8; break;
630// case 8: *ScanCode = 0x0e; break; // backspace
631 // third row
632 case 'z': *ScanCode = 0x2c; break;
633 case 'Z': *ScanCode = 0x2c; *code |= 8; break;
634 case 'x': *ScanCode = 0x2d; break;
635 case 'X': *ScanCode = 0x2d; *code |= 8; break;
636 case 'c': *ScanCode = 0x2e; break;
637 case 'C': *ScanCode = 0x2e; *code |= 8; break;
638 case 'v': *ScanCode = 0x2f; break;
639 case 'V': *ScanCode = 0x2f; *code |= 8; break;
640 case 'b': *ScanCode = 0x30; break;
641 case 'B': *ScanCode = 0x30; *code |= 8; break;
642 case '-': *ScanCode = 0x0c; break;
643 case 'n': *ScanCode = 0x31; break;
644 case 'N': *ScanCode = 0x31; *code |= 8; break;
645 case '+': *ScanCode = 0x0d; *code |= 8; break;
646 case 'm': *ScanCode = 0x32; break;
647 case 'M': *ScanCode = 0x32; *code |= 8; break;
648 case '=': *ScanCode = 0x0d; break;
649 case ',': *ScanCode = 0x33; break;
650 case ';': *ScanCode = 0x27; break;
651 case ')': *ScanCode = 0x0b; *code |= 8; break;
652 // fourth row
653// case 9: *ScanCode = 0x0f; break; // tab
654 case '/': *ScanCode = 0x35; break;
655 case '?': *ScanCode = 0x35; *code |= 8; break;
656 case ' ': *ScanCode = 0x39; break;
657 case '\'': *ScanCode = 0x28; break;
658 case '"': *ScanCode = 0x28; *code |= 8; break;
659 case '~': *ScanCode = 0x29; *code |= 8; break;
660 case '.': *ScanCode = 0x34; break;
661 case ':': *ScanCode = 0x27; *code |= 8; break;
662 case '<': *ScanCode = 0x33; *code |= 8; break;
663// case 13: *ScanCode = 0x1c; break; // enter
664 case '>': *ScanCode = 0x34; *code |= 8; break;
665 // others
666// case 27: *ScanCode = 0x01; break; // esc
667 case '`': *ScanCode = 0x29; break;
668 case '^': *ScanCode = 0x07; *code |= 8; break;
669 case '[': *ScanCode = 0x1a; break;
670 case '{': *ScanCode = 0x1a; *code |= 8; break;
671 case ']': *ScanCode = 0x1b; break;
672 case '}': *ScanCode = 0x1b; *code |= 8; break;
673 case '\\': *ScanCode = 0x2b; break;
674 case '|': *ScanCode = 0x2b; *code |= 8; break;
675 // ctrl keys
676 case 1: *ScanCode = 0x1e; *code |= 16; break; // a
677 case 2: *ScanCode = 0x30; *code |= 16; break; // b
678 }
679
680 if (*ScanCode == 0 && key < 3000)
681 printf("unknown key %d mod %d ascii %d\n", key, mod, ascii);
682
683}
UINT ScanCode
Definition: VirtualKey.c:24
#define printf
Definition: freeldr.h:97
static int mod
Definition: i386-dis.c:1288
#define e
Definition: ke_i.h:82
Definition: inflate.c:139
Definition: copy.c:22

Referenced by QMyScrollView::keyPressEvent(), QMyMainWindow::keyPressEvent(), QMyScrollView::keyReleaseEvent(), and QMyMainWindow::keyReleaseEvent().

◆ hexdump()

void hexdump ( uint8 p,
uint32  len 
)

Definition at line 2282 of file qtewin.cpp.

2283{
2284 uint8 * line = p;
2285 int i, thisline;
2286 uint32 offset = 0;
2287
2288 while (offset < len)
2289 {
2290 printf("%04x ", offset);
2291 thisline = len - offset;
2292 if (thisline > 16)
2293 {
2294 thisline = 16;
2295 }
2296 for (i = 0; i < thisline; i++)
2297 {
2298 printf("%02x ", line[i]);
2299 }
2300 for (; i < 16; i++)
2301 {
2302 printf(" ");
2303 }
2304 for (i = 0; i < thisline; i++)
2305 {
2306 printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
2307 }
2308 printf("\n");
2309 offset += thisline;
2310 line += thisline;
2311 }
2312}
unsigned int uint32
Definition: types.h:32
unsigned char uint8
Definition: types.h:28
GLenum GLsizei len
Definition: glext.h:6722
GLintptr offset
Definition: glext.h:5920
Definition: parser.c:49

◆ is_pixel_on()

bool is_pixel_on ( uint8 data,
int  x,
int  y,
int  width,
int  bpp 
)

Definition at line 1379 of file qtewin.cpp.

1380{
1381 int start, shift;
1382
1383 if (bpp == 1)
1384 {
1385 width = (width + 7) / 8;
1386 start = (y * width) + x / 8;
1387 shift = x % 8;
1388 return (data[start] & (0x80 >> shift)) != 0;
1389 }
1390 else if (bpp == 8)
1391 return data[y * width + x] != 0;
1392 else
1393 return false;
1394}
DWORD bpp
Definition: surface.c:185
GLuint start
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei width
Definition: gl.h:1546
#define shift
Definition: input.c:1755

Referenced by draw_glyph(), ui_create_glyph(), and ui_patblt().

◆ load_licence()

int load_licence ( uint8 **  data)

Definition at line 2257 of file qtewin.cpp.

2258{
2259 return 0;
2260}

◆ main()

int main ( int argc  ,
char **  argv 
)

Definition at line 2528 of file qtewin.cpp.

2529{
2530#ifdef SHARP
2531 g_App = new QPEApplication(argc, argv);
2532#else
2533 g_App = new QApplication(argc, argv, QApplication::GuiServer);
2534 //g_App = new QApplication(argc, argv);
2535#endif
2536 g_SV = new QMyScrollView();
2537 g_App->setMainWidget(g_SV);
2538 g_SV->showMaximized();
2539 if (argc > 1)
2540 {
2543 {
2544 param_connect();
2545 }
2546 }
2547 else
2548 {
2549 g_SV->timer_id = g_SV->startTimer(1000); /* one sec delay, then dialog */
2550 g_App->exec();
2551 }
2552 delete g_SV;
2553 delete g_App;
2554 xfree(g_CM);
2555 xfree(g_BS);
2556 return 0;
2557}
static int argc
Definition: ServiceArgs.c:12
int timer_id
Definition: qtewin.h:80
#define argv
Definition: mplay32.c:18
int param_connect(void)
Definition: qtewin.cpp:2476
void xfree(void *in_val)
Definition: qtewin.cpp:2161
int parse_parameters(int in_argc, char **in_argv)
Definition: qtewin.cpp:2363
static struct QColorMap * g_CM
Definition: qtewin.cpp:118
static QApplication * g_App
Definition: qtewin.cpp:114
static QMyScrollView * g_SV
Definition: qtewin.cpp:117
void get_username_and_hostname(void)
Definition: qtewin.cpp:2315

◆ out_params()

void out_params ( void  )

Definition at line 2340 of file qtewin.cpp.

2341{
2342 fprintf(stderr, "qterdesktop: A Remote Desktop Protocol client.\n");
2343 fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2004 Matt Chapman.\n");
2344 fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
2345 fprintf(stderr, "Usage: qterdesktop [options] server\n");
2346 fprintf(stderr, " -g: desktop geometry (WxH)\n");
2347 fprintf(stderr, " -4: use RDP version 4\n");
2348 fprintf(stderr, " -5: use RDP version 5 (default)\n");
2349 fprintf(stderr, " -t: tcp port)\n");
2350 fprintf(stderr, " -a: connection colour depth\n");
2351 fprintf(stderr, " -u: user name\n");
2352 fprintf(stderr, " -d: domain\n");
2353 fprintf(stderr, " -s: shell\n");
2354 fprintf(stderr, " -c: working directory\n");
2355 fprintf(stderr, " -p: password (- to prompt)\n");
2356 fprintf(stderr, " -n: client hostname\n");
2357 fprintf(stderr, " -f: full screen\n");
2358 fprintf(stderr, " -r sound: enable sound\n");
2359 fprintf(stderr, "\n");
2360}
#define VERSION
Definition: rdesktop.h:45

Referenced by parse_parameters().

◆ param_connect()

int param_connect ( void  )

Definition at line 2476 of file qtewin.cpp.

2477{
2478 QWidget * Desktop;
2479 int dw, dh;
2480
2481#ifdef WITH_RDPSND
2482 // init sound
2483 if (g_rdpsnd)
2484 {
2485 rdpsnd_init();
2486 }
2487#endif
2489 g_directory))
2490 {
2491 g_BS = (uint8*)xmalloc(g_width * g_height * 4);
2492 memset(g_BS, 0, g_width * g_height * 4);
2493 g_clipx = 0;
2494 g_clipy = 0;
2495 g_clipcx = g_width;
2497 g_CM = (QColorMap*)xmalloc(sizeof(struct QColorMap));
2498 memset(g_CM, 0, sizeof(struct QColorMap));
2499 g_CM->NumColors = 256;
2500 g_MW = new QMyMainWindow();
2502 g_MW->show();
2503 g_SV->addChild(g_MW);
2504 g_MW->setMouseTracking(true);
2505 g_SocketNotifier = new QSocketNotifier(g_global_sock,
2506 QSocketNotifier::Read,
2507 g_MW);
2508 g_MW->connect(g_SocketNotifier, SIGNAL(activated(int)), g_MW,
2509 SLOT(dataReceived()));
2510 if (g_fullscreen)
2511 {
2512 Desktop = g_App->desktop();
2513 dw = Desktop->width();
2514 dh = Desktop->height();
2515 if (dw == g_client_width && dh == g_client_height)
2516 {
2517 g_MW->resize(g_client_width - 4, g_client_height - 4);
2518 }
2519 g_SV->showFullScreen();
2520 }
2521 g_MW->setCursor((int)10); /* Qt::BlankCursor */
2522 g_App->exec();
2523 }
2524 return 0;
2525}
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
Definition: rdp.c:1742
RD_BOOL rdpsnd_init(char *optarg)
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
static UINT activated
Definition: msctf.c:70
static char g_shell[128]
Definition: qtewin.cpp:103
static int g_fullscreen
Definition: qtewin.cpp:105
static char g_server[64]
Definition: qtewin.cpp:100
static int g_clipcx
Definition: qtewin.cpp:122
static int g_clipy
Definition: qtewin.cpp:121
static char g_directory[32]
Definition: qtewin.cpp:104
static QSocketNotifier * g_SocketNotifier
Definition: qtewin.cpp:110
void * xmalloc(int size)
Definition: qtewin.cpp:2155
static int g_clipx
Definition: qtewin.cpp:120
static uint32 g_flags
Definition: qtewin.cpp:99
static QMyMainWindow * g_MW
Definition: qtewin.cpp:116
static char g_domain[16]
Definition: qtewin.cpp:101
static int g_global_sock
Definition: qtewin.cpp:106
static int g_clipcy
Definition: qtewin.cpp:123
static char g_password[16]
Definition: qtewin.cpp:102
#define memset(x, y, z)
Definition: compat.h:39

Referenced by main().

◆ parse_parameters()

int parse_parameters ( int  in_argc,
char **  in_argv 
)

Definition at line 2363 of file qtewin.cpp.

2364{
2365 int i;
2366 char * p;
2367
2368 for (i = 1; i < in_argc; i++)
2369 {
2370 strcpy(g_server, in_argv[i]);
2371 if (strcmp(in_argv[i], "-h") == 0)
2372 {
2373 out_params();
2374 return 0;
2375 }
2376 else if (strcmp(in_argv[i], "-g") == 0)
2377 {
2378 g_width = strtol(in_argv[i + 1], &p, 10);
2379 if (*p == 'x')
2380 {
2381 g_height = strtol(p + 1, &p, 10);
2382 }
2383 if (*p == '-')
2384 {
2385 g_client_width = strtol(p + 1, &p, 10);
2386 }
2387 else
2388 {
2391 }
2392 if (*p == 'x')
2393 {
2394 g_client_height = strtol(p + 1, NULL, 10);
2395 }
2396 g_width = (g_width + 3) & ~3;
2397 g_height = (g_height + 3) & ~3;
2398 g_client_width = (g_client_width + 3) & ~3;
2399 g_client_height = (g_client_height + 3) & ~3;
2400 i++;
2401 }
2402 else if (strcmp(in_argv[i], "-4") == 0)
2403 {
2404 g_use_rdp5 = 0;
2405 }
2406 else if (strcmp(in_argv[i], "-5") == 0)
2407 {
2408 g_use_rdp5 = 1;
2409 }
2410 else if (strcmp(in_argv[i], "-a") == 0)
2411 {
2412 g_server_bpp = strtol(in_argv[i + 1], &p, 10);
2413 if (g_server_bpp != 8 &&
2414 g_server_bpp != 16 && g_server_bpp != 24)
2415 {
2416 error("invalid bpp\n");
2417 return 0;
2418 }
2419 i++;
2420 }
2421 else if (strcmp(in_argv[i], "-t") == 0)
2422 {
2423 g_tcp_port_rdp = strtol(in_argv[i + 1], &p, 10);
2424 i++;
2425 }
2426 else if (strcmp(in_argv[i], "-u") == 0)
2427 {
2428 STRNCPY(g_username, in_argv[i + 1], sizeof(g_username));
2429 i++;
2430 }
2431 else if (strcmp(in_argv[i], "-d") == 0)
2432 {
2433 STRNCPY(g_domain, in_argv[i + 1], sizeof(g_domain));
2434 i++;
2435 }
2436 else if (strcmp(in_argv[i], "-s") == 0)
2437 {
2438 STRNCPY(g_shell, in_argv[i + 1], sizeof(g_shell));
2439 i++;
2440 }
2441 else if (strcmp(in_argv[i], "-c") == 0)
2442 {
2443 STRNCPY(g_directory, in_argv[i + 1], sizeof(g_directory));
2444 i++;
2445 }
2446 else if (strcmp(in_argv[i], "-p") == 0)
2447 {
2448 STRNCPY(g_password, in_argv[i + 1], sizeof(g_password));
2450 i++;
2451 }
2452 else if (strcmp(in_argv[i], "-n") == 0)
2453 {
2454 STRNCPY(g_hostname, in_argv[i + 1], sizeof(g_hostname));
2455 i++;
2456 }
2457 else if (strcmp(in_argv[i], "-f") == 0)
2458 {
2459 g_fullscreen = 1;
2460 }
2461 else if (strcmp(in_argv[i], "-r") == 0)
2462 {
2463 if (strcmp(in_argv[i + 1], "sound") == 0)
2464 {
2465#ifdef WITH_RDPSND
2466 g_rdpsnd = 1;
2467#endif
2468 }
2469 i++;
2470 }
2471 }
2472 return 1;
2473}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
#define error(str)
Definition: mkdosfs.c:1605
#define RDP_LOGON_AUTO
Definition: constants.h:261
int g_tcp_port_rdp
Definition: tcp.c:75
int g_use_rdp5
Definition: qtewin.cpp:59
void out_params(void)
Definition: qtewin.cpp:2340

Referenced by main().

◆ rd()

int rd ( double  in)

Definition at line 841 of file qtewin.cpp.

842{
843 return (int)(in + 0.50);
844}
GLuint in
Definition: glext.h:9616

◆ rd_close_file()

void rd_close_file ( int  fd)

Definition at line 2227 of file qtewin.cpp.

2228{
2229 return;
2230}

◆ rd_lock_file()

BOOL rd_lock_file ( int  fd,
int  start,
int  len 
)

Definition at line 2251 of file qtewin.cpp.

2252{
2253 return False;
2254}
#define False
Definition: types.h:25

◆ rd_lseek_file()

int rd_lseek_file ( int  fd,
int  offset 
)

Definition at line 2245 of file qtewin.cpp.

2246{
2247 return 0;
2248}

◆ rd_open_file()

int rd_open_file ( char filename)

Definition at line 2221 of file qtewin.cpp.

2222{
2223 return 0;
2224}

◆ rd_pstcache_mkdir()

BOOL rd_pstcache_mkdir ( void  )

Definition at line 2215 of file qtewin.cpp.

2216{
2217 return 0;
2218}

◆ rd_read_file()

int rd_read_file ( int  fd,
void ptr,
int  len 
)

Definition at line 2233 of file qtewin.cpp.

2234{
2235 return 0;
2236}

◆ rd_write_file()

int rd_write_file ( int  fd,
void ptr,
int  len 
)

Definition at line 2239 of file qtewin.cpp.

2240{
2241 return 0;
2242}

◆ read_keyboard_state()

unsigned int read_keyboard_state ( void  )

Definition at line 1457 of file qtewin.cpp.

1458{
1459 return 0;
1460}

◆ redraw()

◆ rop()

int rop ( int  rop,
int  src,
int  dst 
)

Definition at line 1006 of file qtewin.cpp.

1007{
1008 switch (rop)
1009 {
1010 case 0x0: return 0;
1011 case 0x1: return NOT (src | dst);
1012 case 0x2: return NOT (src) & dst;
1013 case 0x3: return NOT (src);
1014 case 0x4: return src & NOT (dst);
1015 case 0x5: return NOT (dst);
1016 case 0x6: return src ^ dst;
1017 case 0x7: return NOT (src & dst);
1018 case 0x8: return src & dst;
1019 case 0x9: return NOT (src) ^ dst;
1020 case 0xa: return dst;
1021 case 0xb: return NOT (src) | dst;
1022 case 0xc: return src;
1023 case 0xd: return src | NOT (dst);
1024 case 0xe: return src | dst;
1025 case 0xf: return NOT (0);
1026 }
1027 return dst;
1028}
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define NOT(x)
Definition: qtewin.cpp:1003
int rop(int rop, int src, int dst)
Definition: qtewin.cpp:1006

Referenced by rop(), and set_pixel().

◆ save_licence()

void save_licence ( uint8 data,
int  length 
)

Definition at line 2263 of file qtewin.cpp.

2264{
2265}

◆ set_pixel()

void set_pixel ( int  x,
int  y,
int  pixel,
int  op = 0xc 
)

Definition at line 1049 of file qtewin.cpp.

1050{
1051 int p;
1052
1053 if (x >= g_clipx && x < (g_clipx + g_clipcx) &&
1054 y >= g_clipy && y < (g_clipy + g_clipcy))
1055 {
1056 if (x >= 0 && x < g_width && y >= 0 && y < g_height)
1057 {
1058 if (op == 0xc)
1059 {
1060 if (g_server_bpp == 8)
1061 {
1062 SETPIXEL8(g_BS, x, y, g_width, pixel);
1063 }
1064 else if (g_server_bpp == 16)
1065 {
1066 SETPIXEL16(g_BS, x, y, g_width, pixel);
1067 }
1068 else if (g_server_bpp == 24)
1069 {
1070 SETPIXEL32(g_BS, x, y, g_width, pixel);
1071 }
1072 }
1073 else
1074 {
1075 if (g_server_bpp == 8)
1076 {
1077 p = GETPIXEL8(g_BS, x, y, g_width);
1078 p = rop(op, pixel, p);
1079 SETPIXEL8(g_BS, x, y, g_width, p);
1080 }
1081 else if (g_server_bpp == 16)
1082 {
1083 p = GETPIXEL16(g_BS, x, y, g_width);
1084 p = rop(op, pixel, p);
1085 SETPIXEL16(g_BS, x, y, g_width, p);
1086 }
1087 else if (g_server_bpp == 24)
1088 {
1089 p = GETPIXEL32(g_BS, x, y, g_width);
1090 p = rop(op, pixel, p);
1091 SETPIXEL32(g_BS, x, y, g_width, p);
1092 }
1093 }
1094 }
1095 }
1096}
UINT op
Definition: effect.c:236

Referenced by draw_glyph(), fill_rect(), ui_desktop_restore(), ui_destblt(), ui_line(), ui_memblt(), ui_paint_bitmap(), ui_patblt(), and ui_screenblt().

◆ set_pixel_on()

void set_pixel_on ( uint8 data,
int  x,
int  y,
int  width,
int  bpp,
uint8  pixel 
)

Definition at line 1397 of file qtewin.cpp.

1398{
1399 if (bpp == 8)
1400 data[y * width + x] = pixel;
1401}

Referenced by ui_create_glyph().

◆ ui_begin_update()

void ui_begin_update ( void  )

Definition at line 1537 of file qtewin.cpp.

1538{
1539}

◆ ui_bell()

void ui_bell ( void  )

Definition at line 1565 of file qtewin.cpp.

1566{
1567 g_App->beep();
1568}

◆ ui_create_bitmap()

HBITMAP ui_create_bitmap ( int  width,
int  height,
uint8 data 
)

Definition at line 1284 of file qtewin.cpp.

1285{
1286 struct bitmap * the_bitmap;
1288 int i, j;
1289 int r, g, b, pixel;
1290
1292 the_bitmap = (struct bitmap*)xmalloc(sizeof(struct bitmap));
1293 the_bitmap->w = width;
1294 the_bitmap->h = height;
1295 the_bitmap->data = bitmap_data;
1296 if (g_server_bpp == 8)
1297 {
1298 for (i = 0; i < height; i++)
1299 for (j = 0; j < width; j++)
1300 bitmap_data[i * width + j] = data[i * width + j];
1301 }
1302 else if (g_server_bpp == 16)
1303 {
1304 for (i = 0; i < height; i++)
1305 for (j = 0; j < width; j++)
1306 *(((uint16*)bitmap_data) + (i * width + j)) =
1307 *(((uint16*)data) + (i * width + j));
1308 }
1309 else if (g_server_bpp == 24)
1310 {
1311 for (i = 0; i < height; i++)
1312 for (j = 0; j < width; j++)
1313 {
1314 r = data[(i * width + j) * 3 + 0];
1315 g = data[(i * width + j) * 3 + 1];
1316 b = data[(i * width + j) * 3 + 2];
1317 pixel = (r << 16) | (g << 8) | b;
1318 SETPIXEL32(bitmap_data, j, i, width, pixel);
1319 }
1320 }
1321 return the_bitmap;
1322}
unsigned short uint16
Definition: types.h:30
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
#define b
Definition: ke_i.h:79

◆ ui_create_colourmap()

HCOLOURMAP ui_create_colourmap ( COLOURMAP colours)

Definition at line 1507 of file qtewin.cpp.

1508{
1509 int i;
1510 int x;
1511 uint8 r, g, b;
1512 i = 0;
1513 while (i < colours->ncolours && i < 256)
1514 {
1515 r = colours->colours[i].red;
1516 g = colours->colours[i].green;
1517 b = colours->colours[i].blue;
1518 x = (r << 16) | (g << 8) | b;
1519 g_CM->RGBColors[i] = x;
1520 i++;
1521 }
1522 g_CM->NumColors = colours->ncolours;
1523 return g_CM;
1524}
uint8 red
Definition: types.h:57
uint8 blue
Definition: types.h:59
uint8 green
Definition: types.h:58
uint16 ncolours
Definition: types.h:66
COLOURENTRY * colours
Definition: types.h:67

◆ ui_create_cursor()

HCURSOR ui_create_cursor ( uint32  x,
uint32  y,
int  width,
int  height,
uint8 andmask,
uint8 xormask 
)

Definition at line 1438 of file qtewin.cpp.

1441{
1442 return (void*)1;
1443}

◆ ui_create_glyph()

HGLYPH ui_create_glyph ( int  width,
int  height,
uint8 data 
)

Definition at line 1404 of file qtewin.cpp.

1405{
1406 int i, j;
1407 uint8* glyph_data;
1408 struct bitmap* the_glyph;
1409
1410 glyph_data = (uint8*)xmalloc(width * height);
1411 the_glyph = (struct bitmap*)xmalloc(sizeof(struct bitmap));
1412 the_glyph->w = width;
1413 the_glyph->h = height;
1414 the_glyph->data = glyph_data;
1415 memset(glyph_data, 0, width * height);
1416 for (i = 0; i < height; i++)
1417 for (j = 0; j < width; j++)
1418 if (is_pixel_on(data, j, i, width, 1))
1419 set_pixel_on(glyph_data, j, i, width, 8, 255);
1420 return the_glyph;
1421}
void set_pixel_on(uint8 *data, int x, int y, int width, int bpp, uint8 pixel)
Definition: qtewin.cpp:1397

◆ ui_desktop_restore()

void ui_desktop_restore ( uint32  offset,
int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 2108 of file qtewin.cpp.

2109{
2110 uint8 * data;
2111 int i, j;
2112 int Bpp;
2113
2114 Bpp = 4;
2115 switch (g_server_bpp)
2116 {
2117 case 8: Bpp = 1; break;
2118 case 15: Bpp = 2; break;
2119 case 16: Bpp = 2; break;
2120 }
2121 offset *= Bpp;
2122 data = cache_get_desktop(offset, cx, cy, Bpp);
2123 if (g_server_bpp == 8)
2124 {
2125 for (i = 0; i < cy; i++)
2126 for (j = 0; j < cx; j++)
2127 set_pixel(x + j, y + i, data[i * cx + j]);
2128 }
2129 else if (g_server_bpp == 16)
2130 {
2131 for (i = 0; i < cy; i++)
2132 for (j = 0; j < cx; j++)
2133 set_pixel(x + j, y + i, *(((uint16*)data) + (i * cx + j)));
2134 }
2135 else if (g_server_bpp == 24)
2136 {
2137 for (i = 0; i < cy; i++)
2138 for (j = 0; j < cx; j++)
2139 set_pixel(x + j, y + i, *(((uint32*)data) + (i * cx + j)));
2140 }
2141 redraw(x, y, cx, cy);
2142}
uint8 * cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel)
Definition: cache.c:353
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248

◆ ui_desktop_save()

void ui_desktop_save ( uint32  offset,
int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 2065 of file qtewin.cpp.

2066{
2067 uint8 * data;
2068 int i, j, Bpp, pixel;
2069
2070 Bpp = 4;
2071 switch (g_server_bpp)
2072 {
2073 case 8: Bpp = 1; break;
2074 case 15: Bpp = 2; break;
2075 case 16: Bpp = 2; break;
2076 }
2077 data = (uint8*)xmalloc(cx * cy * Bpp);
2078 if (g_server_bpp == 8)
2079 {
2080 for (i = 0; i < cy; i++)
2081 for (j = 0; j < cx; j++)
2082 {
2083 pixel = get_pixel(x + j, y + i);
2084 SETPIXEL8(data, j, i, cx, pixel);
2085 }
2086 }
2087 else if (g_server_bpp == 16)
2088 {
2089 for (i = 0; i < cy; i++)
2090 for (j = 0; j < cx; j++)
2091 {
2092 pixel = get_pixel(x + j, y + i);
2093 SETPIXEL16(data, j, i, cx, pixel);
2094 }
2095 }
2096 else if (g_server_bpp == 24)
2097 {
2098 for (i = 0; i < cy; i++)
2099 for (j = 0; j < cx; j++)
2100 *(((uint32*)data) + (i * cx + j)) = get_pixel(x + j, y + i);
2101 }
2102 offset *= Bpp;
2103 cache_put_desktop(offset, cx, cy, cx * Bpp, Bpp, data);
2104 xfree(data);
2105}
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 *data)
Definition: cache.c:371
int get_pixel(int x, int y)
Definition: qtewin.cpp:1031

◆ ui_destblt()

void ui_destblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 1571 of file qtewin.cpp.

1572{
1573 int i, j;
1574
1575
1576 if (opcode == 0x0) /* black */
1577 {
1578 for (i = 0; i < cy; i++)
1579 for (j = 0; j < cx; j++)
1580 set_pixel(x + j, y + i, 0, 0xc);
1581 }
1582 else if (opcode == 0xf) /* white */
1583 {
1584 for (i = 0; i < cy; i++)
1585 for (j = 0; j < cx; j++)
1586 set_pixel(x + j, y + i, 0xffffff, 0xc);
1587 }
1588 else
1589 {
1590 for (i = 0; i < cy; i++)
1591 for (j = 0; j < cx; j++)
1592 set_pixel(x + j, y + i, get_pixel(x + j, y + i), opcode);
1593 }
1594 redraw(x, y, cx, cy);
1595}

◆ ui_destroy_bitmap()

void ui_destroy_bitmap ( HBITMAP  bmp)

Definition at line 1365 of file qtewin.cpp.

1366{
1367 struct bitmap* the_bitmap;
1368
1369 the_bitmap = (struct bitmap*)bmp;
1370 if (the_bitmap != NULL)
1371 {
1372 if (the_bitmap->data != NULL)
1373 xfree(the_bitmap->data);
1374 xfree(the_bitmap);
1375 }
1376}
BITMAP bmp
Definition: alphablend.c:62

◆ ui_destroy_colourmap()

void ui_destroy_colourmap ( HCOLOURMAP  map)

Definition at line 1532 of file qtewin.cpp.

1533{
1534}

◆ ui_destroy_cursor()

void ui_destroy_cursor ( HCURSOR  )

Definition at line 1502 of file qtewin.cpp.

1503{
1504}

◆ ui_destroy_glyph()

void ui_destroy_glyph ( HGLYPH  glyph)

Definition at line 1424 of file qtewin.cpp.

1425{
1426 struct bitmap* the_glyph;
1427
1428 the_glyph = (struct bitmap*)glyph;
1429 if (the_glyph != NULL)
1430 {
1431 if (the_glyph->data != NULL)
1432 xfree(the_glyph->data);
1433 xfree(the_glyph);
1434 }
1435}

◆ ui_draw_text()

void ui_draw_text ( uint8  font,
uint8  flags,
uint8  opcode,
int  mixmode,
int  x,
int  y,
int  clipx,
int  clipy,
int  clipcx,
int  clipcy,
int  boxx,
int  boxy,
int  boxcx,
int  boxcy,
BRUSH brush,
int  bgcolour,
int  fgcolour,
uint8 text,
uint8  length 
)

Definition at line 1989 of file qtewin.cpp.

1994{
1995 FONTGLYPH * glyph;
1996 int i, j, xyoffset;
1997 DATABLOB * entry;
1998
1999 if (boxx + boxcx > g_width)
2000 boxcx = g_width - boxx;
2001 if (boxy + boxcy > g_height)
2002 boxcy = g_height - boxy;
2003
2004 if (boxcx > 1)
2005 fill_rect(boxx, boxy, boxcx, boxcy, bgcolour);
2006 else if (mixmode == MIX_OPAQUE)
2007 fill_rect(clipx, clipy, clipcx, clipcy, bgcolour);
2008
2009 /* Paint text, character by character */
2010 for (i = 0; i < length;)
2011 {
2012 switch (text[i])
2013 {
2014 case 0xff:
2015 if (i + 2 < length)
2016 cache_put_text(text[i + 1], text, text[i + 2]);
2017 else
2018 {
2019 error("this shouldn't be happening\n");
2020 exit(1);
2021 }
2022 /* this will move pointer from start to first character after FF command */
2023 length -= i + 3;
2024 text = &(text[i + 3]);
2025 i = 0;
2026 break;
2027
2028 case 0xfe:
2029 entry = cache_get_text(text[i + 1]);
2030 if (entry != NULL)
2031 {
2032 if ((((uint8 *) (entry->data))[1] == 0) && (!(flags & TEXT2_IMPLICIT_X)))
2033 {
2034 if (flags & TEXT2_VERTICAL)
2035 y += text[i + 2];
2036 else
2037 x += text[i + 2];
2038 }
2039 for (j = 0; j < entry->size; j++)
2040 DO_GLYPH(((uint8 *) (entry->data)), j);
2041 }
2042 if (i + 2 < length)
2043 i += 3;
2044 else
2045 i += 2;
2046 length -= i;
2047 /* this will move pointer from start to first character after FE command */
2048 text = &(text[i]);
2049 i = 0;
2050 break;
2051
2052 default:
2053 DO_GLYPH(text, i);
2054 i++;
2055 break;
2056 }
2057 }
2058 if (boxcx > 1)
2059 redraw(boxx, boxy, boxcx, boxcy);
2060 else
2061 redraw(clipx, clipy, clipcx, clipcy);
2062}
void cache_put_text(uint8 cache_id, void *data, int length)
Definition: cache.c:335
DATABLOB * cache_get_text(uint8 cache_id)
Definition: cache.c:325
#define MIX_OPAQUE
Definition: constants.h:273
const WCHAR * text
Definition: package.c:1799
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
uint32_t entry
Definition: isohybrid.c:63
#define DO_GLYPH(ttext, idx)
Definition: qtewin.cpp:1957
void fill_rect(int x, int y, int cx, int cy, int colour, int opcode=0xc)
Definition: qtewin.cpp:1599
#define exit(n)
Definition: config.h:202

◆ ui_ellipse()

void ui_ellipse ( uint8  opcode,
uint8  fillmode,
int  x,
int  y,
int  cx,
int  cy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)

Definition at line 1495 of file qtewin.cpp.

1498{
1499}

◆ ui_end_update()

void ui_end_update ( void  )

Definition at line 1542 of file qtewin.cpp.

1543{
1544}

◆ ui_get_numlock_state()

uint16 ui_get_numlock_state ( uint32  state)

Definition at line 1451 of file qtewin.cpp.

1452{
1453 return 0;
1454}

◆ ui_line()

void ui_line ( uint8  opcode,
int  startx,
int  starty,
int  endx,
int  endy,
PEN pen 
)

Definition at line 1864 of file qtewin.cpp.

1866{
1867 int dx, dy, incx, incy, dpr, dpru, p, left, top, right, bottom;
1868
1869 if (startx > endx)
1870 {
1871 dx = startx - endx;
1872 incx = -1;
1873 left = endx;
1874 right = startx;
1875 }
1876 else
1877 {
1878 dx = endx - startx;
1879 incx = 1;
1880 left = startx;
1881 right = endx;
1882 }
1883 if (starty > endy)
1884 {
1885 dy = starty - endy;
1886 incy = -1;
1887 top = endy;
1888 bottom = starty;
1889 }
1890 else
1891 {
1892 dy = endy - starty;
1893 incy = 1;
1894 top = starty;
1895 bottom = endy;
1896 }
1897 if (dx >= dy)
1898 {
1899 dpr = dy << 1;
1900 dpru = dpr - (dx << 1);
1901 p = dpr - dx;
1902 for (; dx >= 0; dx--)
1903 {
1904 set_pixel(startx, starty, pen->colour, opcode);
1905 if (p > 0)
1906 {
1907 startx += incx;
1908 starty += incy;
1909 p += dpru;
1910 }
1911 else
1912 {
1913 startx += incx;
1914 p += dpr;
1915 }
1916 }
1917 }
1918 else
1919 {
1920 dpr = dx << 1;
1921 dpru = dpr - (dy << 1);
1922 p = dpr - dy;
1923 for (; dy >= 0; dy--)
1924 {
1925 set_pixel(startx, starty, pen->colour, opcode);
1926 if (p > 0)
1927 {
1928 startx += incx;
1929 starty += incy;
1930 p += dpru;
1931 }
1932 else
1933 {
1934 starty += incy;
1935 p += dpr;
1936 }
1937 }
1938 }
1939 redraw(left, top, (right - left) + 1, (bottom - top) + 1);
1940}
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
uint32 colour
Definition: types.h:86

Referenced by ui_polyline().

◆ ui_memblt()

void ui_memblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
HBITMAP  src,
int  srcx,
int  srcy 
)

Definition at line 1777 of file qtewin.cpp.

1779{
1780 int i, j, p;
1781 struct bitmap * the_bitmap;
1782
1783 the_bitmap = (struct bitmap*)src;
1784 if (the_bitmap == NULL)
1785 return;
1786#ifdef QT_OPTI
1787 if (opcode == 0xc) /* optimize */
1788 {
1789 if (WarpCoords(&x, &y, &cx, &cy, &srcx, &srcy))
1790 {
1791 if (g_server_bpp == 8)
1792 {
1793 for (i = 0; i < cy; i++)
1794 for (j = 0; j < cx; j++)
1795 {
1796 p = GETPIXEL8(the_bitmap->data, srcx + j, srcy + i, the_bitmap->w);
1797 SETPIXEL8(g_BS, x + j, y + i, g_width, p);
1798 }
1799 }
1800 else if (g_server_bpp == 16)
1801 {
1802 for (i = 0; i < cy; i++)
1803 for (j = 0; j < cx; j++)
1804 {
1805 p = GETPIXEL16(the_bitmap->data, srcx + j, srcy + i, the_bitmap->w);
1806 SETPIXEL16(g_BS, x + j, y + i, g_width, p);
1807 }
1808 }
1809 else if (g_server_bpp == 24)
1810 {
1811 for (i = 0; i < cy; i++)
1812 for (j = 0; j < cx; j++)
1813 {
1814 p = GETPIXEL32(the_bitmap->data, srcx + j, srcy + i, the_bitmap->w);
1815 SETPIXEL32(g_BS, x + j, y + i, g_width, p);
1816 }
1817 }
1818 }
1819 }
1820 else
1821#endif
1822 {
1823 if (g_server_bpp == 8)
1824 {
1825 for (i = 0; i < cy; i++)
1826 for (j = 0; j < cx; j++)
1827 if ((i + srcy) < the_bitmap->h && (j + srcx) < the_bitmap->w)
1828 set_pixel(x + j, y + i,
1829 the_bitmap->data[(i + srcy) * the_bitmap->w + (j + srcx)],
1830 opcode);
1831 }
1832 else if (g_server_bpp == 16)
1833 {
1834 for (i = 0; i < cy; i++)
1835 for (j = 0; j < cx; j++)
1836 if ((i + srcy) < the_bitmap->h && (j + srcx) < the_bitmap->w)
1837 set_pixel(x + j, y + i,
1838 *(((uint16*)the_bitmap->data) + ((i + srcy) * the_bitmap->w + (j + srcx))),
1839 opcode);
1840 }
1841 else if (g_server_bpp == 24)
1842 {
1843 for (i = 0; i < cy; i++)
1844 for (j = 0; j < cx; j++)
1845 if ((i + srcy) < the_bitmap->h && (j + srcx) < the_bitmap->w)
1846 set_pixel(x + j, y + i,
1847 *(((uint32*)the_bitmap->data) + ((i + srcy) * the_bitmap->w + (j + srcx))),
1848 opcode);
1849 }
1850 }
1851 redraw(x, y, cx, cy);
1852}

◆ ui_move_pointer()

void ui_move_pointer ( int  x,
int  y 
)

Definition at line 1274 of file qtewin.cpp.

1275{
1276}

◆ ui_paint_bitmap()

void ui_paint_bitmap ( int  x,
int  y,
int  cx,
int  cy,
int  width,
int  height,
uint8 data 
)

Definition at line 1325 of file qtewin.cpp.

1327{
1328 int i, j;
1329 int r, g, b, pixel;
1330
1331 if (g_server_bpp == 8)
1332 {
1333 for (i = 0; i < cy; i++)
1334 for (j = 0; j < cx; j++)
1335 if (i < height)
1336 if (j < width)
1337 set_pixel(x + j, y + i, data[i * width + j]);
1338 }
1339 else if (g_server_bpp == 16)
1340 {
1341 for (i = 0; i < cy; i++)
1342 for (j = 0; j < cx; j++)
1343 if (i < height)
1344 if (j < width)
1345 set_pixel(x + j, y + i, *(((uint16*)data) + (i * width + j)));
1346 }
1347 else if (g_server_bpp == 24)
1348 {
1349 for (i = 0; i < cy; i++)
1350 for (j = 0; j < cx; j++)
1351 if (i < height)
1352 if (j < width)
1353 {
1354 r = data[(i * width + j) * 3 + 0];
1355 g = data[(i * width + j) * 3 + 1];
1356 b = data[(i * width + j) * 3 + 2];
1357 pixel = (r << 16) | (g << 8) | b;
1358 set_pixel(x + j, y + i, pixel);
1359 }
1360 }
1361 redraw(x, y, cx, cy);
1362}

◆ ui_patblt()

void ui_patblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)

Definition at line 1649 of file qtewin.cpp.

1651{
1652 int i, j;
1653 uint8 ipattern[8];
1654
1655 switch (brush->style)
1656 {
1657 case 0:
1658 fill_rect(x, y, cx, cy, fgcolour, opcode);
1659 break;
1660 case 3:
1661 for (i = 0; i < 8; i++)
1662 ipattern[i] = ~brush->pattern[7 - i];
1663 for (i = 0; i < cy; i++)
1664 for (j = 0; j < cx; j++)
1665 if (is_pixel_on(ipattern, (x + j + brush->xorigin) % 8,
1666 (y + i + brush->yorigin) % 8, 8, 1))
1667 set_pixel(x + j, y + i, fgcolour, opcode);
1668 else
1669 set_pixel(x + j, y + i, bgcolour, opcode);
1670 break;
1671 }
1672 redraw(x, y, cx, cy);
1673}
#define for
Definition: utility.h:88

◆ ui_polygon()

void ui_polygon ( uint8  opcode,
uint8  fillmode,
POINT point,
int  npoints,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)

Definition at line 1468 of file qtewin.cpp.

1470{
1471}

◆ ui_polyline()

void ui_polyline ( uint8  opcode,
POINT points,
int  npoints,
PEN pen 
)

Definition at line 1475 of file qtewin.cpp.

1476{
1477 int i, x, y, dx, dy;
1478
1479 if (npoints > 0)
1480 {
1481 x = points[0].x;
1482 y = points[0].y;
1483 for (i = 1; i < npoints; i++)
1484 {
1485 dx = points[i].x;
1486 dy = points[i].y;
1487 ui_line(opcode, x, y, x + dx, y + dy, pen);
1488 x = x + dx;
1489 y = y + dy;
1490 }
1491 }
1492}
GLsizei const GLfloat * points
Definition: glext.h:8112
void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
Definition: qtewin.cpp:1864

◆ ui_rect()

void ui_rect ( int  x,
int  y,
int  cx,
int  cy,
int  colour 
)

Definition at line 1642 of file qtewin.cpp.

1643{
1644 fill_rect(x, y, cx, cy, colour);
1645 redraw(x, y, cx, cy);
1646}

◆ ui_reset_clip()

void ui_reset_clip ( void  )

Definition at line 1556 of file qtewin.cpp.

1557{
1558 g_clipx = 0;
1559 g_clipy = 0;
1560 g_clipcx = g_width;
1562}

◆ ui_resize_window()

void ui_resize_window ( void  )

Definition at line 1463 of file qtewin.cpp.

1464{
1465}

◆ ui_screenblt()

void ui_screenblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
int  srcx,
int  srcy 
)

Definition at line 1676 of file qtewin.cpp.

1678{
1679 int i, j, pixel;
1680 uint8 * temp;
1681
1682 temp = (uint8*)xmalloc(cx * cy * 4);
1683#ifdef QT_OPTI
1684 if (opcode == 0xc)
1685 {
1686 if (WarpCoords(&x, &y, &cx, &cy, &srcx, &srcy))
1687 {
1688 if (g_server_bpp == 8)
1689 {
1690 for (i = 0; i < cy; i++)
1691 for (j = 0; j < cx; j++)
1692 {
1693 pixel = GETPIXEL8(g_BS, srcx + j, srcy + i, g_width);
1694 SETPIXEL8(temp, j, i, cx, pixel);
1695 }
1696 for (i = 0; i < cy; i++)
1697 for (j = 0; j < cx; j++)
1698 {
1699 pixel = GETPIXEL8(temp, j, i, cx);
1700 SETPIXEL8(g_BS, x + j, y + i, g_width, pixel);
1701 }
1702 }
1703 else if (g_server_bpp == 16)
1704 {
1705 for (i = 0; i < cy; i++)
1706 for (j = 0; j < cx; j++)
1707 {
1708 pixel = GETPIXEL16(g_BS, srcx + j, srcy + i, g_width);
1709 SETPIXEL16(temp, j, i, cx, pixel);
1710 }
1711 for (i = 0; i < cy; i++)
1712 for (j = 0; j < cx; j++)
1713 {
1714 pixel = GETPIXEL16(temp, j, i, cx);
1715 SETPIXEL16(g_BS, x + j, y + i, g_width, pixel);
1716 }
1717 }
1718 else if (g_server_bpp == 24)
1719 {
1720 for (i = 0; i < cy; i++)
1721 for (j = 0; j < cx; j++)
1722 {
1723 pixel = GETPIXEL32(g_BS, srcx + j, srcy + i, g_width);
1724 SETPIXEL32(temp, j, i, cx, pixel);
1725 }
1726 for (i = 0; i < cy; i++)
1727 for (j = 0; j < cx; j++)
1728 {
1729 pixel = GETPIXEL32(temp, j, i, cx);
1730 SETPIXEL32(g_BS, x + j, y + i, g_width, pixel);
1731 }
1732 }
1733 }
1734 }
1735 else
1736#endif
1737 {
1738 if (g_server_bpp == 8)
1739 {
1740 for (i = 0; i < cy; i++)
1741 for (j = 0; j < cx; j++)
1742 temp[i * cx + j] = get_pixel(srcx + j, srcy + i);
1743 for (i = 0; i < cy; i++)
1744 for (j = 0; j < cx; j++)
1745 set_pixel(x + j, y + i, temp[i * cx + j], opcode);
1746 }
1747 else if (g_server_bpp == 16)
1748 {
1749 for (i = 0; i < cy; i++)
1750 for (j = 0; j < cx; j++)
1751 {
1752 pixel = get_pixel(srcx + j, srcy + i);
1753 SETPIXEL16(temp, j, i, cx, pixel);
1754 }
1755 for (i = 0; i < cy; i++)
1756 for (j = 0; j < cx; j++)
1757 {
1758 pixel = GETPIXEL16(temp, j, i, cx);
1759 set_pixel(x + j, y + i, pixel, opcode);
1760 }
1761 }
1762 else if (g_server_bpp == 24)
1763 {
1764 for (i = 0; i < cy; i++)
1765 for (j = 0; j < cx; j++)
1766 *(((uint32*)temp) + (i * cx + j)) = get_pixel(srcx + j, srcy + i);
1767 for (i = 0; i < cy; i++)
1768 for (j = 0; j < cx; j++)
1769 set_pixel(x + j, y + i, *(((uint32*)temp) + (i * cx + j)), opcode);
1770 }
1771 }
1772 xfree(temp);
1773 redraw(x, y, cx, cy);
1774}
static calc_node_t temp
Definition: rpn_ieee.c:38

◆ ui_select()

int ui_select ( int  rdp_socket)

Definition at line 1266 of file qtewin.cpp.

1267{
1268 if (g_global_sock == 0)
1269 g_global_sock = rdp_socket;
1270 return 1;
1271}

◆ ui_set_clip()

void ui_set_clip ( int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 1547 of file qtewin.cpp.

1548{
1549 g_clipx = x;
1550 g_clipy = y;
1551 g_clipcx = cx;
1552 g_clipcy = cy;
1553}

◆ ui_set_colourmap()

void ui_set_colourmap ( HCOLOURMAP  map)

Definition at line 1527 of file qtewin.cpp.

1528{
1529}

◆ ui_set_cursor()

void ui_set_cursor ( HCURSOR  )

Definition at line 1446 of file qtewin.cpp.

1447{
1448}

◆ ui_set_null_cursor()

void ui_set_null_cursor ( void  )

Definition at line 1279 of file qtewin.cpp.

1280{
1281}

◆ ui_triblt()

void ui_triblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
HBITMAP  src,
int  srcx,
int  srcy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)

Definition at line 1856 of file qtewin.cpp.

1859{
1860}

◆ unimpl()

void unimpl ( char format,
  ... 
)

Definition at line 2193 of file qtewin.cpp.

2194{
2195 va_list ap;
2196
2197 fprintf(stderr, "NOT IMPLEMENTED: ");
2198 va_start(ap, format);
2200 va_end(ap);
2201}

◆ warning()

void warning ( char format,
  ... 
)

Definition at line 2182 of file qtewin.cpp.

2183{
2184 va_list ap;
2185
2186 fprintf(stderr, "WARNING: ");
2187 va_start(ap, format);
2189 va_end(ap);
2190}

◆ WarpCoords()

bool WarpCoords ( int x,
int y,
int cx,
int cy,
int srcx,
int srcy 
)

Definition at line 1100 of file qtewin.cpp.

1101{
1102 int dx, dy;
1103 QRect InRect(*x, *y, *cx, *cy);
1104 QRect OutRect;
1106 OutRect = InRect.intersect(CRect);
1107 if (OutRect.isEmpty())
1108 return false;
1109 dx = OutRect.x() - InRect.x();
1110 dy = OutRect.y() - InRect.y();
1111 *x = OutRect.x();
1112 *y = OutRect.y();
1113 *cx = OutRect.width();
1114 *cy = OutRect.height();
1115 if (srcx != NULL)
1116 *srcx = *srcx + dx;
1117 if (srcy != NULL)
1118 *srcy = *srcy + dy;
1119 return true;
1120}

Referenced by fill_rect(), redraw(), ui_memblt(), and ui_screenblt().

◆ WriteString()

void WriteString ( QFile *  File,
QString *  Line 
)

Definition at line 401 of file qtewin.cpp.

402{
403 File->writeBlock((const char*)(*Line), Line->length());
404}
Definition: ncftp.h:79

Referenced by QMyDialog::SaveClicked().

◆ xfree()

void xfree ( void in_val)

Definition at line 2161 of file qtewin.cpp.

2162{
2163 if (in_val != NULL)
2164 {
2165 free(in_val);
2166 }
2167}
#define free
Definition: debug_ros.c:5

Referenced by main(), ui_desktop_save(), ui_destroy_bitmap(), ui_destroy_glyph(), and ui_screenblt().

◆ xmalloc()

void * xmalloc ( int  size)

Definition at line 2155 of file qtewin.cpp.

2156{
2157 return malloc(size);
2158}
#define malloc
Definition: debug_ros.c:4
GLsizeiptr size
Definition: glext.h:5919

Referenced by param_connect(), ui_create_bitmap(), ui_create_glyph(), ui_desktop_save(), and ui_screenblt().

◆ xrealloc()

void * xrealloc ( void in_val,
int  size 
)

Definition at line 2145 of file qtewin.cpp.

2146{
2147 if (size < 1)
2148 {
2149 size = 1;
2150 }
2151 return realloc(in_val, size);
2152}
#define realloc
Definition: debug_ros.c:6

◆ xstrdup()

char * xstrdup ( const char s)

Definition at line 2170 of file qtewin.cpp.

2171{
2172 char * mem = strdup(s);
2173 if (mem == NULL)
2174 {
2175 perror("strdup");
2176 exit(1);
2177 }
2178 return mem;
2179}
GLdouble s
Definition: gl.h:2039
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
Definition: mem.c:156

Variable Documentation

◆ g_App

QApplication* g_App = 0
static

◆ g_bitmap_cache

int g_bitmap_cache = 1

Definition at line 56 of file qtewin.cpp.

◆ g_bitmap_cache_persist_enable

int g_bitmap_cache_persist_enable = 0

Definition at line 57 of file qtewin.cpp.

◆ g_bitmap_cache_precache

int g_bitmap_cache_precache = 1

Definition at line 58 of file qtewin.cpp.

◆ g_bitmap_compression

int g_bitmap_compression = 1

Definition at line 61 of file qtewin.cpp.

◆ g_BS

◆ g_client_height

◆ g_client_width

◆ g_clipcx

int g_clipcx = 0
static

◆ g_clipcy

int g_clipcy = 0
static

◆ g_clipx

int g_clipx = 0
static

◆ g_clipy

int g_clipy = 0
static

◆ g_CM

◆ g_console_session

int g_console_session = 0

Definition at line 65 of file qtewin.cpp.

◆ g_deactivated

int g_deactivated = 0
static

Definition at line 107 of file qtewin.cpp.

◆ g_desktop_save

int g_desktop_save = 1

Definition at line 60 of file qtewin.cpp.

◆ g_directory

char g_directory[32] = ""
static

Definition at line 104 of file qtewin.cpp.

Referenced by param_connect(), and parse_parameters().

◆ g_domain

char g_domain[16] = ""
static

Definition at line 101 of file qtewin.cpp.

Referenced by param_connect(), and parse_parameters().

◆ g_encryption

int g_encryption = 1

Definition at line 55 of file qtewin.cpp.

◆ g_ext_disc_reason

uint32 g_ext_disc_reason = 0
static

Definition at line 108 of file qtewin.cpp.

◆ g_flags

uint32 g_flags = RDP_LOGON_NORMAL
static

Definition at line 99 of file qtewin.cpp.

Referenced by param_connect(), and parse_parameters().

◆ g_fullscreen

int g_fullscreen = 0
static

Definition at line 105 of file qtewin.cpp.

Referenced by param_connect(), and parse_parameters().

◆ g_global_sock

int g_global_sock = 0
static

Definition at line 106 of file qtewin.cpp.

Referenced by param_connect(), QMyScrollView::timerEvent(), and ui_select().

◆ g_height

int g_height = 480

◆ g_hostname

char g_hostname[16] = ""

Definition at line 73 of file qtewin.cpp.

Referenced by get_username_and_hostname(), and parse_parameters().

◆ g_keyboard_functionkeys

int g_keyboard_functionkeys = 0xc

Definition at line 69 of file qtewin.cpp.

◆ g_keyboard_subtype

int g_keyboard_subtype = 0x0

Definition at line 68 of file qtewin.cpp.

◆ g_keyboard_type

int g_keyboard_type = 0x4

Definition at line 67 of file qtewin.cpp.

◆ g_keylayout

int g_keylayout = 0x409

Definition at line 66 of file qtewin.cpp.

◆ g_MW

◆ g_password

char g_password[16] = ""
static

Definition at line 102 of file qtewin.cpp.

Referenced by param_connect(), and parse_parameters().

◆ g_polygon_ellipse_orders

int g_polygon_ellipse_orders = 0

Definition at line 62 of file qtewin.cpp.

◆ g_rdp5_performanceflags

int g_rdp5_performanceflags
Initial value:
=
#define RDP5_NO_MENUANIMATIONS
Definition: constants.h:271
#define RDP5_NO_FULLWINDOWDRAG
Definition: constants.h:270
#define RDP5_NO_WALLPAPER
Definition: constants.h:269

Definition at line 63 of file qtewin.cpp.

◆ g_redirect

BOOL g_redirect = False

Definition at line 126 of file qtewin.cpp.

◆ g_redirect_cookie

char g_redirect_cookie[128]

Definition at line 131 of file qtewin.cpp.

◆ g_redirect_domain

char g_redirect_domain[16]

Definition at line 128 of file qtewin.cpp.

◆ g_redirect_flags

uint32 g_redirect_flags = 0

Definition at line 132 of file qtewin.cpp.

◆ g_redirect_password

char g_redirect_password[64]

Definition at line 129 of file qtewin.cpp.

◆ g_redirect_server

char g_redirect_server[64]

Definition at line 127 of file qtewin.cpp.

◆ g_redirect_username

char g_redirect_username[64]

Definition at line 130 of file qtewin.cpp.

◆ g_server

char g_server[64] = ""
static

Definition at line 100 of file qtewin.cpp.

Referenced by param_connect(), parse_parameters(), and QMyScrollView::timerEvent().

◆ g_server_bpp

◆ g_shell

char g_shell[128] = ""
static

Definition at line 103 of file qtewin.cpp.

Referenced by param_connect(), and parse_parameters().

◆ g_SocketNotifier

QSocketNotifier* g_SocketNotifier = 0
static

Definition at line 110 of file qtewin.cpp.

Referenced by param_connect(), and QMyScrollView::timerEvent().

◆ g_SV

◆ g_tcp_port_rdp

int g_tcp_port_rdp
extern

Definition at line 75 of file tcp.c.

Referenced by parse_parameters().

◆ g_use_rdp5

int g_use_rdp5 = 1

Definition at line 59 of file qtewin.cpp.

Referenced by parse_parameters().

◆ g_username

char g_username[100] = ""

Definition at line 74 of file qtewin.cpp.

Referenced by get_username_and_hostname(), and parse_parameters().

◆ g_width