├── .github └── ISSUE_TEMPLATE │ ├── __NO_workflows__ │ └── issues_close.yml │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── FUNDING.yml ├── LICENSE ├── Makefile ├── README.md ├── docker ├── AppRun ├── AppRun.wrapped ├── Dockerfile7.4.33 ├── Dockerfile8.2.22 ├── apprun-hooks │ └── linuxdeploy-plugin-gtk.sh ├── copy.ldd.sh ├── run.sh └── useslib.sh ├── docs ├── appimage.md ├── compile-docker.md ├── compile-linux.md ├── compile-mac.md ├── compile-windows-old.md ├── compile-windows.md ├── reference-links.md └── reference-objects.md ├── gen ├── defs.txt └── run.php ├── main.cpp ├── main.h ├── php-gtk.cpp ├── php-gtk.h ├── php-gtk3.ini └── src ├── G ├── GApplication.cpp ├── GApplication.h ├── GObject.cpp └── GObject.h ├── Gdk ├── Gdk.cpp ├── Gdk.h ├── GdkCursor.cpp ├── GdkCursor.h ├── GdkDisplay.cpp ├── GdkDisplay.h ├── GdkDrawable.cpp ├── GdkDrawable.h ├── GdkEvent.cpp ├── GdkEvent.h ├── GdkEventAny.cpp ├── GdkEventButton.cpp ├── GdkEventButton.h ├── GdkEventKey.cpp ├── GdkEventKey.h ├── GdkMonitor.cpp ├── GdkMonitor.h ├── GdkPixbuf.cpp ├── GdkPixbuf.h ├── GdkPixbufFormat.cpp ├── GdkPixbufFormat.h ├── GdkRGBA.cpp ├── GdkRGBA.h ├── GdkScreen.cpp ├── GdkScreen.h ├── GdkThreads.cpp ├── GdkThreads.h ├── GdkVisual.cpp ├── GdkVisual.h ├── GdkWindow.cpp └── GdkWindow.h ├── Glade ├── GladeApp.cpp ├── GladeApp.h ├── GladeDesignView.cpp ├── GladeDesignView.h ├── GladeEditor.cpp ├── GladeEditor.h ├── GladePalette.cpp ├── GladePalette.h ├── GladeProject.cpp ├── GladeProject.h ├── GladeWidget.cpp └── GladeWidget.h ├── Gtk ├── Gtk.cpp ├── Gtk.h ├── GtkAboutDialog.cpp ├── GtkAboutDialog.h ├── GtkActionBar.cpp ├── GtkActionBar.h ├── GtkAdjustment.cpp ├── GtkAdjustment.h ├── GtkAlignment.cpp ├── GtkAlignment.h ├── GtkAppChooserButton.cpp ├── GtkAppChooserButton.h ├── GtkAppChooserDialog.cpp ├── GtkAppChooserDialog.h ├── GtkApplication.cpp ├── GtkApplication.h ├── GtkApplicationWindow.cpp ├── GtkApplicationWindow.h ├── GtkAspectFrame.cpp ├── GtkAspectFrame.h ├── GtkBin.cpp ├── GtkBin.h ├── GtkBox.cpp ├── GtkBox.h ├── GtkBuilder.cpp ├── GtkBuilder.h ├── GtkButton.cpp ├── GtkButton.h ├── GtkButtonBox.cpp ├── GtkButtonBox.h ├── GtkCalendar.cpp ├── GtkCalendar.h ├── GtkCellRenderer.cpp ├── GtkCellRenderer.h ├── GtkCellRendererCombo.cpp ├── GtkCellRendererCombo.h ├── GtkCellRendererPixbuf.cpp ├── GtkCellRendererPixbuf.h ├── GtkCellRendererText.cpp ├── GtkCellRendererText.h ├── GtkCellRendererToggle.cpp ├── GtkCellRendererToggle.h ├── GtkCheckButton.cpp ├── GtkCheckButton.h ├── GtkCheckMenuItem.cpp ├── GtkCheckMenuItem.h ├── GtkClipboard.cpp ├── GtkClipboard.h ├── GtkColorButton.cpp ├── GtkColorButton.h ├── GtkColorChooserDialog.cpp ├── GtkColorChooserDialog.h ├── GtkComboBox.cpp ├── GtkComboBox.h ├── GtkComboBoxText.cpp ├── GtkComboBoxText.h ├── GtkContainer.cpp ├── GtkContainer.h ├── GtkCssProvider.cpp ├── GtkCssProvider.h ├── GtkDialog.cpp ├── GtkDialog.h ├── GtkDrawingArea.cpp ├── GtkDrawingArea.h ├── GtkEntry.cpp ├── GtkEntry.h ├── GtkEntryBuffer.cpp ├── GtkEntryBuffer.h ├── GtkEntryCompletion.cpp ├── GtkEntryCompletion.h ├── GtkEventBox.cpp ├── GtkEventBox.h ├── GtkExpander.cpp ├── GtkExpander.h ├── GtkFileChooser.cpp ├── GtkFileChooser.h ├── GtkFileChooserDialog.cpp ├── GtkFileChooserDialog.h ├── GtkFileFilter.cpp ├── GtkFileFilter.h ├── GtkFixed.cpp ├── GtkFixed.h ├── GtkFlowBox.cpp ├── GtkFlowBox.h ├── GtkFlowBoxChild.cpp ├── GtkFlowBoxChild.h ├── GtkFontButton.cpp ├── GtkFontButton.h ├── GtkFontChooserDialog.cpp ├── GtkFontChooserDialog.h ├── GtkFrame.cpp ├── GtkFrame.h ├── GtkGrid.cpp ├── GtkGrid.h ├── GtkHBox.cpp ├── GtkHBox.h ├── GtkHeaderBar.cpp ├── GtkHeaderBar.h ├── GtkIconTheme.cpp ├── GtkIconTheme.h ├── GtkImage.cpp ├── GtkImage.h ├── GtkInfoBar.cpp ├── GtkInfoBar.h ├── GtkLabel.cpp ├── GtkLabel.h ├── GtkLayout.cpp ├── GtkLayout.h ├── GtkListBox.cpp ├── GtkListBox.h ├── GtkListBoxRow.cpp ├── GtkListBoxRow.h ├── GtkListStore.cpp ├── GtkListStore.h ├── GtkMenu.cpp ├── GtkMenu.h ├── GtkMenuBar.cpp ├── GtkMenuBar.h ├── GtkMenuButton.cpp ├── GtkMenuButton.h ├── GtkMenuItem.cpp ├── GtkMenuItem.h ├── GtkMenuShell.cpp ├── GtkMenuShell.h ├── GtkMessageDialog.cpp ├── GtkMessageDialog.h ├── GtkMisc.cpp ├── GtkMisc.h ├── GtkNotebook.cpp ├── GtkNotebook.h ├── GtkOverlay.cpp ├── GtkOverlay.h ├── GtkPageSetup.cpp ├── GtkPageSetup.h ├── GtkPaned.cpp ├── GtkPaned.h ├── GtkPaperSize.cpp ├── GtkPaperSize.h ├── GtkPrintSettings.cpp ├── GtkPrintSettings.h ├── GtkProgressBar.cpp ├── GtkProgressBar.h ├── GtkRadioButton.cpp ├── GtkRadioButton.h ├── GtkRecentChooserDialog.cpp ├── GtkRecentChooserDialog.h ├── GtkRequisition.cpp ├── GtkRequisition.h ├── GtkRevealer.cpp ├── GtkRevealer.h ├── GtkScrolledWindow.cpp ├── GtkScrolledWindow.h ├── GtkSeparator.cpp ├── GtkSeparator.h ├── GtkSeparatorMenuItem.cpp ├── GtkSeparatorMenuItem.h ├── GtkSeparatorToolItem.cpp ├── GtkSeparatorToolItem.h ├── GtkSizeGroup.cpp ├── GtkSizeGroup.h ├── GtkSpinner.cpp ├── GtkSpinner.h ├── GtkStack.cpp ├── GtkStack.h ├── GtkStackSidebar.cpp ├── GtkStackSidebar.h ├── GtkStackSwitcher.cpp ├── GtkStackSwitcher.h ├── GtkStatusIcon.cpp ├── GtkStatusIcon.h ├── GtkStatusbar.cpp ├── GtkStatusbar.h ├── GtkStyleContext.cpp ├── GtkStyleContext.h ├── GtkTable.cpp ├── GtkTable.h ├── GtkTextBuffer.cpp ├── GtkTextBuffer.h ├── GtkTextIter.cpp ├── GtkTextIter.h ├── GtkTextMark.cpp ├── GtkTextMark.h ├── GtkTextTag.cpp ├── GtkTextTag.h ├── GtkTextTagTable.cpp ├── GtkTextTagTable.h ├── GtkTextView.cpp ├── GtkTextView.h ├── GtkToggleButton.cpp ├── GtkToggleButton.h ├── GtkToolButton.cpp ├── GtkToolButton.h ├── GtkToolItem.cpp ├── GtkToolItem.h ├── GtkToolbar.cpp ├── GtkToolbar.h ├── GtkTreeIter.cpp ├── GtkTreeIter.h ├── GtkTreeModel.cpp ├── GtkTreeModel.h ├── GtkTreeSelection.cpp ├── GtkTreeSelection.h ├── GtkTreeSortable.cpp ├── GtkTreeSortable.h ├── GtkTreeStore.cpp ├── GtkTreeStore.h ├── GtkTreeView.cpp ├── GtkTreeView.h ├── GtkTreeViewColumn.cpp ├── GtkTreeViewColumn.h ├── GtkVBox.cpp ├── GtkVBox.h ├── GtkViewport.cpp ├── GtkViewport.h ├── GtkWidget.cpp ├── GtkWidget.h ├── GtkWidgetPath.cpp ├── GtkWidgetPath.h ├── GtkWindow.cpp ├── GtkWindow.h ├── GtkWrapMode.cpp ├── GtkWrapMode.h ├── GtkosxApplication.cpp └── GtkosxApplication.h ├── GtkSourceView ├── GtkSourceView.cpp └── GtkSourceView.h ├── Pango ├── PangoAttrList.cpp ├── PangoAttrList.h ├── PangoContext.cpp ├── PangoContext.h ├── PangoLayout.cpp ├── PangoLayout.h ├── PangoLayoutLine.cpp ├── PangoLayoutLine.h ├── PangoWrapMode.cpp └── PangoWrapMode.h └── libwnck ├── WnckClassGroup.cpp ├── WnckClassGroup.h ├── WnckScreen.cpp ├── WnckScreen.h ├── WnckWindow.cpp └── WnckWindow.h /.github/ISSUE_TEMPLATE/__NO_workflows__/issues_close.yml: -------------------------------------------------------------------------------- 1 | name: Close inactive issues 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | 6 | jobs: 7 | close-issues: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@v5 14 | with: 15 | days-before-issue-close: 30 16 | close-issue-message: "This issue was closed because it has been inactive for 30 days." 17 | days-before-pr-close: -1 18 | repo-token: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Small working code** 14 | ```php 15 | set_size_request(500, 500); 22 | 23 | /** 24 | * add your widget or logic here, that couse the problem 25 | */ 26 | 27 | 28 | // connect to signal that close program 29 | $window->connect("destroy", function() { 30 | Gtk::main_quit(); 31 | }); 32 | 33 | // show all and start 34 | $window->show_all(); 35 | Gtk::main(); 36 | ``` 37 | 38 | **Expected behavior** 39 | A clear and concise description of what you expected to happen. 40 | 41 | **Screenshots** 42 | If applicable, add screenshots to help explain your problem. 43 | 44 | **Version** 45 | - Linux, Windows or Mac?: 46 | - Using pre-build binary? Which version?: 47 | - Did you compiled? What your PHP full version?: 48 | 49 | **Additional context** 50 | Add any other context about the problem here. 51 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea, class or method 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **GTK documentation** 11 | Provide the GTK documentation link of method or class 12 | 13 | **Usage example** 14 | Provide links of how to use this methods or class, or a simple expected code 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .~ 3 | thumbs.db 4 | *.o 5 | *.so 6 | .vscode/settings.json 7 | .vscode/c_cpp_properties.json 8 | build.sh 9 | -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: scorninpc 2 | -------------------------------------------------------------------------------- /docker/AppRun: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # autogenerated by linuxdeploy 4 | 5 | # make sure errors in sourced scripts will cause this script to stop 6 | set -e 7 | 8 | this_dir="$(readlink -f "$(dirname "$0")")" 9 | 10 | source "$this_dir"/apprun-hooks/"linuxdeploy-plugin-gtk.sh" 11 | 12 | exec "$this_dir"/AppRun.wrapped "$@" 13 | -------------------------------------------------------------------------------- /docker/AppRun.wrapped: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export APPDIR="$(dirname "$(readlink -f "${0}")")" 4 | 5 | ${APPDIR}/apprun-hooks/linuxdeploy-plugin-gtk.sh 6 | 7 | # Paths 8 | export LD_LIBRARY_PATH=${APPDIR}/usr/lib:${APPDIR}/usr/local/php-gtk3/lib:${APPDIR}/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:${LD_LIBRARY_PATH} 9 | export PATH=${PATH}:${APPDIR}/usr/local/php-gtk3/bin:${APPDIR}/usr/lib:${APPDIR}/usr/local/php-gtk3/lib:${APPDIR}/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders 10 | 11 | # export XDG_DATA_DIRS=$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:${APPDIR}/usr/local/share:${APPDIR}/usr/share 12 | 13 | # Run PHP with custom ini and custom modules extension dir 14 | ${APPDIR}/usr/local/php-gtk3/bin/php \ 15 | -c ${APPDIR}/usr/local/php-gtk3/lib/php.ini \ 16 | -dextension_dir=${APPDIR}/usr/local/php-gtk3/lib/php/extensions \ 17 | $@ -------------------------------------------------------------------------------- /docker/Dockerfile7.4.33: -------------------------------------------------------------------------------- 1 | # 2 | # start creating the docker container (use --no-cache if need to recreate) 3 | # $ docker build -t php7.4.33-gtk3 . 4 | # 5 | # clone php-gtk3 repository to php-gtk3-source 6 | # $ git clone git@github.com:scorninpc/php-gtk3.git php-gtk3-source 7 | # 8 | # build php-gtk3 9 | # $ docker run --name php74-gtk3 --rm -v $PWD:/app php7.4.33-gtk3 build 10 | # 11 | # test build 12 | # $ docker run --name php74-gtk3 --rm -v $PWD:/app php7.4.33-gtk3 php -m 13 | # 14 | # copy compiled php to install 15 | # $ docker run --name php74-gtk3 --rm -v $PWD:/app php7.4.33-gtk3 php-copy 16 | # $ sudo chown $USER:$USER -R $PWD/usr/local/php-gtk3 17 | # $ sudo cp libphpcpp.so.2.3 /lib/ 18 | # $ sudo cp libgladeui-2.so.13 /lib/ 19 | # $ sudo cp libgtksourceview-3.0.so.1 /lib/ 20 | # $ sudo mv $PWD/usr/local/php-gtk3 /usr/local/ 21 | # $ sudo ls -s /usr/local/php-gtk3/bin/php /usr/bin/php-gtk3 22 | # 23 | FROM debian:stable-slim 24 | 25 | # git 26 | RUN apt-get update && apt-get install -y libssl-dev libpq-dev bison libreadline-dev git build-essential autoconf automake libtool re2c libxml2-dev libcurl4-openssl-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libzip-dev libsqlite3-dev libonig-dev libxslt1-dev libgtk-3-dev libgladeui-dev libgtksourceview-3.0-dev libwnck-dev 27 | 28 | # php-src 29 | WORKDIR /php-gtk-build 30 | RUN git clone -b PHP-7.4.33 https://github.com/php/php-src.git PHP-7.4.33 31 | 32 | WORKDIR /php-gtk-build/PHP-7.4.33 33 | RUN ./buildconf --force 34 | RUN ./configure --prefix=/usr/local/php-gtk3 --disable-cgi --disable-shared --enable-static --with-pgsql --with-pdo-mysql --with-pdo-pgsql --with-pgsql --with-ffi --with-readline --enable-soap --enable-sockets --with-bz2 --with-zlib --enable-mbstring --with-curl --with-xsl 35 | RUN make -j 4 && make install 36 | ENV PATH=${PATH}:/usr/local/php-gtk3/bin 37 | 38 | # php-cpp 39 | WORKDIR /php-gtk-build 40 | RUN git clone https://github.com/fast-debug/PHP-CPP.git 41 | WORKDIR /php-gtk-build/PHP-CPP 42 | RUN make -j 4 && make install 43 | 44 | # exports 45 | ENV PATH=${PATH}:/php-gtk-build 46 | WORKDIR /php-gtk-build 47 | COPY run.sh ./ 48 | ENTRYPOINT ["run.sh"] -------------------------------------------------------------------------------- /docker/Dockerfile8.2.22: -------------------------------------------------------------------------------- 1 | # 2 | # start creating the docker container (use --no-cache if need to recreate) 3 | # $ docker build -t php8.2.22-gtk3 . 4 | # 5 | # clone php-gtk3 repository to php-gtk3-source 6 | # $ git clone git@github.com:scorninpc/php-gtk3.git php-gtk3-source 7 | # 8 | # build php-gtk3 9 | # $ docker run --name php82-gtk3 --rm -v $PWD:/app php8.2.22-gtk3 build 10 | # 11 | # test build 12 | # $ docker run --name php82-gtk3 --rm -v $PWD:/app php8.2.22-gtk3 php -m 13 | # 14 | # copy compiled php to install 15 | # $ docker run --name php82-gtk3 --rm -v $PWD:/app php8.2.22-gtk3 php-copy 16 | # $ sudo chown $USER:$USER -R $PWD/usr/local/php-gtk3 17 | # $ sudo cp libphpcpp.so.2.3 /lib/ 18 | # $ sudo cp libgladeui-2.so.13 /lib/ 19 | # $ sudo cp libgtksourceview-3.0.so.1 /lib/ 20 | # $ sudo mv $PWD/usr/local/php-gtk3 /usr/local/ 21 | # $ sudo ls -s /usr/local/php-gtk3/bin/php /usr/bin/php-gtk3 22 | # 23 | FROM debian:stable-slim 24 | 25 | # git 26 | RUN apt-get update && apt-get install -y libpq-dev bison libreadline-dev git build-essential autoconf automake libtool re2c libxml2-dev libcurl4-openssl-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libzip-dev libsqlite3-dev libonig-dev libxslt1-dev libgtk-3-dev libgladeui-dev libgtksourceview-3.0-dev libwnck-dev 27 | 28 | # php-src 29 | WORKDIR /php-gtk-build 30 | RUN git clone -b PHP-8.2.22 https://github.com/php/php-src.git PHP-8.2.22 31 | 32 | WORKDIR /php-gtk-build/PHP-8.2.22 33 | RUN ./buildconf --force 34 | RUN ./configure --prefix=/usr/local/php-gtk3 --disable-cgi --disable-shared --enable-static --with-pgsql --with-pdo-mysql --with-pdo-pgsql --with-pgsql --with-ffi --with-readline --with-openssl --enable-soap --enable-sockets --with-bz2 --with-zlib --enable-mbstring --with-curl --with-xsl 35 | RUN make -j 4 && make install 36 | ENV PATH=${PATH}:/usr/local/php-gtk3/bin 37 | 38 | # php-cpp 39 | WORKDIR /php-gtk-build 40 | RUN git clone https://github.com/fast-debug/PHP-CPP.git 41 | WORKDIR /php-gtk-build/PHP-CPP 42 | RUN make -j 4 && make install 43 | 44 | # exports 45 | ENV PATH=${PATH}:/php-gtk-build 46 | WORKDIR /php-gtk-build 47 | COPY run.sh ./ 48 | ENTRYPOINT ["run.sh"] -------------------------------------------------------------------------------- /docker/apprun-hooks/linuxdeploy-plugin-gtk.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | COLOR_SCHEME="$(dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read 'string:org.freedesktop.appearance' 'string:color-scheme' 2>/dev/null | tail -n1 | cut -b35- | cut -d' ' -f2)" 4 | if [ -z "$COLOR_SCHEME" ]; then 5 | COLOR_SCHEME="$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null)" 6 | fi 7 | case "$COLOR_SCHEME" in 8 | "1"|"'prefer-dark'") GTK_THEME_VARIANT="dark";; 9 | "2"|"'prefer-light'") GTK_THEME_VARIANT="light";; 10 | *) GTK_THEME_VARIANT="light";; 11 | esac 12 | # APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:-"Adwaita:$GTK_THEME_VARIANT"}" # Allow user to override theme (discouraged) 13 | 14 | export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}" # Workaround to run extracted AppImage 15 | export GTK_DATA_PREFIX="$APPDIR" 16 | # export GTK_THEME="$APPIMAGE_GTK_THEME" # Custom themes are broken 17 | export GDK_BACKEND=x11 # Crash with Wayland backend on Wayland 18 | export XDG_DATA_DIRS="$APPDIR/usr/share:/usr/share:$XDG_DATA_DIRS" # g_get_system_data_dirs() from GLib 19 | export GSETTINGS_SCHEMA_DIR="$APPDIR//usr/share/glib-2.0/schemas" 20 | export GI_TYPELIB_PATH="$APPDIR//usr/lib/girepository-1.0" 21 | export GTK_EXE_PREFIX="$APPDIR//usr" 22 | export GTK_PATH="$APPDIR//usr/lib/gtk-3.0" 23 | export GTK_IM_MODULE_FILE="$APPDIR//usr/lib/gtk-3.0/3.0.0/immodules.cache" 24 | export GDK_PIXBUF_MODULE_FILE="$APPDIR//usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" 25 | -------------------------------------------------------------------------------- /docker/copy.ldd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ldd -u -r $1 | awk 'NF == 4 { system("cp " $3 " /app/usr/lib") }' 4 | 5 | ldconfig -p | grep libgladeui-2.so | tr ' ' '\n' | grep / 6 | ldconfig -p | grep libgtksourceview-3.0.so | tr ' ' '\n' | grep / 7 | 8 | 9 | # cp /lib/x86_64-linux-gnu/libgladeui-2.so /app/usr/lib/libgladeui-2.so.13 10 | -------------------------------------------------------------------------------- /docker/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # mount the working dir when run with -v 4 | 5 | # execute php command 6 | # $ docker run --rm -v ~/Desktop/php-gtk3:/app php-gtk3 php -m 7 | if [ "$1" == "php" ]; then 8 | shift 9 | /usr/local/php-gtk3/bin/php -dextension=/app/php-gtk3-source/php-gtk3.so "$@" 10 | fi 11 | 12 | # copy compiled php to ~/Desktop/php-gtk3/php-bin 13 | # $ docker run --rm -v ~/Desktop/php-gtk3:/app php-gtk3 php-copy 14 | # give user permission back on host with 15 | # $ chwon user:user -R ~/Desktop/php-gtk3/usr/local/php-gtk3 16 | if [ "$1" == "php-copy" ]; then 17 | cp /lib/x86_64-linux-gnu/libgladeui-2.so.13 /app 18 | mkdir /app/usr/local/php-gtk3 -p 19 | cp /lib/libphpcpp.so.2.3 /app 20 | cp /lib/x86_64-linux-gnu/libgtksourceview-3.0.so.1 /app 21 | cp /usr/local/php-gtk3 "/app/usr/local/" -r 22 | fi 23 | 24 | # compile php-gtk3 source. checkout PHP-GTK3 source on ~/Desktop before compile 25 | # $ docker run --rm -v ~/Desktop/php-gtk3:/app php-gtk3 build 26 | # teste with 27 | # $ docker run --rm -v ~/Desktop/php-gtk3:/app php-gtk3 php -m 28 | if [ "$1" == "build" ]; then 29 | shift 30 | cd /app/php-gtk3-source && make clean && make -j "$@" 31 | 32 | cp /app/php-gtk3-source/php-gtk3.so $(php-config --extension-dir)/ 33 | echo "extension=php-gtk3.so" >> $(php-config --ini-path)/php.ini 34 | fi 35 | 36 | # tests to copy dependencies 37 | if [ "$1" == "ldd" ]; then 38 | 39 | /usr/local/php-gtk3/bin/php -dextension=/app/php-gtk3-source/php-gtk3.so -m 40 | 41 | /app/copy.ldd.sh /usr/local/php-gtk3/bin/php -dextension=/app/php-gtk3-source/php-gtk3.so -m 42 | fi -------------------------------------------------------------------------------- /docker/useslib.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ldd $1 | grep -q $2 3 | exit $? -------------------------------------------------------------------------------- /docs/compile-docker.md: -------------------------------------------------------------------------------- 1 | 2 | # Table of contents 3 | 4 | - [How to compile PHP-GTK on Linux with Docker](#how-to-compile-php-gtk-on-linux-with-docker) 5 | - [How to install PHP-GTK on Linux with Docker](#how-to-install-php-gtk-on-linux-with-docker) 6 | 7 | # How to compile PHP-GTK on Linux with Docker 8 | 9 | This is extremely experimental 10 | 11 | 1. Create a working folder 12 | 13 | 2. Inside this folder, choose the `Dockerfile` from `/docker` folder in repository. This named with php version like `DockerfileX.X.XX`, and rename it to `Dockerfile` 14 | 15 | 3. You will need `run.sh` too. Only this two files 16 | 17 | 4. Now create the image with `docker build -t php-gtk3-image . `. `php-gtk3-image` is the final image name, and you can change if you want 18 | 19 | 5. Clone the php-gtk3 repository to php-gtk3-source with `git clone git@github.com:scorninpc/php-gtk3.git php-gtk3-source` 20 | 21 | 6. Now you can build source with docker with command `docker run --name php-gtk3-container --rm -v $PWD:/app php-gtk3-image build 4` 22 | 23 | 7. If all works fine, you can test your build with `docker run --name php-gtk3-container --rm -v $PWD:/app php-gtk3-image php -m`. You will see `php-gtk3` extension on the list 24 | 25 | # How to install PHP-GTK on Linux with Docker 26 | 27 | 1. After compile, you can install compiled locally. Run command `docker run --name php-gtk3-container --rm -v $PWD:/app php-gtk3-image php-copy`. This will create a folder locally called `usr` and some `.so` files 28 | 29 | 2. Give user permission to the `usr` with `sudo chown $USER:$USER -R $PWD/usr/local/php-gtk3` 30 | 31 | 3. Copy libs to the lib folder with `sudo cp libphpcpp.so.2.3 /lib/`, `sudo cp libgladeui-2.so.13 /lib/` and `sudo cp libgtksourceview-3.0.so.1 /lib/` 32 | 33 | 4. Move `src/local/php-gtk3` to system folders with `sudo mv $PWD/usr/local/php-gtk3 /usr/local/` 34 | 35 | 5. Create the syslink with `sudo ls -s /usr/local/php-gtk3/bin/php /usr/bin/php-gtk3` 36 | 37 | 6. now you should be able to run `php-gtk3` command to execute your scripts -------------------------------------------------------------------------------- /docs/compile-mac.md: -------------------------------------------------------------------------------- 1 | # Compilar o PHP 2 | 3 | _this doc is old, and not intense tested. maybe some errors occur_ 4 | 5 | $ brew install bison@3.5 6 | 7 | $ echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.zshrc 8 | 9 | $ export PATH="/usr/local/opt/bison/bin:$PATH" 10 | 11 | $ brew install autoconf automake libtool re2c bison flex git 12 | 13 | $ git clone -b PHP-7.4 https://github.com/php/php-src.git php7.4 14 | 15 | $ ./buildconf --force 16 | 17 | $ ./configure --disable-all --enable-cli --prefix=/opt/php7.4 18 | 19 | $ make 20 | 21 | $ sudo make install 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | # Compilar PHP-CPP 31 | 32 | $ git clone https://github.com/scorninpc/PHP-CPP php-cpp 33 | 34 | # Change php-config on Makefile to /opt/php/bin/php-config 35 | 36 | $ make 37 | 38 | $ sudo make install 39 | 40 | 41 | 42 | 43 | 44 | 45 | # Compilar Gtk 46 | 47 | $ brew install gtk+3 gtksourceview3 gtk-mac-integration libglade pkg-config 48 | 49 | 50 | 51 | 52 | 53 | # Compilar PHP-GTK3 54 | 55 | $ git clone https://github.com/scorninpc/php-gtk3.git 56 | 57 | # Change php-config on Makefile to /opt/php/bin/php-config 58 | 59 | # The Cellar still including gtk2 on cflags as dependency of libglade. So you need to remove glade from main.h and main.cpp; Remove libglade from GTKFLAGS and GTKLIBS from Makefile; And remove Glade src from SOURCES of Makefile 60 | 61 | $ make 62 | 63 | -------------------------------------------------------------------------------- /gen/defs.txt: -------------------------------------------------------------------------------- 1 | void gtk_application_add_accelerator (GtkApplication* application, const gchar* accelerator, GtkJustification action_name, gint parameter); 2 | 3 | void gtk_application_add_window (GtkApplication* application, GtkWindow* window); 4 | 5 | gchar** gtk_application_get_accels_for_action (GtkApplication* application, const gchar* detailed_action_name); 6 | 7 | gchar** gtk_application_get_actions_for_accel (GtkApplication* application, const gchar* accel); 8 | 9 | GtkWindow* gtk_application_get_active_window (GtkApplication* application); 10 | 11 | GMenuModel* gtk_application_get_app_menu (GtkApplication* application); 12 | 13 | GMenu* gtk_application_get_menu_by_id (GtkApplication* application, const gchar* id); 14 | 15 | GMenuModel* gtk_application_get_menubar (GtkApplication* application); 16 | 17 | GtkWindow* gtk_application_get_window_by_id (GtkApplication* application, guint id); 18 | 19 | GList* gtk_application_get_windows (GtkApplication* application); 20 | 21 | guint gtk_application_inhibit (GtkApplication* application, GtkWindow* window, GtkApplicationInhibitFlags flags, const gchar* reason); 22 | 23 | gboolean gtk_application_is_inhibited (GtkApplication* application, GtkApplicationInhibitFlags flags); 24 | 25 | 26 | gboolean gtk_application_prefers_app_menu (GtkApplication* application); 27 | 28 | void gtk_application_remove_accelerator (GtkApplication* application, const gchar* action_name, GVariant* parameter); 29 | 30 | void gtk_application_remove_window (GtkApplication* application, GtkWindow* window); 31 | 32 | void gtk_application_set_accels_for_action (GtkApplication* application, const gchar* detailed_action_name, const gchar* const* accels); 33 | 34 | void gtk_application_set_app_menu (GtkApplication* application, GMenuModel* app_menu); 35 | 36 | void gtk_application_set_menubar (GtkApplication* application, GMenuModel* menubar); 37 | 38 | void gtk_application_uninhibit (GtkApplication* application, guint cookie); 39 | 40 | gchar** gtk_application_list_action_descriptions (GtkApplication* application); 41 | 42 | GtkWidget* gtk_application_window_new (GtkApplication* application); 43 | 44 | GtkApplication* gtk_application_new (const gchar* application_id, GApplicationFlags flags) -------------------------------------------------------------------------------- /php-gtk.h: -------------------------------------------------------------------------------- 1 | #ifndef _PHPGTK_H_ 2 | #define _PHPGTK_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "src/Gtk/GtkWidget.h" 9 | 10 | 11 | bool phpgtk_check_parameter(Php::Parameters ¶meters, int param, Php::Type expected_type, bool required, const char *object_type); 12 | char *phpgtk_wrong_type_message(int param, Php::Type type_passed, Php::Type type_expected); 13 | std::string phpgtk_type_to_string(Php::Type type); 14 | Php::Value cobject_to_phpobject(gpointer *cobject); 15 | 16 | /** 17 | * Struct for generic callback 18 | */ 19 | struct generic_st_callback { 20 | Php::Value callback_name; 21 | Php::Object self_widget; 22 | Php::Parameters parameters; 23 | 24 | GType return_type; 25 | int n_params; 26 | GType *param_types; 27 | }; 28 | 29 | void generic_callback(gpointer *self, ...); 30 | 31 | 32 | #endif -------------------------------------------------------------------------------- /php-gtk3.ini: -------------------------------------------------------------------------------- 1 | extension=php-gtk3.so -------------------------------------------------------------------------------- /src/Gdk/Gdk.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Gdk.h" 3 | #include "../../php-gtk.h" 4 | 5 | /** 6 | * 7 | */ 8 | Gdk_::Gdk_() = default; 9 | Gdk_::~Gdk_() = default; 10 | 11 | /** 12 | * https://developer.gnome.org/gdk3/stable/gdk3-Testing.html#gdk-test-simulate-button 13 | */ 14 | Php::Value Gdk_::test_simulate_button(Php::Parameters ¶meters) 15 | { 16 | bool check; 17 | 18 | // --- 19 | phpgtk_check_parameter(parameters, 1, Php::Type::Object, TRUE, "GdkWindow"); 20 | GdkWindow *window; 21 | if(parameters.size() > 0) { 22 | Php::Value object_window = parameters[0]; 23 | GdkWindow_ *phpgtk_window = (GdkWindow_ *)object_window.implementation(); 24 | window = GDK_WINDOW(phpgtk_window->get_instance()); 25 | } 26 | 27 | // --- 28 | check = phpgtk_check_parameter(parameters, 2, Php::Type::Numeric, FALSE, NULL); 29 | gint x = 0; 30 | if(check) { 31 | x = (int)parameters[1]; 32 | } 33 | 34 | // --- 35 | check = phpgtk_check_parameter(parameters, 3, Php::Type::Numeric, FALSE, NULL); 36 | gint y = 0; 37 | if(check) { 38 | y = (int)parameters[2]; 39 | } 40 | 41 | // --- 42 | check = phpgtk_check_parameter(parameters, 4, Php::Type::Numeric, FALSE, NULL); 43 | gint button = 0; 44 | if(check) { 45 | button = (int)parameters[3]; 46 | } 47 | 48 | // --- 49 | check = phpgtk_check_parameter(parameters, 5, Php::Type::Numeric, FALSE, NULL); 50 | GdkModifierType modifiers = GDK_BUTTON1_MASK; 51 | if(check) { 52 | int phpgtk_modifiers = (int)parameters[4]; 53 | modifiers = (GdkModifierType)phpgtk_modifiers; 54 | } 55 | 56 | // --- 57 | check = phpgtk_check_parameter(parameters, 6, Php::Type::Numeric, FALSE, NULL); 58 | GdkEventType button_pressrelease = GDK_BUTTON_PRESS; 59 | if(check) { 60 | int phpgtk_button_pressrelease = (int)parameters[4]; 61 | button_pressrelease = (GdkEventType)phpgtk_button_pressrelease; 62 | } 63 | 64 | // Move the cursor 65 | GdkDevice *device = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display_get_default())); 66 | GdkScreen *screen = gdk_screen_get_default(); 67 | gdk_device_warp (device, screen, x, y); 68 | 69 | // 70 | gdk_test_simulate_button(window, x, y, button, modifiers, button_pressrelease); 71 | 72 | return 1; 73 | } -------------------------------------------------------------------------------- /src/Gdk/Gdk.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDK_H_ 3 | #define _PHPGTK_GDK_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "GdkWindow.h" 10 | 11 | /** 12 | * 13 | */ 14 | class Gdk_ : public Php::Base 15 | { 16 | /** 17 | * Publics 18 | */ 19 | public: 20 | /** 21 | * C++ constructor/destructor 22 | */ 23 | Gdk_(); 24 | virtual ~Gdk_(); 25 | 26 | static Php::Value test_simulate_button(Php::Parameters ¶meters); 27 | }; 28 | 29 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkCursor.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKCURSOR_H_ 3 | #define _PHPGTK_GDKCURSOR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../../php-gtk.h" 9 | #include "../G/GObject.h" 10 | #include "GdkDisplay.h" 11 | #include "GdkPixbuf.h" 12 | 13 | /** 14 | * GdkCursor_ 15 | */ 16 | class GdkCursor_ : public GObject_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GdkCursor_(); 27 | ~GdkCursor_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | static Php::Value new_for_display(Php::Parameters ¶meters); 31 | static Php::Value new_from_name(Php::Parameters ¶meters); 32 | static Php::Value new_from_pixbuf(Php::Parameters ¶meters); 33 | Php::Value get_cursor_type(); 34 | Php::Value get_display(); 35 | Php::Value get_image(); 36 | // gdk_cursor_new_from_name 37 | // gdk_cursor_new_from_pixbuf 38 | // gdk_cursor_get_cursor_type 39 | // gdk_cursor_get_display 40 | // gdk_cursor_get_image 41 | 42 | 43 | 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Gdk/GdkDisplay.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkDisplay.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GdkDisplay_::GdkDisplay_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GdkDisplay_::~GdkDisplay_() = default; 13 | 14 | /** 15 | * Return original GtkWidget 16 | */ 17 | GdkDisplay *GdkDisplay_::get_instance() 18 | { 19 | return instance; 20 | } 21 | 22 | /** 23 | * Set the original GdkDisplay 24 | */ 25 | void GdkDisplay_::set_instance(GdkDisplay *screen) 26 | { 27 | instance = screen; 28 | } 29 | 30 | /** 31 | * https://developer.gnome.org/gdk3/stable/GdkDisplay.html#gdk-display-get-default 32 | */ 33 | Php::Value GdkDisplay_::get_default() 34 | { 35 | GdkDisplay *returndedValue = gdk_display_get_default(); 36 | 37 | GdkDisplay_ *returnValue = new GdkDisplay_(); 38 | returnValue->set_instance(returndedValue); 39 | 40 | return Php::Object("GdkDisplay", returnValue); 41 | } 42 | 43 | /** 44 | * https://developer.gnome.org/gdk3/stable/GdkDisplay.html#gdk-display-get-primary-monitor 45 | */ 46 | Php::Value GdkDisplay_::get_primary_monitor() 47 | { 48 | GdkMonitor *returndedValue = gdk_display_get_primary_monitor(GDK_DISPLAY(instance)); 49 | 50 | GdkMonitor_ *returnValue = new GdkMonitor_(); 51 | returnValue->set_instance(returndedValue); 52 | 53 | return Php::Object("GdkMonitor", returnValue); 54 | } 55 | 56 | Php::Value GdkDisplay_::get_default_screen() 57 | { 58 | GdkScreen* ret = gdk_display_get_default_screen(GDK_DISPLAY(instance)); 59 | 60 | GdkScreen_ *returnValue = new GdkScreen_(); 61 | returnValue->set_instance(ret); 62 | 63 | return Php::Object("GdkScreen", returnValue); 64 | } -------------------------------------------------------------------------------- /src/Gdk/GdkDisplay.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKDISPLAY_H_ 3 | #define _PHPGTK_GDKDISPLAY_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GdkMonitor.h" 9 | #include "GdkScreen.h" 10 | 11 | /** 12 | * GdkDisplay_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GdkDisplay.html 15 | */ 16 | class GdkDisplay_ : public Php::Base 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | GdkDisplay *instance; 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GdkDisplay_(); 29 | ~GdkDisplay_(); 30 | 31 | /** 32 | * Return original GdkDisplay 33 | */ 34 | GdkDisplay *get_instance(); 35 | void set_instance(GdkDisplay *screen); 36 | 37 | static Php::Value get_default(); 38 | Php::Value get_primary_monitor(); 39 | Php::Value get_default_screen(); 40 | 41 | 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Gdk/GdkDrawable.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkDrawable.h" 3 | 4 | 5 | GdkDrawable_::GdkDrawable_() = default; 6 | GdkDrawable_::~GdkDrawable_() = default; 7 | -------------------------------------------------------------------------------- /src/Gdk/GdkDrawable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKDRAWABLE_H_ 3 | #define _PHPGTK_GDKDRAWABLE_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | /** 11 | * 12 | */ 13 | class GdkDrawable_ : public GObject_ 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | /** 20 | * C++ constructor and destructor 21 | */ 22 | GdkDrawable_(); 23 | ~GdkDrawable_(); 24 | 25 | }; 26 | 27 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkEvent.h" 3 | 4 | 5 | // 6 | GdkEvent *GdkEvent_::get_instance() 7 | { 8 | return instance; 9 | } 10 | 11 | /** 12 | * PHP Constructor 13 | */ 14 | void GdkEvent_::__construct(Php::Parameters& parameters) 15 | { 16 | 17 | } 18 | 19 | // 20 | void GdkEvent_::set_instance(GdkEvent *event) 21 | { 22 | instance = event; 23 | } 24 | 25 | 26 | void GdkEvent_::populate(GdkEvent *event) 27 | { 28 | instance = event; 29 | 30 | // get self reference as Php::Value object 31 | Php::Value self(this); 32 | 33 | // GdkEventType 34 | self["type"] = event->type; 35 | 36 | // GtkEventButton 37 | GdkEventButton_ *eventbutton_ = new GdkEventButton_(); 38 | Php::Value gdkeventbutton = Php::Object("GdkEventButton", eventbutton_); 39 | eventbutton_->populate(event->button); 40 | self["button"] = eventbutton_; 41 | 42 | // GtkEventKey 43 | GdkEventKey_ *eventkey_ = new GdkEventKey_(); 44 | Php::Value gdkeventkey = Php::Object("GdkEventKey", eventkey_); 45 | eventkey_->populate(event->key); 46 | self["key"] = eventkey_; 47 | 48 | 49 | /** 50 | 51 | https://developer.gnome.org/gdk3/stable/gdk3-Events.html#gdk-event-get-event-type 52 | https://developer.gnome.org/gtk-tutorial/stable/a2767.html 53 | 54 | union _GdkEvent 55 | { 56 | GdkEventType type; 57 | GdkEventAny any; 58 | GdkEventExpose expose; 59 | GdkEventNoExpose no_expose; 60 | GdkEventVisibility visibility; 61 | GdkEventMotion motion; 62 | GdkEventButton button; 63 | GdkEventKey key; 64 | GdkEventCrossing crossing; 65 | GdkEventFocus focus_change; 66 | GdkEventConfigure configure; 67 | GdkEventProperty property; 68 | GdkEventSelection selection; 69 | GdkEventProximity proximity; 70 | GdkEventClient client; 71 | GdkEventDND dnd; 72 | }; 73 | 74 | */ 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/Gdk/GdkEvent.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKEVENT_H_ 3 | #define _PHPGTK_GDKEVENT_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GdkEventButton.h" 9 | #include "GdkEventKey.h" 10 | 11 | /** 12 | * 13 | */ 14 | class GdkEvent_ : public Php::Base 15 | { 16 | /** 17 | * Publics 18 | */ 19 | public: 20 | GdkEvent *instance; 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GdkEvent_() = default; 26 | virtual ~GdkEvent_() = default; 27 | // 28 | GdkEvent *get_instance(); 29 | void set_instance(GdkEvent *event); 30 | 31 | /** 32 | * PHP Construct 33 | */ 34 | void __construct(Php::Parameters ¶meters); 35 | 36 | /** 37 | * Populate GdkEvent to PHPGTK::GDKEVENT 38 | */ 39 | void populate(GdkEvent *event); 40 | }; 41 | 42 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkEventAny.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | /** 7 | * @todo Add all properties 8 | * 9 | * https://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html 10 | */ 11 | class GdkEventAny_ : public Php::Base 12 | { 13 | 14 | public: 15 | 16 | /** 17 | * c++ constructor 18 | */ 19 | GdkEventAny_() = default; 20 | 21 | /** 22 | * c++ destructor 23 | */ 24 | virtual ~GdkEventAny_() = default; 25 | }; -------------------------------------------------------------------------------- /src/Gdk/GdkEventButton.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkEventButton.h" 3 | 4 | 5 | /** 6 | * c++ constructor 7 | */ 8 | GdkEventButton_::GdkEventButton_() 9 | { 10 | 11 | } 12 | 13 | /** 14 | * PHP Constructor 15 | */ 16 | void GdkEventButton_::__construct(Php::Parameters& parameters) 17 | { 18 | 19 | } 20 | 21 | void GdkEventButton_::populate(GdkEventButton event) 22 | { 23 | // get self reference as Php::Value object 24 | Php::Value self(this); 25 | 26 | // initialize a public property 27 | self["type"] = (int)event.type; 28 | // self["window"] = (int)event.window; // GdkWindow 29 | self["send_event"] = (int)event.send_event; 30 | self["time"] = (int)event.time; 31 | self["x"] = (int)event.x; 32 | self["y"] = (int)event.y; 33 | self["axes"] = (double *)event.axes; 34 | self["state"] = (int)event.state; 35 | self["button"] = (int)event.button; 36 | // self["device"] = (int)event.device; // GdkDevice 37 | self["x_root"] = (double)event.x_root; 38 | self["y_root"] = (double)event.y_root; 39 | 40 | } -------------------------------------------------------------------------------- /src/Gdk/GdkEventButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GdkEVENTBUTTON_H_ 3 | #define _PHPGTK_GdkEVENTBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | /** 9 | * 10 | */ 11 | class GdkEventButton_ : public Php::Base 12 | { 13 | /** 14 | * Publics 15 | */ 16 | public: 17 | 18 | /** 19 | * C++ constructor and destructor 20 | */ 21 | GdkEventButton_(); 22 | 23 | /** 24 | * PHP Construct 25 | */ 26 | void __construct(Php::Parameters ¶meters); 27 | 28 | /** 29 | * Populate GdkEventButton to PHPGTK::GdkEventButton 30 | */ 31 | void populate(GdkEventButton event); 32 | }; 33 | 34 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkEventKey.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkEventKey.h" 3 | 4 | 5 | /** 6 | * c++ constructor 7 | */ 8 | GdkEventKey_::GdkEventKey_() 9 | { 10 | 11 | } 12 | 13 | /** 14 | * PHP Constructor 15 | */ 16 | void GdkEventKey_::__construct(Php::Parameters& parameters) 17 | { 18 | 19 | } 20 | 21 | void GdkEventKey_::populate(GdkEventKey event) 22 | { 23 | // Php::call("var_dump", "OK"); 24 | 25 | // get self reference as Php::Value object 26 | Php::Value self(this); 27 | // initialize a public property 28 | self["type"] = (int)event.type; 29 | // self["window"] = (int)event.window; // GdkWindow 30 | self["send_event"] = (int)event.send_event; 31 | self["time"] = (int)event.time; 32 | self["state"] = (int)event.state; 33 | self["keyval"] = (int)event.keyval; 34 | self["length"] = (int)event.length; 35 | 36 | if(event.string != NULL) { 37 | const gchar *event_string = event.string; 38 | self["string"] = &event_string; 39 | } 40 | 41 | self["hardware_keycode"] = (int)event.hardware_keycode; 42 | self["keycode"] = (int)event.hardware_keycode; 43 | self["group"] = (int)event.group; 44 | self["is_modifier"] = (int)event.is_modifier; 45 | 46 | 47 | 48 | } -------------------------------------------------------------------------------- /src/Gdk/GdkEventKey.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKEVENTKEY_H_ 3 | #define _PHPGTK_GDKEVENTKEY_H_ 4 | 5 | #include 6 | #include 7 | 8 | /** 9 | * 10 | */ 11 | class GdkEventKey_ : public Php::Base 12 | { 13 | /** 14 | * Publics 15 | */ 16 | public: 17 | 18 | /** 19 | * C++ constructor and destructor 20 | */ 21 | GdkEventKey_(); 22 | 23 | /** 24 | * PHP Construct 25 | */ 26 | void __construct(Php::Parameters ¶meters); 27 | 28 | /** 29 | * Populate GdkEventKey to PHPGTK::GdkEventKey 30 | */ 31 | void populate(GdkEventKey event); 32 | }; 33 | 34 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkMonitor.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkMonitor.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GdkMonitor_::GdkMonitor_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GdkMonitor_::~GdkMonitor_() = default; 13 | 14 | /** 15 | * Return original GtkWidget 16 | */ 17 | GdkMonitor *GdkMonitor_::get_instance() 18 | { 19 | return instance; 20 | } 21 | 22 | /** 23 | * Set the original GdkMonitor 24 | */ 25 | void GdkMonitor_::set_instance(GdkMonitor *monitor) 26 | { 27 | instance = monitor; 28 | } 29 | 30 | /** 31 | * https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-width-mm 32 | */ 33 | Php::Value GdkMonitor_::get_width_mm() 34 | { 35 | return gdk_monitor_get_width_mm(GDK_MONITOR(instance)); 36 | } 37 | 38 | /** 39 | * https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-height-mm 40 | */ 41 | Php::Value GdkMonitor_::get_height_mm() 42 | { 43 | return gdk_monitor_get_height_mm(GDK_MONITOR(instance)); 44 | } 45 | 46 | /** 47 | * https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-workarea 48 | */ 49 | Php::Value GdkMonitor_::get_workarea() 50 | { 51 | // Allocate a GdkRectangle on the stack 52 | GdkRectangle workarea; 53 | 54 | // Fill in the workarea details 55 | gdk_monitor_get_workarea(GDK_MONITOR(instance), &workarea); 56 | 57 | // Create the return array 58 | Php::Value arr; 59 | arr["x"] = workarea.x; 60 | arr["y"] = workarea.y; 61 | arr["width"] = workarea.width; 62 | arr["height"] = workarea.height; 63 | 64 | return arr; 65 | } 66 | -------------------------------------------------------------------------------- /src/Gdk/GdkMonitor.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKMONITOR_H_ 3 | #define _PHPGTK_GDKMONITOR_H_ 4 | 5 | #include 6 | #include 7 | 8 | /** 9 | * GdkMonitor_ 10 | * 11 | * https://developer.gnome.org/gdk3/stable/GdkMonitor.html 12 | */ 13 | class GdkMonitor_ : public Php::Base 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | GdkMonitor *instance; 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GdkMonitor_(); 26 | ~GdkMonitor_(); 27 | 28 | /** 29 | * Return original GdkMonitor 30 | */ 31 | GdkMonitor *get_instance(); 32 | void set_instance(GdkMonitor *monitor); 33 | 34 | Php::Value get_width_mm(); 35 | Php::Value get_height_mm(); 36 | Php::Value get_workarea(); 37 | 38 | 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Gdk/GdkPixbufFormat.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkPixbufFormat.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GdkPixbufFormat_::GdkPixbufFormat_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GdkPixbufFormat_::~GdkPixbufFormat_() = default; 13 | 14 | /** 15 | * Return original GtkWidget 16 | */ 17 | GdkPixbufFormat *GdkPixbufFormat_::get_instance() 18 | { 19 | return instance; 20 | } 21 | 22 | /** 23 | * Set the original GdkPixbufFormat 24 | */ 25 | void GdkPixbufFormat_::set_instance(GdkPixbufFormat *pixbuf_format) 26 | { 27 | instance = pixbuf_format; 28 | 29 | // get self reference as Php::Value object 30 | Php::Value self(this); 31 | 32 | // initialize a public property 33 | self["mime_types"] = gdk_pixbuf_format_get_name(pixbuf_format); 34 | // self["any"] = Php::Object("GdkEventAny", &event->any); 35 | } -------------------------------------------------------------------------------- /src/Gdk/GdkPixbufFormat.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKPIXBUFFORMAT_H_ 3 | #define _PHPGTK_GDKPIXBUFFORMAT_H_ 4 | 5 | #include 6 | #include 7 | 8 | 9 | /** 10 | * GdkPixbufFormat_ 11 | * 12 | * https://developer.gnome.org/gtk3/stable/GdkPixbufFormat.html 13 | */ 14 | class GdkPixbufFormat_ : public Php::Base 15 | { 16 | /** 17 | * Publics 18 | */ 19 | public: 20 | 21 | GdkPixbufFormat *instance; 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GdkPixbufFormat_(); 27 | ~GdkPixbufFormat_(); 28 | 29 | /** 30 | * Return original GtkWidget 31 | */ 32 | GdkPixbufFormat *get_instance(); 33 | 34 | /** 35 | * Set the original GdkPixbufFormat 36 | */ 37 | void set_instance(GdkPixbufFormat *pixbuf_format); 38 | 39 | 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Gdk/GdkRGBA.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkRGBA.h" 3 | 4 | 5 | GdkRGBA_::GdkRGBA_() = default; 6 | GdkRGBA_::~GdkRGBA_() = default; 7 | 8 | // 9 | GdkRGBA GdkRGBA_::get_instance() 10 | { 11 | return instance; 12 | } 13 | 14 | // 15 | void GdkRGBA_::set_instance(GdkRGBA event) 16 | { 17 | instance = event; 18 | } 19 | 20 | Php::Value GdkRGBA_::__get(const Php::Value &name) 21 | { 22 | if (name == "red") return instance.red; 23 | if (name == "green") return instance.green; 24 | if (name == "blue") return instance.blue; 25 | if (name == "alpha") return instance.alpha; 26 | 27 | // property not supported, fall back on default 28 | return Php::Base::__get(name); 29 | } 30 | 31 | 32 | Php::Value GdkRGBA_::parse(Php::Parameters ¶meters) 33 | { 34 | std::string s_spec = parameters[0]; 35 | gchar *spec = (gchar *)s_spec.c_str(); 36 | 37 | GdkRGBA rgba; 38 | 39 | bool ret = gdk_rgba_parse(&rgba, spec); 40 | if(!ret) { 41 | return ret; 42 | } 43 | 44 | GdkRGBA_ *return_parsed = new GdkRGBA_(); 45 | return_parsed->set_instance(rgba); 46 | return Php::Object("GdkRGBA", return_parsed); 47 | } 48 | 49 | Php::Value GdkRGBA_::to_string(Php::Parameters ¶meters) 50 | { 51 | char *ret = gdk_rgba_to_string(&instance); 52 | 53 | return ret; 54 | } -------------------------------------------------------------------------------- /src/Gdk/GdkRGBA.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKRGBA_H_ 3 | #define _PHPGTK_GDKRGBA_H_ 4 | 5 | #include 6 | #include 7 | 8 | /** 9 | * 10 | */ 11 | class GdkRGBA_ : public Php::Base 12 | { 13 | /** 14 | * Publics 15 | */ 16 | public: 17 | /** 18 | * C++ constructor and destructor 19 | */ 20 | GdkRGBA_(); 21 | ~GdkRGBA_(); 22 | 23 | Php::Value __get(const Php::Value &name); 24 | 25 | GdkRGBA instance; 26 | GdkRGBA get_instance(); 27 | void set_instance(GdkRGBA event); 28 | 29 | 30 | static Php::Value parse(Php::Parameters ¶meters); 31 | Php::Value to_string(Php::Parameters ¶meters); 32 | }; 33 | 34 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkScreen.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkScreen.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GdkScreen_::GdkScreen_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GdkScreen_::~GdkScreen_() = default; 13 | 14 | /** 15 | * Return original GtkWidget 16 | */ 17 | GdkScreen *GdkScreen_::get_instance() 18 | { 19 | return instance; 20 | } 21 | 22 | /** 23 | * Set the original GdkScreen 24 | */ 25 | void GdkScreen_::set_instance(GdkScreen *screen) 26 | { 27 | instance = screen; 28 | } 29 | 30 | /** 31 | * https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-rgba-visual 32 | */ 33 | Php::Value GdkScreen_::get_rgba_visual() 34 | { 35 | GdkVisual *returndedValue = gdk_screen_get_rgba_visual(instance); 36 | 37 | GdkVisual_ *returnValue = new GdkVisual_(); 38 | returnValue->set_instance((gpointer *)returndedValue); 39 | 40 | return Php::Object("GdkVisual", returnValue); 41 | } 42 | 43 | /** 44 | * https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-window-stack 45 | */ 46 | Php::Value GdkScreen_::get_window_stack() 47 | { 48 | GList *ret = gdk_screen_get_window_stack(instance); 49 | 50 | Php::Value ret_arr; 51 | 52 | for(int index=0; GList *item=g_list_nth(ret, index); index++) { 53 | 54 | GdkWindow_ *widget_ = new GdkWindow_(); 55 | widget_->set_instance((gpointer *)item->data); 56 | ret_arr[index] = Php::Object("GdkWindow", widget_); 57 | } 58 | 59 | return ret_arr; 60 | } 61 | 62 | Php::Value GdkScreen_::get_default() 63 | { 64 | GdkScreen *ret = gdk_screen_get_default(); 65 | 66 | GdkScreen_ *returnValue = new GdkScreen_(); 67 | returnValue->set_instance(ret); 68 | 69 | return Php::Object("GdkScreen", returnValue); 70 | } -------------------------------------------------------------------------------- /src/Gdk/GdkScreen.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKSCREEN_H_ 3 | #define _PHPGTK_GDKSCREEN_H_ 4 | 5 | #include 6 | #include 7 | 8 | 9 | #include "GdkVisual.h" 10 | #include "GdkWindow.h" 11 | 12 | 13 | /** 14 | * GdkScreen_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GdkScreen.html 17 | */ 18 | class GdkScreen_ : public Php::Base 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | GdkScreen *instance; 26 | 27 | /** 28 | * C++ constructor and destructor 29 | */ 30 | GdkScreen_(); 31 | ~GdkScreen_(); 32 | 33 | /** 34 | * Return original GdkScreen 35 | */ 36 | GdkScreen *get_instance(); 37 | 38 | /** 39 | * Set the original GdkScreen 40 | */ 41 | void set_instance(GdkScreen *screen); 42 | Php::Value get_rgba_visual(); 43 | Php::Value get_window_stack(); 44 | static Php::Value get_default(); 45 | 46 | 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/Gdk/GdkThreads.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GdkThreads.h" 3 | 4 | 5 | void GdkThreads_::add_idle(Php::Parameters ¶meters) 6 | { 7 | throw Php::Exception("gdk_threads_add_idle not implemented yet"); 8 | } -------------------------------------------------------------------------------- /src/Gdk/GdkThreads.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GdkTHREADS_H_ 3 | #define _PHPGTK_GdkTHREADS_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /** 10 | * 11 | */ 12 | class GdkThreads_ : public Php::Base 13 | { 14 | /** 15 | * Publics 16 | */ 17 | public: 18 | 19 | /** 20 | * C++ constructor and destructor 21 | */ 22 | GdkThreads_() = default; 23 | 24 | void add_idle(Php::Parameters ¶meters); 25 | }; 26 | 27 | #endif -------------------------------------------------------------------------------- /src/Gdk/GdkVisual.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKVISUAL_H_ 3 | #define _PHPGTK_GDKVISUAL_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | // #include "GdkScreen.h" 10 | 11 | /** 12 | * GdkVisual_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GdkVisual.html 15 | */ 16 | class GdkVisual_ : public GObject_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | // GdkVisual *instance; 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GdkVisual_(); 29 | ~GdkVisual_(); 30 | 31 | // /** 32 | // * Set and Get the original GdkVisual 33 | // */ 34 | // void set_instance(GdkVisual visual); 35 | // GdkVisual *get_instance(); 36 | 37 | Php::Value get_blue_pixel_details(Php::Parameters ¶meters); 38 | 39 | Php::Value get_green_pixel_details(Php::Parameters ¶meters); 40 | 41 | Php::Value get_red_pixel_details(Php::Parameters ¶meters); 42 | 43 | Php::Value get_depth(); 44 | 45 | Php::Value get_visual_type(); 46 | 47 | Php::Value get_screen(); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Gdk/GdkWindow.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GDKWINDOW_H_ 3 | #define _PHPGTK_GDKWINDOW_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "GdkCursor.h" 10 | 11 | /** 12 | * GdkWindow_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GdkWindow.html 15 | */ 16 | class GdkWindow_ : public GObject_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GdkWindow_(); 27 | ~GdkWindow_(); 28 | 29 | void beep(); 30 | void maximize(); 31 | static Php::Value get_default_root_window(); 32 | Php::Value get_window_type(); 33 | Php::Value get_children(); 34 | Php::Value get_width(); 35 | Php::Value get_height(); 36 | Php::Value get_position(); 37 | void set_cursor(Php::Parameters ¶meters); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Glade/GladeApp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GLADEAPP_H_ 3 | #define _PHPGTK_GLADEAPP_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "../Gtk/GtkWidget.h" 10 | #include "GladeProject.h" 11 | 12 | /** 13 | * GladeApp_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GladeApp.html 16 | */ 17 | class GladeApp_ : public GObject_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GladeApp_(); 28 | ~GladeApp_(); 29 | 30 | void __construct(); 31 | 32 | static Php::Value get(); 33 | 34 | void set_window(); 35 | 36 | Php::Value get_window(); 37 | 38 | Php::Value get_clipboard(); 39 | 40 | void add_project(); 41 | 42 | void remove_project(); 43 | 44 | Php::Value get_projects(); 45 | 46 | Php::Value get_config(); 47 | 48 | Php::Value is_project_loaded(); 49 | 50 | Php::Value get_project_by_path(); 51 | 52 | Php::Value config_save(); 53 | 54 | void set_accel_group(); 55 | 56 | Php::Value get_catalogs_dir(); 57 | 58 | Php::Value get_modules_dir(); 59 | 60 | Php::Value get_pixmaps_dir(); 61 | 62 | Php::Value get_locale_dir(); 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/Glade/GladeDesignView.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GladeDesignView.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GladeDesignView_::GladeDesignView_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GladeDesignView_::~GladeDesignView_() = default; 13 | 14 | void GladeDesignView_::__construct(Php::Parameters ¶meters) 15 | { 16 | 17 | Php::Value object_project = parameters[0]; 18 | GladeProject_ *phpgtk_project = (GladeProject_ *)object_project.implementation(); 19 | GladeProject *project = (GladeProject *)phpgtk_project->get_instance(); 20 | 21 | instance = (gpointer *)glade_design_view_new (project); 22 | 23 | } 24 | 25 | Php::Value GladeDesignView_::get_project() 26 | { 27 | GladeProject *ret = glade_design_view_get_project (GLADE_DESIGN_VIEW(instance)); 28 | 29 | GladeProject_ *project = new GladeProject_(); 30 | project->set_instance((gpointer *)ret); 31 | return Php::Object("GladeProject", project); 32 | } 33 | 34 | Php::Value GladeDesignView_::get_from_project(Php::Parameters ¶meters) 35 | { 36 | Php::Value object_project = parameters[0]; 37 | GladeProject_ *phpgtk_project = (GladeProject_ *)object_project.implementation(); 38 | GladeProject *project = (GladeProject *)phpgtk_project->get_instance(); 39 | 40 | GladeDesignView *ret = glade_design_view_get_from_project (project); 41 | 42 | GladeDesignView_ *project_ret = new GladeDesignView_(); 43 | project_ret->set_instance((gpointer *)ret); 44 | return Php::Object("GladeProject", project_ret); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/Glade/GladeDesignView.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GLADEDESIGNVIEW_H_ 3 | #define _PHPGTK_GLADEDESIGNVIEW_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "../Gtk/GtkBox.h" 11 | #include "../Gtk/GtkWidget.h" 12 | #include "GladeProject.h" 13 | 14 | /** 15 | * GladeDesignView_ 16 | * 17 | * https://developer.gnome.org/gtk3/stable/GladeDesignView.html 18 | */ 19 | class GladeDesignView_ : public GtkBox_ 20 | { 21 | /** 22 | * Publics 23 | */ 24 | public: 25 | 26 | /** 27 | * C++ constructor and destructor 28 | */ 29 | GladeDesignView_(); 30 | ~GladeDesignView_(); 31 | 32 | void __construct(Php::Parameters ¶meters); 33 | 34 | Php::Value get_project(); 35 | 36 | Php::Value get_from_project(Php::Parameters ¶meters); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Glade/GladeEditor.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GladeEditor.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GladeEditor_::GladeEditor_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GladeEditor_::~GladeEditor_() = default; 13 | 14 | void GladeEditor_::__construct() 15 | { 16 | instance = (gpointer *)glade_editor_new (); 17 | 18 | } 19 | 20 | void GladeEditor_::load_widget(Php::Parameters ¶meters) 21 | { 22 | Php::Value object_widget = parameters[0]; 23 | GladeWidget_ *phpgtk_widget = (GladeWidget_ *)object_widget.implementation(); 24 | GladeWidget *widget = (GladeWidget *)phpgtk_widget->get_instance(); 25 | 26 | // Php::call("var_dump", glade_widget_get_name(widget)); 27 | 28 | 29 | glade_editor_load_widget (GLADE_EDITOR(instance), glade_widget_get_from_gobject(widget)); 30 | } 31 | 32 | Php::Value GladeEditor_::query_dialog(Php::Parameters ¶meters) 33 | { 34 | throw Php::Exception("GladeEditor_::query_dialog not implemented"); 35 | // gboolean ret = glade_editor_query_dialog (GLADE_EDITOR(instance), widget); 36 | 37 | // return ret; 38 | return false; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/Glade/GladeEditor.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GLADEEDITOR_H_ 3 | #define _PHPGTK_GLADEEDITOR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "../Gtk/GtkBox.h" 11 | #include "../Gtk/GtkWidget.h" 12 | #include "GladeProject.h" 13 | #include "GladeWidget.h" 14 | 15 | /** 16 | * GladeEditor_ 17 | * 18 | * https://developer.gnome.org/gtk3/stable/GladeEditor.html 19 | */ 20 | class GladeEditor_ : public GtkBox_ 21 | { 22 | /** 23 | * Publics 24 | */ 25 | public: 26 | 27 | /** 28 | * C++ constructor and destructor 29 | */ 30 | GladeEditor_(); 31 | ~GladeEditor_(); 32 | 33 | void __construct(); 34 | 35 | void load_widget(Php::Parameters ¶meters); 36 | 37 | Php::Value query_dialog(Php::Parameters ¶meters); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Glade/GladePalette.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GladePalette.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GladePalette_::GladePalette_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GladePalette_::~GladePalette_() = default; 13 | 14 | void GladePalette_::__construct() 15 | { 16 | instance = (gpointer *)glade_palette_new (); 17 | 18 | } 19 | 20 | Php::Value GladePalette_::get_item_appearance() 21 | { 22 | throw Php::Exception("GladePalette_::get_item_appearance not implemented"); 23 | 24 | // GladeItemAppearance ret = glade_palette_get_item_appearance (GLADE_PALETTE(instance)); 25 | 26 | // return ret; 27 | return 1; 28 | } 29 | 30 | void GladePalette_::set_item_appearance(Php::Parameters ¶meters) 31 | { 32 | throw Php::Exception("GladePalette_::set_item_appearance not implemented"); 33 | 34 | // int int_item_appearence = (int)parameters[0]; 35 | // GladeItemAppearance item_appearence = (GladeItemAppearance)int_item_appearence; 36 | 37 | // glade_palette_set_item_appearance (GLADE_PALETTE(instance), item_appearence); 38 | 39 | } 40 | 41 | Php::Value GladePalette_::get_use_small_item_icons() 42 | { 43 | bool ret = glade_palette_get_use_small_item_icons (GLADE_PALETTE(instance)); 44 | 45 | return ret; 46 | } 47 | 48 | void GladePalette_::set_use_small_item_icons(Php::Parameters ¶meters) 49 | { 50 | gboolean use_small_item_icons = (gboolean)parameters[0]; 51 | 52 | glade_palette_set_use_small_item_icons (GLADE_PALETTE(instance), use_small_item_icons); 53 | 54 | } 55 | 56 | Php::Value GladePalette_::get_show_selector_button() 57 | { 58 | bool ret = glade_palette_get_show_selector_button (GLADE_PALETTE(instance)); 59 | 60 | return ret; 61 | } 62 | 63 | void GladePalette_::set_show_selector_button(Php::Parameters ¶meters) 64 | { 65 | gboolean show_selector_button = (gboolean)parameters[0]; 66 | 67 | glade_palette_set_show_selector_button (GLADE_PALETTE(instance), show_selector_button); 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/Glade/GladePalette.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GLADEPALETTE_H_ 3 | #define _PHPGTK_GLADEPALETTE_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "../Gtk/GtkBox.h" 11 | #include "../Gtk/GtkWidget.h" 12 | 13 | /** 14 | * GladePalette_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GladePalette.html 17 | */ 18 | class GladePalette_ : public GtkBox_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GladePalette_(); 29 | ~GladePalette_(); 30 | 31 | void __construct(); 32 | 33 | Php::Value get_item_appearance(); 34 | 35 | void set_item_appearance(Php::Parameters ¶meters); 36 | 37 | Php::Value get_use_small_item_icons(); 38 | 39 | void set_use_small_item_icons(Php::Parameters ¶meters); 40 | 41 | Php::Value get_show_selector_button(); 42 | 43 | void set_show_selector_button(Php::Parameters ¶meters); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Glade/GladeProject.cpp: -------------------------------------------------------------------------------- 1 | #include "GladeProject.h" 2 | 3 | // void GladeProject_::set_project(GladeProject *passed_project) 4 | // { 5 | // project = passed_project; 6 | // } 7 | // GladeProject *GladeProject_::get_project() 8 | // { 9 | // return project; 10 | // } 11 | 12 | /** 13 | * Constructor 14 | */ 15 | GladeProject_::GladeProject_() = default; 16 | 17 | /** 18 | * Destructor 19 | */ 20 | GladeProject_::~GladeProject_() = default; 21 | 22 | void GladeProject_::__construct() 23 | { 24 | instance = (gpointer *)glade_project_new(); 25 | } 26 | 27 | Php::Value GladeProject_::selection_get() 28 | { 29 | GList *ret = glade_project_selection_get(GLADE_PROJECT(instance)); 30 | 31 | Php::Value ret_arr; 32 | 33 | for(int index=0; GList *item=g_list_nth(ret, index); index++) { 34 | 35 | GladeWidget_ *widget_ = new GladeWidget_(); 36 | widget_->set_instance((gpointer *)item->data); 37 | ret_arr[index] = Php::Object("GladeWidget", widget_); 38 | } 39 | 40 | return ret_arr; 41 | } 42 | -------------------------------------------------------------------------------- /src/Glade/GladeProject.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GLADEPROJECT_H_ 3 | #define _PHPGTK_GLADEPROJECT_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "../G/GObject.h" 11 | #include "../Gtk/GtkWidget.h" 12 | #include "GladeProject.h" 13 | #include "GladeWidget.h" 14 | 15 | /** 16 | * GladeProject_ 17 | * 18 | * https://developer.gnome.org/gtk3/stable/GladeProject.html 19 | */ 20 | class GladeProject_ : public GObject_ 21 | { 22 | /** 23 | * Publics 24 | */ 25 | public: 26 | 27 | // GladeProject *project; 28 | 29 | // void set_project(GladeProject *passed_project); 30 | // GladeProject *get_project(); 31 | 32 | /** 33 | * C++ constructor and destructor 34 | */ 35 | GladeProject_(); 36 | ~GladeProject_(); 37 | 38 | void __construct(); 39 | 40 | Php::Value selection_get(); 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Glade/GladeWidget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GladeWidget.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GladeWidget_::GladeWidget_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GladeWidget_::~GladeWidget_() = default; 13 | 14 | void GladeWidget_::__construct() 15 | { 16 | 17 | } -------------------------------------------------------------------------------- /src/Glade/GladeWidget.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GLADEWIDGET_H_ 3 | #define _PHPGTK_GLADEWIDGET_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "../Gtk/GtkBox.h" 11 | #include "../Gtk/GtkWidget.h" 12 | #include "GladeProject.h" 13 | 14 | /** 15 | * GladeWidget_ 16 | * 17 | * https://developer.gnome.org/gtk3/stable/GladeWidget.html 18 | */ 19 | class GladeWidget_ : public GObject_ 20 | { 21 | /** 22 | * Publics 23 | */ 24 | public: 25 | 26 | /** 27 | * C++ constructor and destructor 28 | */ 29 | GladeWidget_(); 30 | ~GladeWidget_(); 31 | 32 | void __construct(); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Gtk/Gtk.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTK_H_ 3 | #define _PHPGTK_GTK_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /** 10 | * Dependency: 11 | * show_uri_on_window 12 | */ 13 | #include "GtkWindow.h" 14 | 15 | /** 16 | * 17 | */ 18 | class Gtk_ : public Php::Base 19 | { 20 | /** 21 | * Privates 22 | */ 23 | private: 24 | /** 25 | * 26 | */ 27 | GtkWidget *widget; 28 | 29 | struct st_timeout_add; 30 | 31 | /** 32 | * Publics 33 | */ 34 | public: 35 | /** 36 | * C++ constructor/destructor 37 | */ 38 | Gtk_(); 39 | 40 | /** 41 | * Gtk loop 42 | * https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-main 43 | */ 44 | static void main(); 45 | 46 | /** 47 | * Gtk main quit 48 | * https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-main-quit 49 | */ 50 | static void main_quit(); 51 | 52 | static Php::Value timeout_add(Php::Parameters ¶meters); 53 | static Php::Value source_remove(Php::Parameters ¶meters); 54 | static Php::Value is_destroyed(Php::Parameters ¶meters); 55 | static Php::Value show_uri_on_window(Php::Parameters ¶meters); 56 | static gint timeout_add_callback(gpointer data); 57 | 58 | static Php::Value events_pending(); 59 | static Php::Value main_do_event(Php::Parameters& parameters); 60 | static Php::Value main_iteration(); 61 | static Php::Value get_major_version(); 62 | static Php::Value get_micro_version(); 63 | static Php::Value get_minor_version(); 64 | static void init(); 65 | 66 | }; 67 | 68 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkActionBar.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkActionBar.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkActionBar_::GtkActionBar_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkActionBar_::~GtkActionBar_() = default; 13 | 14 | void GtkActionBar_::__construct() 15 | { 16 | instance = (gpointer *)gtk_action_bar_new (); 17 | 18 | } 19 | 20 | void GtkActionBar_::pack_start(Php::Parameters ¶meters) 21 | { 22 | GtkWidget *child; 23 | if(parameters.size() > 0) { 24 | Php::Value object_child = parameters[0]; 25 | GtkWidget_ *phpgtk_child = (GtkWidget_ *)object_child.implementation(); 26 | child = GTK_WIDGET(phpgtk_child->get_instance()); 27 | } 28 | 29 | gtk_action_bar_pack_start (GTK_ACTION_BAR(instance), child); 30 | 31 | } 32 | 33 | void GtkActionBar_::pack_end(Php::Parameters ¶meters) 34 | { 35 | GtkWidget *child; 36 | if(parameters.size() > 0) { 37 | Php::Value object_child = parameters[0]; 38 | GtkWidget_ *phpgtk_child = (GtkWidget_ *)object_child.implementation(); 39 | child = GTK_WIDGET(phpgtk_child->get_instance()); 40 | } 41 | 42 | gtk_action_bar_pack_end (GTK_ACTION_BAR(instance), child); 43 | 44 | } 45 | 46 | Php::Value GtkActionBar_::get_center_widget() 47 | { 48 | gpointer *ret = (gpointer *)gtk_action_bar_get_center_widget (GTK_ACTION_BAR(instance)); 49 | 50 | // GtkWidget_ *return_parsed = new GtkWidget_(); 51 | // return_parsed->set_instance((gpointer *)ret); 52 | // return Php::Object("GtkWidget", return_parsed); 53 | 54 | return cobject_to_phpobject(ret); 55 | } 56 | 57 | void GtkActionBar_::set_center_widget(Php::Parameters ¶meters) 58 | { 59 | GtkWidget *center_widget; 60 | if(parameters.size() > 0) { 61 | Php::Value object_center_widget = parameters[0]; 62 | GtkWidget_ *phpgtk_center_widget = (GtkWidget_ *)object_center_widget.implementation(); 63 | center_widget = GTK_WIDGET(phpgtk_center_widget->get_instance()); 64 | } 65 | 66 | gtk_action_bar_set_center_widget (GTK_ACTION_BAR(instance), center_widget); 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/Gtk/GtkActionBar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKACTIONBAR_H_ 3 | #define _PHPGTK_GTKACTIONBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkActionBar_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkActionBar.html 17 | */ 18 | class GtkActionBar_ : public GtkBin_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkActionBar_(); 29 | ~GtkActionBar_(); 30 | 31 | void __construct(); 32 | 33 | void pack_start(Php::Parameters ¶meters); 34 | 35 | void pack_end(Php::Parameters ¶meters); 36 | 37 | Php::Value get_center_widget(); 38 | 39 | void set_center_widget(Php::Parameters ¶meters); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Gtk/GtkAdjustment.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkAdjustment.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkAdjustment_::GtkAdjustment_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkAdjustment_::~GtkAdjustment_() = default; 13 | 14 | /** 15 | * PHP Constructor 16 | */ 17 | void GtkAdjustment_::__construct(Php::Parameters ¶meters) 18 | { 19 | // Verify if has value parameter 20 | double value = false; 21 | if(parameters.size() >= 3) { 22 | value = parameters[2]; 23 | } 24 | 25 | // Verify if has lower parameter 26 | double lower = false; 27 | if(parameters.size() >= 3) { 28 | lower = parameters[2]; 29 | } 30 | 31 | // Verify if has upper parameter 32 | double upper = false; 33 | if(parameters.size() >= 3) { 34 | upper = parameters[2]; 35 | } 36 | 37 | // Verify if has step_increment parameter 38 | double step_increment = false; 39 | if(parameters.size() >= 3) { 40 | step_increment = parameters[2]; 41 | } 42 | 43 | // Verify if has page_increment parameter 44 | double page_increment = false; 45 | if(parameters.size() >= 3) { 46 | page_increment = parameters[2]; 47 | } 48 | 49 | // Verify if has page_size parameter 50 | double page_size = false; 51 | if(parameters.size() >= 3) { 52 | page_size = parameters[2]; 53 | } 54 | 55 | instance = (gpointer *)gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size); 56 | } 57 | 58 | 59 | Php::Value GtkAdjustment_::get_value() 60 | { 61 | return gtk_adjustment_get_value(GTK_ADJUSTMENT(instance)); 62 | } 63 | 64 | void GtkAdjustment_::set_value(Php::Parameters& parameters) 65 | { 66 | double value = 0; 67 | value = (double)parameters[0]; 68 | gtk_adjustment_set_value(GTK_ADJUSTMENT(instance), value); 69 | } -------------------------------------------------------------------------------- /src/Gtk/GtkAdjustment.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKADJUSTMENT_H_ 3 | #define _PHPGTK_GTKADJUSTMENT_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | /** 11 | * GtkAdjustment_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkAdjustment.html 14 | */ 15 | class GtkAdjustment_ : public GObject_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkAdjustment_(); 26 | ~GtkAdjustment_(); 27 | 28 | /** 29 | * PHP Construct 30 | */ 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | void set_value(Php::Parameters& parameters); 34 | 35 | Php::Value get_value(); 36 | }; 37 | 38 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkAlignment.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "GtkAlignment.h" 4 | 5 | GtkAlignment_::GtkAlignment_() = default; 6 | GtkAlignment_::~GtkAlignment_() = default; 7 | 8 | void GtkAlignment_::set(Php::Parameters ¶meters) 9 | { 10 | double d_xalign = parameters[0]; 11 | 12 | gfloat xalign = (float)d_xalign; 13 | 14 | double d_yalign = parameters[1]; 15 | 16 | gfloat yalign = (float)d_yalign; 17 | 18 | double d_xscale = parameters[2]; 19 | 20 | gfloat xscale = (float)d_xscale; 21 | 22 | double d_yscale = parameters[3]; 23 | 24 | gfloat yscale = (float)d_yscale; 25 | 26 | gtk_alignment_set(GTK_ALIGNMENT(instance), xalign, yalign, xscale, yscale); 27 | } 28 | 29 | void GtkAlignment_::set_padding(Php::Parameters ¶meters) 30 | { 31 | guint padding_top = (int)parameters[0]; 32 | 33 | guint padding_bottom = (int)parameters[1]; 34 | 35 | guint padding_left = (int)parameters[2]; 36 | 37 | guint padding_right = (int)parameters[3]; 38 | 39 | gtk_alignment_set_padding(GTK_ALIGNMENT(instance), padding_top, padding_bottom, padding_left, padding_right); 40 | } 41 | 42 | Php::Value GtkAlignment_::get_padding() 43 | { 44 | guint* top; 45 | guint* bottom; 46 | guint* left; 47 | guint* right; 48 | 49 | gtk_alignment_get_padding(GTK_ALIGNMENT(instance), top, bottom, left, right); 50 | 51 | Php::Value arr; 52 | arr["top"] = top; 53 | arr["bottom"] = bottom; 54 | arr["left"] = left; 55 | arr["right"] = right; 56 | 57 | return arr; 58 | 59 | } 60 | 61 | void GtkAlignment_::__construct(Php::Parameters ¶meters) 62 | { 63 | double d_xalign = parameters[0]; 64 | 65 | gfloat xalign = (float)d_xalign; 66 | 67 | double d_yalign = parameters[1]; 68 | 69 | gfloat yalign = (float)d_yalign; 70 | 71 | double d_xscale = parameters[2]; 72 | 73 | gfloat xscale = (float)d_xscale; 74 | 75 | double d_yscale = parameters[3]; 76 | 77 | gfloat yscale = (float)d_yscale; 78 | 79 | instance = (gpointer *)gtk_alignment_new(xalign, yalign, xscale, yscale); 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/Gtk/GtkAlignment.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _PHPGTK_GTKALIGNMENT_H_ 4 | #define _PHPGTK_GTKALIGNMENT_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "GtkBin.h" 10 | 11 | class GtkAlignment_ : public GtkBin_ 12 | { 13 | public: 14 | GtkAlignment_(); 15 | ~GtkAlignment_(); 16 | 17 | void set(Php::Parameters ¶meters); 18 | void set_padding(Php::Parameters ¶meters); 19 | Php::Value get_padding(); 20 | void __construct(Php::Parameters ¶meters); 21 | 22 | }; 23 | 24 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkAppChooserButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKAPPCHOOSERBUTTON_H_ 3 | #define _PHPGTK_GTKAPPCHOOSERBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkComboBox.h" 9 | 10 | /** 11 | * GtkAppChooserButton_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkAppChooserButton.html 14 | */ 15 | class GtkAppChooserButton_ : public GtkComboBox_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkAppChooserButton_(); 26 | ~GtkAppChooserButton_(); 27 | 28 | void __construct(Php::Parameters ¶meters); 29 | 30 | void append_custom_item(Php::Parameters ¶meters); 31 | 32 | void append_separator(); 33 | 34 | void set_active_custom_item(Php::Parameters ¶meters); 35 | 36 | Php::Value get_show_default_item(); 37 | 38 | void set_show_default_item(Php::Parameters ¶meters); 39 | 40 | Php::Value get_show_dialog_item(); 41 | 42 | void set_show_dialog_item(Php::Parameters ¶meters); 43 | 44 | Php::Value get_heading(); 45 | 46 | void set_heading(Php::Parameters ¶meters); 47 | 48 | Php::Value get_app_info(); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Gtk/GtkAppChooserDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKAPPCHOOSERDIALOG_H_ 3 | #define _PHPGTK_GTKAPPCHOOSERDIALOG_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkDialog.h" 9 | #include "GtkWindow.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkAppChooserDialog_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkAppChooserDialog.html 17 | */ 18 | class GtkAppChooserDialog_ : public GtkDialog_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkAppChooserDialog_(); 29 | ~GtkAppChooserDialog_(); 30 | 31 | void __construc(Php::Parameters ¶meters); 32 | 33 | static Php::Value new_for_content_type(Php::Parameters ¶meters); 34 | 35 | Php::Value get_widget(); 36 | 37 | void set_heading(Php::Parameters ¶meters); 38 | 39 | Php::Value get_heading(); 40 | 41 | Php::Value get_app_info(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Gtk/GtkApplicationWindow.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "GtkApplicationWindow.h" 4 | 5 | GtkApplicationWindow_::GtkApplicationWindow_() = default; 6 | GtkApplicationWindow_::~GtkApplicationWindow_() = default; 7 | 8 | void GtkApplicationWindow_::set_show_menubar(Php::Parameters ¶meters) 9 | { 10 | gboolean show_menubar = (gboolean)parameters[0]; 11 | 12 | gtk_application_window_set_show_menubar(GTK_APPLICATION_WINDOW(instance), show_menubar); 13 | } 14 | 15 | Php::Value GtkApplicationWindow_::get_show_menubar() 16 | { 17 | bool ret = gtk_application_window_get_show_menubar(GTK_APPLICATION_WINDOW(instance)); 18 | 19 | return ret; 20 | } -------------------------------------------------------------------------------- /src/Gtk/GtkApplicationWindow.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _PHPGTK_GTKAPPLICATIONWINDOW_H_ 4 | #define _PHPGTK_GTKAPPLICATIONWINDOW_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "GtkWindow.h" 10 | #include "../../php-gtk.h" 11 | 12 | 13 | 14 | class GtkApplicationWindow_ : public GtkWindow_ 15 | { 16 | public: 17 | GtkApplicationWindow_(); 18 | ~GtkApplicationWindow_(); 19 | 20 | void set_show_menubar(Php::Parameters ¶meters); 21 | Php::Value get_show_menubar(); 22 | 23 | 24 | }; 25 | 26 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkAspectFrame.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkAspectFrame.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkAspectFrame_::GtkAspectFrame_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkAspectFrame_::~GtkAspectFrame_() = default; 13 | 14 | void GtkAspectFrame_::__construct(Php::Parameters ¶meters) 15 | { 16 | std::string s_label = parameters[0]; 17 | gchar *label = (gchar *)s_label.c_str(); 18 | 19 | double d_xalign = parameters[1]; 20 | gfloat xalign = (float)d_xalign; 21 | 22 | double d_yalign = parameters[2]; 23 | gfloat yalign = (float)d_yalign; 24 | 25 | double d_ratio = parameters[3]; 26 | gfloat ratio = (float)d_ratio; 27 | 28 | gboolean obey_child = (gboolean)parameters[4]; 29 | 30 | instance = (gpointer *)gtk_aspect_frame_new (label, xalign, yalign, ratio, obey_child); 31 | 32 | } 33 | 34 | void GtkAspectFrame_::set(Php::Parameters ¶meters) 35 | { 36 | double d_xalign = parameters[0]; 37 | gfloat xalign = (float)d_xalign; 38 | 39 | double d_yalign = parameters[1]; 40 | gfloat yalign = (float)d_yalign; 41 | 42 | double d_ratio = parameters[2]; 43 | gfloat ratio = (float)d_ratio; 44 | 45 | gboolean obey_child = (gboolean)parameters[3]; 46 | 47 | gtk_aspect_frame_set (GTK_ASPECT_FRAME(instance), xalign, yalign, ratio, obey_child); 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/Gtk/GtkAspectFrame.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKASPECTFRAME_H_ 3 | #define _PHPGTK_GTKASPECTFRAME_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkFrame.h" 9 | 10 | /** 11 | * GtkAspectFrame_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkAspectFrame.html 14 | */ 15 | class GtkAspectFrame_ : public GtkFrame_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkAspectFrame_(); 26 | ~GtkAspectFrame_(); 27 | 28 | void __construct(Php::Parameters ¶meters); 29 | 30 | void set(Php::Parameters ¶meters); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/Gtk/GtkBin.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkBin.h" 3 | 4 | GtkBin_::GtkBin_() = default; 5 | GtkBin_::~GtkBin_() = default; 6 | 7 | Php::Value GtkBin_::get_child() 8 | { 9 | gpointer *ret = (gpointer *)gtk_bin_get_child(GTK_BIN(instance)); 10 | 11 | return cobject_to_phpobject(ret); 12 | } -------------------------------------------------------------------------------- /src/Gtk/GtkBin.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKBIN_H_ 3 | #define _PHPGTK_GTKBIN_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | 10 | /** 11 | * 12 | */ 13 | class GtkBin_ : public GtkContainer_ 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | /** 21 | * C++ constructor and destructor 22 | */ 23 | GtkBin_(); 24 | virtual ~GtkBin_(); 25 | 26 | void test3(); 27 | 28 | Php::Value get_child(); 29 | }; 30 | 31 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkBox.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKBOX_H_ 3 | #define _PHPGTK_GTKBOX_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../../php-gtk.h" 9 | 10 | #include "GtkContainer.h" 11 | #include "GtkWidget.h" 12 | 13 | /** 14 | * GtkBox_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkBox.html 17 | */ 18 | class GtkBox_ : public GtkContainer_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkBox_(); 29 | ~GtkBox_(); 30 | 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | void pack_start(Php::Parameters ¶meters); 34 | 35 | void pack_end(Php::Parameters ¶meters); 36 | 37 | Php::Value get_homogeneous(); 38 | 39 | void set_homogeneous(Php::Parameters ¶meters); 40 | 41 | Php::Value get_spacing(); 42 | 43 | void set_spacing(Php::Parameters ¶meters); 44 | 45 | void reorder_child(Php::Parameters ¶meters); 46 | 47 | Php::Value query_child_packing(Php::Parameters ¶meters); 48 | 49 | void set_child_packing(Php::Parameters ¶meters); 50 | 51 | Php::Value get_baseline_position(); 52 | 53 | void set_baseline_position(Php::Parameters ¶meters); 54 | 55 | Php::Value get_center_widget(); 56 | 57 | void set_center_widget(Php::Parameters ¶meters); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Gtk/GtkButtonBox.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKBUTTONBOX_H_ 3 | #define _PHPGTK_GTKBUTTONBOX_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBox.h" 9 | #include "GtkBox.h" 10 | 11 | /** 12 | * GtkButtonBox_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkButtonBox.html 15 | */ 16 | class GtkButtonBox_ : public GtkBox_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkButtonBox_(); 27 | ~GtkButtonBox_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | 31 | Php::Value get_layout(); 32 | 33 | Php::Value get_child_secondary(Php::Parameters ¶meters); 34 | 35 | Php::Value get_child_non_homogeneous(Php::Parameters ¶meters); 36 | 37 | void set_layout(Php::Parameters ¶meters); 38 | 39 | void set_child_secondary(Php::Parameters ¶meters); 40 | 41 | void set_child_non_homogeneous(Php::Parameters ¶meters); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Gtk/GtkCalendar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCALENDAR_H_ 3 | #define _PHPGTK_GTKCALENDAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkWidget.h" 9 | 10 | /** 11 | * GtkCalendar_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCalendar.html 14 | */ 15 | class GtkCalendar_ : public GtkWidget_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCalendar_(); 26 | ~GtkCalendar_(); 27 | 28 | void __construct(); 29 | 30 | void select_month(Php::Parameters ¶meters); 31 | 32 | void select_day(Php::Parameters ¶meters); 33 | 34 | void mark_day(Php::Parameters ¶meters); 35 | 36 | void unmark_day(Php::Parameters ¶meters); 37 | 38 | Php::Value get_day_is_marked(Php::Parameters ¶meters); 39 | 40 | void clear_marks(); 41 | 42 | Php::Value get_display_options(); 43 | 44 | void set_display_options(Php::Parameters ¶meters); 45 | 46 | Php::Value get_date(Php::Parameters ¶meters); 47 | 48 | void set_detail_func(Php::Parameters ¶meters); 49 | 50 | Php::Value get_detail_width_chars(); 51 | 52 | void set_detail_width_chars(Php::Parameters ¶meters); 53 | 54 | Php::Value get_detail_height_rows(); 55 | 56 | void set_detail_height_rows(Php::Parameters ¶meters); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/Gtk/GtkCellRenderer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkCellRenderer.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkCellRenderer_::GtkCellRenderer_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkCellRenderer_::~GtkCellRenderer_() = default; 13 | 14 | /** 15 | * PHP Constructor 16 | */ 17 | void GtkCellRenderer_::__construct(Php::Parameters ¶meters) 18 | { 19 | } 20 | 21 | /** 22 | * Sets the renderer’s alignment within its available space. 23 | */ 24 | void GtkCellRenderer_::set_alignment(Php::Parameters ¶meters) 25 | { 26 | double xalign = parameters[0]; 27 | double yalign = parameters[1]; 28 | gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(instance), xalign, yalign); 29 | } 30 | 31 | /** 32 | * Fills in xalign and yalign with the appropriate values of cell . 33 | */ 34 | Php::Value GtkCellRenderer_::get_alignment() 35 | { 36 | float xalign = 0; 37 | float yalign = 0; 38 | 39 | gtk_cell_renderer_get_alignment(GTK_CELL_RENDERER(instance), &xalign, &yalign); 40 | 41 | // Cria o retorno 42 | Php::Value arr; 43 | arr["xalign"] = xalign; 44 | arr["yalign"] = yalign; 45 | 46 | return arr; 47 | } -------------------------------------------------------------------------------- /src/Gtk/GtkCellRenderer.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCELLRENDERER_H_ 3 | #define _PHPGTK_GTKCELLRENDERER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | /** 11 | * GtkCellRenderer_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCellRenderer.html 14 | */ 15 | class GtkCellRenderer_ : public GObject_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCellRenderer_(); 26 | ~GtkCellRenderer_(); 27 | 28 | /** 29 | * PHP Construct 30 | */ 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | /** 34 | * Sets the renderer’s alignment within its available space. 35 | * 36 | * https://developer.gnome.org/gtk3/stable/GtkCellRenderer.html#gtk-cell-renderer-set-alignment 37 | */ 38 | void set_alignment(Php::Parameters ¶meters); 39 | 40 | /** 41 | * Fills in xalign and yalign with the appropriate values of cell. 42 | * 43 | * https://developer.gnome.org/gtk3/stable/GtkCellRenderer.html#gtk-cell-renderer-get-alignment 44 | */ 45 | Php::Value get_alignment(); 46 | }; 47 | 48 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererCombo.cpp: -------------------------------------------------------------------------------- 1 | #include "GtkCellRendererCombo.h" 2 | 3 | GtkCellRendererCombo_::GtkCellRendererCombo_() = default; 4 | GtkCellRendererCombo_::~GtkCellRendererCombo_() = default; 5 | 6 | 7 | void GtkCellRendererCombo_::__construct() 8 | { 9 | 10 | instance = (gpointer *)gtk_cell_renderer_combo_new(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererCombo.h: -------------------------------------------------------------------------------- 1 | #ifndef _PHPGTK_GTKCELLRENDERERCOMBO_H_ 2 | #define _PHPGTK_GTKCELLRENDERERCOMBO_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "GtkCellRendererText.h" 8 | 9 | 10 | class GtkCellRendererCombo_ : public GtkCellRendererText_ 11 | { 12 | public: 13 | GtkCellRendererCombo_(); 14 | ~GtkCellRendererCombo_(); 15 | 16 | void __construct(); 17 | 18 | }; 19 | 20 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererPixbuf.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkCellRendererPixbuf.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkCellRendererPixbuf_::GtkCellRendererPixbuf_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkCellRendererPixbuf_::~GtkCellRendererPixbuf_() = default; 13 | 14 | void GtkCellRendererPixbuf_::__construct() 15 | { 16 | instance = (gpointer *)gtk_cell_renderer_pixbuf_new (); 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererPixbuf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCELLRENDERERPIXBUF_H_ 3 | #define _PHPGTK_GTKCELLRENDERERPIXBUF_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkCellRenderer.h" 9 | 10 | /** 11 | * GtkCellRendererPixbuf_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCellRendererPixbuf.html 14 | */ 15 | class GtkCellRendererPixbuf_ : public GtkCellRenderer_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCellRendererPixbuf_(); 26 | ~GtkCellRendererPixbuf_(); 27 | 28 | void __construct(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererText.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkCellRendererText.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkCellRendererText_::GtkCellRendererText_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkCellRendererText_::~GtkCellRendererText_() = default; 13 | 14 | /** 15 | * PHP Constructor 16 | */ 17 | void GtkCellRendererText_::__construct(Php::Parameters ¶meters) 18 | { 19 | instance = (gpointer *)gtk_cell_renderer_text_new(); 20 | } 21 | 22 | /** 23 | * If radio is TRUE, the cell renderer renders a radio toggle 24 | */ 25 | void GtkCellRendererText_::set_fixed_height_from_font(Php::Parameters ¶meters) 26 | { 27 | gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(instance), parameters[0]); 28 | } -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererText.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCELLRENDERERTEXT_H_ 3 | #define _PHPGTK_GTKCELLRENDERERTEXT_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkCellRenderer.h" 9 | 10 | /** 11 | * GtkCellRendererText_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCellRendererText.html 14 | */ 15 | class GtkCellRendererText_ : public GtkCellRenderer_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCellRendererText_(); 26 | ~GtkCellRendererText_(); 27 | 28 | /** 29 | * PHP Construct 30 | */ 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | /** 34 | * Sets the height of a renderer to explicitly be determined by the “font” and “y_pad” property set on it. 35 | * 36 | * https://developer.gnome.org/gtk3/stable/GtkCellRendererText.html#gtk-cell-renderer-text-set-fixed-height-from-font 37 | */ 38 | void set_fixed_height_from_font(Php::Parameters ¶meters); 39 | }; 40 | 41 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkCellRendererToggle.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkCellRendererToggle.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkCellRendererToggle_::GtkCellRendererToggle_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkCellRendererToggle_::~GtkCellRendererToggle_() = default; 13 | 14 | /** 15 | * PHP Constructor 16 | */ 17 | void GtkCellRendererToggle_::__construct(Php::Parameters ¶meters) 18 | { 19 | instance = (gpointer *)gtk_cell_renderer_toggle_new(); 20 | } 21 | 22 | /** 23 | * Activates or deactivates a cell renderer. 24 | */ 25 | void GtkCellRendererToggle_::set_activatable(Php::Parameters ¶meters) 26 | { 27 | gtk_cell_renderer_toggle_set_activatable(GTK_CELL_RENDERER_TOGGLE(instance), parameters[0]); 28 | } 29 | 30 | /** 31 | * Returns whether the cell renderer is active 32 | */ 33 | Php::Value GtkCellRendererToggle_::get_activatable() 34 | { 35 | // 36 | return gtk_cell_renderer_toggle_get_activatable(GTK_CELL_RENDERER_TOGGLE(instance)); 37 | } 38 | 39 | /** 40 | * If radio is TRUE, the cell renderer renders a radio toggle 41 | */ 42 | void GtkCellRendererToggle_::set_radio(Php::Parameters ¶meters) 43 | { 44 | gtk_cell_renderer_toggle_set_radio(GTK_CELL_RENDERER_TOGGLE(instance), parameters[0]); 45 | } 46 | 47 | /** 48 | * Returns whether we’re rendering radio toggles rather than checkboxes. 49 | */ 50 | Php::Value GtkCellRendererToggle_::get_radio() 51 | { 52 | // 53 | return gtk_cell_renderer_toggle_get_radio(GTK_CELL_RENDERER_TOGGLE(instance)); 54 | } 55 | 56 | /** 57 | * Activates or deactivates a cell renderer. 58 | */ 59 | void GtkCellRendererToggle_::set_active(Php::Parameters ¶meters) 60 | { 61 | gtk_cell_renderer_toggle_set_active(GTK_CELL_RENDERER_TOGGLE(instance), parameters[0]); 62 | } 63 | 64 | /** 65 | * Returns whether the cell renderer is active. 66 | */ 67 | Php::Value GtkCellRendererToggle_::get_active() 68 | { 69 | // 70 | return gtk_cell_renderer_toggle_get_active(GTK_CELL_RENDERER_TOGGLE(instance)); 71 | } -------------------------------------------------------------------------------- /src/Gtk/GtkCheckButton.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkCheckButton.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkCheckButton_::GtkCheckButton_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkCheckButton_::~GtkCheckButton_() = default; 13 | 14 | void GtkCheckButton_::__construct() 15 | { 16 | instance = (gpointer *)gtk_check_button_new (); 17 | 18 | } 19 | 20 | Php::Value GtkCheckButton_::new_with_label(Php::Parameters ¶meters) 21 | { 22 | std::string s_label = parameters[0]; 23 | gchar *label = (gchar *)s_label.c_str(); 24 | 25 | GtkWidget *ret = gtk_check_button_new_with_label (label); 26 | 27 | GtkCheckButton_ *return_parsed = new GtkCheckButton_(); 28 | return_parsed->set_instance((gpointer *)ret); 29 | return Php::Object("GtkCheckButton", return_parsed); 30 | } 31 | 32 | Php::Value GtkCheckButton_::new_with_mnemonic(Php::Parameters ¶meters) 33 | { 34 | std::string s_label = parameters[0]; 35 | gchar *label = (gchar *)s_label.c_str(); 36 | 37 | GtkWidget *ret = gtk_check_button_new_with_mnemonic (label); 38 | 39 | GtkCheckButton_ *return_parsed = new GtkCheckButton_(); 40 | return_parsed->set_instance((gpointer *)ret); 41 | return Php::Object("GtkCheckButton", return_parsed); 42 | } 43 | 44 | Php::Value GtkCheckButton_::get_active() 45 | { 46 | bool ret = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(instance)); 47 | 48 | return ret; 49 | } 50 | 51 | void GtkCheckButton_::set_active(Php::Parameters& parameters) 52 | { 53 | gboolean is_active = (gboolean)parameters[0]; 54 | 55 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(instance), is_active); 56 | 57 | } 58 | 59 | void GtkCheckButton_::toggled() 60 | { 61 | gtk_toggle_button_toggled(GTK_TOGGLE_BUTTON(instance)); 62 | 63 | } -------------------------------------------------------------------------------- /src/Gtk/GtkCheckButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCHECKBUTTON_H_ 3 | #define _PHPGTK_GTKCHECKBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkToggleButton.h" 9 | 10 | /** 11 | * GtkCheckButton_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCheckButton.html 14 | */ 15 | class GtkCheckButton_ : public GtkToggleButton_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCheckButton_(); 26 | ~GtkCheckButton_(); 27 | 28 | void __construct(); 29 | 30 | static Php::Value new_with_label(Php::Parameters ¶meters); 31 | 32 | static Php::Value new_with_mnemonic(Php::Parameters ¶meters); 33 | 34 | Php::Value get_active(); 35 | 36 | void set_active(Php::Parameters& parameters); 37 | 38 | void toggled(); 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/Gtk/GtkCheckMenuItem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCHECKMENUITEM_H_ 3 | #define _PHPGTK_GTKCHECKMENUITEM_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkMenuItem.h" 9 | 10 | /** 11 | * GtkCheckMenuItem_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCheckMenuItem.html 14 | */ 15 | class GtkCheckMenuItem_ : public GtkMenuItem_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCheckMenuItem_(); 26 | ~GtkCheckMenuItem_(); 27 | 28 | void __construct(); 29 | 30 | static Php::Value new_with_label(Php::Parameters ¶meters); 31 | 32 | static Php::Value new_with_mnemonic(Php::Parameters ¶meters); 33 | 34 | Php::Value get_active(); 35 | 36 | void set_active(Php::Parameters ¶meters); 37 | 38 | void toggled(); 39 | 40 | Php::Value get_inconsistent(); 41 | 42 | void set_inconsistent(Php::Parameters ¶meters); 43 | 44 | Php::Value get_draw_as_radio(); 45 | 46 | void set_draw_as_radio(Php::Parameters ¶meters); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/Gtk/GtkColorButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCOLORBUTTON_H_ 3 | #define _PHPGTK_GTKCOLORBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkButton.h" 9 | #include "../Gdk/GdkRGBA.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkColorButton_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkColorButton.html 17 | */ 18 | class GtkColorButton_ : public GtkButton_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkColorButton_(); 29 | ~GtkColorButton_(); 30 | 31 | void __construct(); 32 | 33 | Php::Value new_with_color(); 34 | 35 | static Php::Value new_with_rgba(Php::Parameters ¶meters); 36 | 37 | void set_color(Php::Parameters ¶meters); 38 | 39 | void get_color(Php::Parameters ¶meters); 40 | 41 | void set_alpha(Php::Parameters ¶meters); 42 | void get_alpha(Php::Parameters ¶meters); 43 | 44 | void set_rgba(Php::Parameters ¶meters); 45 | 46 | Php::Value get_rgba(Php::Parameters ¶meters); 47 | 48 | void set_use_alpha(Php::Parameters ¶meters); 49 | 50 | Php::Value get_use_alpha(); 51 | 52 | void set_title(Php::Parameters ¶meters); 53 | 54 | Php::Value get_title(); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/Gtk/GtkColorChooserDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCOLORCHOOSERDIALOG_H_ 3 | #define _PHPGTK_GTKCOLORCHOOSERDIALOG_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkDialog.h" 9 | #include "../Gdk/GdkRGBA.h" 10 | 11 | /** 12 | * GtkColorChooserDialog_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkColorChooserDialog.html 15 | */ 16 | class GtkColorChooserDialog_ : public GtkDialog_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkColorChooserDialog_(); 27 | ~GtkColorChooserDialog_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | 31 | Php::Value get_rgba(); 32 | 33 | void set_rgba(Php::Parameters ¶meters); 34 | 35 | Php::Value get_use_alpha(); 36 | 37 | void set_use_alpha(Php::Parameters ¶meters); 38 | 39 | void add_palette(Php::Parameters ¶meters); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Gtk/GtkComboBoxText.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCOMBOBOXTEXT_H_ 3 | #define _PHPGTK_GTKCOMBOBOXTEXT_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkComboBox.h" 9 | #include "GtkWidget.h" 10 | 11 | /** 12 | * GtkComboBoxText_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkComboBoxText.html 15 | */ 16 | class GtkComboBoxText_ : public GtkComboBox_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkComboBoxText_(); 27 | ~GtkComboBoxText_(); 28 | 29 | void __construct(); 30 | 31 | static Php::Value new_with_entry(); 32 | 33 | void append(Php::Parameters ¶meters); 34 | 35 | void prepend(Php::Parameters ¶meters); 36 | 37 | void insert(Php::Parameters ¶meters); 38 | 39 | void append_text(Php::Parameters ¶meters); 40 | 41 | void prepend_text(Php::Parameters ¶meters); 42 | 43 | void insert_text(Php::Parameters ¶meters); 44 | 45 | void remove(Php::Parameters ¶meters); 46 | 47 | void remove_all(); 48 | 49 | Php::Value get_active_text(); 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Gtk/GtkCssProvider.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKCSSPROVIDER_H_ 3 | #define _PHPGTK_GTKCSSPROVIDER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | /** 11 | * GtkCssProvider_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkCssProvider.html 14 | */ 15 | class GtkCssProvider_ : public GObject_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkCssProvider_(); 26 | ~GtkCssProvider_(); 27 | 28 | static Php::Value get_named(Php::Parameters ¶meters); 29 | 30 | Php::Value load_from_data(Php::Parameters ¶meters); 31 | 32 | Php::Value load_from_file(Php::Parameters ¶meters); 33 | 34 | Php::Value load_from_path(Php::Parameters ¶meters); 35 | 36 | void load_from_resource(Php::Parameters ¶meters); 37 | 38 | void __construct(); 39 | 40 | Php::Value to_string(); 41 | 42 | Php::Value gtk_css_section_get_end_line(); 43 | 44 | Php::Value gtk_css_section_get_end_position(); 45 | 46 | Php::Value gtk_css_section_get_file(); 47 | 48 | Php::Value gtk_css_section_get_parent(); 49 | 50 | Php::Value gtk_css_section_get_section_type(); 51 | 52 | Php::Value gtk_css_section_get_start_line(); 53 | 54 | Php::Value gtk_css_section_get_start_position(); 55 | 56 | Php::Value gtk_css_section_ref(); 57 | 58 | void gtk_css_section_unref(); 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/Gtk/GtkDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKDIALOG_H_ 3 | #define _PHPGTK_GTKDIALOG_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkWindow.h" 9 | #include "GtkBox.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkDialog_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkDialog.html 17 | */ 18 | class GtkDialog_ : public GtkWindow_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkDialog_(); 29 | virtual ~GtkDialog_(); 30 | 31 | void __construct(); 32 | 33 | static Php::Value new_with_buttons(Php::Parameters ¶meters); 34 | 35 | Php::Value run(); 36 | 37 | void response(Php::Parameters ¶meters); 38 | 39 | void add_button(Php::Parameters ¶meters); 40 | 41 | void add_buttons(Php::Parameters ¶meters); 42 | 43 | void add_action_widget(Php::Parameters ¶meters); 44 | 45 | void set_default_response(Php::Parameters ¶meters); 46 | 47 | void set_response_sensitive(Php::Parameters ¶meters); 48 | 49 | void get_response_for_widget(Php::Parameters ¶meters); 50 | 51 | Php::Value get_widget_for_response(Php::Parameters ¶meters); 52 | 53 | Php::Value get_content_area(); 54 | 55 | Php::Value get_header_bar(); 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/Gtk/GtkDrawingArea.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkDrawingArea.h" 3 | 4 | GtkDrawingArea_::GtkDrawingArea_() = default; 5 | GtkDrawingArea_::~GtkDrawingArea_() = default; 6 | 7 | void GtkDrawingArea_::__construct() 8 | { 9 | instance = (gpointer *)gtk_drawing_area_new (); 10 | } 11 | -------------------------------------------------------------------------------- /src/Gtk/GtkDrawingArea.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKDRAWINGAREA_H_ 3 | #define _PHPGTK_GTKDRAWINGAREA_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkWidget.h" 9 | 10 | class GtkDrawingArea_ : public GtkWidget_ 11 | { 12 | /** 13 | * Publics 14 | */ 15 | public: 16 | 17 | /** 18 | * C++ constructor and destructor 19 | */ 20 | GtkDrawingArea_(); 21 | ~GtkDrawingArea_(); 22 | 23 | void __construct(); 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/Gtk/GtkEventBox.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkEventBox.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkEventBox_::GtkEventBox_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkEventBox_::~GtkEventBox_() = default; 13 | 14 | 15 | void GtkEventBox_::__construct() 16 | { 17 | instance = (gpointer *)gtk_event_box_new(); 18 | } 19 | 20 | 21 | Php::Value GtkEventBox_::get_visible_window() 22 | { 23 | bool ret = gtk_event_box_get_visible_window(GTK_EVENT_BOX(instance)); 24 | 25 | return ret; 26 | } 27 | 28 | void GtkEventBox_::set_visible_window(Php::Parameters ¶meters) 29 | { 30 | gboolean visible_window = (gboolean)parameters[0]; 31 | 32 | gtk_event_box_set_visible_window(GTK_EVENT_BOX(instance), visible_window); 33 | } 34 | 35 | Php::Value GtkEventBox_::get_above_child() 36 | { 37 | bool ret = gtk_event_box_get_above_child(GTK_EVENT_BOX(instance)); 38 | 39 | return ret; 40 | } 41 | 42 | void GtkEventBox_::set_above_child(Php::Parameters ¶meters) 43 | { 44 | gboolean above_child = (gboolean)parameters[0]; 45 | 46 | gtk_event_box_set_above_child(GTK_EVENT_BOX(instance), above_child); 47 | } 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/Gtk/GtkEventBox.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKEVENTBOX_H_ 3 | #define _PHPGTK_GTKEVENTBOX_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | 10 | class GtkEventBox_ : public GtkBin_ 11 | { 12 | public: 13 | GtkEventBox_(); 14 | ~GtkEventBox_(); 15 | 16 | void __construct(); 17 | 18 | Php::Value get_visible_window(); 19 | 20 | void set_visible_window(Php::Parameters ¶meters); 21 | 22 | Php::Value get_above_child(); 23 | 24 | void set_above_child(Php::Parameters ¶meters); 25 | }; 26 | 27 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkExpander.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKEXPANDER_H_ 3 | #define _PHPGTK_GTKEXPANDER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkExpander_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkExpander.html 17 | */ 18 | class GtkExpander_ : public GtkBin_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkExpander_(); 29 | ~GtkExpander_(); 30 | 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | static Php::Value new_with_mnemonic(Php::Parameters ¶meters); 34 | 35 | void set_expanded(Php::Parameters ¶meters); 36 | 37 | Php::Value get_expanded(); 38 | 39 | void set_spacing(Php::Parameters ¶meters); 40 | 41 | Php::Value get_spacing(); 42 | 43 | void set_label(Php::Parameters ¶meters); 44 | 45 | Php::Value get_label(); 46 | 47 | void set_use_underline(Php::Parameters ¶meters); 48 | 49 | Php::Value get_use_underline(); 50 | 51 | void set_use_markup(Php::Parameters ¶meters); 52 | 53 | Php::Value get_use_markup(); 54 | 55 | void set_label_widget(Php::Parameters ¶meters); 56 | 57 | Php::Value get_label_widget(); 58 | 59 | void set_label_fill(Php::Parameters ¶meters); 60 | 61 | Php::Value get_label_fill(); 62 | 63 | void set_resize_toplevel(Php::Parameters ¶meters); 64 | 65 | Php::Value get_resize_toplevel(); 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/Gtk/GtkFileChooser.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkFileChooser.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkFileChooser_::GtkFileChooser_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkFileChooser_::~GtkFileChooser_() = default; 13 | 14 | Php::Value GtkFileChooser_::get_filename() 15 | { 16 | std::string ret = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(instance)); 17 | 18 | return ret; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/Gtk/GtkFileChooser.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFILECHOOSER_H_ 3 | #define _PHPGTK_GTKFILECHOOSER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | /** 11 | * GtkFileChooser_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkFileChooser.html 14 | */ 15 | class GtkFileChooser_ : public GObject_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkFileChooser_(); 26 | ~GtkFileChooser_(); 27 | 28 | Php::Value get_filename(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/Gtk/GtkFileFilter.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkFileFilter.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkFileFilter_::GtkFileFilter_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkFileFilter_::~GtkFileFilter_() = default; 13 | 14 | void GtkFileFilter_::__construct() 15 | { 16 | instance = (gpointer *)gtk_file_filter_new (); 17 | 18 | } 19 | 20 | void GtkFileFilter_::set_name(Php::Parameters ¶meters) 21 | { 22 | std::string s_name = parameters[0]; 23 | gchar *name = (gchar *)s_name.c_str(); 24 | 25 | gtk_file_filter_set_name (GTK_FILE_FILTER(instance), name); 26 | 27 | } 28 | 29 | Php::Value GtkFileFilter_::get_name() 30 | { 31 | char * ret = (char *) gtk_file_filter_get_name (GTK_FILE_FILTER(instance)); 32 | 33 | return ret; 34 | } 35 | 36 | void GtkFileFilter_::add_mime_type(Php::Parameters ¶meters) 37 | { 38 | std::string s_name = parameters[0]; 39 | gchar *name = (gchar *)s_name.c_str(); 40 | 41 | gtk_file_filter_add_mime_type (GTK_FILE_FILTER(instance), name); 42 | 43 | } 44 | 45 | void GtkFileFilter_::add_pattern(Php::Parameters ¶meters) 46 | { 47 | std::string s_name = parameters[0]; 48 | gchar *name = (gchar *)s_name.c_str(); 49 | 50 | gtk_file_filter_add_pattern (GTK_FILE_FILTER(instance), name); 51 | 52 | } 53 | 54 | void GtkFileFilter_::add_pixbuf_formats() 55 | { 56 | gtk_file_filter_add_pixbuf_formats (GTK_FILE_FILTER(instance)); 57 | 58 | } 59 | 60 | Php::Value GtkFileFilter_::get_needed() 61 | { 62 | GtkFileFilterFlags ret = gtk_file_filter_get_needed (GTK_FILE_FILTER(instance)); 63 | 64 | return ret; 65 | } 66 | 67 | Php::Value GtkFileFilter_::filter(Php::Parameters ¶meters) 68 | { 69 | // GtkFileFilterInfo *filter_info; 70 | // if(parameters.size() > 0) { 71 | // Php::Value object_filter_info = parameters[0]; 72 | // GtkFileFilterInfo_ *phpgtk_filter_info = (GtkFileFilterInfo_ *)object_filter_info.implementation(); 73 | // filter_info = GTK_WIDGET(phpgtk_filter_info->get_instance()); 74 | // } 75 | 76 | // gboolean ret = gtk_file_filter_filter (GTK_FILE_FILTER(instance), filter_info); 77 | 78 | // return ret; 79 | return 1; 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/Gtk/GtkFileFilter.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFILEFILTER_H_ 3 | #define _PHPGTK_GTKFILEFILTER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | /** 11 | * GtkFileFilter_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkFileFilter.html 14 | */ 15 | class GtkFileFilter_ : public GObject_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkFileFilter_(); 26 | ~GtkFileFilter_(); 27 | 28 | void __construct(); 29 | 30 | void set_name(Php::Parameters ¶meters); 31 | 32 | Php::Value get_name(); 33 | 34 | void add_mime_type(Php::Parameters ¶meters); 35 | 36 | void add_pattern(Php::Parameters ¶meters); 37 | 38 | void add_pixbuf_formats(); 39 | 40 | Php::Value get_needed(); 41 | 42 | Php::Value filter(Php::Parameters ¶meters); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/Gtk/GtkFixed.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkFixed.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkFixed_::GtkFixed_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkFixed_::~GtkFixed_() = default; 13 | 14 | void GtkFixed_::__construct() 15 | { 16 | instance = (gpointer *)gtk_fixed_new (); 17 | 18 | } 19 | 20 | void GtkFixed_::put(Php::Parameters ¶meters) 21 | { 22 | GtkWidget *widget; 23 | if(parameters.size() > 0) { 24 | Php::Value object_widget = parameters[0]; 25 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 26 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 27 | } 28 | 29 | gint x = (gint)parameters[1]; 30 | 31 | gint y = (gint)parameters[2]; 32 | 33 | gtk_fixed_put (GTK_FIXED(instance), widget, x, y); 34 | 35 | } 36 | 37 | void GtkFixed_::move(Php::Parameters ¶meters) 38 | { 39 | GtkWidget *widget; 40 | if(parameters.size() > 0) { 41 | Php::Value object_widget = parameters[0]; 42 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 43 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 44 | } 45 | 46 | gint x = (gint)parameters[1]; 47 | 48 | gint y = (gint)parameters[2]; 49 | 50 | gtk_fixed_move (GTK_FIXED(instance), widget, x, y); 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/Gtk/GtkFixed.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFIXED_H_ 3 | #define _PHPGTK_GTKFIXED_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | 10 | /** 11 | * GtkFixed_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkFixed.html 14 | */ 15 | class GtkFixed_ : public GtkContainer_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkFixed_(); 26 | ~GtkFixed_(); 27 | 28 | void __construct(); 29 | 30 | void put(Php::Parameters ¶meters); 31 | 32 | void move(Php::Parameters ¶meters); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Gtk/GtkFlowBoxChild.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkFlowBoxChild.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkFlowBoxChild_::GtkFlowBoxChild_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkFlowBoxChild_::~GtkFlowBoxChild_() = default; 13 | 14 | void GtkFlowBoxChild_::__construct() 15 | { 16 | instance = (gpointer *)gtk_flow_box_child_new (); 17 | } 18 | 19 | Php::Value GtkFlowBoxChild_::get_index() 20 | { 21 | gint ret = gtk_flow_box_child_get_index (GTK_FLOW_BOX_CHILD(instance)); 22 | 23 | return ret; 24 | } 25 | 26 | Php::Value GtkFlowBoxChild_::is_selected() 27 | { 28 | bool ret = gtk_flow_box_child_is_selected (GTK_FLOW_BOX_CHILD(instance)); 29 | 30 | return ret; 31 | } 32 | 33 | void GtkFlowBoxChild_::changed() 34 | { 35 | gtk_flow_box_child_changed (GTK_FLOW_BOX_CHILD(instance)); 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/Gtk/GtkFlowBoxChild.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFLOWBOXCHILD_H_ 3 | #define _PHPGTK_GTKFLOWBOXCHILD_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | /** 12 | * GtkFlowBoxChild_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkFlowBoxChild.html 15 | */ 16 | class GtkFlowBoxChild_ : public GtkBin_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkFlowBoxChild_(); 27 | ~GtkFlowBoxChild_(); 28 | 29 | void __construct(); 30 | 31 | Php::Value get_index(); 32 | 33 | Php::Value is_selected(); 34 | 35 | void changed(); 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/Gtk/GtkFontButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFONTBUTTON_H_ 3 | #define _PHPGTK_GTKFONTBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkButton.h" 9 | 10 | /** 11 | * GtkFontButton_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkFontButton.html 14 | */ 15 | class GtkFontButton_ : public GtkButton_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkFontButton_(); 26 | ~GtkFontButton_(); 27 | 28 | void __construct(); 29 | 30 | static Php::Value new_with_font(Php::Parameters ¶meters); 31 | 32 | Php::Value set_font_name(Php::Parameters ¶meters); 33 | void set_font(Php::Parameters ¶meters); 34 | 35 | Php::Value get_font_name(); 36 | Php::Value get_font(); 37 | 38 | void set_show_style(Php::Parameters ¶meters); 39 | 40 | Php::Value get_show_style(); 41 | 42 | void set_show_size(Php::Parameters ¶meters); 43 | 44 | Php::Value get_show_size(); 45 | 46 | void set_use_font(Php::Parameters ¶meters); 47 | 48 | Php::Value get_use_font(); 49 | 50 | void set_use_size(Php::Parameters ¶meters); 51 | 52 | Php::Value get_use_size(); 53 | 54 | void set_title(Php::Parameters ¶meters); 55 | 56 | Php::Value get_title(); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/Gtk/GtkFontChooserDialog.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkFontChooserDialog.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkFontChooserDialog_::GtkFontChooserDialog_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkFontChooserDialog_::~GtkFontChooserDialog_() = default; 13 | 14 | void GtkFontChooserDialog_::__construct(Php::Parameters ¶meters) 15 | { 16 | std::string s_title = parameters[0]; 17 | gchar *title = (gchar *)s_title.c_str(); 18 | 19 | Php::Value object_parent = parameters[1]; 20 | GtkWindow *parent = NULL; 21 | if (object_parent.instanceOf("GtkWindow")) { 22 | GtkWindow_ *phpgtk_parent = (GtkWindow_ *)object_parent.implementation(); 23 | parent = GTK_WINDOW(phpgtk_parent->get_instance()); 24 | } 25 | 26 | instance = (gpointer *)gtk_font_chooser_dialog_new (title, parent); 27 | 28 | } 29 | 30 | Php::Value GtkFontChooserDialog_::get_font_size() 31 | { 32 | gint ret = gtk_font_chooser_get_font_size (GTK_FONT_CHOOSER(instance)); 33 | 34 | return ret; 35 | } 36 | 37 | Php::Value GtkFontChooserDialog_::get_font() 38 | { 39 | std::string ret = gtk_font_chooser_get_font (GTK_FONT_CHOOSER(instance)); 40 | 41 | return ret; 42 | } 43 | 44 | Php::Value GtkFontChooserDialog_::get_preview_text() 45 | { 46 | std::string ret = gtk_font_chooser_get_preview_text (GTK_FONT_CHOOSER(instance)); 47 | 48 | return ret; 49 | } 50 | 51 | void GtkFontChooserDialog_::set_preview_text(Php::Parameters ¶meters) 52 | { 53 | std::string s_text = parameters[0]; 54 | gchar *text = (gchar *)s_text.c_str(); 55 | 56 | gtk_font_chooser_set_preview_text (GTK_FONT_CHOOSER(instance), text); 57 | 58 | } 59 | 60 | Php::Value GtkFontChooserDialog_::get_show_preview_entry() 61 | { 62 | bool ret = gtk_font_chooser_get_show_preview_entry (GTK_FONT_CHOOSER(instance)); 63 | 64 | return ret; 65 | } 66 | 67 | void GtkFontChooserDialog_::set_show_preview_entry(Php::Parameters ¶meters) 68 | { 69 | gboolean show_preview_entry = (gboolean)parameters[0]; 70 | 71 | gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER(instance), show_preview_entry); 72 | 73 | } 74 | 75 | -------------------------------------------------------------------------------- /src/Gtk/GtkFontChooserDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFONTCHOOSERDIALOG_H_ 3 | #define _PHPGTK_GTKFONTCHOOSERDIALOG_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkDialog.h" 9 | #include "GtkWindow.h" 10 | 11 | /** 12 | * GtkFontChooserDialog_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkFontChooserDialog.html 15 | */ 16 | class GtkFontChooserDialog_ : public GtkDialog_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkFontChooserDialog_(); 27 | ~GtkFontChooserDialog_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | 31 | Php::Value get_font_size(); 32 | 33 | Php::Value get_font(); 34 | 35 | Php::Value get_preview_text(); 36 | 37 | void set_preview_text(Php::Parameters ¶meters); 38 | 39 | Php::Value get_show_preview_entry(); 40 | 41 | void set_show_preview_entry(Php::Parameters ¶meters); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Gtk/GtkFrame.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKFRAME_H_ 3 | #define _PHPGTK_GTKFRAME_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkFrame_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkFrame.html 17 | */ 18 | class GtkFrame_ : public GtkBin_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkFrame_(); 29 | ~GtkFrame_(); 30 | 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | void set_label(Php::Parameters ¶meters); 34 | 35 | void set_label_widget(Php::Parameters ¶meters); 36 | 37 | void set_label_align(Php::Parameters ¶meters); 38 | 39 | void set_shadow_type(Php::Parameters ¶meters); 40 | 41 | Php::Value get_label(); 42 | 43 | Php::Value get_label_align(Php::Parameters ¶meters); 44 | 45 | Php::Value get_label_widget(); 46 | 47 | Php::Value get_shadow_type(); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Gtk/GtkGrid.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKGRID_H_ 3 | #define _PHPGTK_GTKGRID_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkGrid_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkGrid.html 17 | */ 18 | class GtkGrid_ : public GtkContainer_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkGrid_(); 29 | ~GtkGrid_(); 30 | 31 | void __construct(); 32 | 33 | void attach(Php::Parameters ¶meters); 34 | 35 | void attach_next_to(Php::Parameters ¶meters); 36 | 37 | Php::Value get_child_at(Php::Parameters ¶meters); 38 | 39 | void insert_row(Php::Parameters ¶meters); 40 | 41 | void insert_column(Php::Parameters ¶meters); 42 | 43 | void remove_row(Php::Parameters ¶meters); 44 | 45 | void remove_column(Php::Parameters ¶meters); 46 | 47 | void insert_next_to(Php::Parameters ¶meters); 48 | 49 | void set_row_homogeneous(Php::Parameters ¶meters); 50 | 51 | Php::Value get_row_homogeneous(); 52 | 53 | void set_row_spacing(Php::Parameters ¶meters); 54 | 55 | Php::Value get_row_spacing(); 56 | 57 | void set_column_homogeneous(Php::Parameters ¶meters); 58 | 59 | Php::Value get_column_homogeneous(); 60 | 61 | void set_column_spacing(Php::Parameters ¶meters); 62 | 63 | Php::Value get_column_spacing(); 64 | 65 | void set_baseline_row(Php::Parameters ¶meters); 66 | 67 | Php::Value get_baseline_row(); 68 | 69 | void set_row_baseline_position(Php::Parameters ¶meters); 70 | 71 | Php::Value get_row_baseline_position(Php::Parameters ¶meters); 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/Gtk/GtkHBox.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkHBox.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkHBox_::GtkHBox_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkHBox_::~GtkHBox_() = default; 13 | 14 | /** 15 | * PHP Constructor 16 | */ 17 | void GtkHBox_::__construct(Php::Parameters ¶meters) 18 | { 19 | Php::warning << "GtkHBox is deprecated on Gtk 3.20 and will be removed on non-beta release" << std::flush; 20 | 21 | // Construct the parent 22 | Php::call("parent::__construct", GTK_ORIENTATION_HORIZONTAL, 0); 23 | 24 | // Verify if has homogeneous parameter 25 | if(parameters.size() >= 1) { 26 | Php::call("parent::set_homogeneous", parameters[0]); 27 | } 28 | 29 | // Verify if has spacing parameter 30 | if(parameters.size() >= 2) { 31 | Php::call("parent::set_spacing", parameters[1]); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Gtk/GtkHBox.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKHBOX_H_ 3 | #define _PHPGTK_GTKHBOX_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBox.h" 9 | 10 | /** 11 | * 12 | */ 13 | class GtkHBox_ : public GtkBox_ 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | /** 21 | * C++ constructor and destructor 22 | */ 23 | GtkHBox_(); 24 | virtual ~GtkHBox_(); 25 | 26 | /** 27 | * PHP Construct 28 | */ 29 | void __construct(Php::Parameters ¶ms); 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkHeaderBar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKHEADERBAR_H_ 3 | #define _PHPGTK_GTKHEADERBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkHeaderBar_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkHeaderBar.html 17 | */ 18 | class GtkHeaderBar_ : public GtkContainer_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkHeaderBar_(); 29 | ~GtkHeaderBar_(); 30 | 31 | void __construct(); 32 | 33 | void set_title(Php::Parameters ¶meters); 34 | 35 | Php::Value get_title(); 36 | 37 | void set_subtitle(Php::Parameters ¶meters); 38 | 39 | Php::Value get_subtitle(); 40 | 41 | void set_has_subtitle(Php::Parameters ¶meters); 42 | 43 | Php::Value get_has_subtitle(); 44 | 45 | void set_custom_title(Php::Parameters ¶meters); 46 | 47 | Php::Value get_custom_title(); 48 | 49 | void pack_start(Php::Parameters ¶meters); 50 | 51 | void pack_end(Php::Parameters ¶meters); 52 | 53 | void set_show_close_button(Php::Parameters ¶meters); 54 | 55 | Php::Value get_show_close_button(); 56 | 57 | void set_decoration_layout(Php::Parameters ¶meters); 58 | 59 | Php::Value get_decoration_layout(); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/Gtk/GtkIconTheme.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKICONTHEME_H_ 3 | #define _PHPGTK_GTKICONTHEME_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | 10 | #include "../../php-gtk.h" 11 | 12 | /** 13 | * GtkIconTheme 14 | * 15 | * https://docs.gtk.org/gtk3/class.IconTheme.html 16 | */ 17 | class GtkIconTheme_ : public GObject_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkIconTheme_(); 28 | ~GtkIconTheme_(); 29 | 30 | void __construct(); 31 | static Php::Value get_default(); 32 | static Php::Value get_for_screen(Php::Parameters ¶meters); 33 | Php::Value has_icon(Php::Parameters ¶meters); 34 | Php::Value list_icons(Php::Parameters ¶meters); 35 | void add_resource_path(Php::Parameters ¶meters); 36 | void append_search_path(Php::Parameters ¶meters); 37 | void prepend_search_path(Php::Parameters ¶meters); 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /src/Gtk/GtkInfoBar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKINFOBAR_H_ 3 | #define _PHPGTK_GTKINFOBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBox.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkInfoBar_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkInfoBar.html 17 | */ 18 | class GtkInfoBar_ : public GtkBox_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkInfoBar_(); 29 | ~GtkInfoBar_(); 30 | 31 | void __construct(); 32 | 33 | static Php::Value new_with_buttons(Php::Parameters ¶meters); 34 | 35 | void add_action_widget(Php::Parameters ¶meters); 36 | 37 | Php::Value add_button(Php::Parameters ¶meters); 38 | 39 | void add_buttons(Php::Parameters ¶meters); 40 | 41 | void set_response_sensitive(Php::Parameters ¶meters); 42 | 43 | void set_default_response(Php::Parameters ¶meters); 44 | 45 | void response(Php::Parameters ¶meters); 46 | 47 | void set_message_type(Php::Parameters ¶meters); 48 | 49 | Php::Value get_message_type(); 50 | 51 | Php::Value get_action_area(); 52 | 53 | Php::Value get_content_area(); 54 | 55 | Php::Value get_show_close_button(); 56 | 57 | void set_show_close_button(Php::Parameters ¶meters); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Gtk/GtkLayout.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKLAYOUT_H_ 3 | #define _PHPGTK_GTKLAYOUT_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | #include "GtkWindow.h" 10 | #include "GtkAdjustment.h" 11 | 12 | /** 13 | * GtkLayout_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkLayout.html 16 | */ 17 | class GtkLayout_ : public GtkContainer_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkLayout_(); 28 | ~GtkLayout_(); 29 | 30 | void __construct(Php::Parameters ¶meters); 31 | 32 | void put(Php::Parameters ¶meters); 33 | 34 | void move(Php::Parameters ¶meters); 35 | 36 | void set_size(Php::Parameters ¶meters); 37 | 38 | Php::Value get_size(Php::Parameters ¶meters); 39 | 40 | Php::Value get_hadjustment(); 41 | 42 | Php::Value get_vadjustment(); 43 | 44 | void set_hadjustment(Php::Parameters ¶meters); 45 | 46 | void set_vadjustment(Php::Parameters ¶meters); 47 | 48 | Php::Value get_bin_window(); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Gtk/GtkListBoxRow.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkListBoxRow.h" 3 | 4 | 5 | /** 6 | * Return original instance 7 | */ 8 | GtkListBoxRow *GtkListBoxRow_::get_row() 9 | { 10 | return row; 11 | } 12 | 13 | /** 14 | * Set the original GtkListBoxRow 15 | */ 16 | void GtkListBoxRow_::set_row(GtkListBoxRow *pased_row) 17 | { 18 | row = pased_row; 19 | } 20 | 21 | /** 22 | * Constructor 23 | */ 24 | GtkListBoxRow_::GtkListBoxRow_() = default; 25 | 26 | /** 27 | * Destructor 28 | */ 29 | GtkListBoxRow_::~GtkListBoxRow_() = default; 30 | 31 | // 32 | void GtkListBoxRow_::__construct() 33 | { 34 | instance = (gpointer *)gtk_list_box_row_new(); 35 | 36 | } -------------------------------------------------------------------------------- /src/Gtk/GtkListBoxRow.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKLISTBOXROW_H_ 3 | #define _PHPGTK_GTKLISTBOXROW_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | 10 | /** 11 | * GtkListBoxRow_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkListBoxRow.html 14 | */ 15 | class GtkListBoxRow_ : public GtkBin_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | GtkListBoxRow *row; 23 | 24 | /** 25 | * Set/Get original row 26 | */ 27 | GtkListBoxRow *get_row(); 28 | void set_row(GtkListBoxRow *pased_row); 29 | 30 | /** 31 | * C++ constructor and destructor 32 | */ 33 | GtkListBoxRow_(); 34 | ~GtkListBoxRow_(); 35 | 36 | void __construct(); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Gtk/GtkMenu.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMENU_H_ 3 | #define _PHPGTK_GTKMENU_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkMenuShell.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkMenu_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkMenu.html 17 | */ 18 | class GtkMenu_ : public GtkMenuShell_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkMenu_(); 29 | ~GtkMenu_(); 30 | 31 | void __construct(); 32 | 33 | static void new_from_model(Php::Parameters ¶meters); 34 | 35 | void set_screen(Php::Parameters ¶meters); 36 | 37 | void reorder_child(Php::Parameters ¶meters); 38 | 39 | void attach(Php::Parameters ¶meters); 40 | 41 | void popup_at_rect(Php::Parameters ¶meters); 42 | 43 | void popup_at_widget(Php::Parameters ¶meters); 44 | 45 | void popup_at_pointer (Php::Parameters ¶meters); 46 | 47 | void set_accel_group(Php::Parameters ¶meters); 48 | 49 | Php::Value get_accel_group(); 50 | 51 | void set_accel_path(Php::Parameters ¶meters); 52 | 53 | Php::Value get_accel_path(); 54 | 55 | void set_monitor(Php::Parameters ¶meters); 56 | 57 | Php::Value get_monitor(); 58 | 59 | void place_on_monitor(Php::Parameters ¶meters); 60 | 61 | void set_reserve_toggle_size(Php::Parameters ¶meters); 62 | 63 | Php::Value get_reserve_toggle_size(); 64 | 65 | void popdown(); 66 | 67 | void reposition(); 68 | 69 | Php::Value get_active(); 70 | 71 | void set_active(Php::Parameters ¶meters); 72 | 73 | void attach_to_widget(Php::Parameters ¶meters); 74 | 75 | void detach(); 76 | 77 | Php::Value get_attach_widget(); 78 | 79 | Php::Value get_for_attach_widget(); 80 | }; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/Gtk/GtkMenuBar.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkMenuBar.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkMenuBar_::GtkMenuBar_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkMenuBar_::~GtkMenuBar_() = default; 13 | 14 | void GtkMenuBar_::__construct() 15 | { 16 | instance = (gpointer *)gtk_menu_bar_new (); 17 | 18 | } 19 | 20 | void GtkMenuBar_::new_from_model(Php::Parameters ¶meters) 21 | { 22 | 23 | // gtk_menu_bar_new_from_model (model); 24 | throw Php::Exception("GtkMenuBar_::new_from_model not implemented"); 25 | 26 | } 27 | 28 | void GtkMenuBar_::set_pack_direction(Php::Parameters ¶meters) 29 | { 30 | int int_pack_dir = (int)parameters[0]; 31 | GtkPackDirection pack_dir = (GtkPackDirection)int_pack_dir; 32 | 33 | gtk_menu_bar_set_pack_direction (GTK_MENU_BAR(instance), pack_dir); 34 | 35 | } 36 | 37 | Php::Value GtkMenuBar_::get_pack_direction() 38 | { 39 | GtkPackDirection ret = gtk_menu_bar_get_pack_direction (GTK_MENU_BAR(instance)); 40 | 41 | return ret; 42 | } 43 | 44 | void GtkMenuBar_::set_child_pack_direction(Php::Parameters ¶meters) 45 | { 46 | int int_child_pack_dir = (int)parameters[0]; 47 | GtkPackDirection child_pack_dir = (GtkPackDirection)int_child_pack_dir; 48 | 49 | gtk_menu_bar_set_child_pack_direction (GTK_MENU_BAR(instance), child_pack_dir); 50 | 51 | } 52 | 53 | void GtkMenuBar_::child_pack_direction() 54 | { 55 | gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR(instance)); 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Gtk/GtkMenuBar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMENUBAR_H_ 3 | #define _PHPGTK_GTKMENUBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkMenuShell.h" 9 | #include "GtkWidget.h" 10 | 11 | /** 12 | * GtkMenuBar_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkMenuBar.html 15 | */ 16 | class GtkMenuBar_ : public GtkMenuShell_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkMenuBar_(); 27 | ~GtkMenuBar_(); 28 | 29 | void __construct(); 30 | 31 | static void new_from_model(Php::Parameters ¶meters); 32 | 33 | void set_pack_direction(Php::Parameters ¶meters); 34 | 35 | Php::Value get_pack_direction(); 36 | 37 | void set_child_pack_direction(Php::Parameters ¶meters); 38 | 39 | void child_pack_direction(); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Gtk/GtkMenuButton.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkMenuButton.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkMenuButton_::GtkMenuButton_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkMenuButton_::~GtkMenuButton_() = default; 13 | 14 | void GtkMenuButton_::__construct() 15 | { 16 | instance = (gpointer *)gtk_menu_button_new(); 17 | } 18 | 19 | void GtkMenuButton_::set_popup(Php::Parameters& parameters) 20 | { 21 | Php::Value object_menu = parameters[0]; 22 | GtkWidget_ *phpgtk_menu = (GtkWidget_ *)object_menu.implementation(); 23 | GtkWidget *menu = GTK_WIDGET(phpgtk_menu->get_instance()); 24 | 25 | gtk_menu_button_set_popup (GTK_MENU_BUTTON(instance), menu); 26 | } -------------------------------------------------------------------------------- /src/Gtk/GtkMenuButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMENUBUTTON_H_ 3 | #define _PHPGTK_GTKMENUBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkToggleButton.h" 9 | 10 | #include "../../php-gtk.h" 11 | 12 | /** 13 | * GtkMenuButton_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkMenuButton.html 16 | */ 17 | class GtkMenuButton_ : public GtkToggleButton_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkMenuButton_(); 28 | ~GtkMenuButton_(); 29 | 30 | void __construct(); 31 | 32 | void set_popup(Php::Parameters& parameters); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Gtk/GtkMenuItem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMENUITEM_H_ 3 | #define _PHPGTK_GTKMENUITEM_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkMenuItem_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkMenuItem.html 17 | */ 18 | class GtkMenuItem_ : public GtkBin_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkMenuItem_(); 29 | ~GtkMenuItem_(); 30 | 31 | void __construct(); 32 | 33 | static Php::Value new_with_label(Php::Parameters ¶meters); 34 | 35 | static Php::Value new_with_mnemonic(Php::Parameters ¶meters); 36 | 37 | Php::Value get_label(); 38 | 39 | void set_label(Php::Parameters ¶meters); 40 | 41 | Php::Value get_use_underline(); 42 | 43 | void set_use_underline(Php::Parameters ¶meters); 44 | 45 | void set_submenu(Php::Parameters ¶meters); 46 | 47 | Php::Value get_submenu(); 48 | 49 | void set_accel_path(Php::Parameters ¶meters); 50 | 51 | Php::Value get_accel_path(); 52 | 53 | void select(); 54 | 55 | void deselect(); 56 | 57 | void activate(); 58 | 59 | Php::Value toggle_size_request(Php::Parameters ¶meters); 60 | 61 | void size_allocate(Php::Parameters ¶meters); 62 | 63 | Php::Value get_reserve_indicator(); 64 | 65 | void set_reserve_indicator(Php::Parameters ¶meters); 66 | 67 | void set_right_justified(Php::Parameters& parameters); 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/Gtk/GtkMenuShell.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMENUSHELL_H_ 3 | #define _PHPGTK_GTKMENUSHELL_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkMenuShell_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkMenuShell.html 17 | */ 18 | class GtkMenuShell_ : public GtkContainer_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkMenuShell_(); 29 | ~GtkMenuShell_(); 30 | 31 | void append(Php::Parameters ¶meters); 32 | 33 | void prepend(Php::Parameters ¶meters); 34 | 35 | void insert(Php::Parameters ¶meters); 36 | 37 | void deactivate(); 38 | 39 | void select_item(Php::Parameters ¶meters); 40 | 41 | void select_first(Php::Parameters ¶meters); 42 | 43 | void deselect(); 44 | 45 | void activate_item(Php::Parameters ¶meters); 46 | 47 | void cancel(); 48 | 49 | void set_take_focus(Php::Parameters ¶meters); 50 | 51 | Php::Value get_take_focus(); 52 | 53 | Php::Value get_selected_item(); 54 | 55 | Php::Value get_parent_shell(); 56 | 57 | void bind_model(Php::Parameters ¶meters); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Gtk/GtkMessageDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMESSAGEDIALOG_H_ 3 | #define _PHPGTK_GTKMESSAGEDIALOG_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkDialog.h" 9 | 10 | #include "../../php-gtk.h" 11 | 12 | /** 13 | * GtkMessageDialog_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkMessageDialog.html 16 | */ 17 | class GtkMessageDialog_ : public GtkDialog_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkMessageDialog_(); 28 | ~GtkMessageDialog_(); 29 | 30 | void __construct(Php::Parameters ¶meters); 31 | 32 | static Php::Value new_with_markup(Php::Parameters ¶meters); 33 | 34 | void set_markup(Php::Parameters ¶meters); 35 | 36 | void format_secondary_text(Php::Parameters ¶meters); 37 | 38 | void format_secondary_markup(Php::Parameters ¶meters); 39 | 40 | Php::Value get_message_area(); 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Gtk/GtkMisc.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkMisc.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkMisc_::GtkMisc_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkMisc_::~GtkMisc_() = default; 13 | -------------------------------------------------------------------------------- /src/Gtk/GtkMisc.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKMISC_H_ 3 | #define _PHPGTK_GTKMISC_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkWidget.h" 9 | 10 | /** 11 | * GtkMisc_ 12 | */ 13 | class GtkMisc_ : public GtkWidget_ 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | /** 21 | * C++ constructor and destructor 22 | */ 23 | GtkMisc_(); 24 | ~GtkMisc_(); 25 | }; 26 | 27 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkOverlay.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkOverlay.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkOverlay_::GtkOverlay_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkOverlay_::~GtkOverlay_() = default; 13 | 14 | void GtkOverlay_::__construct() 15 | { 16 | instance = (gpointer *)gtk_overlay_new (); 17 | 18 | } 19 | 20 | void GtkOverlay_::add_overlay(Php::Parameters ¶meters) 21 | { 22 | GtkWidget *widget; 23 | if(parameters.size() > 0) { 24 | Php::Value object_widget = parameters[0]; 25 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 26 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 27 | } 28 | 29 | gtk_overlay_add_overlay (GTK_OVERLAY(instance), widget); 30 | 31 | } 32 | 33 | void GtkOverlay_::reorder_overlay(Php::Parameters ¶meters) 34 | { 35 | GtkWidget *child; 36 | if(parameters.size() > 0) { 37 | Php::Value object_child = parameters[0]; 38 | GtkWidget_ *phpgtk_child = (GtkWidget_ *)object_child.implementation(); 39 | child = GTK_WIDGET(phpgtk_child->get_instance()); 40 | } 41 | 42 | gint position = (gint)parameters[1]; 43 | 44 | gtk_overlay_reorder_overlay (GTK_OVERLAY(instance), child, position); 45 | 46 | } 47 | 48 | Php::Value GtkOverlay_::get_overlay_pass_through(Php::Parameters ¶meters) 49 | { 50 | GtkWidget *widget; 51 | if(parameters.size() > 0) { 52 | Php::Value object_widget = parameters[0]; 53 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 54 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 55 | } 56 | 57 | bool ret = gtk_overlay_get_overlay_pass_through (GTK_OVERLAY(instance), widget); 58 | 59 | return ret; 60 | } 61 | 62 | void GtkOverlay_::set_overlay_pass_through(Php::Parameters ¶meters) 63 | { 64 | GtkWidget *widget; 65 | if(parameters.size() > 0) { 66 | Php::Value object_widget = parameters[0]; 67 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 68 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 69 | } 70 | 71 | gboolean pass_through = (gboolean)parameters[1]; 72 | 73 | gtk_overlay_set_overlay_pass_through (GTK_OVERLAY(instance), widget, pass_through); 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/Gtk/GtkOverlay.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKOVERLAY_H_ 3 | #define _PHPGTK_GTKOVERLAY_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | /** 12 | * GtkOverlay_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkOverlay.html 15 | */ 16 | class GtkOverlay_ : public GtkBin_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkOverlay_(); 27 | ~GtkOverlay_(); 28 | 29 | void __construct(); 30 | 31 | void add_overlay(Php::Parameters ¶meters); 32 | 33 | void reorder_overlay(Php::Parameters ¶meters); 34 | 35 | Php::Value get_overlay_pass_through(Php::Parameters ¶meters); 36 | 37 | void set_overlay_pass_through(Php::Parameters ¶meters); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Gtk/GtkProgressBar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKPROGRESSBAR_H_ 3 | #define _PHPGTK_GTKPROGRESSBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkWidget.h" 9 | 10 | /** 11 | * GtkProgressBar_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkProgressBar.html 14 | */ 15 | class GtkProgressBar_ : public GtkWidget_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkProgressBar_(); 26 | ~GtkProgressBar_(); 27 | 28 | void __construct(); 29 | 30 | void pulse(); 31 | 32 | void set_fraction(Php::Parameters ¶meters); 33 | 34 | Php::Value get_fraction(); 35 | 36 | void set_inverted(Php::Parameters ¶meters); 37 | 38 | Php::Value get_inverted(); 39 | 40 | void set_show_text(Php::Parameters ¶meters); 41 | 42 | Php::Value get_show_text(); 43 | 44 | void set_text(Php::Parameters ¶meters); 45 | 46 | Php::Value get_text(); 47 | 48 | void set_ellipsize(Php::Parameters ¶meters); 49 | 50 | Php::Value get_ellipsize(); 51 | 52 | void set_pulse_step(Php::Parameters ¶meters); 53 | 54 | Php::Value get_pulse_step(); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/Gtk/GtkRadioButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKRADIOBUTTON_H_ 3 | #define _PHPGTK_GTKRADIOBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkCheckButton.h" 9 | 10 | /** 11 | * GtkRadioButton_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkRadioButton.html 14 | */ 15 | class GtkRadioButton_ : public GtkCheckButton_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkRadioButton_(); 26 | ~GtkRadioButton_(); 27 | 28 | void __construct(Php::Parameters ¶meters); 29 | 30 | static Php::Value new_from_widget(Php::Parameters ¶meters); 31 | 32 | static Php::Value new_with_label(Php::Parameters ¶meters); 33 | 34 | static Php::Value new_with_label_from_widget(Php::Parameters ¶meters); 35 | 36 | static Php::Value new_with_mnemonic(Php::Parameters ¶meters); 37 | 38 | static Php::Value new_with_mnemonic_from_widget(Php::Parameters ¶meters); 39 | 40 | void set_group(Php::Parameters ¶meters); 41 | 42 | Php::Value get_group(); 43 | 44 | void join_group(Php::Parameters ¶meters); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Gtk/GtkRequisition.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkRequisition.h" 3 | 4 | /** 5 | * C++ constructor and destructor 6 | */ 7 | GtkRequisition_::GtkRequisition_() = default; 8 | GtkRequisition_::~GtkRequisition_() = default; 9 | 10 | /** 11 | * PHP Constructor 12 | */ 13 | void GtkRequisition_::__construct(Php::Parameters ¶meters) 14 | { 15 | width = parameters[0]; 16 | height = parameters[1]; 17 | } -------------------------------------------------------------------------------- /src/Gtk/GtkRequisition.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKREQUISITION_H_ 3 | #define _PHPGTK_GTKREQUISITION_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /** 10 | * 11 | */ 12 | class GtkRequisition_ : public Php::Base 13 | { 14 | 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | int width; 21 | int height; 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkRequisition_(); 27 | virtual ~GtkRequisition_(); 28 | 29 | /** 30 | * PHP Construct 31 | */ 32 | void __construct(Php::Parameters ¶meters); 33 | }; 34 | 35 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkRevealer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkRevealer.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkRevealer_::GtkRevealer_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkRevealer_::~GtkRevealer_() = default; 13 | 14 | void GtkRevealer_::__construct() 15 | { 16 | instance = (gpointer *)gtk_revealer_new (); 17 | 18 | } 19 | 20 | Php::Value GtkRevealer_::get_reveal_child() 21 | { 22 | bool ret = gtk_revealer_get_reveal_child (GTK_REVEALER(instance)); 23 | 24 | return ret; 25 | } 26 | 27 | void GtkRevealer_::set_reveal_child(Php::Parameters ¶meters) 28 | { 29 | gboolean reveal_child = (gboolean)parameters[0]; 30 | 31 | gtk_revealer_set_reveal_child (GTK_REVEALER(instance), reveal_child); 32 | 33 | } 34 | 35 | Php::Value GtkRevealer_::get_child_revealed() 36 | { 37 | bool ret = gtk_revealer_get_child_revealed (GTK_REVEALER(instance)); 38 | 39 | return ret; 40 | } 41 | 42 | Php::Value GtkRevealer_::get_transition_duration() 43 | { 44 | int ret = gtk_revealer_get_transition_duration (GTK_REVEALER(instance)); 45 | 46 | return ret; 47 | } 48 | 49 | void GtkRevealer_::set_transition_duration(Php::Parameters ¶meters) 50 | { 51 | guint duration = (int)parameters[0]; 52 | 53 | gtk_revealer_set_transition_duration (GTK_REVEALER(instance), duration); 54 | 55 | } 56 | 57 | Php::Value GtkRevealer_::get_transition_type() 58 | { 59 | GtkRevealerTransitionType ret = gtk_revealer_get_transition_type (GTK_REVEALER(instance)); 60 | 61 | return ret; 62 | } 63 | 64 | void GtkRevealer_::set_transition_type(Php::Parameters ¶meters) 65 | { 66 | int int_transition = (int)parameters[0]; 67 | GtkRevealerTransitionType transition = (GtkRevealerTransitionType)int_transition; 68 | 69 | gtk_revealer_set_transition_type (GTK_REVEALER(instance), transition); 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/Gtk/GtkRevealer.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKREVEALER_H_ 3 | #define _PHPGTK_GTKREVEALER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkWidget.h" 10 | 11 | /** 12 | * GtkRevealer_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkRevealer.html 15 | */ 16 | class GtkRevealer_ : public GtkBin_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkRevealer_(); 27 | ~GtkRevealer_(); 28 | 29 | void __construct(); 30 | 31 | Php::Value get_reveal_child(); 32 | 33 | void set_reveal_child(Php::Parameters ¶meters); 34 | 35 | Php::Value get_child_revealed(); 36 | 37 | Php::Value get_transition_duration(); 38 | 39 | void set_transition_duration(Php::Parameters ¶meters); 40 | 41 | Php::Value get_transition_type(); 42 | 43 | void set_transition_type(Php::Parameters ¶meters); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Gtk/GtkScrolledWindow.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSCROLLEDWINDOW_H_ 3 | #define _PHPGTK_GTKSCROLLEDWINDOW_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | 10 | /** 11 | * GtkScrolledWindow_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkScrolledWindow.html 14 | */ 15 | class GtkScrolledWindow_ : public GtkContainer_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | /** 22 | * C++ constructor and destructor 23 | */ 24 | GtkScrolledWindow_(); 25 | ~GtkScrolledWindow_(); 26 | 27 | /** 28 | * PHP Construct 29 | */ 30 | void __construct(Php::Parameters ¶meters); 31 | 32 | void set_overlay_scrolling(Php::Parameters ¶meters); 33 | 34 | /** 35 | * Sets the scrollbar policy for the horizontal and vertical scrollbars. 36 | * 37 | * https://developer.gnome.org/gtk3/stable/GtkScrolledWindow.html#gtk-scrolled-window-set-policy 38 | */ 39 | void set_policy(Php::Parameters ¶meters); 40 | 41 | void set_shadow_type(Php::Parameters ¶meters); 42 | 43 | void set_propagate_natural_height(Php::Parameters ¶meters); 44 | 45 | void set_propagate_natural_width(Php::Parameters ¶meters); 46 | 47 | void set_max_content_height(Php::Parameters ¶meters); 48 | void set_min_content_height(Php::Parameters ¶meters); 49 | 50 | Php::Value get_hadjustment(); 51 | 52 | Php::Value get_vadjustment(); 53 | 54 | void set_max_content_width(Php::Parameters ¶meters); 55 | void set_min_content_width(Php::Parameters ¶meters); 56 | }; 57 | 58 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkSeparator.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "GtkSeparator.h" 4 | 5 | GtkSeparator_::GtkSeparator_() = default; 6 | GtkSeparator_::~GtkSeparator_() = default; 7 | 8 | void GtkSeparator_::__construct(Php::Parameters ¶meters) 9 | { 10 | int porientation = parameters[0]; 11 | GtkOrientation orientation = (GtkOrientation) porientation; 12 | 13 | instance = (gpointer *)gtk_separator_new(orientation); 14 | } 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Gtk/GtkSeparator.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _PHPGTK_GTKSEPARATOR_H_ 4 | #define _PHPGTK_GTKSEPARATOR_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "GtkWidget.h" 10 | 11 | class GtkSeparator_ : public GtkWidget_ 12 | { 13 | public: 14 | GtkSeparator_(); 15 | ~GtkSeparator_(); 16 | 17 | void __construct(Php::Parameters ¶meters); 18 | 19 | 20 | }; 21 | 22 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkSeparatorMenuItem.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkSeparatorMenuItem.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkSeparatorMenuItem_::GtkSeparatorMenuItem_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkSeparatorMenuItem_::~GtkSeparatorMenuItem_() = default; 13 | 14 | void GtkSeparatorMenuItem_::__construct() 15 | { 16 | instance = (gpointer *)gtk_separator_menu_item_new (); 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/Gtk/GtkSeparatorMenuItem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSEPARATORMENUITEM_H_ 3 | #define _PHPGTK_GTKSEPARATORMENUITEM_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkMenuItem.h" 9 | 10 | /** 11 | * GtkSeparatorMenuItem_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkSeparatorMenuItem.html 14 | */ 15 | class GtkSeparatorMenuItem_ : public GtkMenuItem_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkSeparatorMenuItem_(); 26 | ~GtkSeparatorMenuItem_(); 27 | 28 | void __construct(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/Gtk/GtkSeparatorToolItem.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkSeparatorToolItem.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkSeparatorToolItem_::GtkSeparatorToolItem_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkSeparatorToolItem_::~GtkSeparatorToolItem_() = default; 13 | 14 | void GtkSeparatorToolItem_::__construct() 15 | { 16 | instance = (gpointer *)gtk_separator_tool_item_new (); 17 | 18 | } 19 | 20 | void GtkSeparatorToolItem_::set_draw(Php::Parameters ¶meters) 21 | { 22 | gboolean homogeneous = (gboolean)parameters[0]; 23 | 24 | gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM(instance), homogeneous); 25 | 26 | } 27 | 28 | Php::Value GtkSeparatorToolItem_::get_draw() 29 | { 30 | bool ret = gtk_separator_tool_item_get_draw (GTK_SEPARATOR_TOOL_ITEM(instance)); 31 | 32 | return ret; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/Gtk/GtkSeparatorToolItem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSEPARATORTOOLITEM_H_ 3 | #define _PHPGTK_GTKSEPARATORTOOLITEM_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkToolItem.h" 9 | 10 | /** 11 | * GtkSeparatorToolItem_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkSeparatorToolItem.html 14 | */ 15 | class GtkSeparatorToolItem_ : public GtkToolItem_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkSeparatorToolItem_(); 26 | ~GtkSeparatorToolItem_(); 27 | 28 | void __construct(); 29 | 30 | void set_draw(Php::Parameters ¶meters); 31 | 32 | Php::Value get_draw(); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Gtk/GtkSizeGroup.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkSizeGroup.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkSizeGroup_::GtkSizeGroup_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkSizeGroup_::~GtkSizeGroup_() = default; 13 | 14 | void GtkSizeGroup_::__construct(Php::Parameters ¶meters) 15 | { 16 | int int_mode = (int)parameters[0]; 17 | GtkSizeGroupMode mode = (GtkSizeGroupMode)int_mode; 18 | 19 | instance = (gpointer *)gtk_size_group_new (mode); 20 | 21 | } 22 | 23 | void GtkSizeGroup_::set_mode(Php::Parameters ¶meters) 24 | { 25 | int int_mode = (int)parameters[0]; 26 | GtkSizeGroupMode mode = (GtkSizeGroupMode)int_mode; 27 | 28 | gtk_size_group_set_mode (GTK_SIZE_GROUP(instance), mode); 29 | 30 | } 31 | 32 | Php::Value GtkSizeGroup_::get_mode() 33 | { 34 | GtkSizeGroupMode ret = gtk_size_group_get_mode (GTK_SIZE_GROUP(instance)); 35 | 36 | return ret; 37 | } 38 | 39 | void GtkSizeGroup_::add_widget(Php::Parameters ¶meters) 40 | { 41 | GtkWidget *widget; 42 | if(parameters.size() > 0) { 43 | Php::Value object_widget = parameters[0]; 44 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 45 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 46 | } 47 | 48 | gtk_size_group_add_widget (GTK_SIZE_GROUP(instance), widget); 49 | 50 | } 51 | 52 | void GtkSizeGroup_::remove_widget(Php::Parameters ¶meters) 53 | { 54 | GtkWidget *widget; 55 | if(parameters.size() > 0) { 56 | Php::Value object_widget = parameters[0]; 57 | GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation(); 58 | widget = GTK_WIDGET(phpgtk_widget->get_instance()); 59 | } 60 | 61 | gtk_size_group_remove_widget (GTK_SIZE_GROUP(instance), widget); 62 | 63 | } 64 | 65 | Php::Value GtkSizeGroup_::get_widgets() 66 | { 67 | // GSList ret = gtk_size_group_get_widgets (GTK_SIZE_GROUP(instance)); 68 | 69 | // return ret; 70 | 71 | return 1; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/Gtk/GtkSizeGroup.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSIZEGROUP_H_ 3 | #define _PHPGTK_GTKSIZEGROUP_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "GtkWidget.h" 10 | 11 | /** 12 | * GtkSizeGroup_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkSizeGroup.html 15 | */ 16 | class GtkSizeGroup_ : public GObject_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkSizeGroup_(); 27 | ~GtkSizeGroup_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | 31 | void set_mode(Php::Parameters ¶meters); 32 | 33 | Php::Value get_mode(); 34 | 35 | void add_widget(Php::Parameters ¶meters); 36 | 37 | void remove_widget(Php::Parameters ¶meters); 38 | 39 | Php::Value get_widgets(); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Gtk/GtkSpinner.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkSpinner.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkSpinner_::GtkSpinner_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkSpinner_::~GtkSpinner_() = default; 13 | 14 | void GtkSpinner_::__construct() 15 | { 16 | instance = (gpointer *)gtk_spinner_new (); 17 | 18 | } 19 | 20 | void GtkSpinner_::start() 21 | { 22 | gtk_spinner_start (GTK_SPINNER(instance)); 23 | 24 | } 25 | 26 | void GtkSpinner_::stop() 27 | { 28 | gtk_spinner_stop (GTK_SPINNER(instance)); 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Gtk/GtkSpinner.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSPINNER_H_ 3 | #define _PHPGTK_GTKSPINNER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkWidget.h" 9 | 10 | /** 11 | * GtkSpinner_ 12 | * 13 | * https://developer.gnome.org/gtk3/stable/GtkSpinner.html 14 | */ 15 | class GtkSpinner_ : public GtkWidget_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkSpinner_(); 26 | ~GtkSpinner_(); 27 | 28 | void __construct(); 29 | 30 | void start(); 31 | 32 | void stop(); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Gtk/GtkStack.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSTACK_H_ 3 | #define _PHPGTK_GTKSTACK_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | 10 | #include "../../php-gtk.h" 11 | 12 | /** 13 | * GtkStack_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkStack.html 16 | */ 17 | class GtkStack_ : public GtkContainer_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkStack_(); 28 | ~GtkStack_(); 29 | 30 | void __construct(); 31 | 32 | void add_named(Php::Parameters ¶meters); 33 | 34 | void add_titled(Php::Parameters ¶meters); 35 | 36 | Php::Value get_child_by_name(Php::Parameters ¶meters); 37 | 38 | void set_visible_child(Php::Parameters ¶meters); 39 | 40 | Php::Value get_visible_child(); 41 | 42 | void set_visible_child_name(Php::Parameters ¶meters); 43 | 44 | Php::Value get_visible_child_name(); 45 | 46 | void set_visible_child_full(Php::Parameters ¶meters); 47 | 48 | void set_homogeneous(Php::Parameters ¶meters); 49 | 50 | Php::Value get_homogeneous(); 51 | 52 | void set_hhomogeneous(Php::Parameters ¶meters); 53 | 54 | Php::Value get_hhomogeneous(); 55 | 56 | void set_vhomogeneous(Php::Parameters ¶meters); 57 | 58 | Php::Value get_vhomogeneous(); 59 | 60 | void set_transition_duration(Php::Parameters ¶meters); 61 | 62 | Php::Value get_transition_duration(); 63 | 64 | void set_transition_type(Php::Parameters ¶meters); 65 | 66 | Php::Value get_transition_type(); 67 | 68 | Php::Value get_transition_running(); 69 | 70 | Php::Value get_interpolate_size(); 71 | 72 | void set_interpolate_size(Php::Parameters ¶meters); 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/Gtk/GtkStackSidebar.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkStackSidebar.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkStackSidebar_::GtkStackSidebar_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkStackSidebar_::~GtkStackSidebar_() = default; 13 | 14 | void GtkStackSidebar_::__construct() 15 | { 16 | instance = (gpointer *)gtk_stack_sidebar_new (); 17 | 18 | } 19 | 20 | void GtkStackSidebar_::set_stack(Php::Parameters ¶meters) 21 | { 22 | GtkStack *stack; 23 | if(parameters.size() > 0) { 24 | Php::Value object_stack = parameters[0]; 25 | GtkStack_ *phpgtk_stack = (GtkStack_ *)object_stack.implementation(); 26 | stack = GTK_STACK(phpgtk_stack->get_instance()); 27 | } 28 | 29 | gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR(instance), stack); 30 | 31 | } 32 | 33 | Php::Value GtkStackSidebar_::get_stack() 34 | { 35 | GtkStack *ret = gtk_stack_sidebar_get_stack (GTK_STACK_SIDEBAR(instance)); 36 | 37 | GtkStack_ *return_parsed = new GtkStack_(); 38 | return_parsed->set_instance((gpointer *)ret); 39 | return Php::Object("GtkStack", return_parsed); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/Gtk/GtkStackSidebar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSTACKSIDEBAR_H_ 3 | #define _PHPGTK_GTKSTACKSIDEBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBin.h" 9 | #include "GtkStack.h" 10 | 11 | /** 12 | * GtkStackSidebar_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkStackSidebar.html 15 | */ 16 | class GtkStackSidebar_ : public GtkBin_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkStackSidebar_(); 27 | ~GtkStackSidebar_(); 28 | 29 | void __construct(); 30 | 31 | void set_stack(Php::Parameters ¶meters); 32 | 33 | Php::Value get_stack(); 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/Gtk/GtkStackSwitcher.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkStackSwitcher.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkStackSwitcher_::GtkStackSwitcher_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkStackSwitcher_::~GtkStackSwitcher_() = default; 13 | 14 | void GtkStackSwitcher_::__construct() 15 | { 16 | instance = (gpointer *)gtk_stack_switcher_new (); 17 | 18 | } 19 | 20 | void GtkStackSwitcher_::set_stack(Php::Parameters ¶meters) 21 | { 22 | GtkStack *stack; 23 | if(parameters.size() > 0) { 24 | Php::Value object_stack = parameters[0]; 25 | GtkStack_ *phpgtk_stack = (GtkStack_ *)object_stack.implementation(); 26 | stack = GTK_STACK(phpgtk_stack->get_instance()); 27 | } 28 | 29 | gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER(instance), stack); 30 | 31 | } 32 | 33 | Php::Value GtkStackSwitcher_::get_stack() 34 | { 35 | GtkStack *ret = gtk_stack_switcher_get_stack (GTK_STACK_SWITCHER(instance)); 36 | 37 | GtkStack_ *return_parsed = new GtkStack_(); 38 | return_parsed->set_instance((gpointer *)ret); 39 | return Php::Object("GtkStack", return_parsed); 40 | } 41 | 42 | 43 | void GtkStackSwitcher_::set_orientation(Php::Parameters ¶meters) 44 | { 45 | // Cast GtkOrientation param 46 | int php_orientation = parameters[0]; 47 | GtkOrientation orientation = (GtkOrientation)php_orientation; 48 | 49 | gtk_orientable_set_orientation(GTK_ORIENTABLE(instance), orientation); 50 | } 51 | 52 | Php::Value GtkStackSwitcher_::get_orientation() 53 | { 54 | return gtk_orientable_get_orientation(GTK_ORIENTABLE(instance)); 55 | } 56 | -------------------------------------------------------------------------------- /src/Gtk/GtkStackSwitcher.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSTACKSWITCHER_H_ 3 | #define _PHPGTK_GTKSTACKSWITCHER_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBox.h" 9 | #include "GtkStack.h" 10 | 11 | /** 12 | * GtkStackSwitcher_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkStackSwitcher.html 15 | */ 16 | class GtkStackSwitcher_ : public GtkBox_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkStackSwitcher_(); 27 | ~GtkStackSwitcher_(); 28 | 29 | void __construct(); 30 | 31 | void set_stack(Php::Parameters ¶meters); 32 | 33 | Php::Value get_stack(); 34 | void set_orientation(Php::Parameters ¶meters); 35 | Php::Value get_orientation(); 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/Gtk/GtkStatusIcon.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _PHPGTK_GTKSTATUSICON_H_ 4 | #define _PHPGTK_GTKSTATUSICON_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "../G/GObject.h" 10 | #include "../Gdk/GdkPixbuf.h" 11 | #include "GtkWidget.h" 12 | #include "GtkMenu.h" 13 | 14 | class GtkStatusIcon_ : public GObject_ 15 | { 16 | public: 17 | GtkStatusIcon_(); 18 | ~GtkStatusIcon_(); 19 | 20 | void set_from_pixbuf(Php::Parameters ¶meters); 21 | void set_from_file(Php::Parameters ¶meters); 22 | void set_from_stock(Php::Parameters ¶meters); 23 | void set_from_icon_name(Php::Parameters ¶meters); 24 | //Php::Value get_storage_type(); 25 | Php::Value get_pixbuf(); 26 | Php::Value get_stock(); 27 | Php::Value get_icon_name(); 28 | //Php::Value get_gicon(); 29 | Php::Value get_size(); 30 | Php::Value get_screen(); 31 | void set_has_tooltip(Php::Parameters ¶meters); 32 | void set_tooltip_text(Php::Parameters ¶meters); 33 | void set_tooltip_markup(Php::Parameters ¶meters); 34 | void set_title(Php::Parameters ¶meters); 35 | Php::Value get_title(); 36 | void set_name(Php::Parameters ¶meters); 37 | void set_visible(Php::Parameters ¶meters); 38 | Php::Value get_visible(); 39 | Php::Value is_embedded(); 40 | Php::Value get_has_tooltip(); 41 | Php::Value get_tooltip_text(); 42 | Php::Value get_tooltip_markup(); 43 | //Php::Value get_x11_window_id(); 44 | void __construct(); 45 | static Php::Value new_from_pixbuf(Php::Parameters ¶meters); 46 | static Php::Value new_from_file(Php::Parameters ¶meters); 47 | static Php::Value new_from_stock(Php::Parameters ¶meters); 48 | static Php::Value new_from_icon_name(Php::Parameters ¶meters); 49 | Php::Value position_menu(Php::Parameters ¶meters); 50 | 51 | 52 | }; 53 | 54 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkStatusbar.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkStatusbar.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkStatusbar_::GtkStatusbar_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkStatusbar_::~GtkStatusbar_() = default; 13 | 14 | void GtkStatusbar_::__construct() 15 | { 16 | instance = (gpointer *)gtk_statusbar_new (); 17 | 18 | } 19 | 20 | Php::Value GtkStatusbar_::get_context_id(Php::Parameters ¶meters) 21 | { 22 | std::string s_context_description = parameters[0]; 23 | gchar *context_description = (gchar *)s_context_description.c_str(); 24 | 25 | int ret = gtk_statusbar_get_context_id (GTK_STATUSBAR(instance), context_description); 26 | 27 | return ret; 28 | } 29 | 30 | Php::Value GtkStatusbar_::push(Php::Parameters ¶meters) 31 | { 32 | guint context_id = (int)parameters[0]; 33 | 34 | std::string s_text = parameters[1]; 35 | gchar *text = (gchar *)s_text.c_str(); 36 | 37 | int ret = gtk_statusbar_push (GTK_STATUSBAR(instance), context_id, text); 38 | 39 | return ret; 40 | } 41 | 42 | void GtkStatusbar_::pop(Php::Parameters ¶meters) 43 | { 44 | guint context_id = (int)parameters[0]; 45 | 46 | gtk_statusbar_pop (GTK_STATUSBAR(instance), context_id); 47 | 48 | } 49 | 50 | void GtkStatusbar_::remove(Php::Parameters ¶meters) 51 | { 52 | guint context_id = (int)parameters[0]; 53 | 54 | guint message_id = (int)parameters[1]; 55 | 56 | gtk_statusbar_remove (GTK_STATUSBAR(instance), context_id, message_id); 57 | 58 | } 59 | 60 | void GtkStatusbar_::remove_all(Php::Parameters ¶meters) 61 | { 62 | guint context_id = (int)parameters[0]; 63 | 64 | gtk_statusbar_remove_all (GTK_STATUSBAR(instance), context_id); 65 | 66 | } 67 | 68 | Php::Value GtkStatusbar_::get_message_area() 69 | { 70 | gpointer *ret = (gpointer *)gtk_statusbar_get_message_area (GTK_STATUSBAR(instance)); 71 | 72 | return cobject_to_phpobject(ret); 73 | 74 | // GtkWidget_ *return_parsed = new GtkWidget_(); 75 | // return_parsed->set_instance((gpointer *)ret); 76 | // return Php::Object("GtkWidget", return_parsed); 77 | } 78 | 79 | -------------------------------------------------------------------------------- /src/Gtk/GtkStatusbar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKSTATUSBAR_H_ 3 | #define _PHPGTK_GTKSTATUSBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBox.h" 9 | 10 | #include "../../php-gtk.h" 11 | 12 | /** 13 | * GtkStatusbar_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkStatusbar.html 16 | */ 17 | class GtkStatusbar_ : public GtkBox_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkStatusbar_(); 28 | ~GtkStatusbar_(); 29 | 30 | void __construct(); 31 | 32 | Php::Value get_context_id(Php::Parameters ¶meters); 33 | 34 | Php::Value push(Php::Parameters ¶meters); 35 | 36 | void pop(Php::Parameters ¶meters); 37 | 38 | void remove(Php::Parameters ¶meters); 39 | 40 | void remove_all(Php::Parameters ¶meters); 41 | 42 | Php::Value get_message_area(); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/Gtk/GtkTable.h: -------------------------------------------------------------------------------- 1 | #ifndef _PHPGTK_GTKTABLE_H_ 2 | #define _PHPGTK_GTKTABLE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "../../php-gtk.h" 8 | 9 | #include "GtkContainer.h" 10 | 11 | 12 | class GtkTable_ : public GtkContainer_ 13 | { 14 | public: 15 | GtkTable_(); 16 | ~GtkTable_(); 17 | 18 | void resize(Php::Parameters ¶meters); 19 | void attach(Php::Parameters ¶meters); 20 | void attach_defaults(Php::Parameters ¶meters); 21 | void set_row_spacing(Php::Parameters ¶meters); 22 | Php::Value get_row_spacing(Php::Parameters ¶meters); 23 | void set_col_spacing(Php::Parameters ¶meters); 24 | Php::Value get_col_spacing(Php::Parameters ¶meters); 25 | void set_row_spacings(Php::Parameters ¶meters); 26 | Php::Value get_default_row_spacing(); 27 | void set_col_spacings(Php::Parameters ¶meters); 28 | Php::Value get_default_col_spacing(); 29 | void set_homogeneous(Php::Parameters ¶meters); 30 | Php::Value get_homogeneous(); 31 | Php::Value get_size(Php::Parameters ¶meters); 32 | void __construct(Php::Parameters ¶meters); 33 | 34 | }; 35 | 36 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkTextMark.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkTextMark.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkTextMark_::GtkTextMark_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkTextMark_::~GtkTextMark_() = default; 13 | 14 | void GtkTextMark_::__construct(Php::Parameters ¶meters) 15 | { 16 | std::string s_name = parameters[0]; 17 | gchar *name = (gchar *)s_name.c_str(); 18 | 19 | gboolean left_gravity = (gboolean)parameters[1]; 20 | 21 | instance = (gpointer *)gtk_text_mark_new (name, left_gravity); 22 | 23 | } 24 | 25 | void GtkTextMark_::set_visible(Php::Parameters ¶meters) 26 | { 27 | gboolean setting = (gboolean)parameters[0]; 28 | 29 | gtk_text_mark_set_visible (GTK_TEXT_MARK(instance), setting); 30 | 31 | } 32 | 33 | Php::Value GtkTextMark_::set_buffer() 34 | { 35 | bool ret = gtk_text_mark_get_visible (GTK_TEXT_MARK(instance)); 36 | 37 | return ret; 38 | } 39 | 40 | Php::Value GtkTextMark_::get_deleted() 41 | { 42 | bool ret = gtk_text_mark_get_deleted (GTK_TEXT_MARK(instance)); 43 | 44 | return ret; 45 | } 46 | 47 | Php::Value GtkTextMark_::get_name() 48 | { 49 | std::string ret = gtk_text_mark_get_name (GTK_TEXT_MARK(instance)); 50 | 51 | return ret; 52 | } 53 | 54 | Php::Value GtkTextMark_::get_buffer() 55 | { 56 | GtkTextBuffer *ret = gtk_text_mark_get_buffer (GTK_TEXT_MARK(instance)); 57 | 58 | GtkTextBuffer_ *return_parsed = new GtkTextBuffer_(); 59 | return_parsed->set_instance((gpointer *)ret); 60 | return Php::Object("GtkTextBuffer", return_parsed); 61 | } 62 | 63 | Php::Value GtkTextMark_::get_left_gravity() 64 | { 65 | bool ret = gtk_text_mark_get_left_gravity (GTK_TEXT_MARK(instance)); 66 | 67 | return ret; 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/Gtk/GtkTextMark.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTEXTMARK_H_ 3 | #define _PHPGTK_GTKTEXTMARK_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "GtkTextBuffer.h" 10 | 11 | /** 12 | * GtkTextMark_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkTextMark.html 15 | */ 16 | class GtkTextMark_ : public GObject_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkTextMark_(); 27 | ~GtkTextMark_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | 31 | void set_visible(Php::Parameters ¶meters); 32 | 33 | Php::Value set_buffer(); 34 | 35 | Php::Value get_deleted(); 36 | 37 | Php::Value get_name(); 38 | 39 | Php::Value get_buffer(); 40 | 41 | Php::Value get_left_gravity(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Gtk/GtkTextTag.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkTextTag.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkTextTag_::GtkTextTag_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkTextTag_::~GtkTextTag_() = default; 13 | 14 | /** 15 | * Return original GtkTreeIter 16 | */ 17 | GtkTextTag *GtkTextTag_::get_tag() 18 | { 19 | return tag; 20 | } 21 | 22 | /** 23 | * Set the original GtkTextTag 24 | */ 25 | void GtkTextTag_::set_tag(GtkTextTag *passed_tag) 26 | { 27 | tag = passed_tag; 28 | } 29 | 30 | 31 | void GtkTextTag_::__construct(Php::Parameters ¶meters) 32 | { 33 | std::string s_name = parameters[0]; 34 | gchar *name = (gchar *)s_name.c_str(); 35 | 36 | tag = gtk_text_tag_new (name); 37 | 38 | } 39 | 40 | Php::Value GtkTextTag_::get_priority() 41 | { 42 | gint ret = gtk_text_tag_get_priority (tag); 43 | 44 | return ret; 45 | } 46 | 47 | void GtkTextTag_::set_priority(Php::Parameters ¶meters) 48 | { 49 | gint priority = (gint)parameters[0]; 50 | 51 | gtk_text_tag_set_priority (tag, priority); 52 | 53 | } 54 | 55 | Php::Value GtkTextTag_::event(Php::Parameters ¶meters) 56 | { 57 | // GtkTextIter *iter; 58 | // if(parameters.size() > 2) { 59 | // Php::Value object_iter = parameters[2]; 60 | // GtkTextIter_ *phpgtk_iter = (GtkTextIter_ *)object_iter.implementation(); 61 | // iter = GTK_WIDGET(phpgtk_iter->get_instance()); 62 | // } 63 | 64 | // GtkTextIter *iter; 65 | // if(parameters.size() > 2) { 66 | // Php::Value object_iter = parameters[2]; 67 | // GtkTextIter_ *phpgtk_iter = (GtkTextIter_ *)object_iter.implementation(); 68 | // iter = GTK_WIDGET(phpgtk_iter->get_instance()); 69 | // } 70 | 71 | // gboolean ret = gtk_text_tag_event (tag, event_object, event, iter); 72 | 73 | // return ret; 74 | 75 | 76 | throw Php::Exception("GtkTextTag_::event not implemented"); 77 | return -1; 78 | } 79 | 80 | void GtkTextTag_::tag_changed(Php::Parameters ¶meters) 81 | { 82 | gboolean size_changed = (gboolean)parameters[0]; 83 | 84 | gtk_text_tag_changed (tag, size_changed); 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/Gtk/GtkTextTag.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTEXTTAG_H_ 3 | #define _PHPGTK_GTKTEXTTAG_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "../Gdk/GdkEvent.h" 10 | #include "GtkTextIter.h" 11 | 12 | /** 13 | * GtkTextTag_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkTextTag.html 16 | */ 17 | class GtkTextTag_ : public GObject_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | GtkTextTag *tag; 25 | 26 | GtkTextTag *get_tag(); 27 | void set_tag(GtkTextTag *passed_tag); 28 | 29 | /** 30 | * C++ constructor and destructor 31 | */ 32 | GtkTextTag_(); 33 | ~GtkTextTag_(); 34 | 35 | void __construct(Php::Parameters ¶meters); 36 | 37 | Php::Value get_priority(); 38 | 39 | void set_priority(Php::Parameters ¶meters); 40 | 41 | Php::Value event(Php::Parameters ¶meters); 42 | 43 | void tag_changed(Php::Parameters ¶meters); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Gtk/GtkTextTagTable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTEXTTAGTABLE_H_ 3 | #define _PHPGTK_GTKTEXTTAGTABLE_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "GtkTextTag.h" 10 | 11 | /** 12 | * GtkTextTagTable_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkTextTagTable.html 15 | */ 16 | class GtkTextTagTable_ : public GObject_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkTextTagTable_(); 27 | ~GtkTextTagTable_(); 28 | 29 | void __construct(); 30 | 31 | Php::Value add(Php::Parameters ¶meters); 32 | 33 | void remove(Php::Parameters ¶meters); 34 | 35 | Php::Value lookup(Php::Parameters ¶meters); 36 | 37 | Php::Value foreach(Php::Parameters ¶meters); 38 | 39 | Php::Value get_size(); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Gtk/GtkToggleButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTOGGLEBUTTON_H_ 3 | #define _PHPGTK_GTKTOGGLEBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkButton.h" 9 | 10 | #include "../../php-gtk.h" 11 | 12 | /** 13 | * GtkToggleButton_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkToggleButton.html 16 | */ 17 | class GtkToggleButton_ : public GtkButton_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkToggleButton_(); 28 | ~GtkToggleButton_(); 29 | 30 | void __construct(); 31 | 32 | static Php::Value new_with_label(Php::Parameters ¶meters); 33 | 34 | static Php::Value new_with_mnemonic(Php::Parameters ¶meters); 35 | 36 | void set_mode(Php::Parameters ¶meters); 37 | 38 | Php::Value get_mode(); 39 | 40 | void toggled(); 41 | 42 | Php::Value get_active(); 43 | 44 | void set_active(Php::Parameters ¶meters); 45 | 46 | Php::Value get_inconsistent(); 47 | 48 | void set_inconsistent(Php::Parameters ¶meters); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Gtk/GtkToolButton.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTOOLBUTTON_H_ 3 | #define _PHPGTK_GTKTOOLBUTTON_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkToolItem.h" 9 | #include "GtkWidget.h" 10 | 11 | #include "../../php-gtk.h" 12 | 13 | /** 14 | * GtkToolButton_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkToolButton.html 17 | */ 18 | class GtkToolButton_ : public GtkToolItem_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkToolButton_(); 29 | ~GtkToolButton_(); 30 | 31 | void __construct(Php::Parameters ¶meters); 32 | 33 | void set_label(Php::Parameters ¶meters); 34 | 35 | Php::Value get_label(); 36 | 37 | void set_use_underline(Php::Parameters ¶meters); 38 | 39 | Php::Value get_use_underline(); 40 | 41 | void set_icon_name(Php::Parameters ¶meters); 42 | 43 | Php::Value get_icon_name(); 44 | 45 | void set_icon_widget(Php::Parameters ¶meters); 46 | 47 | Php::Value get_icon_widget(); 48 | 49 | void set_label_widget(Php::Parameters ¶meters); 50 | 51 | Php::Value get_label_widget(); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Gtk/GtkToolbar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTOOLBAR_H_ 3 | #define _PHPGTK_GTKTOOLBAR_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkContainer.h" 9 | #include "GtkWidget.h" 10 | #include "GtkToolItem.h" 11 | 12 | /** 13 | * GtkToolbar_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkToolbar.html 16 | */ 17 | class GtkToolbar_ : public GtkContainer_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkToolbar_(); 28 | ~GtkToolbar_(); 29 | 30 | void __construct(); 31 | 32 | void insert(Php::Parameters ¶meters); 33 | 34 | Php::Value get_item_index(Php::Parameters ¶meters); 35 | 36 | Php::Value get_n_items(); 37 | 38 | Php::Value get_nth_item(Php::Parameters ¶meters); 39 | 40 | Php::Value get_drop_index(Php::Parameters ¶meters); 41 | 42 | void set_drop_highlight_item(Php::Parameters ¶meters); 43 | 44 | void set_show_arrow(Php::Parameters ¶meters); 45 | 46 | void unset_icon_size(); 47 | 48 | Php::Value get_show_arrow(); 49 | 50 | Php::Value get_style(); 51 | 52 | Php::Value get_icon_size(); 53 | 54 | Php::Value get_relief_style(); 55 | 56 | void set_style(Php::Parameters ¶meters); 57 | 58 | void set_icon_size(Php::Parameters ¶meters); 59 | 60 | void unset_style(); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/Gtk/GtkTreeIter.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkTreeIter.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkTreeIter_::GtkTreeIter_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkTreeIter_::~GtkTreeIter_() = default; 13 | 14 | /** 15 | * Return original GtkTreeIter 16 | */ 17 | GtkTreeIter GtkTreeIter_::get_instance() 18 | { 19 | return instance; 20 | } 21 | 22 | /** 23 | * Set the original GtkTreeIter 24 | */ 25 | void GtkTreeIter_::set_instance(GtkTreeIter passed_instance) 26 | { 27 | instance = passed_instance; 28 | } -------------------------------------------------------------------------------- /src/Gtk/GtkTreeIter.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTREEITER_H_ 3 | #define _PHPGTK_GTKTREEITER_H_ 4 | 5 | #include 6 | #include 7 | 8 | /** 9 | * GtkTreeIter_ 10 | * 11 | * https://developer.gnome.org/gtk3/stable/GtkTreeModel.html#GtkTreeIter-struct 12 | */ 13 | class GtkTreeIter_ : public Php::Base 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | GtkTreeIter instance; 21 | 22 | /** 23 | * C++ constructor and destructor 24 | */ 25 | GtkTreeIter_(); 26 | ~GtkTreeIter_(); 27 | 28 | /** 29 | * Return original GtkTreeIter 30 | */ 31 | GtkTreeIter get_instance(); 32 | 33 | /** 34 | * Set the original GtkTreeIter 35 | */ 36 | void set_instance(GtkTreeIter passed_instance); 37 | }; 38 | 39 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkTreeModel.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_TREEMODEL_H_ 3 | #define _PHPGTK_TREEMODEL_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkTreeIter.h" 9 | 10 | #include "../G/GObject.h" 11 | 12 | /** 13 | * GtkTreeModel_ 14 | * 15 | * https://developer.gnome.org/gtk3/stable/GtkTreeModel.html 16 | */ 17 | class GtkTreeModel_ : public GObject_ 18 | { 19 | 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | GtkTreeModel *model; 26 | 27 | /** 28 | * C++ constructor and destructor 29 | */ 30 | GtkTreeModel_(); 31 | ~GtkTreeModel_(); 32 | 33 | /** 34 | * Return original GtkTreeModel 35 | */ 36 | GtkTreeModel *get_model(); 37 | 38 | /** 39 | * Set the original GtkTreeModel 40 | */ 41 | void set_model(GtkTreeModel *passed_model); 42 | 43 | /** 44 | * PHP Construct 45 | */ 46 | void __construct(Php::Parameters ¶meters); 47 | 48 | 49 | Php::Value get_iter(Php::Parameters ¶meters); 50 | Php::Value get_value(Php::Parameters ¶meters); 51 | Php::Value get_path(Php::Parameters ¶meters); 52 | Php::Value get_iter_from_string(Php::Parameters ¶meters); 53 | }; 54 | 55 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkTreeSelection.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTREESELECTION_H_ 3 | #define _PHPGTK_GTKTREESELECTION_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "GtkTreeView.h" 10 | #include "GtkTreeIter.h" 11 | #include "GtkTreeModel.h" 12 | 13 | /** 14 | * GtkTreeSelection_ 15 | * 16 | * https://developer.gnome.org/gtk3/stable/GtkTreeSelection.html 17 | */ 18 | class GtkTreeSelection_ : public GObject_ 19 | { 20 | /** 21 | * Publics 22 | */ 23 | public: 24 | 25 | /** 26 | * C++ constructor and destructor 27 | */ 28 | GtkTreeSelection_(); 29 | ~GtkTreeSelection_(); 30 | 31 | void set_mode(Php::Parameters ¶meters); 32 | 33 | Php::Value get_mode(); 34 | 35 | void set_select_function(Php::Parameters ¶meters); 36 | 37 | void get_select_function(Php::Parameters ¶meters); 38 | 39 | Php::Value get_user_data(Php::Parameters ¶meters); 40 | 41 | Php::Value get_tree_view(); 42 | 43 | Php::Value get_selected(Php::Parameters ¶meters); 44 | 45 | void selected_foreach(Php::Parameters ¶meters); 46 | 47 | Php::Value get_selected_rows(); 48 | 49 | Php::Value count_selected_rows(); 50 | 51 | void select_path(Php::Parameters ¶meters); 52 | 53 | void unselect_path(Php::Parameters ¶meters); 54 | 55 | Php::Value path_is_selected(Php::Parameters ¶meters); 56 | 57 | void select_iter(Php::Parameters ¶meters); 58 | 59 | void unselect_iter(Php::Parameters ¶meters); 60 | 61 | Php::Value iter_is_selected(Php::Parameters ¶meters); 62 | 63 | void select_all(); 64 | 65 | void unselect_all(); 66 | 67 | void unselect_range(Php::Parameters ¶meters); 68 | 69 | void select_range(Php::Parameters& parameters); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/Gtk/GtkTreeSortable.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "GtkTreeSortable.h" 4 | 5 | GtkTreeSortable_::GtkTreeSortable_() = default; 6 | GtkTreeSortable_::~GtkTreeSortable_() = default; 7 | 8 | void GtkTreeSortable_::sort_column_changed() 9 | { 10 | gtk_tree_sortable_sort_column_changed(GTK_TREE_SORTABLE(instance)); 11 | } 12 | 13 | Php::Value GtkTreeSortable_::get_sort_column_id() 14 | { 15 | gint sort_column_id; 16 | GtkSortType order; 17 | 18 | gtk_tree_sortable_get_sort_column_id(GTK_TREE_SORTABLE(instance), &sort_column_id, &order); 19 | 20 | Php::Value ret; 21 | 22 | ret["sort_column_id"] = sort_column_id; 23 | ret["order"] = (int)order; 24 | 25 | ret[0] = sort_column_id; 26 | ret[1] = (int)order; 27 | 28 | return ret; 29 | } 30 | 31 | void GtkTreeSortable_::set_sort_column_id(Php::Parameters ¶meters) 32 | { 33 | gint sort_column_id = (gint)parameters[0]; 34 | 35 | int int_order = parameters[1]; 36 | GtkSortType order = (GtkSortType) int_order; 37 | 38 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(instance), sort_column_id, order); 39 | } 40 | 41 | Php::Value GtkTreeSortable_::has_default_sort_func() 42 | { 43 | bool ret = gtk_tree_sortable_has_default_sort_func(GTK_TREE_SORTABLE(instance)); 44 | 45 | return ret; 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/Gtk/GtkTreeSortable.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _PHPGTK_GTKTREESORTABLE_H_ 4 | #define _PHPGTK_GTKTREESORTABLE_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "../G/GObject.h" 10 | 11 | class GtkTreeSortable_ : public GObject_ 12 | { 13 | public: 14 | GtkTreeSortable_(); 15 | ~GtkTreeSortable_(); 16 | 17 | void sort_column_changed(); 18 | Php::Value get_sort_column_id(); 19 | void set_sort_column_id(Php::Parameters ¶meters); 20 | Php::Value has_default_sort_func(); 21 | 22 | 23 | }; 24 | 25 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkTreeStore.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKTREESTORE_H_ 3 | #define _PHPGTK_GTKTREESTORE_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkTreeModel.h" 9 | #include "../../main.h" 10 | 11 | /** 12 | * GtkTreeStore_ 13 | * 14 | * https://developer.gnome.org/gtk3/stable/GtkTreeStore.html 15 | */ 16 | class GtkTreeStore_ : public GtkTreeModel_ 17 | { 18 | /** 19 | * Publics 20 | */ 21 | public: 22 | 23 | /** 24 | * C++ constructor and destructor 25 | */ 26 | GtkTreeStore_(); 27 | ~GtkTreeStore_(); 28 | 29 | void __construct(Php::Parameters ¶meters); 30 | 31 | void set_column_types(Php::Parameters ¶meters); 32 | 33 | void set_value(Php::Parameters ¶meters); 34 | 35 | Php::Value remove(Php::Parameters ¶meters); 36 | 37 | Php::Value insert(Php::Parameters ¶meters); 38 | 39 | Php::Value insert_before(Php::Parameters ¶meters); 40 | 41 | Php::Value insert_after(Php::Parameters ¶meters); 42 | 43 | Php::Value insert_with_values(Php::Parameters ¶meters); 44 | 45 | Php::Value prepend(Php::Parameters ¶meters); 46 | 47 | Php::Value append(Php::Parameters ¶meters); 48 | 49 | Php::Value is_ancestor(Php::Parameters ¶meters); 50 | 51 | Php::Value iter_depth(Php::Parameters ¶meters); 52 | 53 | void clear(); 54 | 55 | void reorder(Php::Parameters ¶meters); 56 | 57 | void swap(Php::Parameters ¶meters); 58 | 59 | void move_before(Php::Parameters ¶meters); 60 | 61 | void move_after(Php::Parameters ¶meters); 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/Gtk/GtkVBox.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkVBox.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkVBox_::GtkVBox_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkVBox_::~GtkVBox_() = default; 13 | 14 | /** 15 | * PHP Constructor 16 | */ 17 | void GtkVBox_::__construct(Php::Parameters ¶meters) 18 | { 19 | Php::deprecated << "GtkVBox is deprecated on Gtk 3.20 and will be removed on non-beta release" << std::endl; 20 | 21 | // Construct the parent 22 | Php::call("parent::__construct", GTK_ORIENTATION_VERTICAL, 0); 23 | 24 | // Verify if has homogeneous parameter 25 | if(parameters.size() >= 1) { 26 | Php::call("parent::set_homogeneous", parameters[0]); 27 | } 28 | 29 | // Verify if has spacing parameter 30 | if(parameters.size() >= 2) { 31 | Php::call("parent::set_spacing", parameters[1]); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Gtk/GtkVBox.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKVBOX_H_ 3 | #define _PHPGTK_GTKVBOX_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "GtkBox.h" 9 | 10 | /** 11 | * 12 | */ 13 | class GtkVBox_ : public GtkBox_ 14 | { 15 | /** 16 | * Publics 17 | */ 18 | public: 19 | 20 | /** 21 | * C++ constructor and destructor 22 | */ 23 | GtkVBox_(); 24 | virtual ~GtkVBox_(); 25 | 26 | /** 27 | * PHP Construct 28 | */ 29 | void __construct(Php::Parameters ¶ms); 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkViewport.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _PHPGTK_GTKVIEWPORT_H_ 4 | #define _PHPGTK_GTKVIEWPORT_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "../../php-gtk.h" 10 | #include "GtkBin.h" 11 | 12 | 13 | class GtkViewport_ : public GtkBin_ 14 | { 15 | public: 16 | GtkViewport_(); 17 | ~GtkViewport_(); 18 | 19 | Php::Value get_hadjustment(); 20 | Php::Value get_vadjustment(); 21 | void set_hadjustment(Php::Parameters ¶meters); 22 | void set_vadjustment(Php::Parameters ¶meters); 23 | void set_shadow_type(Php::Parameters ¶meters); 24 | Php::Value get_shadow_type(); 25 | Php::Value get_bin_window(); 26 | Php::Value get_view_window(); 27 | void __construct(Php::Parameters ¶meters); 28 | 29 | 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /src/Gtk/GtkWrapMode.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GtkWrapMode.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | GtkWrapMode_::GtkWrapMode_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | GtkWrapMode_::~GtkWrapMode_() = default; 13 | 14 | -------------------------------------------------------------------------------- /src/Gtk/GtkWrapMode.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKWRAPMODE_H_ 3 | #define _PHPGTK_GTKWRAPMODE_H_ 4 | 5 | #include 6 | #include 7 | 8 | 9 | /** 10 | * GtkWrapMode_ 11 | * 12 | * https://developer.gnome.org/gtk3/stable/GtkWrapMode.html 13 | */ 14 | class GtkWrapMode_ : public Php::Base 15 | { 16 | /** 17 | * Publics 18 | */ 19 | public: 20 | 21 | /** 22 | * C++ constructor and destructor 23 | */ 24 | GtkWrapMode_(); 25 | ~GtkWrapMode_(); 26 | 27 | 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/Gtk/GtkosxApplication.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_GTKOSXAPPLICATION_H_ 3 | #define _PHPGTK_GTKOSXAPPLICATION_H_ 4 | 5 | #include 6 | #include 7 | #include "../G/GObject.h" 8 | 9 | #include "gtkmacintegration/gtkosxapplication.h" 10 | 11 | 12 | /** 13 | * GtkosxApplication_ 14 | * 15 | * http://gtk-osx.sourceforge.net/gtk-mac-integration/GtkosxApplication.html 16 | */ 17 | class GtkosxApplication_ : public GObject_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | 24 | /** 25 | * C++ constructor and destructor 26 | */ 27 | GtkosxApplication_(); 28 | ~GtkosxApplication_(); 29 | 30 | void __construct(Php::Parameters ¶meters); 31 | void set_dock_icon_pixbuf(Php::Parameters ¶meters); 32 | void set_use_quartz_accelerators(Php::Parameters ¶meters); 33 | Php::Value use_quartz_accelerators(); 34 | void ready(); 35 | void set_menu_bar(Php::Parameters ¶meters); 36 | void sync_menubar(); 37 | void insert_app_menu_item(Php::Parameters ¶meters); 38 | void set_window_menu(Php::Parameters ¶meters); 39 | void set_help_menu(Php::Parameters ¶meters); 40 | void set_dock_menu(Php::Parameters ¶meters); 41 | void set_dock_icon_resource(Php::Parameters ¶meters); 42 | void attention_request(Php::Parameters ¶meters); 43 | void cancel_attention_request(Php::Parameters ¶meters); 44 | Php::Value get_bundle_path(); 45 | Php::Value get_resource_path(); 46 | Php::Value get_executable_path(); 47 | Php::Value get_bundle_id(); 48 | Php::Value get_bundle_info(Php::Parameters ¶meters); 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /src/Pango/PangoAttrList.cpp: -------------------------------------------------------------------------------- 1 | #include "PangoAttrList.h" 2 | 3 | /** 4 | * Constructor 5 | */ 6 | PangoAttrList_::PangoAttrList_() = default; 7 | 8 | /** 9 | * Destructor 10 | */ 11 | PangoAttrList_::~PangoAttrList_() = default; 12 | 13 | void PangoAttrList_::__construct() 14 | { 15 | instance = (gpointer *)pango_attr_list_new (); 16 | } 17 | 18 | Php::Value PangoAttrList_::get_attributes() 19 | { 20 | throw Php::Exception("PangoAttrList::get_attributes() not implemented"); 21 | 22 | /* 23 | GSList *ret = pango_attr_list_get_attributes(PANGO_ATTR_LIST(instance)); 24 | 25 | Php::Value ret_arr; 26 | 27 | for(int index=0; GSList *item=g_slist_nth(ret, index); index++) { 28 | 29 | PangoAttribute_ *return_parsed = new PangoAttribute_(); 30 | 31 | return_parsed->set_instance( 32 | (gpointer *)PANGO_ATTRIBUTE(item->data) // @TODO 33 | ); 34 | 35 | ret_arr[index] = Php::Object("PangoAttribute", return_parsed); 36 | } 37 | 38 | return ret_arr; 39 | */ 40 | } -------------------------------------------------------------------------------- /src/Pango/PangoAttrList.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_PANGOATTRLIST_H_ 3 | #define _PHPGTK_PANGOATTRLIST_H_ 4 | 5 | #include 6 | 7 | #include "../G/GObject.h" 8 | 9 | class PangoAttrList_ : public GObject_ 10 | { 11 | /** 12 | * Publics 13 | */ 14 | public: 15 | 16 | /** 17 | * C++ constructor and destructor 18 | */ 19 | PangoAttrList_(); 20 | ~PangoAttrList_(); 21 | 22 | void __construct(); 23 | 24 | Php::Value get_attributes(); 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/Pango/PangoContext.cpp: -------------------------------------------------------------------------------- 1 | #include "PangoContext.h" 2 | 3 | /** 4 | * Constructor 5 | */ 6 | PangoContext_::PangoContext_() = default; 7 | 8 | /** 9 | * Destructor 10 | */ 11 | PangoContext_::~PangoContext_() = default; 12 | 13 | void PangoContext_::__construct() 14 | { 15 | instance = (gpointer *)pango_context_new (); 16 | } 17 | -------------------------------------------------------------------------------- /src/Pango/PangoContext.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_PANGOCONTEXT_H_ 3 | #define _PHPGTK_PANGOCONTEXT_H_ 4 | 5 | #include 6 | 7 | #include "../G/GObject.h" 8 | 9 | class PangoContext_ : public GObject_ 10 | { 11 | /** 12 | * Publics 13 | */ 14 | public: 15 | 16 | /** 17 | * C++ constructor and destructor 18 | */ 19 | PangoContext_(); 20 | ~PangoContext_(); 21 | 22 | void __construct(); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/Pango/PangoLayout.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_PANGOLAYOUT_H_ 3 | #define _PHPGTK_PANGOLAYOUT_H_ 4 | 5 | #include 6 | 7 | #include "../G/GObject.h" 8 | 9 | #include "PangoContext.h" 10 | #include "PangoLayoutLine.h" 11 | 12 | class PangoLayout_ : public GObject_ 13 | { 14 | /** 15 | * Publics 16 | */ 17 | public: 18 | 19 | /** 20 | * C++ constructor and destructor 21 | */ 22 | PangoLayout_(); 23 | ~PangoLayout_(); 24 | 25 | void __construct(Php::Parameters ¶meters); 26 | 27 | void set_text(Php::Parameters ¶meters); 28 | 29 | void set_markup(Php::Parameters ¶meters); 30 | 31 | void set_width(Php::Parameters ¶meters); 32 | 33 | Php::Value get_line(Php::Parameters ¶meters); 34 | 35 | Php::Value get_text(); 36 | 37 | Php::Value get_width(); 38 | 39 | Php::Value xy_to_index(Php::Parameters ¶meters); 40 | 41 | Php::Value get_extents(); 42 | 43 | Php::Value get_size(); 44 | 45 | Php::Value get_pixel_size(); 46 | 47 | void set_spacing(Php::Parameters ¶meters); 48 | 49 | Php::Value get_spacing(); 50 | 51 | void set_line_spacing(Php::Parameters ¶meters); 52 | 53 | Php::Value get_line_spacing(); 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/Pango/PangoLayoutLine.cpp: -------------------------------------------------------------------------------- 1 | #include "PangoLayoutLine.h" 2 | 3 | /** 4 | * Constructor 5 | */ 6 | PangoLayoutLine_::PangoLayoutLine_() = default; 7 | 8 | /** 9 | * Destructor 10 | */ 11 | PangoLayoutLine_::~PangoLayoutLine_() = default; 12 | -------------------------------------------------------------------------------- /src/Pango/PangoLayoutLine.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_PANGOLAYOUTLINE_H_ 3 | #define _PHPGTK_PANGOLAYOUTLINE_H_ 4 | 5 | #include 6 | 7 | #include "../G/GObject.h" 8 | 9 | #include "PangoLayout.h" 10 | 11 | class PangoLayoutLine_ : public GObject_ 12 | { 13 | /** 14 | * Publics 15 | */ 16 | public: 17 | 18 | /** 19 | * C++ constructor and destructor 20 | */ 21 | PangoLayoutLine_(); 22 | ~PangoLayoutLine_(); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/Pango/PangoWrapMode.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "PangoWrapMode.h" 3 | 4 | /** 5 | * Constructor 6 | */ 7 | PangoWrapMode_::PangoWrapMode_() = default; 8 | 9 | /** 10 | * Destructor 11 | */ 12 | PangoWrapMode_::~PangoWrapMode_() = default; 13 | -------------------------------------------------------------------------------- /src/Pango/PangoWrapMode.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_PANGOWRAPMODE_H_ 3 | #define _PHPGTK_PANGOWRAPMODE_H_ 4 | 5 | #include 6 | #include 7 | 8 | class PangoWrapMode_ : public Php::Base 9 | { 10 | /** 11 | * Publics 12 | */ 13 | public: 14 | 15 | /** 16 | * C++ constructor and destructor 17 | */ 18 | PangoWrapMode_(); 19 | ~PangoWrapMode_(); 20 | 21 | 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/libwnck/WnckClassGroup.cpp: -------------------------------------------------------------------------------- 1 | #ifdef WITH_LIBWNCK 2 | #include "WnckClassGroup.h" 3 | 4 | /** 5 | * 6 | */ 7 | /** 8 | * Constructor 9 | */ 10 | WnckClassGroup_::WnckClassGroup_() = default; 11 | WnckClassGroup_::~WnckClassGroup_() = default; 12 | 13 | /** 14 | * https://developer.gnome.org/libwnck/stable/WnckClassGroup.html#wnck-class-group-get-id 15 | */ 16 | Php::Value WnckClassGroup_::get_id() 17 | { 18 | std::string ret = wnck_class_group_get_id(WNCK_CLASS_GROUP(instance)); 19 | 20 | return ret; 21 | } 22 | 23 | /** 24 | * https://developer.gnome.org/libwnck/stable/WnckClassGroup.html#wnck-class-group-get-name 25 | */ 26 | Php::Value WnckClassGroup_::get_name() 27 | { 28 | std::string ret = wnck_class_group_get_name(WNCK_CLASS_GROUP(instance)); 29 | 30 | return ret; 31 | } 32 | 33 | /** 34 | * https://developer.gnome.org/libwnck/stable/WnckClassGroup.html#wnck-class-group-get-icon 35 | */ 36 | Php::Value WnckClassGroup_::get_icon() 37 | { 38 | GdkPixbuf *ret = wnck_class_group_get_icon(WNCK_CLASS_GROUP(instance)); 39 | 40 | GdkPixbuf_ *widget_ = new GdkPixbuf_(); 41 | widget_->set_instance(ret); 42 | return Php::Object("GdkPixbuf", widget_); 43 | } 44 | 45 | /** 46 | * https://developer.gnome.org/libwnck/stable/WnckClassGroup.html#wnck-class-group-get-mini-icon 47 | */ 48 | Php::Value WnckClassGroup_::get_mini_icon() 49 | { 50 | GdkPixbuf *ret = wnck_class_group_get_mini_icon(WNCK_CLASS_GROUP(instance)); 51 | 52 | GdkPixbuf_ *widget_ = new GdkPixbuf_(); 53 | widget_->set_instance(ret); 54 | return Php::Object("GdkPixbuf", widget_); 55 | } 56 | 57 | /** 58 | * https://developer.gnome.org/libwnck/stable/WnckClassGroup.html#wnck-class-group-get-windows 59 | */ 60 | Php::Value WnckClassGroup_::get_windows() 61 | { 62 | GList *ret = wnck_class_group_get_windows(WNCK_CLASS_GROUP(instance)); 63 | 64 | Php::Value ret_arr; 65 | 66 | for(int index=0; GList *item=g_list_nth(ret, index); index++) { 67 | 68 | WnckWindow_ *widget_ = new WnckWindow_(); 69 | widget_->set_instance((gpointer *)item->data); 70 | ret_arr[index] = Php::Object("WnckWindow", widget_); 71 | } 72 | 73 | return ret_arr; 74 | } 75 | #endif -------------------------------------------------------------------------------- /src/libwnck/WnckClassGroup.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_WNCKCLASSGROUP_H_ 3 | #define _PHPGTK_WNCKCLASSGROUP_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "../Gdk/GdkPixbuf.h" 10 | #include "WnckWindow.h" 11 | 12 | /** 13 | * 14 | */ 15 | class WnckClassGroup_ : public GObject_ 16 | { 17 | /** 18 | * Publics 19 | */ 20 | public: 21 | /** 22 | * C++ constructor/destructor 23 | */ 24 | WnckClassGroup_(); 25 | ~WnckClassGroup_(); 26 | 27 | Php::Value get_id(); 28 | Php::Value get_name(); 29 | Php::Value get_icon(); 30 | Php::Value get_mini_icon(); 31 | Php::Value get_windows(); 32 | }; 33 | 34 | #endif -------------------------------------------------------------------------------- /src/libwnck/WnckScreen.cpp: -------------------------------------------------------------------------------- 1 | #ifdef WITH_LIBWNCK 2 | #include "WnckScreen.h" 3 | 4 | /** 5 | * 6 | */ 7 | /** 8 | * Constructor 9 | */ 10 | WnckScreen_::WnckScreen_() = default; 11 | WnckScreen_::~WnckScreen_() = default; 12 | 13 | /** 14 | * https://developer.gnome.org/gdk3/stable/gdk3-Testing.html#gdk-test-simulate-button 15 | */ 16 | Php::Value WnckScreen_::get_default() 17 | { 18 | WnckScreen *ret = wnck_screen_get_default(); 19 | 20 | // 21 | WnckScreen_ *widget_ = new WnckScreen_(); 22 | widget_->set_instance((gpointer *)ret); 23 | return Php::Object("WnckScreen", widget_); 24 | } 25 | 26 | /** 27 | * https://developer.gnome.org/libwnck/stable/WnckScreen.html#wnck-screen-get-active-window 28 | */ 29 | Php::Value WnckScreen_::get_active_window() 30 | { 31 | WnckWindow *ret = wnck_screen_get_active_window(WNCK_SCREEN(instance)); 32 | 33 | // 34 | if (ret) { 35 | WnckWindow_ *widget_ = new WnckWindow_(); 36 | widget_->set_instance((gpointer *)ret); 37 | return Php::Object("WnckWindow", widget_); 38 | } 39 | else { 40 | return NULL; 41 | } 42 | } 43 | 44 | 45 | 46 | Php::Value WnckScreen_::get_width() 47 | { 48 | return wnck_screen_get_width(WNCK_SCREEN(instance)); 49 | } 50 | 51 | Php::Value WnckScreen_::get_height() 52 | { 53 | return wnck_screen_get_height(WNCK_SCREEN(instance)); 54 | } 55 | #endif -------------------------------------------------------------------------------- /src/libwnck/WnckScreen.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_WNCKSCREEN_H_ 3 | #define _PHPGTK_WNCKSCREEN_H_ 4 | 5 | #include 6 | #include 7 | 8 | #include "../G/GObject.h" 9 | #include "WnckWindow.h" 10 | 11 | /** 12 | * 13 | */ 14 | class WnckScreen_ : public GObject_ 15 | { 16 | /** 17 | * Publics 18 | */ 19 | public: 20 | /** 21 | * C++ constructor/destructor 22 | */ 23 | WnckScreen_(); 24 | ~WnckScreen_(); 25 | 26 | static Php::Value get_default(); 27 | Php::Value get_active_window(); 28 | Php::Value get_width(); 29 | Php::Value get_height(); 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /src/libwnck/WnckWindow.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PHPGTK_WNCKWINDOW_H_ 3 | #define _PHPGTK_WNCKWINDOW_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "../G/GObject.h" 11 | #include "../Gdk/GdkPixbuf.h" 12 | #include "WnckClassGroup.h" 13 | 14 | /** 15 | * 16 | */ 17 | class WnckWindow_ : public GObject_ 18 | { 19 | /** 20 | * Publics 21 | */ 22 | public: 23 | /** 24 | * C++ constructor/destructor 25 | */ 26 | WnckWindow_(); 27 | ~WnckWindow_(); 28 | 29 | static Php::Value get_window(Php::Parameters ¶meters); 30 | Php::Value get_name(); 31 | Php::Value get_icon(); 32 | Php::Value get_window_type(); 33 | Php::Value get_xid(); 34 | Php::Value get_pid(); 35 | Php::Value get_class_group(); 36 | Php::Value is_active(); 37 | void close(Php::Parameters ¶meters); 38 | void minimize(); 39 | void activate(Php::Parameters ¶meters); 40 | }; 41 | 42 | #endif --------------------------------------------------------------------------------