Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into debian

Conflicts:
	Makefile.am
	configure.ac
  • Loading branch information...
commit 7c84525fd7d2f0bb9aa9a59924848191a5ef2f1a 2 parents 148f439 + e825606
@pchilds authored
View
4 Makefile.am
@@ -1,8 +1,8 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS=gtk2plot debian
+SUBDIRS=gtk3plot debian
ACLOCAL_AMFLAGS=-I m4 ${ACLOCAL_FLAGS}
MAINTAINERCLEANFILES=Makefile.in configure
DISTCLEANFILES= =
pkgconfigdir=$(libdir)/pkgconfig
-pkgconfig_DATA=gtkplot-2.0.pc
+pkgconfig_DATA=gtkplot-3.0.pc
View
20 configure.ac
@@ -1,26 +1,26 @@
AC_PREREQ([2.65])
-AC_INIT([Gtk2Plot],[2.0.0],[pchilds@physics.org],[gtk2plot],[https://github.com/pchilds/GtkPlot])
+AC_INIT([Gtk3Plot],[3.0.0],[pchilds@physics.org],[gtk3plot],[https://github.com/pchilds/GtkPlot])
AC_CONFIG_HEADERS([config.h gtkplotconfig.h])
-AC_CONFIG_SRCDIR([gtk2plot/gtkplotlinear.h])
+AC_CONFIG_SRCDIR([gtk3plot/gtkplotlinear.h])
AC_CONFIG_AUX_DIR([confsupp])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC([gcc cc])
LT_PREREQ([2.2])
LT_INIT([win32-dll])
-AC_SUBST([PLOT_API_VERSION], [2.0])
-AC_SUBST([PLOT_GTK_MAJOR], [2])
-AC_SUBST([PLOT_GTK_MINOR], [18])
-AC_SUBST([PLOT_SDIR], [gtk2plot])
+AC_SUBST([PLOT_API_VERSION], [3.0])
+AC_SUBST([PLOT_GTK_MAJOR], [3])
+AC_SUBST([PLOT_GTK_MINOR], [2])
+AC_SUBST([PLOT_SDIR], [gtk3plot])
lt_enable_auto_import=
case "$host_os" in
mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
esac
AC_SUBST([lt_enable_auto_import])
-PKG_CHECK_MODULES([PLOT], [gtk+-2.0 >= 2.18])
-AC_CONFIG_FILES([Makefile gtk2plot/Makefile \
- gtkplot-2.0.pc:gtkplot.pc.in \
- COPYING:COPYING-2.0.in])
+PKG_CHECK_MODULES([PLOT], [gtk+-3.0 >= 3.2])
+AC_CONFIG_FILES([Makefile gtk3plot/Makefile \
+ gtkplot-3.0.pc:gtkplot.pc.in \
+ COPYING:COPYING-3.0.in])
AC_CONFIG_FILES([debian/Makefile])
AC_OUTPUT()
View
32 debian/control
@@ -1,53 +1,53 @@
Source: libgtkplot
Priority: optional
Maintainer: Paul Childs <pchilds@physics.org>
-Build-Depends: debhelper (>= 7.0.50), autotools-dev, dh-autoreconf, pkg-config, libgtk2.0-dev
+Build-Depends: debhelper (>= 7.0.50), autotools-dev, dh-autoreconf, pkg-config, libgtk-3-dev
Standards-Version: 3.8.3
Section: libs
Homepage: <https://github.com/pchilds/GtkPlot>
-Package: libgtkplot-2-dev
+Package: libgtkplot-3-dev
Section: libdevel
Architecture: any
-Depends: libgtkplot-2 (= ${binary:Version})
-Description: Provides headers for the libgtkplot-2 package
- libgtkplot-2 makes available to gtk+2 programs, a linear and polar
+Depends: libgtkplot-3 (= ${binary:Version})
+Description: Provides headers for the libgtkplot-3 package
+ libgtkplot-3 makes available to gtk+3 programs, a linear and polar
plotting widget. The widget features multiplot capability, zoom
control, smart range setting and mouse location tracking.
Processing is optimised towards speed for large data sets as
commonly occurs in scientific applications and outputs to a neat
publication ready format.
-Package: libgtkplot-2-doc
+Package: libgtkplot-3-doc
Section: doc
Architecture: any
-Depends: libgtkplot-2 (= ${binary:Version})
-Description: Provides examples for the libgtkplot-2 package
- libgtkplot-2 makes available to gtk+2 programs, a linear and polar
+Depends: libgtkplot-3 (= ${binary:Version})
+Description: Provides examples for the libgtkplot-3 package
+ libgtkplot-3 makes available to gtk+3 programs, a linear and polar
plotting widget. The widget features multiplot capability, zoom
control, smart range setting and mouse location tracking.
Processing is optimised towards speed for large data sets as
commonly occurs in scientific applications and outputs to a neat
publication ready format.
-Package: libgtkplot-2-dbg
+Package: libgtkplot-3-dbg
Section: debug
Architecture: any
-Depends: libgtkplot-2 (= ${binary:Version})
-Description: Provides debug symbols for the libgtkplot-2 package
- libgtkplot-2 makes available to gtk+2 programs, a linear and polar
+Depends: libgtkplot-3 (= ${binary:Version})
+Description: Provides debug symbols for the libgtkplot-3 package
+ libgtkplot-3 makes available to gtk+3 programs, a linear and polar
plotting widget. The widget features multiplot capability, zoom
control, smart range setting and mouse location tracking.
Processing is optimised towards speed for large data sets as
commonly occurs in scientific applications and outputs to a neat
publication ready format.
-Package: libgtkplot-2
+Package: libgtkplot-3
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Provides shared libraries for plotting with gtk+2
- libgtkplot-2 makes available to gtk+2 programs, a linear and polar
+Description: Provides shared libraries for plotting with gtk+3
+ libgtkplot-3 makes available to gtk+3 programs, a linear and polar
plotting widget. The widget features multiplot capability, zoom
control, smart range setting and mouse location tracking.
Processing is optimised towards speed for large data sets as
View
2  debian/rules
@@ -5,4 +5,4 @@ export DH_VERBOSE=1
dh $@ --with autoreconf
.PHONY: override_dh_strip
override_dh_strip:
- dh_strip --dbg-package=libgtkplot-2-dbg
+ dh_strip --dbg-package=libgtkplot-3-dbg
View
2  debian/shlibs.local
@@ -1 +1 @@
-libgtkplot 2.0 libgtkplot-2
+libgtkplot 3.0 libgtkplot-3
View
362 gtk3plot/a11y/gtkplotaccessible.c 100644 → 100755
@@ -24,20 +24,378 @@
#include <gtk/gtk.h>
#include "gtkplotaccessible.h"
-G_DEFINE_TYPE(GtkPlotAccessible, _gtk_plot_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
+#define TOOLTIP_KEY "tooltip"
+
+static gboolean gtk_plot_accessible_on_screen(GtkWidget *widget)
+{
+ gboolean return_value;
+ GtkAllocation allocation;
+ GtkWidget *viewport;
+
+ gtk_widget_get_allocation(widget, &allocation);
+ viewport=gtk_widget_get_ancestor(widget, GTK_TYPE_VIEWPORT);
+ if (viewport)
+ {
+ GtkAllocation viewport_allocation;
+ GtkAdjustment *adjustment;
+ GdkRectangle visible_rect;
+
+ gtk_widget_get_allocation(viewport, &viewport_allocation);
+ adjustment=gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(viewport));
+ visible_rect.y=gtk_adjustment_get_value(adjustment);
+ adjustment=gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(viewport));
+ {visible_rect.x=gtk_adjustment_get_value(adjustment); visible_rect.width=viewport_allocation.width; visible_rect.height=viewport_allocation.height;}
+ if (((allocation.x+allocation.width)<visible_rect.x)||((allocation.y+allocation.height)<visible_rect.y)||(allocation.x>(visible_rect.x+visible_rect.width))||(allocation.y>(visible_rect.y+visible_rect.height))) return_value = FALSE;
+ else return_value=TRUE;
+ }
+ else
+ {
+ if ((allocation.x+allocation.width)<=0&&(allocation.y+allocation.height)<=0) return_value=FALSE;
+ else return_value=TRUE;
+ }
+ return return_value;
+}
+
+static gboolean gtk_plot_accessible_all_parents_visible(GtkWidget *widget)
+{
+ gboolean result=TRUE;
+ GtkWidget *iter_parent=NULL;
+
+ for (iter_parent=gtk_widget_get_parent(widget); iter_parent; iter_parent=gtk_widget_get_parent(iter_parent))
+ {
+ if (!gtk_widget_get_visible(iter_parent))
+ {
+ result=FALSE;
+ break;
+ }
+ }
+ return result;
+}
+
+static void gtk_plot_accessible_get_extents(AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type)
+{
+ GdkWindow *window;
+ gint x_window, y_window;
+ gint x_toplevel, y_toplevel;
+ GtkWidget *widget;
+ GtkAllocation allocation;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(component));
+ if (widget==NULL) return;
+ gtk_widget_get_allocation(widget, &allocation);
+ {*width = allocation.width; *height=allocation.height;}
+ if (!gtk_plot_accessible_on_screen(widget)||(!gtk_widget_is_drawable(widget)))
+ {
+ {*x=G_MININT; *y=G_MININT;}
+ return;
+ }
+ if (gtk_widget_get_parent(widget)) {*x=allocation.x; *y =allocation.y; window=gtk_widget_get_parent_window(widget);}
+ else {*x=0; *y=0; window=gtk_widget_get_window(widget);}
+ gdk_window_get_origin(window, &x_window, &y_window);
+ {*x+=x_window; *y+=y_window;}
+ if (coord_type==ATK_XY_WINDOW)
+ {
+ window=gdk_window_get_toplevel(gtk_widget_get_window(widget));
+ gdk_window_get_origin(window, &x_toplevel, &y_toplevel);
+ {*x-=x_toplevel; *y-=y_toplevel;}
+ }
+}
+
+static AtkLayer gtk_plot_accessible_get_layer(AtkComponent *component) {return (GTK_PLOT_ACCESSIBLE(component))->layer;}
+
+static void gtk_plot_accessible_get_size(AtkComponent *component, gint *width, gint *height)
+{
+ GtkWidget *widget;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(component));
+ if (widget==NULL) return;
+ {*width=gtk_widget_get_allocated_width(widget); *height=gtk_widget_get_allocated_height(widget);}
+}
+
+static gboolean gtk_plot_accessible_grab_focus(AtkComponent *component)
+{
+ GtkWidget *widget;
+ GtkWidget *toplevel;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(component));
+ if (!widget||!gtk_widget_get_can_focus (widget)) return FALSE;
+ gtk_widget_grab_focus(widget);
+ toplevel=gtk_widget_get_toplevel(widget);
+ if (gtk_widget_is_toplevel(toplevel))
+ {
+ #ifdef GDK_WINDOWING_X11
+ gtk_window_present_with_time(GTK_WINDOW(toplevel),
+ gdk_x11_get_server_time(gtk_widget_get_window(widget)));
+ #else
+ gtk_window_present(GTK_WINDOW(toplevel));
+ #endif
+ }
+ return TRUE;
+}
+
+static void atk_component_interface_init(AtkComponentIface *iface)
+{
+ iface->get_extents=gtk_plot_accessible_get_extents;
+ iface->get_layer=gtk_plot_accessible_get_layer;
+ iface->get_size=gtk_plot_accessible_get_size;
+ iface->grab_focus=gtk_plot_accessible_grab_focus;
+}
+
+G_DEFINE_TYPE_WITH_CODE(GtkPlotAccessible, _gtk_plot_accessible, GTK_TYPE_ACCESSIBLE, G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT, atk_component_interface_init))
+
+static gboolean focus_cb(GtkWidget *widget, GdkEventFocus *event)
+{
+ AtkObject *obj;
+
+ obj=gtk_widget_get_accessible(widget);
+ g_signal_emit_by_name(obj, "focus-event", event->in);
+ return FALSE;
+}
+
+static void notify_cb(GObject *obj, GParamSpec *pspec)
+{
+ GtkPlotAccessibleClass *klass;
+
+ klass=GTK_PLOT_ACCESSIBLE_GET_CLASS(GTK_PLOT_ACCESSIBLE(gtk_widget_get_accessible(GTK_WIDGET(obj))));
+ if (klass->notify_gtk) klass->notify_gtk(obj, pspec);
+}
+
+static void size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation)
+{
+ AtkObject* accessible;
+ AtkRectangle rect;
+
+ accessible=gtk_widget_get_accessible(widget);
+ if (ATK_IS_COMPONENT(accessible))
+ {
+ {rect.x=allocation->x; rect.y=allocation->y; rect.width=allocation->width; rect.height=allocation->height;}
+ g_signal_emit_by_name (accessible, "bounds-changed", &rect);
+ }
+}
+
+static gint map_cb(GtkWidget *widget)
+{
+ AtkObject *accessible;
+
+ accessible=gtk_widget_get_accessible(widget);
+ atk_object_notify_state_change(accessible, ATK_STATE_SHOWING, gtk_widget_get_mapped(widget));
+ return 1;
+}
+
+static void gtk_plot_accessible_notify_gtk(GObject *obj, GParamSpec *pspec)
+{
+ GtkWidget* widget=GTK_WIDGET (obj);
+ AtkObject* atk_obj=gtk_widget_get_accessible(widget);
+ AtkState state;
+ gboolean value;
+
+ if (g_strcmp0(pspec->name, "has-focus")==0) return;
+ else if (g_strcmp0(pspec->name, "visible")==0) {state=ATK_STATE_VISIBLE; value=gtk_widget_get_visible(widget);}
+ else if (g_strcmp0(pspec->name, "sensitive")==0) {state=ATK_STATE_SENSITIVE; value=gtk_widget_get_sensitive (widget);}
+ else if (g_strcmp0(pspec->name, "tooltip-text")==0) g_object_set_data_full(G_OBJECT(GTK_PLOT_ACCESSIBLE(atk_obj)), TOOLTIP_KEY, gtk_widget_get_tooltip_text(widget), g_free);
+ return;
+ atk_object_notify_state_change(atk_obj, state, value);
+ if (state==ATK_STATE_SENSITIVE) atk_object_notify_state_change(atk_obj, ATK_STATE_ENABLED, value);
+ if (state==ATK_STATE_HORIZONTAL) atk_object_notify_state_change(atk_obj, ATK_STATE_VERTICAL, !value);
+}
+
+static const gchar* gtk_plot_accessible_get_description(AtkObject* accessible)
+{
+ GtkWidget *widget;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(accessible));
+ if (widget==NULL) return NULL;
+ if (accessible->description) return accessible->description;
+ return g_object_get_data(G_OBJECT(accessible), TOOLTIP_KEY);
+}
+
+static AtkObject* gtk_plot_accessible_get_parent(AtkObject *accessible)
+{
+ AtkObject *parent;
+ GtkWidget *widget, *parent_widget;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(accessible));
+ if (widget==NULL) return NULL;
+ parent=accessible->accessible_parent;
+ if (parent!=NULL) return parent;
+ parent_widget=gtk_widget_get_parent(widget);
+ if (parent_widget==NULL) return NULL;
+ if (GTK_IS_NOTEBOOK(parent_widget))
+ {
+ gint page_num=0;
+ GtkWidget *child;
+ GtkNotebook *notebook;
+
+ notebook=GTK_NOTEBOOK(parent_widget);
+ while (TRUE)
+ {
+ child=gtk_notebook_get_nth_page(notebook, page_num);
+ if (!child) break;
+ if (child==widget)
+ {
+ parent=gtk_widget_get_accessible(parent_widget);
+ parent=atk_object_ref_accessible_child(parent, page_num);
+ g_object_unref(parent);
+ return parent;
+ }
+ page_num++;
+ }
+ }
+ parent=gtk_widget_get_accessible(parent_widget);
+ return parent;
+}
+
+static AtkRelationSet* gtk_plot_accessible_ref_relation_set(AtkObject *obj)
+{
+ AtkObject *array[1];
+ AtkRelation* relation;
+ AtkRelationSet *relation_set;
+ GtkWidget *widget;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(obj));
+ if (widget==NULL) return NULL;
+ relation_set=ATK_OBJECT_CLASS(_gtk_plot_accessible_parent_class)->ref_relation_set(obj);
+ if (!atk_relation_set_contains(relation_set, ATK_RELATION_LABELLED_BY))
+ {
+ GList *labels, *ptr;
+
+ labels=gtk_widget_list_mnemonic_labels(widget);
+ ptr=labels;
+ while (ptr)
+ {
+ if (ptr->data)
+ {
+ array[0]=gtk_widget_get_accessible(ptr->data);
+ relation=atk_relation_new(array, 1, ATK_RELATION_LABELLED_BY);
+ atk_relation_set_add(relation_set, relation);
+ g_object_unref(relation);
+ break;
+ }
+ ptr=ptr->next;
+ }
+ g_list_free(labels);
+ }
+ return relation_set;
+}
+
+static AtkStateSet *gtk_plot_accessible_ref_state_set(AtkObject *accessible)
+{
+ GtkWidget *widget;
+ AtkStateSet *state_set;
+
+ state_set=ATK_OBJECT_CLASS(_gtk_plot_accessible_parent_class)->ref_state_set(accessible);
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(accessible));
+ if (widget == NULL) atk_state_set_add_state(state_set, ATK_STATE_DEFUNCT);
+ else
+ {
+ if (gtk_widget_is_sensitive(widget))
+ {
+ atk_state_set_add_state(state_set, ATK_STATE_SENSITIVE);
+ atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
+ }
+ if (gtk_widget_get_can_focus(widget)) atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE);
+ if (gtk_widget_get_visible(widget))
+ {
+ atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
+ if (gtk_plot_accessible_on_screen(widget)&&gtk_widget_get_mapped(widget)&&gtk_plot_accessible_all_parents_visible(widget)) atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
+ }
+ if (gtk_widget_has_focus(widget)&&!g_object_get_data(G_OBJECT(accessible), "gail-focus-object")) atk_state_set_add_state(state_set, ATK_STATE_FOCUSED);
+ if (gtk_widget_has_default(widget)) atk_state_set_add_state(state_set, ATK_STATE_DEFAULT);
+ }
+ return state_set;
+}
+
+static gint gtk_plot_accessible_get_index_in_parent(AtkObject *accessible)
+{
+ gint index;
+ GList *children;
+ GtkWidget *widget;
+ GtkWidget *parent_widget;
+
+ widget=gtk_accessible_get_widget(GTK_ACCESSIBLE(accessible));
+ if (widget==NULL) return -1;
+ if (accessible->accessible_parent)
+ {
+ AtkObject *parent;
+ gint n_children, i;
+ gboolean found=FALSE;
+
+ parent=accessible->accessible_parent;
+ n_children=atk_object_get_n_accessible_children(parent);
+ for (i=0;i<n_children;i++)
+ {
+ AtkObject *child;
+
+ child=atk_object_ref_accessible_child(parent, i);
+ if (child==accessible) found=TRUE;
+ g_object_unref(child);
+ if (found) return i;
+ }
+ }
+ if (!GTK_IS_WIDGET(widget)) return -1;
+ parent_widget=gtk_widget_get_parent(widget);
+ if (!GTK_IS_CONTAINER(parent_widget)) return -1;
+ children=gtk_container_get_children(GTK_CONTAINER(parent_widget));
+ index=g_list_index(children, widget);
+ g_list_free(children);
+ return index;
+}
+
+static AtkAttributeSet *gtk_plot_accessible_get_attributes(AtkObject *obj)
+{
+ AtkAttribute *toolkit;
+ AtkAttributeSet *attributes;
+
+ toolkit=g_new(AtkAttribute, 1);
+ toolkit->name=g_strdup("toolkit");
+ toolkit->value=g_strdup("gtk");
+ attributes=g_slist_append(NULL, toolkit);
+ return attributes;
+}
+
+static void gtk_plot_accessible_focus_event(AtkObject *obj, gboolean focus_in)
+{
+ AtkObject *focus_obj;
+
+ focus_obj=g_object_get_data(G_OBJECT (obj), "gail-focus-object");
+ if (focus_obj==NULL) focus_obj=obj;
+ atk_object_notify_state_change(focus_obj, ATK_STATE_FOCUSED, focus_in);
+}
static void gtk_plot_accessible_initialise(AtkObject *obj, gpointer data)
{
+ GtkWidget *widget;
+
(ATK_OBJECT_CLASS(_gtk_plot_accessible_parent_class))->initialize(obj, data);
+ widget=GTK_WIDGET(data);
+ g_signal_connect_after(widget, "focus-in-event", G_CALLBACK(focus_cb), NULL);
+ g_signal_connect_after(widget, "focus-out-event", G_CALLBACK(focus_cb), NULL);
+ g_signal_connect(widget, "notify", G_CALLBACK(notify_cb), NULL);
+ g_signal_connect(widget, "size-allocate", G_CALLBACK(size_allocate_cb), NULL);
+ g_signal_connect(widget, "map", G_CALLBACK(map_cb), NULL);
+ g_signal_connect(widget, "unmap", G_CALLBACK(map_cb), NULL);
+ GTK_PLOT_ACCESSIBLE(obj)->layer=ATK_LAYER_WIDGET;
obj->role=ATK_ROLE_CHART;
+ g_object_set_data_full(G_OBJECT(GTK_PLOT_ACCESSIBLE(obj)), TOOLTIP_KEY, gtk_widget_get_tooltip_text(widget), g_free);
}
static void gtk_plot_accessible_finalise(GObject *obj) {(G_OBJECT_CLASS(_gtk_plot_accessible_parent_class))->finalize(obj);}
static void _gtk_plot_accessible_class_init(GtkPlotAccessibleClass *klass)
{
+ AtkObjectClass* atk_klass;
+
+ klass->notify_gtk=gtk_plot_accessible_notify_gtk;
+ atk_klass=ATK_OBJECT_CLASS(klass);
+ atk_klass->get_description=gtk_plot_accessible_get_description;
+ atk_klass->get_parent=gtk_plot_accessible_get_parent;
+ atk_klass->ref_relation_set=gtk_plot_accessible_ref_relation_set;
+ atk_klass->ref_state_set=gtk_plot_accessible_ref_state_set;
+ atk_klass->get_index_in_parent=gtk_plot_accessible_get_index_in_parent;
+ atk_klass->get_attributes=gtk_plot_accessible_get_attributes;
+ atk_klass->focus_event=gtk_plot_accessible_focus_event;
+ atk_klass->initialize=gtk_plot_accessible_initialise;
(G_OBJECT_CLASS(klass))->finalize=gtk_plot_accessible_finalise;
- (ATK_OBJECT_CLASS(klass))->initialize=gtk_plot_accessible_initialise;
}
static void _gtk_plot_accessible_init(GtkPlotAccessible *plot) {}
View
6 gtk3plot/a11y/gtkplotaccessible.h 100644 → 100755
@@ -36,11 +36,13 @@
typedef struct _GtkPlotAccessibleClass GtkPlotAccessibleClass;
struct _GtkPlotAccessible
{
- GtkWidgetAccessible parent;
+ GtkAccessible parent;
+ AtkLayer layer;
};
struct _GtkPlotAccessibleClass
{
- GtkWidgetAccessibleClass parent_class;
+ GtkAccessibleClass parent_class;
+ void (*notify_gtk) (GObject *object, GParamSpec *pspec);
};
GType _gtk_plot_accessible_get_type(void);
G_END_DECLS
View
15 gtk3plot/a11y/gtkplotlinearaccessible.c 100644 → 100755
@@ -39,8 +39,8 @@ static gboolean gtk_plot_linear_accessible_do_action(AtkAction* action, gint i)
plot=gtk_accessible_get_widget(GTK_ACCESSIBLE(action));
plt=GTK_PLOT_LINEAR(plot);
if (plot==NULL||!gtk_widget_get_sensitive(plot)) return FALSE;
- g_object_get(G_OBJECT(plot), "xmin", &xi, "xmax", &xf, "ymin", &mny, "ymax", &mxy, NULL);
- switch i
+ g_object_get(G_OBJECT(plot), "xmin", &xi, "xmax", &xf, "ymin", &yi, "ymax", &yf, NULL);
+ switch (i)
{
case 5:
tp=-UZC*(plt->yps);
@@ -97,7 +97,7 @@ static gint gtk_plot_linear_accessible_get_n_actions(AtkAction* action)
static const gchar* gtk_plot_linear_accessible_action_get_name(AtkAction* action, gint i)
{
if (gtk_plot_linear_accessible_get_n_actions(action)==0) return NULL;
- switch i
+ switch (i)
{
case 5: return "grow";
case 4: return "shrink";
@@ -112,7 +112,7 @@ static const gchar* gtk_plot_linear_accessible_action_get_name(AtkAction* action
static const gchar* gtk_plot_linear_accessible_action_get_description(AtkAction* action, gint i)
{
if (gtk_plot_linear_accessible_get_n_actions(action)==0) return NULL;
- switch i
+ switch (i)
{
case 5: return "zoom out vertically";
case 4: return "zoom in vertically";
@@ -124,20 +124,17 @@ static const gchar* gtk_plot_linear_accessible_action_get_description(AtkAction*
}
}
-static const gchar* gtk_plot_linear_accessible_get_keybinding(AtkAction* action, gint i) {}
-
static void atk_action_interface_init(AtkActionIface* iface)
{
iface->do_action=gtk_plot_linear_accessible_do_action;
iface->get_n_actions=gtk_plot_linear_accessible_get_n_actions;
iface->get_name=gtk_plot_linear_accessible_action_get_name;
iface->get_name=gtk_plot_linear_accessible_action_get_description;
- iface->get_keybinding=gtk_plot_linear_accessible_get_keybinding;
}
static void gtk_plot_linear_accessible_get_image_position(AtkImage* img, gint* x, gint* y, AtkCoordType coord_type) {atk_component_get_position(ATK_COMPONENT(img), x, y, coord_type);}
-static const gchar* gtk_plot_linear_accessible_get_image_description(AtkImage* img) {return (GTK_IMAGE_ACCESSIBLE(img))->image_description;}
+static const gchar* gtk_plot_linear_accessible_get_image_description(AtkImage* img) {return (GTK_PLOT_LINEAR_ACCESSIBLE(img))->image_description;}
static gboolean gtk_plot_linear_accessible_set_image_description(AtkImage* img, const gchar* desc)
{
@@ -165,7 +162,7 @@ static void atk_image_interface_init(AtkImageIface* iface)
iface->get_image_size=gtk_plot_linear_accessible_get_image_size;
}
-G_DEFINE_TYPE_WITH_CODE(GtkPlotLinearAccessible, _gtk_plot_linear_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
+G_DEFINE_TYPE_WITH_CODE(GtkPlotLinearAccessible, _gtk_plot_linear_accessible, GTK_TYPE_PLOT_ACCESSIBLE,
G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION, atk_action_interface_init);
G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE, atk_image_interface_init))
View
0  gtk3plot/a11y/gtkplotlinearaccessible.h 100644 → 100755
File mode changed
View
21 gtk3plot/a11y/gtkplotpolaraccessible.c 100644 → 100755
@@ -40,7 +40,7 @@ static gboolean gtk_plot_polar_accessible_do_action(AtkAction* action, gint i)
plt=GTK_PLOT_POLAR(plot);
if (plot==NULL||!gtk_widget_get_sensitive(plot)) return FALSE;
g_object_get(G_OBJECT(plot), "thmin", &yi, "thmax", &yf, "rmin", &xi, "rmax", &xf, NULL);
- switch i
+ switch (i)
{
case 3:
tp=-UZC*(plt->thps);
@@ -81,12 +81,12 @@ static gint gtk_plot_polar_accessible_get_n_actions(AtkAction* action)
static const gchar* gtk_plot_polar_accessible_action_get_name(AtkAction* action, gint i)
{
if (gtk_plot_polar_accessible_get_n_actions(action)==0) return NULL;
- switch i
+ switch (i)
{
- case 5: return "out";
- case 4: return "in";
case 3: return "open";
case 2: return "close";
+ case 1: return "out";
+ case 0: return "in";
default: return NULL;
}
}
@@ -94,30 +94,27 @@ static const gchar* gtk_plot_polar_accessible_action_get_name(AtkAction* action,
static const gchar* gtk_plot_polar_accessible_action_get_description(AtkAction* action, gint i)
{
if (gtk_plot_polar_accessible_get_n_actions(action)==0) return NULL;
- switch i
+ switch (i)
{
- case 5: return "zoom out radially";
- case 4: return "zoom in radially";
case 3: return "zoom out azimuthally";
case 2: return "zoom in azimuthally";
+ case 1: return "zoom out radially";
+ case 0: return "zoom in radially";
default: return NULL;
}
}
-static const gchar* gtk_plot_polar_accessible_get_keybinding(AtkAction* action, gint i) {}
-
static void atk_action_interface_init(AtkActionIface* iface)
{
iface->do_action=gtk_plot_polar_accessible_do_action;
iface->get_n_actions=gtk_plot_polar_accessible_get_n_actions;
iface->get_name=gtk_plot_polar_accessible_action_get_name;
iface->get_name=gtk_plot_polar_accessible_action_get_description;
- iface->get_keybinding=gtk_plot_polar_accessible_get_keybinding;
}
static void gtk_plot_polar_accessible_get_image_position(AtkImage* img, gint* x, gint* y, AtkCoordType coord_type) {atk_component_get_position(ATK_COMPONENT(img), x, y, coord_type);}
-static const gchar* gtk_plot_polar_accessible_get_image_description(AtkImage* img) {return (GTK_IMAGE_ACCESSIBLE(img))->image_description;}
+static const gchar* gtk_plot_polar_accessible_get_image_description(AtkImage* img) {return (GTK_PLOT_POLAR_ACCESSIBLE(img))->image_description;}
static gboolean gtk_plot_polar_accessible_set_image_description(AtkImage* img, const gchar* desc)
{
@@ -145,7 +142,7 @@ static void atk_image_interface_init(AtkImageIface* iface)
iface->get_image_size=gtk_plot_polar_accessible_get_image_size;
}
-G_DEFINE_TYPE_WITH_CODE(GtkPlotPolarAccessible, _gtk_plot_polar_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
+G_DEFINE_TYPE_WITH_CODE(GtkPlotPolarAccessible, _gtk_plot_polar_accessible, GTK_TYPE_PLOT_ACCESSIBLE,
G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION, atk_action_interface_init);
G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE, atk_image_interface_init))
View
0  gtk3plot/a11y/gtkplotpolaraccessible.h 100644 → 100755
File mode changed
View
2  gtk3plot/gtkplot.c
@@ -70,7 +70,7 @@ static void gtk_plot_class_init(GtkPlotClass *klass)
obj_klass=G_OBJECT_CLASS(klass);
(obj_klass->finalize)=(GObjectFinalizeFunc) gtk_plot_finalise;
- gtk_widget_class_set_accessible(GTK_WIDGET_CLASS(klass), GTK_TYPE_PLOT_ACCESSIBLE);
+ gtk_widget_class_set_accessible_type(GTK_WIDGET_CLASS(klass), GTK_TYPE_PLOT_ACCESSIBLE);
}
static void gtk_plot_init(GtkPlot *plot)
View
2  gtk3plot/gtkplotlinear.c
@@ -4320,7 +4320,7 @@ static void gtk_plot_linear_class_init(GtkPlotLinearClass *klass)
(widget_klass->motion_notify_event)=gtk_plot_linear_motion_notify;
(widget_klass->button_release_event)=gtk_plot_linear_button_release;
(widget_klass->draw)=gtk_plot_linear_draw;
- gtk_widget_class_set_accessible(widget_klass, GTK_TYPE_PLOT_LINEAR_ACCESSIBLE);
+ gtk_widget_class_set_accessible_type(widget_klass, GTK_TYPE_PLOT_LINEAR_ACCESSIBLE);
gtk_plot_linear_signals[MOVED]=g_signal_new("moved", G_OBJECT_CLASS_TYPE(obj_klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GtkPlotLinearClass, moved), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}
View
2  gtk3plot/gtkplotpolar.c
@@ -5723,7 +5723,7 @@ static void gtk_plot_polar_class_init(GtkPlotPolarClass *klass)
(widget_klass->motion_notify_event)=gtk_plot_polar_motion_notify;
(widget_klass->button_release_event)=gtk_plot_polar_button_release;
(widget_klass->draw)=gtk_plot_polar_draw;
- gtk_widget_class_set_accessible(widget_klass, GTK_TYPE_PLOT_POLAR_ACCESSIBLE);
+ gtk_widget_class_set_accessible_type(widget_klass, GTK_TYPE_PLOT_POLAR_ACCESSIBLE);
gtk_plot_polar_signals[MOVED]=g_signal_new("moved", G_OBJECT_CLASS_TYPE(obj_klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GtkPlotPolarClass, moved), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}
View
22 reversion.sh
@@ -13,7 +13,7 @@ lrv=$5
if [ $1 -eq 3 ]
then
gmx=3
- gmn=0
+ gmn=2
gdp="-3"
{
echo "AM_CFLAGS=\$(PLOT_CFLAGS) -g"
@@ -26,7 +26,10 @@ then
echo "libgtkplot_@PLOT_API_VERSION@_la_SOURCES= \\"
echo " gtkplot.c \\"
echo " gtkplotlinear.c \\"
- echo " gtkplotpolar.c"
+ echo " gtkplotpolar.c \\"
+ echo " a11y/gtkplotaccessible.c \\"
+ echo " a11y/gtkplotlinearaccessible.c \\"
+ echo " a11y/gtkplotpolaraccessible.c"
echo "libgtkplot_@PLOT_API_VERSION@_la_LDFLAGS= \\"
echo " @lt_enable_auto_import@ \\"
echo " -no-undefined \\"
@@ -36,7 +39,10 @@ then
echo "gtkplotinclude_HEADERS= \\"
echo " gtkplot.h \\"
echo " gtkplotlinear.h \\"
- echo " gtkplotpolar.h"
+ echo " gtkplotpolar.h \\"
+ echo " a11y/gtkplotaccessible.h \\"
+ echo " a11y/gtkplotlinearaccessible.h \\"
+ echo " a11y/gtkplotpolaraccessible.h"
echo ""
echo "bin_PROGRAMS=TestPlotLinear TestPlotPolar"
echo "TestPlotLinear_SOURCES=testplotlinear.c"
@@ -59,10 +65,7 @@ else
echo "libgtkplot_@PLOT_API_VERSION@_la_SOURCES= \\"
echo " gtkplot.c \\"
echo " gtkplotlinear.c \\"
- echo " gtkplotpolar.c \\"
- echo " a11y/gtkplotaccessible.c \\"
- echo " a11y/gtkplotlinearaccessible.c \\"
- echo " a11y/gtkplotpolaraccessible.c"
+ echo " gtkplotpolar.c"
echo "libgtkplot_@PLOT_API_VERSION@_la_LDFLAGS= \\"
echo " @lt_enable_auto_import@ \\"
echo " -no-undefined \\"
@@ -72,10 +75,7 @@ else
echo "gtkplotinclude_HEADERS= \\"
echo " gtkplot.h \\"
echo " gtkplotlinear.h \\"
- echo " gtkplotpolar.h \\"
- echo " a11y/gtkplotaccessible.h \\"
- echo " a11y/gtkplotlinearaccessible.h \\"
- echo " a11y/gtkplotpolaraccessible.h"
+ echo " gtkplotpolar.h"
echo ""
echo "bin_PROGRAMS=TestPlotLinear TestPlotPolar"
echo "TestPlotLinear_SOURCES=testplotlinear.c"
Please sign in to comment.
Something went wrong with that request. Please try again.