magnifier.c File Reference

#include "config.h"
#include "magnifier.h"
#include "magnifier-private.h"
#include "zoom-region.h"
#include "zoom-region-private.h"
#include "gmag-cursor.h"
#include "gmag-graphical-server.h"
#include "GNOME_Magnifier.h"
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <libbonobo.h>
#include <login-helper/login-helper.h>
#include <gdk-pixbuf/gdk-pixbuf-io.h>
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>

Go to the source code of this file.

Data Structures

struct  MagLoginHelper
struct  MagLoginHelperClass
struct  MagnifierZoomRegionSaveProps

Defines

#define DEBUG_CLIENT_CALLS
#define DBG(a)   if (client_debug) { (a); }
#define GET_PIXEL(a, i, j, s, b)   (*(guint32 *)(memcpy (b,(a) + ((j) * s + (i) * pixel_size_t), pixel_size_t)))
#define PUT_PIXEL(a, i, j, s, b)   (memcpy (a + ((j) * s + (i) * pixel_size_t), &(b), pixel_size_t))

Enumerations

enum  {
  MAGNIFIER_SOURCE_DISPLAY_PROP,
  MAGNIFIER_TARGET_DISPLAY_PROP,
  MAGNIFIER_SOURCE_SIZE_PROP,
  MAGNIFIER_TARGET_SIZE_PROP,
  MAGNIFIER_CURSOR_SET_PROP,
  MAGNIFIER_CURSOR_SIZE_PROP,
  MAGNIFIER_CURSOR_ZOOM_PROP,
  MAGNIFIER_CURSOR_COLOR_PROP,
  MAGNIFIER_CURSOR_HOTSPOT_PROP,
  MAGNIFIER_CURSOR_DEFAULT_SIZE_PROP,
  MAGNIFIER_CROSSWIRE_SIZE_PROP,
  MAGNIFIER_CROSSWIRE_LENGTH_PROP,
  MAGNIFIER_CROSSWIRE_CLIP_PROP,
  MAGNIFIER_CROSSWIRE_COLOR_PROP
}

Functions

static void magnifier_init_cursor_set (Magnifier *magnifier, gchar *cursor_set)
static void magnifier_init_window (Magnifier *magnifier, GdkScreen *screen)
static gboolean magnifier_reset_struts_at_idle (gpointer data)
static void magnifier_adjust_source_size (Magnifier *magnifier)
static Window * mag_login_helper_get_raise_windows (LoginHelper *helper)
static LoginHelperDeviceReqFlags mag_login_helper_get_device_reqs (LoginHelper *helper)
static gboolean mag_login_helper_set_safe (LoginHelper *helper, gboolean ignored)
static void mag_login_helper_class_init (MagLoginHelperClass *klass)
static void mag_login_helper_init (MagLoginHelper *helper)
static void mag_login_helper_set_magnifier (MagLoginHelper *helper, Magnifier *mag)
 BONOBO_TYPE_FUNC (MagLoginHelper, LOGIN_HELPER_TYPE, mag_login_helper)
static void magnifier_warp_cursor_to_screen (Magnifier *magnifier)
void magnifier_zoom_regions_update_pointer (Magnifier *magnifier)
static void magnifier_zoom_regions_mark_dirty (Magnifier *magnifier, GNOME_Magnifier_RectBounds rect_bounds)
void magnifier_set_cursor_from_pixbuf (Magnifier *magnifier, GdkPixbuf *cursor_pixbuf)
GdkPixbuf * magnifier_get_pixbuf_for_name (Magnifier *magnifier, const gchar *cursor_name)
void magnifier_set_cursor_pixmap_by_name (Magnifier *magnifier, const gchar *cursor_name, gboolean source_fallback)
void magnifier_notify_damage (Magnifier *magnifier, GdkRectangle *rect)
static void magnifier_set_extension_listeners (Magnifier *magnifier, GdkWindow *root)
static void magnifier_size_allocate (GtkWidget *widget)
static void magnifier_realize (GtkWidget *widget)
GdkWindow * magnifier_get_root (Magnifier *magnifier)
static gint magnifier_parse_display_name (Magnifier *magnifier, gchar *full_display_string, gchar **display_name)
static void magnifier_get_display_rect_bounds (Magnifier *magnifier, GNOME_Magnifier_RectBounds *rect_bounds, gboolean is_target)
gboolean magnifier_full_screen_capable (Magnifier *magnifier)
static void magnifier_unref_zoom_region (gpointer data, gpointer user_data)
static GSList * magnifier_zoom_regions_save (Magnifier *magnifier)
static void magnifier_zoom_regions_restore (Magnifier *magnifier, GSList *region_params)
static void magnifier_init_display (Magnifier *magnifier, gchar *display_name, gboolean is_target)
static void magnifier_exit (GtkObject *object)
static void magnifier_recolor_pixbuf (Magnifier *magnifier, GdkPixbuf *pixbuf)
void magnifier_transform_cursor (Magnifier *magnifier)
static void magnifier_get_property (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
static void magnifier_set_property (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
static void magnifier_do_dispose (Magnifier *magnifier)
static void magnifier_gobject_dispose (GObject *object)
static CORBA_boolean impl_magnifier_support_colorblind_filters (Magnifier *magnifier)
static void impl_magnifier_hide_cursor (PortableServer_Servant servant, CORBA_Environment *ev)
static void impl_magnifier_show_cursor (PortableServer_Servant servant, CORBA_Environment *ev)
static CORBA_boolean impl_magnifier_full_screen_capable (PortableServer_Servant servant, CORBA_Environment *ev)
static void impl_magnifier_set_source_display (PortableServer_Servant servant, const CORBA_char *display, CORBA_Environment *ev)
static void impl_magnifier_set_target_display (PortableServer_Servant servant, const CORBA_char *display, CORBA_Environment *ev)
static CORBA_string impl_magnifier_get_source_display (PortableServer_Servant servant, CORBA_Environment *ev)
static CORBA_string impl_magnifier_get_target_display (PortableServer_Servant servant, CORBA_Environment *ev)
static GNOME_Magnifier_ZoomRegion impl_magnifier_create_zoom_region (PortableServer_Servant servant, const CORBA_float zx, const CORBA_float zy, const GNOME_Magnifier_RectBounds *roi, const GNOME_Magnifier_RectBounds *viewport, CORBA_Environment *ev)
static CORBA_boolean impl_magnifier_add_zoom_region (PortableServer_Servant servant, const GNOME_Magnifier_ZoomRegion region, CORBA_Environment *ev)
static Bonobo_PropertyBag impl_magnifier_get_properties (PortableServer_Servant servant, CORBA_Environment *ev)
GNOME_Magnifier_ZoomRegionListimpl_magnifier_get_zoom_regions (PortableServer_Servant servant, CORBA_Environment *ev)
static void impl_magnifier_clear_all_zoom_regions (PortableServer_Servant servant, CORBA_Environment *ev)
static void impl_magnifier_dispose (PortableServer_Servant servant, CORBA_Environment *ev)
static void magnifier_class_init (MagnifierClass *klass)
static void magnifier_properties_init (Magnifier *magnifier)
static void magnifier_init (Magnifier *magnifier)
GdkDrawable * magnifier_get_cursor (Magnifier *magnifier)
Magnifiermagnifier_new (gboolean override_redirect)

Variables

static gboolean client_debug = FALSE
static GObjectClass * parent_class = NULL
enum { ... }  PropIdx
gchar * mag_prop_names [MAGNIFIER_CROSSWIRE_COLOR_PROP+1]
static Magnifier_this_magnifier = NULL
gint fixes_event_base
static gboolean _is_override_redirect = FALSE


Define Documentation

#define DEBUG_CLIENT_CALLS

Definition at line 45 of file magnifier.c.

#define DBG (  )     if (client_debug) { (a); }

#define GET_PIXEL ( a,
i,
j,
s,
 )     (*(guint32 *)(memcpy (b,(a) + ((j) * s + (i) * pixel_size_t), pixel_size_t)))

Definition at line 683 of file magnifier.c.

Referenced by magnifier_recolor_pixbuf().

#define PUT_PIXEL ( a,
i,
j,
s,
 )     (memcpy (a + ((j) * s + (i) * pixel_size_t), &(b), pixel_size_t))

Definition at line 686 of file magnifier.c.

Referenced by magnifier_recolor_pixbuf().


Enumeration Type Documentation

anonymous enum

Enumerator:
MAGNIFIER_SOURCE_DISPLAY_PROP 
MAGNIFIER_TARGET_DISPLAY_PROP 
MAGNIFIER_SOURCE_SIZE_PROP 
MAGNIFIER_TARGET_SIZE_PROP 
MAGNIFIER_CURSOR_SET_PROP 
MAGNIFIER_CURSOR_SIZE_PROP 
MAGNIFIER_CURSOR_ZOOM_PROP 
MAGNIFIER_CURSOR_COLOR_PROP 
MAGNIFIER_CURSOR_HOTSPOT_PROP 
MAGNIFIER_CURSOR_DEFAULT_SIZE_PROP 
MAGNIFIER_CROSSWIRE_SIZE_PROP 
MAGNIFIER_CROSSWIRE_LENGTH_PROP 
MAGNIFIER_CROSSWIRE_CLIP_PROP 
MAGNIFIER_CROSSWIRE_COLOR_PROP 

Definition at line 67 of file magnifier.c.


Function Documentation

static void magnifier_init_cursor_set ( Magnifier magnifier,
gchar *  cursor_set 
) [static]

static void magnifier_init_window ( Magnifier magnifier,
GdkScreen *  screen 
) [static]

static gboolean magnifier_reset_struts_at_idle ( gpointer  data  )  [static]

Definition at line 874 of file magnifier.c.

References MAGNIFIER, Magnifier::priv, and _MagnifierPrivate::w.

Referenced by magnifier_new().

static void magnifier_adjust_source_size ( Magnifier magnifier  )  [static]

static Window* mag_login_helper_get_raise_windows ( LoginHelper *  helper  )  [static]

static LoginHelperDeviceReqFlags mag_login_helper_get_device_reqs ( LoginHelper *  helper  )  [static]

Definition at line 148 of file magnifier.c.

Referenced by mag_login_helper_class_init().

static gboolean mag_login_helper_set_safe ( LoginHelper *  helper,
gboolean  ignored 
) [static]

Definition at line 159 of file magnifier.c.

Referenced by mag_login_helper_class_init().

static void mag_login_helper_class_init ( MagLoginHelperClass klass  )  [static]

static void mag_login_helper_init ( MagLoginHelper helper  )  [static]

Definition at line 174 of file magnifier.c.

References MagLoginHelper::mag.

static void mag_login_helper_set_magnifier ( MagLoginHelper helper,
Magnifier mag 
) [static]

Definition at line 180 of file magnifier.c.

References MagLoginHelper::mag.

Referenced by magnifier_new().

BONOBO_TYPE_FUNC ( MagLoginHelper  ,
LOGIN_HELPER_TYPE  ,
mag_login_helper   
)

Definition at line 186 of file magnifier.c.

static void magnifier_warp_cursor_to_screen ( Magnifier magnifier  )  [static]

Definition at line 203 of file magnifier.c.

References Magnifier::priv, _MagnifierPrivate::root, and Magnifier::source_display.

Referenced by magnifier_set_property().

void magnifier_zoom_regions_update_pointer ( Magnifier magnifier  ) 

static void magnifier_zoom_regions_mark_dirty ( Magnifier magnifier,
GNOME_Magnifier_RectBounds  rect_bounds 
) [static]

void magnifier_set_cursor_from_pixbuf ( Magnifier magnifier,
GdkPixbuf *  cursor_pixbuf 
)

GdkPixbuf* magnifier_get_pixbuf_for_name ( Magnifier magnifier,
const gchar *  cursor_name 
)

Definition at line 329 of file magnifier.c.

References _MagnifierPrivate::cursorlist, and Magnifier::priv.

Referenced by magnifier_set_cursor_pixmap_by_name().

void magnifier_set_cursor_pixmap_by_name ( Magnifier magnifier,
const gchar *  cursor_name,
gboolean  source_fallback 
)

void magnifier_notify_damage ( Magnifier magnifier,
GdkRectangle *  rect 
)

static void magnifier_set_extension_listeners ( Magnifier magnifier,
GdkWindow *  root 
) [static]

Definition at line 378 of file magnifier.c.

References Magnifier::source_initialized.

Referenced by impl_magnifier_add_zoom_region(), and magnifier_set_property().

static void magnifier_size_allocate ( GtkWidget *  widget  )  [static]

Definition at line 385 of file magnifier.c.

Referenced by magnifier_init_window(), and magnifier_set_property().

static void magnifier_realize ( GtkWidget *  widget  )  [static]

Definition at line 391 of file magnifier.c.

Referenced by magnifier_init_window(), and magnifier_set_property().

GdkWindow* magnifier_get_root ( Magnifier magnifier  ) 

static gint magnifier_parse_display_name ( Magnifier magnifier,
gchar *  full_display_string,
gchar **  display_name 
) [static]

Definition at line 408 of file magnifier.c.

Referenced by magnifier_init_display(), and magnifier_set_property().

static void magnifier_get_display_rect_bounds ( Magnifier magnifier,
GNOME_Magnifier_RectBounds rect_bounds,
gboolean  is_target 
) [static]

gboolean magnifier_full_screen_capable ( Magnifier magnifier  ) 

static void magnifier_unref_zoom_region ( gpointer  data,
gpointer  user_data 
) [static]

static GSList* magnifier_zoom_regions_save ( Magnifier magnifier  )  [static]

static void magnifier_zoom_regions_restore ( Magnifier magnifier,
GSList *  region_params 
) [static]

static void magnifier_init_display ( Magnifier magnifier,
gchar *  display_name,
gboolean  is_target 
) [static]

static void magnifier_exit ( GtkObject *  object  )  [static]

Definition at line 677 of file magnifier.c.

Referenced by magnifier_init_window(), and magnifier_set_property().

static void magnifier_recolor_pixbuf ( Magnifier magnifier,
GdkPixbuf *  pixbuf 
) [static]

Definition at line 690 of file magnifier.c.

References Magnifier::cursor_color, GET_PIXEL, and PUT_PIXEL.

Referenced by magnifier_transform_cursor().

void magnifier_transform_cursor ( Magnifier magnifier  ) 

static void magnifier_get_property ( BonoboPropertyBag *  bag,
BonoboArg *  arg,
guint  arg_id,
CORBA_Environment *  ev,
gpointer  user_data 
) [static]

static void magnifier_set_property ( BonoboPropertyBag *  bag,
BonoboArg *  arg,
guint  arg_id,
CORBA_Environment *  ev,
gpointer  user_data 
) [static]

Definition at line 963 of file magnifier.c.

References Magnifier::crosswire_clip, Magnifier::crosswire_color, Magnifier::crosswire_length, Magnifier::crosswire_size, Magnifier::cursor_color, Magnifier::cursor_hotspot, Magnifier::cursor_scale_factor, Magnifier::cursor_set, Magnifier::cursor_size_x, Magnifier::cursor_size_y, DBG, ex_Bonobo_PropertyBag_NotFound, ex_Bonobo_PropertyBag_ReadOnly, magnifier_adjust_source_size(), MAGNIFIER_CROSSWIRE_CLIP_PROP, MAGNIFIER_CROSSWIRE_COLOR_PROP, MAGNIFIER_CROSSWIRE_LENGTH_PROP, MAGNIFIER_CROSSWIRE_SIZE_PROP, MAGNIFIER_CURSOR_COLOR_PROP, MAGNIFIER_CURSOR_DEFAULT_SIZE_PROP, MAGNIFIER_CURSOR_HOTSPOT_PROP, MAGNIFIER_CURSOR_SET_PROP, MAGNIFIER_CURSOR_SIZE_PROP, MAGNIFIER_CURSOR_ZOOM_PROP, magnifier_exit(), magnifier_get_display_rect_bounds(), magnifier_get_root(), magnifier_init_cursor_set(), magnifier_init_window(), magnifier_parse_display_name(), magnifier_realize(), magnifier_set_extension_listeners(), magnifier_size_allocate(), MAGNIFIER_SOURCE_DISPLAY_PROP, MAGNIFIER_SOURCE_SIZE_PROP, MAGNIFIER_TARGET_DISPLAY_PROP, MAGNIFIER_TARGET_SIZE_PROP, magnifier_transform_cursor(), magnifier_warp_cursor_to_screen(), magnifier_zoom_regions_mark_dirty(), magnifier_zoom_regions_restore(), magnifier_zoom_regions_save(), magnifier_zoom_regions_update_pointer(), _MagnifierPrivate::overlay, Magnifier::priv, _MagnifierPrivate::root, Magnifier::source_bounds, Magnifier::source_display, Magnifier::source_display_name, _MagnifierPrivate::source_drawable, Magnifier::source_screen_num, Magnifier::target_bounds, Magnifier::target_display, Magnifier::target_display_name, Magnifier::target_screen_num, TC_GNOME_Magnifier_Point, TC_GNOME_Magnifier_RectBounds, _MagnifierPrivate::w, GNOME_Magnifier_RectBounds_type::x1, GNOME_Magnifier_RectBounds_type::x2, GNOME_Magnifier_RectBounds_type::y1, and GNOME_Magnifier_RectBounds_type::y2.

Referenced by impl_magnifier_set_source_display(), impl_magnifier_set_target_display(), and magnifier_properties_init().

static void magnifier_do_dispose ( Magnifier magnifier  )  [static]

Definition at line 1196 of file magnifier.c.

References MAGNIFIER_OAFIID, and Magnifier::zoom_regions.

Referenced by impl_magnifier_dispose(), and magnifier_gobject_dispose().

static void magnifier_gobject_dispose ( GObject *  object  )  [static]

Definition at line 1210 of file magnifier.c.

References MAGNIFIER, and magnifier_do_dispose().

Referenced by magnifier_class_init().

static CORBA_boolean impl_magnifier_support_colorblind_filters ( Magnifier magnifier  )  [static]

Definition at line 1219 of file magnifier.c.

Referenced by magnifier_class_init().

static void impl_magnifier_hide_cursor ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1229 of file magnifier.c.

References MAGNIFIER.

Referenced by magnifier_class_init().

static void impl_magnifier_show_cursor ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1238 of file magnifier.c.

References MAGNIFIER.

Referenced by magnifier_class_init().

static CORBA_boolean impl_magnifier_full_screen_capable ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

static void impl_magnifier_set_source_display ( PortableServer_Servant  servant,
const CORBA_char *  display,
CORBA_Environment *  ev 
) [static]

static void impl_magnifier_set_target_display ( PortableServer_Servant  servant,
const CORBA_char *  display,
CORBA_Environment *  ev 
) [static]

static CORBA_string impl_magnifier_get_source_display ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1330 of file magnifier.c.

References DBG, MAGNIFIER, and Magnifier::source_display_name.

Referenced by magnifier_class_init().

static CORBA_string impl_magnifier_get_target_display ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1341 of file magnifier.c.

References DBG, MAGNIFIER, and Magnifier::target_display_name.

Referenced by magnifier_class_init().

static GNOME_Magnifier_ZoomRegion impl_magnifier_create_zoom_region ( PortableServer_Servant  servant,
const CORBA_float  zx,
const CORBA_float  zy,
const GNOME_Magnifier_RectBounds roi,
const GNOME_Magnifier_RectBounds viewport,
CORBA_Environment *  ev 
) [static]

static CORBA_boolean impl_magnifier_add_zoom_region ( PortableServer_Servant  servant,
const GNOME_Magnifier_ZoomRegion  region,
CORBA_Environment *  ev 
) [static]

static Bonobo_PropertyBag impl_magnifier_get_properties ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1431 of file magnifier.c.

References MAGNIFIER, and Magnifier::property_bag.

Referenced by magnifier_class_init().

GNOME_Magnifier_ZoomRegionList* impl_magnifier_get_zoom_regions ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
)

static void impl_magnifier_clear_all_zoom_regions ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1468 of file magnifier.c.

References MAGNIFIER, magnifier_unref_zoom_region(), and Magnifier::zoom_regions.

Referenced by magnifier_class_init().

static void impl_magnifier_dispose ( PortableServer_Servant  servant,
CORBA_Environment *  ev 
) [static]

Definition at line 1481 of file magnifier.c.

References MAGNIFIER, and magnifier_do_dispose().

Referenced by magnifier_class_init().

static void magnifier_class_init ( MagnifierClass klass  )  [static]

static void magnifier_properties_init ( Magnifier magnifier  )  [static]

static void magnifier_init ( Magnifier magnifier  )  [static]

GdkDrawable* magnifier_get_cursor ( Magnifier magnifier  ) 

Magnifier* magnifier_new ( gboolean  override_redirect  ) 


Variable Documentation

gboolean client_debug = FALSE [static]

Definition at line 48 of file magnifier.c.

Referenced by magnifier_init(), and zoom_region_class_init().

GObjectClass* parent_class = NULL [static]

Definition at line 65 of file magnifier.c.

Referenced by magnifier_class_init(), and zoom_region_class_init().

enum { ... } PropIdx

gchar* mag_prop_names[MAGNIFIER_CROSSWIRE_COLOR_PROP+1]

Initial value:

 {
    "SOURCE_DISPLAY",
    "TARGET_DISPLAY",
    "SOURCE_SIZE",
    "TARGET_SIZE",
    "CURSOR_SET",
    "CURSOR_SIZE",
    "CURSOR_ZOOM",
    "CURSOR_COLOR",
    "CURSOR_HOTSPOT",
    "CURSOR_DEFAULT_SIZE",
    "CROSSWIRE_SIZE",
    "CROSSWIRE_LENGTH",
    "CROSSWIRE_CLIP",
    "CROSSWIRE_COLOR"
}

Definition at line 103 of file magnifier.c.

Referenced by magnifier_get_property().

Magnifier* _this_magnifier = NULL [static]

Definition at line 121 of file magnifier.c.

gboolean _is_override_redirect = FALSE [static]

Definition at line 129 of file magnifier.c.

Referenced by magnifier_init_window(), and magnifier_new().


Generated on Sat Mar 14 02:12:20 2009 for gnome-mag by  doxygen 1.5.7.1