summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-05-20 05:01:27 +0000
committerJon A. Cruz <jon@joncruz.org>2011-05-20 05:01:27 +0000
commit9865291b790f185d7ec2271c58e8653c9d4bb295 (patch)
treed2599d2788944bc2e811b204bfb4e6d304571c10 /src
parentExtension that generates an SVGFont from a set of layers with id="GlyphLayer-... (diff)
downloadinkscape-9865291b790f185d7ec2271c58e8653c9d4bb295.tar.gz
inkscape-9865291b790f185d7ec2271c58e8653c9d4bb295.zip
Reinstating version bump.
(bzr r10215)
Diffstat (limited to 'src')
-rw-r--r--src/display/sp-canvas.cpp7
-rw-r--r--src/ege-adjustment-action.cpp10
-rw-r--r--src/ege-select-one-action.cpp3
-rw-r--r--src/ink-comboboxentry-action.cpp27
-rw-r--r--src/ink-comboboxentry-action.h2
-rw-r--r--src/inkscape.cpp4
-rw-r--r--src/io/sys.cpp4
-rw-r--r--src/ui/dialog/glyphs.cpp20
-rw-r--r--src/ui/dialog/glyphs.h2
-rw-r--r--src/widgets/sp-color-slider.cpp18
-rw-r--r--src/widgets/sp-color-wheel-selector.cpp4
11 files changed, 8 insertions, 93 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 2d1e57092..0d450362a 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -47,12 +47,9 @@
using Inkscape::Debug::GdkEventLatencyTracker;
-// GTK_CHECK_VERSION returns false on failure
-#define HAS_GDK_EVENT_REQUEST_MOTIONS GTK_CHECK_VERSION(2, 12, 0)
-
// gtk_check_version returns non-NULL on failure
static bool const HAS_BROKEN_MOTION_HINTS =
- true || gtk_check_version(2, 12, 0) != NULL || !HAS_GDK_EVENT_REQUEST_MOTIONS;
+ true || gtk_check_version(2, 12, 0) != NULL;
// Define this to visualize the regions to be redrawn
//#define DEBUG_REDRAW 1;
@@ -1599,9 +1596,7 @@ sp_canvas_scroll (GtkWidget *widget, GdkEventScroll *event)
static inline void request_motions(GdkWindow *w, GdkEventMotion *event) {
gdk_window_get_pointer(w, NULL, NULL, NULL);
-#if HAS_GDK_EVENT_REQUEST_MOTIONS
gdk_event_request_motions(event);
-#endif
}
/**
diff --git a/src/ege-adjustment-action.cpp b/src/ege-adjustment-action.cpp
index 9c01b4c7c..b8ee66f08 100644
--- a/src/ege-adjustment-action.cpp
+++ b/src/ege-adjustment-action.cpp
@@ -47,10 +47,8 @@
#include <gtk/gtktoolitem.h>
#include <gtk/gtk.h>
#include <gtk/gtkhscale.h>
-#if GTK_CHECK_VERSION(2,12,0)
#include <gtk/gtkscalebutton.h>
#include <gtk/gtkstock.h>
-#endif /* GTK_CHECK_VERSION(2,12,0) */
#include <gtk/gtkhbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkmisc.h>
@@ -96,7 +94,6 @@ enum {
APPEARANCE_MINIMAL, /* no label, just choices in a drop-down menu */
};
-#if GTK_CHECK_VERSION(2,12,0)
/* TODO need to have appropriate icons setup for these: */
static const gchar *floogles[] = {
GTK_STOCK_REMOVE,
@@ -105,7 +102,6 @@ static const gchar *floogles[] = {
GTK_STOCK_ABOUT,
GTK_STOCK_GO_UP,
0};
-#endif /* GTK_CHECK_VERSION(2,12,0) */
typedef struct _EgeAdjustmentDescr EgeAdjustmentDescr;
@@ -846,12 +842,10 @@ static GtkWidget* create_tool_item( GtkAction* action )
gtk_scale_set_digits( GTK_SCALE(spinbutton), 0 );
g_signal_connect( G_OBJECT(spinbutton), "format-value", G_CALLBACK(slider_format_falue), leakyForNow );
-#if GTK_CHECK_VERSION(2,12,0)
} else if ( act->private_data->appearanceMode == APPEARANCE_MINIMAL ) {
spinbutton = gtk_scale_button_new( GTK_ICON_SIZE_MENU, 0, 100, 2, 0 );
gtk_scale_button_set_adjustment( GTK_SCALE_BUTTON(spinbutton), act->private_data->adj );
gtk_scale_button_set_icons( GTK_SCALE_BUTTON(spinbutton), floogles );
-#endif /* GTK_CHECK_VERSION(2,12,0) */
} else {
if ( gFactoryCb ) {
spinbutton = gFactoryCb( act->private_data->adj, act->private_data->climbRate, act->private_data->digits );
@@ -913,10 +907,8 @@ static GtkWidget* create_tool_item( GtkAction* action )
g_signal_connect_swapped( G_OBJECT(spinbutton), "event", G_CALLBACK(event_cb), action );
if ( act->private_data->appearanceMode == APPEARANCE_FULL ) {
/* */
-#if GTK_CHECK_VERSION(2,12,0)
} else if ( act->private_data->appearanceMode == APPEARANCE_MINIMAL ) {
/* */
-#endif /* GTK_CHECK_VERSION(2,12,0) */
} else {
gtk_entry_set_width_chars( GTK_ENTRY(spinbutton), act->private_data->digits + 3 );
}
@@ -962,10 +954,8 @@ gboolean focus_in_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
EgeAdjustmentAction* action = EGE_ADJUSTMENT_ACTION( data );
if ( GTK_IS_SPIN_BUTTON(widget) ) {
action->private_data->lastVal = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
-#if GTK_CHECK_VERSION(2,12,0)
} else if ( GTK_IS_SCALE_BUTTON(widget) ) {
action->private_data->lastVal = gtk_scale_button_get_value( GTK_SCALE_BUTTON(widget) );
-#endif /* GTK_CHECK_VERSION(2,12,0) */
} else if (GTK_IS_RANGE(widget) ) {
action->private_data->lastVal = gtk_range_get_value( GTK_RANGE(widget) );
}
diff --git a/src/ege-select-one-action.cpp b/src/ege-select-one-action.cpp
index 83a083425..1c3ec1ff5 100644
--- a/src/ege-select-one-action.cpp
+++ b/src/ege-select-one-action.cpp
@@ -935,7 +935,6 @@ void resync_sensitive( EgeSelectOneAction* act )
GSList* group = (GSList*)data;
// List is backwards in group as compared to GtkTreeModel, we better do matching.
while ( group ) {
-#if GTK_CHECK_VERSION(2,16,0)
GtkRadioAction* ract = GTK_RADIO_ACTION(group->data);
const gchar* label = gtk_action_get_label( GTK_ACTION( ract ) );
@@ -964,8 +963,6 @@ void resync_sensitive( EgeSelectOneAction* act )
}
gtk_action_set_sensitive( GTK_ACTION(ract), sens );
-#endif
-
group = g_slist_next(group);
}
}
diff --git a/src/ink-comboboxentry-action.cpp b/src/ink-comboboxentry-action.cpp
index 74034e537..eaaf62113 100644
--- a/src/ink-comboboxentry-action.cpp
+++ b/src/ink-comboboxentry-action.cpp
@@ -266,9 +266,7 @@ static void ink_comboboxentry_action_init (Ink_ComboBoxEntry_Action *action)
action->active = -1;
action->text = NULL;
action->entry_completion = NULL;
-#if !GTK_CHECK_VERSION(2,16,0)
action->indicator = NULL;
-#endif
action->popup = false;
action->warning = NULL;
action->altx_name = NULL;
@@ -348,15 +346,7 @@ GtkWidget* create_tool_item( GtkAction* action )
{
GtkWidget *align = gtk_alignment_new(0, 0.5, 0, 0);
-#if GTK_CHECK_VERSION(2,16,0)
gtk_container_add( GTK_CONTAINER(align), comboBoxEntry );
-#else // GTK_CHECK_VERSION(2,16,0)
- GtkWidget *hbox = gtk_hbox_new( FALSE, 0 );
- ink_comboboxentry_action->indicator = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_box_pack_start( GTK_BOX(hbox), comboBoxEntry, TRUE, TRUE, 0 );
- gtk_box_pack_start( GTK_BOX(hbox), ink_comboboxentry_action->indicator, FALSE, FALSE, 0 );
- gtk_container_add( GTK_CONTAINER(align), hbox );
-#endif // GTK_CHECK_VERSION(2,16,0)
gtk_container_add( GTK_CONTAINER(item), align );
}
@@ -415,10 +405,7 @@ GtkWidget* create_tool_item( GtkAction* action )
}
-#if GTK_CHECK_VERSION(2,16,0)
gtk_action_connect_proxy( GTK_ACTION( action ), item );
-#endif
-
gtk_widget_show_all( item );
} else {
@@ -480,7 +467,6 @@ gboolean ink_comboboxentry_action_set_active_text( Ink_ComboBoxEntry_Action* ink
// Show or hide warning
if( ink_comboboxentry_action->active == -1 && ink_comboboxentry_action->warning != NULL ) {
-#if GTK_CHECK_VERSION(2,16,0)
{
GtkStockItem item;
gboolean isStock = gtk_stock_lookup( GTK_STOCK_DIALOG_WARNING, &item );
@@ -498,22 +484,13 @@ gboolean ink_comboboxentry_action_set_active_text( Ink_ComboBoxEntry_Action* ink
gtk_entry_set_icon_tooltip_text( ink_comboboxentry_action->entry,
GTK_ENTRY_ICON_SECONDARY,
ink_comboboxentry_action->warning );
-#else // GTK_CHECK_VERSION(2,16,0)
- gtk_image_set_from_stock( GTK_IMAGE(ink_comboboxentry_action->indicator), GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_widget_set_tooltip_text( ink_comboboxentry_action->indicator, ink_comboboxentry_action->warning );
-#endif // GTK_CHECK_VERSION(2,16,0)
} else {
-#if GTK_CHECK_VERSION(2,16,0)
gtk_entry_set_icon_from_icon_name( GTK_ENTRY(ink_comboboxentry_action->entry),
GTK_ENTRY_ICON_SECONDARY,
NULL );
gtk_entry_set_icon_from_stock( GTK_ENTRY(ink_comboboxentry_action->entry),
GTK_ENTRY_ICON_SECONDARY,
NULL );
-#else // GTK_CHECK_VERSION(2,16,0)
- gtk_image_set_from_stock( GTK_IMAGE(ink_comboboxentry_action->indicator), NULL, GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_widget_set_tooltip_text( ink_comboboxentry_action->indicator, NULL );
-#endif // GTK_CHECK_VERSION(2,16,0)
}
}
@@ -585,13 +562,9 @@ void ink_comboboxentry_action_set_warning( Ink_ComboBoxEntry_Action* action,
// Widget may not have been created....
if( action->entry ) {
-#if GTK_CHECK_VERSION(2,16,0)
gtk_entry_set_icon_tooltip_text( GTK_ENTRY(action->entry),
GTK_ENTRY_ICON_SECONDARY,
action->warning );
-#else // GTK_CHECK_VERSION(2,16,0)
- gtk_image_set_from_stock( GTK_IMAGE(action->indicator), action->warning ? GTK_STOCK_DIALOG_WARNING : 0, GTK_ICON_SIZE_SMALL_TOOLBAR );
-#endif // GTK_CHECK_VERSION(2,16,0)
}
}
diff --git a/src/ink-comboboxentry-action.h b/src/ink-comboboxentry-action.h
index e080e6cdf..1a83cb053 100644
--- a/src/ink-comboboxentry-action.h
+++ b/src/ink-comboboxentry-action.h
@@ -49,9 +49,7 @@ struct _Ink_ComboBoxEntry_Action {
GtkComboBoxEntry *combobox;
GtkEntry *entry;
GtkEntryCompletion *entry_completion;
-#if !GTK_CHECK_VERSION(2,16,0)
GtkWidget *indicator;
-#endif
gpointer cell_data_func; // drop-down menu format
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 91e3b0c5f..1b0893c0b 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -442,11 +442,7 @@ void inkscape_autosave_init()
// Turn on autosave
guint32 timeout = prefs->getInt("/options/autosave/interval", 10) * 60;
// g_debug("options.autosave.interval = %d", prefs->getInt("/options/autosave/interval", 10));
-#if GLIB_CHECK_VERSION(2,14,0)
autosave_timeout_id = g_timeout_add_seconds(timeout, inkscape_autosave, NULL);
-#else
- autosave_timeout_id = g_timeout_add(timeout * 1000, inkscape_autosave, NULL);
-#endif
}
}
diff --git a/src/io/sys.cpp b/src/io/sys.cpp
index a68d02707..e6c512be2 100644
--- a/src/io/sys.cpp
+++ b/src/io/sys.cpp
@@ -19,9 +19,7 @@
#include <glib/gstdio.h>
#include <glib/gutils.h>
#include <glibmm/fileutils.h>
-#if GLIB_CHECK_VERSION(2,6,0)
- #include <glib/gstdio.h>
-#endif
+#include <glib/gstdio.h>
#include <glibmm/ustring.h>
#include <gtk/gtkmessagedialog.h>
diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp
index f3d7ed971..8eef5d89b 100644
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
@@ -48,7 +48,6 @@ GlyphsPanel &GlyphsPanel::getInstance()
}
-#if GLIB_CHECK_VERSION(2,14,0)
static std::map<GUnicodeScript, Glib::ustring> & getScriptToName()
{
static bool init = false;
@@ -123,8 +122,6 @@ static std::map<GUnicodeScript, Glib::ustring> & getScriptToName()
mappings[G_UNICODE_SCRIPT_PHOENICIAN] = _("Phoenician");
mappings[G_UNICODE_SCRIPT_PHAGS_PA] = _("Phags-pa");
mappings[G_UNICODE_SCRIPT_NKO] = _("N'Ko");
-
-#if GLIB_CHECK_VERSION(2,14,0)
mappings[G_UNICODE_SCRIPT_KAYAH_LI] = _("Kayah Li");
mappings[G_UNICODE_SCRIPT_LEPCHA] = _("Lepcha");
mappings[G_UNICODE_SCRIPT_REJANG] = _("Rejang");
@@ -136,11 +133,9 @@ static std::map<GUnicodeScript, Glib::ustring> & getScriptToName()
mappings[G_UNICODE_SCRIPT_CARIAN] = _("Carian");
mappings[G_UNICODE_SCRIPT_LYCIAN] = _("Lycian");
mappings[G_UNICODE_SCRIPT_LYDIAN] = _("Lydian");
-#endif // GLIB_CHECK_VERSION(2,14,0)
}
return mappings;
}
-#endif // GLIB_CHECK_VERSION(2,14,0)
typedef std::pair<gunichar, gunichar> Range;
typedef std::pair<Range, Glib::ustring> NamedRange;
@@ -337,9 +332,7 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
entry(0),
label(0),
insertBtn(0),
-#if GLIB_CHECK_VERSION(2,14,0)
scriptCombo(0),
-#endif // GLIB_CHECK_VERSION(2,14,0)
fsel(0),
targetDesktop(0),
deskTrack(),
@@ -366,7 +359,6 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
// -------------------------------
-#if GLIB_CHECK_VERSION(2,14,0)
{
Gtk::Label *label = new Gtk::Label(_("Script: "));
table->attach( *Gtk::manage(label),
@@ -391,7 +383,6 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
}
row++;
-#endif // GLIB_CHECK_VERSION(2,14,0)
// -------------------------------
@@ -464,10 +455,7 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
insertBtn = new Gtk::Button(_("Append"));
conn = insertBtn->signal_clicked().connect(sigc::mem_fun(*this, &GlyphsPanel::insertText));
instanceConns.push_back(conn);
-#if GTK_CHECK_VERSION(2,18,0)
- //gtkmm 2.18
insertBtn->set_can_default();
-#endif
insertBtn->set_sensitive(false);
box->pack_end(*Gtk::manage(insertBtn), Gtk::PACK_SHRINK);
@@ -607,13 +595,11 @@ void GlyphsPanel::glyphSelectionChanged()
Glib::ustring scriptName;
-#if GLIB_CHECK_VERSION(2,14,0)
GUnicodeScript script = g_unichar_get_script(ch);
std::map<GUnicodeScript, Glib::ustring> mappings = getScriptToName();
if (mappings.find(script) != mappings.end()) {
scriptName = mappings[script];
}
-#endif
gchar * tmp = g_strdup_printf("U+%04X %s", ch, scriptName.c_str());
label->set_text(tmp);
}
@@ -680,7 +666,6 @@ void GlyphsPanel::rebuild()
if (font) {
//double sp_font_selector_get_size (SPFontSelector *fsel);
-#if GLIB_CHECK_VERSION(2,14,0)
GUnicodeScript script = G_UNICODE_SCRIPT_INVALID_CODE;
Glib::ustring scriptName = scriptCombo->get_active_text();
std::map<GUnicodeScript, Glib::ustring> items = getScriptToName();
@@ -690,7 +675,6 @@ void GlyphsPanel::rebuild()
break;
}
}
-#endif // GLIB_CHECK_VERSION(2,14,0)
// Disconnect the model while we update it. Simple work-around for 5x+ performance boost.
Glib::RefPtr<Gtk::ListStore> tmp = Gtk::ListStore::create(*getColumns());
@@ -707,13 +691,9 @@ void GlyphsPanel::rebuild()
for (gunichar ch = lower; ch <= upper; ch++) {
int glyphId = font->MapUnicodeChar(ch);
if (glyphId > 0) {
-#if GLIB_CHECK_VERSION(2,14,0)
if ((script == G_UNICODE_SCRIPT_INVALID_CODE) || (script == g_unichar_get_script(ch))) {
present.push_back(ch);
}
-#else
- present.push_back(ch);
-#endif
}
}
diff --git a/src/ui/dialog/glyphs.h b/src/ui/dialog/glyphs.h
index d6c731dda..1440a693f 100644
--- a/src/ui/dialog/glyphs.h
+++ b/src/ui/dialog/glyphs.h
@@ -77,9 +77,7 @@ private:
Gtk::Entry *entry;
Gtk::Label *label;
Gtk::Button *insertBtn;
-#if GLIB_CHECK_VERSION(2,14,0)
Gtk::ComboBoxText *scriptCombo;
-#endif //GLIB_CHECK_VERSION(2,14,0)
Gtk::ComboBoxText *rangeCombo;
SPFontSelector *fsel;
SPDesktop *targetDesktop;
diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp
index 0e30b1ce6..0690caaab 100644
--- a/src/widgets/sp-color-slider.cpp
+++ b/src/widgets/sp-color-slider.cpp
@@ -1,5 +1,3 @@
-#define __SP_COLOR_SLIDER_C__
-
/*
* A slider with colored background
*
@@ -329,21 +327,17 @@ sp_color_slider_new (GtkAdjustment *adjustment)
return GTK_WIDGET (slider);
}
-void
-sp_color_slider_set_adjustment (SPColorSlider *slider, GtkAdjustment *adjustment)
+void sp_color_slider_set_adjustment(SPColorSlider *slider, GtkAdjustment *adjustment)
{
- g_return_if_fail (slider != NULL);
- g_return_if_fail (SP_IS_COLOR_SLIDER (slider));
+ g_return_if_fail (slider != NULL);
+ g_return_if_fail (SP_IS_COLOR_SLIDER (slider));
- if (!adjustment) {
- adjustment = (GtkAdjustment *) gtk_adjustment_new (0.0, 0.0, 1.0, 0.01, 0.0, 0.0);
- }
-#if GTK_CHECK_VERSION (2,14,0)
- else {
+ if (!adjustment) {
+ adjustment = (GtkAdjustment *) gtk_adjustment_new (0.0, 0.0, 1.0, 0.01, 0.0, 0.0);
+ } else {
gtk_adjustment_set_page_increment(adjustment, 0.0);
gtk_adjustment_set_page_size(adjustment, 0.0);
}
-#endif
if (slider->adjustment != adjustment) {
if (slider->adjustment) {
diff --git a/src/widgets/sp-color-wheel-selector.cpp b/src/widgets/sp-color-wheel-selector.cpp
index 2e36a024e..784dd23ad 100644
--- a/src/widgets/sp-color-wheel-selector.cpp
+++ b/src/widgets/sp-color-wheel-selector.cpp
@@ -135,14 +135,12 @@ static void resizeHSVWheel( GtkHSV *hsv, GtkAllocation *allocation )
gtk_hsv_set_metrics( hsv, diam, ring );
}
-#if GTK_CHECK_VERSION(2,18,0)
static void handleWheelStyleSet(GtkHSV *hsv, GtkStyle* /*previous*/, gpointer /*userData*/)
{
GtkAllocation allocation = {0, 0, 0, 0};
gtk_widget_get_allocation( GTK_WIDGET(hsv), &allocation );
resizeHSVWheel( hsv, &allocation );
}
-#endif // GTK_CHECK_VERSION(2,18,0)
static void handleWheelAllocation(GtkHSV *hsv, GtkAllocation *allocation, gpointer /*userData*/)
{
@@ -220,10 +218,8 @@ void ColorWheelSelector::init()
// GTK does not automatically scale the color wheel, so we have to add that in:
gtk_signal_connect( GTK_OBJECT(_wheel), "size-allocate",
GTK_SIGNAL_FUNC(handleWheelAllocation), _csel );
-#if GTK_CHECK_VERSION(2,18,0)
gtk_signal_connect( GTK_OBJECT(_wheel), "style-set",
GTK_SIGNAL_FUNC(handleWheelStyleSet), _csel );
-#endif // GTK_CHECK_VERSION(2,18,0)
}
static void