/[svn]/gigedit/trunk/src/gigedit/dimregionchooser.h
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/dimregionchooser.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1303 by persson, Sun Aug 26 09:29:52 2007 UTC revision 2556 by schoenebeck, Fri May 16 23:19:23 2014 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006, 2007 Andreas Persson   * Copyright (C) 2006-2014 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 21  Line 21 
21  #define GIGEDIT_DIMREGIONCHOOSER_H  #define GIGEDIT_DIMREGIONCHOOSER_H
22    
23  #include <gtkmm/drawingarea.h>  #include <gtkmm/drawingarea.h>
24  #include <gdkmm/colormap.h>  #include <gtkmm/uimanager.h>
25    #include <gtkmm/menu.h>
26  #include <gdkmm/window.h>  #include <gdkmm/window.h>
27    
28    #include "compat.h"
29    
30  #include <gig.h>  #include <gig.h>
31    
32    #include <set>
33    
34  class DimRegionChooser : public Gtk::DrawingArea  class DimRegionChooser : public Gtk::DrawingArea
35  {  {
36  public:  public:
# Line 34  public: Line 39  public:
39    
40      void set_region(gig::Region* region);      void set_region(gig::Region* region);
41    
42      sigc::signal<void> signal_dimregion_selected();      sigc::signal<void>& signal_dimregion_selected();
43      sigc::signal<void> signal_region_changed();      sigc::signal<void>& signal_region_changed();
44    
45      gig::DimensionRegion* get_dimregion() { return dimreg; }      gig::DimensionRegion* get_dimregion() const { return dimreg; }
46        void get_dimregions(const gig::Region* region, bool stereo,
47                            std::set<gig::DimensionRegion*>& dimregs) const;
48    
49  protected:  protected:
50      virtual void on_realize();  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
51      virtual bool on_expose_event(GdkEventExpose* e);      virtual bool on_expose_event(GdkEventExpose* e);
52      virtual void on_size_request(GtkRequisition* requisition);  #else
53        virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
54    #endif
55      virtual bool on_button_press_event(GdkEventButton* event);      virtual bool on_button_press_event(GdkEventButton* event);
56      virtual bool on_button_release_event(GdkEventButton* event);      virtual bool on_button_release_event(GdkEventButton* event);
57      virtual bool on_motion_notify_event(GdkEventMotion* event);      virtual bool on_motion_notify_event(GdkEventMotion* event);
58      virtual bool on_focus(Gtk::DirectionType direction);      virtual bool on_focus(Gtk::DirectionType direction);
59        void refresh_all();
60        void split_dimension_zone();
61        void delete_dimension_zone();
62    
63      Glib::RefPtr<Gdk::GC> gc;      Gdk::RGBA red, black, white;
     Gdk::Color blue, red, black, white, green;  
64    
65      gig::Instrument* instrument;      gig::Instrument* instrument;
66      gig::Region* region;      gig::Region* region;
# Line 62  protected: Line 73  protected:
73      int focus_line;      int focus_line;
74      int dimvalue[256];      int dimvalue[256];
75      int label_width;      int label_width;
76        bool labels_changed;
77      int nbDimensions;      int nbDimensions;
78    
79        int dimtype;
80        int dimzone;
81    
82      // information needed during a resize      // information needed during a resize
83      struct {      struct {
84          bool active;          bool active;
# Line 81  protected: Line 96  protected:
96    
97      bool cursor_is_resize;      bool cursor_is_resize;
98      bool is_in_resize_zone(double x, double y);      bool is_in_resize_zone(double x, double y);
99        void update_after_resize();
100    
101      int h;      int h;
102      int w;  
103        Glib::RefPtr<Gtk::ActionGroup> actionGroup;
104        Glib::RefPtr<Gtk::UIManager> uiManager;
105        Gtk::Menu* popup_menu_inside_dimregion;
106        Gtk::Menu* popup_menu_outside_dimregion;
107  };  };
108    
109  #endif  #endif

Legend:
Removed from v.1303  
changed lines
  Added in v.2556

  ViewVC Help
Powered by ViewVC