You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
3.6 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 2008 Tristan Van Berkom <tristan.van.berkom@gmail.com>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_ACTIVATABLE_H__
  23. #define __GTK_ACTIVATABLE_H__
  24. #include <gtk/gtkaction.h>
  25. #include <gtk/gtktypeutils.h>
  26. G_BEGIN_DECLS
  27. #define GTK_TYPE_ACTIVATABLE (gtk_activatable_get_type ())
  28. #define GTK_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatable))
  29. #define GTK_ACTIVATABLE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatableIface))
  30. #define GTK_IS_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTIVATABLE))
  31. #define GTK_ACTIVATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatableIface))
  32. typedef struct _GtkActivatable GtkActivatable; /* Dummy typedef */
  33. typedef struct _GtkActivatableIface GtkActivatableIface;
  34. /**
  35. * GtkActivatableIface:
  36. * @update: Called to update the activatable when its related action's properties change.
  37. * You must check the #GtkActivatable:use-action-appearance property only apply action
  38. * properties that are meant to effect the appearance accordingly.
  39. * @sync_action_properties: Called to update the activatable completely, this is called internally when
  40. * #GtkActivatable::related-action property is set or unset and by the implementor when
  41. * #GtkActivatable::use-action-appearance changes.<note><para>This method can be called
  42. * with a %NULL action at times</para></note>
  43. *
  44. * Since: 2.16
  45. */
  46. struct _GtkActivatableIface
  47. {
  48. GTypeInterface g_iface;
  49. /* virtual table */
  50. void (* update) (GtkActivatable *activatable,
  51. GtkAction *action,
  52. const gchar *property_name);
  53. void (* sync_action_properties) (GtkActivatable *activatable,
  54. GtkAction *action);
  55. };
  56. GType gtk_activatable_get_type (void) G_GNUC_CONST;
  57. void gtk_activatable_sync_action_properties (GtkActivatable *activatable,
  58. GtkAction *action);
  59. void gtk_activatable_set_related_action (GtkActivatable *activatable,
  60. GtkAction *action);
  61. GtkAction *gtk_activatable_get_related_action (GtkActivatable *activatable);
  62. void gtk_activatable_set_use_action_appearance (GtkActivatable *activatable,
  63. gboolean use_appearance);
  64. gboolean gtk_activatable_get_use_action_appearance (GtkActivatable *activatable);
  65. /* For use in activatable implementations */
  66. void gtk_activatable_do_set_related_action (GtkActivatable *activatable,
  67. GtkAction *action);
  68. G_END_DECLS
  69. #endif /* __GTK_ACTIVATABLE_H__ */