WL

 view release on metacpan or  search on metacpan

lib/WL/input_method.pm  view on Meta::CPAN

{
	my $self = shift;
	my $opcode = shift;

	if ($opcode == EVENT_ACTIVATE) {
		@_ = unpack ('L', shift);
		return $self->activate (new WL::wl_input_method_context ($self->{conn}));
	} elsif ($opcode == EVENT_DEACTIVATE) {
		@_ = unpack ('L', shift);
		return $self->deactivate (new WL::wl_input_method_context ($self->{conn}, shift));
	} else {
		die 'Bad opcode';
	}
}

package WL::wl_input_panel;

our @ISA = qw/WL::Base/;
our $VERSION = 1;
our $INTERFACE = 'wl_input_panel';

# Requests
use constant REQUEST_GET_INPUT_PANEL_SURFACE => 0;

sub get_input_panel_surface
{
	my $self = shift;
	my $file;
	my $retval;

	$self->call (REQUEST_GET_INPUT_PANEL_SURFACE, pack ('L L',
		($retval = new WL::wl_input_panel_surface ($self->{conn}))->{id},
		shift->{id}), $file);

	return $retval;
}

package WL::wl_input_panel_surface;

our @ISA = qw/WL::Base/;
our $VERSION = 1;
our $INTERFACE = 'wl_input_panel_surface';

# Requests
use constant REQUEST_SET_TOPLEVEL => 0;
use constant REQUEST_SET_OVERLAY_PANEL => 1;

sub set_toplevel
{
	my $self = shift;
	my $file;
	my $retval;

	$self->call (REQUEST_SET_TOPLEVEL, pack ('L L',
		shift->{id},
		shift), $file);

	return $retval;
}

sub set_overlay_panel
{
	my $self = shift;
	my $file;
	my $retval;

	$self->call (REQUEST_SET_OVERLAY_PANEL, pack ('',
		), $file);

	return $retval;
}

# Enums
use constant POSITION_CENTER_BOTTOM => 0;


=head1 BUGS

The interface documentation for the bindings is lacking.

Only client part implemented, not server.

=head1 SEE ALSO

=over

=item *

L<http://wayland.freedesktop.org/> -- Wayland project web site

=item *

L<wl-draw.pl> -- Example Wayland client

=item *

L<wl-scanner.pl> -- Tool that generated this module

=item *

L<WL::Base> -- Base class for Wayland objects

=item *

L<WL::Connection> -- Estabilish a Wayland connection

=back

=head1 COPYRIGHT

Copyright 2013, 2014 Lubomir Rintel

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

Copyright notice from the protocol definition file:

  Copyright © 2012, 2013 Intel Corporation
  
  Permission to use, copy, modify, distribute, and sell this
  software and its documentation for any purpose is hereby granted



( run in 1.269 second using v1.01-cache-2.11-cpan-99c4e6809bf )