Commit graph

143 commits

Author SHA1 Message Date
Soreepeong
7f5ef03917 Use EarlyLoadedService for anything that is not mandatory for kicking off plugin loader 2024-04-07 21:53:23 +09:00
srkizer
55bd845a63
Add IconTexture/Wrap to INotification (#1738) (#1739)
* Add IconTexture/Wrap to INotification (#1738)

Notification record and IActiveNotification interface now supports
setting or updating the texture wraps being used, and SetIconTexture has
gotten more overloads to support leaveOpen mechanism that can commonly
be found with Stream wrappers.

ImGui widget is updated to support testing setting "leaveOpen" and
updating "IconTexture" property via setter, making it possible to check
whether IDTW.Dispose is being called under given conditions.

Some changes to doccomments are made.

* typo
2024-03-22 14:47:50 +01:00
srkizer
be63276a85
Rename to Framework.Run (#1728) 2024-03-19 08:04:21 -07:00
srkizer
5d473919a1
Hide scheduler from RunOnFrameworkThread (#1725)
* Hide scheduler from RunOnFrameworkThread

Creating new tasks via Task.Run and alike would fetch the current
scheduler, which we do not want in case of running stuff from the
framework thread. Change is to prevent the standard library from seeing
the "current scheduler". If one wants to use `await` with an async
function to be run in the framework thread, one can use
`RunOnFrameworkThreadAwaitable` instead now.

* TaskSchedulerWidget: test better stuff

* TaskSchedulerWidget: add freeze tests

* More comments

* Make TaskFactory a getter method instead of property to avoid bad suggestions

* Why are there stuff still not pushed
2024-03-18 20:10:47 -07:00
srkizer
87b9edb448
Add IInternal/PublicDisposableService (#1696)
* Add IInternal/PublicDisposableService

Plugins are exposed interfaces that are not inherited from
`IDisposable`, but services implementing plugin interfaces often
implement `IDisposable`. Some plugins may try to call
`IDisposable.Dispose` on everything provided, and it also is possible to
use `using` clause too eagerly while working on Dalamud itself, such as
writing `using var smth = await Service<SomeService>.GetAsync();`. Such
behaviors often lead to a difficult-to-debug errors, and making those
services either not an `IDisposable` or making `IDisposable.Dispose` do
nothing if the object has been loaded would prevent such errors. As
`ServiceManager` must be the only class dealing with construction and
disposal of services, `IInternalDisposableService` has been added to
limit who can dispose the object. `IPublicDisposableService` also has
been added to classes that can be constructed and accessed directly by
plugins; for those, `Dispose` will be ignored if the instance is a
service instance, and only `DisposeService` will respond.

In addition, `DalamudPluginInterface` and `UiBuilder` also have been
changed so that their `IDisposable.Dispose` no longer respond, and
instead, internal functions have been added to only allow disposal from
Dalamud.

* Cleanup

* Postmerge fixes

* More explanation on RunOnFrameworkThread(ClearHooks)

* Mark ReliableFileStorage public ctor obsolete

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-16 15:58:05 +00:00
goat
dcec076ca7
Merge pull request #1681 from Soreepeong/feature/inotificationmanager
Implement INotificationManager
2024-03-16 16:46:12 +01:00
wolfcomp
3f4a91b726
Handle static declares in AddonLifecycleWidget (#1720)
* Handle static declares

old way: <https://learn.microsoft.com/en-us/dotnet/api/system.delegate.target?view=net-8.0#property-value>

new way: <https://learn.microsoft.com/en-us/dotnet/api/system.reflection.memberinfo.declaringtype?view=net-8.0#property-value>

* get full name instead of class name
2024-03-16 16:42:24 +01:00
Soreepeong
033a57d19d Merge remote-tracking branch 'upstream/master' into feature/inotificationmanager 2024-03-14 13:06:04 +09:00
Soreepeong
9724e511e9 Add INotification.RespectUiHidden 2024-03-14 13:05:46 +09:00
srkizer
cf4a9e3055
Easier SingleFontChooserDialog ctor, window pos/size/flags, and more docs (#1704)
* Make SingleFontChooserDialog ctor less confusing

The current constructor expects a new fresh instance of IFontAtlas,
which can be easy to miss, resulting in wasted time troubleshooting
without enough clues. New constructor is added that directly takes an
instance of UiBuilder, and the old constructor has been obsoleted and
should be changed to private on api 10.

* Add position, size, and window flags conf to SFCD

* Improve documentations

* Add test for PopupPosition/Size

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-14 00:57:30 +01:00
srkizer
a26bb58fdb
Use custom TaskScheduler for Framework.RunOnTick (#1597)
* Use custom TaskScheduler for Framework.RunOnTick

* TaskSchedulerWidget: add example
2024-03-14 00:36:38 +01:00
Soreepeong
70eecdaaef more 2024-03-05 21:04:20 +09:00
Soreepeong
9ba0a297c9 Add texture vram usage estimation 2024-03-05 01:53:31 +09:00
Soreepeong
6a0f774625 Add texture leak tracker 2024-03-05 01:06:02 +09:00
Soreepeong
5ad8edbc04 Move save get/save functions to ITextureReadbackProvider 2024-03-03 21:00:37 +09:00
Soreepeong
e1bdba06de cleanup 2024-03-03 20:41:41 +09:00
Soreepeong
c04ce36b9c Add CreateFromGameScreen 2024-03-03 20:08:52 +09:00
Soreepeong
3853191c48 More cleanup 2024-03-03 00:51:28 +09:00
Soreepeong
3415df5d40 Cleanup 2024-03-02 23:45:14 +09:00
Soreepeong
0aa75306d4 fixese 2024-03-02 07:50:37 +09:00
Soreepeong
5367d288d6 Use WIC to implement ITP.SaveAsImageFormatToStreamAsync 2024-03-02 06:57:12 +09:00
Soreepeong
1ae11440aa Add ITextureProvider.CreateFromExistingTextureAsync 2024-03-02 01:41:11 +09:00
Soreepeong
8fa8ca43b6 Rename ISharedImmediateTexture methods 2024-03-01 09:47:27 +09:00
Soreepeong
ca986b46a2 cleanup 2024-02-28 21:17:50 +09:00
Soreepeong
cc756c243c Add ITextureProvider.GetFromManifestResource(Assembly,string) 2024-02-28 21:04:57 +09:00
Soreepeong
35f3802471 Format 2024-02-28 20:10:31 +09:00
Soreepeong
f8492dc06b changes 2024-02-28 19:16:14 +09:00
Soreepeong
ea633cd876 Implement texture load throttling & cancellable async loads 2024-02-28 17:43:24 +09:00
Soreepeong
e12b2f7803 Make state+texture retrieval done with one API call 2024-02-28 17:43:24 +09:00
Soreepeong
2920d18afa Update IconBrowserWidget 2024-02-28 17:43:24 +09:00
Soreepeong
eb4d9aba7e TexWidget: add test/examples for new APIs 2024-02-28 17:43:22 +09:00
Soreepeong
6b875bbcb5 Support SetIconTexture(Task<IDalamudTextureWrap?>?) 2024-02-28 17:27:19 +09:00
Soreepeong
a1e2473774 Normalize names 2024-02-28 17:11:30 +09:00
Soreepeong
92302ffd89 More cleanup 2024-02-28 17:11:30 +09:00
Soreepeong
a7d5380796 Cleanup 2024-02-28 17:11:30 +09:00
Soreepeong
e44180d4a2 honor notification window focus 2024-02-28 17:11:30 +09:00
Soreepeong
0040f61125 Make notifications minimizable, remove interactable 2024-02-28 17:11:30 +09:00
Soreepeong
e96089f8b2 Separate progress and expiry animations 2024-02-28 17:11:30 +09:00
Soreepeong
f434946137 Turn impls of IconSource internal 2024-02-28 17:11:30 +09:00
Soreepeong
42b6f8fd4b fix disposes and add TextureWrapIconSource 2024-02-28 17:11:30 +09:00
Soreepeong
cf54a02812 fixes 2024-02-28 17:11:30 +09:00
Soreepeong
df9212ac58 Expose DefaultDisplayDuration 2024-02-28 17:11:29 +09:00
Soreepeong
1ca2d2000b Add UserDismissable 2024-02-28 17:11:29 +09:00
Soreepeong
3a6aa13c3b Add IconSource 2024-02-28 17:11:29 +09:00
Soreepeong
7aba15ef5b Normalize namespaces 2024-02-28 17:11:29 +09:00
Soreepeong
04c6be5671 Add progressbar 2024-02-28 17:11:29 +09:00
Soreepeong
2935d18c37 Show plugin icons as fallback icon 2024-02-28 17:11:29 +09:00
Soreepeong
3ba395bd70 Implement INotificationManager 2024-02-28 17:11:29 +09:00
Soreepeong
9629a555be Rename to CreateWrapSharingLowLevelResource 2024-02-26 03:20:28 +09:00
Soreepeong
f6be80a5fb Make IDalamudTextureWrap ICloneable 2024-02-25 21:21:50 +09:00