summaryrefslogtreecommitdiff
path: root/src/drivers/X11
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-31 19:55:03 +0000
committerManolo Gouy <Manolo>2016-03-31 19:55:03 +0000
commit519673a7761f0e43d926ea5dac43cda305fb089e (patch)
treee3d18b6b7916a09c9a224cfea9694641d68cabfe /src/drivers/X11
parent5d12ea5ab12d3b911777bb8cbdeb70c3d183267c (diff)
Move dnd and character-composition related functions from Fl_System_Driver to Fl_Screen_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/X11')
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.H3
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx17
2 files changed, 20 insertions, 0 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H
index 4d107abd1..0cfe6311a 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.H
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.H
@@ -73,6 +73,9 @@ public:
virtual void repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp);
virtual int has_timeout(Fl_Timeout_Handler cb, void *argp);
virtual void remove_timeout(Fl_Timeout_Handler cb, void *argp);
+ virtual int dnd(int unused);
+ virtual int compose(int &del);
+ virtual void compose_reset();
};
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index f938b1417..03981271c 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -34,6 +34,7 @@
#endif
extern Atom fl_NET_WORKAREA;
+extern XIC fl_xim_ic; // in Fl_x.cxx
// Add these externs to allow X11 port to build - same as Fl_WinAPI_Screen_Driver.cxx.
// These should be in an internal header somewhere?
@@ -609,7 +610,23 @@ void Fl_X11_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void *argp) {
}
}
+int Fl_X11_Screen_Driver::compose(int& del) {
+ int condition;
+ unsigned char ascii = (unsigned char)Fl::e_text[0];
+ condition = (Fl::e_state & (FL_ALT | FL_META | FL_CTRL)) && !(ascii & 128) ;
+ if (condition) { del = 0; return 0;} // this stuff is to be treated as a function key
+ del = Fl::compose_state;
+ Fl::compose_state = 0;
+ // Only insert non-control characters:
+ if ( (!Fl::compose_state) && ! (ascii & ~31 && ascii!=127)) { return 0; }
+ return 1;
+}
+void Fl_X11_Screen_Driver::compose_reset()
+{
+ Fl::compose_state = 0;
+ if (fl_xim_ic) XmbResetIC(fl_xim_ic);
+}
//
// End of "$Id$".