Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Zephir as bridge to interact CPP libraries through PHP? #2432

Open
d47081 opened this issue Jul 21, 2024 · 0 comments
Open

Zephir as bridge to interact CPP libraries through PHP? #2432

d47081 opened this issue Jul 21, 2024 · 0 comments

Comments

@d47081
Copy link

d47081 commented Jul 21, 2024

I have an idea to share libgtk-dev API to PHP application using extension written in Zephir-lang.

Here is few implementations for PHP-CPP: PHP-GTK3, PHP-GTK4

For example, PHP GtkSeparator constructor require one argument, format and pass it to gtk_separator_new pointer:

#include "GtkSeparator.h"

GtkSeparator_::GtkSeparator_() = default;
GtkSeparator_::~GtkSeparator_() = default;

void GtkSeparator_::__construct(Php::Parameters &parameters)
{
	int porientation = parameters[0];
	GtkOrientation orientation = (GtkOrientation) porientation;

	instance = (gpointer *)gtk_separator_new(orientation);
}

If that's possible, can somebody share some examples or links to documentation?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant