Php::Value GtkClipboard_::get_selection()
{
	GdkAtom atom = gtk_clipboard_get_selection (GTK_CLIPBOARD(instance));

	std::string ret = gdk_atom_name(atom);

	return ret;
}
Php::Value GtkClipboard_::wait_for_image()
{
	GdkPixbuf *ret = gtk_clipboard_wait_for_image (GTK_CLIPBOARD(instance));

	GdkPixbuf_ *return_parsed = new GdkPixbuf_();
	return_parsed->set_instance(ret);
	return Php::Object("GdkPixbuf", return_parsed);
}
Example #3
0
static const char* ImGui_ImplGtk3Cogl_GetClipboardText(void* user_data)
{
    static char *last_clipboard = NULL;

    g_clear_pointer(&last_clipboard, g_free);
    last_clipboard = gtk_clipboard_wait_for_text(GTK_CLIPBOARD(user_data));
    return last_clipboard;
}
void GtkClipboard_::set_image(Php::Parameters &parameters)
{
	GdkPixbuf *pixbuf;
	if(parameters.size() > 0) {
		Php::Value object_pixbuf = parameters[0];
		GdkPixbuf_ *phpgtk_pixbuf = (GdkPixbuf_ *)object_pixbuf.implementation();
		pixbuf = phpgtk_pixbuf->get_instance();
	}

	gtk_clipboard_set_image (GTK_CLIPBOARD(instance), pixbuf);

}
Php::Value GtkClipboard_::wait_is_image_available(Php::Parameters &parameters)
{
	GtkTextBuffer *buffer;
	if(parameters.size() > 0) {
		Php::Value object_buffer = parameters[0];
		GtkTextBuffer_ *phpgtk_buffer = (GtkTextBuffer_ *)object_buffer.implementation();
		buffer = GTK_TEXT_BUFFER(phpgtk_buffer->get_instance());
	}

	gboolean ret = gtk_clipboard_wait_is_rich_text_available (GTK_CLIPBOARD(instance), buffer);

	return ret;
}
void GtkClipboard_::set_text(Php::Parameters &parameters)
{
	std::string s_text = parameters[0];
	gchar *text = (gchar *)s_text.c_str();

	gint len = -1;
	if(parameters.size() >= 2) {
		len = (gint)parameters[1];
	}

	gtk_clipboard_set_text (GTK_CLIPBOARD(instance), text, len);

}
void GtkClipboard_::request_text(Php::Parameters &parameters)
{
	// std::string s_user_function = parameters[0];
	// gchar *user_function = (gchar *)s_user_function.c_str();

	// gpointer user_data = (gpointer)parameters[1];


	// Create user data param of callaback
    struct st_request_callback *callback_object = (struct st_request_callback *)malloc(sizeof(struct st_request_callback));
    memset(callback_object, 0, sizeof(struct st_request_callback));
    callback_object->user_parameters = parameters;
    callback_object->self_widget = Php::Object("GtkClipboard", this);

    // handle the callback
	gtk_clipboard_request_text (GTK_CLIPBOARD(instance), request_text_callback, (gpointer)callback_object);
}
Example #8
0
GtkClipboard*
rbgtk_get_clipboard(VALUE obj)
{
    return GTK_CLIPBOARD(RVAL2GOBJ(obj));
}
void GtkClipboard_::set_can_store()
{
	gtk_clipboard_store (GTK_CLIPBOARD(instance));

}
Example #10
0
Php::Value GtkClipboard_::wait_is_uris_available()
{
	gboolean ret = gtk_clipboard_wait_is_uris_available (GTK_CLIPBOARD(instance));

	return ret;
}
Example #11
0
Php::Value GtkClipboard_::wait_for_text()
{
	std::string ret = gtk_clipboard_wait_for_text (GTK_CLIPBOARD(instance));

	return ret;
}
Example #12
0
void GtkClipboard_::clear()
{
	gtk_clipboard_clear (GTK_CLIPBOARD(instance));

}
Example #13
0
static void ImGui_ImplGtk3Cogl_SetClipboardText(void* user_data, const char* text)
{
    gtk_clipboard_set_text(GTK_CLIPBOARD(user_data), text, -1);
}