コード例 #1
0
void FlushMarker(PBSynopsisItem *item)
{
	// Flush marker or comment on page
	if (item != NULL && (item->GetType() == SYNOPSIS_MARKER || item->GetType() == SYNOPSIS_COMMENT))
	{
		int spi, sei, sci, epi, eei, eci;
		PBSynopsisMarker *marker = (PBSynopsisMarker *)item;
		if (marker != NULL)
		{
			unpack_position(marker->GetLongPosition(), &spi, &sei, &sci);
			unpack_position(marker->GetEndLongPosition(), &epi, &eei, &eci);
			int i;
			for (i = 0; i < 2; i++)
			{
				bookview->selectionModel().activate(0, 0);
				bookview->selectionModel().extendTo(ScreenWidth(), ScreenHeight());
				bookview->selectionModel().SetSelection(spi, sei, sci, epi, eei, eci);
				repaint_all(-2);
				PartialUpdateBW(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight());
				bookview->selectionModel().clear();
				repaint_all(-2);
				PartialUpdateBW(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight());
			}
		}
	}
}
コード例 #2
0
ファイル: zoomer.cpp プロジェクト: pocketbook-free/djviewer
// draw zoomer
void Zoomer::Draw(int gu)
{
    // draw frame
    int xframe, yframe, wframe, hframe;
    GetWindowFrameRect(xframe, yframe, wframe, hframe);
    iv_windowframe(xframe, yframe, wframe, hframe, BLACK, WHITE, const_cast<char*>("@Zoom"), 0);

    // draw bitmap
    int xbitmap, ybitmap, wbitmap, hbitmap;
    GetBitmapFrameRect(xbitmap, ybitmap, wbitmap, hbitmap);
    DrawBitmap(xbitmap, ybitmap, &djvumode);

    // draw description
    char buffer[128] = {0};
    s_Strategies[m_Position]->GetDescription(buffer, sizeof(buffer));
    SetFont(menu_n_font, 0);
    DrawTextRect(xframe, yframe + hframe - 1.25 * menu_n_font->height, wframe, 1, buffer, ALIGN_CENTER);

    // current selection
    InvertAreaBW(xbitmap + m_IconWidth * m_Position, ybitmap, m_IconWidth, m_IconHeight);

	// update screen
	if (gu) {
		//PartialUpdate(xframe, yframe, wframe, hframe);
	} else {
		PartialUpdateBW(xframe, yframe, wframe, hframe);
	}
}
コード例 #3
0
	static bool get_new_mode_from_coord(int x, int y)
	{
		need_fit_scale = false;
		int cw = bm_touchzoom->width / 6 - 36, ch = bm_touchzoom->height / 5 - 48;
		for (int i = 0; i < 6; ++i)
			if (x > dx + 40 + i *(cw + 36) && x < dx + 40 + (i + 1) *(cw + 36)) for (int j = 0; j < 5; ++j)
					if (y > dy + th + 8 + j *(ch + 48) && y < dy + th + 8 + (j + 1) *(ch + 48))
					{
						switch (j)
						{
							case 4:
								if (i > 4) return false;
								new_rscale = SC_REFLOW[i];
								new_reflow = 1;
								break;

							case 3:
								if (i > 3) return false;
								new_scale = SC_COLUMNS[i];
								new_reflow = 0;
								break;

							case 2:
								new_scale = SC_NORMAL[(i + 5) * 13 / 11 + 1];
								new_reflow = 0;
								break;

							case 1:
								new_scale = SC_NORMAL[i * 13 / 11];
								new_reflow = 0;
								break;

							case 0:
								if (i == 0)
									new_scale = SC_PREVIEW[1];
								else if (i == 2)
									new_scale = SC_PREVIEW[0];
								else if (i == 4)
									need_fit_scale = true;
								else
									return false;
								new_reflow = 0;
								break;
						}
						invert_item(dx + 40 + i *(cw + 36) + 16, dy + th + 8 + j *(ch + 48) + 22, cw + 4, ch + 4);
						PartialUpdateBW(dx + 40 + i *(cw + 36) + 16, dy + th + 8 + j *(ch + 48) + 22, cw + 4, ch + 4);
						return true;
					}
		return false;
	}
コード例 #4
0
ファイル: main.cpp プロジェクト: pocketbook-free/pdfviewer
static void draw_jump_info(char* text)
{
	int x, y, w, h;

	SetFont(menu_n_font, BLACK);
	w = StringWidth("999%") + 20;
	if (StringWidth(text) > w - 10) w = StringWidth(text) + 20;
	h = (menu_n_font->height * 3) / 2;
	x = ScreenWidth() - w - 5;
	y = ScreenHeight() - h - 30;
	FillArea(x + 1, y + 1, w - 2, h - 2, WHITE);
	DrawRect(x + 1, y, w - 2, h, BLACK);
	DrawRect(x, y + 1, w, h - 2, BLACK);
	DrawTextRect(x, y, w, h, text, ALIGN_CENTER | VALIGN_MIDDLE);
	PartialUpdateBW(x, y, w, h);
}