Download the PHP package toknot/gtk without Composer
On this page you can find all versions of the php package toknot/gtk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package gtk
php-gtk
PHP bindings to the gtk+3 C library.
The project only expose GTK API by FFI
Requirements
- PHP >= 7.4
- PHP FFI extension available
- toknot/ffi-extend >=0.1
composer install
Status
- support C function call of
GLib,GObject,Gio,Gtk,Atk,Gdk,Gdk-Pixbuf,Pango - support C macro value and call of
GLib,GLib, and a small part ofGTK
Defined Constants
DLL file name and header file name map list:
Gtk\PHPGtk::$gtkDllMap determine load dynamic library name prefix and header file.
Load Dynamic Library
- In Linux, default find:
- when
PHP_INT_SIZEequal 4, OS is 32bit, find/usr/lib - when
PHP_INT_SIZEequal 8, OS is 64bit, find/usr/lib64
- when
- specify lib path by self through
Gtk\PHPGtk::gtk($libpath),- if
$libpathis string, value must be lib directory path - will find match $libpath/$name-*.so, and load the first dll
- if
- specify lib name through set
namevalue of specify lib row ofGtk\APP::$gtkDllMap
Usage
-
basic example
- C Lib API call
PHPGtkclass can be callGtk,GLib,GObject,Gio,GdkfunctionPHPGtk::atk()returnGtk\Atk, can be callGLib,GObject,ATKfunctionPHPGtk::gdk()returnGtk\Pixbuf, can be callGLib,GObject,GIO,GDK,gdk-pixbuffunctionPHPGtk::pango()returnGtk\Pango, can be callGLib,GObject,Pangofunction- macro value get by same name constant of class
- macro function call by same name method of class
- lib version value defined by macro get by global same name constant
- About gettext of
glib: Gtk\Glib::$GETTEXT_PACKAGEname ofGETTEXT_PACKAGEwhen compileGlib, default is nullGtk\Glib::$gettextDllpath of gettext shared library, default is empty, if php eanble gettext, will use php gettext() function instead and the property invaild- Gtk\GtkWidget class provided simple OO method of call C function that related
GtkWidget
Note:
- Default, The number of callback function argument must less than 10, otherwise extra argument value always
NULL, only whenGtk\GtkAbstract::$gCallbackArgNumbe changed to other value - if C function for callback, use
GObject::G_CALLBACK($callable)convert, the$callableis smailer[$gtk, $c_func_name, true], it php callable array has 3 entries, 3rd is bool value - if new C variable be used occur segfault, try new unmanaged variable
- most class is sub of
Gtk\GtkAbstract
For Windows
- get libgtk3 binary DLL file, see https://www.gtk.org/docs/installations/windows/
- copy libgtk3 all DLL file and dependency to your path, if use MSYS install, pass
YOUP_PATH/mingw32/binorYOUP_PATH/mingw64/bintoPHPGtk::gtk($libpath), if not installed other package,In the path DLL file is libgtk dependency package
All versions of gtk with dependencies
PHP Build Version
Package Version
The package toknot/gtk contains the following files
Loading the files please wait ...