~ubuntu-branches/ubuntu/wily/bombono-dvd/wily

« back to all changes in this revision

Viewing changes to src/mgui/editor/toolbar.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-11-04 11:46:25 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20101104114625-8xfdhvhpsm51i0nu
Tags: upstream-0.8.0
Import upstream version 0.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
namespace Project
45
45
{
46
46
 
47
 
FrameThemeObj* AddFTOItem(MenuRegion& menu_rgn, const std::string& theme, const Rect& lct, MediaItem mi);
 
47
FrameThemeObj* NewFTO(const std::string& theme, const Rect& lct);
48
48
void AddMenuItem(MenuRegion& menu_rgn, Comp::Object* obj);
49
49
 
50
 
// вспомогательная структура для передачи меню ссылок
51
 
// от браузеров к редактору
52
 
struct SetLinkMenu
53
 
{
54
 
                  bool  isForBack; // нужны ссылки для фона
55
 
    ptr::one<Gtk::Menu> linkMenu;
56
 
             MediaItem  newLink;
57
 
 
58
 
    SetLinkMenu(): isForBack(false) {}
59
 
};
 
50
//// вспомогательная структура для передачи меню ссылок
 
51
//// от браузеров к редактору
 
52
//struct SetLinkMenu
 
53
//{
 
54
//                  bool  isForBack; // нужны ссылки для фона
 
55
//    ptr::one<Gtk::Menu> linkMenu;
 
56
//             MediaItem  newLink;
 
57
//
 
58
//    SetLinkMenu(): isForBack(false) {}
 
59
//};
60
60
 
61
61
} // namespace Project
62
62
 
64
64
{
65
65
 
66
66
extern Gtk::TreeModelColumn<std::string> FrameTypeColumn;
67
 
std::string GetActiveTheme(Gtk::ComboBox& combo);
 
67
std::string GetActiveTheme();
68
68
Gtk::Toolbar& PackToolbar(MEditorArea& editor, Gtk::VBox& lct_box);
69
69
 
70
70
const double DEF_FONT_SIZE = 28.0;
72
72
 
73
73
typedef boost::function<bool(FrameThemeObj*, MenuRegion&)> FTOFunctor;
74
74
typedef boost::function<bool(TextObj*, MenuRegion&)> TextObjFunctor;
75
 
void ForAllSelected(FTOFunctor fto_fnr, TextObjFunctor txt_fnr, MenuRegion& mn_rgn, const int_array& sel_arr);
 
75
void ForAllSelected(FTOFunctor fto_fnr, TextObjFunctor txt_fnr);
76
76
 
77
 
void ForAllSelectedFTO(FTOFunctor fnr, MenuRegion& mn_rgn, const int_array& sel_arr);
 
77
void ForAllSelectedFTO(FTOFunctor fnr);
78
78
 
79
79
void AddFTOItem(MEditorArea& editor, const Point& center, Project::MediaItem mi);
80
80
 
81
81
} // namespace Editor
82
82
 
83
 
void SetSelObjectsLinks(MEditorArea& edt_area, Project::MediaItem mi, bool is_background);
84
83
void SetSelObjectsTStyle(MEditorArea& edt_area, const Editor::TextStyle& ts, bool only_clr);
85
84
 
86
 
void SetBackgroundLink(MEditorArea& edt_area, Project::MediaItem mi);
 
85
void SetBackgroundLink(Project::MediaItem mi);
87
86
void SetLinkForObject(MEditorArea& edt_area, Project::MediaItem mi, int pos, bool for_poster);
88
87
 
89
 
void ToggleSafeArea(MEditorArea& edt_area);
 
88
void ToggleSafeArea();
90
89
 
91
90
namespace Project {
92
91
 
93
 
class CommonMenuBuilder
 
92
struct CommonMenuBuilder
94
93
{
95
 
    public:
96
 
                           CommonMenuBuilder(MediaItem cur_itm, bool for_poster);
 
94
            MediaItem  curItm; // текущая ссылка
 
95
                       // визуальная ссылка (=> только "первичка") 
 
96
                       // для переходов (может быть меню, не может быть рисунком)
 
97
                 bool  forPoster;
 
98
                 bool  onlyWithAudio; // картинки запрещены
 
99
 
 
100
            Gtk::Menu& resMenu;  // результирующее меню; обязательно должно быть присоединено после Create(),
 
101
                                 // иначе утечка
 
102
Gtk::RadioButtonGroup  radioGrp;
 
103
 
 
104
                           CommonMenuBuilder(MediaItem cur_itm, bool for_poster, bool only_with_audio = false);
97
105
    virtual               ~CommonMenuBuilder() {}
98
106
 
99
107
    virtual ActionFunctor  CreateAction(MediaItem mi) = 0;
100
108
 
101
109
                Gtk::Menu& Create();
102
 
    virtual          void  AddConstantChoice(Gtk::Menu& lnk_list);
103
 
 
104
 
    protected:
105
 
              MediaItem  curItm; // текущая ссылка
106
 
                   bool  forPoster; // визуальная ссылка или для переходов (может быть меню, не может быть рисунком)
107
 
 
108
 
              Gtk::Menu& resMenu;  // результирующее меню; обязательно должно быть присоединено после Creat(),
109
 
                                   // иначе утечка
110
 
  Gtk::RadioButtonGroup  radioGrp;
111
 
 
112
 
Gtk::RadioMenuItem& 
113
 
AddMediaItemChoice(Gtk::Menu& lnk_list, MediaItem mi, const std::string& name = std::string());
 
110
    virtual          void  AddConstantChoice();
 
111
 
 
112
Gtk::RadioMenuItem& AddMediaItemChoice(Gtk::Menu& lnk_list, MediaItem mi, const std::string& name = std::string());
 
113
void AddPredefinedItem(const std::string& label, bool is_active, const ActionFunctor& fnr);
114
114
};
115
115
 
116
116
void AppendRadioItem(Gtk::RadioMenuItem& itm, bool is_active, const ActionFunctor& fnr, Gtk::Menu& lnk_list);
 
117
void AddNoLinkItem(CommonMenuBuilder& mb, bool exp_link);
117
118
 
118
119
class EditorMenuBuilder: public CommonMenuBuilder
119
120
{
125
126
            MEditorArea& editor;
126
127
};
127
128
 
 
129
class EndActionMenuBld: public CommonMenuBuilder
 
130
{
 
131
    typedef CommonMenuBuilder MyParent;
 
132
    public:
 
133
    typedef boost::function<void(EndActionMenuBld&)> Functor;
 
134
 
 
135
                    EndActionMenuBld(PostAction& pa, const ActionFunctor& on_updater,
 
136
                                     const Functor& cc_adder);
 
137
 
 
138
                     void  AddConstantItem(const std::string& label, PostActionType typ);
 
139
 
 
140
    virtual ActionFunctor  CreateAction(Project::MediaItem mi);
 
141
    virtual          void  AddConstantChoice();
 
142
 
 
143
    protected:
 
144
                 PostAction& pAct;
 
145
        const ActionFunctor  onUpdater;
 
146
              const Functor  ccAdder;
 
147
};
 
148
 
128
149
} // namespace Project
129
150
 
130
151
#endif // __MGUI_EDITOR_TOOLBAR_H__