diff options
| author | Po Lu | 2023-01-08 15:39:28 +0800 |
|---|---|---|
| committer | Po Lu | 2023-01-08 15:39:28 +0800 |
| commit | 86fe89312893bbc8aa47605afbf8da8cd5a12faf (patch) | |
| tree | 4dfc7e9cca88a193e6c5c809daa57be6f0f1e75e /java/org | |
| parent | 695e26079eb60d10ffe25bb8ae91ebc6131fb27d (diff) | |
| download | emacs-86fe89312893bbc8aa47605afbf8da8cd5a12faf.tar.gz emacs-86fe89312893bbc8aa47605afbf8da8cd5a12faf.zip | |
Delete unused files
* java/org/gnu/emacs/EmacsPaintQueue.java
* java/org/gnu/emacs/EmacsPaintReq.java: Remove files.
Diffstat (limited to 'java/org')
| -rw-r--r-- | java/org/gnu/emacs/EmacsPaintQueue.java | 124 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsPaintReq.java | 33 |
2 files changed, 0 insertions, 157 deletions
diff --git a/java/org/gnu/emacs/EmacsPaintQueue.java b/java/org/gnu/emacs/EmacsPaintQueue.java deleted file mode 100644 index f4840dbf5ae..00000000000 --- a/java/org/gnu/emacs/EmacsPaintQueue.java +++ /dev/null | |||
| @@ -1,124 +0,0 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | ||
| 2 | |||
| 3 | Copyright (C) 2023 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 10 | your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | package org.gnu.emacs; | ||
| 21 | |||
| 22 | import java.util.LinkedList; | ||
| 23 | import java.util.List; | ||
| 24 | |||
| 25 | import android.graphics.Canvas; | ||
| 26 | import android.graphics.Paint; | ||
| 27 | import android.graphics.Rect; | ||
| 28 | |||
| 29 | public class EmacsPaintQueue | ||
| 30 | { | ||
| 31 | /* Queue of paint operations. This is modified from the Emacs | ||
| 32 | thread, and entire paint queues are periodically flushed to the | ||
| 33 | application thread where it is executed. */ | ||
| 34 | private List<EmacsPaintReq> paintOperations; | ||
| 35 | |||
| 36 | /* Number of operations in this queue. */ | ||
| 37 | public int numRequests; | ||
| 38 | |||
| 39 | public | ||
| 40 | EmacsPaintQueue () | ||
| 41 | { | ||
| 42 | paintOperations = new LinkedList<EmacsPaintReq> (); | ||
| 43 | } | ||
| 44 | |||
| 45 | public void | ||
| 46 | run () | ||
| 47 | { | ||
| 48 | EmacsDrawable drawable, last; | ||
| 49 | Canvas canvas; | ||
| 50 | EmacsGC gc; | ||
| 51 | int i; | ||
| 52 | Paint paint; | ||
| 53 | Rect rect, offsetRect, copyRect; | ||
| 54 | |||
| 55 | canvas = null; | ||
| 56 | last = null; | ||
| 57 | gc = null; | ||
| 58 | paint = new Paint (); | ||
| 59 | |||
| 60 | for (EmacsPaintReq req : paintOperations) | ||
| 61 | { | ||
| 62 | drawable = req.getDrawable (); | ||
| 63 | canvas = drawable.lockCanvas (); | ||
| 64 | |||
| 65 | if (canvas == null) | ||
| 66 | /* No canvas is currently available. */ | ||
| 67 | continue; | ||
| 68 | |||
| 69 | gc = req.getGC (); | ||
| 70 | rect = req.getRect (); | ||
| 71 | |||
| 72 | drawable.damageRect (rect); | ||
| 73 | |||
| 74 | if (gc.clip_rects == null) | ||
| 75 | { | ||
| 76 | /* No clipping is applied. Just draw and continue. */ | ||
| 77 | req.paintTo (canvas, paint, gc); | ||
| 78 | continue; | ||
| 79 | } | ||
| 80 | |||
| 81 | if (gc.clip_rects != null && gc.clip_rects.length > 0) | ||
| 82 | { | ||
| 83 | if (gc.clip_rects.length == 1) | ||
| 84 | { | ||
| 85 | /* There is only a single clip rect, which is simple | ||
| 86 | enough. */ | ||
| 87 | canvas.save (); | ||
| 88 | canvas.clipRect (gc.clip_rects[0]); | ||
| 89 | req.paintTo (canvas, paint, gc); | ||
| 90 | canvas.restore (); | ||
| 91 | } | ||
| 92 | else | ||
| 93 | { | ||
| 94 | /* There are multiple clip rects. Android doesn't let | ||
| 95 | programs use RegionOp.UNION on the clip rectangle, | ||
| 96 | so Emacs must iterate over each intersection and | ||
| 97 | paint it manually. This seems inefficient but | ||
| 98 | thankfully Emacs never seems to use more than one | ||
| 99 | clip rect. */ | ||
| 100 | |||
| 101 | for (i = 0; i < gc.clip_rects.length; ++i) | ||
| 102 | { | ||
| 103 | copyRect = new Rect (gc.clip_rects[i]); | ||
| 104 | |||
| 105 | if (copyRect.intersect (rect)) | ||
| 106 | { | ||
| 107 | canvas.save (); | ||
| 108 | canvas.clipRect (copyRect); | ||
| 109 | req.paintTo (canvas, paint, gc); | ||
| 110 | canvas.restore (); | ||
| 111 | } | ||
| 112 | } | ||
| 113 | } | ||
| 114 | } | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | public void | ||
| 119 | appendPaintOperation (EmacsPaintReq req) | ||
| 120 | { | ||
| 121 | paintOperations.add (req); | ||
| 122 | numRequests++; | ||
| 123 | } | ||
| 124 | }; | ||
diff --git a/java/org/gnu/emacs/EmacsPaintReq.java b/java/org/gnu/emacs/EmacsPaintReq.java deleted file mode 100644 index 5b14b005093..00000000000 --- a/java/org/gnu/emacs/EmacsPaintReq.java +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | ||
| 2 | |||
| 3 | Copyright (C) 2023 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 10 | your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | package org.gnu.emacs; | ||
| 21 | |||
| 22 | import android.graphics.Canvas; | ||
| 23 | import android.graphics.Paint; | ||
| 24 | import android.graphics.Rect; | ||
| 25 | |||
| 26 | public interface EmacsPaintReq | ||
| 27 | { | ||
| 28 | public EmacsDrawable getDrawable (); | ||
| 29 | public EmacsGC getGC (); | ||
| 30 | public void paintTo (Canvas canvas, Paint paint, | ||
| 31 | EmacsGC immutableGC); | ||
| 32 | public Rect getRect (); | ||
| 33 | }; | ||