Package ch.bailu.gtk.gtk
Class WidgetClass
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gtk.WidgetClass
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
WidgetClassExtended
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
The object class structure needs to be the first
element in the widget class structure in order for the class mechanism
to work correctly.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBinding
(int keyval, int mods, WidgetClass.OnShortcutFunc callback, Str format_string, Object... _elipse) Creates a new shortcut for @widget_class that calls the given @callback
with arguments read according to @format_string.void
addBinding
(int keyval, int mods, WidgetClass.OnShortcutFunc callback, String format_string, Object... _elipse) Creates a new shortcut for @widget_class that calls the given @callback
with arguments read according to @format_string.void
addBindingAction
(int keyval, int mods, Str action_name, Str format_string, Object... _elipse) Creates a new shortcut for @widget_class that activates the given
@action_name with arguments read according to @format_string.void
addBindingAction
(int keyval, int mods, String action_name, String format_string, Object... _elipse) Creates a new shortcut for @widget_class that activates the given
@action_name with arguments read according to @format_string.void
addBindingSignal
(int keyval, int mods, Str signal, Str format_string, Object... _elipse) Creates a new shortcut for @widget_class that emits the given action
@signal with arguments read according to @format_string.void
addBindingSignal
(int keyval, int mods, String signal, String format_string, Object... _elipse) Creates a new shortcut for @widget_class that emits the given action
@signal with arguments read according to @format_string.void
addShortcut
(Shortcut shortcut) Installs a shortcut in @widget_class.void
bindTemplateCallbackFull
(Str callback_name, WidgetClass.OnCallback callback_symbol) Declares a @callback_symbol to handle @callback_name from
the template XML defined for @widget_type.void
bindTemplateCallbackFull
(String callback_name, WidgetClass.OnCallback callback_symbol) Declares a @callback_symbol to handle @callback_name from
the template XML defined for @widget_type.void
bindTemplateChildFull
(Str name, boolean internal_child, long struct_offset) Automatically assign an object declared in the class template XML to
be set to a location on a freshly built instance’s private data, or
alternatively accessible via [method@Gtk.Widget.get_template_child].void
bindTemplateChildFull
(String name, boolean internal_child, long struct_offset) Automatically assign an object declared in the class template XML to
be set to a location on a freshly built instance’s private data, or
alternatively accessible via [method@Gtk.Widget.get_template_child].int
Retrieves the accessible role used by the given `GtkWidget` class.int
Retrieves the signal id for the activation signal.static ClassHandler
Gets the name used by this class for matching in CSS code.ch.bailu.gtk.gtk.JnaWidgetClass.OnComputeExpand
ch.bailu.gtk.gtk.JnaWidgetClass.OnContains
ch.bailu.gtk.gtk.JnaWidgetClass.OnCssChanged
ch.bailu.gtk.gtk.JnaWidgetClass.OnDirectionChanged
ch.bailu.gtk.gtk.JnaWidgetClass.OnFocus
ch.bailu.gtk.gtk.JnaWidgetClass.OnGetRequestMode
ch.bailu.gtk.gtk.JnaWidgetClass.OnGrabFocus
ch.bailu.gtk.gtk.JnaWidgetClass.OnHide
ch.bailu.gtk.gtk.JnaWidgetClass.OnKeynavFailed
ch.bailu.gtk.gtk.JnaWidgetClass.OnMap
ch.bailu.gtk.gtk.JnaWidgetClass.OnMeasure
ch.bailu.gtk.gtk.JnaWidgetClass.OnMnemonicActivate
ch.bailu.gtk.gtk.JnaWidgetClass.OnMoveFocus
ch.bailu.gtk.gtk.WidgetClassPrivate
ch.bailu.gtk.gtk.JnaWidgetClass.OnQueryTooltip
ch.bailu.gtk.gtk.JnaWidgetClass.OnRealize
ch.bailu.gtk.gtk.JnaWidgetClass.OnRoot
ch.bailu.gtk.gtk.JnaWidgetClass.OnSetFocusChild
ch.bailu.gtk.gtk.JnaWidgetClass.OnShow
ch.bailu.gtk.gtk.JnaWidgetClass.OnSizeAllocate
ch.bailu.gtk.gtk.JnaWidgetClass.OnSnapshot
ch.bailu.gtk.gtk.JnaWidgetClass.OnStateFlagsChanged
ch.bailu.gtk.gtk.JnaWidgetClass.OnSystemSettingChanged
ch.bailu.gtk.gtk.JnaWidgetClass.OnUnmap
ch.bailu.gtk.gtk.JnaWidgetClass.OnUnrealize
ch.bailu.gtk.gtk.JnaWidgetClass.OnUnroot
static int
long
Retrieves the type of the [class@Gtk.LayoutManager]
used by widgets of class @widget_class.static TypeSystem.TypeSize
static TypeSystem.TypeSize
void
installAction
(Str action_name, Str parameter_type, WidgetClass.OnWidgetActionActivateFunc activate) This should be called at class initialization time to specify
actions to be added for all instances of this class.void
installAction
(String action_name, String parameter_type, WidgetClass.OnWidgetActionActivateFunc activate) This should be called at class initialization time to specify
actions to be added for all instances of this class.void
installPropertyAction
(Str action_name, Str property_name) Installs an action called @action_name on @widget_class and
binds its state to the value of the @property_name property.void
installPropertyAction
(String action_name, String property_name) Installs an action called @action_name on @widget_class and
binds its state to the value of the @property_name property.void
setAccessibleRole
(int accessible_role) Sets the accessible role used by the given `GtkWidget` class.void
setActivateSignal
(int signal_id) Sets the `GtkWidgetClass.activate_signal` field with the
given @signal_id.void
setActivateSignalFromName
(Str signal_name) Sets the `GtkWidgetClass.activate_signal` field with the signal id for
the given @signal_name.void
setActivateSignalFromName
(String signal_name) Sets the `GtkWidgetClass.activate_signal` field with the signal id for
the given @signal_name.void
setCssName
(Str name) Sets the name to be used for CSS matching of widgets.void
setCssName
(String name) Sets the name to be used for CSS matching of widgets.void
setFieldComputeExpand
(WidgetClass.OnComputeExpand compute_expand) void
setFieldContains
(WidgetClass.OnContains contains) void
setFieldCssChanged
(WidgetClass.OnCssChanged css_changed) void
setFieldDirectionChanged
(WidgetClass.OnDirectionChanged direction_changed) void
setFieldFocus
(WidgetClass.OnFocus focus) void
setFieldGetRequestMode
(WidgetClass.OnGetRequestMode get_request_mode) void
setFieldGrabFocus
(WidgetClass.OnGrabFocus grab_focus) void
void
setFieldKeynavFailed
(WidgetClass.OnKeynavFailed keynav_failed) void
void
setFieldMeasure
(WidgetClass.OnMeasure measure) void
setFieldMnemonicActivate
(WidgetClass.OnMnemonicActivate mnemonic_activate) void
setFieldMoveFocus
(WidgetClass.OnMoveFocus move_focus) void
setFieldQueryTooltip
(WidgetClass.OnQueryTooltip query_tooltip) void
setFieldRealize
(WidgetClass.OnRealize realize) void
void
setFieldSetFocusChild
(WidgetClass.OnSetFocusChild set_focus_child) void
void
setFieldSizeAllocate
(WidgetClass.OnSizeAllocate size_allocate) void
setFieldSnapshot
(WidgetClass.OnSnapshot snapshot) void
setFieldStateFlagsChanged
(WidgetClass.OnStateFlagsChanged state_flags_changed) void
setFieldSystemSettingChanged
(WidgetClass.OnSystemSettingChanged system_setting_changed) void
setFieldUnmap
(WidgetClass.OnUnmap unmap) void
setFieldUnrealize
(WidgetClass.OnUnrealize unrealize) void
setFieldUnroot
(WidgetClass.OnUnroot unroot) void
setLayoutManagerType
(long type) Sets the type to be used for creating layout managers for
widgets of @widget_class.void
setTemplate
(Bytes template_bytes) This should be called at class initialization time to specify
the `GtkBuilder` XML to be used to extend a widget.void
setTemplateFromResource
(Str resource_name) A convenience function that calls [method@Gtk.WidgetClass.set_template]
with the contents of a `GResource`.void
setTemplateFromResource
(String resource_name) A convenience function that calls [method@Gtk.WidgetClass.set_template]
with the contents of a `GResource`.void
setTemplateScope
(BuilderScope scope) For use in language bindings, this will override the default
`GtkBuilderScope` to be used when parsing GtkBuilder XML from
this class’s template data.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
PARENT_CLASS
The object class structure needs to be the first
element in the widget class structure in order for the class mechanism
to work correctly. This allows a GtkWidgetClass pointer to be cast to
a GObjectClass pointer.
Private field: direct-type- See Also:
-
SHOW
- See Also:
-
HIDE
- See Also:
-
MAP
- See Also:
-
UNMAP
- See Also:
-
REALIZE
SeeWidgetClass.OnRealize.onRealize(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gtk.Widget)
- See Also:
-
UNREALIZE
- See Also:
-
ROOT
- See Also:
-
UNROOT
SeeWidgetClass.OnUnroot.onUnroot(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gtk.Widget)
- See Also:
-
SIZE_ALLOCATE
- See Also:
-
STATE_FLAGS_CHANGED
- See Also:
-
DIRECTION_CHANGED
- See Also:
-
GET_REQUEST_MODE
- See Also:
-
MEASURE
- See Also:
-
MNEMONIC_ACTIVATE
- See Also:
-
GRAB_FOCUS
- See Also:
-
FOCUS
SeeWidgetClass.OnFocus.onFocus(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gtk.Widget, int)
- See Also:
-
SET_FOCUS_CHILD
- See Also:
-
MOVE_FOCUS
- See Also:
-
KEYNAV_FAILED
- See Also:
-
QUERY_TOOLTIP
- See Also:
-
COMPUTE_EXPAND
- See Also:
-
CSS_CHANGED
- See Also:
-
SYSTEM_SETTING_CHANGED
- See Also:
-
SNAPSHOT
- See Also:
-
CONTAINS
- See Also:
-
PRIV
- See Also:
-
-
Constructor Details
-
WidgetClass
-
-
Method Details
-
getClassHandler
-
setFieldShow
-
getFieldShow
public ch.bailu.gtk.gtk.JnaWidgetClass.OnShow getFieldShow() -
setFieldHide
-
getFieldHide
public ch.bailu.gtk.gtk.JnaWidgetClass.OnHide getFieldHide() -
setFieldMap
-
getFieldMap
public ch.bailu.gtk.gtk.JnaWidgetClass.OnMap getFieldMap() -
setFieldUnmap
-
getFieldUnmap
public ch.bailu.gtk.gtk.JnaWidgetClass.OnUnmap getFieldUnmap() -
setFieldRealize
-
getFieldRealize
public ch.bailu.gtk.gtk.JnaWidgetClass.OnRealize getFieldRealize() -
setFieldUnrealize
-
getFieldUnrealize
public ch.bailu.gtk.gtk.JnaWidgetClass.OnUnrealize getFieldUnrealize() -
setFieldRoot
-
getFieldRoot
public ch.bailu.gtk.gtk.JnaWidgetClass.OnRoot getFieldRoot() -
setFieldUnroot
-
getFieldUnroot
public ch.bailu.gtk.gtk.JnaWidgetClass.OnUnroot getFieldUnroot() -
setFieldSizeAllocate
-
getFieldSizeAllocate
public ch.bailu.gtk.gtk.JnaWidgetClass.OnSizeAllocate getFieldSizeAllocate() -
setFieldStateFlagsChanged
-
getFieldStateFlagsChanged
public ch.bailu.gtk.gtk.JnaWidgetClass.OnStateFlagsChanged getFieldStateFlagsChanged() -
setFieldDirectionChanged
-
getFieldDirectionChanged
public ch.bailu.gtk.gtk.JnaWidgetClass.OnDirectionChanged getFieldDirectionChanged() -
setFieldGetRequestMode
-
getFieldGetRequestMode
public ch.bailu.gtk.gtk.JnaWidgetClass.OnGetRequestMode getFieldGetRequestMode() -
setFieldMeasure
-
getFieldMeasure
public ch.bailu.gtk.gtk.JnaWidgetClass.OnMeasure getFieldMeasure() -
setFieldMnemonicActivate
-
getFieldMnemonicActivate
public ch.bailu.gtk.gtk.JnaWidgetClass.OnMnemonicActivate getFieldMnemonicActivate() -
setFieldGrabFocus
-
getFieldGrabFocus
public ch.bailu.gtk.gtk.JnaWidgetClass.OnGrabFocus getFieldGrabFocus() -
setFieldFocus
-
getFieldFocus
public ch.bailu.gtk.gtk.JnaWidgetClass.OnFocus getFieldFocus() -
setFieldSetFocusChild
-
getFieldSetFocusChild
public ch.bailu.gtk.gtk.JnaWidgetClass.OnSetFocusChild getFieldSetFocusChild() -
setFieldMoveFocus
-
getFieldMoveFocus
public ch.bailu.gtk.gtk.JnaWidgetClass.OnMoveFocus getFieldMoveFocus() -
setFieldQueryTooltip
-
getFieldQueryTooltip
public ch.bailu.gtk.gtk.JnaWidgetClass.OnQueryTooltip getFieldQueryTooltip() -
setFieldComputeExpand
-
getFieldComputeExpand
public ch.bailu.gtk.gtk.JnaWidgetClass.OnComputeExpand getFieldComputeExpand() -
setFieldCssChanged
-
getFieldCssChanged
public ch.bailu.gtk.gtk.JnaWidgetClass.OnCssChanged getFieldCssChanged() -
setFieldSystemSettingChanged
-
getFieldSystemSettingChanged
public ch.bailu.gtk.gtk.JnaWidgetClass.OnSystemSettingChanged getFieldSystemSettingChanged() -
setFieldSnapshot
-
getFieldSnapshot
public ch.bailu.gtk.gtk.JnaWidgetClass.OnSnapshot getFieldSnapshot() -
setFieldContains
-
getFieldContains
public ch.bailu.gtk.gtk.JnaWidgetClass.OnContains getFieldContains() -
getFieldPriv
public ch.bailu.gtk.gtk.WidgetClassPrivate getFieldPriv() -
addBinding
public void addBinding(int keyval, int mods, WidgetClass.OnShortcutFunc callback, @Nullable Str format_string, Object... _elipse) Creates a new shortcut for @widget_class that calls the given @callback
with arguments read according to @format_string.
The arguments and format string must be provided in the same way as
with g_variant_new().
This function is a convenience wrapper around
[method@Gtk.WidgetClass.add_shortcut] and must be called during class
initialization. It does not provide for user_data, if you need that,
you will have to use [method@GtkWidgetClass.add_shortcut] with a custom
shortcut.- Parameters:
keyval
- key value of binding to installmods
- key modifier of binding to installcallback
- the callback to call upon activationformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string
-
addBinding
public void addBinding(int keyval, int mods, WidgetClass.OnShortcutFunc callback, String format_string, Object... _elipse) Creates a new shortcut for @widget_class that calls the given @callback
with arguments read according to @format_string.
The arguments and format string must be provided in the same way as
with g_variant_new().
This function is a convenience wrapper around
[method@Gtk.WidgetClass.add_shortcut] and must be called during class
initialization. It does not provide for user_data, if you need that,
you will have to use [method@GtkWidgetClass.add_shortcut] with a custom
shortcut.- Parameters:
keyval
- key value of binding to installmods
- key modifier of binding to installcallback
- the callback to call upon activationformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string
-
addBindingAction
public void addBindingAction(int keyval, int mods, @Nonnull Str action_name, @Nullable Str format_string, Object... _elipse) Creates a new shortcut for @widget_class that activates the given
@action_name with arguments read according to @format_string.
The arguments and format string must be provided in the same way as
with g_variant_new().
This function is a convenience wrapper around
[method@Gtk.WidgetClass.add_shortcut] and must be called during class
initialization.- Parameters:
keyval
- key value of binding to installmods
- key modifier of binding to installaction_name
- the action to activateformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string
-
addBindingAction
public void addBindingAction(int keyval, int mods, String action_name, String format_string, Object... _elipse) Creates a new shortcut for @widget_class that activates the given
@action_name with arguments read according to @format_string.
The arguments and format string must be provided in the same way as
with g_variant_new().
This function is a convenience wrapper around
[method@Gtk.WidgetClass.add_shortcut] and must be called during class
initialization.- Parameters:
keyval
- key value of binding to installmods
- key modifier of binding to installaction_name
- the action to activateformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string
-
addBindingSignal
public void addBindingSignal(int keyval, int mods, @Nonnull Str signal, @Nullable Str format_string, Object... _elipse) Creates a new shortcut for @widget_class that emits the given action
@signal with arguments read according to @format_string.
The arguments and format string must be provided in the same way as
with g_variant_new().
This function is a convenience wrapper around
[method@Gtk.WidgetClass.add_shortcut] and must be called during class
initialization.- Parameters:
keyval
- key value of binding to installmods
- key modifier of binding to installsignal
- the signal to executeformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string
-
addBindingSignal
public void addBindingSignal(int keyval, int mods, String signal, String format_string, Object... _elipse) Creates a new shortcut for @widget_class that emits the given action
@signal with arguments read according to @format_string.
The arguments and format string must be provided in the same way as
with g_variant_new().
This function is a convenience wrapper around
[method@Gtk.WidgetClass.add_shortcut] and must be called during class
initialization.- Parameters:
keyval
- key value of binding to installmods
- key modifier of binding to installsignal
- the signal to executeformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string
-
addShortcut
Installs a shortcut in @widget_class.
Every instance created for @widget_class or its subclasses will
inherit this shortcut and trigger it.
Shortcuts added this way will be triggered in the %GTK_PHASE_BUBBLE
phase, which means they may also trigger if child widgets have focus.
This function must only be used in class initialization functions
otherwise it is not guaranteed that the shortcut will be installed.- Parameters:
shortcut
- the `GtkShortcut` to add
-
bindTemplateCallbackFull
public void bindTemplateCallbackFull(@Nonnull Str callback_name, WidgetClass.OnCallback callback_symbol) Declares a @callback_symbol to handle @callback_name from
the template XML defined for @widget_type.
This function is not supported after [method@Gtk.WidgetClass.set_template_scope]
has been used on @widget_class. See [method@Gtk.BuilderCScope.add_callback_symbol].
Note that this must be called from a composite widget classes
class initializer after calling [method@Gtk.WidgetClass.set_template].- Parameters:
callback_name
- The name of the callback as expected in the template XMLcallback_symbol
- The callback symbol
-
bindTemplateCallbackFull
Declares a @callback_symbol to handle @callback_name from
the template XML defined for @widget_type.
This function is not supported after [method@Gtk.WidgetClass.set_template_scope]
has been used on @widget_class. See [method@Gtk.BuilderCScope.add_callback_symbol].
Note that this must be called from a composite widget classes
class initializer after calling [method@Gtk.WidgetClass.set_template].- Parameters:
callback_name
- The name of the callback as expected in the template XMLcallback_symbol
- The callback symbol
-
bindTemplateChildFull
Automatically assign an object declared in the class template XML to
be set to a location on a freshly built instance’s private data, or
alternatively accessible via [method@Gtk.Widget.get_template_child].
The struct can point either into the public instance, then you should
use `G_STRUCT_OFFSET(WidgetType, member)` for @struct_offset, or in the
private struct, then you should use `G_PRIVATE_OFFSET(WidgetType, member)`.
An explicit strong reference will be held automatically for the duration
of your instance’s life cycle, it will be released automatically when
`GObjectClass.dispose()` runs on your instance and if a @struct_offset
that is `!= 0` is specified, then the automatic location in your instance
public or private data will be set to %NULL. You can however access an
automated child pointer the first time your classes `GObjectClass.dispose()`
runs, or alternatively in [signal@Gtk.Widget::destroy].
If @internal_child is specified, [vfunc@Gtk.Buildable.get_internal_child]
will be automatically implemented by the `GtkWidget` class so there is no
need to implement it manually.
The wrapper macros [func@Gtk.widget_class_bind_template_child],
[func@Gtk.widget_class_bind_template_child_internal],
[func@Gtk.widget_class_bind_template_child_private] and
[func@Gtk.widget_class_bind_template_child_internal_private]
might be more convenient to use.
Note that this must be called from a composite widget classes class
initializer after calling [method@Gtk.WidgetClass.set_template].- Parameters:
name
- The “id” of the child defined in the template XMLinternal_child
- Whether the child should be accessible as an “internal-child” when this class is used in GtkBuilder XMLstruct_offset
- The structure offset into the composite widget’s instance public or private structure where the automated child pointer should be set, or 0 to not assign the pointer.
-
bindTemplateChildFull
Automatically assign an object declared in the class template XML to
be set to a location on a freshly built instance’s private data, or
alternatively accessible via [method@Gtk.Widget.get_template_child].
The struct can point either into the public instance, then you should
use `G_STRUCT_OFFSET(WidgetType, member)` for @struct_offset, or in the
private struct, then you should use `G_PRIVATE_OFFSET(WidgetType, member)`.
An explicit strong reference will be held automatically for the duration
of your instance’s life cycle, it will be released automatically when
`GObjectClass.dispose()` runs on your instance and if a @struct_offset
that is `!= 0` is specified, then the automatic location in your instance
public or private data will be set to %NULL. You can however access an
automated child pointer the first time your classes `GObjectClass.dispose()`
runs, or alternatively in [signal@Gtk.Widget::destroy].
If @internal_child is specified, [vfunc@Gtk.Buildable.get_internal_child]
will be automatically implemented by the `GtkWidget` class so there is no
need to implement it manually.
The wrapper macros [func@Gtk.widget_class_bind_template_child],
[func@Gtk.widget_class_bind_template_child_internal],
[func@Gtk.widget_class_bind_template_child_private] and
[func@Gtk.widget_class_bind_template_child_internal_private]
might be more convenient to use.
Note that this must be called from a composite widget classes class
initializer after calling [method@Gtk.WidgetClass.set_template].- Parameters:
name
- The “id” of the child defined in the template XMLinternal_child
- Whether the child should be accessible as an “internal-child” when this class is used in GtkBuilder XMLstruct_offset
- The structure offset into the composite widget’s instance public or private structure where the automated child pointer should be set, or 0 to not assign the pointer.
-
getAccessibleRole
public int getAccessibleRole()Retrieves the accessible role used by the given `GtkWidget` class.
Different accessible roles have different states, and are rendered
differently by assistive technologies.
See also: [method@Gtk.Accessible.get_accessible_role].- Returns:
- the accessible role for the widget class
-
getActivateSignal
public int getActivateSignal()Retrieves the signal id for the activation signal.
the activation signal is set using
[method@Gtk.WidgetClass.set_activate_signal].- Returns:
- a signal id, or 0 if the widget class does not specify an activation signal
-
getCssName
Gets the name used by this class for matching in CSS code.
See [method@Gtk.WidgetClass.set_css_name] for details.- Returns:
- the CSS name of the given class
-
getLayoutManagerType
public long getLayoutManagerType()Retrieves the type of the [class@Gtk.LayoutManager]
used by widgets of class @widget_class.
See also: [method@Gtk.WidgetClass.set_layout_manager_type].- Returns:
- type of a `GtkLayoutManager` subclass, or %G_TYPE_INVALID
-
installAction
public void installAction(@Nonnull Str action_name, @Nullable Str parameter_type, WidgetClass.OnWidgetActionActivateFunc activate) This should be called at class initialization time to specify
actions to be added for all instances of this class.
Actions installed by this function are stateless. The only state
they have is whether they are enabled or not.- Parameters:
action_name
- a prefixed action name, such as "clipboard.paste"parameter_type
- the parameter typeactivate
- callback to use when the action is activated
-
installAction
public void installAction(String action_name, String parameter_type, WidgetClass.OnWidgetActionActivateFunc activate) This should be called at class initialization time to specify
actions to be added for all instances of this class.
Actions installed by this function are stateless. The only state
they have is whether they are enabled or not.- Parameters:
action_name
- a prefixed action name, such as "clipboard.paste"parameter_type
- the parameter typeactivate
- callback to use when the action is activated
-
installPropertyAction
Installs an action called @action_name on @widget_class and
binds its state to the value of the @property_name property.
This function will perform a few santity checks on the property selected
via @property_name. Namely, the property must exist, must be readable,
writable and must not be construct-only. There are also restrictions
on the type of the given property, it must be boolean, int, unsigned int,
double or string. If any of these conditions are not met, a critical
warning will be printed and no action will be added.
The state type of the action matches the property type.
If the property is boolean, the action will have no parameter and
toggle the property value. Otherwise, the action will have a parameter
of the same type as the property.- Parameters:
action_name
- name of the actionproperty_name
- name of the property in instances of @widget_class or any parent class.
-
installPropertyAction
Installs an action called @action_name on @widget_class and
binds its state to the value of the @property_name property.
This function will perform a few santity checks on the property selected
via @property_name. Namely, the property must exist, must be readable,
writable and must not be construct-only. There are also restrictions
on the type of the given property, it must be boolean, int, unsigned int,
double or string. If any of these conditions are not met, a critical
warning will be printed and no action will be added.
The state type of the action matches the property type.
If the property is boolean, the action will have no parameter and
toggle the property value. Otherwise, the action will have a parameter
of the same type as the property.- Parameters:
action_name
- name of the actionproperty_name
- name of the property in instances of @widget_class or any parent class.
-
setAccessibleRole
public void setAccessibleRole(int accessible_role) Sets the accessible role used by the given `GtkWidget` class.
Different accessible roles have different states, and are
rendered differently by assistive technologies.- Parameters:
accessible_role
- the `GtkAccessibleRole` used by the @widget_class
-
setActivateSignal
public void setActivateSignal(int signal_id) Sets the `GtkWidgetClass.activate_signal` field with the
given @signal_id.
The signal will be emitted when calling [method@Gtk.Widget.activate].
The @signal_id must have been registered with `g_signal_new()`
or g_signal_newv() before calling this function.- Parameters:
signal_id
- the id for the activate signal
-
setActivateSignalFromName
Sets the `GtkWidgetClass.activate_signal` field with the signal id for
the given @signal_name.
The signal will be emitted when calling [method@Gtk.Widget.activate].
The @signal_name of @widget_type must have been registered with
g_signal_new() or g_signal_newv() before calling this function.- Parameters:
signal_name
- the name of the activate signal of @widget_type
-
setActivateSignalFromName
Sets the `GtkWidgetClass.activate_signal` field with the signal id for
the given @signal_name.
The signal will be emitted when calling [method@Gtk.Widget.activate].
The @signal_name of @widget_type must have been registered with
g_signal_new() or g_signal_newv() before calling this function.- Parameters:
signal_name
- the name of the activate signal of @widget_type
-
setCssName
Sets the name to be used for CSS matching of widgets.
If this function is not called for a given class, the name
set on the parent class is used. By default, `GtkWidget`
uses the name "widget".- Parameters:
name
- name to use
-
setCssName
Sets the name to be used for CSS matching of widgets.
If this function is not called for a given class, the name
set on the parent class is used. By default, `GtkWidget`
uses the name "widget".- Parameters:
name
- name to use
-
setLayoutManagerType
public void setLayoutManagerType(long type) Sets the type to be used for creating layout managers for
widgets of @widget_class.
The given @type must be a subtype of [class@Gtk.LayoutManager].
This function should only be called from class init functions
of widgets.- Parameters:
type
- The object type that implements the `GtkLayoutManager` for @widget_class
-
setTemplate
This should be called at class initialization time to specify
the `GtkBuilder` XML to be used to extend a widget.
For convenience, [method@Gtk.WidgetClass.set_template_from_resource]
is also provided.
Note that any class that installs templates must call
[method@Gtk.Widget.init_template] in the widget’s instance initializer.- Parameters:
template_bytes
- A `GBytes` holding the `GtkBuilder` XML
-
setTemplateFromResource
A convenience function that calls [method@Gtk.WidgetClass.set_template]
with the contents of a `GResource`.
Note that any class that installs templates must call
[method@Gtk.Widget.init_template] in the widget’s instance
initializer.- Parameters:
resource_name
- The name of the resource to load the template from
-
setTemplateFromResource
A convenience function that calls [method@Gtk.WidgetClass.set_template]
with the contents of a `GResource`.
Note that any class that installs templates must call
[method@Gtk.Widget.init_template] in the widget’s instance
initializer.- Parameters:
resource_name
- The name of the resource to load the template from
-
setTemplateScope
For use in language bindings, this will override the default
`GtkBuilderScope` to be used when parsing GtkBuilder XML from
this class’s template data.
Note that this must be called from a composite widget classes class
initializer after calling [method@GtkWidgetClass.set_template].- Parameters:
scope
- The `GtkBuilderScope` to use when loading the class template
-
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-