~ubuntu-branches/ubuntu/wily/aegisub/wily-proposed

« back to all changes in this revision

Viewing changes to src/text_selection_controller.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Reichel, Pascal De Vuyst, Juan Picca, Sebastian Reichel
  • Date: 2015-08-04 21:40:50 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20150804214050-y2aghm9vdksoc8t7
Tags: 3.2.2+dfsg-1
[ Pascal De Vuyst ]
* Fix Typo in package description (Closes: #739219)

[ Juan Picca ]
* Add patch to fix reproducible build (Closes: #789728)

[ Sebastian Reichel ]
* New upstream release
 - remove vendor directory from orig tarball
* Update Debian Standards Version to 3.9.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (c) 2012, Thomas Goyne <plorkyeran@aegisub.org>
 
1
// Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
2
2
//
3
3
// Permission to use, copy, modify, and distribute this software for any
4
4
// purpose with or without fee is hereby granted, provided that the above
14
14
//
15
15
// Aegisub Project http://www.aegisub.org/
16
16
 
17
 
#pragma once
 
17
#include <libaegisub/signal.h>
 
18
 
 
19
class wxStyledTextCtrl;
 
20
class wxStyledTextEvent;
18
21
 
19
22
class TextSelectionController {
 
23
        int selection_start = 0;
 
24
        int selection_end = 0;
 
25
        int insertion_point = 0;
 
26
        bool changing = false;
 
27
 
 
28
        wxStyledTextCtrl *ctrl = nullptr;
 
29
 
 
30
        void UpdateUI(wxStyledTextEvent &evt);
 
31
 
 
32
        agi::signal::Signal<> AnnounceSelectionChanged;
 
33
 
20
34
public:
21
 
        virtual ~TextSelectionController() { }
22
 
 
23
 
        virtual void SetSelection(int start, int end) = 0;
24
 
        virtual void SetInsertionPoint(int point) = 0;
25
 
 
26
 
        virtual int GetSelectionStart() const = 0;
27
 
        virtual int GetSelectionEnd() const = 0;
28
 
        virtual int GetInsertionPoint() const = 0;
 
35
        void SetSelection(int start, int end);
 
36
        void SetInsertionPoint(int point);
 
37
 
 
38
        int GetSelectionStart() const { return selection_start; }
 
39
        int GetSelectionEnd() const { return selection_end; }
 
40
        int GetInsertionPoint() const { return insertion_point; }
 
41
 
 
42
        void SetControl(wxStyledTextCtrl *ctrl);
 
43
        ~TextSelectionController();
 
44
 
 
45
        DEFINE_SIGNAL_ADDERS(AnnounceSelectionChanged, AddSelectionListener)
29
46
};