Commit Graph
9 Commits
Author SHA1 Message Date
David Richardson 5a1845957e AppKit: Implement CPOpenPanel for the browser
* CPItemProvider.j: Introduce CPItemProvider, modelled on NSItemProvider.
  - Register data representations keyed by MIME type, with wildcard matching.
  - Load representations asynchronously, completing inside a run loop pass.
  - Read browser File objects with FileReader.
  - Document remaining NSItemProvider compatibility gaps via TODO comments.

* Foundation.j: Import CPItemProvider.j.

* CPPlatformFilePanel.j: Introduce the DOM platform class that runs the browser's file dialog through a hidden file input.

* CPOpenPanel.j: Replace the NativeHost implementation with a browser implementation.
  - Implement -beginWithCompletionHandler: and -beginSheetModalForWindow:completionHandler:.
  - Add allowed file types, message, prompt, and an accessory view behind an Options button.
  - Validate chosen files through the window delegate's panel:validateURL:error:.
  - Add -itemProviders, and -URLs holding file names.
  - Raise an exception from -runModal.
  - Document remaining NSOpenPanel compatibility gaps via TODO comments.

* CPTextView.j: Insert images through CPOpenPanel and CPItemProvider, for both -insertImage: and paste.

* CPItemProviderTest.j, CPOpenPanelTest.j: Add unit tests covering registration, loading, type matching, panel results, and cancelled runs.
2026-11-02 14:52:41 -06:00
Aparajita Fishman 17f07ee888 capp_lint will not flag CPRectEdge, more linking 2013-01-20 07:24:00 +07:00
Alexander Ljungberg 65043c5d78 Added some missing LGPL headers. 2011-03-25 22:52:57 -04:00
Francisco Ryan Tolmasky I 52f7844aee Made it so .h files are automatically included in AppKit (avoiding needing to manually include Platform.h, etc.).
Also changed a bunch of <AppKit/*> imports to "*" imports.

Reviewed by me.
2010-11-01 11:10:01 -07:00
Francisco Ryan Tolmasky I efaff96168 Consolidate with browser branch.
Reviewed by me.
2009-10-19 16:52:19 -07:00
Francisco Ryan Tolmasky I fce91c7ad3 Cleanuped up open/save panel.
Reviewed by me.
2009-10-17 10:00:50 -07:00
Francisco Ryan Tolmasky I f109313d32 Reapply desktop differences.
Reviewed by me.
2009-09-22 19:32:23 -07:00
Ross Boucher 5f5efffe9d A few updates in preparation of the new media panel 2009-05-30 13:41:48 -07:00
Ross Boucher 5a3f1c81a0 Add open panel beginnings 2009-05-24 13:43:23 -07:00