diff options
author | Benjamin Otte <otte@redhat.com> | 2018-06-04 05:41:44 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-06-07 21:47:30 -0400 |
commit | b6c8943bbfb046f4f8c2b468a71b407115735760 (patch) | |
tree | f733dd4469a445d8a1fdb221f4ab9f6b13105d8f /demos/gtk-demo/puzzlepiece.h | |
parent | 46d8c84049f7e76c8d8ff4f71eac95d8ea227920 (diff) | |
download | gtk+-b6c8943bbfb046f4f8c2b468a71b407115735760.tar.gz |
demo: Add the sliding puzzle demo
Diffstat (limited to 'demos/gtk-demo/puzzlepiece.h')
-rw-r--r-- | demos/gtk-demo/puzzlepiece.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/demos/gtk-demo/puzzlepiece.h b/demos/gtk-demo/puzzlepiece.h new file mode 100644 index 0000000000..b7fc97dc05 --- /dev/null +++ b/demos/gtk-demo/puzzlepiece.h @@ -0,0 +1,23 @@ +#ifndef __PUZZLE_PIECE_H__ +#define __PUZZLE_PIECE_H__ + +#include <gtk/gtk.h> + +/* First, add the boilerplate for the object itself. + */ +#define GTK_TYPE_PUZZLE_PIECE (gtk_puzzle_piece_get_type ()) +G_DECLARE_FINAL_TYPE (GtkPuzzlePiece, gtk_puzzle_piece, GTK, PUZZLE_PIECE, GObject) + +/* Then, declare all constructors */ +GdkPaintable * gtk_puzzle_piece_new (GdkPaintable *puzzle, + guint x, + guint y, + guint width, + guint height); + +/* Next, add the getters and setters for object properties */ +GdkPaintable * gtk_puzzle_piece_get_puzzle (GtkPuzzlePiece *self); +guint gtk_puzzle_piece_get_x (GtkPuzzlePiece *self); +guint gtk_puzzle_piece_get_y (GtkPuzzlePiece *self); + +#endif /* __PUZZLE_PIECE_H__ */ |