Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Dialog::Export Class Referencefinal

#include <export.h>

Inheritance diagram for Inkscape::UI::Dialog::Export:
Inkscape::UI::Dialog::DialogBase

Public Member Functions

 Export ()
 
 ~Export () final
 
- Public Member Functions inherited from Inkscape::UI::Dialog::DialogBase
 DialogBase (char const *prefs_path=nullptr, Glib::ustring dialog_type={})
 DialogBase constructor.
 
 DialogBase (DialogBase const &)=delete
 
DialogBaseoperator= (DialogBase const &)=delete
 
 ~DialogBase () override
 
virtual void update ()
 The update() method is essential to Gtk state management.
 
void setDesktop (SPDesktop *new_desktop)
 Called when the desktop might have changed for this dialog.
 
void on_map () override
 
Glib::ustring const & get_name () const
 
Glib::ustring const & getPrefsPath () const
 
Glib::ustring const & get_type () const
 
const Glib::ustring & get_icon () const
 
void blink ()
 Highlight notebook where dialog already exists.
 
virtual void focus_dialog ()
 
void defocus_dialog ()
 
bool getShowing ()
 
void fix_inner_scroll (Gtk::ScrolledWindow &scrollwin)
 
SPDesktopgetDesktop () const
 

Static Public Member Functions

static std::string absolutizePath (SPDocument *doc, const std::string &filename)
 Convert path to absolute path.
 
static bool unConflictFilename (SPDocument *doc, std::string &filename, std::string const extension)
 
static std::string filePathFromObject (SPDocument *doc, SPObject *obj, const std::string &file_entry_text)
 
static std::string prependDirectory (const std::string &name, const std::string &orig, SPDocument *doc=nullptr)
 Adds the full directory path to the final part of a file name.
 
static std::string defaultFilename (SPDocument *doc, const std::string &filename_entry_text, const std::string &extension)
 
static bool checkOrCreateDirectory (std::string const &filename)
 Checks if the directory exists and if not, tries to create the directory and if failed, displays an error message.
 
static bool exportRaster (Geom::Rect const &area, unsigned long int const &width, unsigned long int const &height, float const &dpi, Inkscape::Colors::Color const &bgcolor, Glib::ustring const &filename, bool overwrite, unsigned(*callback)(float, void *), void *data, Inkscape::Extension::Output *extension, std::vector< SPItem const * > *items=nullptr)
 Export to raster graphics.
 
static bool exportVector (Inkscape::Extension::Output *extension, SPDocument *doc, Glib::ustring const &filename, bool overwrite, Geom::Rect const &area)
 
static bool exportVector (Inkscape::Extension::Output *extension, SPDocument *doc, Glib::ustring const &filename, bool overwrite, const std::vector< SPItem const * > &items, SPPage const *page)
 
static bool exportVector (Inkscape::Extension::Output *extension, SPDocument *doc, Glib::ustring const &filename, bool overwrite, const std::vector< SPItem const * > &items, const std::vector< SPPage const * > &pages)
 Export to vector graphics.
 

Private Member Functions

void setDefaultNotebookPage ()
 
void onNotebookPageSwitch (Widget *page, unsigned page_number)
 
void documentReplaced () override
 
void desktopReplaced () override
 Called when the desktop has certainly changed.
 
void selectionChanged (Inkscape::Selection *selection) override
 
void selectionModified (Inkscape::Selection *selection, unsigned flags) override
 

Private Attributes

Glib::RefPtr< Gtk::Builder > builder
 
Gtk::Box & container
 
Gtk::Notebook & export_notebook
 
SingleExportsingle_image
 
BatchExportbatch_export
 
Inkscape::Preferencesprefs = nullptr
 
std::map< notebook_page, int > pages
 
sigc::scoped_connection notebook_signal
 

Additional Inherited Members

- Protected Member Functions inherited from Inkscape::UI::Dialog::DialogBase
InkscapeApplicationgetApp () const
 
SPDocumentgetDocument () const
 
SelectiongetSelection () const
 
void setShowing (bool showing)
 function called from notebook dialog that performs an update of the dialog and sets the dialog showing state true
 
- Protected Attributes inherited from Inkscape::UI::Dialog::DialogBase
Glib::ustring _name
 
Glib::ustring const _prefs_path
 
Glib::ustring const _dialog_type
 

Detailed Description

Definition at line 53 of file export.h.

Constructor & Destructor Documentation

◆ Export()

◆ ~Export()

Inkscape::UI::Dialog::Export::~Export ( )
finaldefault

Member Function Documentation

◆ absolutizePath()

std::string Inkscape::UI::Dialog::Export::absolutizePath ( SPDocument doc,
const std::string &  filename 
)
static

Convert path to absolute path.

  • doc Document. Relative paths are interpreted relative to the document path.
  • filename File path which may be relative. Value is in platform-native encoding (see Glib::filename_to_utf8).
Returns
File path changed to absolute path. Value is in platform-native encoding (see Glib::filename_to_utf8).

Definition at line 135 of file export.cpp.

References SPDocument::getDocumentFilename().

Referenced by checkOrCreateDirectory(), exportRaster(), exportVector(), Inkscape::UI::Dialog::SingleExport::onExport(), and unConflictFilename().

◆ checkOrCreateDirectory()

bool Inkscape::UI::Dialog::Export::checkOrCreateDirectory ( std::string const &  filename)
static

Checks if the directory exists and if not, tries to create the directory and if failed, displays an error message.

  • filename - File path (may be absolute or relative to current document). Value is in platform-native encoding (see Glib::filename_to_utf8).

Definition at line 175 of file export.cpp.

References absolutizePath(), Inkscape::UI::Dialog::DialogBase::desktop, Inkscape::ERROR_MESSAGE, Inkscape::IO::file_test(), Inkscape::MessageStack::flash(), SPDesktop::getDocument(), SPDesktop::messageStack(), Inkscape::IO::sanitizeString(), and sp_ui_error_dialog().

Referenced by Inkscape::UI::Dialog::SingleExport::onExport().

◆ defaultFilename()

std::string Inkscape::UI::Dialog::Export::defaultFilename ( SPDocument doc,
const std::string &  filename_entry_text,
const std::string &  extension 
)
static

◆ desktopReplaced()

void Inkscape::UI::Dialog::Export::desktopReplaced ( )
overrideprivatevirtual

◆ documentReplaced()

void Inkscape::UI::Dialog::Export::documentReplaced ( )
overrideprivatevirtual

◆ exportRaster()

bool Inkscape::UI::Dialog::Export::exportRaster ( Geom::Rect const &  area,
unsigned long int const &  width,
unsigned long int const &  height,
float const &  dpi,
Inkscape::Colors::Color const &  bgcolor,
Glib::ustring const &  filename,
bool  overwrite,
unsigned(*)(float, void *)  callback,
void *  data,
Inkscape::Extension::Output extension,
std::vector< SPItem const * > *  items = nullptr 
)
static

◆ exportVector() [1/3]

◆ exportVector() [2/3]

bool Inkscape::UI::Dialog::Export::exportVector ( Inkscape::Extension::Output extension,
SPDocument doc,
Glib::ustring const &  filename,
bool  overwrite,
const std::vector< SPItem const * > &  items,
SPPage const *  page 
)
static

Definition at line 313 of file export.cpp.

References exportVector(), items, page, and pages.

◆ exportVector() [3/3]

◆ filePathFromObject()

std::string Inkscape::UI::Dialog::Export::filePathFromObject ( SPDocument doc,
SPObject obj,
const std::string &  file_entry_text 
)
static

◆ onNotebookPageSwitch()

◆ prependDirectory()

std::string Inkscape::UI::Dialog::Export::prependDirectory ( const std::string &  name,
const std::string &  orig,
SPDocument doc = nullptr 
)
static

Adds the full directory path to the final part of a file name.

  • name - The final name part of a path, if absolute path, this is returned unchanged. Value is in platform-native encoding (see Glib::filename_to_utf8).
  • orig - The original filename, an optional path used previously which this name will be appanded in order to produce the full path. Value is in platform-native encoding (see Glib::filename_to_utf8).
  • doc - The document to take a fallback directory from if orig is empty.
Returns
A path ending with name and starting with the directory part of
  1. name (if it is an absolute path or empty)
  2. orig
  3. doc or
  4. the user home directory Value is in platform-native encoding (see Glib::filename_to_utf8).

Definition at line 483 of file export.cpp.

References SPDocument::getDocumentFilename(), Inkscape::IO::Resource::homedir_path(), name, and orig.

Referenced by defaultFilename(), filePathFromObject(), and Inkscape::UI::Dialog::SingleExport::loadExportHints().

◆ selectionChanged()

◆ selectionModified()

◆ setDefaultNotebookPage()

void Inkscape::UI::Dialog::Export::setDefaultNotebookPage ( )
private

◆ unConflictFilename()

bool Inkscape::UI::Dialog::Export::unConflictFilename ( SPDocument doc,
std::string &  filename,
std::string const  extension 
)
static

Definition at line 151 of file export.cpp.

References absolutizePath(), and Inkscape::IO::file_test().

Referenced by Inkscape::UI::Dialog::BatchExport::onExport().

Member Data Documentation

◆ batch_export

BatchExport& Inkscape::UI::Dialog::Export::batch_export
private

◆ builder

Glib::RefPtr<Gtk::Builder> Inkscape::UI::Dialog::Export::builder
private

Definition at line 60 of file export.h.

◆ container

Gtk::Box& Inkscape::UI::Dialog::Export::container
private

Definition at line 61 of file export.h.

Referenced by Export().

◆ export_notebook

Gtk::Notebook& Inkscape::UI::Dialog::Export::export_notebook
private

Definition at line 62 of file export.h.

Referenced by Export(), selectionChanged(), selectionModified(), and setDefaultNotebookPage().

◆ notebook_signal

sigc::scoped_connection Inkscape::UI::Dialog::Export::notebook_signal
private

Definition at line 72 of file export.h.

Referenced by Export().

◆ pages

std::map<notebook_page, int> Inkscape::UI::Dialog::Export::pages
private

◆ prefs

Inkscape::Preferences* Inkscape::UI::Dialog::Export::prefs = nullptr
private

Definition at line 66 of file export.h.

Referenced by Export().

◆ single_image

SingleExport& Inkscape::UI::Dialog::Export::single_image
private

The documentation for this class was generated from the following files: