///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://DbusmenuGtk3?version=0.4' {
// Module dependencies
import type Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
import type Dbusmenu from 'gi://Dbusmenu?version=0.4';
export namespace DbusmenuGtk3 {
/**
* DbusmenuGtk3-0.4
*/
const GTK_MENUITEM_H__: number;
/**
* The Dbusmenu GTK parser adds cached items on the various
* menu items throughout the tree. Sometimes it can be useful
* to get that cached item to use directly. This function
* will retrieve it for you.
* @param widget A #GtkMenuItem that may have a cached #DbusmenuMenuitem from the parser
* @returns A pointer to the cached item or NULL if it isn't there.
*/
function gtk_parse_get_cached_item(widget: Gtk.Widget): Dbusmenu.Menuitem;
/**
* Goes through the GTK structures and turns them into the appropraite
* Dbusmenu structures along with setting up all the relationships
* between the objects. It also stores the dbusmenu items as a cache
* on the GTK items so that they'll be reused if necissary.
* @param widget A #GtkMenuItem or #GtkMenuShell to turn into a #DbusmenuMenuitem
* @returns A dbusmenu item representing the menu structure
*/
function gtk_parse_menu_structure(widget: Gtk.Widget): Dbusmenu.Menuitem;
/**
* This function looks on the menu item for a property by the
* name of `property`. If one exists it tries to turn it into
* a #GdkPixbuf. It assumes that the property is a base64 encoded
* PNG file like the one created by #dbusmenu_menuite_property_set_image.
* @param menuitem The #DbusmenuMenuitem to look for the property on
* @param property The name of the property to look for.
* @returns A pixbuf or #NULL to signal error.
*/
function menuitem_property_get_image(menuitem: Dbusmenu.Menuitem, property: string): GdkPixbuf.Pixbuf;
/**
* This function gets a GTK shortcut as a key and a mask
* for use to set the accelerators.
* @param menuitem The #DbusmenuMenuitem to get the shortcut off
*/
function menuitem_property_get_shortcut(menuitem: Dbusmenu.Menuitem): [number, Gdk.ModifierType];
/**
* This function takes the pixbuf that is stored in `data` and
* turns it into a base64 encoded PNG so that it can be placed
* onto a standard #DbusmenuMenuitem property.
* @param menuitem The #DbusmenuMenuitem to set the property on.
* @param property Name of the property to set.
* @param data The image to place on the property.
* @returns Whether the function was able to set the property or not.
*/
function menuitem_property_set_image(
menuitem: Dbusmenu.Menuitem,
property: string,
data: GdkPixbuf.Pixbuf,
): boolean;
/**
* Takes the modifer described by `key` and `modifier` and places that into
* the format sending across Dbus for shortcuts.
* @param menuitem The #DbusmenuMenuitem to set the shortcut on
* @param key The keycode of the key to send
* @param modifier A bitmask of modifiers used to activate the item
* @returns Whether it was successful at setting the property.
*/
function menuitem_property_set_shortcut(
menuitem: Dbusmenu.Menuitem,
key: number,
modifier: Gdk.ModifierType | null,
): boolean;
/**
* Takes the shortcut that is installed on a menu item and calls
* #dbusmenu_menuitem_property_set_shortcut with it. It also sets
* up listeners to watch it change.
* @param menuitem The #DbusmenuMenuitem to set the shortcut on
* @param gmi A menu item to steal the shortcut off of
* @returns Whether it was successful at setting the property.
*/
function menuitem_property_set_shortcut_menuitem(menuitem: Dbusmenu.Menuitem, gmi: Gtk.MenuItem): boolean;
/**
* This function takes a GTK shortcut string as defined in
* #gtk_accelerator_parse and turns that into the information
* required to send it over DBusmenu.
* @param menuitem The #DbusmenuMenuitem to set the shortcut on
* @param shortcut String describing the shortcut
* @returns Whether it was successful at setting the property.
*/
function menuitem_property_set_shortcut_string(menuitem: Dbusmenu.Menuitem, shortcut: string): boolean;
namespace Client {
// Constructor properties interface
interface ConstructorProps extends Dbusmenu.Client.ConstructorProps {}
}
/**
* A subclass of #DbusmenuClient to add functionality with regarding
* building GTK items out of the abstract tree.
*/
class Client extends Dbusmenu.Client {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](dbus_name: string, dbus_object: string): Client;
// Methods
/**
* Gets the accel group for this client.
* @returns Either a valid group or #NULL on error or none set.
*/
get_accel_group(): Gtk.AccelGroup;
/**
* This grabs the #GtkMenuItem that is associated with the
* #DbusmenuMenuitem.
* @param item #DbusmenuMenuitem to get associated #GtkMenuItem on.
* @returns The #GtkMenuItem that can be played with.
*/
menuitem_get(item: Dbusmenu.Menuitem): Gtk.MenuItem;
/**
* This grabs the submenu associated with the menuitem.
* @param item #DbusmenuMenuitem to get associated #GtkMenu on.
* @returns The #GtkMenu if there is one.
*/
menuitem_get_submenu(item: Dbusmenu.Menuitem): Gtk.Menu;
/**
* This function provides some of the basic connectivity for being in
* the GTK world. Things like visibility and sensitivity of the item are
* handled here so that the subclasses don't have to. If you're building
* your on GTK menu item you can use this function to apply those basic
* attributes so that you don't have to deal with them either.
*
* This also handles passing the "activate" signal back to the
* #DbusmenuMenuitem side of thing.
* @param item The #DbusmenuMenuitem to attach the GTK-isms to
* @param gmi A #GtkMenuItem representing the GTK world's view of this menuitem
* @param parent The parent #DbusmenuMenuitem
*/
newitem_base(item: Dbusmenu.Menuitem, gmi: Gtk.MenuItem, parent: Dbusmenu.Menuitem): void;
/**
* Sets the acceleration group for the menu items with accelerators
* on this client.
* @param agroup The new acceleration group
*/
set_accel_group(agroup: Gtk.AccelGroup): void;
}
namespace Menu {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Menu.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
dbus_name: string;
dbusName: string;
dbus_object: string;
dbusObject: string;
}
}
/**
* A #GtkMenu that is built using an abstract tree built from
* a #DbusmenuGtkClient.
*/
class Menu extends Gtk.Menu implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType