00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef MAGNIFIER_H_
00024 #define MAGNIFIER_H_
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif 
00029 
00030 #include "GNOME_Magnifier.h"
00031 
00032 #include <X11/Xlib.h>
00033 #ifdef HAVE_XFIXES
00034 #include <X11/extensions/Xfixes.h>
00035 #endif 
00036 
00037 #include <glib.h>
00038 
00039 #include <gdk/gdk.h>
00040 
00041 #include <bonobo/bonobo-object.h>
00042 #include <bonobo/bonobo-property-bag.h>
00043 
00044 #include <login-helper/login-helper.h>
00045 
00046 #define MAGNIFIER_TYPE         (magnifier_get_type ())
00047 #define MAGNIFIER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), MAGNIFIER_TYPE, Magnifier))
00048 #define MAGNIFIER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), MAGNIFIER_TYPE, MagnifierClass))
00049 #define IS_MAGNIFIER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAGNIFIER_TYPE))
00050 #define IS_MAGNIFIER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAGNIFIER_TYPE))
00051 
00052 #define MAGNIFIER_OAFIID "OAFIID:GNOME_Magnifier_Magnifier:0.9"
00053 
00054 typedef struct _MagnifierPrivate MagnifierPrivate;
00055 
00056 typedef struct {
00057         BonoboObject parent;
00058         BonoboPropertyBag *property_bag;
00059         GdkDisplay *source_display;
00060         GdkDisplay *target_display;
00061         gchar *source_display_name;
00062         gchar *target_display_name;
00063         int source_screen_num;
00064         int target_screen_num;
00065         GList *zoom_regions;
00066         gboolean source_initialized;
00067         gint crosswire_size;
00068         guint32 crosswire_color;
00069         gboolean crosswire_clip;
00070         gchar *cursor_set;
00071         gint cursor_size_x;
00072         gint cursor_size_y;
00073         guint32 cursor_color;
00074         float cursor_scale_factor;
00075         GNOME_Magnifier_RectBounds source_bounds;
00076         GNOME_Magnifier_RectBounds target_bounds;
00077         GNOME_Magnifier_Point cursor_hotspot;
00078         MagnifierPrivate *priv;
00079 } Magnifier;
00080 
00081 typedef struct {
00082         BonoboObjectClass parent_class;
00083         POA_GNOME_Magnifier_Magnifier__epv epv;
00084 } MagnifierClass;
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 typedef struct timing {
00136         GTimer *process;
00137         GTimer *frame;
00138         GTimer *scale;
00139         GTimer *idle;
00140         gdouble scale_val;
00141         gdouble idle_val;
00142         gdouble frame_val;
00143         int   dx;
00144         int   dy;
00145         gdouble scale_total;
00146         gdouble idle_total;
00147         gdouble frame_total;
00148         int   dx_total;
00149         int   dy_total;
00150         long  update_pixels_total;
00151         long  num_scale_samples;
00152         long  num_idle_samples;
00153         long  num_frame_samples;
00154         long  num_line_samples;
00155         gdouble last_frame_val;
00156         int   last_dy;
00157 } TimingStruct;
00158 
00159 TimingStruct mag_timing;
00160 
00161 GdkDrawable *magnifier_get_cursor    (Magnifier *magnifier);
00162 GType        magnifier_get_type      (void);
00163 GdkWindow   *magnifier_get_root      (Magnifier *magnifier);
00164 Magnifier   *magnifier_new           (gboolean override_redirect);
00165 gboolean     magnifier_error_check   (void);
00166 void         magnifier_notify_damage (Magnifier *magnifier, XRectangle *rect);
00167 void         magnifier_set_cursor_from_pixbuf (Magnifier *magnifier,
00168                                                GdkPixbuf *cursor_pixbuf);
00169 void         magnifier_set_cursor_pixmap_by_name (Magnifier *magnifier,
00170                                                   const gchar *cursor_name, 
00171                                                   gboolean source_fallback);
00172 void         magnifier_transform_cursor (Magnifier *magnifier);
00173 #ifdef __cplusplus
00174 }
00175 #endif 
00176 
00177 #endif