remove static Pango::FontDescriptions, they cause glib errors because of initialization before Glib::thread_init() has been called
git-svn-id: svn://localhost/ardour2/trunk@2100 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
133a66920b
commit
9decb3e027
@ -743,7 +743,7 @@ libraries['flac'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local
|
||||
#
|
||||
|
||||
conf = Configure (libraries['flac'])
|
||||
if conf.CheckLib ('FLAC', 'FLAC__seekable_stream_decoder_init', language='CXX'):
|
||||
if conf.CheckLib ('FLAC', 'FLAC__seekable_stream_decoder_set_read_callback', language='CXX'):
|
||||
conf.env.Append(CCFLAGS='-DHAVE_FLAC')
|
||||
use_flac = True
|
||||
else:
|
||||
|
@ -44,7 +44,7 @@ using namespace Gtk;
|
||||
using namespace Gtkmm2ext;
|
||||
using namespace Editing;
|
||||
|
||||
Pango::FontDescription AutomationTimeAxisView::name_font;
|
||||
Pango::FontDescription* AutomationTimeAxisView::name_font = 0;
|
||||
bool AutomationTimeAxisView::have_name_font = false;
|
||||
|
||||
AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r,
|
||||
@ -124,7 +124,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
||||
bool shortened = false;
|
||||
|
||||
int ignore_width;
|
||||
shortpname = fit_to_pixels (_name, 60, name_font, ignore_width, true);
|
||||
shortpname = fit_to_pixels (_name, 60, *name_font, ignore_width, true);
|
||||
|
||||
if (shortpname != _name ){
|
||||
shortened = true;
|
||||
@ -137,7 +137,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
||||
|
||||
/* limit the plug name string */
|
||||
|
||||
string pname = fit_to_pixels (nomparent, 60, name_font, ignore_width, true);
|
||||
string pname = fit_to_pixels (nomparent, 60, *name_font, ignore_width, true);
|
||||
if (pname != nomparent) {
|
||||
shortened = true;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ class AutomationTimeAxisView : public TimeAxisView {
|
||||
void set_colors ();
|
||||
void color_handler ();
|
||||
|
||||
static Pango::FontDescription name_font;
|
||||
static Pango::FontDescription* name_font;
|
||||
static bool have_name_font;
|
||||
};
|
||||
|
||||
|
@ -133,12 +133,14 @@ Editor::initialize_canvas ()
|
||||
|
||||
/* stuff for the verbose canvas cursor */
|
||||
|
||||
Pango::FontDescription font = get_font_for_style (N_("VerboseCanvasCursor"));
|
||||
Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
|
||||
|
||||
verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root());
|
||||
verbose_canvas_cursor->property_font_desc() = font;
|
||||
verbose_canvas_cursor->property_font_desc() = *font;
|
||||
verbose_canvas_cursor->property_anchor() = ANCHOR_NW;
|
||||
|
||||
delete font;
|
||||
|
||||
verbose_cursor_visible = false;
|
||||
|
||||
/* a group to hold time (measure) lines */
|
||||
|
@ -243,11 +243,14 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
|
||||
mark->property_fill_color_rgba() = rgba;
|
||||
mark->property_outline_color_rgba() = rgba;
|
||||
mark->property_width_pixels() = 1;
|
||||
Pango::FontDescription font = get_font_for_style (N_("MarkerText"));
|
||||
Pango::FontDescription* font = get_font_for_style (N_("MarkerText"));
|
||||
|
||||
text = new Text (*group);
|
||||
text->property_text() = annotation.c_str();
|
||||
text->property_font_desc() = font;
|
||||
text->property_font_desc() = *font;
|
||||
|
||||
delete font;
|
||||
|
||||
if (annotate_left) {
|
||||
text->property_x() = -(text->property_text_width());
|
||||
} else {
|
||||
|
@ -45,7 +45,7 @@ using namespace ARDOUR;
|
||||
//------------------------------------------------------------------------------
|
||||
/** Initialize const static memeber data */
|
||||
|
||||
Pango::FontDescription TimeAxisViewItem::NAME_FONT;
|
||||
Pango::FontDescription* TimeAxisViewItem::NAME_FONT = 0;
|
||||
bool TimeAxisViewItem::have_name_font = false;
|
||||
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
|
||||
const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
|
||||
@ -88,7 +88,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
|
||||
int width;
|
||||
int height;
|
||||
|
||||
layout->set_font_description (NAME_FONT);
|
||||
layout->set_font_description (*NAME_FONT);
|
||||
Gtkmm2ext::get_ink_pixel_size (layout, width, height);
|
||||
|
||||
NAME_Y_OFFSET = height + 6;
|
||||
@ -128,7 +128,7 @@ void
|
||||
TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis)
|
||||
{
|
||||
item_name = it_name ;
|
||||
name_text_width = ::pixel_width (it_name, NAME_FONT);
|
||||
name_text_width = ::pixel_width (it_name, *NAME_FONT);
|
||||
last_name_text_width = 0;
|
||||
samples_per_unit = spu ;
|
||||
should_show_selection = true;
|
||||
@ -214,7 +214,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
|
||||
then NAME_Y_OFFSET to position the text in the vertical center of the highlight
|
||||
*/
|
||||
name_text->property_y() = (double) trackview.height - 1.0 - TimeAxisViewItem::NAME_Y_OFFSET;
|
||||
name_text->property_font_desc() = NAME_FONT;
|
||||
name_text->property_font_desc() = *NAME_FONT;
|
||||
name_text->property_anchor() = Gtk::ANCHOR_NW;
|
||||
|
||||
name_text->set_data ("timeaxisviewitem", this);
|
||||
@ -493,7 +493,7 @@ TimeAxisViewItem::set_item_name(std::string new_name, void* src)
|
||||
if (new_name != item_name) {
|
||||
std::string temp_name = item_name ;
|
||||
item_name = new_name ;
|
||||
name_text_width = ::pixel_width (new_name, NAME_FONT);
|
||||
name_text_width = ::pixel_width (new_name, *NAME_FONT);
|
||||
NameChanged (item_name, temp_name, src) ; /* EMIT_SIGNAL */
|
||||
}
|
||||
}
|
||||
@ -563,7 +563,7 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
|
||||
{
|
||||
if (name_text) {
|
||||
name_text->property_text() = new_name;
|
||||
name_text_width = pixel_width (new_name, NAME_FONT);
|
||||
name_text_width = pixel_width (new_name, *NAME_FONT);
|
||||
name_text_size_cache.clear ();
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ class TimeAxisViewItem : public Selectable
|
||||
bool name_active() const { return name_connected; }
|
||||
|
||||
// Default sizes, font and spacing
|
||||
static Pango::FontDescription NAME_FONT ;
|
||||
static Pango::FontDescription* NAME_FONT ;
|
||||
static bool have_name_font;
|
||||
static const double NAME_X_OFFSET ;
|
||||
static const double GRAB_HANDLE_LENGTH ;
|
||||
|
@ -237,7 +237,7 @@ get_canvas_points (string who, uint32_t npoints)
|
||||
return new ArdourCanvas::Points (npoints);
|
||||
}
|
||||
|
||||
Pango::FontDescription
|
||||
Pango::FontDescription*
|
||||
get_font_for_style (string widgetname)
|
||||
{
|
||||
Gtk::Window window (WINDOW_TOPLEVEL);
|
||||
@ -260,10 +260,10 @@ get_font_for_style (string widgetname)
|
||||
|
||||
PangoContext* ctxt = (PangoContext*) pango_layout_get_context ((PangoLayout*) layout->gobj());
|
||||
pfd = pango_context_get_font_description (ctxt);
|
||||
return Pango::FontDescription (pfd, true); /* make a copy */
|
||||
return new Pango::FontDescription (pfd, true); /* make a copy */
|
||||
}
|
||||
|
||||
return Pango::FontDescription (pfd, true); /* make a copy */
|
||||
return new Pango::FontDescription (pfd, true); /* make a copy */
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
@ -63,7 +63,7 @@ unsigned char* xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h);
|
||||
|
||||
ArdourCanvas::Points* get_canvas_points (std::string who, uint32_t npoints);
|
||||
|
||||
Pango::FontDescription get_font_for_style (std::string widgetname);
|
||||
Pango::FontDescription* get_font_for_style (std::string widgetname);
|
||||
|
||||
uint32_t rgba_from_style (std::string, uint32_t, uint32_t, uint32_t, uint32_t, std::string = "fg", int = Gtk::STATE_NORMAL, bool = true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user