Getting colder with our second freeze... it's 3.31.91 release day and string freeze, upload a tarball and lock those strings 🏂

Commit 42df9eda authored by Matthias Clasen's avatar Matthias Clasen Committed by Carlos Garnacho

Prevent subclassing of gestures

For now, at least. We do this by hiding the instance and
class structures in private headers.
parent 93b78833
......@@ -503,6 +503,7 @@ gtk_private_h_sources = \
gtkcustompaperunixdialog.h \
gtkdialogprivate.h \
gtkentryprivate.h \
gtkeventcontrollerprivate.h \
gtkfilechooserembed.h \
gtkfilechooserentry.h \
gtkfilechooserprivate.h \
......@@ -512,6 +513,13 @@ gtk_private_h_sources = \
gtkfontchooserprivate.h \
gtkfontchooserutils.h \
gtkgestureprivate.h \
gtkgesturedragprivate.h \
gtkgesturelongpressprivate.h \
gtkgesturemultipressprivate.h \
gtkgesturepanprivate.h \
gtkgesturerotateprivate.h \
gtkgestureswipeprivate.h \
gtkgesturezoomprivate.h \
gtkheaderbarprivate.h \
gtkhslaprivate.h \
gtkiconcache.h \
......
......@@ -39,7 +39,8 @@
*/
#include "config.h"
#include <gtk/gtkeventcontroller.h>
#include "gtkeventcontroller.h"
#include "gtkeventcontrollerprivate.h"
#include "gtktypebuiltins.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
......
......@@ -40,22 +40,6 @@ G_BEGIN_DECLS
#define GTK_IS_EVENT_CONTROLLER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER))
#define GTK_EVENT_CONTROLLER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER, GtkEventControllerClass))
struct _GtkEventController
{
GObject parent_instance;
};
struct _GtkEventControllerClass
{
GObjectClass parent_class;
gboolean (* handle_event) (GtkEventController *controller,
const GdkEvent *event);
void (* reset) (GtkEventController *controller);
/*<private>*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_event_controller_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2012, One Laptop Per Child.
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_EVENT_CONTROLLER_PRIVATE_H__
#define __GTK_EVENT_CONTROLLER_PRIVATE_H__
#include "gtkeventcontroller.h"
struct _GtkEventController
{
GObject parent_instance;
};
struct _GtkEventControllerClass
{
GObjectClass parent_class;
gboolean (* handle_event) (GtkEventController *controller,
const GdkEvent *event);
void (* reset) (GtkEventController *controller);
/*<private>*/
gpointer padding[10];
};
#endif /* __GTK_EVENT_CONTROLLER_PRIVATE_H__ */
......@@ -87,7 +87,8 @@
*/
#include "config.h"
#include <gtk/gtkgesture.h>
#include "gtkgesture.h"
#include "gtkgestureprivate.h"
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkmain.h"
......
......@@ -39,35 +39,6 @@ G_BEGIN_DECLS
typedef struct _GtkGesture GtkGesture;
typedef struct _GtkGestureClass GtkGestureClass;
struct _GtkGesture
{
GtkEventController parent_instance;
};
struct _GtkGestureClass
{
GtkEventControllerClass parent_class;
gboolean (* check) (GtkGesture *gesture);
void (* begin) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* update) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* end) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* cancel) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* sequence_state_changed) (GtkGesture *gesture,
GdkEventSequence *sequence,
GtkEventSequenceState state);
/*< private >*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_get_type (void) G_GNUC_CONST;
......
......@@ -31,7 +31,8 @@
* gtk_gesture_drag_get_start_point().
*/
#include "config.h"
#include <gtk/gtkgesturedrag.h>
#include "gtkgesturedrag.h"
#include "gtkgesturedragprivate.h"
typedef struct _GtkGestureDragPrivate GtkGestureDragPrivate;
typedef struct _EventData EventData;
......
......@@ -38,28 +38,6 @@ G_BEGIN_DECLS
typedef struct _GtkGestureDrag GtkGestureDrag;
typedef struct _GtkGestureDragClass GtkGestureDragClass;
struct _GtkGestureDrag
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureDragClass
{
GtkGestureSingleClass parent_class;
void (* drag_begin) (GtkGestureDrag *gesture,
gdouble start_x,
gdouble start_y);
void (* drag_update) (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y);
void (* drag_end) (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y);
/*<private>*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_drag_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_DRAG_PRIVATE_H__
#define __GTK_GESTURE_DRAG_PRIVATE_H__
#include "gtkgesturesingleprivate.h"
#include "gtkgesturedrag.h"
struct _GtkGestureDrag
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureDragClass
{
GtkGestureSingleClass parent_class;
void (* drag_begin) (GtkGestureDrag *gesture,
gdouble start_x,
gdouble start_y);
void (* drag_update) (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y);
void (* drag_end) (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y);
/*<private>*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_DRAG_PRIVATE_H__ */
......@@ -33,9 +33,10 @@
*/
#include "config.h"
#include <gtk/gtk.h>
#include <gtk/gtkgesturelongpress.h>
#include "gtkgesturelongpress.h"
#include "gtkgesturelongpressprivate.h"
#include "gtkmarshalers.h"
#include "gtkdnd.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......
......@@ -38,24 +38,6 @@ G_BEGIN_DECLS
typedef struct _GtkGestureLongPress GtkGestureLongPress;
typedef struct _GtkGestureLongPressClass GtkGestureLongPressClass;
struct _GtkGestureLongPress
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureLongPressClass
{
GtkGestureSingleClass parent_class;
void (* pressed) (GtkGestureLongPress *gesture,
gdouble x,
gdouble y);
void (* cancelled) (GtkGestureLongPress *gesture);
/*< private >*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_long_press_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2012, One Laptop Per Child.
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_LONG_PRESS_PRIVATE_H__
#define __GTK_GESTURE_LONG_PRESS_PRIVATE_H__
#include "gtkgesturesingleprivate.h"
#include "gtkgesturelongpress.h"
struct _GtkGestureLongPress
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureLongPressClass
{
GtkGestureSingleClass parent_class;
void (* pressed) (GtkGestureLongPress *gesture,
gdouble x,
gdouble y);
void (* cancelled) (GtkGestureLongPress *gesture);
/*< private >*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_LONG_PRESS_PRIVATE_H__ */
......@@ -36,6 +36,7 @@
#include "config.h"
#include "gtkgesturemultipress.h"
#include "gtkgesturemultipressprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......
......@@ -38,25 +38,6 @@ G_BEGIN_DECLS
typedef struct _GtkGestureMultiPress GtkGestureMultiPress;
typedef struct _GtkGestureMultiPressClass GtkGestureMultiPressClass;
struct _GtkGestureMultiPress
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureMultiPressClass
{
GtkGestureSingleClass parent_class;
gboolean (* pressed) (GtkGestureMultiPress *gesture,
gint n_press,
gdouble x,
gdouble y);
void (* stopped) (GtkGestureMultiPress *gesture);
/*<private>*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_multi_press_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2014 Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__
#define __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__
#include "gtkgesturesingleprivate.h"
#include "gtkgesturemultipress.h"
struct _GtkGestureMultiPress
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureMultiPressClass
{
GtkGestureSingleClass parent_class;
gboolean (* pressed) (GtkGestureMultiPress *gesture,
gint n_press,
gdouble x,
gdouble y);
void (* stopped) (GtkGestureMultiPress *gesture);
/*<private>*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ */
......@@ -39,7 +39,8 @@
*/
#include "config.h"
#include <gtk/gtkgesturepan.h>
#include "gtkgesturepan.h"
#include "gtkgesturepanprivate.h"
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......
......@@ -38,23 +38,6 @@ G_BEGIN_DECLS
typedef struct _GtkGesturePan GtkGesturePan;
typedef struct _GtkGesturePanClass GtkGesturePanClass;
struct _GtkGesturePan
{
GtkGestureDrag parent_instance;
};
struct _GtkGesturePanClass
{
GtkGestureDragClass parent_class;
void (* pan) (GtkGesturePan *gesture,
GtkPanDirection direction,
gdouble offset);
/*< private >*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_pan_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_PAN_PRIVATE_H__
#define __GTK_GESTURE_PAN_PRIVATE_H__
#include "gtkgesturedragprivate.h"
#include "gtkgesturepan.h"
struct _GtkGesturePan
{
GtkGestureDrag parent_instance;
};
struct _GtkGesturePanClass
{
GtkGestureDragClass parent_class;
void (* pan) (GtkGesturePan *gesture,
GtkPanDirection direction,
gdouble offset);
/*< private >*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_PAN_PRIVATE_H__ */
......@@ -16,20 +16,50 @@
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_PRIVATE_H__
#define __GTK_GESTURE_PRIVATE_H__
#include "gtkeventcontrollerprivate.h"
#include "gtkgesture.h"
struct _GtkGesture
{
GtkEventController parent_instance;
};
struct _GtkGestureClass
{
GtkEventControllerClass parent_class;
gboolean (* check) (GtkGesture *gesture);
void (* begin) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* update) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* end) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* cancel) (GtkGesture *gesture,
GdkEventSequence *sequence);
void (* sequence_state_changed) (GtkGesture *gesture,
GdkEventSequence *sequence,
GtkEventSequenceState state);
/*< private >*/
gpointer padding[10];
};
G_BEGIN_DECLS
gboolean _gtk_gesture_handled_sequence_press (GtkGesture *gesture,
GdkEventSequence *sequence);
gboolean _gtk_gesture_get_pointer_emulating_sequence
(GtkGesture *gesture,
GdkEventSequence **sequence);
(GtkGesture *gesture,
GdkEventSequence **sequence);
G_END_DECLS
......
......@@ -31,7 +31,8 @@
#include "config.h"
#include <math.h>
#include <gtk/gtkgesturerotate.h>
#include "gtkgesturerotate.h"
#include "gtkgesturerotateprivate.h"
#include "gtkmarshalers.h"
typedef struct _GtkGestureRotatePrivate GtkGestureRotatePrivate;
......
......@@ -39,22 +39,6 @@ G_BEGIN_DECLS
typedef struct _GtkGestureRotate GtkGestureRotate;
typedef struct _GtkGestureRotateClass GtkGestureRotateClass;
struct _GtkGestureRotate
{
GtkGesture parent_instance;
};
struct _GtkGestureRotateClass
{
GtkGestureClass parent_class;
void (* angle_changed) (GtkGestureRotate *gesture,
gdouble angle,
gdouble delta);
/*< private >*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_rotate_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2012, One Laptop Per Child.
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_ROTATE_PRIVATE_H__
#define __GTK_GESTURE_ROTATE_PRIVATE_H__
#include "gtkgestureprivate.h"
#include "gtkgesturerotate.h"
struct _GtkGestureRotate
{
GtkGesture parent_instance;
};
struct _GtkGestureRotateClass
{
GtkGestureClass parent_class;
void (* angle_changed) (GtkGestureRotate *gesture,
gdouble angle,
gdouble delta);
/*< private >*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_ROTATE_PRIVATE_H__ */
......@@ -35,7 +35,8 @@
*/
#include "config.h"
#include <gtk/gtkgesturesingle.h>
#include "gtkgesturesingle.h"
#include "gtkgesturesingleprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......
......@@ -39,19 +39,6 @@ G_BEGIN_DECLS
typedef struct _GtkGestureSingle GtkGestureSingle;
typedef struct _GtkGestureSingleClass GtkGestureSingleClass;
struct _GtkGestureSingle
{
GtkGesture parent_instance;
};
struct _GtkGestureSingleClass
{
GtkGestureClass parent_class;
/*< private >*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_single_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2012, One Laptop Per Child.
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_SINGLE_PRIVATE_H__
#define __GTK_GESTURE_SINGLE_PRIVATE_H__
#include "gtkgestureprivate.h"
#include "gtkgesturesingle.h"
struct _GtkGestureSingle
{
GtkGesture parent_instance;
};
struct _GtkGestureSingleClass
{
GtkGestureClass parent_class;
/*< private >*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_SINGLE_PRIVATE_H__ */
......@@ -36,7 +36,8 @@
*/
#include "config.h"
#include <gtk/gtkgestureswipe.h>
#include "gtkgestureswipe.h"
#include "gtkgestureswipeprivate.h"
#include "gtkmarshalers.h"
#define CAPTURE_THRESHOLD_MS 150
......
......@@ -39,23 +39,6 @@ G_BEGIN_DECLS
typedef struct _GtkGestureSwipe GtkGestureSwipe;
typedef struct _GtkGestureSwipeClass GtkGestureSwipeClass;
struct _GtkGestureSwipe
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureSwipeClass
{
GtkGestureSingleClass parent_class;
void (* swipe) (GtkGestureSwipe *gesture,
gdouble velocity_x,
gdouble velocity_y);
/*< private >*/
gpointer padding[10];
};
GDK_AVAILABLE_IN_3_14
GType gtk_gesture_swipe_get_type (void) G_GNUC_CONST;
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2012, One Laptop Per Child.
* Copyright (C) 2014, Red Hat, Inc.
*
* 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 library. If not, see <http://www.gnu.org/licenses/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_SWIPE_PRIVATE_H__
#define __GTK_GESTURE_SWIPE_PRIVATE_H__
#include "gtkgesturesingleprivate.h"
#include "gtkgestureswipe.h"
struct _GtkGestureSwipe
{
GtkGestureSingle parent_instance;