Example #1
0
//------------------------------------------------------------------------------
// Function Name  : view_elevator_entry()
// Description    :
//------------------------------------------------------------------------------
void view_elevator_entry(void)
{
	PRINT_FUNC_CO();

	hcm_req_elevator_call();
	
	update_elevator_info();

	ui_draw_image(g_elev_bg_h);

	ui_draw_image(g_icon_img_h);

	ui_draw_image(g_elev_img_h);

	ui_draw_image(g_floor_img_h);
	
	ui_draw_text(245, 89, 500, 32, 24, WHITE, TXT_ALIGN_LEFT, "엘레베이터 상태 확인중 입니다");
	//ui_draw_text(245, 89, 500, 32, 24, WHITE, TXT_ALIGN_LEFT, "엘레베이터를 호출하였습니다");
	
	hcm_register_workqueue(500, view_elevator_animation_arrow);
}
Example #2
0
//------------------------------------------------------------------------------
// Function Name  : view_parking_entry()
// Description    :
//------------------------------------------------------------------------------
void view_parking_entry(void)
{
	parking_info_t parking_info;
	char temp_str[64] = {0,};
	rect_t rect;
	int i;
	
	PRINT_FUNC_CO();

	hcm_req_parking_info();

	ui_draw_image(g_parking_bg_h);
	ui_draw_image(g_parking_img_h);
	ui_draw_image(g_map_img_h);
	
	if (g_parking_info.status == PARKING_STATUS_IN) {
		sprintf(temp_str, "[%s]층 [%s]에 주차 되었습니다",
			g_parking_info.floor, g_parking_info.zone);
		ui_draw_text(245, 89, 500, 32, 24, WHITE, TXT_ALIGN_LEFT, temp_str);
	} else {
		ui_draw_text(245, 89, 500, 32, 24, WHITE, TXT_ALIGN_LEFT,
			"주차위치를 확인할 수 없습니다");
	}

	rect.x = 37;
	rect.y = 251;
	rect.w = 172;
	rect.h = 200;
	ui_draw_image_part(g_parking_bg_h, &rect, &rect);

	for (i = 0; i < MAX_PARKING_LIST; i++) {
		parking_list_get_item(i, &parking_info);
		if (parking_info.status != PARKING_STATUS_IN)
			break;
		memset(temp_str, 0, sizeof(temp_str));
		sprintf(temp_str, "%s -%s", parking_info.floor, parking_info.zone);
		ui_draw_text(37, 251+(36*i), 172, 32, 24, WHITE, TXT_ALIGN_LEFT, temp_str);
	}
}
Example #3
0
static void do_forms(float xofs, float yofs)
{
    pdf_ui_event event;
    fz_point p;
    int i;

    for (i = 0; i < annot_count; ++i)
        ui_draw_image(&annot_tex[i], xofs - page_tex.x, yofs - page_tex.y);

    if (!pdf || search_active)
        return;

    p.x = xofs - page_tex.x + ui.x;
    p.y = xofs - page_tex.x + ui.y;
    fz_transform_point(&p, &page_inv_ctm);

    if (ui.down && !ui.active)
    {
        event.etype = PDF_EVENT_TYPE_POINTER;
        event.event.pointer.pt = p;
        event.event.pointer.ptype = PDF_POINTER_DOWN;
        if (pdf_pass_event(ctx, pdf, (pdf_page*)page, &event))
        {
            if (pdf->focus)
                ui.active = do_forms;
            pdf_update_page(ctx, (pdf_page*)page);
            render_page();
            ui_needs_update = 1;
        }
    }
    else if (ui.active == do_forms && !ui.down)
    {
        ui.active = NULL;
        event.etype = PDF_EVENT_TYPE_POINTER;
        event.event.pointer.pt = p;
        event.event.pointer.ptype = PDF_POINTER_UP;
        if (pdf_pass_event(ctx, pdf, (pdf_page*)page, &event))
        {
            pdf_update_page(ctx, (pdf_page*)page);
            render_page();
            ui_needs_update = 1;
        }
    }
}
Example #4
0
int
lua_image_draw(lua_State *L) {
    struct Image *pImage = checkImage(L, 1);
    int argc = lua_gettop(state);
    int x, y;
    int result;

    if (argc == 3) {
        if ((lua_type(state, 2) == LUA_TNUMBER) &&
            (lua_type(state, 3) == LUA_TNUMBER)) {
            x = lua_tonumber(state, 2);
            y = lua_tonumber(state, 3);
            ui_draw_image(pImage->data, x, y);
            result = 0;
        }
        else result = EINVAL;
    }
    else result = EINVAL;

    lua_pushnumber(state, result);
    return 1;
}
Example #5
0
//------------------------------------------------------------------------------
// Function Name  : view_security_entry()
// Description    :
//------------------------------------------------------------------------------
void view_security_entry(void)
{
	PRINT_FUNC_CO();

	hcm_req_security_info();

	update_security_info();

	ui_draw_image(g_secu_bg_h);

	if (g_security_status) {
		ui_draw_icon_image(g_secu_icon_h, ICON_IMG_SECU_ON);
		ui_draw_icon_image(g_gas_sw_icon_h, ICON_IMG_SECU_SW_ON);
		ui_draw_text(240, 108, 500, 40, 32, WHITE, TXT_ALIGN_LEFT, "자동방범이 설정되었습니다");
	} else {
		ui_draw_icon_image(g_secu_icon_h, ICON_IMG_SECU_OFF);
		ui_draw_icon_image(g_gas_sw_icon_h, ICON_IMG_SECU_SW_OFF);
		ui_draw_text(240, 108, 500, 40, 32, WHITE, TXT_ALIGN_LEFT, "자동방범이 해제되었습니다");
	}
		
	ui_draw_text(144, 329, 150, 32, 24, WHITE, TXT_ALIGN_RIGHT, "방범해제");
	ui_draw_text(625, 329, 150, 32, 24, WHITE, TXT_ALIGN_LEFT, "방범설정");
}
Example #6
0
static void do_canvas(void)
{
    static int saved_scroll_x = 0;
    static int saved_scroll_y = 0;
    static int saved_ui_x = 0;
    static int saved_ui_y = 0;

    float x, y;

    if (oldpage != currentpage || oldzoom != currentzoom || oldrotate != currentrotate)
    {
        render_page();
        update_title();
        oldpage = currentpage;
        oldzoom = currentzoom;
        oldrotate = currentrotate;
    }

    if (ui.x >= canvas_x && ui.x < canvas_x + canvas_w && ui.y >= canvas_y && ui.y < canvas_y + canvas_h)
    {
        ui.hot = doc;
        if (!ui.active && ui.middle)
        {
            ui.active = doc;
            saved_scroll_x = scroll_x;
            saved_scroll_y = scroll_y;
            saved_ui_x = ui.x;
            saved_ui_y = ui.y;
        }
    }

    if (ui.hot == doc)
    {
        scroll_x -= ui.scroll_x * ui.lineheight * 3;
        scroll_y -= ui.scroll_y * ui.lineheight * 3;
    }

    if (ui.active == doc)
    {
        scroll_x = saved_scroll_x + saved_ui_x - ui.x;
        scroll_y = saved_scroll_y + saved_ui_y - ui.y;
    }

    if (page_tex.w <= canvas_w)
    {
        scroll_x = 0;
        x = canvas_x + (canvas_w - page_tex.w) / 2;
    }
    else
    {
        scroll_x = fz_clamp(scroll_x, 0, page_tex.w - canvas_w);
        x = canvas_x - scroll_x;
    }

    if (page_tex.h <= canvas_h)
    {
        scroll_y = 0;
        y = canvas_y + (canvas_h - page_tex.h) / 2;
    }
    else
    {
        scroll_y = fz_clamp(scroll_y, 0, page_tex.h - canvas_h);
        y = canvas_y - scroll_y;
    }

    ui_draw_image(&page_tex, x - page_tex.x, y - page_tex.y);

    do_forms(x, y);

    if (!search_active)
    {
        do_links(links, x, y);
        do_page_selection(x, y, x+page_tex.w, y+page_tex.h);
        if (search_hit_page == currentpage && search_hit_count > 0)
            do_search_hits(x, y);
    }
}