Gtk3-SimpleList-0.21/0000755000076500001440000000000013654022013012700 5ustar tvusersGtk3-SimpleList-0.21/Makefile.PL0000644000076500001440000000174513654021462014670 0ustar tvusersuse strict; use warnings; use ExtUtils::MakeMaker; use File::Spec; sub main { # Create the Makefile my @args = ( AUTHOR => 'Thierry Vignaud ', NAME => 'Gtk3::SimpleList', VERSION_FROM => File::Spec->catfile('lib', 'Gtk3', 'SimpleList.pm'), ABSTRACT_FROM => File::Spec->catfile('lib', 'Gtk3', 'SimpleList.pm'), LICENSE => 'lgpl', 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.64' }, PREREQ_PM => { 'Gtk3' => 0, }, META_MERGE => { 'meta-spec' => { version => 2 }, resources => { homepage => 'https://github.com/soig/Gtk3-SimpleList', bucktracker => 'https://github.com/soig/Gtk3-SimpleList/issues', }, repository => { type => 'git', url => 'https://github.com/soig/Gtk3-SimpleList.git', web => 'https://github.com/soig/Gtk3-SimpleList', }, release_status => 'stable', }, ); WriteMakefile(@args); return 0; } exit main() unless caller; Gtk3-SimpleList-0.21/lib/0000755000076500001440000000000013654022012013445 5ustar tvusersGtk3-SimpleList-0.21/lib/Gtk3/0000755000076500001440000000000013654022012014255 5ustar tvusersGtk3-SimpleList-0.21/lib/Gtk3/SimpleList.pm0000644000076500001440000006013413654021724016715 0ustar tvusers# # $Id$ # ######################### package Gtk3::SimpleList; use strict; use Carp; use Gtk3; our @ISA = 'Gtk3::TreeView'; our $VERSION = '0.21'; our %column_types = ( 'hidden' => {type=>'Glib::String', attr=>'hidden'}, 'text' => {type=>'Glib::String', renderer=>'Gtk3::CellRendererText', attr=>'text'}, 'markup' => {type=>'Glib::String', renderer=>'Gtk3::CellRendererText', attr=>'markup'}, 'int' => {type=>'Glib::Int', renderer=>'Gtk3::CellRendererText', attr=>'text'}, 'double' => {type=>'Glib::Double', renderer=>'Gtk3::CellRendererText', attr=>'text'}, 'bool' => {type=>'Glib::Boolean', renderer=>'Gtk3::CellRendererToggle', attr=>'active'}, 'scalar' => {type=>'Glib::Scalar', renderer=>'Gtk3::CellRendererText', attr=> sub { my ($tree_column, $cell, $model, $iter, $i) = @_; my ($info) = $model->get ($iter, $i); $cell->set (text => $info || '' ); } }, 'pixbuf' => {type=>'Gtk3::Gdk::Pixbuf', renderer=>'Gtk3::CellRendererPixbuf', attr=>'pixbuf'}, ); # this is some cool shit sub add_column_type { shift; # don't want/need classname my $name = shift; $column_types{$name} = { @_ }; } sub text_cell_edited { my ($cell_renderer, $text_path, $new_text, $slist) = @_; my $path = Gtk3::TreePath->new_from_string ($text_path); my $model = $slist->get_model; my $iter = $model->get_iter ($path); $model->set ($iter, $cell_renderer->{column}, $new_text); } sub new { croak "Usage: $_[0]\->new (title => type, ...)\n" . " expecting a list of column title and type name pairs.\n" . " can't create a SimpleList with no columns" unless @_ >= 3; # class, key1, val1 return shift->new_from_treeview (Gtk3::TreeView->new (), @_); } sub new_from_treeview { my $class = shift; my $view = shift; croak "treeview is not a Gtk3::TreeView" unless defined ($view) and UNIVERSAL::isa ($view, 'Gtk3::TreeView'); croak "Usage: $class\->new_from_treeview (treeview, title => type, ...)\n" . " expecting a treeview reference and list of column title and type name pairs.\n" . " can't create a SimpleList with no columns" unless @_ >= 2; # key1, val1 my @column_info = (); for (my $i = 0; $i < @_ ; $i+=2) { my $typekey = $_[$i+1]; croak "expecting pairs of title=>type" unless $typekey; croak "unknown column type $typekey, use one of " . join(", ", keys %column_types) unless exists $column_types{$typekey}; my $type = $column_types{$typekey}{type}; if (not defined $type) { $type = 'Glib::String'; carp "column type $typekey has no type field; did you" . " create a custom column type incorrectly?\n" . "limping along with $type"; } push @column_info, { title => $_[$i], type => $type, rtype => $column_types{$_[$i+1]}{renderer}, attr => $column_types{$_[$i+1]}{attr}, }; } my $model = Gtk3::ListStore->new (map { $_->{type} } @column_info); # just in case, 'cause i'm paranoid like that. map { $view->remove_column ($_) } $view->get_columns; $view->set_model ($model); for (my $i = 0; $i < @column_info ; $i++) { if( 'CODE' eq ref $column_info[$i]{attr} ) { $view->insert_column_with_data_func (-1, $column_info[$i]{title}, $column_info[$i]{rtype}->new, $column_info[$i]{attr}, $i); } elsif ('hidden' eq $column_info[$i]{attr}) { # skip hidden column } else { my $column = Gtk3::TreeViewColumn->new_with_attributes ( $column_info[$i]{title}, $column_info[$i]{rtype}->new, $column_info[$i]{attr} => $i, ); $view->append_column ($column); if ($column_info[$i]{attr} eq 'active') { # make boolean columns respond to editing. my $r = $column->get_cells; $r->set (activatable => 1); $r->{column_index} = $i; $r->signal_connect (toggled => sub { my ($renderer, $row, $slist) = @_; my $col = $renderer->{column_index}; my $model = $slist->get_model; my $iter = $model->iter_nth_child (undef, $row); my $val = $model->get ($iter, $col); $model->set ($iter, $col, !$val); }, $view); } elsif ($column_info[$i]{attr} eq 'text') { # attach a decent 'edited' callback to any # columns using a text renderer. we do NOT # turn on editing by default. my $r = $column->get_cells; $r->{column} = $i; $r->signal_connect (edited => \&text_cell_edited, $view); } } } my @a; tie @a, 'Gtk3::SimpleList::TiedList', $model; $view->{data} = \@a; return bless $view, $class; } sub set_column_editable { my ($self, $index, $editable) = @_; my $column = $self->get_column ($index); croak "invalid column index $index" unless defined $column; my $cell_renderer = $column->get_cells; $cell_renderer->set (editable => $editable); } sub get_column_editable { my ($self, $index, $editable) = @_; my $column = $self->get_column ($index); croak "invalid column index $index" unless defined $column; my $cell_renderer = $column->get_cells; return $cell_renderer->get ('editable'); } sub get_selected_indices { my $self = shift; my $selection = $self->get_selection; return () unless $selection; # warning: this assumes that the TreeModel is actually a ListStore. # if the model is a TreeStore, get_indices will return more than one # index, which tells you how to get all the way down into the tree, # but all the indices will be squashed into one array... so, ah, # don't use this for TreeStores! my ($indices) = $selection->get_selected_rows; map { $_->get_indices } @$indices; } sub select { my $self = shift; my $selection = $self->get_selection; my @inds = (@_ > 1 && $selection->get_mode ne 'multiple') ? $_[0] : @_; my $model = $self->get_model; foreach my $i (@inds) { my $iter = $model->iter_nth_child (undef, $i); next unless $iter; $selection->select_iter ($iter); } } sub unselect { my $self = shift; my $selection = $self->get_selection; my @inds = (@_ > 1 && $selection->get_mode ne 'multiple') ? $_[0] : @_; my $model = $self->get_model; foreach my $i (@inds) { my $iter = $model->iter_nth_child (undef, $i); next unless $iter; $selection->unselect_iter ($iter); } } sub set_data_array { @{$_[0]->{data}} = @{$_[1]}; } sub get_row_data_from_path { my ($self, $path) = @_; # $path->get_depth always 1 for SimpleList # my $depth = $path->get_depth; # array has only one member for SimpleList my @indices = $path->get_indices; my $index = $indices[0]; return $self->{data}->[$index]; } ################################## package Gtk3::SimpleList::TiedRow; use strict; use Gtk3; use Carp; # TiedRow is the lowest-level tie, allowing you to treat a row as an array # of column data. sub TIEARRAY { my $class = shift; my $model = shift; my $iter = shift; croak "usage tie (\@ary, 'class', model, iter)" unless $model && UNIVERSAL::isa ($model, 'Gtk3::TreeModel'); return bless { model => $model, iter => $iter, }, $class; } sub FETCH { # this, index return $_[0]->{model}->get ($_[0]->{iter}, $_[1]); } sub STORE { # this, index, value return $_[0]->{model}->set ($_[0]->{iter}, $_[1], $_[2]) if defined $_[2]; # allow 0, but not undef } sub FETCHSIZE { # this return $_[0]{model}->get_n_columns; } sub EXISTS { return( $_[1] < $_[0]{model}->get_n_columns ); } sub EXTEND { } # can't change the length, ignore sub CLEAR { } # can't change the length, ignore sub new { my ($class, $model, $iter) = @_; my @a; tie @a, __PACKAGE__, $model, $iter; return \@a; } sub POP { croak "pop called on a TiedRow, but you can't change its size"; } sub PUSH { croak "push called on a TiedRow, but you can't change its size"; } sub SHIFT { croak "shift called on a TiedRow, but you can't change its size"; } sub UNSHIFT { croak "unshift called on a TiedRow, but you can't change its size"; } sub SPLICE { croak "splice called on a TiedRow, but you can't change its size"; } #sub DELETE { croak "delete called on a TiedRow, but you can't change its size"; } sub STORESIZE { carp "STORESIZE operation not supported"; } ################################### package Gtk3::SimpleList::TiedList; use strict; use Gtk3; use Carp; # TiedList is an array in which each element is a row in the liststore. sub TIEARRAY { my $class = shift; my $model = shift; croak "usage tie (\@ary, 'class', model)" unless $model && UNIVERSAL::isa ($model, 'Gtk3::TreeModel'); return bless { model => $model, }, $class; } sub FETCH { # this, index my $iter = $_[0]->{model}->iter_nth_child (undef, $_[1]); return undef unless defined $iter; my @row; tie @row, 'Gtk3::SimpleList::TiedRow', $_[0]->{model}, $iter; return \@row; } sub STORE { # this, index, value my $iter = $_[0]->{model}->iter_nth_child (undef, $_[1]); $iter = $_[0]->{model}->insert ($_[1]) if not defined $iter; my @row; tie @row, 'Gtk3::SimpleList::TiedRow', $_[0]->{model}, $iter; if ('ARRAY' eq ref $_[2]) { @row = @{$_[2]}; } else { $row[0] = $_[2]; } return $_[2]; } sub FETCHSIZE { # this return $_[0]->{model}->iter_n_children (undef); } sub PUSH { # this, list my $model = shift()->{model}; my $iter; foreach (@_) { $iter = $model->append; my @row; tie @row, 'Gtk3::SimpleList::TiedRow', $model, $iter; if ('ARRAY' eq ref $_) { @row = @$_; } else { $row[0] = $_; } } return $model->iter_n_children (undef); } sub POP { # this my $model = $_[0]->{model}; my $index = $model->iter_n_children-1; my $iter = $model->iter_nth_child(undef, $index); return undef unless $iter; my $ret = [ $model->get ($iter) ]; $model->remove($iter) if( $index >= 0 ); return $ret; } sub SHIFT { # this my $model = $_[0]->{model}; my $iter = $model->iter_nth_child(undef, 0); return undef unless $iter; my $ret = [ $model->get ($iter) ]; $model->remove($iter) if( $model->iter_n_children ); return $ret; } sub UNSHIFT { # this, list my $model = shift()->{model}; my $iter; foreach (@_) { $iter = $model->prepend; my @row; tie @row, 'Gtk3::SimpleList::TiedRow', $model, $iter; if ('ARRAY' eq ref $_) { @row = @$_; } else { $row[0] = $_; } } return $model->iter_n_children (undef); } # note: really, arrays aren't supposed to support the delete operator this # way, but we don't want to break existing code. sub DELETE { # this, key my $model = $_[0]->{model}; my $ret; if ($_[1] < $model->iter_n_children (undef)) { my $iter = $model->iter_nth_child (undef, $_[1]); return undef unless $iter; $ret = [ $model->get ($iter) ]; $model->remove ($iter); } return $ret; } sub CLEAR { # this $_[0]->{model}->clear; } # note: arrays aren't supposed to support exists, either. sub EXISTS { # this, key return( $_[1] < $_[0]->{model}->iter_n_children ); } # we can't really, reasonably, extend the tree store in one go, it will be # extend as items are added sub EXTEND {} sub get_model { return $_[0]{model}; } sub STORESIZE { carp "STORESIZE: operation not supported"; } sub SPLICE { # this, offset, length, list my $self = shift; # get the model and the number of rows my $model = $self->{model}; # get the offset my $offset = shift || 0; # if offset is neg, invert it $offset = $model->iter_n_children (undef) + $offset if ($offset < 0); # get the number of elements to remove my $length = shift; # if len was undef, not just false, calculate it $length = $self->FETCHSIZE() - $offset unless (defined ($length)); # get any elements we need to insert into their place my @list = @_; # place to store any returns my @ret = (); # remove the desired elements my $ret; for (my $i = $offset; $i < $offset+$length; $i++) { # things will be shifting forward, so always delete at offset $ret = $self->DELETE ($offset); push @ret, $ret if defined $ret; } # insert the passed list at offset in reverse order, so the will # be in the correct order foreach (reverse @list) { # insert a new row $model->insert ($offset); # and put the data in it $self->STORE ($offset, $_); } # return deleted rows in array context, the last row otherwise # if nothing deleted return empty return (@ret ? (wantarray ? @ret : $ret[-1]) : ()); } 1; __END__ # documentation is a good thing. =head1 NAME Gtk3::SimpleList - A simple interface to Gtk3's complex MVC list widget =head1 SYNOPSIS use Glib qw(TRUE FALSE); use Gtk3 '-init'; use Gtk3::SimpleList; my $slist = Gtk3::SimpleList->new ( 'Text Field' => 'text', 'Markup Field' => 'markup', 'Int Field' => 'int', 'Double Field' => 'double', 'Bool Field' => 'bool', 'Scalar Field' => 'scalar', 'Pixbuf Field' => 'pixbuf', ); @{$slist->{data}} = ( [ 'text', 1, 1.1, TRUE, $var, $pixbuf ], [ 'text', 2, 2.2, FALSE, $var, $pixbuf ], ); # (almost) anything you can do to an array you can do to # $slist->{data} which is an array reference tied to the list model push @{$slist->{data}}, [ 'text', 3, 3.3, TRUE, $var, $pixbuf ]; # mess with selections $slist->get_selection->set_mode ('multiple'); $slist->get_selection->unselect_all; $slist->select (1, 3, 5..9); # select rows by index $slist->unselect (3, 8); # unselect rows by index @sel = $slist->get_selected_indices; # simple way to make text columns editable $slist->set_column_editable ($col_num, TRUE); # Gtk3::SimpleList derives from Gtk3::TreeView, so all methods # on a treeview are available. $slist->set_rules_hint (TRUE); $slist->signal_connect (row_activated => sub { my ($sl, $path, $column) = @_; my $row_ref = $sl->get_row_data_from_path ($path); # $row_ref is now an array ref to the double-clicked row's data. }); # turn an existing TreeView into a SimpleList; useful for # Glade-generated interfaces. $simplelist = Gtk3::SimpleList->new_from_treeview ( $glade->get_widget ('treeview'), 'Text Field' => 'text', 'Int Field' => 'int', 'Double Field' => 'double', ); =head1 ABSTRACT SimpleList is a simple interface to the powerful but complex Gtk3::TreeView and Gtk3::ListStore combination, implementing using tied arrays to make thing simple and easy. =head1 DESCRIPTION Gtk3 has a powerful, but complex MVC (Model, View, Controller) system used to implement list and tree widgets. Gtk3::SimpleList automates the complex setup work and allows you to treat the list model as a more natural list of lists structure. After creating a new Gtk3::SimpleList object with the desired columns you may set the list data with a simple Perl array assignment. Rows may be added or deleted with all of the normal array operations. You can treat the C member of the list simplelist object as an array reference, and manipulate the list data with perl's normal array operators. A mechanism has also been put into place allowing columns to be Perl scalars. The scalar is converted to text through Perl's normal mechanisms and then displayed in the list. This same mechanism can be expanded by defining arbitrary new column types before calling the new function. =head1 OBJECT HIERARCHY Glib::Object +--- Gtk3::Object +--- Gtk3::Widget +--- Gtk3::TreeView +--- Gtk3::SimpleList =head1 METHODS =over =item $slist = Gtk3::SimpleList->new ($cname, $ctype, ...) =over =over =item * $cname (string) =item * $ctype (string) =back =back Creates a new Gtk3::SimpleList object with the specified columns. The parameter C is the name of the column, what will be displayed in the list headers if they are turned on. The parameter ctype is the type of the column, one of: text normal text strings markup pango markup strings int integer values double double-precision floating point values bool boolean values, displayed as toggle-able checkboxes scalar a perl scalar, displayed as a text string by default pixbuf a Gtk3::Gdk::Pixbuf or the name of a custom type you add with C. These should be provided in pairs according to the desired columns for your list. =item $slist = Gtk3::SimpleList->new_from_treeview ($treeview, $cname, $ctype, ...) =over =over =item * $treeview (Gtk3::TreeView) =item * $cname (string) =item * $ctype (string) =back =back Like C<< Gtk3::SimpleList->new() >>, but turns an existing Gtk3::TreeView into a Gtk3::SimpleList. This is intended mostly for use with stuff like Glade, where the widget is created for you. This will create and attach a new model and remove any existing columns from I. Returns I, re-blessed as a Gtk3::SimpleList. =item $slist->set_data_array ($arrayref) =over =over =item * $arrayref (array reference) =back =back Set the data in the list to the array reference $arrayref. This is completely equivalent to @{$list->{data}} = @{$arrayref} and is only here for convenience and for those programmers who don't like to type-cast and have static, set once data. =item @indices = $slist->get_selected_indices Return the indices of the selected rows in the ListStore. =item $slist->get_row_data_from_path ($path) =over =over =item * $path (Gtk3::TreePath) the path of the desired row =back =back Returns an array ref with the data of the row indicated by $path. =item $slist->select ($index, ...); =item $slist->unselect ($index, ...); =over =over =item * $index (integer) =back =back Select or unselect rows in the list by index. If the list is set for multiple selection, all indices in the list will be set/unset; otherwise, just the first is used. If the list is set for no selection, then nothing happens. To set the selection mode, or to select all or none of the rows, use the normal TreeView/TreeSelection stuff, e.g. $slist->get_selection and the TreeSelection methods C, C, C, and C. =item $slist->set_column_editable ($index, $editable) =over =over =item * $index (integer) =item * $editable (boolean) =back =back =item boolean = $slist->get_column_editable ($index) =over =over =item * $index (integer) =back =back This is a very simple interface to Gtk3::TreeView's editable text column cells. All columns which use the attr "text" (basically, any text or number column, see C) automatically have callbacks installed to update data when cells are edited. With C, you can enable the in-place editing. C tells you if column I is currently editable. =item Gtk3::SimpleList->add_column_type ($type_name, ...) =over =over =item $type_name (string) =back =back Add a new column type to the list of possible types. Initially six column types are defined, text, int, double, bool, scalar, and pixbuf. The bool column type uses a toggle cell renderer, the pixbuf uses a pixbuf cell renderer, and the rest use text cell renderers. In the process of adding a new column type you may use any cell renderer you wish. The first parameter is the column type name, the list of six are examples. There are no restrictions on the names and you may even overwrite the existing ones should you choose to do so. The remaining parameters are the type definition consisting of key value pairs. There are three required: type, renderer, and attr. The type key determines what actual datatype will be stored in the underlying model representation; this is a package name, e.g. Glib::String, Glib::Int, Glib::Boolean, but in general if you want an arbitrary Perl data structure you will want to use 'Glib::Scalar'. The renderer key should hold the class name of the cell renderer to create for this column type; this may be any of Gtk3::CellRendererText, Gtk3::CellRendererToggle, Gtk3::CellRendererPixbuf, or some other, possibly custom, cell renderer class. The attr key is magical; it may be either a string, in which case it specifies the attribute which will be set from the specified column (e.g. 'text' for a text renderer, 'active' for a toggle renderer, etc), or it may be a reference to a subroutine which will be called each time the renderer needs to draw the data. This function, described as a GtkTreeCellDataFunc in the API reference, will receive 5 parameters: $treecol, $cell, $model, $iter, $col_num (when SimpleList hooks up the function, it sets the column number to be passed as the user data). The data value for the particular cell in question is available via $model->get ($iter, $col_num); you can then do whatever it is you have to do to render the cell the way you want. Here are some examples: # just displays the value in a scalar as # Perl would convert it to a string Gtk3::SimpleList->add_column_type( 'a_scalar', type => 'Glib::Scalar', renderer => 'Gtk3::CellRendererText', attr => sub { my ($treecol, $cell, $model, $iter, $col_num) = @_; my $info = $model->get ($iter, $col_num); $cell->set (text => $info); } ); # sums up the values in an array ref and displays # that in a text renderer Gtk3::SimpleList->add_column_type( 'sum_of_array', type => 'Glib::Scalar', renderer => 'Gtk3::CellRendererText', attr => sub { my ($treecol, $cell, $model, $iter, $col_num) = @_; my $sum = 0; my $info = $model->get ($iter, $col_num); foreach (@$info) { $sum += $_; } $cell->set (text => $sum); } ); =back =head1 MODIFYING LIST DATA After creating a new Gtk3::SimpleList object there will be a member called C which is a tied array. That means data may be treated as an array, but in reality the data resides in something else. There is no need to understand the details of this it just means that you put data into, take data out of, and modify it just like any other array. This includes using array operations like push, pop, unshift, and shift. For those of you very familiar with perl this section will prove redundant, but just in case: Adding and removing rows: # push a row onto the end of the list push @{$slist->{data}}, [col1_data, col2_data, ..., coln_data]; # pop a row off of the end of the list $rowref = pop @{$slist->{data}}; # unshift a row onto the beginning of the list unshift @{$slist->{data}}, [col1_data, col2_data, ..., coln_data]; # shift a row off of the beginning of the list $rowref = shift @{$slist->{data}}; # delete the row at index $n, 0 indexed splice @{ $slist->{data} }, $n, 1; # set the entire list to be the data in a array @{$slist->{data}} = ( [row1, ...], [row2, ...], [row3, ...] ); Getting at the data in the list: # get an array reference to the entire nth row $rowref = $slist->{data}[n]; # get the scalar in the mth column of the nth row, 0 indexed $val = $slist->{data}[n][m]; # set an array reference to the entire nth row $slist->{data}[n] = [col1_data, col2_data, ..., coln_data]; # get the scalar in the mth column of the nth row, 0 indexed $slist->{data}[n][m] = $rowm_coln_value; =head1 SEE ALSO Perl(1), Glib(3pm), Gtk3(3pm), Gtk3::TreeView(3pm), Gtk3::TreeModel(3pm), Gtk3::ListStore(3pm). Note: Gtk2::SimpleList was deprecated in favor of Gtk2::Ex::Simple::List, part of the Gtk2-Perl-Ex project at http://gtk2-perl-ex.sf.net . Gtk3::SimpleList is a simple port of Gtk2::SimpleList on top of Gtk3 for its users that wanted to switch to Gtk3. =head1 AUTHORS muppet Ross McFarland Gavin Brown Thierry Vignaud =head1 COPYRIGHT AND LICENSE Copyright 2003-2004 by the Gtk2-Perl team. Copyright 2013 by Thierry Vignaud This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. =cut Gtk3-SimpleList-0.21/MANIFEST.SKIP0000644000076500001440000000015713653757020014615 0ustar tvusers^Makefile$ ^Makefile[.]old$ ^blib/ ^Gtk3-SimpleList- ^pm_to_blib$ [.]gitignore ^[.]git/ MYMETA.json MYMETA.yml Gtk3-SimpleList-0.21/META.json0000644000076500001440000000241113654022013014317 0ustar tvusers{ "abstract" : "A simple interface to Gtk3's complex MVC list widget", "author" : [ "Thierry Vignaud " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", "license" : [ "open_source" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Gtk3-SimpleList", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.64" } }, "runtime" : { "requires" : { "Gtk3" : "0" } } }, "release_status" : "stable", "resources" : { "X_bucktracker" : "https://github.com/soig/Gtk3-SimpleList/issues", "homepage" : "https://github.com/soig/Gtk3-SimpleList" }, "version" : "0.21", "x_repository" : { "type" : "git", "url" : "https://github.com/soig/Gtk3-SimpleList.git", "web" : "https://github.com/soig/Gtk3-SimpleList" }, "x_serialization_backend" : "JSON::PP version 4.04" } Gtk3-SimpleList-0.21/META.yml0000644000076500001440000000151113654022013014147 0ustar tvusers--- abstract: "A simple interface to Gtk3's complex MVC list widget" author: - 'Thierry Vignaud ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '6.64' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' license: open_source meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Gtk3-SimpleList no_index: directory: - t - inc requires: Gtk3: '0' resources: X_bucktracker: https://github.com/soig/Gtk3-SimpleList/issues homepage: https://github.com/soig/Gtk3-SimpleList version: '0.21' x_repository: type: git url: https://github.com/soig/Gtk3-SimpleList.git web: https://github.com/soig/Gtk3-SimpleList x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Gtk3-SimpleList-0.21/COPYING0000644000076500001440000006363713653757020013766 0ustar tvusers GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! Gtk3-SimpleList-0.21/README0000644000076500001440000000245613653757020013603 0ustar tvusersGtk3::SimpleList.pm ============ This module provides a helper module for Gtk3. It's based on Gtk2::SimpleList. INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing you can find documentation for this module with the perldoc command. perldoc Gtk3::SimpleList For any kind of help or support simply send a mail to the gtk-perl mailing list (gtk-perl-list@gnome.org). COPYRIGHT AND LICENCE Copyright 2003-2004 by the Gtk3-Perl team. opyright (C) 2013 Thierry Vignaud This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version; or the Artistic License, version 2.0. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. Gtk3-SimpleList-0.21/MANIFEST0000644000076500001440000000040713653757020014046 0ustar tvuserslib/Gtk3/SimpleList.pm Makefile.PL MANIFEST MANIFEST.SKIP README t/01compile.t COPYING Changes META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) Gtk3-SimpleList-0.21/t/0000755000076500001440000000000013654022012013142 5ustar tvusersGtk3-SimpleList-0.21/t/01compile.t0000644000076500001440000000021013653757020015126 0ustar tvusers#!/usr/bin/perl # $Id$ use Test::More tests => 2; use_ok('Gtk3::SimpleList'); can_ok('Gtk3::SimpleList', qw(new new_from_treeview)); Gtk3-SimpleList-0.21/Changes0000644000076500001440000000107413654021746014211 0ustar tvusersRevision history for Gtk3::SimpleList 0.21 Mon Apr 4 16:17:00 CEST 2020 * Remove useless Data::Dumper from Makefile.PL (CPAN RT#132493) 0.20 Mon Apr 4 11:35:15 CEST 2020 Add repository details Fix URL 0.19 Mon Apr 4 10:51:15 CEST 2020 Do not use PREREQ_FATAL=>1 (CPAN RT#127879) Remove debug message that causes warnings (CPAN RT#132441) 0.18 Mon Nov 5 04:26:15 CEST 2018 Clarify docs (RT#124740) 0.17 Mon Nov 6 08:57:15 CEST 2017 Actually include tests 0.16 Mon Nov 5 21:38:15 CEST 2017 First version, released on an unsuspecting world.