1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gdk.PopupIF; 26 27 private import gdk.PopupLayout; 28 private import gdk.Surface; 29 private import gdk.c.functions; 30 public import gdk.c.types; 31 private import gobject.ObjectG; 32 33 34 /** 35 * A `GdkPopup` is a surface that is attached to another surface. 36 * 37 * The `GdkPopup` is positioned relative to its parent surface. 38 * 39 * `GdkPopup`s are typically used to implement menus and similar popups. 40 * They can be modal, which is indicated by the [property@GdkPopup:autohide] 41 * property. 42 */ 43 public interface PopupIF{ 44 /** Get the main Gtk struct */ 45 public GdkPopup* getPopupStruct(bool transferOwnership = false); 46 47 /** the main Gtk struct as a void* */ 48 protected void* getStruct(); 49 50 51 /** */ 52 public static GType getType() 53 { 54 return gdk_popup_get_type(); 55 } 56 57 /** 58 * Returns whether this popup is set to hide on outside clicks. 59 * 60 * Returns: %TRUE if @popup will autohide 61 */ 62 public bool getAutohide(); 63 64 /** 65 * Returns the parent surface of a popup. 66 * 67 * Returns: the parent surface 68 */ 69 public Surface getParent(); 70 71 /** 72 * Obtains the position of the popup relative to its parent. 73 * 74 * Returns: the X coordinate of @popup position 75 */ 76 public int getPositionX(); 77 78 /** 79 * Obtains the position of the popup relative to its parent. 80 * 81 * Returns: the Y coordinate of @popup position 82 */ 83 public int getPositionY(); 84 85 /** 86 * Gets the current popup rectangle anchor. 87 * 88 * The value returned may change after calling [method@Gdk.Popup.present], 89 * or after the [signal@Gdk.Surface::layout] signal is emitted. 90 * 91 * Returns: the current rectangle anchor value of @popup 92 */ 93 public GdkGravity getRectAnchor(); 94 95 /** 96 * Gets the current popup surface anchor. 97 * 98 * The value returned may change after calling [method@Gdk.Popup.present], 99 * or after the [signal@Gdk.Surface::layout] signal is emitted. 100 * 101 * Returns: the current surface anchor value of @popup 102 */ 103 public GdkGravity getSurfaceAnchor(); 104 105 /** 106 * Present @popup after having processed the #GdkPopupLayout rules. 107 * 108 * If the popup was previously now showing, it will be showed, 109 * otherwise it will change position according to @layout. 110 * 111 * After calling this function, the result should be handled in response 112 * to the [signal@GdkSurface::layout] signal being emitted. The resulting 113 * popup position can be queried using [method@Gdk.Popup.get_position_x], 114 * [method@Gdk.Popup.get_position_y], and the resulting size will be sent as 115 * parameters in the layout signal. Use [method@Gdk.Popup.get_rect_anchor] 116 * and [method@Gdk.Popup.get_surface_anchor] to get the resulting anchors. 117 * 118 * Presenting may fail, for example if the @popup is set to autohide 119 * and is immediately hidden upon being presented. If presenting failed, 120 * the [signal@Gdk.Surface::layout] signal will not me emitted. 121 * 122 * Params: 123 * width = the unconstrained popup width to layout 124 * height = the unconstrained popup height to layout 125 * layout = the `GdkPopupLayout` object used to layout 126 * 127 * Returns: %FALSE if it failed to be presented, otherwise %TRUE. 128 */ 129 public bool present(int width, int height, PopupLayout layout); 130 }