libcrn
3.9.5
A document image processing library
|
Displays a crn::Document. More...
#include <GtkCRNDocument.h>
Public Member Functions | |
Document (bool show_views=true, bool show_tree=true) | |
Constructor. More... | |
virtual | ~Document () override |
Destructor. More... | |
void | set_document (const crn::SDocument &doc) |
Sets the document to display. More... | |
const crn::SDocument & | get_document () |
Gets the displayed document. More... | |
crn::SCDocument | get_document () const |
Gets the displayed document. More... | |
std::vector< crn::String > | get_selected_views_ids () |
Gets the selected views' ids. More... | |
crn::String | get_selected_view_id () |
Gets the displayed views's id. More... | |
void | set_selected_view (const crn::String &view_id) |
Sets the one selected view. More... | |
void | set_show_thumbnails (bool s) |
Shall the views show a thumbnail. More... | |
void | set_show_labels (bool s) |
Shall the views show a label. More... | |
void | set_show_indexes (bool s) |
Shall the views show their index. More... | |
void | select_even () |
Selects even views. More... | |
void | select_odd () |
Selects odd views. More... | |
void | select_all () |
Selects all views. More... | |
void | deselect_all () |
Selects all views. More... | |
void | invert_selection () |
Inverts the view selection. More... | |
void | delete_selection () |
Removes all selected views from the document. More... | |
void | append_views_dialog () |
void | append_views (const std::vector< crn::Path > &filenames) |
Appends new views at the end of the document. More... | |
void | refresh_views () |
Redraws the view list. More... | |
void | select_first () |
If selection size is <= 1, then select the first view, else move last_selected to the first selected element. More... | |
void | select_previous () |
If selection size is 0, the select the first element, if selection size is 1, then select the previous view, else move last_selected to the previous selected element. More... | |
void | select_next () |
If selection size is 0, the select the first element, if selection size is 1, then select the next view, else move last_selected to the next selected element. More... | |
void | select_last () |
If selection size is <= 1, then select the last view, else move last_selected to the last selected element. More... | |
void | set_default_drop_in (bool b) |
Shall we use the default handler for dropped elements? (true by default). More... | |
sigc::signal< void, int, crn::StringUTF8 > | signal_droppedin () |
Signals when something was dropped from another application. Connect to void on_droppedin(int position, crn::StringUTF8 data). More... | |
sigc::signal< void, const crn::String, const std::vector < crn::String > > | signal_view_selection_changed () |
Signal when the selection has changed. Connect to void on_view_selection_changed(const crn::String last_selected_view_id, const std::vector<crn::String> selected_views_ids). More... | |
sigc::signal< bool, const std::vector< crn::String > > | signal_delete_selection () |
Signal when the selection is about to be deleted. Connect to bool on_delete_selection(const std::vector<crn::String> selected_views_ids) that will return true to allow the deletion, false to prevent it. More... | |
Glib::RefPtr< Gtk::ActionGroup > & | get_views_actions () |
Gets the action group associated to views management. More... | |
const crn::SBlock & | get_selected_block () |
Gets the displayed block. More... | |
crn::SCBlock | get_selected_block () const |
Gets the displayed block. More... | |
void | set_show_subblocks (bool s) |
Shows or hides subblocks tree. More... | |
bool | get_show_subblocks () const |
Is subblocks tree shown? More... | |
void | set_show_subblocks_toolbar (bool s) |
Shows or hides subblocks toolbar. More... | |
bool | get_show_subblocks_toolbar () const |
Is subblocks toolbar shown? More... | |
Glib::RefPtr< Gtk::ActionGroup > & | get_subblock_actions () |
Gets the action group associated to subblock management. More... | |
GtkCRN::Image & | get_image () |
Gets the image widget. More... | |
const GtkCRN::Image & | get_image () const |
Gets the image widget. More... | |
void | reload_image (const crn::String &view_id) |
Refreshes the thumbnail of a view and the Image if needed. More... | |
void | thread_safe_reload_image (const crn::String &view_id) |
Refreshes the thumbnail of a view and the Image if needed (thread safe) More... | |
void | set_selection_colors (const crn::pixel::RGB8 &col1, const crn::pixel::RGB8 &col2) |
Sets the colors of the user selection on the image. More... | |
void | set_subblocks_colors (const crn::pixel::RGB8 &col1, const crn::pixel::RGB8 &col2, const crn::pixel::RGB8 &textcol) |
Sets the colors of the subblocks on the image. More... | |
void | set_show_subblock_labels (bool s) |
Shows or hides subblocks labels on the image. More... | |
bool | get_show_subblock_labels () const |
Are subblocks labels shown on the image? More... | |
Gtk::Box & | get_left_panel () |
Return the VBox on the left of the image. More... | |
Gtk::Box & | get_right_panel () |
Displays a crn::Document.
Definition at line 36 of file GtkCRNDocument.h.
Constructor.
Constructor
[in] | show_views | shall the view list be displayed? |
[in] | show_tree | shall the subblock tree be displayed? |
Definition at line 47 of file GtkCRNDocument.cpp.
|
overridevirtual |
void Document::append_views | ( | const std::vector< crn::Path > & | filenames | ) |
Appends new views at the end of the document.
Definition at line 584 of file GtkCRNDocument.cpp.
void Document::append_views_dialog | ( | ) |
Definition at line 595 of file GtkCRNDocument.cpp.
void Document::delete_selection | ( | ) |
Removes all selected views from the document.
Definition at line 552 of file GtkCRNDocument.cpp.
void Document::deselect_all | ( | ) |
Selects all views.
Definition at line 652 of file GtkCRNDocument.cpp.
|
inline |
Gets the displayed document.
Definition at line 55 of file GtkCRNDocument.h.
|
inline |
Gets the displayed document.
Definition at line 57 of file GtkCRNDocument.h.
|
inline |
Gets the image widget.
Definition at line 208 of file GtkCRNDocument.h.
|
inline |
Gets the image widget.
Definition at line 210 of file GtkCRNDocument.h.
|
inline |
Return the VBox on the left of the image.
<Return the VBox on the right of the image
Definition at line 230 of file GtkCRNDocument.h.
|
inline |
Definition at line 232 of file GtkCRNDocument.h.
|
inline |
Gets the displayed block.
Definition at line 169 of file GtkCRNDocument.h.
|
inline |
Gets the displayed block.
Definition at line 171 of file GtkCRNDocument.h.
crn::String Document::get_selected_view_id | ( | ) |
Gets the displayed views's id.
Definition at line 408 of file GtkCRNDocument.cpp.
std::vector< crn::String > Document::get_selected_views_ids | ( | ) |
Gets the selected views' ids.
Definition at line 396 of file GtkCRNDocument.cpp.
|
inline |
Are subblocks labels shown on the image?
Definition at line 224 of file GtkCRNDocument.h.
|
inline |
Is subblocks tree shown?
Definition at line 176 of file GtkCRNDocument.h.
|
inline |
Is subblocks toolbar shown?
Definition at line 180 of file GtkCRNDocument.h.
|
inline |
Gets the action group associated to subblock management.
Gets the action group associated to subblock management. Valid names are:
Definition at line 201 of file GtkCRNDocument.h.
|
inline |
Gets the action group associated to views management.
Gets the action group associated to views management. Valid names are:
Definition at line 162 of file GtkCRNDocument.h.
void Document::invert_selection | ( | ) |
Inverts the view selection.
Definition at line 657 of file GtkCRNDocument.cpp.
void Document::refresh_views | ( | ) |
void Document::reload_image | ( | const crn::String & | view_id | ) |
Refreshes the thumbnail of a view and the Image if needed.
Definition at line 1044 of file GtkCRNDocument.cpp.
void Document::select_all | ( | ) |
Selects all views.
Definition at line 647 of file GtkCRNDocument.cpp.
void Document::select_even | ( | ) |
Selects even views.
Definition at line 637 of file GtkCRNDocument.cpp.
void Document::select_first | ( | ) |
If selection size is <= 1, then select the first view, else move last_selected to the first selected element.
Definition at line 662 of file GtkCRNDocument.cpp.
void Document::select_last | ( | ) |
If selection size is <= 1, then select the last view, else move last_selected to the last selected element.
Definition at line 677 of file GtkCRNDocument.cpp.
void Document::select_next | ( | ) |
If selection size is 0, the select the first element, if selection size is 1, then select the next view, else move last_selected to the next selected element.
Definition at line 672 of file GtkCRNDocument.cpp.
void Document::select_odd | ( | ) |
Selects odd views.
Definition at line 642 of file GtkCRNDocument.cpp.
void Document::select_previous | ( | ) |
If selection size is 0, the select the first element, if selection size is 1, then select the previous view, else move last_selected to the previous selected element.
Definition at line 667 of file GtkCRNDocument.cpp.
|
inline |
Shall we use the default handler for dropped elements? (true by default).
Shall we use the default handler for dropped elements? (true by default). The default handler tries to insert files in the document. Set to false and connect a slot to signal_droppedin() if you want to handle dropped elements by yourself.
[in] | b | true to use the default handler, false to disable the default handler |
Definition at line 113 of file GtkCRNDocument.h.
void Document::set_document | ( | const crn::SDocument & | doc | ) |
Sets the document to display.
Sets the document to display
[in] | doc | the document to display |
Definition at line 247 of file GtkCRNDocument.cpp.
void Document::set_selected_view | ( | const crn::String & | view_id | ) |
Sets the one selected view.
Sets the one selected view
crn::ExceptionNotFound | id not found |
Glib::OptionError | view not shown in the list (the crn::Document object is not consistent with the GtkCRN::Document object!) |
Definition at line 422 of file GtkCRNDocument.cpp.
void Document::set_selection_colors | ( | const crn::pixel::RGB8 & | col1, |
const crn::pixel::RGB8 & | col2 | ||
) |
Sets the colors of the user selection on the image.
Definition at line 1114 of file GtkCRNDocument.cpp.
void Document::set_show_indexes | ( | bool | s | ) |
Shall the views show their index.
Definition at line 532 of file GtkCRNDocument.cpp.
void Document::set_show_labels | ( | bool | s | ) |
Shall the views show a label.
Definition at line 523 of file GtkCRNDocument.cpp.
void Document::set_show_subblock_labels | ( | bool | s | ) |
Shows or hides subblocks labels on the image.
Definition at line 1132 of file GtkCRNDocument.cpp.
|
inline |
Shows or hides subblocks tree.
Definition at line 174 of file GtkCRNDocument.h.
|
inline |
Shows or hides subblocks toolbar.
Definition at line 178 of file GtkCRNDocument.h.
void Document::set_show_thumbnails | ( | bool | s | ) |
Shall the views show a thumbnail.
Definition at line 514 of file GtkCRNDocument.cpp.
void Document::set_subblocks_colors | ( | const crn::pixel::RGB8 & | col1, |
const crn::pixel::RGB8 & | col2, | ||
const crn::pixel::RGB8 & | textcol | ||
) |
Sets the colors of the subblocks on the image.
Definition at line 1122 of file GtkCRNDocument.cpp.
|
inline |
Signal when the selection is about to be deleted. Connect to bool on_delete_selection(const std::vector<crn::String> selected_views_ids) that will return true to allow the deletion, false to prevent it.
Definition at line 121 of file GtkCRNDocument.h.
|
inline |
Signals when something was dropped from another application. Connect to void on_droppedin(int position, crn::StringUTF8 data).
Definition at line 115 of file GtkCRNDocument.h.
|
inline |
Signal when the selection has changed. Connect to void on_view_selection_changed(const crn::String last_selected_view_id, const std::vector<crn::String> selected_views_ids).
Definition at line 118 of file GtkCRNDocument.h.
void Document::thread_safe_reload_image | ( | const crn::String & | view_id | ) |
Refreshes the thumbnail of a view and the Image if needed (thread safe)
Definition at line 1070 of file GtkCRNDocument.cpp.