1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
/* a side panel that can slide in and out of view
*/
/*
Copyright (C) 2007 The National Gallery
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#define TYPE_PANE (pane_get_type())
#define PANE( obj ) (GTK_CHECK_CAST( (obj), TYPE_PANE, Pane ))
#define PANE_CLASS( klass ) \
(GTK_CHECK_CLASS_CAST( (klass), TYPE_PANE, PaneClass ))
#define IS_PANE( obj ) (GTK_CHECK_TYPE( (obj), TYPE_PANE ))
#define IS_PANE_CLASS( klass ) \
(GTK_CHECK_CLASS_TYPE( (klass), TYPE_PANE ))
/* Can hide on the left or the right hand side of a window.
*/
typedef enum {
PANE_HIDE_LEFT,
PANE_HIDE_RIGHT
} PaneHandedness;
typedef struct _Pane {
GtkHPaned parent_object;
PaneHandedness handedness; /* Hide on left or right */
/* The child pane we show on left or right.
*/
Panechild *panechild;
/* Are we visible or not.
*/
gboolean open;
/* The position of the divider. This changes as the pane is animated
* open and closed and does not reflect the position the user has
* selected by dragging.
*/
int position;
/* The position the user wants the pane to sit at.
*/
int user_position;
/* Animating towards this position. If close_on_end is true, close the
* pane at the end of animation.
*/
int target_position;
gboolean close_on_end;
/* Set animation speed with this.
*/
int last_set_position;
/* Timeout for animation.
*/
guint animate_timeout;
} Pane;
typedef struct _PaneClass {
GtkHPanedClass parent_class;
/* Either position or open have changed.
*/
void (*changed)( Pane * );
} PaneClass;
GType pane_get_type( void );
Pane *pane_new( PaneHandedness handedness );
void pane_set_position( Pane *pane, int position );
void pane_set_user_position( Pane *pane, int user_position );
void pane_set_open( Pane *pane, gboolean open );
void pane_set_state( Pane *pane, gboolean open, int user_position );
void pane_set_child( Pane *pane, Panechild *panechild );
void pane_animate_closed( Pane *pane );
void pane_animate_open( Pane *pane );
|