Logo Search packages:      
Sourcecode: wayland-demos version File versions  Download package

Classes | Functions | Variables

eventdemo.c File Reference

Demonstrate the use of Wayland's toytoolkit. More...

#include <stdio.h>
#include <stdlib.h>
#include <cairo.h>
#include <glib.h>
#include "window.h"
Include dependency graph for eventdemo.c:

Go to the source code of this file.

Classes

struct  eventdemo
 Holds all data the program needs per window. More...

Functions

static void button_handler (struct window *window, struct input *input, uint32_t time, int button, int state, void *data)
 CALLBACK function, Wayland informs about button event.
static struct eventdemoeventdemo_create (struct display *d)
 Create and initialise a new eventdemo window.
static void eventdemo_draw (struct eventdemo *e)
 Redraws the window.
static void key_handler (struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t unicode, uint32_t state, void *data)
 CALLBACK function, Wayland informs about key event.
static void keyboard_focus_handler (struct window *window, struct input *device, void *data)
 CALLBACK function, Wayland informs about keyboard focus change.
int main (int argc, char *argv[])
 Connects to the display, creates the window and hands over to the main loop.
static int motion_handler (struct window *window, struct input *input, uint32_t time, int32_t x, int32_t y, int32_t sx, int32_t sy, void *data)
 CALLBACK function, Waylands informs about pointer motion.
static void redraw_handler (struct window *window, void *data)
 CALLBACK function, Wayland requests the window to redraw.
static void resize_handler (struct window *window, int32_t width, int32_t height, void *data)
 CALLBACK function, Wayland requests the window to resize.

Variables

static int height = 400
static int height_max = 0
static int log_button = 0
static int log_focus = 0
static int log_key = 0
static int log_motion = 0
static int log_redraw = 0
static int log_resize = 0
static int noborder = 0
static const GOptionEntry option_entries []
 command line options for eventdemo
static char * title = "EventDemo"
static int width = 500
static int width_max = 0

Detailed Description

Demonstrate the use of Wayland's toytoolkit.

Heavily commented demo program that can report all events that are dispatched to the window. For other functionality, eg. opengl/egl, drag and drop, etc. have a look at the other demos.

Author:
Tim Wiederhake

Definition in file eventdemo.c.


Generated by  Doxygen 1.6.0   Back to index