| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_ | 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ | 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 class SelectionChangeInvalidator { | 132 class SelectionChangeInvalidator { |
| 133 public: | 133 public: |
| 134 explicit SelectionChangeInvalidator(PDFiumEngine* engine); | 134 explicit SelectionChangeInvalidator(PDFiumEngine* engine); |
| 135 ~SelectionChangeInvalidator(); | 135 ~SelectionChangeInvalidator(); |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 // Returns all the currently visible selection rectangles, in screen | 138 // Returns all the currently visible selection rectangles, in screen |
| 139 // coordinates. | 139 // coordinates. |
| 140 std::vector<pp::Rect> GetVisibleSelections() const; | 140 std::vector<pp::Rect> GetVisibleSelections() const; |
| 141 | 141 |
| 142 // Invalidates |selection|, but with |selection| slightly expanded to |
| 143 // compensate for any rounding errors. |
| 144 void Invalidate(const pp::Rect& selection); |
| 145 |
| 142 PDFiumEngine* const engine_; | 146 PDFiumEngine* const engine_; |
| 143 // The origin at the time this object was constructed. | 147 // The origin at the time this object was constructed. |
| 144 const pp::Point previous_origin_; | 148 const pp::Point previous_origin_; |
| 145 // Screen rectangles that were selected on construction. | 149 // Screen rectangles that were selected on construction. |
| 146 std::vector<pp::Rect> old_selections_; | 150 std::vector<pp::Rect> old_selections_; |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 // Used to store mouse down state to handle it in other mouse event handlers. | 153 // Used to store mouse down state to handle it in other mouse event handlers. |
| 150 class MouseDownState { | 154 class MouseDownState { |
| 151 public: | 155 public: |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 814 bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 811 int pdf_buffer_size, | 815 int pdf_buffer_size, |
| 812 int page_number, | 816 int page_number, |
| 813 double* width, | 817 double* width, |
| 814 double* height) override; | 818 double* height) override; |
| 815 }; | 819 }; |
| 816 | 820 |
| 817 } // namespace chrome_pdf | 821 } // namespace chrome_pdf |
| 818 | 822 |
| 819 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 823 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| OLD | NEW |