diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-02-20 17:47:58 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-02-20 17:47:58 +0000 |
| commit | f3014b0c21602d1e52ce240b6f4682cb5a92386a (patch) | |
| tree | f59eae26f2581f7a56e3fb13776b4e98b0840fd2 /src | |
| parent | update 2geom info (diff) | |
| download | inkscape-f3014b0c21602d1e52ce240b6f4682cb5a92386a.tar.gz inkscape-f3014b0c21602d1e52ce240b6f4682cb5a92386a.zip | |
documentation
(bzr r11003)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/scriptdialog.cpp | 45 | ||||
| -rw-r--r-- | src/ui/dialog/scriptdialog.h | 12 | ||||
| -rw-r--r-- | src/ui/dialog/text-edit.h | 28 |
3 files changed, 34 insertions, 51 deletions
diff --git a/src/ui/dialog/scriptdialog.cpp b/src/ui/dialog/scriptdialog.cpp index b775c74a1..5c4e729b7 100644 --- a/src/ui/dialog/scriptdialog.cpp +++ b/src/ui/dialog/scriptdialog.cpp @@ -44,27 +44,20 @@ class ScriptDialogImpl : public ScriptDialog { public: - - - /** - * Constructor - */ ScriptDialogImpl(); - - /** - * Destructor - */ ~ScriptDialogImpl() {} /** - * Clear the text + * Remove all text from the dialog. */ void clear(); /** - * Execute the script + * Execute a script in the dialog. + * + * @param lang language in which the script is programmed */ void execute(Inkscape::Extension::Script::InkscapeScript::ScriptLanguage lang); @@ -86,10 +79,7 @@ class ScriptDialogImpl : public ScriptDialog private: - - Gtk::MenuBar menuBar; - Gtk::Menu fileMenu; //## Script text @@ -138,10 +128,6 @@ static void textViewClear(Gtk::TextView &view) buffer->erase(buffer->begin(), buffer->end()); } - -/** - * Also a public method. Remove all text from the dialog - */ void ScriptDialogImpl::clear() { textViewClear(scriptText); @@ -149,9 +135,6 @@ void ScriptDialogImpl::clear() textViewClear(errorText); } -/** - * Execute the script in the dialog - */ void ScriptDialogImpl::execute(Inkscape::Extension::Script::InkscapeScript::ScriptLanguage lang) { Glib::ustring script = scriptText.get_buffer()->get_text(true); @@ -167,25 +150,16 @@ void ScriptDialogImpl::execute(Inkscape::Extension::Script::InkscapeScript::Scri } } -/** - * Execute the script in the dialog - */ void ScriptDialogImpl::executeJavascript() { execute(Inkscape::Extension::Script::InkscapeScript::JAVASCRIPT); } -/** - * Execute the script in the dialog - */ void ScriptDialogImpl::executePython() { execute(Inkscape::Extension::Script::InkscapeScript::PYTHON); } -/** - * Execute the script in the dialog - */ void ScriptDialogImpl::executeRuby() { execute(Inkscape::Extension::Script::InkscapeScript::RUBY); @@ -195,9 +169,6 @@ void ScriptDialogImpl::executeRuby() //######################################################################### //## C O N S T R U C T O R / D E S T R U C T O R //######################################################################### -/** - * Constructor - */ ScriptDialogImpl::ScriptDialogImpl() : ScriptDialog() { @@ -251,20 +222,12 @@ ScriptDialogImpl::ScriptDialogImpl() : } -/** - * Factory method. Use this to create a new ScriptDialog - */ ScriptDialog &ScriptDialog::getInstance() { ScriptDialog *dialog = new ScriptDialogImpl(); return *dialog; } - - - - - } //namespace Dialogs } //namespace UI } //namespace Inkscape diff --git a/src/ui/dialog/scriptdialog.h b/src/ui/dialog/scriptdialog.h index a54f865f8..d1962bf6f 100644 --- a/src/ui/dialog/scriptdialog.h +++ b/src/ui/dialog/scriptdialog.h @@ -31,24 +31,16 @@ class ScriptDialog : public UI::Widget::Panel { public: - - - /** - * Constructor - */ ScriptDialog() : UI::Widget::Panel("", "/dialogs/script", SP_VERB_DIALOG_SCRIPT) {} - /** - * Factory method + * Helper function which returns a new instance of the dialog. + * getInstance is needed by the dialog manager (Inkscape::UI::Dialog::DialogManager). */ static ScriptDialog &getInstance(); - /** - * Destructor - */ virtual ~ScriptDialog() {}; }; // class ScriptDialog diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h index 84b032eb8..9417f690e 100644 --- a/src/ui/dialog/text-edit.h +++ b/src/ui/dialog/text-edit.h @@ -82,11 +82,34 @@ protected: void onReadSelection (gboolean style, gboolean content); void onToggle (); static void onLineSpacingChange (GtkComboBox* widget, gpointer data); + + /** + * Callback invoked when the user modifies the text of the selected text object. + * + * onTextChange is responsible for initiating the commands after the user + * modified the text in the selected object. The UI of the dialog is + * updated. The subfunction setPreviewText updates the preview label. + * + * @param text_buffer pointer to GtkTextBuffer with the text of the selected text object + * @param self pointer to the current instance of the dialog. + */ static void onTextChange (GtkTextBuffer *text_buffer, TextEdit *self); + + /** + * Callback invoked when the user modifies the font through the dialog or the tools control bar. + * + * onFontChange updates the dialog UI. The subfunction setPreviewText updates the preview label. + * + * @param fontsel pointer to SPFontSelector (currently not used). + * @param font pointer to the font instance for the text to be previewed + * @param self pointer to the current instance of the dialog. + */ static void onFontChange (SPFontSelector *fontsel, font_instance *font, TextEdit *self); /** * Get the selected text off the main canvas. + * + * @return SPItem pointer to the selected text object */ SPItem *getSelectedTextItem (void); @@ -97,6 +120,9 @@ protected: /** * Helper function to create markup from a font definition and display in the preview label. + * + * @param font pointer to the font instance for the text to be previewed + * @param phrase text to be shown */ void setPreviewText (font_instance *font, Glib::ustring phrase); @@ -122,6 +148,8 @@ protected: /** * Is invoked by the desktop tracker when the desktop changes. + * + * @see DesktopTracker */ void setTargetDesktop(SPDesktop *desktop); |
