Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a gst-object% base class for other gst objects
- Loading branch information
Showing
1 changed file
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
#lang racket/base | ||
|
||
(require ffi/unsafe/introspection) | ||
(require (except-in ffi/unsafe/introspection | ||
send get-field set-field! field-bound? is-a? is-a?/c) | ||
racket/class | ||
racket/contract) | ||
|
||
(provide gst) | ||
(provide (contract-out [gst | ||
gi-repository?] | ||
[gst-object% | ||
(class/c | ||
[get-name | ||
(->m string?)] | ||
[get-parent | ||
(->m (or/c gobject? #f))] | ||
[has-as-parent? | ||
(->m gobject? boolean?)] | ||
[get-path-string | ||
(->m string?)])] | ||
[gst-version | ||
(-> string?)])) | ||
|
||
(define gst (introspection 'Gst)) | ||
|
||
(define gst-object-mixin | ||
(make-gobject-delegate get-name | ||
get-parent | ||
[has-as-parent? 'has_as_parent] | ||
get-path-string)) | ||
|
||
(define gst-object% | ||
(class (gst-object-mixin gobject%) | ||
(super-new) | ||
(inherit-field pointer))) | ||
|
||
(define gst-version | ||
(gst 'version_string)) |