Example #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());
			}
		}
	}
}
Example #2
0
void new_synopsis_note()
{
	PrepareActiveContent(0);

	SynWordList* synWordList = new SynWordList[2];
	memset(synWordList, 0, sizeof(SynWordList) * 2);

	synWordList[0].word = strdup("");
	synWordList[0].x1 = 0;
	synWordList[0].y1 = 0;
	synWordList[0].x2 = 0;
	synWordList[0].y2 = 0;
	synWordList[0].pnum = cpage;
	synWordList[0].wnum = 1;

	synWordList[1].word = strdup("");
	synWordList[1].x1 = ScreenWidth();
	synWordList[1].y1 = ScreenHeight() - PanelHeight();
	synWordList[1].x2 = ScreenWidth();
	synWordList[1].y2 = ScreenHeight() - PanelHeight();
	synWordList[1].pnum = cpage;
	synWordList[1].wnum = 2;

	List.Clear();
	List.Add(synWordList, 2, 1);

	delete[] synWordList;

	ibitmap *bm1=NULL, *bm2=NULL;
	bm1 = BitmapFromScreen(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight());
//	bm2 = BitmapFromScreen(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight());
	Note = new SynopsisNote();
	Note->Create((TSynopsisTOC*)&m_TOC, &List, bm1, bm2, false);
//	SendEvent(GetEventHandler(), EVT_SHOW, 0, 0);
}
Example #3
0
void qPBReaderPlatform::UpdatePanelDisplay()
{
   TRSCOPE(pb, "qPBReaderPlatform::UpdatePanelDisplay");
#ifdef Q_OS_POCKETBOOK

   ::PartialUpdate(0,
                   ScreenHeight() - PanelHeight(),
                   ScreenWidth(),
                   PanelHeight());
#endif
}
Example #4
0
void SelectionTimer()
{
	repaint_all(-1);
	ToolBar.OutputPage(BitmapFromScreen(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight()),
				1, updMarkerx, updMarkery, updMarkerw, updMarkerh);
	if (++usersleep < 50)
		SetHardTimer("SelectionTimer", SelectionTimer, 25);
	else
		MarkerHandler(EVT_POINTERUP, lastx, lasty);
}
Example #5
0
void OpenMarkerMenu(PBSynopsisItem *item)
{
	// Prepare page and open marker menu
	if (item != NULL)
	{
		int spi, sei, sci, epi, eei, eci;
		PBSynopsisMarker *marker = (PBSynopsisMarker *)item;
		selectingMarker = false;
		ClearTimer(SelectionTimer);
		unpack_position(marker->GetLongPosition(), &spi, &sei, &sci);
		unpack_position(marker->GetEndLongPosition(), &epi, &eei, &eci);
		bookview->selectionModel().SetSelection(spi, sei, sci, epi, eei, eci);
		repaint_all(-1);
		ToolBar.OutputPage(BitmapFromScreen(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight()));
		ToolBar.OpenMarkerMenu(marker);
		bookview->selectionModel().clear();
	}
}
Example #6
0
void set_panel_height()
{
	panelh = PanelHeight();
}
Example #7
0
void show_hide_panel()
{
	SetPanelType((panelh == 0) ? 1 : 0);
	panelh = PanelHeight();
	out_page(1);
}
Example #8
0
static int search_handler(int type, int par1, int par2)
{
	static int x0, y0;

	switch (type)
	{
		case EVT_SHOW:
			//out_page(0);
			break;

		case EVT_POINTERDOWN:
			x0 = par1;
			y0 = par2;
			break;

		case EVT_POINTERUP:
			if (par1 - x0 > EPSX)
			{
				turn_page(-1);
				return 1;
			}
			if (x0 - par1 > EPSX)
			{
				turn_page(1);
				return 1;
			}
			if (par1 > ScreenWidth() - searchbm.width && par2 > ScreenHeight() - PanelHeight() - searchbm.height)
			{
				if (par1 < ScreenWidth() - searchbm.width / 2)
				{
					do_search(stext, spage - 1, -1);
				}
				else
				{
					do_search(stext, spage + 1, +1);
				}
				return 1;
			}
			else
			{
				stop_search();
			}
			break;

		case EVT_KEYPRESS:
			switch (par1)
			{
				case KEY_OK:
				case KEY_BACK:
					stop_search();
					break;
				case KEY_LEFT:
					do_search(stext, spage - 1, -1);
					break;
				case KEY_RIGHT:
					do_search(stext, spage + 1, +1);
					break;
				default:
					break;
			}
			break;
		default:
			break;
	}

	return 0;
}
Example #9
0
int MarkerHandler(int type, int par1, int par2)
{
	if (type == EVT_POINTERDOWN)
	{
		selectingMarker = true;
		restore_current_position();
		mainApplication->refreshWindow();
		bookview->selectionModel().clear();
		bookview->selectionModel().activate(par1 - imgposx, par2 - imgposy);
		SetHardTimer("SelectionTimer", SelectionTimer, 250);
		selMarkery1 = selMarkery2 = lasty = par2;
		lastx = par1;
		usersleep = 0;
	}
	else if (type == EVT_POINTERMOVE)
	{
		if (++trailMarker > 8)
		{
			if (selectingMarker)
			{
				lastx = par1;
				lasty = par2;
				bookview->selectionModel().extendTo(par1 - imgposx, par2 - imgposy);
				selMarkery2 = par2;
				usersleep = 0;
			}
			trailMarker = 0;
		}
	}
	else if (type == EVT_POINTERUP)
	{
		if (!selectingMarker)
			return 0;
		selectingMarker = false;
		ClearTimer(SelectionTimer);
		restore_current_position();
		mainApplication->refreshWindow();
		bookview->selectionModel().extendTo(par1 - imgposx, par2 - imgposy);

		long long spos, epos;
		bool clickOnly, emptyText;
		GetSelectionInfo(&spos, &epos, &emptyText, &clickOnly);
		if ((clickOnly && SynTOC.GetMarkerByPos(spos) != NULL) || emptyText)
		{
			OpenMarkerMenu(SynTOC.GetMarkerByPos(spos));
		}
		else
		{
			MergeMarkers(spos, epos);
			bookview->selectionModel().clear();
			repaint_all(-2);
			ToolBar.OutputPage(BitmapFromScreen(0, 0, ScreenWidth(), ScreenHeight()-PanelHeight()),
						2, updMarkerx, updMarkery, updMarkerw, updMarkerh);
		}

	}
	else if (type == EVT_POINTERHOLD || type == EVT_POINTERLONG)
	{
		restore_current_position();
		mainApplication->refreshWindow();
		bookview->selectionModel().extendTo(par1 - imgposx, par2 - imgposy);

		long long spos, epos;
		bool clickOnly, emptyText;
		GetSelectionInfo(&spos, &epos, &emptyText, &clickOnly);
		if (clickOnly || emptyText)
		{
			OpenMarkerMenu(SynTOC.GetMarkerByPos(spos));
		}
	}
	return 0;
}
Example #10
0
		// добавляем две пустышки с координатами верхнего левого и нижнего правого углов
		acwordlist[0].word = strdup("");
		acwordlist[0].x1 = 0;
		acwordlist[0].y1 = 0;
		acwordlist[0].x2 = 0;
		acwordlist[0].y2 = 0;
		acwordlist[0].pnum = paragraph;
		acwordlist[0].wnum = cr.elementIndex();

		cr = is_footnote_mode() ? footview->textArea().endCursor() : bookview->textArea().endCursor();
		paragraph = !cr.isNull() ? cr.paragraphCursor().index() : 0;

		acwordlist[1].word = strdup("");
		acwordlist[1].x1 = ScreenWidth();
		acwordlist[1].y1 = ScreenHeight() - PanelHeight();
		acwordlist[1].x2 = ScreenWidth();
		acwordlist[1].y2 = ScreenHeight() - PanelHeight();
		acwordlist[1].pnum = paragraph;
		acwordlist[1].wnum = cr.elementIndex();

		acwlistcount = 2;
	}
}

void new_synopsis_note()
{
	PrepareSynTOC(0);
	restore_current_position();
	mainApplication->refreshWindow();
	IfEmptyWordList();