20#include <glibmm/i18n.h>
41 std::set<Glib::ustring> check;
48 if (term !=
"" && (check.insert(term).second)) {
49 ss << (first ?
"" :
", ") <<
"<b>" << term.raw() <<
"</b>";
54 return g_strdup(ss.str().c_str());
60 std::set<Glib::ustring> check;
65 if (term !=
"" && (check.insert(term).second)) {
90 , _when_selected{when_selected}
91 , _when_nothing{when_nothing}
101 std::vector<SPItem*>
items(selection->
items().begin(), selection->
items().end());
107 g_assert(
item !=
nullptr);
114 layer_name = g_strdup(_(
"root"));
116 layer_name = g_strdup(_(
"none"));
118 char const *layer_label;
119 bool is_label =
false;
120 if (layer->
label()) {
121 layer_label = layer->
label();
128 layer_name = g_strdup_printf(_(
"layer <b>%s</b>"), quoted_layer_label);
130 layer_name = g_strdup_printf(_(
"layer <b><i>%s</i></b>"), quoted_layer_label);
132 g_free(quoted_layer_label);
141 gchar *parent_name =
nullptr;
144 parent_name = g_strdup_printf(_(
"<i>%s</i>"), quoted_parent_label);
145 g_free(quoted_parent_label);
151 if (num_layers == 1) {
152 if (num_parents == 1) {
154 in_phrase = g_strdup_printf(_(
" in %s"), layer_name);
156 in_phrase = g_strdup_printf(
"%s", _(
" hidden in definitions"));
157 else if (parent_name)
158 in_phrase = g_strdup_printf(_(
" in group %s (%s)"), parent_name, layer_name);
160 in_phrase = g_strdup_printf(_(
" in unnamed group (%s)"), layer_name);
162 in_phrase = g_strdup_printf(ngettext(
" in <b>%i</b> parent (%s)",
" in <b>%i</b> parents (%s)", num_parents), num_parents, layer_name);
165 in_phrase = g_strdup_printf(ngettext(
" in <b>%i</b> layer",
" in <b>%i</b> layers", num_layers), num_layers);
168 g_free (parent_name);
170 if (
items.size()==1) {
173 bool isUse = is<SPUse>(
item);
176 item_desc, in_phrase,
178 }
else if (is<SPSymbol>(
item)) {
180 item_desc, in_phrase,
181 _(
"Remove from symbols tray to edit symbol"));
186 item_desc, in_phrase,
189 auto text = cast<SPText>(
item);
190 if (text && text->firstChild() && is<SPText>(text->firstChild())) {
192 item_desc, in_phrase,
195 auto flowtext = cast<SPFlowtext>(
item);
196 if (flowtext && !flowtext->has_internal_frame()) {
198 item_desc, in_phrase,
210 int objcount =
items.size();
214 gchar *objects_str = g_strdup_printf(ngettext(
215 "<b>%1$i</b> objects selected of type %2$s",
216 "<b>%1$i</b> objects selected of types %2$s", n_terms),
222 gchar *filt_str =
nullptr;
225 filt_str = g_strdup_printf(ngettext(
"; <i>%d filtered object</i> ",
226 "; <i>%d filtered objects</i> ", n_filt), n_filt);
228 filt_str = g_strdup(
"");
234 objects_str =
nullptr;
SPObject * layerForObject(SPObject *object)
Return layer that contains object.
SPGroup * currentRoot() const
Returns current root (=bottom) layer.
void set(MessageType type, char const *message)
pushes a message on the stack, replacing our old message
void setF(MessageType type, char const *format,...) G_GNUC_PRINTF(3
pushes a message on the stack using prinf-style formatting, and replacing our old message
A class which holds a stack of displayed messages.
SPDesktop * desktop()
Returns the desktop the selection is bound to.
SPItemRange items()
Returns a range of selected SPItems.
void updateMessage(Inkscape::Selection *selection)
sigc::scoped_connection _selection_changed_connection
SelectionDescriber(Inkscape::Selection *selection, MessageStack &stack, char *when_selected, char *when_nothing)
The set of selected SPObjects for a given document and layer model.
size_t numberOfLayers()
Returns the number of layers in which there are selected objects.
size_t numberOfParents()
Returns the number of parents to which the selected objects belong.
sigc::connection connectChanged(sigc::slot< void(Selection *)> slot)
Connects a slot to be notified of selection changes.
Inkscape::LayerManager & layerManager()
Base class for visual SVG elements.
bool isFiltered() const
Returns true if the item is filtered, false otherwise.
virtual const char * displayName() const
The item's type name as a translated human string.
char * detailedDescription() const
Returns a string suitable for status bar, formatted in pango markup language.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
char const * label() const
Gets the author-visible label property for the object or a default if no label is defined.
char const * getId() const
Returns the objects current ID string.
char const * defaultLabel() const
Returns a default label property for this object.
Editable view implementation.
static char const *const parent
Helper class to stream background task notifications as a series of messages.
char * xml_quote_strdup(char const *src)
TODO: insert short description here.
static int count_filtered(const std::vector< SPItem * > &items)
char * collect_terms(const std::vector< SPItem * > &items)
static int count_terms(const std::vector< SPItem * > &items)
TODO: insert short description here.
SVG <image> implementation.
TODO: insert short description here.