Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource wrapper objects for more complicated cases #630

Open
6 tasks
psychon opened this issue Jul 25, 2021 · 0 comments
Open
6 tasks

Add resource wrapper objects for more complicated cases #630

psychon opened this issue Jul 25, 2021 · 0 comments
Labels
P5 Priority Nice-to-have

Comments

@psychon
Copy link
Owner

psychon commented Jul 25, 2021

This is follow-up to #78 / #629. That PR only implements the "easy" part. However, there is also:

  • xvmc has requests with replies. The current structure expects requests without a reply.
+    ("xvmc", &[
+     /* These requests have replies
+     ResourceInfo {
+         resource_name: "Context",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateContext",
+                 created_argument: "context_id",
+             },
+         ],
+         free_request: "DestroyContext",
+     },
+     ResourceInfo {
+         resource_name: "Surface",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateSurface",
+                 created_argument: "surface_id",
+             },
+         ],
+         free_request: "DestroySurface",
+     },
+     ResourceInfo {
+         resource_name: "Subpicture",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateSubpicture",
+                 created_argument: "subpicture_id",
+             },
+         ],
+         free_request: "DestroySubpicture",
+     },
+     */
+    ]),
  • Composite's overlay window is a normal xproto Window that needs special destruction. Also, the server allocates the XID and returns it in a reply. The current structure expects requests without a reply.
+    ("composite", &[
+     /* This request has a reply (and the server allocates the XID!)
+      * Also, this wraps an existing resource (Window), but needs a special free.
+     ResourceInfo {
+         resource_name: "xproto:Window",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "GetOverlayWindow",
+                 created_argument: "window",
+             },
+         ],
+         free_request: "ReleaseOverlayWindow",
+     },
+     */
+    ]),
  • dri2's CreateDrawable also uses xproto::Drawable (hm, I guess this one should even be easily implementable.. I just have no clue about dri2 nor if anyone would still use it)
+    ("dri2", &[
+     /*
+      * DRAWABLE more or less comes from xproto?!?
+     ResourceInfo {
+         resource_name: "DRAWABLE",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateDrawable",
+                 created_argument: "drawable",
+             },
+         ],
+         free_request: "DestroyDrawable",
+     },
+     */
+    ]),
  • GLX has lots of candidates, but I couldn't find a spec and I doubt anyone uses this extension with/from Rust. My guesses: CreateGLXPixmap, CreatePixmap, CreateNewContext, CreatePbuffer, CreateWindow
  • SHM has a CreateSegment request that creates a Seq. However, this request has a reply with an FD containing the segment. "has a reply" does not match the current structure of these wrapper objects at all.
  • xf86dri just uses CARD32 instead of a proper resource typedef (same for xprint)
+    ("xf86dri", &[
+     /*
+     ResourceInfo {
+         resource_name: "Context fixme: just u32",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateContext",
+                 created_argument: "context",
+             },
+         ],
+         free_request: "DestroyContext",
+     },
+     ResourceInfo {
+         resource_name: "Drawable fixme: just u32",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateDrawable",
+                 created_argument: "drawable",
+             },
+         ],
+         free_request: "DestroyDrawable",
+     },
+     */
+    ]),
+    ("xprint", &[
+     /*
+     ResourceInfo {
+         resource_name: "Context todo actually u32",
+         create_requests: &[
+             CreateInfo {
+                 request_name: "CreateContext",
+                 created_argument: "todo",
+             },
+         ],
+         free_request: "todo",
+     },
+     */
+    ]),
@psychon psychon added the P5 Priority Nice-to-have label Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P5 Priority Nice-to-have
Projects
None yet
Development

No branches or pull requests

1 participant