Main Page | Namespace List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

magnifier.h

Go to the documentation of this file.
00001 /*
00002  * AT-SPI - Assistive Technology Service Provider Interface
00003  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
00004  *
00005  * Copyright 2001 Sun Microsystems Inc.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef MAGNIFIER_H_
00024 #define MAGNIFIER_H_
00025 
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif /* __cplusplus */
00030 
00031 #include <X11/Xlib.h>
00032 #include <gdk/gdk.h>
00033 #include <bonobo/bonobo-object.h>
00034 #include <bonobo/bonobo-property-bag.h>
00035 #include <login-helper/login-helper.h>
00036 #include <glib.h>
00037 #include "GNOME_Magnifier.h"
00038 
00039 #define MAGNIFIER_TYPE         (magnifier_get_type ())
00040 #define MAGNIFIER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), MAGNIFIER_TYPE, Magnifier))
00041 #define MAGNIFIER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), MAGNIFIER_TYPE, MagnifierClass))
00042 #define IS_MAGNIFIER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAGNIFIER_TYPE))
00043 #define IS_MAGNIFIER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAGNIFIER_TYPE))
00044 
00045 #define MAGNIFIER_OAFIID "OAFIID:GNOME_Magnifier_Magnifier:0.9"
00046 
00047 typedef struct _MagnifierPrivate MagnifierPrivate;
00048 
00049 typedef struct {
00050         BonoboObject parent;
00051         BonoboPropertyBag *property_bag;
00052         GdkDisplay *source_display;
00053         GdkDisplay *target_display;
00054         gchar *source_display_name;
00055         gchar *target_display_name;
00056         int source_screen_num;
00057         int target_screen_num;
00058         GList *zoom_regions;
00059         gboolean source_initialized;
00060         gint crosswire_size;
00061         guint32 crosswire_color;
00062         gboolean crosswire_clip;
00063         gchar *cursor_set;
00064         gint cursor_size_x;
00065         gint cursor_size_y;
00066         guint32 cursor_color;
00067         float cursor_scale_factor;
00068         GNOME_Magnifier_RectBounds source_bounds;
00069         GNOME_Magnifier_RectBounds target_bounds;
00070         GNOME_Magnifier_Point cursor_hotspot;
00071         MagnifierPrivate *priv;
00072 } Magnifier;
00073 
00074 typedef struct {
00075         BonoboObjectClass parent_class;
00076         POA_GNOME_Magnifier_Magnifier__epv epv;
00077 } MagnifierClass;
00078 
00079 /*
00080  * When running the magnifier in timing test mode (--timing-pan-rate and/or
00081  * --timing-iterations), then the following output is displayed:
00082  *
00083  * Pan Rate           = 200
00084  * Frames Processed   = 1225
00085  * Width/Height/Depth = 640/1024/8
00086  * Zoom Factor (x/y)  = 3.000000/3.000000
00087  * Update Duration    = (avg. 0.010232) (max. 0.002685) (tot. 1.084589) seconds
00088  *   Update Pixels    = (avg. 3046) pixels/frame
00089  *   Update Rate      = (avg. 97.732909) (max. 372.439485) updates/second
00090  *   Net Update Rate  = (avg. 0.297724) (max. 0.457741) Mpex/second
00091  * Pan Latency        = (avg. 0.008229) (max. 0.562326) seconds
00092  * Tot Frame Duration = (avg. 0.008363) (max. 0.562485) (tot. 10.235981)seconds
00093  * Frame Rate         = (avg. 119.578189) (max. 4854.369141) frames/second
00094  * Scroll Delta (x)   = (avg. 0.000000) (tot. 0) lines
00095  * Scroll Delta (y)   = (avg. 5.019608) (tot. 6144) lines
00096  * Scroll Rate (x)    = (avg. 0.000000) lines/second
00097  * Scroll Rate (y)    = (avg. 600.235657) lines/second
00098  * Net Render Rate    = (avg. 8.685322) (max. 3181.359360) Mpex/second
00099  *
00100  * Pan Rate             - Displays the pan rate specified on the command line.
00101  *                        Only displayed if --timing-pan-rate is used.
00102  * Frames Processed     - Number of frames displayed
00103  * Width/Height/Depth   - The width/height/depth of magnifier display.
00104  * Zoom Factor (x/y)    - The zoom factor used.
00105  * Update Duration      - Average and total time spent updating new sections of
00106  *                        the screen.
00107  *   Update Pixels      - Number of pixels updated
00108  *   Update Rate        - Number of updates possible per second.
00109  *   Net Update Rate    - Number of Megapixels updated per second.
00110  * Pan Latency          - Time spent from the beginning of the setROI request
00111  *                        until GTK+ has finished processing the update (in
00112  *                        GDK's gdk_window_update_idle idle handler.
00113  * Total Frame Duration - Average and total time processing frames.
00114  * Frame Rate           - Number of frames per second.
00115  * Scroll Delta         - Average and total number of lines scrolled.
00116  * Scroll Rate          - Number of lines scrolled per second.  Note that this
00117  *                        value will be equal to the --timing-pan-rate value
00118  *                        times the y zoom factor.
00119  * Net Render Rate      - Number of Megapixels processed per second.
00120  *
00121  * When running with the --timing-output argument, similar information is
00122  * displayed for each frame plus timing information for the frame.  Update
00123  * information is not displayed for frames where updates do not occur.  Pan 
00124  * Rate, Frames Processed, and Width/Height/Depth is not displayed for each
00125  * frame, only when displaying summary information.
00126  */
00127 
00128 typedef struct timing {
00129         GTimer *process;
00130         GTimer *frame;
00131         GTimer *scale;
00132         GTimer *idle;
00133         gdouble scale_val;
00134         gdouble idle_val;
00135         gdouble frame_val;
00136         int   dx;
00137         int   dy;
00138         gdouble scale_total;
00139         gdouble idle_total;
00140         gdouble frame_total;
00141         int   dx_total;
00142         int   dy_total;
00143         long  update_pixels_total;
00144         long  num_scale_samples;
00145         long  num_idle_samples;
00146         long  num_frame_samples;
00147         long  num_line_samples;
00148         gdouble last_frame_val;
00149         int   last_dy;
00150 } TimingStruct;
00151 
00152 TimingStruct mag_timing;
00153 
00154 GdkDrawable *magnifier_get_cursor    (Magnifier *magnifier);
00155 GType        magnifier_get_type      (void);
00156 GdkWindow   *magnifier_get_root      (Magnifier *magnifier);
00157 Magnifier   *magnifier_new           (gboolean override_redirect);
00158 gboolean     magnifier_error_check   (void);
00159 void         magnifier_notify_damage (Magnifier *magnifier, XRectangle *rect);
00160 gboolean     magnifier_source_has_damage_extension (Magnifier *magnifier);
00161 #ifdef __cplusplus
00162 }
00163 #endif /* __cplusplus */
00164 
00165 #endif /* MAGNIFIER_H_ */

Generated on Mon May 15 16:14:02 2006 for gnome-mag by  doxygen 1.4.4