void render_line_sel( struct text_rendition *info, struct line_layout *ll ) { int base_x = ll->base_x; int base_y = ll->base_y; UINT_32 line_start = ll->line_start; UINT_32 line_end = ll->line_end; int sel_start_x = ll->sel_start_x; int sel_end_x = ll->sel_end_x; if (info->sel_from <= line_end && info->sel_to >= line_start) { int x, y, w, h; if (info->sel_from >= line_start) x = sel_start_x; else x = base_x; if (info->sel_to <= line_end) w = sel_end_x - x; else w = (base_x + info->line_width) - x; x += info->origin_x; h = info->line_height; y = base_y - h; XFillRectangle( info->ctx_dsp, info->ctx_win, info->ctx_gc, x + RECT_X(info->sel_bleed), y + RECT_Y(info->sel_bleed), w + RECT_W(info->sel_bleed), h + RECT_H(info->sel_bleed) ); } }
static int ui_window_get_placement(lua_State* L) { HWND hwnd = NULL; RECT rect; Crj_ParseArgs(L, "| u", &hwnd); hwnd = GetTargetWindow(hwnd); GetWindowRect(hwnd, &rect); lua_pushinteger(L, RECT_X(rect)); lua_pushinteger(L, RECT_Y(rect)); lua_pushinteger(L, RECT_WIDTH(rect)); lua_pushinteger(L, RECT_HEIGHT(rect)); return 4; }