/usr/include/d/gtkd-3/gtk/AppChooserWidget.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | /*
* This file is part of gtkD.
*
* gtkD 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 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD 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 gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gtk.AppChooserWidget;
private import gio.AppInfoIF;
private import glib.ConstructionException;
private import glib.Str;
private import gobject.ObjectG;
private import gobject.Signals;
private import gtk.AppChooserIF;
private import gtk.AppChooserT;
private import gtk.Box;
private import gtk.Menu;
private import gtk.Widget;
private import gtk.c.functions;
public import gtk.c.types;
public import gtkc.gtktypes;
private import std.algorithm;
/**
* #GtkAppChooserWidget is a widget for selecting applications.
* It is the main building block for #GtkAppChooserDialog. Most
* applications only need to use the latter; but you can use
* this widget as part of a larger widget if you have special needs.
*
* #GtkAppChooserWidget offers detailed control over what applications
* are shown, using the
* #GtkAppChooserWidget:show-default,
* #GtkAppChooserWidget:show-recommended,
* #GtkAppChooserWidget:show-fallback,
* #GtkAppChooserWidget:show-other and
* #GtkAppChooserWidget:show-all
* properties. See the #GtkAppChooser documentation for more information
* about these groups of applications.
*
* To keep track of the selected application, use the
* #GtkAppChooserWidget::application-selected and #GtkAppChooserWidget::application-activated signals.
*
* # CSS nodes
*
* GtkAppChooserWidget has a single CSS node with name appchooser.
*/
public class AppChooserWidget : Box, AppChooserIF
{
/** the main Gtk struct */
protected GtkAppChooserWidget* gtkAppChooserWidget;
/** Get the main Gtk struct */
public GtkAppChooserWidget* getAppChooserWidgetStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gtkAppChooserWidget;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gtkAppChooserWidget;
}
protected override void setStruct(GObject* obj)
{
gtkAppChooserWidget = cast(GtkAppChooserWidget*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GtkAppChooserWidget* gtkAppChooserWidget, bool ownedRef = false)
{
this.gtkAppChooserWidget = gtkAppChooserWidget;
super(cast(GtkBox*)gtkAppChooserWidget, ownedRef);
}
// add the AppChooser capabilities
mixin AppChooserT!(GtkAppChooserWidget);
/** */
public static GType getType()
{
return gtk_app_chooser_widget_get_type();
}
/**
* Creates a new #GtkAppChooserWidget for applications
* that can handle content of the given type.
*
* Params:
* contentType = the content type to show applications for
*
* Returns: a newly created #GtkAppChooserWidget
*
* Since: 3.0
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string contentType)
{
auto p = gtk_app_chooser_widget_new(Str.toStringz(contentType));
if(p is null)
{
throw new ConstructionException("null returned by new");
}
this(cast(GtkAppChooserWidget*) p);
}
/**
* Returns the text that is shown if there are not applications
* that can handle the content type.
*
* Returns: the value of #GtkAppChooserWidget:default-text
*
* Since: 3.0
*/
public string getDefaultText()
{
return Str.toString(gtk_app_chooser_widget_get_default_text(gtkAppChooserWidget));
}
/**
* Returns the current value of the #GtkAppChooserWidget:show-all
* property.
*
* Returns: the value of #GtkAppChooserWidget:show-all
*
* Since: 3.0
*/
public bool getShowAll()
{
return gtk_app_chooser_widget_get_show_all(gtkAppChooserWidget) != 0;
}
/**
* Returns the current value of the #GtkAppChooserWidget:show-default
* property.
*
* Returns: the value of #GtkAppChooserWidget:show-default
*
* Since: 3.0
*/
public bool getShowDefault()
{
return gtk_app_chooser_widget_get_show_default(gtkAppChooserWidget) != 0;
}
/**
* Returns the current value of the #GtkAppChooserWidget:show-fallback
* property.
*
* Returns: the value of #GtkAppChooserWidget:show-fallback
*
* Since: 3.0
*/
public bool getShowFallback()
{
return gtk_app_chooser_widget_get_show_fallback(gtkAppChooserWidget) != 0;
}
/**
* Returns the current value of the #GtkAppChooserWidget:show-other
* property.
*
* Returns: the value of #GtkAppChooserWidget:show-other
*
* Since: 3.0
*/
public bool getShowOther()
{
return gtk_app_chooser_widget_get_show_other(gtkAppChooserWidget) != 0;
}
/**
* Returns the current value of the #GtkAppChooserWidget:show-recommended
* property.
*
* Returns: the value of #GtkAppChooserWidget:show-recommended
*
* Since: 3.0
*/
public bool getShowRecommended()
{
return gtk_app_chooser_widget_get_show_recommended(gtkAppChooserWidget) != 0;
}
/**
* Sets the text that is shown if there are not applications
* that can handle the content type.
*
* Params:
* text = the new value for #GtkAppChooserWidget:default-text
*/
public void setDefaultText(string text)
{
gtk_app_chooser_widget_set_default_text(gtkAppChooserWidget, Str.toStringz(text));
}
/**
* Sets whether the app chooser should show all applications
* in a flat list.
*
* Params:
* setting = the new value for #GtkAppChooserWidget:show-all
*
* Since: 3.0
*/
public void setShowAll(bool setting)
{
gtk_app_chooser_widget_set_show_all(gtkAppChooserWidget, setting);
}
/**
* Sets whether the app chooser should show the default handler
* for the content type in a separate section.
*
* Params:
* setting = the new value for #GtkAppChooserWidget:show-default
*
* Since: 3.0
*/
public void setShowDefault(bool setting)
{
gtk_app_chooser_widget_set_show_default(gtkAppChooserWidget, setting);
}
/**
* Sets whether the app chooser should show related applications
* for the content type in a separate section.
*
* Params:
* setting = the new value for #GtkAppChooserWidget:show-fallback
*
* Since: 3.0
*/
public void setShowFallback(bool setting)
{
gtk_app_chooser_widget_set_show_fallback(gtkAppChooserWidget, setting);
}
/**
* Sets whether the app chooser should show applications
* which are unrelated to the content type.
*
* Params:
* setting = the new value for #GtkAppChooserWidget:show-other
*
* Since: 3.0
*/
public void setShowOther(bool setting)
{
gtk_app_chooser_widget_set_show_other(gtkAppChooserWidget, setting);
}
/**
* Sets whether the app chooser should show recommended applications
* for the content type in a separate section.
*
* Params:
* setting = the new value for #GtkAppChooserWidget:show-recommended
*
* Since: 3.0
*/
public void setShowRecommended(bool setting)
{
gtk_app_chooser_widget_set_show_recommended(gtkAppChooserWidget, setting);
}
protected class OnApplicationActivatedDelegateWrapper
{
void delegate(AppInfoIF, AppChooserWidget) dlg;
gulong handlerId;
this(void delegate(AppInfoIF, AppChooserWidget) dlg)
{
this.dlg = dlg;
onApplicationActivatedListeners ~= this;
}
void remove(OnApplicationActivatedDelegateWrapper source)
{
foreach(index, wrapper; onApplicationActivatedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onApplicationActivatedListeners[index] = null;
onApplicationActivatedListeners = std.algorithm.remove(onApplicationActivatedListeners, index);
break;
}
}
}
}
OnApplicationActivatedDelegateWrapper[] onApplicationActivatedListeners;
/**
* Emitted when an application item is activated from the widget's list.
*
* This usually happens when the user double clicks an item, or an item
* is selected and the user presses one of the keys Space, Shift+Space,
* Return or Enter.
*
* Params:
* application = the activated #GAppInfo
*/
gulong addOnApplicationActivated(void delegate(AppInfoIF, AppChooserWidget) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnApplicationActivatedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"application-activated",
cast(GCallback)&callBackApplicationActivated,
cast(void*)wrapper,
cast(GClosureNotify)&callBackApplicationActivatedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackApplicationActivated(GtkAppChooserWidget* appchooserwidgetStruct, GAppInfo* application, OnApplicationActivatedDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(AppInfoIF)(application), wrapper.outer);
}
extern(C) static void callBackApplicationActivatedDestroy(OnApplicationActivatedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnApplicationSelectedDelegateWrapper
{
void delegate(AppInfoIF, AppChooserWidget) dlg;
gulong handlerId;
this(void delegate(AppInfoIF, AppChooserWidget) dlg)
{
this.dlg = dlg;
onApplicationSelectedListeners ~= this;
}
void remove(OnApplicationSelectedDelegateWrapper source)
{
foreach(index, wrapper; onApplicationSelectedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onApplicationSelectedListeners[index] = null;
onApplicationSelectedListeners = std.algorithm.remove(onApplicationSelectedListeners, index);
break;
}
}
}
}
OnApplicationSelectedDelegateWrapper[] onApplicationSelectedListeners;
/**
* Emitted when an application item is selected from the widget's list.
*
* Params:
* application = the selected #GAppInfo
*/
gulong addOnApplicationSelected(void delegate(AppInfoIF, AppChooserWidget) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnApplicationSelectedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"application-selected",
cast(GCallback)&callBackApplicationSelected,
cast(void*)wrapper,
cast(GClosureNotify)&callBackApplicationSelectedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackApplicationSelected(GtkAppChooserWidget* appchooserwidgetStruct, GAppInfo* application, OnApplicationSelectedDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(AppInfoIF)(application), wrapper.outer);
}
extern(C) static void callBackApplicationSelectedDestroy(OnApplicationSelectedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnPopulatePopupDelegateWrapper
{
void delegate(Menu, AppInfoIF, AppChooserWidget) dlg;
gulong handlerId;
this(void delegate(Menu, AppInfoIF, AppChooserWidget) dlg)
{
this.dlg = dlg;
onPopulatePopupListeners ~= this;
}
void remove(OnPopulatePopupDelegateWrapper source)
{
foreach(index, wrapper; onPopulatePopupListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onPopulatePopupListeners[index] = null;
onPopulatePopupListeners = std.algorithm.remove(onPopulatePopupListeners, index);
break;
}
}
}
}
OnPopulatePopupDelegateWrapper[] onPopulatePopupListeners;
/**
* Emitted when a context menu is about to popup over an application item.
* Clients can insert menu items into the provided #GtkMenu object in the
* callback of this signal; the context menu will be shown over the item
* if at least one item has been added to the menu.
*
* Params:
* menu = the #GtkMenu to populate
* application = the current #GAppInfo
*/
gulong addOnPopulatePopup(void delegate(Menu, AppInfoIF, AppChooserWidget) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnPopulatePopupDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"populate-popup",
cast(GCallback)&callBackPopulatePopup,
cast(void*)wrapper,
cast(GClosureNotify)&callBackPopulatePopupDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackPopulatePopup(GtkAppChooserWidget* appchooserwidgetStruct, GtkMenu* menu, GAppInfo* application, OnPopulatePopupDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(Menu)(menu), ObjectG.getDObject!(AppInfoIF)(application), wrapper.outer);
}
extern(C) static void callBackPopulatePopupDestroy(OnPopulatePopupDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
}
|