From 964e860072cd4871481481d5b3ffa96abb1bac35 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 14 Jan 2016 16:32:09 +0000 Subject: Run through codespell --- xrdp/xrdp_bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xrdp/xrdp_bitmap.c') diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index aafc19f2..3fd0fbb7 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -165,7 +165,7 @@ xrdp_bitmap_create_with_data(int width, int height, if (((bpp >= 24) && (data_as_int & 3)) || (((bpp == 15) || (bpp == 16)) && (data_as_int & 1))) { - /* got to copy data here, it's not alligned + /* got to copy data here, it's not aligned other calls in this file assume alignment */ Bpp = 4; switch (bpp) -- cgit v1.2.1 From ca9cbcafc826dc4c3ff6c54fcab3d81789ae5807 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 3 May 2016 13:07:13 -0700 Subject: Typo fixes --- xrdp/xrdp_bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xrdp/xrdp_bitmap.c') diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 3fd0fbb7..6a062d51 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -1254,8 +1254,8 @@ xrdp_bitmap_draw_focus_box(struct xrdp_bitmap *self, painter->brush.pattern[5] = 0x55; painter->brush.pattern[6] = 0xaa; painter->brush.pattern[7] = 0x55; - painter->brush.x_orgin = x; - painter->brush.x_orgin = x; + painter->brush.x_origin = x; + painter->brush.x_origin = x; painter->brush.style = 3; painter->fg_color = self->wm->black; painter->bg_color = self->parent->bg_color; -- cgit v1.2.1 From aaa89ad4e6b5484b246ec9ecb7d93248e1fa74cd Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 21 Jun 2016 16:30:17 -0700 Subject: Use const unsigned for hex arrays Some constants are too big for the signed type. --- xrdp/xrdp_bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xrdp/xrdp_bitmap.c') diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 6a062d51..e99e2bfe 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -38,7 +38,7 @@ while (0) -static const int g_crc_table[256] = +static const unsigned int g_crc_table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, -- cgit v1.2.1 From a618d4f757d57068e388b213290d3a4f6068a9ae Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 16 Oct 2016 22:21:07 -0700 Subject: Don't use final newline in log calls, it's already appended --- xrdp/xrdp_bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xrdp/xrdp_bitmap.c') diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index e99e2bfe..9ffc6284 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -471,7 +471,7 @@ xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette) /* read bmp header */ if (g_file_seek(fd, 14) < 0) { - log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s\n", + log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); free_stream(s); g_file_close(fd); @@ -505,7 +505,7 @@ xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette) { if (g_file_seek(fd, 14 + header.size) < 0) { - log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s\n", + log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); } xrdp_bitmap_resize(self, header.image_width, header.image_height); @@ -562,7 +562,7 @@ xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette) /* read palette */ if (g_file_seek(fd, 14 + header.size) < 0) { - log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s\n", + log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); } init_stream(s, 8192); @@ -623,7 +623,7 @@ xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette) /* read palette */ if (g_file_seek(fd, 14 + header.size) < 0) { - log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s\n", + log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); } init_stream(s, 8192); -- cgit v1.2.1 From 1f5158676975b2b4c9c3be518b575b677a4fede3 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Thu, 15 Dec 2016 21:17:50 -0800 Subject: add libpainter for drawing when client does not have minimum orders --- xrdp/xrdp_bitmap.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xrdp/xrdp_bitmap.c') diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 9ffc6284..1c759c3e 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -123,6 +123,14 @@ xrdp_bitmap_create(int width, int height, int bpp, self->data = (char *)g_malloc(width * height * Bpp, 0); } +#if defined(XRDP_PAINTER) + if (self->type == WND_TYPE_SCREEN) /* noorders */ + { + LLOGLN(0, ("xrdp_bitmap_create: noorders")); + self->data = (char *) g_malloc(width * height * Bpp, 0); + } +#endif + if (self->type != WND_TYPE_BITMAP) { self->child_list = list_create(); -- cgit v1.2.1 From 77d6fd08076088afde1ac1a445cbf9c1dedfe726 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 16 Dec 2016 23:46:09 +0000 Subject: Fix Parallels Client on Mac self->line_size should be calculated in xrdp_bitmap_create_with_data() The code was in the original noorders branch but got lost. Without this fix, the image is garbled. The client should be configured with compression disabled, or it will disconnect. That's a known problem. --- xrdp/xrdp_bitmap.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'xrdp/xrdp_bitmap.c') diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 9ffc6284..053be88b 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -149,9 +149,9 @@ xrdp_bitmap_create_with_data(int width, int height, struct xrdp_wm *wm) { struct xrdp_bitmap *self = (struct xrdp_bitmap *)NULL; + int Bpp; #if defined(NEED_ALIGN) tintptr data_as_int; - int Bpp; #endif self = (struct xrdp_bitmap *)g_malloc(sizeof(struct xrdp_bitmap), 1); @@ -160,6 +160,22 @@ xrdp_bitmap_create_with_data(int width, int height, self->height = height; self->bpp = bpp; self->wm = wm; + + Bpp = 4; + switch (bpp) + { + case 8: + Bpp = 1; + break; + case 15: + Bpp = 2; + break; + case 16: + Bpp = 2; + break; + } + self->line_size = width * Bpp; + #if defined(NEED_ALIGN) data_as_int = (tintptr) data; if (((bpp >= 24) && (data_as_int & 3)) || @@ -167,19 +183,6 @@ xrdp_bitmap_create_with_data(int width, int height, { /* got to copy data here, it's not aligned other calls in this file assume alignment */ - Bpp = 4; - switch (bpp) - { - case 8: - Bpp = 1; - break; - case 15: - Bpp = 2; - break; - case 16: - Bpp = 2; - break; - } self->data = (char *)g_malloc(width * height * Bpp, 0); g_memcpy(self->data, data, width * height * Bpp); return self; -- cgit v1.2.1