home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.sepub/pictures / 2014.11.ftp.sunet.se-pictures.tar / ftp.sunet.se / pub / pictures / ACiD-artpacks / programs / unix / editors / gimp-plugins-unstable-0_99_23_tar.gz / gimp-plugins-unstable-0_99_23_tar / gimp-plugins-unstable-0.99.23 / dumpwindow / gtkpanner.h < prev    next >
C/C++ Source or Header  |  1998-03-01  |  3KB  |  121 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Library General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Library General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Library General Public
  15.  * License along with this library; if not, write to the Free
  16.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  */
  18. #ifndef __GTK_PANNER_H__
  19. #define __GTK_PANNER_H__
  20.  
  21.  
  22. #include <gtk/gtkwidget.h>
  23.  
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif /* __cplusplus */
  28.  
  29.  
  30. enum
  31. {
  32.   GTK_TRAVERSE_LEFT   = 1 << 0,
  33.   GTK_TRAVERSE_RIGHT  = 1 << 1,
  34.   GTK_TRAVERSE_TOP    = 1 << 2,  
  35.   GTK_TRAVERSE_BOTTOM = 1 << 3
  36. };
  37.  
  38.  
  39. #define GTK_PANNER(obj)          GTK_CHECK_CAST (obj, gtk_panner_get_type (), GtkPanner)
  40. #define GTK_PANNER_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_panner_get_type (), GtkPannerClass)
  41. #define GTK_IS_PANNER(obj)       GTK_CHECK_TYPE (obj, gtk_panner_get_type ())
  42.  
  43.  
  44. typedef struct _GtkPanner       GtkPanner;
  45. typedef struct _GtkPannerClass  GtkPannerClass;
  46.  
  47. struct _GtkPanner
  48. {
  49.   GtkWidget widget;
  50.  
  51.   GdkRectangle canvas_area;
  52.   GdkRectangle slider_area;
  53.  
  54.   gint canvas_width;
  55.   gint canvas_height;
  56.   gint slider_x;
  57.   gint slider_y;
  58.   gint slider_width;
  59.   gint slider_height;
  60.  
  61.   guint do_slide : 1;
  62.   guint do_resize : 1;
  63.  
  64.   guint allow_traverse_left : 1;     /* XXX: Is this good name? */
  65.   guint allow_traverse_right : 1;    /* XXX: Is this good name? */
  66.   guint allow_traverse_top : 1;      /* XXX: Is this good name? */
  67.   guint allow_traverse_bottom : 1;   /* XXX: Is this good name? */
  68.  
  69.   guint is_sliding : 1;
  70.   guint is_resizing : 1;
  71.   gint pressed_point_x;
  72.   gint pressed_point_y;
  73.  
  74.   gint old_slider_x;
  75.   gint old_slider_y;
  76.   gint old_slider_width;
  77.   gint old_slider_height;
  78.  
  79.  
  80.   void (* paint_canvas) (GtkPanner *panner, GdkRectangle *area,
  81.              gpointer user_data);
  82.   void (* paint_slider) (GtkPanner *panner, GdkRectangle *area,
  83.              gpointer user_data);
  84.   gpointer paint_canvas_user_data;
  85.   gpointer paint_slider_user_data;
  86. };
  87.  
  88. struct _GtkPannerClass
  89. {
  90.   GtkWidgetClass parent_class;
  91.  
  92.   void (* canvas_resize_notify) (GtkPanner *panner);
  93.   void (* slider_move_notify) (GtkPanner *panner);
  94.   void (* slider_resize_notify) (GtkPanner *panner);
  95.   void (* slider_motion_notify) (GtkPanner *panner);
  96. };
  97.  
  98.  
  99. guint      gtk_panner_get_type (void);
  100. GtkWidget* gtk_panner_new      (void);
  101.  
  102. void       gtk_panner_set_canvas_size (GtkPanner *panner,
  103.                        gint width, gint height);
  104. void       gtk_panner_set_slider_size (GtkPanner *panner,
  105.                        gint width, gint height);
  106. void       gtk_panner_set_slider_position (GtkPanner *panner,
  107.                        gint x, gint y);
  108.  
  109. void       gtk_panner_set_traverse_perm (GtkPanner *panner,
  110.                      gint permission);
  111. void       gtk_panner_unset_traverse_perm (GtkPanner *panner,
  112.                        gint permission);
  113.  
  114.  
  115. #ifdef __cplusplus
  116. }
  117. #endif /* __cplusplus */
  118.  
  119.  
  120. #endif /* __GTK_PANNER_H__ */
  121.