summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 266cb27)
raw | patch | inline | side by side (parent: 266cb27)
author | bryce <bryce@users.sourceforge.net> | |
Tue, 20 Feb 2007 08:08:25 +0000 (08:08 +0000) | ||
committer | bryce <bryce@users.sourceforge.net> | |
Tue, 20 Feb 2007 08:08:25 +0000 (08:08 +0000) |
Making the marker dropdowns static so they can be updated.
src/dialogs/stroke-style.cpp | patch | blob | history | |
src/ui/cache/svg_preview_cache.cpp | patch | blob | history | |
src/ui/cache/svg_preview_cache.h | patch | blob | history |
index 0dedcfe4cdc5cb31f594e51b8068103349e1067e..a488c1533fea1675ce2a4d239eb4ac8607e56cf8 100644 (file)
static void sp_stroke_style_widget_change_subselection ( Inkscape::Application *inkscape, SPDesktop *desktop, SPWidget *spw );
+/** Marker selection option menus */
+static GtkWidget * marker_start_menu = NULL;
+static GtkWidget * marker_mid_menu = NULL;
+static GtkWidget * marker_end_menu = NULL;
+
+
/**
* Create the stroke style widget, and hook up all the signals.
*/
// TRANSLATORS: Path markers are an SVG feature that allows you to attach arbitrary shapes
// (arrowheads, bullets, faces, whatever) to the start, end, or middle nodes of a path.
spw_label(t, _("Start Markers:"), 0, i);
- GtkWidget *mnu = ink_marker_menu( spw ,"marker-start", sandbox);
- gtk_signal_connect( GTK_OBJECT(mnu), "changed", GTK_SIGNAL_FUNC(sp_marker_select), spw );
- gtk_widget_show(mnu);
- gtk_table_attach( GTK_TABLE(t), mnu, 1, 4, i, i+1,
+ marker_start_menu = ink_marker_menu( spw ,"marker-start", sandbox);
+ gtk_signal_connect( GTK_OBJECT(marker_start_menu), "changed", GTK_SIGNAL_FUNC(sp_marker_select), spw );
+ gtk_widget_show(marker_start_menu);
+ gtk_table_attach( GTK_TABLE(t), marker_start_menu, 1, 4, i, i+1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)0, 0, 0 );
- gtk_object_set_data(GTK_OBJECT(spw), "start_mark_menu", mnu);
+ gtk_object_set_data(GTK_OBJECT(spw), "start_mark_menu", marker_start_menu);
i++;
spw_label(t, _("Mid Markers:"), 0, i);
- mnu = NULL;
- mnu = ink_marker_menu( spw ,"marker-mid", sandbox);
- gtk_signal_connect( GTK_OBJECT(mnu), "changed", GTK_SIGNAL_FUNC(sp_marker_select), spw );
- gtk_widget_show(mnu);
- gtk_table_attach( GTK_TABLE(t), mnu, 1, 4, i, i+1,
+ marker_mid_menu = ink_marker_menu( spw ,"marker-mid", sandbox);
+ gtk_signal_connect( GTK_OBJECT(marker_mid_menu), "changed", GTK_SIGNAL_FUNC(sp_marker_select), spw );
+ gtk_widget_show(marker_mid_menu);
+ gtk_table_attach( GTK_TABLE(t), marker_mid_menu, 1, 4, i, i+1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)0, 0, 0 );
- gtk_object_set_data(GTK_OBJECT(spw), "mid_mark_menu", mnu);
+ gtk_object_set_data(GTK_OBJECT(spw), "mid_mark_menu", marker_mid_menu);
i++;
spw_label(t, _("End Markers:"), 0, i);
- mnu = NULL;
- mnu = ink_marker_menu( spw ,"marker-end", sandbox);
- gtk_signal_connect( GTK_OBJECT(mnu), "changed", GTK_SIGNAL_FUNC(sp_marker_select), spw );
- gtk_widget_show(mnu);
- gtk_table_attach( GTK_TABLE(t), mnu, 1, 4, i, i+1,
+ marker_end_menu = ink_marker_menu( spw ,"marker-end", sandbox);
+ gtk_signal_connect( GTK_OBJECT(marker_end_menu), "changed", GTK_SIGNAL_FUNC(sp_marker_select), spw );
+ gtk_widget_show(marker_end_menu);
+ gtk_table_attach( GTK_TABLE(t), marker_end_menu, 1, 4, i, i+1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)0, 0, 0 );
- gtk_object_set_data(GTK_OBJECT(spw), "end_mark_menu", mnu);
+ gtk_object_set_data(GTK_OBJECT(spw), "end_mark_menu", marker_end_menu);
i++;
index 6b3bc3930166ab446969c9c6afeb3b1e21c26a13..4aa46af2b32088a365755f065881d6d3391f95ca 100644 (file)
return pixbuf;
}
+namespace Inkscape {
+namespace UI {
+namespace Cache {
+SvgPreview::SvgPreview()
+{
+}
+
+SvgPreview::~SvgPreview()
+{
+}
+
+Glib::ustring SvgPreview::cache_key(gchar const *name, unsigned psize) const {
+ Glib::ustring key = name;
+ key += ":";
+ key += psize;
+ return key;
+}
+
+GdkPixbuf* SvgPreview::get_preview_from_cache(const Glib::ustring& key) {
+ std::map<Glib::ustring, GdkPixbuf *>::iterator found = _pixmap_cache.find(key);
+ if ( found != _pixmap_cache.end() ) {
+ return found->second;
+ }
+ return NULL;
+}
+
+void SvgPreview::set_preview_in_cache(const Glib::ustring& key, GdkPixbuf* px) {
+ _pixmap_cache[key] = px;
+}
+
+GdkPixbuf* SvgPreview::get_preview(const gchar* id, NRArenaItem *root,
+ double scale_factor, unsigned int psize) {
+ // First try looking up the cached preview in the cache map
+ Glib::ustring key = cache_key(id, psize);
+ GdkPixbuf* px = get_preview_from_cache(key);
+
+ if (px == NULL) {
+ /*
+ px = render_pixbuf(root, scale_factor, dbox, psize);
+ set_preview_in_cache(key, px);
+ */
+ }
+}
+
+};
+};
+};
index 2d84b7273ae6f436e3fb13cc2fc55f3e7a9fb1ed..14e05d2f8daa3ec9968feecc6f21a203db46de13 100644 (file)
std::map<Glib::ustring, GdkPixbuf*> _pixmap_cache;
public:
- SvgPreview() {}
- ~SvgPreview() {}
+ SvgPreview();
+ ~SvgPreview();
- Glib::ustring cache_key(gchar const *name, unsigned psize) const {
- Glib::ustring key = name;
- key += ":";
- key += psize;
- return key;
- }
-
- GdkPixbuf* get_preview_from_cache(const Glib::ustring& key) {
- std::map<Glib::ustring, GdkPixbuf *>::iterator found = _pixmap_cache.find(key);
- if ( found != _pixmap_cache.end() ) {
- return found->second;
- }
- return NULL;
- }
-
- void set_preview_in_cache(const Glib::ustring& key, GdkPixbuf* px) {
- _pixmap_cache[key] = px;
- }
-
- GdkPixbuf* get_preview(const gchar* id, NRArenaItem *root, double scale_factor, unsigned int psize) {
- // First try looking up the cached preview in the cache map
- Glib::ustring key = cache_key(id, psize);
- GdkPixbuf* px = get_preview_from_cache(key);
-
- if (px == NULL) {
-/*
- px = render_pixbuf(root, scale_factor, dbox, psize);
- set_preview_in_cache(key, px);
-*/
- }
-
- }
+ Glib::ustring cache_key(gchar const *name, unsigned psize) const;
+ GdkPixbuf* get_preview_from_cache(const Glib::ustring& key);
+ void set_preview_in_cache(const Glib::ustring& key, GdkPixbuf* px);
+ GdkPixbuf* get_preview(const gchar* id, NRArenaItem *root, double scale_factor, unsigned int psize);
};
}; // namespace Cache