view release on metacpan or search on metacpan
ChangeLog.pre-git view on Meta::CPAN
Gtk2::Dialog->vbox and Gtk2::Dialog->action_area.
2008-08-11 Torsten Schoenfeld <kaffeetisch@gmx.de>
* t/02.GtkContainer.t
* xs/GtkContainer.xs: Wrap gtk_container_get_focus_child. Allow
undef for the focus child argument to
gtk_container_set_focus_child.
* t/GtkClipboard.t
* xs/GtkClipboard.xs: Wrap gtk_clipboard_request_uris,
gtk_clipboard_wait_for_uris, and
gtk_clipboard_wait_is_uris_available. Also fix the rich text
tests.
* t/GtkCalendar.t
* xs/GtkCalendar.xs: Wrap gtk_calendar_set_detail_func.
2008-08-08 Torsten Schoenfeld <kaffeetisch@gmx.de>
* xs/GdkCairo.xs
* xs/GdkProperty.xs
* xs/GtkBuilder.xs
ChangeLog.pre-git view on Meta::CPAN
* xs/GdkEvent.xs: Remove an unneeded call to gperl_set_isa.
* t/GtkAction.t, xs/GtkAction.xs: Bind and test
gtk_widget_get_action.
* MANIFEST, maps-2.10, xs_files-2.10, t/GtkCellRendererSpin.t,
xs/GtkCellRendererSpin.xs: Add support for GtkCellRendererSpin.
* t/GtkClipboard.t, xs/GtkClipboard.xs: Bind and test
gtk_clipboard_request_rich_text, gtk_clipboard_wait_for_rich_text,
gtk_clipboard_wait_is_rich_text_available.
* t/GtkComboBox.t, xs/GtkComboBox.xs: Bind and test
gtk_combo_box_set_title, gtk_combo_box_get_title.
* t/GtkDnd.t, xs/GtkDnd.xs: Bind and test
gtk_drag_dest_set_track_motion, gtk_drag_dest_get_track_motion.
* t/GtkEntry.t, xs/GtkEntry.xs: Bind and test
gtk_entry_set_inner_border, gtk_entry_get_inner_border and the new
boxed wrapper for GtkBorder they made necessary.
ChangeLog.pre-git view on Meta::CPAN
* t/GtkActionGroup.t, xs/GtkActionGroup.xs: Bind and test
gtk_action_group_set_translation_domain,
gtk_action_group_set_translate_func, and
gtk_action_group_translate_string.
* t/GtkDialog.t, xs/GtkDialog.xs: Bind and test
gtk_alternative_dialog_button_order.
* t/GtkClipboard.t, t/GtkSelection.t, xs/GtkClipboard.xs,
xs/GtkSelection.xs: Bind and test gtk_clipboard_set_image,
gtk_clipboard_wait_for_image,
gtk_clipboard_wait_is_image_available,
gtk_clipboard_request_image, gtk_clipboard_set_can_store,
gtk_clipboard_store, gtk_clipboard_wait_is_target_available,
gtk_target_list_add_text_targets,
gtk_target_list_add_image_targets,
gtk_target_list_add_uri_targets, gtk_selection_data_set_pixbuf,
gtk_selection_data_get_pixbuf, gtk_selection_data_set_uris,
gtk_selection_data_get_uris, and
gtk_selection_data_targets_include_image. Modify the received
funcs to free the callback directly after it was invoked. Add a
FIXME comment and a test for the completely misbound
gtk_selection_clear.
ChangeLog.pre-git view on Meta::CPAN
gtk_menu_get_for_attach_widget.
2005/01/02 16:35 (+0100) kaffeetisch
* CodeGen.pm: Add a _noinc_ornull variant to the typemaps for
GObject's.
* t/GdkDisplay.t, xs/GdkDisplay.xs: Bind and test
gdk_display_supports_selection_notification,
gdk_display_request_selection_notification,
gdk_display_supports_clipboard_persistence, and
gdk_display_store_clipboard.
* t/GdkDnd.t, xs/GdkDnd.xs: Bind and test gdk_drag_drop_succeeded.
* xs/GdkDrawable.xs: Add a comment about gdk_draw_trapezoids and
why we don't bind it.
* t/GdkWindow.t, xs/GdkWindow.xs: Bind and test
gdk_window_enable_synchronized_configure,
gdk_window_configure_finished, and gdk_window_set_focus_on_map.
ChangeLog.pre-git view on Meta::CPAN
gtk_about_dialog_get_logo_icon_name,
gtk_about_dialog_set_logo_icon_name,
gtk_about_dialog_set_email_hook, gtk_about_dialog_set_url_hook.
Add some parameter descriptions.
* t/GtkCellView.t, xs/GtkCellView.xs: Bind and test
gtk_cell_view_set_value, gtk_cell_view_set_values,
gtk_cell_view_get_size_of_row.
* xs/GtkClipboard.xs: Don't use the _noinc typemaps with
gtk_clipboard_get and gtk_clipboard_get_for_display since we don't
actually own the returned clipboards.
* t/GtkEntryCompletion.t, xs/GtkEntryCompletion.xs: Bind and test
gtk_entry_completion_get_text_column,
gtk_entry_completion_insert_prefix,
gtk_entry_completion_set_inline_completion,
gtk_entry_completion_get_inline_completion,
gtk_entry_completion_set_popup_completion,
gtk_entry_completion_get_popup_completion.
* t/GtkIconTheme.t, xs/GtkIconTheme.xs: Bind and test
ChangeLog.pre-git view on Meta::CPAN
2004/01/12 23:45 (+0100) kaffeetisch
* t/GtkDnd.t: Skip a few things if Gtk2::Gdk::Event::new isn't
available.
2004/01/12 09:49 (-0500) rwmcfa1
* pm/TestHelper.pm: if we're not 2.2.0 or greated don't allow init
to be skipped. earlier rel's have to for some pagno thing.
* t/GtkClipboard.t: the clipboard didn't exist for sure until 2.2.0
2004/01/11 23:59 (+0100) kaffeetisch
* MANIFEST
A t/GtkDnd.t: New test.
* t/GtkTextIter.t: Test everything.
* t/GdkRegion.t
* t/GdkWindow.t
ChangeLog.pre-git view on Meta::CPAN
2004/01/08 18:55 (-0500) rwmcfa1
* xs/GdkWindow.xs: fixed bug found in test branch where attribute_mask
was filled with random garbage, should of been initialized in
SvGdkWindowAttrReal.
2004/01/08 18:55 (-0500) rwmcfa1
* pm/TestHelper.pm: added at_least_version paramter, very useful.
* t/27.GtkClipboard.t: use ^, to skip unless clipboard will be around.
* xs/Gtk2.xs: apidoc fix, version_info should of been get_version_info.
2004/01/09 00:47 (+0100) kaffeetisch
* xs/GdkColor.xs: Add a class argument to Gtk2::Gdk::Colormap::new
and implement ::get_visual and ::get_screen.
* xs/GdkWindow.xs: Hush a compiler warning.
ChangeLog.pre-git view on Meta::CPAN
* pm/SimpleList.pm: Gtk2::SimpleList->new_from_treeview allows an
existing Gtk2::TreeView to be turned into a SimpleList. intended
for Glade users.
* xs/GtkClipboard.xs, api.pod: several nasty bugs mean that this
module couldn't have worked as it was. added class parameter to get
and get_for_display. implemented set_with_data and set_with_owner.
made the others actually work.
* gtk2perl.h, xs/GtkSelection.xs: moved the macro to gtk2perl.h as
GTK2PERL_STACK_ITEMS_TO_TARGET_ENTRY_ARRAY so clipboard could use it.
* t/27.GtkClipboard.t, MANIFEST: new test.
* xs/GtkStyle.xs: somehow we had implemented the deprecated
gtk_draw_flat_box instead of gtk_paint_flat_box.
2003/09/24 14:15 muppetman
* api.pod, xs.GtkWidget.xs, t/01.GtkWidget.xs: simplify
gtk_widget_intersect to return either a rectangle or undef.
ChangeLog.pre-git view on Meta::CPAN
* xs/GtkList.xs xs/GtkSelection.xs xs/GtkStock.xs xs/GtkTreeModel.xs
xs/GtkTreeView.xs: clarified commentary
* xs/GtkListStore.xs xs/GtkTreeStore.xs gtk2perl.h: implement
gtk_(list|tree)_store_set_column_types, since it is now possible
to derive GObject types in perl; this is necessary to implement
the constructor of a derived list or tree store. factored out
the stack handling code, into gtk2perl.h, to avoid needing to
create another header.
* xs/GtkTextBuffer.xs: implemented missing clipboard functions:
add_selection_clipboard remove_selection_clipboard cut_clipboard
copy_clipboard paste_clipboard
* xs/GtkWidget.xs: implemented get_pointer, is_ancestor,
translate_coordinates, set_style, ensure_style; added FIXMEs
* xs/GdkEvent.xs: let gdk_event_set_screen in there twice, because
i wasn't building against 2.2.x. fixed.
2003/08/18 03:56 muppetman
* TODO: updates
ChangeLog.pre-git view on Meta::CPAN
James Curbo
2003/08-06 16:58 ggc
* xs/GtkWidget.xs: add gtk_widget_size_request
2003/08/06 12:57 muppetman
* xs/GtkWindow.xs: plug a memleak in list_toplevels
* xs/GtkWidget.xs: ->get_clipboard
2003/08/05 22:16 muppetman
* pm/SimpleList.pm: pod patch from James Curbo
2003/08/01 12:45 muppetman
* MANIFEST, Gtk2.pm, README, Makefile.PL: updated for 0.92 release
2003/07/31 20:00 muppetman
* Make Gtk2::Widget::hide_on_delete actually usable as a delete-event signal
handler.
* Fix a stack handling issue in Gtk2::TreeModel::get.
Overview of changes in Gtk2 1.191
=================================
* Wrap a lot of new API from gtk+ 2.14, among which:
- gtk_builder_add_objects_from_file and gtk_builder_add_objects_from_string
- gtk_calendar_set_detail_func
- gtk_clipboard_request_uris, gtk_clipboard_wait_for_uris, and
gtk_clipboard_wait_is_uris_available
- gtk_icon_info_new_for_pixbuf
- gtk_page_setup_load_file and gtk_page_setup_load_key_file
- gtk_print_settings_load_file and gtk_print_settings_load_key_file
- gtk_widget_get_snapshot
- gtk_show_uri
- gdk_screen_get_monitor_height_mm, gdk_screen_get_monitor_width_mm, and
gdk_screen_get_monitor_plug_name
- gdk_window_redirect_to_drawable and gdk_window_remove_redirection
* Improve the documentation in many places.
* For Gtk2::CellRenderer subclasses, use a more robust approach for chaining up
* Allow passing undef to the Gtk2::Widget::modify_* methods. [muppet]
* Add support for GtkCellRendererSpin. [Torsten]
* Add support for GtkPageSetup, GtkPaperSize, GtkPrintContext,
GtkPrintOperation, GtkPrintOperationPreview, GtkPrintSettings. [Torsten]
* Add support for GtkRecentChooser, GtkRecentChooserDialog,
GtkRecentChooserMenu, GtkRecentChooserWidget, GtkRecentFilter,
GtkRecentManager. [Emmanuele]
* Wrap new API: [Torsten, muppet]
- gtk_button_set_image_position, gtk_button_get_image_position
- gtk_clipboard_request_rich_text, gtk_clipboard_wait_for_rich_text,
gtk_clipboard_wait_is_rich_text_available
- gtk_combo_box_set_title, gtk_combo_box_get_title
- gtk_drag_dest_set_track_motion, gtk_drag_dest_get_track_motion
- gtk_entry_set_inner_border, gtk_entry_get_inner_border
- gtk_file_chooser_button_set_focus_on_click,
gtk_file_chooser_button_get_focus_on_click
- gtk_label_set_line_wrap_mode, gtk_label_get_line_wrap_mode
- gtk_message_dialog_set_image
- gtk_notebook_set_window_creation_hook, gtk_notebook_set_group_id,
gtk_notebook_get_group_id, gtk_notebook_set_tab_reorderable,
gtk_notebook_get_tab_reorderable, gtk_notebook_set_tab_detachable,
gtk-demo/demo.ui view on Meta::CPAN
<col id="3" translatable="yes">This is the Mary Unknown row</col>
</row>
</data>
</object>
<object class="GtkUIManager" id="uimanager">
<child>
<object class="GtkActionGroup" id="DefaultActions">
<child>
<object class="GtkAction" id="Copy">
<property name="name">Copy</property>
<property name="tooltip" translatable="yes">Copy selected object into the clipboard</property>
<property name="stock_id">gtk-copy</property>
</object>
</child>
<child>
<object class="GtkAction" id="Cut">
<property name="name">Cut</property>
<property name="tooltip" translatable="yes">Cut selected object into the clipboard</property>
<property name="stock_id">gtk-cut</property>
</object>
</child>
<child>
<object class="GtkAction" id="EditMenu">
<property name="name">EditMenu</property>
<property name="label" translatable="yes">_Edit</property>
</object>
</child>
<child>
lib/Gtk2/api.pod view on Meta::CPAN
=item Gtk2::Clipboard::set_with_data
=item Gtk2::Clipboard::set_with_owner
In C, these functions take an array of GtkTargetEntries and the number of
elements in that array as the second and third parameters. In Perl, the
number of target entries is implied by the number of items on the stack,
and the target entries are supplied as a list at the end of the parameter
list:
$clipboard->set_with_data (\&get_func, \&clear_func, $user_data,
@target_entries);
$clipboard->set_with_owner (\&get_func, \&clear_func, $owner,
@target_entries);
=back
=head1 SEE ALSO
The canonical documentation is the C API reference at
http://developer.gnome.org/doc/API/gtk/ and
http://developer.gnome.org/doc/API/gdk/
t/GdkDisplay.t view on Meta::CPAN
SKIP: {
skip("new 2.6 stuff", 1)
unless Gtk2 -> CHECK_VERSION(2, 6, 0);
if ($display -> supports_selection_notification()) {
is($display -> request_selection_notification(Gtk2::Gdk::Atom -> intern("text/plain")), TRUE);
} else {
ok(1);
}
if ($display -> supports_clipboard_persistence()) {
my $window = Gtk2::Window -> new();
$window -> realize();
$display -> store_clipboard($window -> window, 0,
Gtk2::Gdk::Atom -> intern("text/plain"),
Gtk2::Gdk::Atom -> intern("image/png"));
$display -> store_clipboard($window -> window, 0);
}
}
SKIP: {
skip("new 2.8 stuff", 0)
unless Gtk2 -> CHECK_VERSION(2, 8, 0);
$display -> warp_pointer($screen, 100, 100);
}
t/GtkClipboard.t view on Meta::CPAN
#!/usr/bin/perl -w
# vim: set ft=perl :
use Gtk2::TestHelper tests => 115,
at_least_version => [2, 2, 0, "GtkClipboard didn't exist in 2.0.x"];
# $Id$
my $clipboard;
SKIP: {
skip "GdkDisplay is new in 2.2", 1
unless Gtk2->CHECK_VERSION (2, 2, 0);
my $display = Gtk2::Gdk::Display->get_default;
$clipboard = Gtk2::Clipboard->get_for_display (
$display,
Gtk2::Gdk->SELECTION_CLIPBOARD);
isa_ok ($clipboard, 'Gtk2::Clipboard');
is ($clipboard->get_display, $display);
}
$clipboard = Gtk2::Clipboard->get (Gtk2::Gdk->SELECTION_PRIMARY);
isa_ok ($clipboard, 'Gtk2::Clipboard');
my $expect = '0123456789abcdef';
$clipboard->set_text ($expect);
my $text = $clipboard->wait_for_text;
is ($text, $expect);
is ($clipboard->wait_is_text_available, 1);
$clipboard->request_text (sub {
# print "hello from the callback\n" . Dumper(\@_);
is ($_[0], $clipboard);
is ($_[1], $expect);
is ($_[2], 'user data!');
}, 'user data!');
$clipboard->request_contents (Gtk2::Gdk->SELECTION_TYPE_STRING, sub {
#print "hello from the callback\n" . Dumper(\@_);
is ($_[0], $clipboard);
isa_ok ($_[1], 'Gtk2::SelectionData');
is ($_[2], 'user data!');
is ($_[1]->get_text, $expect);
}, 'user data!');
SKIP: {
skip 'request_targets and wait_for_targets are new in 2.4', 4
unless Gtk2->CHECK_VERSION (2, 4, 0);
$clipboard->request_targets (sub {
is ($_[0], $clipboard);
isa_ok ($_[1], "ARRAY");
isa_ok ($_[1][0], "Gtk2::Gdk::Atom");
is ($_[2], "bla");
}, "bla");
}
SKIP: {
skip 'new/now-working targets stuff', 2
unless Gtk2->CHECK_VERSION (2, 6, 0);
is ($clipboard->wait_is_target_available (Gtk2::Gdk::Atom->intern ('TEXT')), TRUE);
isa_ok (($clipboard->wait_for_targets)[0], 'Gtk2::Gdk::Atom');
}
SKIP: {
skip "new image stuff", 5
# Some of this was broken in 2.6.0
unless Gtk2->CHECK_VERSION (2, 6, 1);
my $pixbuf = Gtk2::Gdk::Pixbuf->new ("rgb", FALSE, 8, 23, 42);
$clipboard->set_image ($pixbuf);
is ($clipboard->wait_is_image_available, TRUE);
isa_ok ($clipboard->wait_for_image, "Gtk2::Gdk::Pixbuf");
$clipboard->request_image (sub {
is ($_[0], $clipboard);
isa_ok ($_[1], "Gtk2::Gdk::Pixbuf");
is ($_[2], "bla");
}, "bla");
}
SKIP: {
skip "new stuff in 2.10", 7
unless Gtk2->CHECK_VERSION (2, 10, 0);
my $test_text = 'test test test';
my $buffer = Gtk2::TextBuffer->new;
$buffer->insert ($buffer->get_start_iter, 'bla!');
$buffer->register_deserialize_format (
'text/rdf',
sub { warn "here"; $_[1]->insert ($_[2], 'bla!'); });
$clipboard->set_with_data (
sub {
my ($clipboard, $selection_data, $info, $data) = @_;
$selection_data->set (Gtk2::Gdk::Atom->new ('text/rdf'),
8, $data);
},
sub {},
$test_text,
{target=>'text/rdf'});
$clipboard->request_rich_text ($buffer, sub {
# print "hello from the callback\n" . Dumper(\@_);
is ($_[0], $clipboard);
is ($_[1]->name, 'text/rdf');
is ($_[2], $test_text);
is ($_[3], undef);
});
ok ($clipboard->wait_is_rich_text_available ($buffer));
my ($data, $atom) = $clipboard->wait_for_rich_text ($buffer);
is ($data, $test_text);
is ($atom->name, 'text/rdf');
}
SKIP: {
skip 'new uris stuff', 5
unless Gtk2->CHECK_VERSION (2, 14, 0);
my @uris = ('file:///foo/bar', 'file:///bar/foo');
$clipboard->set_with_data (
sub {
my ($clipboard, $selection_data, $info, $data) = @_;
$selection_data->set_uris (@$data);
},
sub {},
\@uris,
{target=>'text/uri-list'});
is ($clipboard->wait_is_uris_available, TRUE);
is_deeply ($clipboard->wait_for_uris, \@uris);
$clipboard->request_uris (sub {
my ($tmp_clipboard, $tmp_uris, $data) = @_;
is ($tmp_clipboard, $clipboard);
is_deeply ($tmp_uris, \@uris);
is ($data, undef);
});
}
run_main;
#print "----------------------------------\n";
$expect = 'whee';
my $get_func_call_count = 0;
sub get_func {
return if ++$get_func_call_count == 3;
my ($cb, $sd, $info, $user_data_or_owner) = @_;
is ($cb, $clipboard);
isa_ok ($sd, 'Gtk2::SelectionData');
is ($info, 0);
ok (defined $user_data_or_owner);
# Tests for Gtk2::SelectionData:
$sd->set (Gtk2::Gdk->TARGET_STRING, 8, 'bla blub');
is ($sd->get_selection ()->name, 'PRIMARY');
ok (defined $sd->get_target ()->name);
t/GtkClipboard.t view on Meta::CPAN
my $buffer = Gtk2::TextBuffer->new;
$buffer->register_deserialize_format (
'text/rdf',
sub { warn "here"; $sd->insert ($info, 'bla!'); });
is ($sd->targets_include_rich_text ($buffer), FALSE);
}
}
sub clear_func {
is (shift, $clipboard);
ok (shift);
}
sub received_func {
is ($_[0], $clipboard);
isa_ok ($_[1], 'Gtk2::SelectionData');
is ($_[2], 'user data!');
is ($_[1]->get_text, $expect);
}
# set the selection multiple times to make sure we don't crash on
# replacing all the GPerlCallbacks.
$clipboard->set_with_data (\&get_func, \&clear_func, 'user data, yo',
{target=>'TEXT'}, {target=>'STRING'}, {target=>'COMPOUND_TEXT'},
);
ok(1);
$clipboard->set_with_data (\&get_func, \&clear_func, 'user data, yo',
{target=>'TEXT'}, {target=>'STRING'}, {target=>'COMPOUND_TEXT'},
);
ok(1);
$clipboard->set_with_data (\&get_func, \&clear_func, 'user data, yo',
{target=>'TEXT'}, {target=>'STRING'}, {target=>'COMPOUND_TEXT'},
);
ok(1);
$clipboard->request_contents (Gtk2::Gdk->SELECTION_TYPE_STRING,
\&received_func, 'user data!');
run_main;
my $widget = Gtk2::Window->new;
$clipboard->set_with_owner (\&get_func, \&clear_func, $widget,
{target=>'TEXT'}, {target=>'STRING'}, {target=>'COMPOUND_TEXT'},
);
is ($clipboard->get_owner, $widget);
$clipboard->request_contents (Gtk2::Gdk->SELECTION_TYPE_STRING,
\&received_func, 'user data!');
run_main;
SKIP: {
skip "new 2.6 stuff", 0
unless Gtk2->CHECK_VERSION (2, 6, 0);
$clipboard->set_can_store ({target=>'STRING'}, {target=>'TEXT'});
$clipboard->set_can_store;
$clipboard->store;
}
$clipboard->clear;
__END__
Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
t/GtkEditable.t view on Meta::CPAN
$entry -> set_position(2);
is($entry -> get_position(), 2);
$entry -> set_editable(1);
is($entry -> get_editable(), 1);
my $window = Gtk2::Window -> new();
$window -> add($entry);
$entry -> cut_clipboard();
$entry -> copy_clipboard();
$entry -> paste_clipboard();
$entry -> delete_selection();
# Test the custom insert-text marshaller.
{
my $entry = Gtk2::Entry -> new();
$entry -> set_text("äöü");
$entry -> signal_connect(insert_text => sub {
my ($entry, $new_text, $new_text_length, $position, $data) = @_;
$_[1] = reverse $new_text;
$_[3] = 0;
t/GtkTextBuffer.t view on Meta::CPAN
isa_ok($tag_three, "Gtk2::TextTag");
$buffer -> remove_tag($tag_one, $buffer -> get_start_iter(), $buffer -> get_end_iter());
$buffer -> remove_tag_by_name("bulb", $buffer -> get_start_iter(), $buffer -> get_end_iter());
$buffer -> remove_all_tags($buffer -> get_start_iter(), $buffer -> get_end_iter());
SKIP: {
skip "GtkClipboard is new in 2.2", 0
unless Gtk2->CHECK_VERSION (2, 2, 0);
my $clipboard = Gtk2::Clipboard -> get(Gtk2::Gdk -> SELECTION_CLIPBOARD);
$buffer -> paste_clipboard($clipboard, $buffer -> get_end_iter(), 1);
$buffer -> paste_clipboard($clipboard, undef, 1);
$buffer -> copy_clipboard($clipboard);
$buffer -> cut_clipboard($clipboard, 1);
$buffer -> add_selection_clipboard($clipboard);
$buffer -> remove_selection_clipboard($clipboard);
}
$buffer -> begin_user_action();
$buffer -> end_user_action();
SKIP: {
skip "backspace is new in 2.6", 0
unless Gtk2->CHECK_VERSION (2, 6, 0);
$buffer -> backspace($buffer -> get_end_iter(), TRUE, TRUE);
t/GtkWidget.t view on Meta::CPAN
my $bitmap = Gtk2::Gdk::Bitmap->create_from_data ($win->window, "", 1, 1);
$win->realize;
$widget->shape_combine_mask ($bitmap, 5, 5);
$widget->shape_combine_mask (undef, 5, 5);
SKIP: {
skip "stuff that's new in 2.2", 10
unless Gtk2->CHECK_VERSION (2, 2, 0);
isa_ok ($widget->get_clipboard, "Gtk2::Clipboard");
isa_ok ($widget->get_display, "Gtk2::Gdk::Display");
isa_ok ($widget->get_root_window, "Gtk2::Gdk::Window");
isa_ok ($widget->get_screen, "Gtk2::Gdk::Screen");
is ($widget->has_screen, 1);
# not sure it's wise to enquire into what properties exist, but
# let's assume there's at least 1
{ my @pspecs = $widget->list_style_properties;
cmp_ok (scalar(@pspecs), '>', 0); }
xs/GdkDisplay.xs view on Meta::CPAN
GdkWindow *gdk_display_get_default_group (GdkDisplay *display)
#endif
#if GTK_CHECK_VERSION (2, 6, 0)
gboolean gdk_display_supports_selection_notification (GdkDisplay *display);
gboolean gdk_display_request_selection_notification (GdkDisplay *display, GdkAtom selection);
gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display);
## void gdk_display_store_clipboard (GdkDisplay *display, GdkWindow *clipboard_window, guint32 time_, GdkAtom *targets, gint n_targets);
=for apidoc
=for arg ... of Gtk2::Gdk::Atom's
=cut
void
gdk_display_store_clipboard (display, clipboard_window, time_, ...);
GdkDisplay *display
GdkWindow *clipboard_window
guint32 time_
PREINIT:
GdkAtom *targets = NULL;
gint n_targets = 0;
CODE:
if (items > 3) {
int i;
n_targets = items - 3;
targets = g_new0 (GdkAtom, n_targets);
for (i = 3; i < items; i++)
targets[i - 3] = SvGdkAtom (ST (i));
}
gdk_display_store_clipboard (display, clipboard_window, time_, targets, n_targets);
if (targets)
g_free (targets);
#endif
#if GTK_CHECK_VERSION (2, 8, 0)
void gdk_display_warp_pointer (GdkDisplay *display, GdkScreen *screen, gint x, gint y);
xs/GdkEvent.xs view on Meta::CPAN
## KeyRelease: A key was released.
## EnterNotify: A window was entered.
## LeaveNotify: A window was exited.
## FocusChange: The focus window has changed. (The focus window gets
## keyboard events).
## Resize: A window has been resized.
## Map: A window has been mapped. (It is now visible on the screen).
## Unmap: A window has been unmapped. (It is no longer visible on
## the screen).
## Scroll: A mouse wheel was scrolled either up or down.
## OwnerChange: The owner of a clipboard/selection changed.
# struct _GdkEventAny
# {
# GdkEventType type;
# GdkWindow *window;
# gint8 send_event;
# };
GdkEventType
xs/GtkClipboard.xs view on Meta::CPAN
#define DEFINE_QUARK(stem) \
static GQuark \
stem ## _quark (void) \
{ \
static GQuark q = 0; \
if (q == 0) \
q = g_quark_from_static_string ("gtk2perl_" #stem ); \
return q; \
}
DEFINE_QUARK (clipboard_get)
DEFINE_QUARK (clipboard_clear)
DEFINE_QUARK (clipboard_user_data)
static void
gtk2perl_clipboard_received_func (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
gpointer data)
{
GPerlCallback * callback = (GPerlCallback*) data;
gperl_callback_invoke (callback, NULL, clipboard, selection_data);
gperl_callback_destroy (callback);
}
static void
gtk2perl_clipboard_text_received_func (GtkClipboard *clipboard,
const gchar *text,
gpointer data)
{
GPerlCallback * callback = (GPerlCallback*) data;
gperl_callback_invoke (callback, NULL, clipboard, text);
gperl_callback_destroy (callback);
}
#if GTK_CHECK_VERSION(2, 4, 0)
static void
gtk2perl_clipboard_targets_received_func (GtkClipboard *clipboard,
GdkAtom * targets,
gint n_targets,
gpointer data)
{
SV * targetlist;
AV * av;
int i;
GPerlCallback * callback = (GPerlCallback*) data;
av = newAV ();
for (i = 0 ; i < n_targets ; i++)
av_push (av, newSVGdkAtom (targets[i]));
targetlist = sv_2mortal (newRV_noinc ((SV*) av));
gperl_callback_invoke (callback, NULL, clipboard, targetlist);
gperl_callback_destroy (callback);
}
#endif
#if GTK_CHECK_VERSION(2, 6, 0)
static void
gtk2perl_clipboard_image_received_func (GtkClipboard *clipboard,
GdkPixbuf *pixbuf,
gpointer data)
{
GPerlCallback * callback = (GPerlCallback*) data;
gperl_callback_invoke (callback, NULL, clipboard, pixbuf);
gperl_callback_destroy (callback);
}
#endif
static void
gtk2perl_clipboard_get_func (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint info,
gpointer user_data_or_owner)
{
GPerlCallback * callback = (GPerlCallback*)
g_object_get_qdata (G_OBJECT (clipboard),
clipboard_get_quark());
gperl_callback_invoke (callback, NULL,
clipboard, selection_data, info,
user_data_or_owner);
}
static void
gtk2perl_clipboard_clear_func (GtkClipboard *clipboard,
gpointer user_data_or_owner)
{
GPerlCallback * callback = (GPerlCallback*)
g_object_get_qdata (G_OBJECT (clipboard),
clipboard_clear_quark());
gperl_callback_invoke (callback, NULL, clipboard, user_data_or_owner);
}
#if GTK_CHECK_VERSION (2, 10, 0)
static void
gtk2perl_clipboard_rich_text_received_func (GtkClipboard *clipboard,
GdkAtom format,
const guint8 *text,
gsize length,
gpointer data)
{
gperl_callback_invoke ((GPerlCallback*) data, NULL, clipboard,
sv_2mortal (newSVGdkAtom (format)),
sv_2mortal (newSVpvn ((const char *) text, length)));
}
#endif /* 2.10 */
#if GTK_CHECK_VERSION (2, 14, 0)
static void
gtk2perl_clipboard_uri_received_func (GtkClipboard *clipboard,
gchar **uris,
gpointer data)
{
/* uris is not owned by us */
gperl_callback_invoke ((GPerlCallback*) data, NULL, clipboard, uris);
}
#endif /* 2.14 */
#endif /* defined GTK_TYPE_CLIPBOARD */
MODULE = Gtk2::Clipboard PACKAGE = Gtk2::Clipboard PREFIX = gtk_clipboard_
#ifdef GTK_TYPE_CLIPBOARD
## GtkClipboard *gtk_clipboard_get (GdkAtom selection)
GtkClipboard *
gtk_clipboard_get (class, selection)
GdkAtom selection
C_ARGS:
selection
#if GTK_CHECK_VERSION(2,2,0)
## GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay *display, GdkAtom selection)
GtkClipboard *
gtk_clipboard_get_for_display (class, display, selection)
GdkDisplay *display
GdkAtom selection
C_ARGS:
display, selection
## GdkDisplay *gtk_clipboard_get_display (GtkClipboard *clipboard)
GdkDisplay *
gtk_clipboard_get_display (clipboard)
GtkClipboard *clipboard
#endif /* >=2.2.0 */
#### gboolean gtk_clipboard_set_with_data (GtkClipboard *clipboard, const GtkTargetEntry *targets, guint n_targets, GtkClipboardGetFunc get_func, GtkClipboardClearFunc clear_func, gpointer user_data)
=for apidoc
=for arg ... of Gtk2::TargetEntry's
=cut
gboolean
gtk_clipboard_set_with_data (clipboard, get_func, clear_func, user_data, ...)
GtkClipboard *clipboard
SV * get_func
SV * clear_func
SV * user_data
PREINIT:
GtkTargetEntry *targets = NULL;
guint n_targets;
GPerlCallback * get_callback;
GType get_param_types[4];
GPerlCallback * clear_callback;
GType clear_param_types[2];
xs/GtkClipboard.xs view on Meta::CPAN
* the _with_data and _with_owner forms, the user_data arg
* will go through the standard GSignal user data, and thus
* we'll pass NULL to gperl_callback_new's user_data parameter.
* this is not typical usage. */
get_callback = gperl_callback_new (get_func, NULL,
4, get_param_types, G_TYPE_NONE);
clear_callback = gperl_callback_new (clear_func, NULL,
2, clear_param_types, G_TYPE_NONE);
real_user_data = newSVsv (user_data);
RETVAL = gtk_clipboard_set_with_data (clipboard, targets, n_targets,
gtk2perl_clipboard_get_func,
gtk2perl_clipboard_clear_func,
real_user_data);
if (!RETVAL) {
gperl_callback_destroy (get_callback);
gperl_callback_destroy (clear_callback);
SvREFCNT_dec (real_user_data);
} else {
g_object_set_qdata_full (G_OBJECT (clipboard),
clipboard_get_quark(),
get_callback,
(GDestroyNotify)
gperl_callback_destroy);
g_object_set_qdata_full (G_OBJECT (clipboard),
clipboard_clear_quark(),
clear_callback,
(GDestroyNotify)
gperl_callback_destroy);
g_object_set_qdata_full (G_OBJECT (clipboard),
clipboard_user_data_quark (),
real_user_data,
(GDestroyNotify)
gperl_sv_free);
}
OUTPUT:
RETVAL
## gboolean gtk_clipboard_set_with_owner (GtkClipboard *clipboard, const GtkTargetEntry *targets, guint n_targets, GtkClipboardGetFunc get_func, GtkClipboardClearFunc clear_func, GObject *owner)
=for apidoc
=for arg ... of Gtk2::TargetEntry's
=cut
gboolean
gtk_clipboard_set_with_owner (clipboard, get_func, clear_func, owner, ...)
GtkClipboard *clipboard
SV * get_func
SV * clear_func
GObject *owner
PREINIT:
GtkTargetEntry *targets = NULL;
guint n_targets = 0;
GPerlCallback * get_callback;
GType get_param_types[4];
GPerlCallback * clear_callback;
GType clear_param_types[2];
xs/GtkClipboard.xs view on Meta::CPAN
* for both forms, like with signal_connect in Glib. the
* difference here is that gtk will treat the owner differently --
* you can query the owner -- so we have to call the proper one.
* of course, we could put both of these in the same perl wrapper...
*/
get_callback = gperl_callback_new (get_func, NULL,
4, get_param_types, G_TYPE_NONE);
clear_callback = gperl_callback_new (clear_func, NULL,
2, clear_param_types, G_TYPE_NONE);
RETVAL = gtk_clipboard_set_with_owner (clipboard, targets, n_targets,
gtk2perl_clipboard_get_func,
gtk2perl_clipboard_clear_func,
owner);
if (!RETVAL) {
gperl_callback_destroy (get_callback);
gperl_callback_destroy (clear_callback);
} else {
g_object_set_qdata_full (G_OBJECT (clipboard),
clipboard_get_quark(),
get_callback,
(GDestroyNotify)
gperl_callback_destroy);
g_object_set_qdata_full (G_OBJECT (clipboard),
clipboard_clear_quark(),
clear_callback,
(GDestroyNotify)
gperl_callback_destroy);
}
OUTPUT:
RETVAL
## GObject *gtk_clipboard_get_owner (GtkClipboard *clipboard)
###GObject_ornull *
GObject *
gtk_clipboard_get_owner (clipboard)
GtkClipboard *clipboard
## void gtk_clipboard_clear (GtkClipboard *clipboard)
void
gtk_clipboard_clear (clipboard)
GtkClipboard *clipboard
void gtk_clipboard_set_text (GtkClipboard *clipboard, const gchar_length *text, int length(text))
## void gtk_clipboard_request_contents (GtkClipboard *clipboard, GdkAtom target, GtkClipboardReceivedFunc callback, gpointer user_data)
void
gtk_clipboard_request_contents (clipboard, target, callback, user_data=NULL)
GtkClipboard *clipboard
GdkAtom target
SV * callback
SV * user_data
PREINIT:
GPerlCallback * real_callback;
GType param_types[2];
CODE:
param_types[0] = GTK_TYPE_CLIPBOARD;
param_types[1] = GTK_TYPE_SELECTION_DATA;
real_callback = gperl_callback_new (callback, user_data,
2, param_types, G_TYPE_NONE);
gtk_clipboard_request_contents (clipboard, target,
gtk2perl_clipboard_received_func,
real_callback);
## void gtk_clipboard_request_text (GtkClipboard *clipboard, GtkClipboardTextReceivedFunc callback, gpointer user_data)
void
gtk_clipboard_request_text (clipboard, callback, user_data=NULL)
GtkClipboard *clipboard
SV * callback
SV * user_data
PREINIT:
GPerlCallback * real_callback;
GType param_types[2];
CODE:
param_types[0] = GTK_TYPE_CLIPBOARD;
param_types[1] = G_TYPE_STRING;
real_callback = gperl_callback_new (callback, user_data,
2, param_types, G_TYPE_NONE);
gtk_clipboard_request_text (clipboard,
gtk2perl_clipboard_text_received_func,
real_callback);
## GtkSelectionData *gtk_clipboard_wait_for_contents (GtkClipboard *clipboard, GdkAtom target)
GtkSelectionData_own_ornull *
gtk_clipboard_wait_for_contents (clipboard, target)
GtkClipboard *clipboard
GdkAtom target
## gchar * gtk_clipboard_wait_for_text (GtkClipboard *clipboard)
gchar *
gtk_clipboard_wait_for_text (clipboard)
GtkClipboard *clipboard
CLEANUP:
g_free (RETVAL);
## gboolean gtk_clipboard_wait_is_text_available (GtkClipboard *clipboard)
gboolean
gtk_clipboard_wait_is_text_available (clipboard)
GtkClipboard *clipboard
#if GTK_CHECK_VERSION (2, 4, 0)
## void gtk_clipboard_request_targets (GtkClipboard *clipboard, GtkClipboardTargetsReceivedFunc callback, gpointer user_data);
void
gtk_clipboard_request_targets (GtkClipboard *clipboard, SV * callback, SV * user_data=NULL)
PREINIT:
GType param_types[2];
GPerlCallback * real_callback;
CODE:
param_types[0] = GTK_TYPE_CLIPBOARD;
param_types[1] = GPERL_TYPE_SV;
real_callback = gperl_callback_new (callback, user_data,
2, param_types, G_TYPE_NONE);
gtk_clipboard_request_targets
(clipboard,
gtk2perl_clipboard_targets_received_func,
real_callback);
=for apidoc
Returns a list of GdkAtom's.
=cut
## gboolean gtk_clipboard_wait_for_targets (GtkClipboard *clipboard, GdkAtom **targets, gint *n_targets);
void
gtk_clipboard_wait_for_targets (GtkClipboard *clipboard)
PREINIT:
GdkAtom *targets = NULL;
gint n_targets, i;
PPCODE:
if (!gtk_clipboard_wait_for_targets (clipboard, &targets, &n_targets))
XSRETURN_EMPTY;
if (targets) {
EXTEND (SP, n_targets);
for (i = 0 ; i < n_targets ; i++)
PUSHs (sv_2mortal (newSVGdkAtom (targets[i])));
g_free (targets);
}
#endif /* 2.4.0 */
#if GTK_CHECK_VERSION (2, 6, 0)
void gtk_clipboard_set_image (GtkClipboard *clipboard, GdkPixbuf *pixbuf);
GdkPixbuf_noinc_ornull * gtk_clipboard_wait_for_image (GtkClipboard *clipboard);
gboolean gtk_clipboard_wait_is_image_available (GtkClipboard *clipboard);
## void gtk_clipboard_request_image (GtkClipboard *clipboard, GtkClipboardImageReceivedFunc callback, gpointer user_data);
void
gtk_clipboard_request_image (GtkClipboard *clipboard, SV *callback, SV *user_data=NULL)
PREINIT:
GType param_types[2];
GPerlCallback *real_callback;
CODE:
param_types[0] = GTK_TYPE_CLIPBOARD;
param_types[1] = GDK_TYPE_PIXBUF;
real_callback = gperl_callback_new (callback, user_data,
2, param_types, G_TYPE_NONE);
gtk_clipboard_request_image
(clipboard,
gtk2perl_clipboard_image_received_func,
real_callback);
## void gtk_clipboard_set_can_store (GtkClipboard *clipboard, const GtkTargetEntry *targets, gint n_targets);
=for apidoc
=for arg ... of Gtk2::TargetEntry's
=cut
void
gtk_clipboard_set_can_store (clipboard, ...);
GtkClipboard *clipboard
PREINIT:
GtkTargetEntry *targets = NULL;
guint n_targets;
CODE:
GTK2PERL_STACK_ITEMS_TO_TARGET_ENTRY_ARRAY (1, targets, n_targets);
gtk_clipboard_set_can_store (clipboard, targets, (gint) n_targets);
void gtk_clipboard_store (GtkClipboard *clipboard);
gboolean gtk_clipboard_wait_is_target_available (GtkClipboard *clipboard, GdkAtom target);
#endif /* 2.6.0 */
#if GTK_CHECK_VERSION (2, 10, 0)
##void
##gtk_clipboard_request_rich_text (GtkClipboard *clipboard,
## GtkTextBuffer *buffer,
## GtkClipboardRichTextReceivedFunc callback,
## gpointer user_data)
void
gtk_clipboard_request_rich_text (clipboard, buffer, callback, user_data=NULL)
GtkClipboard * clipboard
GtkTextBuffer * buffer
SV * callback
SV * user_data
PREINIT:
GPerlCallback * real_callback;
GType param_types[3];
CODE:
param_types[0] = GTK_TYPE_CLIPBOARD;
param_types[1] = GPERL_TYPE_SV; /* there is no GDK_TYPE_ATOM */
/* The real callback gets string and length parameters, but
* perl scalars know their own length, so we won't expose that.
* The string may have embedded nuls, so we use an SV. */
param_types[2] = GPERL_TYPE_SV;
real_callback = gperl_callback_new (callback, user_data,
G_N_ELEMENTS (param_types),
param_types, G_TYPE_NONE);
gtk_clipboard_request_rich_text
(clipboard, buffer,
gtk2perl_clipboard_rich_text_received_func,
real_callback);
##guint8 *
##gtk_clipboard_wait_for_rich_text (GtkClipboard *clipboard,
## GtkTextBuffer *buffer,
## GdkAtom *format,
## gsize *length)
void
gtk_clipboard_wait_for_rich_text (clipboard, buffer)
GtkClipboard *clipboard
GtkTextBuffer *buffer
PREINIT:
GdkAtom format;
gsize length;
guint8 *text;
PPCODE:
text = gtk_clipboard_wait_for_rich_text (clipboard, buffer,
&format, &length);
if (text) {
EXTEND (SP, 2);
PUSHs (sv_2mortal (newSVpvn ((const char *) text, length)));
PUSHs (sv_2mortal (newSVGdkAtom (format)));
g_free (text);
}
gboolean gtk_clipboard_wait_is_rich_text_available (GtkClipboard *clipboard, GtkTextBuffer *buffer)
#endif /* 2.10.0 */
#if GTK_CHECK_VERSION (2, 14, 0)
# void gtk_clipboard_request_uris (GtkClipboard *clipboard, GtkClipboardURIReceivedFunc callback, gpointer user_data);
void
gtk_clipboard_request_uris (GtkClipboard *clipboard, SV *func, SV *data=NULL)
PREINIT:
GPerlCallback * callback;
GType param_types[2];
CODE:
param_types[0] = GTK_TYPE_CLIPBOARD;
param_types[1] = G_TYPE_STRV;
callback = gperl_callback_new (func, data,
G_N_ELEMENTS (param_types),
param_types, G_TYPE_NONE);
gtk_clipboard_request_uris (clipboard,
gtk2perl_clipboard_uri_received_func,
callback);
# gchar** gtk_clipboard_wait_for_uris (GtkClipboard *clipboard);
SV *
gtk_clipboard_wait_for_uris (GtkClipboard *clipboard)
PREINIT:
gchar **strv;
CODE:
strv = gtk_clipboard_wait_for_uris (clipboard);
RETVAL = gperl_new_boxed (strv, G_TYPE_STRV, TRUE); /* we own the strv */
OUTPUT:
RETVAL
gboolean gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard);
#endif /* 2.14 */
#endif /* defined GTK_TYPE_CLIPBOARD */
xs/GtkEditable.xs view on Meta::CPAN
gint start_pos
gint end_pos
gchar_own *
gtk_editable_get_chars (editable, start_pos, end_pos)
GtkEditable *editable
gint start_pos
gint end_pos
void
gtk_editable_cut_clipboard (editable)
GtkEditable *editable
void
gtk_editable_copy_clipboard (editable)
GtkEditable *editable
void
gtk_editable_paste_clipboard (editable)
GtkEditable *editable
void
gtk_editable_delete_selection (editable)
GtkEditable *editable
void
gtk_editable_set_position (editable, position)
GtkEditable *editable
gint position
xs/GtkTextBuffer.xs view on Meta::CPAN
GtkTextBuffer *buffer
## void gtk_text_buffer_set_modified (GtkTextBuffer *buffer, gboolean setting)
void
gtk_text_buffer_set_modified (buffer, setting)
GtkTextBuffer *buffer
gboolean setting
#if GTK_CHECK_VERSION(2,2,0)
## void gtk_text_buffer_add_selection_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard)
void
gtk_text_buffer_add_selection_clipboard (buffer, clipboard)
GtkTextBuffer *buffer
GtkClipboard *clipboard
## void gtk_text_buffer_remove_selection_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard)
void
gtk_text_buffer_remove_selection_clipboard (buffer, clipboard)
GtkTextBuffer *buffer
GtkClipboard *clipboard
## void gtk_text_buffer_cut_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard, gboolean default_editable)
void
gtk_text_buffer_cut_clipboard (buffer, clipboard, default_editable)
GtkTextBuffer *buffer
GtkClipboard *clipboard
gboolean default_editable
## void gtk_text_buffer_copy_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard)
void
gtk_text_buffer_copy_clipboard (buffer, clipboard)
GtkTextBuffer *buffer
GtkClipboard *clipboard
## void gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard, GtkTextIter *override_location, gboolean default_editable)
void
gtk_text_buffer_paste_clipboard (buffer, clipboard, override_location, default_editable)
GtkTextBuffer *buffer
GtkClipboard *clipboard
GtkTextIter_ornull *override_location
gboolean default_editable
#endif /* defined GTK_TYPE_CLIPBOARD */
## gboolean gtk_text_buffer_get_selection_bounds (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end)
## returns empty list if there is no selection
=for apidoc
=for signature (start, end) = $buffer->get_selection_bounds
Returns start and end if some text is selected, empty otherwise; places the
xs/GtkWidget.xs view on Meta::CPAN
EXTEND (SP, n_props);
for (i = 0; i < n_props; i++)
PUSHs (sv_2mortal (newSVGParamSpec (props[i])));
}
g_free (props); /* must free even when n_props==0 */
}
g_type_class_unref (widget_class);
#GtkClipboard* gtk_widget_get_clipboard (GtkWidget *widget, GdkAtom selection)
GtkClipboard *
gtk_widget_get_clipboard (widget, selection=GDK_SELECTION_CLIPBOARD)
GtkWidget * widget
GdkAtom selection
GdkDisplay * gtk_widget_get_display (GtkWidget * widget)
GdkWindow * gtk_widget_get_root_window (GtkWidget * widget)
GdkScreen * gtk_widget_get_screen (GtkWidget * widget)