aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-06-21 10:31:05 +0800
committerPo Lu2023-06-21 10:31:05 +0800
commitbdaeecd1759e6aee5ad8bf04ba6ed9bb8fb4453d (patch)
treedca4856d9d14f0b4ffa7062e4ff235f46110fadb /src
parent70cf0d7c6f39a53103cb3f6222cedb8345f5d920 (diff)
downloademacs-bdaeecd1759e6aee5ad8bf04ba6ed9bb8fb4453d.tar.gz
emacs-bdaeecd1759e6aee5ad8bf04ba6ed9bb8fb4453d.zip
Update Android port
* src/androidfns.c (android_set_tool_bar_position): (frame_geometry): * src/androidterm.c (android_flash): (android_clear_under_internal_border): Synchronize with X.
Diffstat (limited to 'src')
-rw-r--r--src/androidfns.c38
-rw-r--r--src/androidterm.c30
2 files changed, 46 insertions, 22 deletions
diff --git a/src/androidfns.c b/src/androidfns.c
index 46ff073438a..11ed2e6c00a 100644
--- a/src/androidfns.c
+++ b/src/androidfns.c
@@ -254,15 +254,26 @@ android_set_tool_bar_position (struct frame *f,
254 Lisp_Object new_value, 254 Lisp_Object new_value,
255 Lisp_Object old_value) 255 Lisp_Object old_value)
256{ 256{
257 Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom); 257 if (!EQ (new_value, Qtop) && !EQ (new_value, Qbottom))
258 error ("Tool bar position must be either `top' or `bottom'");
258 259
259 if (!NILP (Fmemq (new_value, choice))) 260 if (EQ (new_value, old_value))
260 { 261 return;
261 if (!EQ (new_value, Qtop)) 262
262 error ("The only supported tool bar position is top"); 263 /* Set the tool bar position. */
263 } 264 fset_tool_bar_position (f, new_value);
264 else 265
265 wrong_choice (choice, new_value); 266 /* Now reconfigure frame glyphs to place the tool bar at the
267 bottom. While the inner height has not changed, call
268 `resize_frame_windows' to place each of the windows at its
269 new position. */
270
271 adjust_frame_size (f, -1, -1, 3, false, Qtool_bar_position);
272 adjust_frame_glyphs (f);
273 SET_FRAME_GARBAGED (f);
274
275 if (FRAME_ANDROID_WINDOW (f))
276 android_clear_under_internal_border (f);
266} 277}
267 278
268void 279void
@@ -1470,7 +1481,7 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute)
1470 1481
1471 tab_bar_height = FRAME_TAB_BAR_HEIGHT (f); 1482 tab_bar_height = FRAME_TAB_BAR_HEIGHT (f);
1472 tab_bar_width = (tab_bar_height 1483 tab_bar_width = (tab_bar_height
1473 ? native_width - 2 * internal_border_width 1484 ? native_width - 2 * internal_border_width
1474 : 0); 1485 : 0);
1475 inner_top += tab_bar_height; 1486 inner_top += tab_bar_height;
1476 1487
@@ -1478,7 +1489,14 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute)
1478 tool_bar_width = (tool_bar_height 1489 tool_bar_width = (tool_bar_height
1479 ? native_width - 2 * internal_border_width 1490 ? native_width - 2 * internal_border_width
1480 : 0); 1491 : 0);
1481 inner_top += tool_bar_height; 1492
1493 /* Subtract or add to the inner dimensions based on the tool bar
1494 position. */
1495
1496 if (EQ (FRAME_TOOL_BAR_POSITION (f), Qtop))
1497 inner_top += tool_bar_height;
1498 else
1499 inner_bottom -= tool_bar_height;
1482 1500
1483 /* Construct list. */ 1501 /* Construct list. */
1484 if (EQ (attribute, Qouter_edges)) 1502 if (EQ (attribute, Qouter_edges))
diff --git a/src/androidterm.c b/src/androidterm.c
index 29076981a47..aed8e24b9fa 100644
--- a/src/androidterm.c
+++ b/src/androidterm.c
@@ -181,7 +181,8 @@ android_flash (struct frame *f)
181 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, 181 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc,
182 flash_left, 182 flash_left,
183 (height - flash_height 183 (height - flash_height
184 - FRAME_INTERNAL_BORDER_WIDTH (f)), 184 - FRAME_INTERNAL_BORDER_WIDTH (f)
185 - FRAME_BOTTOM_MARGIN_HEIGHT (f)),
185 width, flash_height); 186 width, flash_height);
186 187
187 } 188 }
@@ -234,7 +235,8 @@ android_flash (struct frame *f)
234 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, 235 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc,
235 flash_left, 236 flash_left,
236 (height - flash_height 237 (height - flash_height
237 - FRAME_INTERNAL_BORDER_WIDTH (f)), 238 - FRAME_INTERNAL_BORDER_WIDTH (f)
239 - FRAME_BOTTOM_MARGIN_HEIGHT (f)),
238 width, flash_height); 240 width, flash_height);
239 } 241 }
240 else 242 else
@@ -4213,14 +4215,16 @@ android_clear_under_internal_border (struct frame *f)
4213 int width = FRAME_PIXEL_WIDTH (f); 4215 int width = FRAME_PIXEL_WIDTH (f);
4214 int height = FRAME_PIXEL_HEIGHT (f); 4216 int height = FRAME_PIXEL_HEIGHT (f);
4215 int margin = FRAME_TOP_MARGIN_HEIGHT (f); 4217 int margin = FRAME_TOP_MARGIN_HEIGHT (f);
4216 int face_id = 4218 int bottom_margin = FRAME_BOTTOM_MARGIN_HEIGHT (f);
4217 (FRAME_PARENT_FRAME (f) 4219 int face_id = (FRAME_PARENT_FRAME (f)
4218 ? (!NILP (Vface_remapping_alist) 4220 ? (!NILP (Vface_remapping_alist)
4219 ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID) 4221 ? lookup_basic_face (NULL, f,
4220 : CHILD_FRAME_BORDER_FACE_ID) 4222 CHILD_FRAME_BORDER_FACE_ID)
4221 : (!NILP (Vface_remapping_alist) 4223 : CHILD_FRAME_BORDER_FACE_ID)
4222 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) 4224 : (!NILP (Vface_remapping_alist)
4223 : INTERNAL_BORDER_FACE_ID)); 4225 ? lookup_basic_face (NULL, f,
4226 INTERNAL_BORDER_FACE_ID)
4227 : INTERNAL_BORDER_FACE_ID));
4224 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); 4228 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
4225 4229
4226 if (face) 4230 if (face)
@@ -4236,7 +4240,8 @@ android_clear_under_internal_border (struct frame *f)
4236 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, width - border, 4240 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, width - border,
4237 0, border, height); 4241 0, border, height);
4238 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, 0, 4242 android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, 0,
4239 height - border, width, border); 4243 height - bottom_margin - border,
4244 width, border);
4240 android_set_foreground (gc, FRAME_FOREGROUND_PIXEL (f)); 4245 android_set_foreground (gc, FRAME_FOREGROUND_PIXEL (f));
4241 } 4246 }
4242 else 4247 else
@@ -4248,7 +4253,8 @@ android_clear_under_internal_border (struct frame *f)
4248 android_clear_area (FRAME_ANDROID_DRAWABLE (f), width - border, 4253 android_clear_area (FRAME_ANDROID_DRAWABLE (f), width - border,
4249 0, border, height); 4254 0, border, height);
4250 android_clear_area (FRAME_ANDROID_DRAWABLE (f), 0, 4255 android_clear_area (FRAME_ANDROID_DRAWABLE (f), 0,
4251 height - border, width, border); 4256 height - bottom_margin - border,
4257 width, border);
4252 } 4258 }
4253 } 4259 }
4254} 4260}