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
|
@ -15,6 +15,7 @@ gtkardour = env.Copy()
|
|||
domain = 'gtk_ardour'
|
||||
|
||||
gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
|
||||
gtkardour.Append(CCFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
|
||||
gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
|
||||
gtkardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
|
||||
gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
|
||||
|
@ -44,6 +45,7 @@ gtkardour.Merge ([
|
|||
libraries['soundtouch'],
|
||||
libraries['samplerate'],
|
||||
libraries['jack'],
|
||||
libraries['glade2'],
|
||||
libraries['libglademm']
|
||||
])
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <gtkmm/accelmap.h>
|
||||
#include <gtkmm/uimanager.h>
|
||||
|
||||
#include <pbd/error.h>
|
||||
|
||||
#include "actions.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -37,8 +39,21 @@ vector<RefPtr<Gtk::Action> > ActionManager::track_selection_sensitive_actions;
|
|||
vector<RefPtr<Gtk::Action> > ActionManager::plugin_selection_sensitive_actions;
|
||||
vector<RefPtr<Gtk::Action> > ActionManager::range_sensitive_actions;
|
||||
vector<RefPtr<Gtk::Action> > ActionManager::jack_sensitive_actions;
|
||||
RefPtr<UIManager> ActionManager::ui_manager;
|
||||
string ActionManager::unbound_string = "--";
|
||||
|
||||
void
|
||||
ActionManager::init ()
|
||||
{
|
||||
ui_manager = UIManager::create ();
|
||||
|
||||
try {
|
||||
ui_manager->add_ui_from_file ("ardour-menus.xml");
|
||||
} catch (Glib::MarkupError& err) {
|
||||
error << "badly formatted UI definition file" << endmsg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RefPtr<Action>
|
||||
ActionManager::register_action (RefPtr<ActionGroup> group, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
||||
|
@ -129,7 +144,7 @@ ActionManager::lookup_entry (const ustring accel_path, Gtk::AccelKey& key)
|
|||
void
|
||||
ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, vector<string>& keys, vector<AccelKey>& bindings)
|
||||
{
|
||||
ListHandle<RefPtr<ActionGroup> > uim_groups = ui_manager.get_action_groups ();
|
||||
ListHandle<RefPtr<ActionGroup> > uim_groups = ui_manager->get_action_groups ();
|
||||
|
||||
for (ListHandle<RefPtr<ActionGroup> >::iterator g = uim_groups.begin(); g != uim_groups.end(); ++g) {
|
||||
|
||||
|
@ -148,7 +163,7 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
|
|||
bool known = lookup_entry (accel_path, key);
|
||||
|
||||
if (known) {
|
||||
keys.push_back (ui_manager.get_accel_group()->name (key.get_key(), Gdk::ModifierType (key.get_mod())));
|
||||
keys.push_back (ui_manager->get_accel_group()->name (key.get_key(), Gdk::ModifierType (key.get_mod())));
|
||||
} else {
|
||||
keys.push_back (unbound_string);
|
||||
}
|
||||
|
@ -161,17 +176,17 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
|
|||
void
|
||||
ActionManager::add_action_group (RefPtr<ActionGroup> grp)
|
||||
{
|
||||
ui_manager.insert_action_group (grp);
|
||||
ui_manager->insert_action_group (grp);
|
||||
}
|
||||
|
||||
Widget*
|
||||
ActionManager::get_widget (ustring name)
|
||||
{
|
||||
return ui_manager.get_widget (name);
|
||||
return ui_manager->get_widget (name);
|
||||
}
|
||||
|
||||
RefPtr<Action>
|
||||
ActionManager::get_action (ustring name)
|
||||
{
|
||||
return ui_manager.get_action (name);
|
||||
return ui_manager->get_action (name);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ class ActionManager
|
|||
ActionManager() {}
|
||||
virtual ~ActionManager () {}
|
||||
|
||||
static void init ();
|
||||
|
||||
static std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions;
|
||||
static std::vector<Glib::RefPtr<Gtk::Action> > region_list_selection_sensitive_actions;
|
||||
static std::vector<Glib::RefPtr<Gtk::Action> > region_selection_sensitive_actions;
|
||||
|
@ -27,7 +29,7 @@ class ActionManager
|
|||
static std::vector<Glib::RefPtr<Gtk::Action> > jack_sensitive_actions;
|
||||
|
||||
static std::string unbound_string; /* the key string returned if an action is not bound */
|
||||
static Gtk::UIManager ui_manager;
|
||||
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
||||
|
||||
static Gtk::Widget* get_widget (Glib::ustring name);
|
||||
static Glib::RefPtr<Gtk::Action> get_action (Glib::ustring name);
|
||||
|
|
|
@ -1,86 +1,5 @@
|
|||
<ui>
|
||||
|
||||
<popup name='ShuttleUnitsMenu'>
|
||||
<menuitem action='SetShuttleUnitsSemitones'/>
|
||||
<menuitem action='SetShuttleUnitsPercentage'/>
|
||||
</popup>
|
||||
|
||||
<popup name='ShuttleStyleMenu'>
|
||||
<menuitem action='SetShuttleActionSprung'/>
|
||||
<menuitem action='SetShuttleActionWheel'/>
|
||||
</popup>
|
||||
|
||||
<popup name='RegionListMenu'>
|
||||
<menuitem action='rlAudition'/>
|
||||
<menuitem action='rlHide'/>
|
||||
<menuitem action='rlRemove'/>
|
||||
<separator/>
|
||||
<menuitem action='rlShowAll'/>
|
||||
<separator/>
|
||||
<menu name='Sorting'>
|
||||
<menuitem action='SortAscending'/>
|
||||
<menuitem action='SortDescending'/>
|
||||
<separator/>
|
||||
<menuitem action='SortByRegionName'/>
|
||||
<menuitem action='SortByRegionLength'/>
|
||||
<menuitem action='SortByRegionPosition'/>
|
||||
<menuitem action='SortByRegionTimestamp'/>
|
||||
<menuitem action='SortByRegionStartinFile'/>
|
||||
<menuitem action='SortByRegionEndinFile'/>
|
||||
<menuitem action='SortBySourceFileName'/>
|
||||
<menuitem action='SortBySourceFileLength'/>
|
||||
<menuitem action='SortBySourceFileCreationDate'/>
|
||||
<menuitem action='SortBySourceFilesystem'/>
|
||||
</menu>
|
||||
<menuitem action='rlImportAudio'/>
|
||||
<menuitem action='rlEmbedAudio'/>
|
||||
</popup>
|
||||
|
||||
<menubar name='Main'>
|
||||
<menu action='Session'>
|
||||
<menuitem action='New'/>
|
||||
<menuitem action='Open'/>
|
||||
<menuitem action='Recent'/>
|
||||
<menuitem action='Close'/>
|
||||
<separator/>
|
||||
<menuitem action='AddTrackBus'/>
|
||||
<separator/>
|
||||
<menu action='Export'>
|
||||
<menuitem action='ExportSession'/>
|
||||
<menuitem action='ExportRange'/>
|
||||
</menu>
|
||||
<separator/>
|
||||
<menu name='Cleanup'>
|
||||
<menuitem action='CleanupUnused'/>
|
||||
<menuitem action='FlushWastebasket'/>
|
||||
</menu>
|
||||
<separator/>
|
||||
<menu action='Quit'>
|
||||
</menu>
|
||||
<menu name='JACK'>
|
||||
<menuitem action='Disconnect'/>
|
||||
<menuitem action='Connect'/>
|
||||
<menu name='Latency'>
|
||||
<menuitem action='JACKLatency32'/>
|
||||
<menuitem action='JACKLatency64'/>
|
||||
<menuitem action='JACKLatency128'/>
|
||||
<menuitem action='JACKLatency256'/>
|
||||
<menuitem action='JACKLatency512'/>
|
||||
<menuitem action='JACKLatency1024'/>
|
||||
<menuitem action='JACKLatency2048'/>
|
||||
<menuitem action='JACKLatency4096'/>
|
||||
<menuitem action='JACKLatency8192'/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name='Windows'>
|
||||
<menuitem action='GotoEditor'/>
|
||||
<menuitem action='GotoMixer'/>
|
||||
<menuitem action='ToggleOptionsEditor'/>
|
||||
<menuitem action='ToggleAudioLibrary'/>
|
||||
<menuitem action='ToggleConnections'/>
|
||||
<menuitem action='ToggleLocations'/>
|
||||
<menuitem action='ToggleBigClock'/>
|
||||
<menuitem action='ToggleAbout'/>
|
||||
</menu>
|
||||
</menubar>
|
||||
</ui>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
*/
|
||||
|
||||
#include <gdkmm/window.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
|
||||
#include "ardour_message.h"
|
||||
#include "i18n.h"
|
||||
|
@ -54,8 +54,7 @@ ArdourMessage::ArdourMessage (Gtk::Window* parent,
|
|||
add (packer);
|
||||
show_all ();
|
||||
|
||||
realize();
|
||||
get_window()->set_decorations (Gdk::WMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
|
||||
signal_realize().connect (bind (sigc::ptr_fun (Gtkmm2ext::set_decoration), this, Gdk::WMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH)));
|
||||
|
||||
if (grab_focus) {
|
||||
ok_button.grab_focus ();
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include <ardour/port.h>
|
||||
#include <ardour/audio_track.h>
|
||||
|
||||
#include "actions.h"
|
||||
#include "ardour_ui.h"
|
||||
#include "ardour_message.h"
|
||||
#include "public_editor.h"
|
||||
|
@ -830,11 +831,12 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
|||
if (theArdourUI == 0) {
|
||||
theArdourUI = this;
|
||||
}
|
||||
|
||||
ActionManager::init ();
|
||||
|
||||
m_new_session_dialog = 0;
|
||||
m_new_session_dialog_ref = NewSessionDialogFactory::create();
|
||||
m_new_session_dialog_ref->get_widget_derived(NewSessionDialogFactory::top_level_widget_name(),
|
||||
m_new_session_dialog);
|
||||
m_new_session_dialog_ref->get_widget_derived (NewSessionDialogFactory::top_level_widget_name(), m_new_session_dialog);
|
||||
editor = 0;
|
||||
mixer = 0;
|
||||
session = 0;
|
||||
|
@ -859,8 +861,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
|||
last_configure_time.tv_sec = 0;
|
||||
last_configure_time.tv_usec = 0;
|
||||
|
||||
ui_manager = UIManager::create ();
|
||||
|
||||
shuttle_grabbed = false;
|
||||
shuttle_fract = 0.0;
|
||||
|
||||
|
@ -874,10 +874,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
|||
shuttle_actions->add (Action::create (X_("SetShuttleActionSprung"), _("Sprung")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_behaviour), Sprung));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleActionWheel"), _("Wheel")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_behaviour), Wheel));
|
||||
|
||||
ui_manager->insert_action_group (shuttle_actions);
|
||||
ActionManager::add_action_group (shuttle_actions);
|
||||
|
||||
shuttle_style_menu = dynamic_cast<Menu*> (ui_manager->get_widget ("ShuttleStylePopup"));
|
||||
shuttle_unit_menu = dynamic_cast<Menu*> (ui_manager->get_widget ("ShuttleUnitPopup"));
|
||||
shuttle_style_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("ShuttleStylePopup"));
|
||||
shuttle_unit_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("ShuttleUnitPopup"));
|
||||
|
||||
gettimeofday (&last_peak_grab, 0);
|
||||
gettimeofday (&last_shuttle_request, 0);
|
||||
|
@ -934,7 +934,8 @@ ARDOUR_UI::set_engine (AudioEngine& e)
|
|||
}
|
||||
|
||||
if (GTK_ARDOUR::show_key_actions) {
|
||||
KeyboardTarget::show_all_actions ();
|
||||
// GTK2FIX
|
||||
// show_all_actions ();
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
|
|
@ -727,7 +727,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
int make_session_clean ();
|
||||
bool filter_ardour_session_dirs (const Gtk::FileFilter::Info&);
|
||||
|
||||
Glib::RefPtr<Gtk::UIManager> ui_manager;
|
||||
Glib::RefPtr<Gtk::ActionGroup> common_actions;
|
||||
};
|
||||
|
||||
|
|
|
@ -247,12 +247,13 @@ int
|
|||
ARDOUR_UI::create_connection_editor ()
|
||||
{
|
||||
if (connection_editor == 0) {
|
||||
connection_editor = new ConnectionEditor ();
|
||||
connection_editor->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::connection_editor_hiding));
|
||||
// GTK2FIX
|
||||
// connection_editor = new ConnectionEditor ();
|
||||
// connection_editor->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::connection_editor_hiding));
|
||||
}
|
||||
|
||||
if (session) {
|
||||
connection_editor->set_session (session);
|
||||
// connection_editor->set_session (session);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -265,6 +266,9 @@ ARDOUR_UI::toggle_connection_editor ()
|
|||
return;
|
||||
}
|
||||
|
||||
//GTK2FIX
|
||||
#if 0
|
||||
|
||||
if (connection_editor->within_hiding()) {
|
||||
return;
|
||||
}
|
||||
|
@ -275,12 +279,14 @@ ARDOUR_UI::toggle_connection_editor ()
|
|||
} else {
|
||||
connection_editor->hide_all();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::connection_editor_hiding()
|
||||
{
|
||||
connection_editor_check->set_active(false);
|
||||
//GTK2FIX
|
||||
// connection_editor_check->set_active(false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -277,7 +277,7 @@ ARDOUR_UI::install_actions ()
|
|||
void
|
||||
ARDOUR_UI::build_menu_bar ()
|
||||
{
|
||||
menu_bar = dynamic_cast<MenuBar*> (ui_manager->get_widget (X_("/Main")));
|
||||
menu_bar = dynamic_cast<MenuBar*> (ActionManager::get_widget (X_("/Main")));
|
||||
menu_bar->set_name ("MainMenuBar");
|
||||
|
||||
wall_clock_box.add (wall_clock_label);
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
|
||||
#include <pbd/error.h>
|
||||
|
||||
#include <gtkmm/image.h>
|
||||
#include <gdkmm/color.h>
|
||||
#include <gdkmm/bitmap.h>
|
||||
|
||||
#include <gtkmm2ext/gtk_ui.h>
|
||||
#include <gtkmm2ext/tearoff.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
|
@ -40,16 +44,12 @@
|
|||
#include <ardour/location.h>
|
||||
#include <ardour/audioplaylist.h>
|
||||
#include <ardour/audioregion.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/region.h>
|
||||
#include <ardour/session_route.h>
|
||||
#include <ardour/tempo.h>
|
||||
#include <ardour/utils.h>
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "canvas-ruler.h"
|
||||
#include "canvas-simpleline.h"
|
||||
#include "canvas-simplerect.h"
|
||||
#include "canvas-waveview.h"
|
||||
#include "check_mark.h"
|
||||
#include "editor.h"
|
||||
#include "grouped_buttons.h"
|
||||
|
@ -60,6 +60,7 @@
|
|||
#include "rgb_macros.h"
|
||||
#include "selection.h"
|
||||
#include "streamview.h"
|
||||
#include "simpleline.h"
|
||||
#include "time_axis_view.h"
|
||||
#include "utils.h"
|
||||
#include "crossfade_view.h"
|
||||
|
@ -67,6 +68,7 @@
|
|||
#include "public_editor.h"
|
||||
#include "crossfade_edit.h"
|
||||
#include "audio_time_axis.h"
|
||||
#include "canvas_impl.h"
|
||||
#include "gui_thread.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
@ -366,9 +368,6 @@ Editor::Editor (AudioEngine& eng)
|
|||
build_cursors ();
|
||||
setup_toolbar ();
|
||||
|
||||
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
|
||||
set_state (*node);
|
||||
|
||||
edit_cursor_clock.ValueChanged.connect (mem_fun(*this, &Editor::edit_cursor_clock_changed));
|
||||
|
||||
time_canvas_vbox.pack_start (*minsec_ruler, false, false);
|
||||
|
@ -470,9 +469,9 @@ Editor::Editor (AudioEngine& eng)
|
|||
// ARDOUR_UI::instance()->tooltips().set_tip (zoom_onetoone_button, _("Zoom in 1:1"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to session"));
|
||||
|
||||
zoom_in_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(zoom_in_button_xpm)))));
|
||||
zoom_out_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(zoom_out_button_xpm)))));
|
||||
zoom_out_full_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(zoom_out_full_button_xpm)))));
|
||||
zoom_in_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(zoom_in_button_xpm)))));
|
||||
zoom_out_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(zoom_out_button_xpm)))));
|
||||
zoom_out_full_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(zoom_out_full_button_xpm)))));
|
||||
// zoom_onetoone_button.add (*(manage (new Gtk::Image (zoom_onetoone_button_xpm))));
|
||||
|
||||
|
||||
|
@ -620,8 +619,6 @@ Editor::Editor (AudioEngine& eng)
|
|||
region_list_display.signal_key_release_event().connect (mem_fun(*this, &Editor::region_list_display_key_release));
|
||||
region_list_display.signal_button_press_event().connect (mem_fun(*this, &Editor::region_list_display_button_press));
|
||||
region_list_display.signal_button_release_event().connect (mem_fun(*this, &Editor::region_list_display_button_release));
|
||||
region_list_display.signal_enter_notify_event().connect (mem_fun(*this, &Editor::region_list_display_enter_notify));
|
||||
region_list_display.signal_leave_notify_event().connect (mem_fun(*this, &Editor::region_list_display_leave_notify));
|
||||
region_list_display.get_selection()->signal_changed().connect (mem_fun(*this, &Editor::region_list_selection_changed));
|
||||
// GTK2FIX
|
||||
//region_list_display.unselect_row.connect (mem_fun(*this, &Editor::region_list_display_unselected));
|
||||
|
@ -688,6 +685,9 @@ Editor::Editor (AudioEngine& eng)
|
|||
|
||||
vpacker.pack_end (global_hpacker, true, true);
|
||||
|
||||
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
|
||||
set_state (*node);
|
||||
|
||||
_playlist_selector = new PlaylistSelector();
|
||||
_playlist_selector->signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), static_cast<Window *> (_playlist_selector)));
|
||||
|
||||
|
@ -695,8 +695,8 @@ Editor::Editor (AudioEngine& eng)
|
|||
|
||||
/* nudge stuff */
|
||||
|
||||
nudge_forward_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(right_arrow_xpm)))));
|
||||
nudge_backward_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(left_arrow_xpm)))));
|
||||
nudge_forward_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(right_arrow_xpm)))));
|
||||
nudge_backward_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(left_arrow_xpm)))));
|
||||
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (nudge_forward_button, _("Nudge region/selection forwards"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (nudge_backward_button, _("Nudge region/selection backwards"));
|
||||
|
@ -878,13 +878,13 @@ Editor::initialize_canvas ()
|
|||
transport_bar_drag_rect->set_property ("outline_pixels", 0);
|
||||
transport_bar_drag_rect->hide ();
|
||||
|
||||
marker_drag_line_points->push_back(Gnome::Art::Point(0.0, 0.0));
|
||||
marker_drag_line_points->push_back(Gnome::Art::Point(0.0, 0.0));
|
||||
marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
|
||||
marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
|
||||
|
||||
marker_drag_line = new ArdourCanvas::Line (*track_canvas.root());
|
||||
marker_drag_line->set_property ("width_pixels", 1);
|
||||
marker_drag_line->set_property("fill_color_rgba", color_map[cMarkerDragLine]);
|
||||
marker_drag_line->set_property("points", marker_drag_line_points->gobj());
|
||||
marker_drag_line->set_property("points", marker_drag_line_points);
|
||||
marker_drag_line->hide();
|
||||
|
||||
range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
|
||||
|
@ -906,7 +906,7 @@ Editor::initialize_canvas ()
|
|||
|
||||
transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
|
||||
|
||||
transport_punchin_line = new ArdourCanvas::Line (*time_line_group);
|
||||
transport_punchin_line = new ArdourCanvas::SimpleLine (*time_line_group);
|
||||
transport_punchin_line->set_property ("x1", 0.0);
|
||||
transport_punchin_line->set_property ("y1", 0.0);
|
||||
transport_punchin_line->set_property ("x2", 0.0);
|
||||
|
@ -916,7 +916,7 @@ Editor::initialize_canvas ()
|
|||
transport_punchin_line->set_property ("outline_pixels", 1);
|
||||
transport_punchin_line->hide ();
|
||||
|
||||
transport_punchout_line = new ArdourCanvas::Line (*time_line_group);
|
||||
transport_punchout_line = new ArdourCanvas::SimpleLine (*time_line_group);
|
||||
transport_punchout_line->set_property ("x1", 0.0);
|
||||
transport_punchout_line->set_property ("y1", 0.0);
|
||||
transport_punchout_line->set_property ("x2", 0.0);
|
||||
|
@ -1188,19 +1188,19 @@ Editor::deferred_reposition_and_zoom (jack_nframes_t frame, double nfpu)
|
|||
void
|
||||
Editor::on_realize ()
|
||||
{
|
||||
Window::on_realize ();
|
||||
|
||||
/* Even though we're not using acceleration, we want the
|
||||
labels to show up.
|
||||
*/
|
||||
Glib::RefPtr<Gdk::Pixmap> empty_pixmap = Gdk::Pixmap::create(get_window(), 1, 1, 1);
|
||||
Glib::RefPtr<Gdk::Pixmap> empty_bitmap = Gdk::Pixmap::create(get_window(), 1, 1, 1);
|
||||
|
||||
|
||||
track_context_menu.accelerate (*this->get_toplevel());
|
||||
track_region_context_menu.accelerate (*this->get_toplevel());
|
||||
|
||||
Window::on_realize ();
|
||||
|
||||
Glib::RefPtr<Gdk::Pixmap> empty_pixmap = Gdk::Pixmap::create(get_window(), 1, 1, 1);
|
||||
Glib::RefPtr<Gdk::Pixmap> empty_bitmap = Gdk::Pixmap::create(get_window(), 1, 1, 1);
|
||||
Gdk::Color white ("#ffffff" );
|
||||
|
||||
null_cursor = new Gdk::Cursor(empty_pixmap, empty_bitmap, white, white, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -1339,8 +1339,8 @@ Editor::reset_scrolling_region (Gtk::Allocation* alloc)
|
|||
if (playhead_cursor) playhead_cursor->set_length (canvas_alloc_height);
|
||||
|
||||
if (marker_drag_line) {
|
||||
marker_drag_line_points->back().set_x(canvas_height);
|
||||
// cerr << "set mlA points, nc = " << marker_drag_line_points->num_points << endl;
|
||||
marker_drag_line_points.back().set_x(canvas_height);
|
||||
// cerr << "set mlA points, nc = " << marker_drag_line_points.num_points << endl;
|
||||
marker_drag_line->set_property("points", marker_drag_line_points);
|
||||
}
|
||||
if (range_marker_drag_rect) {
|
||||
|
@ -1711,28 +1711,25 @@ Editor::connect_to_session (Session *t)
|
|||
void
|
||||
Editor::build_cursors ()
|
||||
{
|
||||
using namespace Gdk;
|
||||
|
||||
Gdk::Color fg ("#ff0000"); /* Red. */
|
||||
Gdk::Color bg ("#0000ff"); /* Blue. */
|
||||
|
||||
{
|
||||
Glib::RefPtr <Gdk::Pixmap> source, mask;
|
||||
source = Gdk::Pixmap::create_from_data (source, hand_bits,
|
||||
hand_width, hand_height, 1, fg, bg);
|
||||
Gdk::Pixmap::create_from_data(mask, handmask_bits,
|
||||
handmask_width, handmask_height, 1, fg, bg);
|
||||
RefPtr<Bitmap> source, mask;
|
||||
source = Bitmap::create (hand_bits, hand_width, hand_height);
|
||||
mask = Bitmap::create (handmask_bits, handmask_width, handmask_height);
|
||||
grabber_cursor = new Gdk::Cursor (source, mask, fg, bg, hand_x_hot, hand_y_hot);
|
||||
}
|
||||
|
||||
|
||||
Gdk::Color mbg ("#000000" ); /* Black */
|
||||
Gdk::Color mfg ("#0000ff" ); /* Blue. */
|
||||
|
||||
{
|
||||
Glib::RefPtr <Gdk::Pixmap> source, mask;
|
||||
|
||||
Gdk::Pixmap::create_from_data (source, mag_bits,
|
||||
mag_width, mag_height, 1, fg, bg);
|
||||
Gdk::Pixmap::create_from_data (mask, magmask_bits,
|
||||
mag_width, mag_height, 1, fg, bg);
|
||||
RefPtr<Bitmap> source, mask;
|
||||
source = Bitmap::create (mag_bits, mag_width, mag_height);
|
||||
mask = Bitmap::create (magmask_bits, mag_width, mag_height);
|
||||
zoom_cursor = new Gdk::Cursor (source, mask, mfg, mbg, mag_x_hot, mag_y_hot);
|
||||
}
|
||||
|
||||
|
@ -1740,21 +1737,17 @@ Editor::build_cursors ()
|
|||
Gdk::Color ffg ("#000000" );
|
||||
|
||||
{
|
||||
Glib::RefPtr <Gdk::Pixmap> source, mask;
|
||||
RefPtr<Bitmap> source, mask;
|
||||
|
||||
Gdk::Pixmap::create_from_data (source, fader_cursor_bits,
|
||||
fader_cursor_width, fader_cursor_height, 1, fg, bg);
|
||||
Gdk::Pixmap::create_from_data (mask, fader_cursor_mask_bits,
|
||||
fader_cursor_width, fader_cursor_height, 1, fg, bg);
|
||||
source = Bitmap::create (fader_cursor_bits, fader_cursor_width, fader_cursor_height);
|
||||
mask = Bitmap::create (fader_cursor_mask_bits, fader_cursor_width, fader_cursor_height);
|
||||
fader_cursor = new Gdk::Cursor (source, mask, ffg, fbg, fader_cursor_x_hot, fader_cursor_y_hot);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Glib::RefPtr <Gdk::Pixmap> source, mask;
|
||||
Gdk::Pixmap::create_from_data (source,speaker_cursor_bits,
|
||||
speaker_cursor_width, speaker_cursor_height, 1, fg, bg);
|
||||
Gdk::Pixmap::create_from_data (mask, speaker_cursor_mask_bits,
|
||||
speaker_cursor_width, speaker_cursor_height, 1, fg, bg);
|
||||
RefPtr<Bitmap> source, mask;
|
||||
source = Bitmap::create (speaker_cursor_bits, speaker_cursor_width, speaker_cursor_height);
|
||||
mask = Bitmap::create (speaker_cursor_mask_bits, speaker_cursor_width, speaker_cursor_height);
|
||||
speaker_cursor = new Gdk::Cursor (source, mask, ffg, fbg, speaker_cursor_x_hot, speaker_cursor_y_hot);
|
||||
}
|
||||
|
||||
|
@ -4399,9 +4392,11 @@ Editor::playlist_deletion_dialog (Playlist* pl)
|
|||
return -1;
|
||||
break;
|
||||
default:
|
||||
/* keep the playlist */
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* keep the playlist */
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -545,15 +545,15 @@ class Editor : public PublicEditor
|
|||
void store_ruler_visibility ();
|
||||
void restore_ruler_visibility ();
|
||||
|
||||
static gint _metric_get_smpte (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
static gint _metric_get_bbt (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
static gint _metric_get_frames (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
static gint _metric_get_minsec (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
|
||||
gint metric_get_smpte (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
gint metric_get_bbt (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
gint metric_get_frames (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
gint metric_get_minsec (GtkCustomRulerMark **, gulong, gulong, gint);
|
||||
gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
|
||||
GtkWidget *_smpte_ruler;
|
||||
GtkWidget *_bbt_ruler;
|
||||
|
@ -734,8 +734,6 @@ class Editor : public PublicEditor
|
|||
bool region_list_display_key_release (GdkEventKey *);
|
||||
bool region_list_display_button_press (GdkEventButton *);
|
||||
bool region_list_display_button_release (GdkEventButton *);
|
||||
bool region_list_display_enter_notify (GdkEventCrossing *);
|
||||
bool region_list_display_leave_notify (GdkEventCrossing *);
|
||||
void region_list_clear ();
|
||||
void region_list_selection_mapover (sigc::slot<void,ARDOUR::Region&>);
|
||||
void build_region_list_menu ();
|
||||
|
@ -1425,21 +1423,21 @@ class Editor : public PublicEditor
|
|||
void drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
|
||||
void end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
|
||||
|
||||
ArdourCanvas::SimpleRect* range_bar_drag_rect;
|
||||
ArdourCanvas::SimpleRect* transport_bar_drag_rect;
|
||||
ArdourCanvas::Line* marker_drag_line;
|
||||
ArdourCanvas::Points* marker_drag_line_points;
|
||||
ArdourCanvas::SimpleRect* range_marker_drag_rect;
|
||||
ArdourCanvas::SimpleRect* range_bar_drag_rect;
|
||||
ArdourCanvas::SimpleRect* transport_bar_drag_rect;
|
||||
ArdourCanvas::Line* marker_drag_line;
|
||||
ArdourCanvas::Points marker_drag_line_points;
|
||||
ArdourCanvas::SimpleRect* range_marker_drag_rect;
|
||||
|
||||
void update_marker_drag_item (ARDOUR::Location *);
|
||||
|
||||
ArdourCanvas::SimpleRect *transport_bar_range_rect;
|
||||
ArdourCanvas::SimpleRect *transport_bar_range_rect;
|
||||
ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
|
||||
ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
|
||||
ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
|
||||
ArdourCanvas::SimpleRect *transport_loop_range_rect;
|
||||
ArdourCanvas::SimpleRect *transport_punch_range_rect;
|
||||
ArdourCanvas::Line *transport_punchin_line;
|
||||
ArdourCanvas::Line *transport_punchout_line;
|
||||
ArdourCanvas::SimpleRect *transport_punch_range_rect;
|
||||
ArdourCanvas::SimpleLine *transport_punchin_line;
|
||||
ArdourCanvas::SimpleLine *transport_punchout_line;
|
||||
ArdourCanvas::SimpleRect *transport_preroll_rect;
|
||||
ArdourCanvas::SimpleRect *transport_postroll_rect;
|
||||
|
||||
|
@ -1825,10 +1823,6 @@ class Editor : public PublicEditor
|
|||
|
||||
typedef std::map<Editing::ColorID,std::string> ColorStyleMap;
|
||||
void init_colormap ();
|
||||
|
||||
/* GTK2 stuff */
|
||||
|
||||
Glib::RefPtr<Gtk::UIManager> ui_manager;
|
||||
};
|
||||
|
||||
#endif /* __ardour_editor_h__ */
|
||||
|
|
|
@ -1941,8 +1941,8 @@ Editor::update_marker_drag_item (Location *location)
|
|||
double x2 = frame_to_pixel (location->end());
|
||||
|
||||
if (location->is_mark()) {
|
||||
marker_drag_line_points->front().set_x(x1);
|
||||
marker_drag_line_points->back().set_x(x1);
|
||||
marker_drag_line_points.front().set_x(x1);
|
||||
marker_drag_line_points.back().set_x(x1);
|
||||
marker_drag_line->set_property ("points", marker_drag_line_points);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -768,31 +768,31 @@ Editor::update_tempo_based_rulers ()
|
|||
/* Mark generation */
|
||||
|
||||
gint
|
||||
Editor::_metric_get_smpte (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::_metric_get_smpte (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
return ruler_editor->metric_get_smpte (marks, lower, upper, maxchars);
|
||||
}
|
||||
|
||||
gint
|
||||
Editor::_metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::_metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
return ruler_editor->metric_get_bbt (marks, lower, upper, maxchars);
|
||||
}
|
||||
|
||||
gint
|
||||
Editor::_metric_get_frames (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::_metric_get_frames (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
return ruler_editor->metric_get_frames (marks, lower, upper, maxchars);
|
||||
}
|
||||
|
||||
gint
|
||||
Editor::_metric_get_minsec (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::_metric_get_minsec (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
return ruler_editor->metric_get_minsec (marks, lower, upper, maxchars);
|
||||
}
|
||||
|
||||
gint
|
||||
Editor::metric_get_smpte (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::metric_get_smpte (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
jack_nframes_t range;
|
||||
jack_nframes_t pos;
|
||||
|
@ -821,7 +821,7 @@ Editor::metric_get_smpte (GtkCustomRulerMark **marks, gulong lower, gulong upper
|
|||
upper = upper + spacer - lower;
|
||||
lower = 0;
|
||||
}
|
||||
range = upper - lower;
|
||||
range = (jack_nframes_t) floor (upper - lower);
|
||||
|
||||
if (range < (2 * session->frames_per_smpte_frame())) { /* 0 - 2 frames */
|
||||
show_bits = true;
|
||||
|
@ -900,8 +900,8 @@ Editor::metric_get_smpte (GtkCustomRulerMark **marks, gulong lower, gulong upper
|
|||
nmarks = 1 + 24;
|
||||
}
|
||||
|
||||
pos = lower;
|
||||
|
||||
pos = (jack_nframes_t) floor (lower);
|
||||
|
||||
*marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * nmarks);
|
||||
|
||||
if (show_bits) {
|
||||
|
@ -1028,7 +1028,7 @@ Editor::metric_get_smpte (GtkCustomRulerMark **marks, gulong lower, gulong upper
|
|||
|
||||
|
||||
gint
|
||||
Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
if (session == 0) {
|
||||
return 0;
|
||||
|
@ -1059,6 +1059,8 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
BBT_Time previous_beat;
|
||||
BBT_Time next_beat;
|
||||
jack_nframes_t next_beat_pos;
|
||||
jack_nframes_t ilower = (jack_nframes_t) floor (lower);
|
||||
jack_nframes_t iupper = (jack_nframes_t) floor (upper);
|
||||
|
||||
if ((desirable_marks = maxchars / 6) == 0) {
|
||||
return 0;
|
||||
|
@ -1085,11 +1087,11 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
|
||||
/* First find what a beat's distance is, so we can start plotting stuff before the beginning of the ruler */
|
||||
|
||||
session->bbt_time(lower,previous_beat);
|
||||
session->bbt_time(ilower,previous_beat);
|
||||
previous_beat.ticks = 0;
|
||||
next_beat = previous_beat;
|
||||
|
||||
if (session->tempo_map().meter_at(lower).beats_per_bar() < (next_beat.beats + 1)) {
|
||||
if (session->tempo_map().meter_at(ilower).beats_per_bar() < (next_beat.beats + 1)) {
|
||||
next_beat.bars += 1;
|
||||
next_beat.beats = 1;
|
||||
} else {
|
||||
|
@ -1099,7 +1101,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
frame_one_beats_worth = session->tempo_map().frame_time(next_beat) - session->tempo_map().frame_time(previous_beat);
|
||||
|
||||
|
||||
zoomed_bbt_points = session->tempo_map().get_points((lower >= frame_one_beats_worth) ? lower - frame_one_beats_worth : 0, upper);
|
||||
zoomed_bbt_points = session->tempo_map().get_points((ilower >= frame_one_beats_worth) ? ilower - frame_one_beats_worth : 0, iupper);
|
||||
|
||||
if (current_bbt_points == 0 || zoomed_bbt_points == 0 || zoomed_bbt_points->empty()) {
|
||||
return 0;
|
||||
|
@ -1133,7 +1135,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
bool i_am_accented = false;
|
||||
bool we_need_ticks = false;
|
||||
|
||||
position_of_helper = lower + (30 * Editor::get_current_zoom ());
|
||||
position_of_helper = ilower + (30 * Editor::get_current_zoom ());
|
||||
|
||||
if (desirable_marks >= (beats * 2)) {
|
||||
nmarks = (zoomed_beats * bbt_beat_subdivision) + 1;
|
||||
|
@ -1145,12 +1147,12 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
*marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * nmarks);
|
||||
|
||||
(*marks)[0].label = g_strdup(" ");
|
||||
(*marks)[0].position = lower;
|
||||
(*marks)[0].position = ilower;
|
||||
(*marks)[0].style = GtkCustomRulerMarkMicro;
|
||||
|
||||
for (n = 1, i = zoomed_bbt_points->begin(); i != zoomed_bbt_points->end() && n < nmarks; ++i) {
|
||||
|
||||
if ((*i).frame <= lower && (bar_helper_on)) {
|
||||
if ((*i).frame <= ilower && (bar_helper_on)) {
|
||||
|
||||
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
||||
(*marks)[0].label = g_strdup (buf);
|
||||
|
@ -1257,7 +1259,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
snprintf (buf, sizeof(buf), "too many bars... (currently %" PRIu32 ")", zoomed_bars );
|
||||
(*marks)[0].style = GtkCustomRulerMarkMajor;
|
||||
(*marks)[0].label = g_strdup (buf);
|
||||
(*marks)[0].position = lower;
|
||||
(*marks)[0].position = ilower;
|
||||
} else if (desirable_marks < (uint32_t) (nmarks = (gint) (zoomed_bars / 64))) {
|
||||
*marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * nmarks);
|
||||
for (n = 0, i = zoomed_bbt_points->begin(); i != zoomed_bbt_points->end() && n < nmarks; i++) {
|
||||
|
@ -1352,10 +1354,12 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gulong lower, gulong upper,
|
|||
}
|
||||
|
||||
gint
|
||||
Editor::metric_get_frames (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::metric_get_frames (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
jack_nframes_t mark_interval;
|
||||
jack_nframes_t pos;
|
||||
jack_nframes_t ilower = (jack_nframes_t) floor (lower);
|
||||
jack_nframes_t iupper = (jack_nframes_t) floor (upper);
|
||||
gchar buf[16];
|
||||
gint nmarks;
|
||||
gint n;
|
||||
|
@ -1364,7 +1368,7 @@ Editor::metric_get_frames (GtkCustomRulerMark **marks, gulong lower, gulong uppe
|
|||
return 0;
|
||||
}
|
||||
|
||||
mark_interval = (upper - lower) / 5;
|
||||
mark_interval = (iupper - ilower) / 5;
|
||||
if (mark_interval > session->frame_rate()) {
|
||||
mark_interval -= mark_interval % session->frame_rate();
|
||||
} else {
|
||||
|
@ -1372,7 +1376,7 @@ Editor::metric_get_frames (GtkCustomRulerMark **marks, gulong lower, gulong uppe
|
|||
}
|
||||
nmarks = 5;
|
||||
*marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * nmarks);
|
||||
for (n = 0, pos = lower; n < nmarks; pos += mark_interval, ++n) {
|
||||
for (n = 0, pos = ilower; n < nmarks; pos += mark_interval, ++n) {
|
||||
snprintf (buf, sizeof(buf), "%u", pos);
|
||||
(*marks)[n].label = g_strdup (buf);
|
||||
(*marks)[n].position = pos;
|
||||
|
@ -1415,7 +1419,7 @@ sample_to_clock_parts ( jack_nframes_t sample,
|
|||
}
|
||||
|
||||
gint
|
||||
Editor::metric_get_minsec (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
Editor::metric_get_minsec (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
jack_nframes_t range;
|
||||
jack_nframes_t fr;
|
||||
|
@ -1430,6 +1434,8 @@ Editor::metric_get_minsec (GtkCustomRulerMark **marks, gulong lower, gulong uppe
|
|||
bool show_seconds = false;
|
||||
bool show_minutes = false;
|
||||
bool show_hours = false;
|
||||
jack_nframes_t ilower = (jack_nframes_t) floor (lower);
|
||||
jack_nframes_t iupper = (jack_nframes_t) floor (upper);
|
||||
|
||||
if (session == 0) {
|
||||
return 0;
|
||||
|
@ -1444,7 +1450,7 @@ Editor::metric_get_minsec (GtkCustomRulerMark **marks, gulong lower, gulong uppe
|
|||
upper = upper + spacer;
|
||||
lower = 0;
|
||||
}
|
||||
range = upper - lower;
|
||||
range = iupper - ilower;
|
||||
|
||||
if (range < (fr / 50)) {
|
||||
mark_interval = fr / 100; /* show 1/100 seconds */
|
||||
|
@ -1517,7 +1523,7 @@ Editor::metric_get_minsec (GtkCustomRulerMark **marks, gulong lower, gulong uppe
|
|||
|
||||
nmarks = 1 + (range / mark_interval);
|
||||
*marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * nmarks);
|
||||
pos = ((lower + (mark_interval/2))/mark_interval) * mark_interval;
|
||||
pos = ((ilower + (mark_interval/2))/mark_interval) * mark_interval;
|
||||
|
||||
if (show_seconds) {
|
||||
for (n = 0; n < nmarks; pos += mark_interval, ++n) {
|
||||
|
|
|
@ -46,22 +46,28 @@ static void gtk_custom_hruler_draw_pos (GtkCustomRuler * ruler);
|
|||
|
||||
guint gtk_custom_hruler_get_type (void)
|
||||
{
|
||||
static guint custom_hruler_type = 0;
|
||||
|
||||
if (!custom_hruler_type) {
|
||||
static const GtkTypeInfo custom_hruler_info = {
|
||||
"GtkCustomHRuler",
|
||||
sizeof (GtkCustomHRuler),
|
||||
sizeof (GtkCustomHRulerClass),
|
||||
(GtkClassInitFunc) gtk_custom_hruler_class_init,
|
||||
(GtkObjectInitFunc) gtk_custom_hruler_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
custom_hruler_type = gtk_type_unique (gtk_custom_ruler_get_type (), &custom_hruler_info);
|
||||
static GType hruler_type = 0;
|
||||
|
||||
if (!hruler_type)
|
||||
{
|
||||
static const GTypeInfo hruler_info =
|
||||
{
|
||||
sizeof (GtkCustomHRulerClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_custom_hruler_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkCustomHRuler),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_custom_hruler_init,
|
||||
};
|
||||
|
||||
hruler_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCustomHRuler",
|
||||
&hruler_info, 0);
|
||||
}
|
||||
return custom_hruler_type;
|
||||
|
||||
return hruler_type;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -34,14 +34,12 @@
|
|||
#include "gtk-custom-ruler.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GTK_CUSTOM_HRULER(obj) GTK_CHECK_CAST (obj, gtk_custom_hruler_get_type (), GtkCustomHRuler)
|
||||
#define GTK_CUSTOM_HRULER_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_custom_hruler_get_type (), GtkCustomHRulerClass)
|
||||
#define GTK_IS_CUSTOM_HRULER(obj) GTK_CHECK_TYPE (obj, gtk_custom_hruler_get_type ())
|
||||
#define GTK_CUSTOM_HRULER(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gtk_custom_hruler_get_type (), GtkCustomHRuler)
|
||||
#define GTK_CUSTOM_HRULER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gtk_custom_hruler_get_type (), GtkCustomHRulerClass)
|
||||
#define GTK_IS_CUSTOM_HRULER(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gtk_custom_hruler_get_type ())
|
||||
|
||||
|
||||
typedef struct _GtkCustomHRuler GtkCustomHRuler;
|
||||
|
@ -62,9 +60,7 @@ guint gtk_custom_hruler_get_type (void);
|
|||
GtkWidget* gtk_custom_hruler_new (void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __GTK_CUSTOM_HRULER_H__ */
|
||||
|
|
|
@ -27,16 +27,19 @@
|
|||
/* modified by andreas meyer <hexx3000@gmx.de> */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "gettext.h"
|
||||
#define _(Text) dgettext (PACKAGE,Text)
|
||||
|
||||
#include "gtk-custom-ruler.h"
|
||||
|
||||
enum
|
||||
{
|
||||
ARG_0,
|
||||
ARG_LOWER,
|
||||
ARG_UPPER,
|
||||
ARG_POSITION,
|
||||
ARG_MAX_SIZE,
|
||||
ARG_SHOW_POSITION
|
||||
PROP_0,
|
||||
PROP_LOWER,
|
||||
PROP_UPPER,
|
||||
PROP_POSITION,
|
||||
PROP_MAX_SIZE,
|
||||
PROP_SHOW_POSITION
|
||||
};
|
||||
|
||||
static void gtk_custom_ruler_class_init (GtkCustomRulerClass * klass);
|
||||
|
@ -46,11 +49,18 @@ static void gtk_custom_ruler_unrealize (GtkWidget * widget);
|
|||
static void gtk_custom_ruler_size_allocate (GtkWidget * widget, GtkAllocation * allocation);
|
||||
static gint gtk_custom_ruler_expose (GtkWidget * widget, GdkEventExpose * event);
|
||||
static void gtk_custom_ruler_make_pixmap (GtkCustomRuler * ruler);
|
||||
static void gtk_custom_ruler_set_arg (GtkObject * object, GtkArg * arg, guint arg_id);
|
||||
static void gtk_custom_ruler_get_arg (GtkObject * object, GtkArg * arg, guint arg_id);
|
||||
static void gtk_custom_ruler_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_custom_ruler_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
|
||||
static gint
|
||||
default_metric_get_marks (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars)
|
||||
default_metric_get_marks (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -64,38 +74,44 @@ static GtkWidgetClass *parent_class;
|
|||
|
||||
GtkType gtk_custom_ruler_get_type (void)
|
||||
{
|
||||
static GtkType ruler_type = 0;
|
||||
|
||||
if (!ruler_type) {
|
||||
static const GtkTypeInfo ruler_info = {
|
||||
"GtkCustomRuler",
|
||||
sizeof (GtkCustomRuler),
|
||||
sizeof (GtkCustomRulerClass),
|
||||
(GtkClassInitFunc) gtk_custom_ruler_class_init,
|
||||
(GtkObjectInitFunc) gtk_custom_ruler_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
ruler_type = gtk_type_unique (GTK_TYPE_WIDGET, &ruler_info);
|
||||
static GType ruler_type = 0;
|
||||
|
||||
if (!ruler_type)
|
||||
{
|
||||
static const GTypeInfo ruler_info =
|
||||
{
|
||||
sizeof (GtkCustomRulerClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_custom_ruler_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkCustomRuler),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_custom_ruler_init,
|
||||
};
|
||||
|
||||
ruler_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCustomRuler",
|
||||
&ruler_info, 0);
|
||||
}
|
||||
|
||||
return ruler_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_custom_ruler_class_init (GtkCustomRulerClass * class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GObjectClass *gobject_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
object_class = (GtkObjectClass *) class;
|
||||
widget_class = (GtkWidgetClass *) class;
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
|
||||
|
||||
object_class->set_arg = gtk_custom_ruler_set_arg;
|
||||
object_class->get_arg = gtk_custom_ruler_get_arg;
|
||||
|
||||
|
||||
gobject_class = G_OBJECT_CLASS (class);
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
gobject_class->set_property = gtk_custom_ruler_set_property;
|
||||
gobject_class->get_property = gtk_custom_ruler_get_property;
|
||||
|
||||
widget_class->realize = gtk_custom_ruler_realize;
|
||||
widget_class->unrealize = gtk_custom_ruler_unrealize;
|
||||
widget_class->size_allocate = gtk_custom_ruler_size_allocate;
|
||||
|
@ -104,11 +120,53 @@ gtk_custom_ruler_class_init (GtkCustomRulerClass * class)
|
|||
class->draw_ticks = NULL;
|
||||
class->draw_pos = NULL;
|
||||
|
||||
gtk_object_add_arg_type ("GtkCustomRuler::lower", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_LOWER);
|
||||
gtk_object_add_arg_type ("GtkCustomRuler::upper", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_UPPER);
|
||||
gtk_object_add_arg_type ("GtkCustomRuler::position", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_POSITION);
|
||||
gtk_object_add_arg_type ("GtkCustomRuler::max_size", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_MAX_SIZE);
|
||||
gtk_object_add_arg_type ("GtkCustomRuler::show_position", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SHOW_POSITION);
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_LOWER,
|
||||
g_param_spec_double ("lower",
|
||||
_("Lower"),
|
||||
_("Lower limit of ruler"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_UPPER,
|
||||
g_param_spec_double ("upper",
|
||||
_("Upper"),
|
||||
_("Upper limit of ruler"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_POSITION,
|
||||
g_param_spec_double ("position",
|
||||
_("Position"),
|
||||
_("Position of mark on the ruler"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_MAX_SIZE,
|
||||
g_param_spec_double ("max_size",
|
||||
_("Max Size"),
|
||||
_("Maximum size of the ruler"),
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_SHOW_POSITION,
|
||||
g_param_spec_boolean ("show_position",
|
||||
_("Show Position"),
|
||||
_("Draw current ruler position"),
|
||||
TRUE,
|
||||
G_PARAM_READWRITE));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -129,54 +187,66 @@ gtk_custom_ruler_init (GtkCustomRuler * ruler)
|
|||
}
|
||||
|
||||
static void
|
||||
gtk_custom_ruler_set_arg (GtkObject * object, GtkArg * arg, guint arg_id)
|
||||
gtk_custom_ruler_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (object);
|
||||
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (object);
|
||||
|
||||
switch (arg_id) {
|
||||
case ARG_LOWER:
|
||||
gtk_custom_ruler_set_range (ruler, GTK_VALUE_ULONG (*arg), ruler->upper, ruler->position, ruler->max_size);
|
||||
break;
|
||||
case ARG_UPPER:
|
||||
gtk_custom_ruler_set_range (ruler, ruler->lower, GTK_VALUE_ULONG (*arg), ruler->position, ruler->max_size);
|
||||
break;
|
||||
case ARG_POSITION:
|
||||
gtk_custom_ruler_set_range (ruler, ruler->lower, ruler->upper, GTK_VALUE_ULONG (*arg), ruler->max_size);
|
||||
break;
|
||||
case ARG_MAX_SIZE:
|
||||
gtk_custom_ruler_set_range (ruler, ruler->lower, ruler->upper, ruler->position, GTK_VALUE_ULONG (*arg));
|
||||
break;
|
||||
case ARG_SHOW_POSITION:
|
||||
// gtk_customer_ruler_set_show_position (ruler, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
}
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LOWER:
|
||||
gtk_custom_ruler_set_range (ruler, g_value_get_double (value), ruler->upper,
|
||||
ruler->position, ruler->max_size);
|
||||
break;
|
||||
case PROP_UPPER:
|
||||
gtk_custom_ruler_set_range (ruler, ruler->lower, g_value_get_double (value),
|
||||
ruler->position, ruler->max_size);
|
||||
break;
|
||||
case PROP_POSITION:
|
||||
gtk_custom_ruler_set_range (ruler, ruler->lower, ruler->upper,
|
||||
g_value_get_double (value), ruler->max_size);
|
||||
break;
|
||||
case PROP_MAX_SIZE:
|
||||
gtk_custom_ruler_set_range (ruler, ruler->lower, ruler->upper,
|
||||
ruler->position, g_value_get_double (value));
|
||||
break;
|
||||
case PROP_SHOW_POSITION:
|
||||
gtk_custom_ruler_set_show_position (ruler, g_value_get_boolean (value));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_custom_ruler_get_arg (GtkObject * object, GtkArg * arg, guint arg_id)
|
||||
gtk_custom_ruler_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (object);
|
||||
|
||||
switch (arg_id) {
|
||||
case ARG_LOWER:
|
||||
GTK_VALUE_ULONG (*arg) = ruler->lower;
|
||||
break;
|
||||
case ARG_UPPER:
|
||||
GTK_VALUE_ULONG (*arg) = ruler->upper;
|
||||
break;
|
||||
case ARG_POSITION:
|
||||
GTK_VALUE_ULONG (*arg) = ruler->position;
|
||||
break;
|
||||
case ARG_MAX_SIZE:
|
||||
GTK_VALUE_ULONG (*arg) = ruler->max_size;
|
||||
break;
|
||||
case ARG_SHOW_POSITION:
|
||||
GTK_VALUE_BOOL (*arg) = ruler->show_position;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LOWER:
|
||||
g_value_set_double (value, ruler->lower);
|
||||
break;
|
||||
case PROP_UPPER:
|
||||
g_value_set_double (value, ruler->upper);
|
||||
break;
|
||||
case PROP_POSITION:
|
||||
g_value_set_double (value, ruler->position);
|
||||
break;
|
||||
case PROP_MAX_SIZE:
|
||||
g_value_set_double (value, ruler->max_size);
|
||||
break;
|
||||
case PROP_SHOW_POSITION:
|
||||
g_value_set_boolean (value, ruler->show_position);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -195,18 +265,70 @@ gtk_custom_ruler_set_metric (GtkCustomRuler * ruler, GtkCustomMetric * metric)
|
|||
}
|
||||
|
||||
void
|
||||
gtk_custom_ruler_set_range (GtkCustomRuler * ruler, gulong lower, gulong upper, gulong position, gulong max_size)
|
||||
gtk_custom_ruler_set_range (GtkCustomRuler *ruler,
|
||||
gdouble lower,
|
||||
gdouble upper,
|
||||
gdouble position,
|
||||
gdouble max_size)
|
||||
{
|
||||
g_return_if_fail (ruler != NULL);
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (ruler));
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (ruler));
|
||||
|
||||
ruler->lower = lower;
|
||||
ruler->upper = upper;
|
||||
ruler->position = position;
|
||||
ruler->max_size = max_size;
|
||||
g_object_freeze_notify (G_OBJECT (ruler));
|
||||
if (ruler->lower != lower)
|
||||
{
|
||||
ruler->lower = lower;
|
||||
g_object_notify (G_OBJECT (ruler), "lower");
|
||||
}
|
||||
if (ruler->upper != upper)
|
||||
{
|
||||
ruler->upper = upper;
|
||||
g_object_notify (G_OBJECT (ruler), "upper");
|
||||
}
|
||||
if (ruler->position != position)
|
||||
{
|
||||
ruler->position = position;
|
||||
g_object_notify (G_OBJECT (ruler), "position");
|
||||
}
|
||||
if (ruler->max_size != max_size)
|
||||
{
|
||||
ruler->max_size = max_size;
|
||||
g_object_notify (G_OBJECT (ruler), "max-size");
|
||||
}
|
||||
g_object_thaw_notify (G_OBJECT (ruler));
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (ruler))
|
||||
gtk_widget_queue_draw (GTK_WIDGET (ruler));
|
||||
if (GTK_WIDGET_DRAWABLE (ruler))
|
||||
gtk_widget_queue_draw (GTK_WIDGET (ruler));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_custom_ruler_get_range:
|
||||
* @ruler: a #GtkCustomRuler
|
||||
* @lower: location to store lower limit of the ruler, or %NULL
|
||||
* @upper: location to store upper limit of the ruler, or %NULL
|
||||
* @position: location to store the current position of the mark on the ruler, or %NULL
|
||||
* @max_size: location to store the maximum size of the ruler used when calculating
|
||||
* the space to leave for the text, or %NULL.
|
||||
*
|
||||
* Retrieves values indicating the range and current position of a #GtkCustomRuler.
|
||||
* See gtk_custom_ruler_set_range().
|
||||
**/
|
||||
void
|
||||
gtk_custom_ruler_get_range (GtkCustomRuler *ruler,
|
||||
gdouble *lower,
|
||||
gdouble *upper,
|
||||
gdouble *position,
|
||||
gdouble *max_size)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (ruler));
|
||||
|
||||
if (lower)
|
||||
*lower = ruler->lower;
|
||||
if (upper)
|
||||
*upper = ruler->upper;
|
||||
if (position)
|
||||
*position = ruler->position;
|
||||
if (max_size)
|
||||
*max_size = ruler->max_size;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -269,43 +391,38 @@ gtk_custom_ruler_realize (GtkWidget * widget)
|
|||
}
|
||||
|
||||
static void
|
||||
gtk_custom_ruler_unrealize (GtkWidget * widget)
|
||||
gtk_custom_ruler_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkCustomRuler *ruler;
|
||||
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (widget);
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (widget));
|
||||
if (ruler->backing_store)
|
||||
g_object_unref (ruler->backing_store);
|
||||
if (ruler->non_gr_exp_gc)
|
||||
g_object_unref (ruler->non_gr_exp_gc);
|
||||
|
||||
ruler = GTK_CUSTOM_RULER (widget);
|
||||
ruler->backing_store = NULL;
|
||||
ruler->non_gr_exp_gc = NULL;
|
||||
|
||||
if (ruler->backing_store)
|
||||
gdk_pixmap_unref (ruler->backing_store);
|
||||
if (ruler->non_gr_exp_gc)
|
||||
gdk_gc_destroy (ruler->non_gr_exp_gc);
|
||||
|
||||
ruler->backing_store = NULL;
|
||||
ruler->non_gr_exp_gc = NULL;
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
||||
(*GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
||||
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
||||
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_custom_ruler_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
|
||||
gtk_custom_ruler_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkCustomRuler *ruler;
|
||||
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (widget);
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_CUSTOM_RULER (widget));
|
||||
widget->allocation = *allocation;
|
||||
|
||||
ruler = GTK_CUSTOM_RULER (widget);
|
||||
widget->allocation = *allocation;
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
{
|
||||
gdk_window_move_resize (widget->window,
|
||||
allocation->x, allocation->y,
|
||||
allocation->width, allocation->height);
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget)) {
|
||||
gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height);
|
||||
|
||||
gtk_custom_ruler_make_pixmap (ruler);
|
||||
}
|
||||
gtk_custom_ruler_make_pixmap (ruler);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -332,32 +449,39 @@ gtk_custom_ruler_expose (GtkWidget * widget, GdkEventExpose * event)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_custom_ruler_make_pixmap (GtkCustomRuler * ruler)
|
||||
gtk_custom_ruler_make_pixmap (GtkCustomRuler *ruler)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
gint width;
|
||||
gint height;
|
||||
GtkWidget *widget;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
widget = GTK_WIDGET (ruler);
|
||||
widget = GTK_WIDGET (ruler);
|
||||
|
||||
if (ruler->backing_store) {
|
||||
gdk_window_get_size (ruler->backing_store, &width, &height);
|
||||
if ((width == widget->allocation.width) && (height == widget->allocation.height))
|
||||
return;
|
||||
if (ruler->backing_store)
|
||||
{
|
||||
gdk_drawable_get_size (ruler->backing_store, &width, &height);
|
||||
if ((width == widget->allocation.width) &&
|
||||
(height == widget->allocation.height))
|
||||
return;
|
||||
|
||||
gdk_pixmap_unref (ruler->backing_store);
|
||||
}
|
||||
g_object_unref (ruler->backing_store);
|
||||
}
|
||||
|
||||
ruler->backing_store = gdk_pixmap_new (widget->window, widget->allocation.width, widget->allocation.height, -1);
|
||||
ruler->backing_store = gdk_pixmap_new (widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
|
||||
ruler->xsrc = 0;
|
||||
ruler->ysrc = 0;
|
||||
ruler->xsrc = 0;
|
||||
ruler->ysrc = 0;
|
||||
|
||||
if (!ruler->non_gr_exp_gc) {
|
||||
ruler->non_gr_exp_gc = gdk_gc_new (widget->window);
|
||||
gdk_gc_set_exposures (ruler->non_gr_exp_gc, FALSE);
|
||||
}
|
||||
if (!ruler->non_gr_exp_gc)
|
||||
{
|
||||
ruler->non_gr_exp_gc = gdk_gc_new (widget->window);
|
||||
gdk_gc_set_exposures (ruler->non_gr_exp_gc, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,15 +33,14 @@
|
|||
#include <gtk/gtkwidget.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CUSTOM_RULER (gtk_custom_ruler_get_type ())
|
||||
#define GTK_CUSTOM_RULER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CUSTOM_RULER, GtkCustomRuler))
|
||||
#define GTK_CUSTOM_RULER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CUSTOM_RULER, GtkCustomRulerClass))
|
||||
#define GTK_IS_CUSTOM_RULER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CUSTOM_RULER))
|
||||
#define GTK_IS_CUSTOM_RULER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CUSTOM_RULER))
|
||||
#define GTK_CUSTOM_RULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CUSTOM_RULER, GtkCustomRuler))
|
||||
#define GTK_CUSTOM_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CUSTOM_RULER, GtkCustomRulerClass))
|
||||
#define GTK_IS_CUSTOM_RULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CUSTOM_RULER))
|
||||
#define GTK_IS_CUSTOM_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CUSTOM_RULER))
|
||||
#define GTK_CUSTOM_RULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CUSTOM_RULER, GtkCustomRulerClass))
|
||||
|
||||
typedef struct _GtkCustomRuler GtkCustomRuler;
|
||||
typedef struct _GtkCustomRulerClass GtkCustomRulerClass;
|
||||
|
@ -59,13 +58,13 @@ struct _GtkCustomRuler {
|
|||
gboolean show_position;
|
||||
|
||||
/* The upper limit of the ruler (in points) */
|
||||
gulong lower;
|
||||
gdouble lower;
|
||||
/* The lower limit of the ruler */
|
||||
gulong upper;
|
||||
gdouble upper;
|
||||
/* The position of the mark on the ruler */
|
||||
gulong position;
|
||||
gdouble position;
|
||||
/* The maximum size of the ruler */
|
||||
gulong max_size;
|
||||
gdouble max_size;
|
||||
};
|
||||
|
||||
struct _GtkCustomRulerClass {
|
||||
|
@ -83,29 +82,26 @@ typedef enum {
|
|||
|
||||
struct _GtkCustomRulerMark {
|
||||
gchar *label;
|
||||
gulong position;
|
||||
gdouble position;
|
||||
GtkCustomRulerMarkStyle style;
|
||||
};
|
||||
|
||||
struct _GtkCustomMetric {
|
||||
gfloat units_per_pixel;
|
||||
gint (* get_marks) (GtkCustomRulerMark **marks, gulong lower, gulong upper, gint maxchars);
|
||||
gint (* get_marks) (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars);
|
||||
};
|
||||
|
||||
GtkType gtk_custom_ruler_get_type (void);
|
||||
void gtk_custom_ruler_set_metric (GtkCustomRuler *ruler, GtkCustomMetric *metric);
|
||||
void gtk_custom_ruler_set_range (GtkCustomRuler *ruler,
|
||||
gulong lower,
|
||||
gulong upper,
|
||||
gulong position,
|
||||
gulong max_size);
|
||||
gdouble lower,
|
||||
gdouble upper,
|
||||
gdouble position,
|
||||
gdouble max_size);
|
||||
void gtk_custom_ruler_draw_ticks (GtkCustomRuler *ruler);
|
||||
void gtk_custom_ruler_draw_pos (GtkCustomRuler *ruler);
|
||||
void gtk_custom_ruler_set_show_position (GtkCustomRuler *rule, gboolean yn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CUSTOM_RULER_H__ */
|
||||
|
|
|
@ -167,12 +167,18 @@ Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_drawwidth() const
|
|||
{
|
||||
return Glib::PropertyProxy_ReadOnly<double> (this, "drawwidth");
|
||||
}
|
||||
|
||||
Glib::PropertyProxy<double> ImageFrame::property_height()
|
||||
{
|
||||
return Glib::PropertyProxy<double> (this, "height");
|
||||
}
|
||||
Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_height() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<double> (this, "height");
|
||||
}
|
||||
Glib::PropertyProxy<Gtk::AnchorType> ImageFrame::property_anchor()
|
||||
{
|
||||
return Glib::PropertyProxy<Gtk::AnchorType>(this, "anchor");
|
||||
}
|
||||
|
||||
Glib::PropertyProxy_ReadOnly<Gtk::AnchorType> ImageFrame::property_anchor() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<Gtk::AnchorType>(this, "anchor");
|
||||
|
|
|
@ -159,7 +159,6 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
|
|||
|
||||
track_display.get_selection()->signal_changed().connect (mem_fun(*this, &Mixer_UI::track_display_selection_changed));
|
||||
track_display_model->signal_rows_reordered().connect (mem_fun (*this, &Mixer_UI::track_display_reordered_proxy));
|
||||
track_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::track_display_button_press));
|
||||
|
||||
group_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::group_display_button_press));
|
||||
group_display.get_selection()->signal_changed().connect (mem_fun (*this, &Mixer_UI::group_display_selection_changed));
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "glade_path.h"
|
||||
|
||||
const char* NewSessionDialogFactory::s_m_top_level_widget_name = X_("new_session_dialog");
|
||||
|
||||
const char* NewSessionDialogFactory::top_level_widget_name() { return s_m_top_level_widget_name; }
|
||||
|
||||
Glib::RefPtr<Gnome::Glade::Xml>
|
||||
NewSessionDialogFactory::create()
|
||||
|
|
|
@ -201,7 +201,7 @@ AudioRegionEditor::AudioRegionEditor (Session&s, AudioRegion& r, AudioRegionView
|
|||
|
||||
fade_in_length_spinner.set_digits (3);
|
||||
|
||||
fade_in_length_spinner.signal_activate().connect (mem_fun(*this, &AudioRegionEditor::activation));
|
||||
// fade_in_length_spinner.signal_activate().connect (mem_fun(*this, &AudioRegionEditor::activation));
|
||||
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (fade_in_length_spinner, "500g", 20, -1);
|
||||
|
||||
|
@ -368,10 +368,11 @@ AudioRegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* but, void (Aud
|
|||
case 3:
|
||||
if (ev->type == GDK_BUTTON_PRESS) { /* no double clicks here */
|
||||
if (!spin_arrow_grab) {
|
||||
if ((ev->window == but->gobj()->panel)) {
|
||||
spin_arrow_grab = true;
|
||||
(this->*pmf)();
|
||||
}
|
||||
// GTK2FIX probably nuke the region editor
|
||||
// if ((ev->window == but->gobj()->panel)) {
|
||||
// spin_arrow_grab = true;
|
||||
// (this->*pmf)();
|
||||
// }
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -618,7 +619,7 @@ AudioRegionEditor::bounds_changed (Change what_changed)
|
|||
void
|
||||
AudioRegionEditor::activation ()
|
||||
{
|
||||
ARDOUR_UI::instance()->allow_focus (false);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -17,10 +17,7 @@
|
|||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
|
||||
AudioRegionGainLine::AudioRegionGainLine (string name, Session& s, AudioRegionView& r, ArdourCanvas::Group& parent,
|
||||
Curve& c,
|
||||
bool (*point_callback)(ArdourCanvas::Item*, GdkEvent*, gpointer),
|
||||
bool (*line_callback)(ArdourCanvas::Item*, GdkEvent*, gpointer))
|
||||
AudioRegionGainLine::AudioRegionGainLine (string name, Session& s, AudioRegionView& r, ArdourCanvas::Group& parent, Curve& c)
|
||||
: AutomationLine (name, r.get_time_axis_view(), parent, c),
|
||||
session (s),
|
||||
rv (r)
|
||||
|
|
|
@ -17,10 +17,7 @@ class AudioRegionView;
|
|||
class AudioRegionGainLine : public AutomationLine
|
||||
{
|
||||
public:
|
||||
AudioRegionGainLine (string name, ARDOUR::Session&, AudioRegionView&, ArdourCanvas::Group& parent,
|
||||
ARDOUR::Curve&,
|
||||
bool (*point_callback)(ArdourCanvas::Item*, GdkEvent*, gpointer),
|
||||
bool (*line_callback)(ArdourCanvas::Item*, GdkEvent*, gpointer));
|
||||
AudioRegionGainLine (string name, ARDOUR::Session&, AudioRegionView&, ArdourCanvas::Group& parent, ARDOUR::Curve&);
|
||||
|
||||
void view_to_model_y (double&);
|
||||
void model_to_view_y (double&);
|
||||
|
|
|
@ -98,8 +98,8 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
|
|||
|
||||
create_waves ();
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT(name_highlight), "regionview", this);
|
||||
gtk_object_set_data (GTK_OBJECT(name_text), "regionview", this);
|
||||
name_highlight->set_data ("regionview", this);
|
||||
name_text->set_data ("regionview", this);
|
||||
|
||||
// shape = new ArdourCanvas::Points ();
|
||||
|
||||
|
@ -151,9 +151,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
|
|||
foo += ':';
|
||||
foo += "gain";
|
||||
|
||||
gain_line = new AudioRegionGainLine (foo, tv.session(), *this, *group, region.envelope(),
|
||||
PublicEditor::canvas_control_point_event,
|
||||
PublicEditor::canvas_line_event);
|
||||
gain_line = new AudioRegionGainLine (foo, tv.session(), *this, *group, region.envelope());
|
||||
|
||||
if (!(_flags & EnvelopeVisible)) {
|
||||
gain_line->hide ();
|
||||
|
@ -178,13 +176,12 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
|
|||
|
||||
region.StateChanged.connect (mem_fun(*this, &AudioRegionView::region_changed));
|
||||
|
||||
group->signal_event().connect (bind (mem_fun (editor, &PublicEditor::UNC (PublicEditor::canvas_region_view_event)), group, this));
|
||||
region_view_name_highlight->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_region_view_name_highlight_event), region_view_name_highlight, this));
|
||||
fade_in_shape->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_fade_in_event), fade_in_shape, this));
|
||||
|
||||
fade_in_handle->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_fade_in_handle_event), fade_in_handle, this));
|
||||
fade_out_shape->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_fade_out_event), fade_out_shape, this));
|
||||
fade_out_handle->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_fade_out_handle_event), fade_out_handle, this));
|
||||
group->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
|
||||
name_highlight->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_highlight_event), name_highlight, this));
|
||||
fade_in_shape->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_event), fade_in_shape, this));
|
||||
fade_in_handle->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_handle_event), fade_in_handle, this));
|
||||
fade_out_shape->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_event), fade_out_shape, this));
|
||||
fade_out_handle->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_handle_event), fade_out_handle, this));
|
||||
|
||||
set_colors ();
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ RouteParams_UI::cleanup_pre_view (bool stopupdate)
|
|||
PluginUI * plugui = 0;
|
||||
|
||||
if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_pre_view)) != 0) {
|
||||
plugui->stop_updating ();
|
||||
plugui->stop_updating (0);
|
||||
}
|
||||
|
||||
_pre_plugin_conn.disconnect();
|
||||
|
@ -311,7 +311,7 @@ RouteParams_UI::cleanup_post_view (bool stopupdate)
|
|||
PluginUI * plugui = 0;
|
||||
|
||||
if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_post_view)) != 0) {
|
||||
plugui->stop_updating ();
|
||||
plugui->stop_updating (0);
|
||||
}
|
||||
_post_plugin_conn.disconnect();
|
||||
post_redir_hpane.remove(*_active_post_view);
|
||||
|
@ -573,7 +573,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
|
|||
if (place == PreFader) {
|
||||
cleanup_pre_view();
|
||||
_pre_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
|
||||
plugin_ui->start_updating ();
|
||||
plugin_ui->start_updating (0);
|
||||
_active_pre_view = plugin_ui;
|
||||
pre_redir_hpane.add2 (*_active_pre_view);
|
||||
pre_redir_hpane.show_all();
|
||||
|
@ -581,7 +581,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
|
|||
else {
|
||||
cleanup_post_view();
|
||||
_post_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
|
||||
plugin_ui->start_updating ();
|
||||
plugin_ui->start_updating (0);
|
||||
_active_post_view = plugin_ui;
|
||||
post_redir_hpane.add2 (*_active_post_view);
|
||||
post_redir_hpane.show_all();
|
||||
|
|
|
@ -567,10 +567,9 @@ RouteUI::choose_color()
|
|||
Gdk::Color color;
|
||||
Gdk::Color current;
|
||||
|
||||
current.set_red ( _color.get_red() / 65535.0);
|
||||
current.set_green (_color.get_green() / 65535.0);
|
||||
current.set_blue (_color.get_blue() / 65535.0);
|
||||
//current[3] = 1.0;
|
||||
current.set_red ( _color.get_red() / 65535);
|
||||
current.set_green (_color.get_green() / 65535);
|
||||
current.set_blue (_color.get_blue() / 65535);
|
||||
|
||||
color = Gtkmm2ext::UI::instance()->get_color (_("ardour: color selection"), picked, ¤t);
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ StreamView::StreamView (AudioTimeAxisView& tv)
|
|||
canvas_rect->set_property ("outline_what", (guint32) (0x1|0x2|0x8));
|
||||
canvas_rect->set_property ("fill_color_rgba", stream_base_color);
|
||||
|
||||
canvas_rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_stream_view_event), canvas_rect, this));
|
||||
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
|
||||
|
||||
_samples_per_unit = _trackview.editor.get_current_zoom();
|
||||
_amplitude_above_axis = 1.0;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "time_axis_view.h"
|
||||
#include "simplerect.h"
|
||||
#include "utils.h"
|
||||
#include "canvas_impl.h"
|
||||
#include "rgb_macros.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <gtkmm2ext/utils.h>
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "keyboard.h"
|
||||
#include "utils.h"
|
||||
#include "i18n.h"
|
||||
#include "rgb_macros.h"
|
||||
|
@ -315,9 +316,9 @@ get_canvas_points (string who, uint32_t npoints)
|
|||
}
|
||||
|
||||
int
|
||||
channel_combo_get_channel_count (Gtk::Combo& combo)
|
||||
channel_combo_get_channel_count (Gtk::ComboBoxText& combo)
|
||||
{
|
||||
string str = combo.get_entry()->get_text();
|
||||
string str = combo.get_active_text();
|
||||
int chns;
|
||||
|
||||
if (str == _("mono")) {
|
||||
|
@ -501,8 +502,3 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a)
|
|||
return (uint32_t) RGBA_TO_UINT(r,g,b,a);
|
||||
}
|
||||
|
||||
void
|
||||
decorate (Gtk::Window& w, Gdk::WMDecoration d)
|
||||
{
|
||||
w.get_window()->set_decorations (d);
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ GType WaveView::get_base_type()
|
|||
return gnome_canvas_waveview_get_type();
|
||||
}
|
||||
|
||||
void*
|
||||
GnomeCanvasWaveViewCache*
|
||||
WaveView::create_cache ()
|
||||
{
|
||||
return gnome_canvas_waveview_cache_new ();
|
||||
|
@ -140,13 +140,13 @@ Glib::PropertyProxy_ReadOnly<void*> WaveView::property_data_src() const
|
|||
{
|
||||
return Glib::PropertyProxy_ReadOnly<void*> (this, "data-src");
|
||||
}
|
||||
Glib::PropertyProxy<uint32_t*> WaveView::property_channel()
|
||||
Glib::PropertyProxy<uint32_t> WaveView::property_channel()
|
||||
{
|
||||
return Glib::PropertyProxy<void*> (this, "channel");
|
||||
return Glib::PropertyProxy<uint32_t> (this, "channel");
|
||||
}
|
||||
Glib::PropertyProxy_ReadOnly<uint32_t*> WaveView::property_channel() const
|
||||
Glib::PropertyProxy_ReadOnly<uint32_t> WaveView::property_channel() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<void*> (this, "channel");
|
||||
return Glib::PropertyProxy_ReadOnly<uint32_t> (this, "channel");
|
||||
}
|
||||
Glib::PropertyProxy<void*> WaveView::property_length_function()
|
||||
{
|
||||
|
@ -198,11 +198,11 @@ Glib::PropertyProxy_ReadOnly<void*> WaveView::property_cache() const
|
|||
}
|
||||
Glib::PropertyProxy<bool> WaveView::property_cache_updater()
|
||||
{
|
||||
return Glib::PropertyProxy<void*> (this, "cache-updater");
|
||||
return Glib::PropertyProxy<bool> (this, "cache-updater");
|
||||
}
|
||||
Glib::PropertyProxy_ReadOnly<bool> WaveView::property_cache_updater() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<void*> (this, "cache-updater");
|
||||
return Glib::PropertyProxy_ReadOnly<bool> (this, "cache-updater");
|
||||
}
|
||||
Glib::PropertyProxy<double> WaveView::property_samples_per_unit()
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ private:
|
|||
public:
|
||||
WaveView(Group& parent);
|
||||
|
||||
static void* create_cache();
|
||||
static GnomeCanvasWaveViewCache* create_cache();
|
||||
|
||||
Glib::PropertyProxy<void*> property_data_src();
|
||||
Glib::PropertyProxy_ReadOnly<void*> property_data_src() const;
|
||||
|
|
|
@ -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…
Reference in New Issue