Commit 0568e021 authored by Jiří Techet's avatar Jiří Techet

Back to tidy

Using Mx instead of tidy added too much extra stuff we don't need
at all. It will be easier to continue using tidy and backport the
fixes from Mx.
parent f5fd5915
......@@ -84,12 +84,12 @@ libtool
ltmain.sh
missing
stamp-h1
mx/mx-enum-types.c
mx/mx-enum-types.h
mx/stamp-enum-types
mx/mx-marshal.c
mx/mx-marshal.h
mx/stamp-marshal
tidy/tidy-enum-types.c
tidy/tidy-enum-types.h
tidy/stamp-enum-types
tidy/tidy-marshal.c
tidy/tidy-marshal.h
tidy/stamp-marshal
bindings/python/update-binding.sh
bindings/python/champlain-gtk/pychamplaingtk.c
bindings/python/champlain/pychamplain.c
......
SUBDIRS = build mx champlain
SUBDIRS = build tidy champlain
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
......
......@@ -125,7 +125,7 @@ nodist_libchamplain_@CHAMPLAIN_API_VERSION@_la_SOURCES = \
$(libchamplain_headers_built) \
$(libchamplain_sources_built)
libchamplain_@CHAMPLAIN_API_VERSION@_la_LIBADD = $(DEPS_LIBS) $(SOUP_LIBS) $(MEMPHIS_LIBS) $(top_builddir)/mx/libchamplainmx-1.0.la
libchamplain_@CHAMPLAIN_API_VERSION@_la_LIBADD = $(DEPS_LIBS) $(SOUP_LIBS) $(MEMPHIS_LIBS) $(top_builddir)/tidy/libtidy-1.0.la
libchamplain_@CHAMPLAIN_API_VERSION@_la_LDFLAGS = \
-version-info $(LIBRARY_VERSION)\
......@@ -137,7 +137,7 @@ AM_CPPFLAGS = \
$(SOUP_CFLAGS) \
$(MEMPHIS_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-I$(top_srcdir)/mx \
-I$(top_srcdir)/tidy \
-I$(top_srcdir) \
-DCHAMPLAIN_COMPILATION \
$(WARN_CFLAGS)
......@@ -174,7 +174,7 @@ Champlain_@CHAMPLAIN_API_VERSION_NORM@_gir_FILES = $(introspection_sources)
Champlain_@CHAMPLAIN_API_VERSION_NORM@_gir_INCLUDES = Clutter-1.0 Gtk-3.0 $(memphis_gir_include)
Champlain_@CHAMPLAIN_API_VERSION_NORM@_gir_CFLAGS = \
$(DEPS_CFLAGS) $(SOUP_CFLAGS) $(MEMPHIS_CFLAGS) \
-I$(top_srcdir)/mx -I$(top_srcdir) -I$(top_builddir) \
-I$(top_srcdir)/tidy -I$(top_srcdir) -I$(top_builddir) \
-DCHAMPLAIN_COMPILATION
INTROSPECTION_GIRS += Champlain-@CHAMPLAIN_API_VERSION@.gir
......
......@@ -67,10 +67,10 @@
#include <glib.h>
#include <glib-object.h>
#include <math.h>
#include <mx-kinetic-scroll-view.h>
#include <mx-viewport.h>
#include <mx-adjustment.h>
#include <mx-scrollable.h>
#include <tidy-finger-scroll.h>
#include <tidy-viewport.h>
#include <tidy-adjustment.h>
#include <tidy-scrollable.h>
//#define VIEW_LOG
#ifdef VIEW_LOG
......@@ -265,7 +265,7 @@ update_viewport (ChamplainView *view,
if (relocate || force_relocate)
{
g_signal_handlers_block_by_func (priv->viewport, G_CALLBACK (viewport_pos_changed_cb), view);
mx_viewport_set_origin (MX_VIEWPORT (priv->viewport),
tidy_viewport_set_origin (TIDY_VIEWPORT (priv->viewport),
priv->viewport_x,
priv->viewport_y,
0);
......@@ -285,7 +285,7 @@ update_viewport (ChamplainView *view,
static void
panning_completed (G_GNUC_UNUSED MxKineticScrollView *scroll,
panning_completed (G_GNUC_UNUSED TidyFingerScroll *scroll,
ChamplainView *view)
{
DEBUG_LOG ()
......@@ -294,7 +294,7 @@ panning_completed (G_GNUC_UNUSED MxKineticScrollView *scroll,
gfloat absolute_x, absolute_y;
gfloat x, y;
mx_viewport_get_origin (MX_VIEWPORT (priv->viewport), &x, &y, NULL);
tidy_viewport_get_origin (TIDY_VIEWPORT (priv->viewport), &x, &y, NULL);
absolute_x = x + priv->anchor_x + priv->viewport_width / 2.0;
absolute_y = y + priv->anchor_y + priv->viewport_height / 2.0;
......@@ -332,11 +332,11 @@ resize_viewport (ChamplainView *view)
gdouble lower_y = 0;
gdouble upper_x = G_MAXINT16;
gdouble upper_y = G_MAXINT16;
MxAdjustment *hadjust, *vadjust;
TidyAdjustment *hadjust, *vadjust;
ChamplainViewPrivate *priv = view->priv;
mx_scrollable_get_adjustments (MX_SCROLLABLE (priv->viewport), &hadjust,
tidy_scrollable_get_adjustments (TIDY_SCROLLABLE (priv->viewport), &hadjust,
&vadjust);
if (priv->zoom_level < 8)
......@@ -353,7 +353,7 @@ resize_viewport (ChamplainView *view)
/*
* block emmision of signal by priv->viewport with viewport_pos_changed_cb()
* callback - the signal can be emitted by updating MxAdjustment, but
* callback - the signal can be emitted by updating TidyAdjustment, but
* calling the callback now would be a disaster since we don't have updated
* anchor yet
*/
......@@ -527,7 +527,7 @@ champlain_view_dispose (GObject *object)
if (priv->kinetic_scroll != NULL)
{
mx_kinetic_scroll_view_stop (MX_KINETIC_SCROLL_VIEW (priv->kinetic_scroll));
tidy_finger_scroll_stop (TIDY_FINGER_SCROLL (priv->kinetic_scroll));
g_object_unref (priv->kinetic_scroll);
priv->kinetic_scroll = NULL;
}
......@@ -1019,8 +1019,8 @@ champlain_view_init (ChamplainView *view)
clutter_actor_show (priv->viewport_container);
/* Setup viewport */
priv->viewport = g_object_ref (mx_viewport_new ());
mx_bin_set_child (MX_BIN (priv->viewport), priv->viewport_container);
priv->viewport = g_object_ref (tidy_viewport_new ());
clutter_container_add_actor (CLUTTER_CONTAINER (priv->viewport), priv->viewport_container);
g_object_set (G_OBJECT (priv->viewport), "sync-adjustments", FALSE, NULL);
......@@ -1032,7 +1032,7 @@ champlain_view_init (ChamplainView *view)
clutter_actor_raise (priv->user_layers, priv->map_layer);
/* Setup kinetic scroll */
priv->kinetic_scroll = g_object_ref (mx_kinetic_scroll_view_new ());
priv->kinetic_scroll = g_object_ref (tidy_finger_scroll_new (FALSE));
g_signal_connect (priv->kinetic_scroll, "scroll-event",
G_CALLBACK (scroll_event), view);
......@@ -1085,7 +1085,7 @@ viewport_pos_changed_cb (G_GNUC_UNUSED GObject *gobject,
ChamplainViewPrivate *priv = view->priv;
gfloat x, y;
mx_viewport_get_origin (MX_VIEWPORT (priv->viewport), &x, &y, NULL);
tidy_viewport_get_origin (TIDY_VIEWPORT (priv->viewport), &x, &y, NULL);
if (fabs (x - priv->viewport_x) > 100 ||
fabs (y - priv->viewport_y) > 100 ||
......@@ -2196,7 +2196,7 @@ champlain_view_set_kinetic_mode (ChamplainView *view,
ChamplainViewPrivate *priv = view->priv;
priv->kinetic_mode = kinetic;
mx_kinetic_scroll_view_set_kinetic_mode (MX_KINETIC_SCROLL_VIEW (priv->kinetic_scroll), kinetic);
g_object_set (view->priv->kinetic_scroll, "mode", kinetic, NULL);
}
......
......@@ -214,7 +214,7 @@ AC_CONFIG_FILES([build/Makefile
champlain/Makefile
champlain/champlain-version.h
demos/Makefile
mx/Makefile
tidy/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
......
BUILT_SOURCES =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
mx_headers_public = \
$(srcdir)/mx-viewport.h \
$(srcdir)/mx-kinetic-scroll-view.h \
$(srcdir)/mx-types.h \
$(srcdir)/mx-adjustment.h \
$(srcdir)/mx-bin.h \
$(srcdir)/mx-scrollable.h \
$(srcdir)/mx-private.h
mx_sources = \
$(srcdir)/mx-viewport.c \
$(srcdir)/mx-kinetic-scroll-view.c \
$(srcdir)/mx-adjustment.c \
$(srcdir)/mx-bin.c \
$(srcdir)/mx-scrollable.c
# glib-genmarshal rules
glib_marshal_list = mx-marshal.list
glib_marshal_prefix = _mx_marshal
include $(top_srcdir)/build/Makefile.am.marshal
# glib-mkenums rules
glib_enum_h = mx-enum-types.h
glib_enum_c = mx-enum-types.c
glib_enum_headers = $(mx_headers_public)
include $(top_srcdir)/build/Makefile.am.enums
mx_headers_built = \
mx-enum-types.h \
mx-marshal.h
mx_sources_built = \
mx-enum-types.c \
mx-marshal.c
libchamplainmx_1_0_la_SOURCES = \
$(mx_headers_public) \
$(mx_sources)
nodist_libchamplainmx_1_0_la_SOURCES = \
$(mx_headers_built) \
$(mx_sources_built)
libchamplainmx_1_0_la_LIBADD = $(DEPS_LIBS)
AM_CPPFLAGS = \
-I$(top_srcdir) \
-DPREFIX=\""$(prefix)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DG_DISABLE_DEPRECATED \
-DG_LOG_DOMAIN=\"Mx\" \
$(DEPS_CFLAGS) \
$(MX_DEBUG_CFLAGS) \
$(WARN_CFLAGS)
noinst_LTLIBRARIES = libchamplainmx-1.0.la
This diff is collapsed.
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* mx-adjustment.h: Adjustment object
*
* Copyright 2008 OpenedHand
* Copyright 2009, 2010 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU Lesser General Public License,
* version 2.1, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* Written by: Chris Lord <chris@openedhand.com>, inspired by GtkAdjustment
* Port to Mx by: Robert Staudinger <robsta@openedhand.com>
*
*/
#ifndef __MX_ADJUSTMENT_H__
#define __MX_ADJUSTMENT_H__
#include <glib-object.h>
#include <clutter/clutter.h>
G_BEGIN_DECLS
#define MX_TYPE_ADJUSTMENT (mx_adjustment_get_type())
#define MX_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MX_TYPE_ADJUSTMENT, MxAdjustment))
#define MX_IS_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MX_TYPE_ADJUSTMENT))
#define MX_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MX_TYPE_ADJUSTMENT, MxAdjustmentClass))
#define MX_IS_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MX_TYPE_ADJUSTMENT))
#define MX_ADJUSTMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MX_TYPE_ADJUSTMENT, MxAdjustmentClass))
typedef struct _MxAdjustment MxAdjustment;
typedef struct _MxAdjustmentPrivate MxAdjustmentPrivate;
typedef struct _MxAdjustmentClass MxAdjustmentClass;
/**
* MxAdjustment:
*
* Class for handling an interval between to values. The contents of
* the #MxAdjustment are private and should be accessed using the
* public API.
*/
struct _MxAdjustment
{
/*< private >*/
GObject parent_instance;
MxAdjustmentPrivate *priv;
};
/**
* MxAdjustmentClass
* @changed: Class handler for the ::changed signal.
*
* Base class for #MxAdjustment.
*/
struct _MxAdjustmentClass
{
/*< private >*/
GObjectClass parent_class;
/*< public >*/
void (* changed) (MxAdjustment *adjustment);
/* padding for future expansion */
void (*_padding_0) (void);
void (*_padding_1) (void);
void (*_padding_2) (void);
void (*_padding_3) (void);
void (*_padding_4) (void);
};
GType mx_adjustment_get_type (void) G_GNUC_CONST;
MxAdjustment *mx_adjustment_new (void);
MxAdjustment *mx_adjustment_new_with_values (gdouble value,
gdouble lower,
gdouble upper,
gdouble step_increment,
gdouble page_increment,
gdouble page_size);
gdouble mx_adjustment_get_value (MxAdjustment *adjustment);
void mx_adjustment_set_value (MxAdjustment *adjustment,
gdouble value);
gdouble mx_adjustment_get_lower (MxAdjustment *adjustment);
void mx_adjustment_set_lower (MxAdjustment *adjustment,
gdouble lower);
gdouble mx_adjustment_get_upper (MxAdjustment *adjustment);
void mx_adjustment_set_upper (MxAdjustment *adjustment,
gdouble upper);
gdouble mx_adjustment_get_step_increment (MxAdjustment *adjustment);
void mx_adjustment_set_step_increment (MxAdjustment *adjustment,
gdouble increment);
gdouble mx_adjustment_get_page_increment (MxAdjustment *adjustment);
void mx_adjustment_set_page_increment (MxAdjustment *adjustment,
gdouble increment);
gdouble mx_adjustment_get_page_size (MxAdjustment *adjustment);
void mx_adjustment_set_page_size (MxAdjustment *adjustment,
gdouble page_size);
void mx_adjustment_set_values (MxAdjustment *adjustment,
gdouble value,
gdouble lower,
gdouble upper,
gdouble step_increment,
gdouble page_increment,
gdouble page_size);
void mx_adjustment_get_values (MxAdjustment *adjustment,
gdouble *value,
gdouble *lower,
gdouble *upper,
gdouble *step_increment,
gdouble *page_increment,
gdouble *page_size);
void mx_adjustment_interpolate (MxAdjustment *adjustment,
gdouble value,
guint duration,
gulong mode);
void mx_adjustment_interpolate_relative (MxAdjustment *adjustment,
gdouble offset,
guint duration,
gulong mode);
gboolean mx_adjustment_get_elastic (MxAdjustment *adjustment);
void mx_adjustment_set_elastic (MxAdjustment *adjustment,
gboolean elastic);
gboolean mx_adjustment_get_clamp_value (MxAdjustment *adjustment);
void mx_adjustment_set_clamp_value (MxAdjustment *adjustment,
gboolean clamp);
G_END_DECLS
#endif /* __MX_ADJUSTMENT_H__ */
This diff is collapsed.
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* mx-bin.h: Basic container actor
*
* Copyright 2009, 2008 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU Lesser General Public License,
* version 2.1, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
* Boston, MA 02111-1307, USA.
*
* Written by: Emmanuele Bassi <ebassi@linux.intel.com>
*
*/
#ifndef __MX_BIN_H__
#define __MX_BIN_H__
#include "mx-types.h"
#include <clutter/clutter.h>
G_BEGIN_DECLS
#define MX_TYPE_BIN (mx_bin_get_type ())
#define MX_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MX_TYPE_BIN, MxBin))
#define MX_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MX_TYPE_BIN))
#define MX_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MX_TYPE_BIN, MxBinClass))
#define MX_IS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MX_TYPE_BIN))
#define MX_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MX_TYPE_BIN, MxBinClass))
typedef struct _MxBin MxBin;
typedef struct _MxBinPrivate MxBinPrivate;
typedef struct _MxBinClass MxBinClass;
/**
* MxBin:
*
* The #MxBin struct contains only private data
*/
struct _MxBin
{
/*< private >*/
ClutterGroup parent_instance;
MxBinPrivate *priv;
};
/**
* MxBinClass:
*
* The #MxBinClass struct contains only private data
*/
struct _MxBinClass
{
/*< private >*/
ClutterGroupClass parent_class;
/* padding for future expansion */
void (*_padding_0) (void);
void (*_padding_1) (void);
void (*_padding_2) (void);
void (*_padding_3) (void);
void (*_padding_4) (void);
};
GType mx_bin_get_type (void) G_GNUC_CONST;
void mx_bin_allocate_child (MxBin *bin,
const ClutterActorBox *box,
ClutterAllocationFlags flags);
void mx_bin_set_child (MxBin *bin,
ClutterActor *child);
ClutterActor *mx_bin_get_child (MxBin *bin);
void mx_bin_set_alignment (MxBin *bin,
MxAlign x_align,
MxAlign y_align);
void mx_bin_get_alignment (MxBin *bin,
MxAlign *x_align,
MxAlign *y_align);
void mx_bin_set_fill (MxBin *bin,
gboolean x_fill,
gboolean y_fill);
void mx_bin_get_fill (MxBin *bin,
gboolean *x_fill,
gboolean *y_fill);
G_END_DECLS
#endif /* __MX_BIN_H__ */
This diff is collapsed.
/* mx-kinetic-scroll-view.h: Kinetic scrolling container actor
*
* Copyright (C) 2008 OpenedHand
* Copyright (C) 2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
* Boston, MA 02111-1307, USA.
*
* Written by: Chris Lord <chris@linux.intel.com>
*/
#ifndef __MX_KINETIC_SCROLL_VIEW_H__
#define __MX_KINETIC_SCROLL_VIEW_H__
#include <glib-object.h>
#include "mx-bin.h"
G_BEGIN_DECLS
#define MX_TYPE_KINETIC_SCROLL_VIEW (mx_kinetic_scroll_view_get_type())
#define MX_KINETIC_SCROLL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MX_TYPE_KINETIC_SCROLL_VIEW, MxKineticScrollView))
#define MX_IS_KINETIC_SCROLL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MX_TYPE_KINETIC_SCROLL_VIEW))
#define MX_KINETIC_SCROLL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MX_TYPE_KINETIC_SCROLL_VIEW, MxKineticScrollViewClass))
#define MX_IS_KINETIC_SCROLL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MX_TYPE_KINETIC_SCROLL_VIEW))
#define MX_KINETIC_SCROLL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MX_TYPE_KINETIC_SCROLL_VIEW, MxKineticScrollViewClass))
/**
* MxKineticScrollView:
*
* The contents of this structure is private and should only be accessed using
* the provided API.
*/
typedef struct _MxKineticScrollView MxKineticScrollView;
typedef struct _MxKineticScrollViewPrivate MxKineticScrollViewPrivate;
typedef struct _MxKineticScrollViewClass MxKineticScrollViewClass;
struct _MxKineticScrollView
{
/*< private >*/
MxBin parent_instance;
MxKineticScrollViewPrivate *priv;
};
struct _MxKineticScrollViewClass
{
MxBinClass parent_class;
};
GType mx_kinetic_scroll_view_get_type (void) G_GNUC_CONST;
ClutterActor *mx_kinetic_scroll_view_new (void);
void mx_kinetic_scroll_view_stop (MxKineticScrollView *scroll);
void mx_kinetic_scroll_view_set_deceleration (MxKineticScrollView *scroll,
gdouble rate);
gdouble mx_kinetic_scroll_view_get_deceleration (MxKineticScrollView *scroll);
/*
void mx_kinetic_scroll_view_set_buffer_size (MxKineticScrollView *scroll,
guint size);
guint mx_kinetic_scroll_view_get_buffer_size (MxKineticScrollView *scroll);
*/
void mx_kinetic_scroll_view_set_use_captured (MxKineticScrollView *scroll,
gboolean use_captured);
gboolean mx_kinetic_scroll_view_get_use_captured (MxKineticScrollView *scroll);
void mx_kinetic_scroll_view_set_mouse_button (MxKineticScrollView *scroll,
guint32 button);
guint32 mx_kinetic_scroll_view_get_mouse_button (MxKineticScrollView *scroll);
void mx_kinetic_scroll_view_set_overshoot (MxKineticScrollView *scroll,
gdouble overshoot);
gdouble mx_kinetic_scroll_view_get_overshoot (MxKineticScrollView *scroll);
void mx_kinetic_scroll_view_set_kinetic_mode (MxKineticScrollView *scroll,
gboolean kinetic);
gboolean mx_kinetic_scroll_view_get_kinetic_mode (MxKineticScrollView *scroll);
G_END_DECLS
#endif /* __MX_KINETIC_SCROLL_VIEW_H__ */
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* mx-scrollable.c: Scrollable interface
*
* Copyright 2008 OpenedHand
* Copyright 2009 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU Lesser General Public License,
* version 2.1, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* Written by: Chris Lord <chris@openedhand.com>
* Port to Mx by: Robert Staudinger <robsta@openedhand.com>
*
*/
#include "mx-scrollable.h"
#include "mx-private.h"
static void
mx_scrollable_base_init (gpointer g_iface)
{
static gboolean initialized = FALSE;
if (!initialized)
{
GParamSpec *pspec;
pspec = g_param_spec_object ("horizontal-adjustment",
"Horizontal adjustment",
"The MxAdjustment for horizontal scrolling.",
MX_TYPE_ADJUSTMENT,
MX_PARAM_READWRITE);
g_object_interface_install_property (g_iface, pspec);
pspec = g_param_spec_object ("vertical-adjustment",
"Vertical adjustment",
"The MxAdjustment for vertical scrolling.",
MX_TYPE_ADJUSTMENT,
MX_PARAM_READWRITE);
g_object_interface_install_property (g_iface, pspec);
initialized = TRUE;
}
}
GType
mx_scrollable_get_type (void)
{
static GType type = 0;
if (type == 0)
{
static const GTypeInfo info =
{
sizeof (MxScrollableIface),
mx_scrollable_base_init, /* base_init */
NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE,
"MxScrollable", &info, 0);
}
return type;
}
void
mx_scrollable_set_adjustments (MxScrollable *scrollable,
MxAdjustment *hadjustment,
MxAdjustment *vadjustment)
{
MX_SCROLLABLE_GET_IFACE (scrollable)->set_adjustments (scrollable,
hadjustment,
vadjustment);
}
/**
* mx_scroll_bar_get_adjustments:
* @hadjustment: (transfer none) (out) (allow-none): location to store the horizontal adjustment, or %NULL
* @vadjustment: (transfer none) (out) (allow-none): location to store the vertical adjustment, or %NULL
*
* Gets the adjustment objects that store the offsets of the scrollable widget
* into its possible scrolling area.
*/
void
mx_scrollable_get_adjustments (MxScrollable *scrollable,
MxAdjustment **hadjustment,
MxAdjustment **vadjustment)
{
MX_SCROLLABLE_GET_IFACE (scrollable)->get_adjustments (scrollable,
hadjustment,
vadjustment);
}
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* mx-scrollable.h: Scrollable interface
*
* Copyright 2008 OpenedHand
* Copyright 2009 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU Lesser General Public License,
* version 2.1, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
* Boston, MA 02111-1307, USA.
*
* Written by: Chris Lord <chris@openedhand.com>
* Port to Mx by: Robert Staudinger <robsta@openedhand.com>
*
*/
#ifndef __MX_SCROLLABLE_H__
#define __MX_SCROLLABLE_H__
#include <glib-object.h>
#include "mx-adjustment.h"
G_BEGIN_DECLS
#define MX_TYPE_SCROLLABLE (mx_scrollable_get_type ())
#define MX_SCROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MX_TYPE_SCROLLABLE, MxScrollable))
#define MX_IS_SCROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MX_TYPE_SCROLLABLE))
#define MX_SCROLLABLE_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MX_TYPE_SCROLLABLE, MxScrollableIface))
/**
* MxScrollable:
*
* This is an opaque structure whose members cannot be directly accessed.
*/
typedef struct _MxScrollable MxScrollable; /* Dummy object */
typedef struct _MxScrollableIface MxScrollableIface;
struct _MxScrollableIface
{
GTypeInterface parent;
void (* set_adjustments) (MxScrollable *scrollable,
MxAdjustment *hadjustment,
MxAdjustment *vadjustment);
void (* get_adjustments) (MxScrollable *scrollable,
MxAdjustment **hadjustment,
MxAdjustment **vadjustment);
};
GType mx_scrollable_get_type (void) G_GNUC_CONST;
void mx_scrollable_set_adjustments (MxScrollable *scrollable,
MxAdjustment *hadjustment,