ulalaca-xrdp icon indicating copy to clipboard operation
ulalaca-xrdp copied to clipboard

[WIP] add CoreGraphics-based text renderer for debugging purposes

Open unstabler opened this issue 1 year ago • 3 comments

Screenshot_20231027_071910-3

TODO

  • add multi-line support
  • clean up code

unstabler avatar Oct 26 '23 22:10 unstabler

#16 완성되면 계속 작업함

unstabler avatar Oct 28 '23 16:10 unstabler

작업 방향

@devadversary 님 안녕하세요,

원래대로라면, 아래 이미지처럼 "\n"을 기준으로 텍스트를 한줄씩 나눠서 draw(ULCGTextRenderer(line).render(), x, y) 같은 형태가 되는걸 생각했었습니다.

image

하지만 xrdp의 비트맵을 그리는 server_paint_rect가 surface의 어느 부분에 그릴지 정하는 dstX, dstY를 지정할 수 없게 되어있기 때문에 위의 방법 대신 다른 방법을 제안드립니다.

  1. ULCGTextRenderer는 생성자에서 ULSurface의 전체 크기와 텍스트를 그릴 dstX, dstY 좌표 위치를 추가로 받습니다.
  2. ULCGTextRenderer는 생성자에서 전달받은 ULSurface의 크기만큼의 이미지를 생성하고, 여기에 텍스트를 그립니다.
  3. ULIPCRect { .x = renderer.x(), .y = renderer.y(), .width = renderer.width(), .height = renderer.height() }ULSurface::drawBitmap()을 호출합니다.

image

횡설수설한 설명이라 정말 죄송합니다 ㅠㅠㅠ 혹시 더 나은 방법이 있다면 제안해 주세요. :pray:

unstabler avatar Nov 01 '23 09:11 unstabler

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Nov 02 '23 09:11 sonarqubecloud[bot]