~3v1n0/unity/overlay-border-scale

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/IMTextEntry.h

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <Nux/Nux.h>
27
27
#include <Nux/TextEntry.h>
28
28
#include <UnityCore/GLibSignal.h>
 
29
#include <UnityCore/GLibWrapper.h>
29
30
 
30
31
namespace unity
31
32
{
32
 
namespace dash
33
 
{
34
33
 
35
34
using namespace unity::glib;
36
35
using namespace nux;
40
39
  NUX_DECLARE_OBJECT_TYPE(IMTextEntry, nux::TextEntry);
41
40
public:
42
41
  IMTextEntry();
43
 
  ~IMTextEntry();
44
 
 
45
 
  nux::Property<std::string> preedit_string;
46
 
  nux::Property<bool> im_enabled;
47
 
  nux::Property<bool> im_active;
48
42
 
49
43
private:
50
 
  void CheckIMEnabled();
51
 
  void SetupSimpleIM();
52
 
  void SetupMultiIM();
53
 
 
54
44
  bool InspectKeyEvent(unsigned int eventType, unsigned int keysym, const char* character);
55
 
  bool TryHandleEvent(unsigned int eventType, unsigned int keysym, const char* character);
56
 
  void KeyEventToGdkEventKey(Event& event, GdkEventKey& gdk_event);
57
 
  inline void CheckValidClientWindow(Window window);
58
45
  bool TryHandleSpecial(unsigned int eventType, unsigned int keysym, const char* character);
 
46
  void InsertText(std::string const& text);
59
47
  void Cut();
60
48
  void Copy();
61
 
  void Paste();
62
 
 
63
 
  void OnCommit(GtkIMContext* context, char* str);
64
 
  void OnPreeditChanged(GtkIMContext* context);
65
 
  void OnPreeditStart(GtkIMContext* context);
66
 
  void OnPreeditEnd(GtkIMContext* context);
67
 
 
68
 
  void OnFocusIn();
69
 
  void OnFocusOut();
70
 
  void UpdateCursorLocation();
 
49
  void Paste(bool primary = false);
71
50
 
72
51
  void OnMouseButtonUp(int x, int y, unsigned long bflags, unsigned long kflags);
73
 
 
74
 
 private:
75
 
  glib::SignalManager sig_manager_;
76
 
  GtkIMContext* im_context_;
77
 
  GdkWindow* client_window_;
78
 
  bool focused_;
79
52
};
80
53
 
81
54
}
82
 
}
83
55
 
84
56
#endif