"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/viewer/scrollview.cpp" between
tesseract-5.0.0-rc2.tar.gz and tesseract-5.0.0-rc3.tar.gz

About: Tesseract is an Optical Character Recognition (OCR) engine. Release candidate.

scrollview.cpp  (tesseract-5.0.0-rc2):scrollview.cpp  (tesseract-5.0.0-rc3)
skipping to change at line 63 skipping to change at line 63
}; };
// A map between the window IDs and their corresponding pointers. // A map between the window IDs and their corresponding pointers.
static std::map<int, ScrollView *> svmap; static std::map<int, ScrollView *> svmap;
static std::mutex *svmap_mu; static std::mutex *svmap_mu;
// A map of all semaphores waiting for a specific event on a specific window. // A map of all semaphores waiting for a specific event on a specific window.
static std::map<std::pair<ScrollView *, SVEventType>, std::pair<SVSemaphore *, S VEvent *>> static std::map<std::pair<ScrollView *, SVEventType>, std::pair<SVSemaphore *, S VEvent *>>
waiting_for_events; waiting_for_events;
static std::mutex *waiting_for_events_mu; static std::mutex *waiting_for_events_mu;
SVEvent *SVEvent::copy() { SVEvent *SVEvent::copy() const {
auto *any = new SVEvent; auto *any = new SVEvent;
any->command_id = command_id; any->command_id = command_id;
any->counter = counter; any->counter = counter;
any->parameter = new char[strlen(parameter) + 1]; any->parameter = new char[strlen(parameter) + 1];
strcpy(any->parameter, parameter); strcpy(any->parameter, parameter);
any->type = type; any->type = type;
any->x = x; any->x = x;
any->y = y; any->y = y;
any->x_size = x_size; any->x_size = x_size;
any->y_size = y_size; any->y_size = y_size;
skipping to change at line 426 skipping to change at line 426
/// Add an Event Listener to this ScrollView Window /// Add an Event Listener to this ScrollView Window
void ScrollView::AddEventHandler(SVEventHandler *listener) { void ScrollView::AddEventHandler(SVEventHandler *listener) {
event_handler_ = listener; event_handler_ = listener;
} }
void ScrollView::Signal() { void ScrollView::Signal() {
semaphore_->Signal(); semaphore_->Signal();
} }
void ScrollView::SetEvent(SVEvent *svevent) { void ScrollView::SetEvent(const SVEvent *svevent) {
// Copy event // Copy event
SVEvent *any = svevent->copy(); SVEvent *any = svevent->copy();
SVEvent *specific = svevent->copy(); SVEvent *specific = svevent->copy();
any->counter = specific->counter + 1; any->counter = specific->counter + 1;
// Place both events into the queue. // Place both events into the queue.
std::lock_guard<std::mutex> guard(mutex_); std::lock_guard<std::mutex> guard(mutex_);
// Delete the old objects.. // Delete the old objects..
delete event_table_[specific->type]; delete event_table_[specific->type];
delete event_table_[SVET_ANY]; delete event_table_[SVET_ANY];
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)