From: bryce Date: Mon, 27 Nov 2006 01:13:07 +0000 (+0000) Subject: Documenting all routines in stroke-style.cpp X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9f201372001a5c0ee469c4c1961acdec571c05d8;p=inkscape.git Documenting all routines in stroke-style.cpp --- diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp index 378198f05..c7b4fc1a5 100644 --- a/src/dialogs/stroke-style.cpp +++ b/src/dialogs/stroke-style.cpp @@ -72,6 +72,9 @@ static void sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw); static void sp_stroke_style_widget_change_subselection ( Inkscape::Application *inkscape, SPDesktop *desktop, SPWidget *spw ); +/** + * Create the stroke style widget, and hook up all the signals. + */ GtkWidget * sp_stroke_style_paint_widget_new(void) { @@ -110,6 +113,9 @@ sp_stroke_style_paint_widget_new(void) return spw; } +/** + * On construction, simply does an update of the stroke style paint object. + */ static void sp_stroke_style_paint_construct(SPWidget *spw, SPPaintSelector *psel) { @@ -122,6 +128,9 @@ sp_stroke_style_paint_construct(SPWidget *spw, SPPaintSelector *psel) } } +/** + * On signal modified, invokes an update of the stroke style paint object. + */ static void sp_stroke_style_paint_selection_modified ( SPWidget *spw, Inkscape::Selection *selection, @@ -135,6 +144,9 @@ sp_stroke_style_paint_selection_modified ( SPWidget *spw, } +/** + * On signal selection changed, invokes an update of the stroke style paint object. + */ static void sp_stroke_style_paint_selection_changed ( SPWidget *spw, Inkscape::Selection *selection, @@ -143,6 +155,10 @@ sp_stroke_style_paint_selection_changed ( SPWidget *spw, sp_stroke_style_paint_update (spw); } + +/** + * On signal change subselection, invoke an update of the stroke style widget. + */ static void sp_stroke_style_widget_change_subselection ( Inkscape::Application *inkscape, SPDesktop *desktop, @@ -151,6 +167,10 @@ sp_stroke_style_widget_change_subselection ( Inkscape::Application *inkscape, sp_stroke_style_paint_update (spw); } +/** + * Gets the active stroke style property, then sets the appropriate color, alpha, gradient, + * pattern, etc. for the paint-selector. + */ static void sp_stroke_style_paint_update (SPWidget *spw) { @@ -229,6 +249,9 @@ sp_stroke_style_paint_update (SPWidget *spw) gtk_object_set_data(GTK_OBJECT(spw), "update", GINT_TO_POINTER(FALSE)); } +/** + * When the mode is changed, invoke a regular changed handler. + */ static void sp_stroke_style_paint_mode_changed( SPPaintSelector *psel, SPPaintSelectorMode mode, @@ -249,6 +272,10 @@ static gchar *undo_label_1 = "stroke:flatcolor:1"; static gchar *undo_label_2 = "stroke:flatcolor:2"; static gchar *undo_label = undo_label_1; +/** + * When a drag callback occurs on a paint selector object, if it is a RGB or CMYK + * color mode, then set the stroke opacity to psel's flat color. + */ static void sp_stroke_style_paint_dragged(SPPaintSelector *psel, SPWidget *spw) { @@ -273,6 +300,10 @@ sp_stroke_style_paint_dragged(SPPaintSelector *psel, SPWidget *spw) } } +/** + * When the stroke style's paint settings change, this handler updates the + * repr's stroke css style and applies the style to relevant drawing items. + */ static void sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) { @@ -513,21 +544,25 @@ sp_stroke_radio_button(GtkWidget *tb, char const *icon, } +/** + * Creates a copy of the marker named mname, determines its visible and renderable + * area in menu_id's bounding box, and then renders it. + */ static GtkWidget * sp_marker_prev_new(unsigned size, gchar const *mname, SPDocument *source, SPDocument *sandbox, gchar *menu_id, NRArena const *arena, unsigned visionkey, NRArenaItem *root) { - // the object of the marker + // Retrieve the marker named 'mname' from the source SVG document SPObject const *marker = source->getObjectById(mname); if (marker == NULL) return NULL; - // the repr of the marker; make a copy with id="sample" + // Create a copy repr of the marker with id="sample" Inkscape::XML::Node *mrepr = SP_OBJECT_REPR (marker)->duplicate(); mrepr->setAttribute("id", "sample"); - // replace the old sample in the sandbox by the new one + // Replace the old sample in the sandbox by the new one Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (sandbox->getObjectById("defs")); SPObject *oldmarker = sandbox->getObjectById("sample"); if (oldmarker) @@ -714,6 +749,9 @@ sp_marker_list_from_doc (GtkWidget *m, SPDocument *current_doc, SPDocument *sour } +/** + * Returns a new document containing default start, mid, and end markers. + */ SPDocument * ink_markers_preview_doc () { @@ -747,7 +785,9 @@ gchar const *buffer = "