Re: Feedback request from production of the usage of DWT

2024-06-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

On Friday, 14 June 2024 at 17:39:00 UTC, Ferhat Kurtulmuş wrote:
On Friday, 14 June 2024 at 17:27:20 UTC, Menjanahary R. R. 
wrote:
On Thursday, 13 June 2024 at 11:31:31 UTC, Ferhat Kurtulmuş 
wrote:
On Thursday, 13 June 2024 at 06:59:49 UTC, Menjanahary R. R. 
wrote:

 How important is its adoption?

Is GUI App in D frequent?


...

https://github.com/aferust/testds5


Wow, Awesome project!  Good illustration of using DWT

By the way, what does refer `"libs": ["hid"]` to in 
`https://github.com/aferust/ds5w-d/blob/main/dub.json`?


It tried to build it but with no success...

Does it have to do with some ressources refered within 
`https://github.com/aferust/ds5w-d/blob/main/source/ds5w/io.d` 
in 
`https://github.com/Ohjurot/DualSense-Windows/releases/download/v0.1-beta/DualSenseWindows_V0.1.zip`?


I remember that hid comes with a windows SDK, and used there 
for usb interfacing.


https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/

I have a fish memory and didn't touch the repo for a while.
You may have to set some paths in dub.json


Sorry
"lflags-windows": 
["D:/projects/d_projects/dwt/win-res/resource.res"] this res file 
is compiled with rc.exe of windows SDK and doesn't included in 
the repo. İt is just for embedded icon for exe and modern 
looknfeel of GUI window.


https://learn.microsoft.com/en-us/windows/win32/menurc/resource-compiler. I 
don't have access to any computer at the moment. This is very common in windows 
programming. You can search for it.

https://learn.microsoft.com/en-us/windows/win32/menurc/resource-compiler


Re: Feedback request from production of the usage of DWT

2024-06-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

On Friday, 14 June 2024 at 17:27:20 UTC, Menjanahary R. R. wrote:
On Thursday, 13 June 2024 at 11:31:31 UTC, Ferhat Kurtulmuş 
wrote:
On Thursday, 13 June 2024 at 06:59:49 UTC, Menjanahary R. R. 
wrote:

 How important is its adoption?

Is GUI App in D frequent?


...

https://github.com/aferust/testds5


Wow, Awesome project!  Good illustration of using DWT

By the way, what does refer `"libs": ["hid"]` to in 
`https://github.com/aferust/ds5w-d/blob/main/dub.json`?


It tried to build it but with no success...

Does it have to do with some ressources refered within 
`https://github.com/aferust/ds5w-d/blob/main/source/ds5w/io.d` 
in 
`https://github.com/Ohjurot/DualSense-Windows/releases/download/v0.1-beta/DualSenseWindows_V0.1.zip`?


I remember that hid comes with a windows SDK, and used there for 
usb interfacing.


https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/

I have a fish memory and didn't touch the repo for a while.
You may have to set some paths in dub.json


Re: Feedback request from production of the usage of DWT

2024-06-14 Thread Menjanahary R. R. via Digitalmars-d-learn

On Thursday, 13 June 2024 at 11:31:31 UTC, Ferhat Kurtulmuş wrote:
On Thursday, 13 June 2024 at 06:59:49 UTC, Menjanahary R. R. 
wrote:

 How important is its adoption?

Is GUI App in D frequent?


...

https://github.com/aferust/testds5


Wow, Awesome project!  Good illustration of using DWT

By the way, what does refer `"libs": ["hid"]` to in 
`https://github.com/aferust/ds5w-d/blob/main/dub.json`?


It tried to build it but with no success...

Does it have to do with some ressources refered within 
`https://github.com/aferust/ds5w-d/blob/main/source/ds5w/io.d` in 
`https://github.com/Ohjurot/DualSense-Windows/releases/download/v0.1-beta/DualSenseWindows_V0.1.zip`?


Re: Feedback request from production of the usage of DWT

2024-06-14 Thread Menjanahary R. R. via Digitalmars-d-learn

On Thursday, 13 June 2024 at 09:21:50 UTC, Dejan Lekic wrote:
On Thursday, 13 June 2024 at 06:59:49 UTC, Menjanahary R. R. 
wrote:

 How important is its adoption?

Is GUI App in D frequent?


There are quite few D GUI projects we are aware of, Tilix being 
one of the popular ones. I have few personal projects that are 
based, like Tilix, on GtkD (https://gtkd.org). I never tried 
DWT.


Thanks for sharing.


Re: How to use D without the GC ?

2024-06-14 Thread Dukc via Digitalmars-d-learn

bachmeier kirjoitti 14.6.2024 klo 16.48:
See the example I posted elsewhere in this thread: 
https://forum.dlang.org/post/mwerxaolbkuxlgfep...@forum.dlang.org


I defined

```
@nogc ~this() {
   free(ptr);
   printf("Data has been freed\n");
}
```

and that gets called when the reference count hits zero.


Oh sorry, missed that.


Re: How to use D without the GC ?

2024-06-14 Thread bachmeier via Digitalmars-d-learn

On Friday, 14 June 2024 at 07:52:35 UTC, Dukc wrote:

Lance Bachmeier kirjoitti 14.6.2024 klo 4.23:
We must be talking about different things. You could, for 
instance, call a function in a C library to allocate memory at 
runtime. That function returns a pointer and you pass it to 
SafeRefCounted to ensure it gets freed. Nothing is known about 
the allocation at compile time. This is in fact my primary use 
case - allocating an opaque struct allocated by a C library, 
and not wanting to concern myself with freeing it when I'm 
done with it.


Using a raw pointer as the `SafeRefCounted` type like that 
isn't going to work. `SafeRefCounted` will free only the 
pointer itself at the end, not the struct it's referring to. If 
you use some sort of RAII wrapper for the pointer that `free`s 
it at it's destructor, then it'll work - maybe that's what you 
meant.


See the example I posted elsewhere in this thread: 
https://forum.dlang.org/post/mwerxaolbkuxlgfep...@forum.dlang.org


I defined

```
@nogc ~this() {
  free(ptr);
  printf("Data has been freed\n");
}
```

and that gets called when the reference count hits zero.


Re: How to use D without the GC ?

2024-06-14 Thread Dukc via Digitalmars-d-learn

Lance Bachmeier kirjoitti 14.6.2024 klo 4.23:
We must be talking about different things. You could, for instance, call 
a function in a C library to allocate memory at runtime. That function 
returns a pointer and you pass it to SafeRefCounted to ensure it gets 
freed. Nothing is known about the allocation at compile time. This is in 
fact my primary use case - allocating an opaque struct allocated by a C 
library, and not wanting to concern myself with freeing it when I'm done 
with it.


Using a raw pointer as the `SafeRefCounted` type like that isn't going 
to work. `SafeRefCounted` will free only the pointer itself at the end, 
not the struct it's referring to. If you use some sort of RAII wrapper 
for the pointer that `free`s it at it's destructor, then it'll work - 
maybe that's what you meant.