summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-31 06:24:26 +0000
committerManolo Gouy <Manolo>2016-03-31 06:24:26 +0000
commit059664e7d4c6230b4fe799bd01bc6e630835c05c (patch)
treea6dcbaaf10d59e36088b9176389a2bc33e8e9601 /src
parent62f9813e4ed6a001848d3c31b72f3d48d48df774 (diff)
Begin to remove platform-dependent code from the Fl.H header file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11482 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx8
-rw-r--r--src/Fl_Input.cxx4
-rw-r--r--src/Fl_Input_.cxx2
-rw-r--r--src/Fl_Text_Display.cxx2
-rw-r--r--src/Fl_Text_Editor.cxx4
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.H3
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx8
7 files changed, 19 insertions, 12 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index cb922858e..8c66965d8 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1882,6 +1882,14 @@ int Fl::dnd()
return Fl_System_Driver::driver()->dnd();
}
+void Fl::reset_marked_text() {
+ Fl_System_Driver::driver()->reset_marked_text();
+}
+
+void Fl::insertion_point_location(int x, int y, int height) { // sets window coordinates & height of insertion point
+ Fl_System_Driver::driver()->insertion_point_location(x, y, height);
+}
+
//
// End of "$Id$".
//
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index f752b2b68..92daee5bd 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -599,14 +599,12 @@ int Fl_Input::handle(int event) {
static int dnd_save_position, dnd_save_mark, drag_start = -1, newpos;
static Fl_Widget *dnd_save_focus = NULL;
switch (event) {
-#ifdef __APPLE__ // PORTME: compose text
case FL_UNFOCUS:
- if (Fl::compose_state) {
+ if (Fl_System_Driver::driver()->has_marked_text() && Fl::compose_state) {
this->mark( this->position() );
Fl::reset_marked_text();
}
break;
-#endif
case FL_FOCUS:
switch (Fl::event_key()) {
case FL_Right:
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index f80b59c8e..2230a0c7b 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -395,9 +395,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
} else {
fl_rectf((int)(xpos+curx+0.5), Y+ypos, 2, height);
}
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - compose
Fl::insertion_point_location(xpos+curx, Y+ypos+height, height);
-#endif
}
CONTINUE:
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index cf9e0c9e5..4d516c261 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -2303,9 +2303,7 @@ void Fl_Text_Display::draw_cursor( int X, int Y ) {
if ( X < text_area.x - 1 || X > text_area.x + text_area.w )
return;
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
Fl::insertion_point_location(X, bot, fontHeight);
-#endif
/* For cursors other than the block, make them around 2/3 of a character
width, rounded to an even number of pixels so that X will draw an
odd number centered on the stem at x. */
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx
index 8ca2fd4b7..c43fb518c 100644
--- a/src/Fl_Text_Editor.cxx
+++ b/src/Fl_Text_Editor.cxx
@@ -586,13 +586,11 @@ int Fl_Text_Editor::handle(int event) {
case FL_UNFOCUS:
show_cursor(mCursorOn); // redraws the cursor
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
- if (buffer()->selected() && Fl::compose_state) {
+ if (Fl_System_Driver::driver()->has_marked_text() && buffer()->selected() && Fl::compose_state) {
int pos = insert_position();
buffer()->select(pos, pos);
Fl::reset_marked_text();
}
-#endif
if (buffer()->selected()) redraw(); // Redraw selections...
case FL_HIDE:
if (when() & FL_WHEN_RELEASE) maybe_do_callback();
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
index 12148fb55..29a658d5f 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
@@ -64,6 +64,9 @@ public:
virtual int rmdir(const char* f) {return ::rmdir(f);}
virtual int rename(const char* f, const char *n) {return ::rename(f, n);}
virtual int clocale_printf(FILE *output, const char *format, va_list args);
+ virtual int has_marked_text();
+ virtual void reset_marked_text();
+ virtual void insertion_point_location(int x, int y, int height);
};
#endif // FL_DARWIN_SYSTEM_DRIVER_H
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index ee8a0eb31..f112b3c9f 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
@@ -64,7 +64,11 @@ static int insertion_point_y = 0;
static int insertion_point_height = 0;
static bool insertion_point_location_is_valid = false;
-void Fl::reset_marked_text() {
+int Fl_Darwin_System_Driver::has_marked_text() {
+ return true;
+}
+
+void Fl_Darwin_System_Driver::reset_marked_text() {
Fl::compose_state = 0;
Fl_X::next_marked_length = 0;
insertion_point_location_is_valid = false;
@@ -80,7 +84,7 @@ int Fl_X::insertion_point_location(int *px, int *py, int *pheight)
return true;
}
-void Fl::insertion_point_location(int x, int y, int height) {
+void Fl_Darwin_System_Driver::insertion_point_location(int x, int y, int height) {
insertion_point_location_is_valid = true;
insertion_point_x = x;
insertion_point_y = y;