mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 22:55:44 +01:00
compiles and runs, but crashes ... duh
git-svn-id: svn://localhost/trunk/ardour2@113 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
026f506bc6
commit
f69abbff90
44 changed files with 583 additions and 519 deletions
|
|
@ -41,7 +41,6 @@ controller.cc
|
|||
dndtreeview.cc
|
||||
fastmeter.cc
|
||||
gtk_ui.cc
|
||||
gtkutils.cc
|
||||
hexentry.cc
|
||||
idle_adjustment.cc
|
||||
pix.cc
|
||||
|
|
|
|||
|
|
@ -65,8 +65,7 @@ void
|
|||
Choice::on_realize ()
|
||||
{
|
||||
Gtk::Window::on_realize();
|
||||
Glib::RefPtr<Gdk::Window> win (get_window());
|
||||
win->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
||||
get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
||||
}
|
||||
|
||||
Choice::~Choice ()
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ using namespace Gtk;
|
|||
using namespace Gtkmm2ext;
|
||||
using namespace std;
|
||||
|
||||
Glib::RefPtr<Gdk::Pixmap> *FastMeter::v_pixmap = 0;
|
||||
Glib::RefPtr<Gdk::Bitmap> *FastMeter::v_mask = 0;
|
||||
Glib::RefPtr<Gdk::Pixmap> FastMeter::v_pixmap;
|
||||
Glib::RefPtr<Gdk::Bitmap> FastMeter::v_mask;
|
||||
gint FastMeter::v_pixheight = 0;
|
||||
gint FastMeter::v_pixwidth = 0;
|
||||
|
||||
Glib::RefPtr<Gdk::Pixmap> *FastMeter::h_pixmap = 0;
|
||||
Glib::RefPtr<Gdk::Bitmap> *FastMeter::h_mask = 0;
|
||||
Glib::RefPtr<Gdk::Pixmap> FastMeter::h_pixmap;
|
||||
Glib::RefPtr<Gdk::Bitmap> FastMeter::h_mask;
|
||||
gint FastMeter::h_pixheight = 0;
|
||||
gint FastMeter::h_pixwidth = 0;
|
||||
|
||||
|
|
@ -63,15 +63,10 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o)
|
|||
|
||||
request_width = pixrect.get_width();
|
||||
request_height= pixrect.get_height();
|
||||
|
||||
backing = 0;
|
||||
}
|
||||
|
||||
FastMeter::~FastMeter ()
|
||||
{
|
||||
if (backing) {
|
||||
(*backing)->unreference();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -79,10 +74,9 @@ FastMeter::set_vertical_xpm (const char **xpm)
|
|||
{
|
||||
if (v_pixmap == 0) {
|
||||
gint w, h;
|
||||
|
||||
*v_pixmap = Gdk::Pixmap::create_from_xpm(Gdk::Colormap::get_system(), *v_mask, xpm);
|
||||
|
||||
(*v_pixmap)->get_size(w, h);
|
||||
v_pixmap = Gdk::Pixmap::create_from_xpm(Gdk::Colormap::get_system(), v_mask, xpm);
|
||||
v_pixmap->get_size(w, h);
|
||||
|
||||
v_pixheight = h;
|
||||
v_pixwidth = w;
|
||||
|
|
@ -95,9 +89,8 @@ FastMeter::set_horizontal_xpm (const char **xpm)
|
|||
if (h_pixmap == 0) {
|
||||
gint w, h;
|
||||
|
||||
*h_pixmap = Gdk::Pixmap::create_from_xpm(Gdk::Colormap::get_system(), *h_mask, xpm);
|
||||
|
||||
(*h_pixmap)->get_size(w, h);
|
||||
h_pixmap = Gdk::Pixmap::create_from_xpm(Gdk::Colormap::get_system(), h_mask, xpm);
|
||||
h_pixmap->get_size(w, h);
|
||||
|
||||
h_pixheight = h;
|
||||
h_pixwidth = w;
|
||||
|
|
@ -147,14 +140,14 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
|
|||
pixrect.set_height(v_pixheight - top_of_meter); /* bottom of background */
|
||||
|
||||
if (backing == 0) {
|
||||
*backing = Gdk::Pixmap::create (get_window(), get_width(), get_height());
|
||||
backing = Gdk::Pixmap::create (get_window(), get_width(), get_height());
|
||||
}
|
||||
|
||||
intersect = pixrect.intersect(Glib::wrap(&ev->area), intersecting);
|
||||
if (intersecting) {
|
||||
|
||||
/* paint the background (black). */
|
||||
(*backing)->draw_rectangle(get_style()->get_black_gc(), true, intersect.get_x(), intersect.get_y(), intersect.get_width(), intersect.get_height());
|
||||
backing->draw_rectangle(get_style()->get_black_gc(), true, intersect.get_x(), intersect.get_y(), intersect.get_width(), intersect.get_height());
|
||||
blit = true;
|
||||
}
|
||||
|
||||
|
|
@ -165,10 +158,10 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
|
|||
/* draw the part of the meter image that we need. the area we draw is bounded "in reverse" (top->bottom)
|
||||
*/
|
||||
|
||||
(*backing)->draw_drawable(get_style()->get_fg_gc(get_state()), *v_pixmap,
|
||||
intersect.get_x(), v_pixheight - top_of_meter,
|
||||
intersect.get_x(), v_pixheight - top_of_meter,
|
||||
intersect.get_width(), intersect.get_height());
|
||||
backing->draw_drawable(get_style()->get_fg_gc(get_state()), v_pixmap,
|
||||
intersect.get_x(), v_pixheight - top_of_meter,
|
||||
intersect.get_x(), v_pixheight - top_of_meter,
|
||||
intersect.get_width(), intersect.get_height());
|
||||
|
||||
blit = true;
|
||||
}
|
||||
|
|
@ -176,20 +169,20 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
|
|||
/* draw peak bar */
|
||||
|
||||
if (hold_state) {
|
||||
(*backing)->draw_drawable(get_style()->get_fg_gc(get_state()), *v_pixmap,
|
||||
intersect.get_x(), v_pixheight - (gint) floor (v_pixheight * current_peak),
|
||||
intersect.get_x(), v_pixheight - (gint) floor (v_pixheight * current_peak),
|
||||
intersect.get_width(), 3);
|
||||
backing->draw_drawable(get_style()->get_fg_gc(get_state()), v_pixmap,
|
||||
intersect.get_x(), v_pixheight - (gint) floor (v_pixheight * current_peak),
|
||||
intersect.get_x(), v_pixheight - (gint) floor (v_pixheight * current_peak),
|
||||
intersect.get_width(), 3);
|
||||
}
|
||||
|
||||
/* bilt to on-screen drawable */
|
||||
|
||||
if (blit) {
|
||||
Glib::RefPtr<Gdk::Window> win (get_window());
|
||||
win->draw_drawable(get_style()->get_fg_gc(get_state()), *backing,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.width, ev->area.height);
|
||||
win->draw_drawable(get_style()->get_fg_gc(get_state()), backing,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.width, ev->area.height);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -210,14 +203,14 @@ FastMeter::horizontal_expose (GdkEventExpose* ev)
|
|||
pixrect.set_width(h_pixwidth - right_of_meter);
|
||||
|
||||
if (backing == 0) {
|
||||
*backing = Gdk::Pixmap::create(get_window(), get_width(), get_height());
|
||||
backing = Gdk::Pixmap::create(get_window(), get_width(), get_height());
|
||||
}
|
||||
|
||||
intersect = pixrect.intersect(Glib::wrap(&ev->area), intersecting);
|
||||
if (intersecting) {
|
||||
/* paint the background (black). */
|
||||
|
||||
(*backing)->draw_rectangle(get_style()->get_black_gc(), true,
|
||||
backing->draw_rectangle(get_style()->get_black_gc(), true,
|
||||
intersect.get_x(), intersect.get_y(),
|
||||
intersect.get_width(), intersect.get_height());
|
||||
blit = true;
|
||||
|
|
@ -231,10 +224,10 @@ FastMeter::horizontal_expose (GdkEventExpose* ev)
|
|||
/* draw the part of the meter image that we need.
|
||||
*/
|
||||
|
||||
(*backing)->draw_drawable(get_style()->get_fg_gc(get_state()), *h_pixmap,
|
||||
intersect.get_x(), intersect.get_y(),
|
||||
intersect.get_x(), intersect.get_y(),
|
||||
intersect.get_width(), intersect.get_height());
|
||||
backing->draw_drawable(get_style()->get_fg_gc(get_state()), h_pixmap,
|
||||
intersect.get_x(), intersect.get_y(),
|
||||
intersect.get_x(), intersect.get_y(),
|
||||
intersect.get_width(), intersect.get_height());
|
||||
|
||||
blit = true;
|
||||
}
|
||||
|
|
@ -242,17 +235,17 @@ FastMeter::horizontal_expose (GdkEventExpose* ev)
|
|||
/* draw peak bar */
|
||||
|
||||
if (hold_state) {
|
||||
(*backing)->draw_drawable(get_style()->get_fg_gc(get_state()), *h_pixmap,
|
||||
right_of_meter, intersect.get_y(),
|
||||
right_of_meter, intersect.get_y(),
|
||||
3, intersect.get_height());
|
||||
backing->draw_drawable(get_style()->get_fg_gc(get_state()), h_pixmap,
|
||||
right_of_meter, intersect.get_y(),
|
||||
right_of_meter, intersect.get_y(),
|
||||
3, intersect.get_height());
|
||||
}
|
||||
|
||||
/* bilt to on-screen drawable */
|
||||
|
||||
if (blit) {
|
||||
Glib::RefPtr<Gdk::Window> win(get_window());
|
||||
win->draw_drawable(get_style()->get_fg_gc(get_state()), *backing,
|
||||
win->draw_drawable(get_style()->get_fg_gc(get_state()), backing,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.width, ev->area.height);
|
||||
|
|
|
|||
|
|
@ -85,11 +85,6 @@ UI::UI (string name, int *argc, char ***argv, string rcfile)
|
|||
errors->set_title (title);
|
||||
|
||||
errors->dismiss_button().set_name ("ErrorLogCloseButton");
|
||||
// errors->realize();
|
||||
|
||||
Glib::RefPtr<Gdk::Window> win(errors->get_window());
|
||||
win->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
||||
|
||||
errors->signal_delete_event().connect (bind (ptr_fun (just_hide_it), (Gtk::Window *) errors));
|
||||
|
||||
register_thread (pthread_self(), X_("GUI"));
|
||||
|
|
|
|||
|
|
@ -54,18 +54,18 @@ class FastMeter : public Gtk::DrawingArea {
|
|||
void on_size_request (GtkRequisition*);
|
||||
|
||||
private:
|
||||
static Glib::RefPtr<Gdk::Pixmap>* h_pixmap;
|
||||
static Glib::RefPtr<Gdk::Bitmap>* h_mask;
|
||||
static Glib::RefPtr<Gdk::Pixmap> h_pixmap;
|
||||
static Glib::RefPtr<Gdk::Bitmap> h_mask;
|
||||
static gint h_pixheight;
|
||||
static gint h_pixwidth;
|
||||
|
||||
static Glib::RefPtr<Gdk::Pixmap>* v_pixmap;
|
||||
static Glib::RefPtr<Gdk::Bitmap>* v_mask;
|
||||
static Glib::RefPtr<Gdk::Pixmap> v_pixmap;
|
||||
static Glib::RefPtr<Gdk::Bitmap> v_mask;
|
||||
static gint v_pixheight;
|
||||
static gint v_pixwidth;
|
||||
|
||||
Orientation orientation;
|
||||
Glib::RefPtr<Gdk::Pixmap>* backing;
|
||||
Glib::RefPtr<Gdk::Pixmap> backing;
|
||||
Gdk::Rectangle pixrect;
|
||||
gint request_width;
|
||||
gint request_height;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,12 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
void set_usize_to_display_given_text (Gtk::Widget& w,
|
||||
const std::string& text,
|
||||
gint hpadding = 0,
|
||||
gint vpadding = 0);
|
||||
namespace Gtk {
|
||||
class Widget;
|
||||
}
|
||||
|
||||
void gtk_set_size_request_to_display_given_text (Gtk::Widget& w,
|
||||
const std::string& text,
|
||||
gint hpadding = 0,
|
||||
gint vpadding = 0);
|
||||
#endif /* __gtkutils_h__ */
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ class PopUp : public Gtk::Window, public Touchable
|
|||
|
||||
bool on_delete_event (GdkEventAny* );
|
||||
|
||||
protected:
|
||||
void on_realize ();
|
||||
|
||||
private:
|
||||
Gtk::Label label;
|
||||
std::string my_text;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class TearOff : public Gtk::HBox
|
|||
Gtk::Window* tearoff_window() const { return own_window; }
|
||||
bool torn_off() const;
|
||||
|
||||
|
||||
private:
|
||||
Gtk::Widget& contents;
|
||||
Gtk::Window* own_window;
|
||||
|
|
|
|||
|
|
@ -23,9 +23,15 @@
|
|||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <gtkmm/widget.h>
|
||||
#include <gtkmm/paned.h>
|
||||
#include <gtkmm/comboboxtext.h>
|
||||
|
||||
#include <gdkmm/window.h> /* for WMDecoration */
|
||||
|
||||
namespace Gtk {
|
||||
class ComboBoxText;
|
||||
class Widget;
|
||||
class Window;
|
||||
class Paned;
|
||||
}
|
||||
|
||||
namespace Gtkmm2ext {
|
||||
void init ();
|
||||
|
|
@ -42,6 +48,7 @@ namespace Gtkmm2ext {
|
|||
}
|
||||
|
||||
GdkWindow* get_paned_handle (Gtk::Paned& paned);
|
||||
void set_decoration (Gtk::Window* win, Gdk::WMDecoration decor);
|
||||
};
|
||||
|
||||
#endif /* __gtkmm2ext_utils_h__ */
|
||||
|
|
|
|||
|
|
@ -24,18 +24,10 @@
|
|||
#include <gtkmm2ext/gtkutils.h>
|
||||
|
||||
void
|
||||
set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||
const std::string& text,
|
||||
gint hpadding,
|
||||
gint vpadding)
|
||||
gtk_set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||
const std::string& text,
|
||||
gint hpadding,
|
||||
gint vpadding)
|
||||
{
|
||||
int height = 0;
|
||||
int width = 0;
|
||||
|
||||
w.create_pango_layout(text)->get_pixel_size(width, height);
|
||||
|
||||
height += vpadding;
|
||||
width += hpadding;
|
||||
|
||||
w.set_size_request(width, height);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,6 @@ PopUp::PopUp (Gtk::WindowPosition pos, unsigned int showfor_msecs, bool doh)
|
|||
: Window (WINDOW_POPUP)
|
||||
{
|
||||
|
||||
realize ();
|
||||
Glib::RefPtr<Gdk::Window> win (get_window());
|
||||
win->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
||||
add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
signal_button_press_event().connect(mem_fun(*this,&PopUp::button_click));
|
||||
set_border_width (12);
|
||||
|
|
@ -50,6 +47,13 @@ PopUp::~PopUp ()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
PopUp::on_realize ()
|
||||
{
|
||||
Gtk::Window::on_realize();
|
||||
get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
||||
}
|
||||
|
||||
gint
|
||||
PopUp::remove_prompt_timeout (void *arg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <cmath>
|
||||
#include <gtkmm2ext/tearoff.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
|
||||
using namespace Gtkmm2ext;
|
||||
using namespace Gtk;
|
||||
|
|
@ -43,10 +44,6 @@ TearOff::TearOff (Gtk::Widget& c)
|
|||
own_window = new Gtk::Window (Gtk::WINDOW_TOPLEVEL);
|
||||
own_window->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::POINTER_MOTION_HINT_MASK);
|
||||
own_window->set_resizable (false);
|
||||
// own_window->realize ();
|
||||
|
||||
Glib::RefPtr<Gdk::Window> win (own_window->get_window());
|
||||
win->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
||||
|
||||
VBox* box1;
|
||||
box1 = manage (new VBox);
|
||||
|
|
@ -59,7 +56,8 @@ TearOff::TearOff (Gtk::Widget& c)
|
|||
own_window->signal_button_release_event().connect (mem_fun (*this, &TearOff::window_button_release));
|
||||
own_window->signal_motion_notify_event().connect (mem_fun (*this, &TearOff::window_motion));
|
||||
own_window->signal_delete_event().connect (mem_fun (*this, &TearOff::window_delete_event));
|
||||
|
||||
own_window->signal_realize().connect (bind (sigc::ptr_fun (Gtkmm2ext::set_decoration), own_window, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
|
||||
|
||||
tearoff_arrow.set_name ("TearOffArrow");
|
||||
close_arrow.set_name ("TearOffArrow");
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
|
||||
#include <gtk/gtkpaned.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
#include <gtkmm2ext/gtkutils.h>
|
||||
#include <gtkmm/widget.h>
|
||||
#include <gtkmm/window.h>
|
||||
#include <gtkmm/paned.h>
|
||||
#include <gtkmm/comboboxtext.h>
|
||||
|
||||
#include "i18n.h"
|
||||
|
|
@ -29,11 +31,19 @@ using namespace std;
|
|||
|
||||
void
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *text,
|
||||
gint hpadding, gint vpadding)
|
||||
gint hpadding, gint vpadding)
|
||||
|
||||
{
|
||||
int height = 0;
|
||||
int width = 0;
|
||||
|
||||
w.ensure_style ();
|
||||
set_size_request_to_display_given_text(w, text, hpadding, vpadding);
|
||||
w.create_pango_layout(text)->get_pixel_size (width, height);
|
||||
|
||||
height += vpadding;
|
||||
width += hpadding;
|
||||
|
||||
w.set_size_request(width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -58,3 +68,9 @@ Gtkmm2ext::get_paned_handle (Gtk::Paned& paned)
|
|||
{
|
||||
return GTK_PANED(paned.gobj())->handle;
|
||||
}
|
||||
|
||||
void
|
||||
Gtkmm2ext::set_decoration (Gtk::Window* win, Gdk::WMDecoration decor)
|
||||
{
|
||||
win->get_window()->set_decorations (decor);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue