text:
// Type definitions for GoldenLayout v1.5.x
// Project: https://golden-layout.com/

declare class GoldenLayout {
    /**
     * The topmost item in the layout item tree. In browser terms: Think of the GoldenLayout instance as window
     * object and of goldenLayout.root as the document.
     */
    root: GoldenLayout.ContentItem;

    /**
     * A reference to the (jQuery) DOM element containing the layout
     */
    container: JQuery;

    /**
     * True once the layout item tree has been created and the initialised event has been fired
     */
    isInitialised: boolean;

    /**
     * A reference to the current, extended top level config.
     *
     * Don't rely on this object for state saving / serialisation. Use layout.toConfig() instead.
     */
    config: GoldenLayout.Config;

    /**
     * The currently selected item or null if no item is selected. Only relevant if settings.selectionEnabled is set
     * to true.
     */
    selectedItem: GoldenLayout.ContentItem;

    /**
     * The current outer width of the layout in pixels.
     */
    width: number;

    /**
     * The current outer height of the layout in pixels.
     */
    height: number;

    /**
     * An array of BrowserWindow instances
     */
    openPopouts: GoldenLayout.BrowserWindow[];

    /**
     * True if the layout has been opened as a popout by another layout.
     */
    isSubWindow: boolean;

    /**
     * A singleton instance of EventEmitter that works across windows
     */
    eventHub: GoldenLayout.EventEmitter;

    /**
     * @param config A GoldenLayout configuration object
     * @param container The DOM element the layout will be initialised in. Default: document.body
     */
    constructor(configuration: GoldenLayout.Config, container?: HTMLElement | JQuery);

    /*
     * @param name 	The name of the component, as referred to by componentName in the component configuration.
     * @param component 	A constructor or factory function. Will be invoked with new and two arguments, a
     *                      containerobject and a component state
     */
    registerComponent(name: String, component: any): void;

    /**
     * Renders the layout into the container. If init() is called before the document is ready it attaches itself as
     * a listener to the document and executes once it becomes ready.
     */
    init(): void;

    /**
     * Returns the current state of the layout and its components as a serialisable object.
     */
    toConfig(): any;

    /**
     * Returns a component that was previously registered with layout.registerComponent().
     * @param name The name of a previously registered component
     */
    getComponent(name: string): any;

    /**
     * Resizes the layout. If no arguments are provided GoldenLayout measures its container and resizes accordingly.
     * @param width The outer width the layout should be resized to. Default: The container elements width
     * @param height The outer height the layout should be resized to. Default: The container elements height
     */
    updateSize(width?: number, height?: number): void;

    /**
     * Destroys the layout. Recursively calls destroy on all components and content items, removes all event
     * listeners and finally removes itself from the DOM.
     */
    destroy(): void;

    /**
     * Creates a new content item or tree of content items from configuration. Usually you wouldn't call this
     * directly, but instead use methods like layout.createDragSource(), item.addChild() or item.replaceChild() that
     * all call this method implicitly.
     * @param itemConfiguration An item configuration (can be an entire tree of items)
     * @param parent A parent item
     */
    createContentItem(itemConfiguration?: GoldenLayout.ItemConfigType, parent?: GoldenLayout.ContentItem): void;

    /**
     * Creates a new popout window with configOrContentItem as contents at the position specified in dimensions
     * @param configOrContentItem   The content item or config that will be created in the new window. If a item is
     *                              provided its config will be read, if config is provided, only the content key
     *                              will be used
     * @param dimensions    A map containing the keys left, top, width and height. Left and top can be negative to
     *                      place the window in another screen.
     * @param parentId  The id of the item within the current layout the child window's content will be appended to
     *                  when popIn is clicked
     * @param indexInParent The index at which the child window's contents will be appended to. Default: null
     */
    createPopout(configOrContentItem: GoldenLayout.ItemConfigType | GoldenLayout.ContentItem,
                 dimensions: {width: number, height: number, left: number, top: number}, parentId?: string,
                 indexInParent?: number): void;

    /**
     * Turns a DOM element into a dragSource, meaning that the user can drag the element directly onto the layout
     * where it turns into a contentItem.
     * @param element The DOM element that will be turned into a dragSource
     * @param itemConfiguration An item configuration (can be an entire tree of items)
     */
    createDragSource(element: HTMLElement | JQuery, itemConfiguration: GoldenLayout.ItemConfigType): void;

    /**
     * If settings.selectionEnabled is set to true, this allows to select items programmatically.
     * @param contentItem A ContentItem instance
     */
    selectItem(contentItem: GoldenLayout.ContentItem): void;

    /**
     * Static method on the GoldenLayout constructor! This method will iterate through a GoldenLayout config object
     * and replace frequent keys and values with single letter substitutes.
     * @param config A GoldenLayout configuration object
     */
    static minifyConfig(config: any): any;

    /**
     * Static method on the GoldenLayout constructor! This method will reverse the minifications of GoldenLayout.minifyConfig.
     * @param minifiedConfig A minified GoldenLayout configuration object
     */
    static unminifyConfig(minifiedConfig : any): any;
}

declare namespace GoldenLayout {

    export type ItemConfigType = ItemConfig | ComponentConfig | ReactComponentConfig;

    export interface Settings {
        /**
         * Turns headers on or off. If false, the layout will be displayed with splitters only.
         * Default: true
         */
        hasHeaders?: boolean;

        /**
         * Constrains the area in which items can be dragged to the layout's container. Will be set to false
         * automatically when layout.createDragSource() is called.
         * Default: true
         */
        constrainDragToContainer?: boolean;

        /**
         * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.
         * Default: true
         */
        reorderEnabled?: boolean;

        /**
         * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to
         * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.
         * Default: false
         */
        selectionEnabled?: boolean;

        /**
         * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will
         * be transferred to the new window, if false only the active component will be opened.
         * Default: false
         */
        popoutWholeStack?: boolean;

        /**
         * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).
         * If false, the popout call will fail silently.
         * Default: true
         */
        blockedPopoutsThrowError?: boolean;

        /**
         * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a
         * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In
         * addition, any changes made to popouts won't be stored after the parent is closed.
         * Default: true
         */
        closePopoutsOnUnload?: boolean;

        /**
         * Specifies if the popout icon should be displayed in the header-bar.
         * Default: true
         */
        showPopoutIcon?: boolean;

        /**
         * Specifies if the maximise icon should be displayed in the header-bar.
         * Default: true
         */
        showMaximiseIcon: boolean;

        /**
         * Specifies if the close icon should be displayed in the header-bar.
         * Default: true
         */
        showCloseIcon: boolean;
    }

    export interface Dimensions {
        /**
         * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider
         * than the visible one, making it safe to set this to small values without affecting usability.
         * Default: 5
         */
        borderWidth?: number;

        /**
         * The minimum height an item can be resized to (in pixel).
         * Default: 10
         */
        minItemHeight?: number;

        /**
         * The minimum width an item can be resized to (in pixel).
         * Default: 10
         */
        minItemWidth?: number;

        /**
         * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be
         * adjusted accordingly.
         * Default: 20
         */
        headerHeight?: number;

        /**
         * The width of the element that appears when an item is dragged (in pixel).
         * Default: 300
         */
        dragProxyWidth?:	number;

        /**
         * The height of the element that appears when an item is dragged (in pixel).
         * Default: 200
         */
        dragProxyHeight?: number;
    }

    export interface Labels {
        /**
         * The tooltip text that appears when hovering over the close icon.
         * Default: 'close'
         */
        close?: string;

        /**
         * The tooltip text that appears when hovering over the maximise icon.
         * Default: 'maximise'
         */
        maximise?: string;

        /**
         * The tooltip text that appears when hovering over the minimise icon.
         * Default: 'minimise'
         */
        minimise?: string;

        /**
         * The tooltip text that appears when hovering over the popout icon.
         * Default: 'open in new window'
         */
        popout?: string;
    }

    export interface ItemConfig {
        /**
         * The type of the item. Possible values are 'row', 'column', 'stack', 'component' and 'react-component'.
         */
        type: string;

        /**
         * An array of configurations for items that will be created as children of this item.
         */
        content?: ItemConfigType[];

        /**
         * The width of this item, relative to the other children of its parent in percent
         */
        width?: number;

        /**
         * The height of this item, relative to the other children of its parent in percent
         */
        height?: number;

        /**
         * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()
         */
        id?: string | string[];

        /**
         * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()
         * will return false
         * Default: true
         */
        isClosable?: boolean;

        /**
         * The title of the item as displayed on its tab and on popout windows
         * Default: componentName or ''
         */
        title?: string;
    }

    export interface ComponentConfig extends ItemConfig {
        /**
         * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.
         */
        componentName: string;

        /**
         * A serialisable object. Will be passed to the component constructor function and will be the value returned by
         * container.getState().
         */
        componentState?: any;
    }

    export interface ReactComponentConfig extends ItemConfig {
        /**
         * The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'
         */
        component: string;

        /**
         * Properties that will be passed to the component and accessible using this.props.
         */
        props?: any;
    }

    export interface Config {
        settings?: Settings;
        dimensions?: Dimensions;
        labels?: Labels;
        content: ItemConfigType[];
    }

    export interface ContentItem extends EventEmitter {
        /**
         * This items configuration in its current state
         */
        config: ItemConfigType;

        /**
         * The type of the item. Can be row, column, stack, component or root
         */
        type: string;

        /**
         * An array of items that are children of this item
         */
        contentItems: ContentItem[];

        /**
         * The item that is this item's parent (or null if the item is root)
         */
        parent: ContentItem;

        /**
         * A String or array of identifiers if provided in the configuration
         */
        id: string;

        /**
         * True if the item had been initialised
         */
        isInitialised: boolean;

        /**
         * True if the item is maximised
         */
        isMaximised: boolean;

        /**
         * True if the item is the layout's root item
         */
        isRoot: boolean;

        /**
         * True if the item is a row
         */
        isRow: boolean;

        /**
         * True if the item is a column
         */
        isColumn: boolean;

        /**
         * True if the item is a stack
         */
        isStack: boolean;

        /**
         * True if the item is a component
         */
        isComponent: boolean;

        /**
         * A reference to the layoutManager that controls this item
         */
        layoutManager: any;

        /**
         * The item's outer element
         */
        element: Container;

        /**
         * The item's inner element. Can be the same as the outer element.
         */
        childElementContainer: Container;

        /**
         * Adds an item as a child to this item. If the item is already a part of a layout it will be removed
         * from its original position before adding it to this item.
         * @param itemOrItemConfig A content item (or tree of content items) or an ItemConfiguration to create the item from
         * @param index last index  An optional index that determines at which position the new item should be added. Default: last index.
         */
        addChild(itemOrItemConfig: ContentItem | ItemConfigType, index?: number): void;

        /**
         * Destroys the item and all it's children
         * @param contentItem The contentItem that should be removed
         * @param keepChild If true the item won't be destroyed. (Use cautiosly, if the item isn't destroyed it's up to you to destroy it later). Default: false.
         */
        removeChild(contentItem: Config, keepChild?: boolean ): void;

        /**
         * The contentItem that should be removed
         * @param oldChild	ContentItem The contentItem that should be removed
         * @param newChild A content item (or tree of content items) or an ItemConfiguration to create the item from
         */
        replaceChild(oldChild: ContentItem, newChild: ContentItem | ItemConfigType ): void;

        /**
         * Updates the items size. To actually assign a new size from within a component, use container.setSize( width, height )
         */
        setSize(): void;

        /**
         * Sets the item's title to the provided value. Triggers titleChanged and stateChanged events
         * @param title the new title
         */
        setTitle(title: string): void;

        /**
         * A powerful, yet admittedly confusing method to recursively call methods on items in a tree. Usually you wouldn't need
         * to use it directly, but it's used internally to setSizes, destroy parts of the item tree etc.
         * @param functionName The name of the method to invoke
         * @param functionArguments An array of arguments to pass to every function
         * @param bottomUp If true, the method is invoked on the lowest parts of the tree first and then bubbles upwards. Default: false
         * @param skipSelf If true, the method will only be invoked on the item's children, but not on the item itself. Default: false
         */
        callDownwards(functionName: string, functionArguments?: any[], bottomUp?: boolean, skipSelf?: boolean): void;

        /**
         * Emits an event that bubbles up the item tree until it reaches the root element (and after a delay the layout manager). Useful e.g. for indicating state changes.
         */
        emitBubblingEvent(name: string): void;

        /**
         * Convenience method for item.parent.removeChild( item )
         */
        remove(): void;

        /**
         * Removes the item from its current position in the layout and opens it in a window
         */
        popout(): BrowserWindow;

        /**
         * Maximises the item or minimises it if it's already maximised
         */
        toggleMaximise(): void;

        /**
         * Selects the item. Only relevant if settings.selectionEnabled is set to true
         */
        select(): void;

        /**
         * Unselects the item. Only relevant if settings.selectionEnabled is set to true
         */
        deselect(): void;

        /**
         * Returns true if the item has the specified id or false if not
         * @param id An id to check for
         */
        hasId(id: string): boolean;

        /**
         * Only Stacks have this method! It's the programmatical equivalent of clicking a tab.
         * @param contentItem The new active content item
         */
        setActiveContentItem(contentItem: ContentItem): void;

        /**
         * Only Stacks have this method! Returns the currently selected contentItem.
         */
        getActiveContentItem(): ContentItem;

        /**
         * Adds an id to an item or does nothing if the id is already present
         * @param id The id to be added
         */
        addId(id: string): void;

        /**
         * Removes an id from an item or throws an error if the id couldn't be found
         * @param id The id to be removed
         */
        removeId(id: string): void;

        /**
         * Calls filterFunction recursively for every item in the tree. If the function returns true the item is added to the resulting array
         * @param filterFunction A function that determines whether an item matches certain criteria
         */
        getItemsByFilter(filterFunction: (contentItem: ContentItem) => boolean): ContentItem[];

        /**
         * Returns all items with the specified id.
         * @param id An id specified in the itemConfig
         */
        getItemsById(id: string | string[]): ContentItem[];

        /**
         * Returns all items with the specified type
         * @param type 'row', 'column', 'stack', 'component' or 'root'
         */
        getItemsByType(type: string): ContentItem[];

        /**
         * Returns all instances of the component with the specified componentName
         * @param componentName a componentName as specified in the itemConfig
         */
        getComponentsByName(componentName: string): any;

    }

    export interface Container extends EventEmitter {
        /**
         * The current width of the container in pixel
         */
        width: number;

        /**
         * The current height of the container in pixel
         */
        height: number;

        /**
         * A reference to the component-item that controls this container
         */
        parent: ContentItem;

        /**
         * A reference to the tab that controls this container. Will initially be null
         * (and populated once a tab event has been fired).
         */
        tab: Tab;

        /**
         * The current title of the container
         */
        title: string;

        /*
         * A reference to the GoldenLayout instance this container belongs to
         */
        layoutManager: GoldenLayout;

        /**
         * True if the item is currently hidden
         */
        isHidden: boolean;

        /**
         * Overwrites the components state with the provided value. To only change parts of the componentState see
         * extendState below. This is the main mechanism for saving the state of a component. This state will be the
         * value of componentState when layout.toConfig() is called and will be passed back to the component's
         * constructor function. It will also be used when the component is opened in a new window.
         * @param state A serialisable object
         */
        setState(state: any): void;

        /**
         * This is similar to setState, but merges the provided state into the current one, rather than overwriting it.
         * @param state A serialisable object
         */
        extendState(state: any): void;

        /**
         * Returns the current state.
         */
        getState(): any;

        /**
         * Returns the container's inner element as a jQuery element
         */
        getElement(): JQuery;

        /**
         * hides the container or returns false if hiding it is not possible
         */
        hide(): boolean;

        /**
         * shows the container or returns false if showing it is not possible
         */
        show(): boolean;

        /**
         * Sets the container to the specified size or returns false if that's not possible
         * @param width the new width in pixel
         * @param height the new height in pixel
         */
        setSize(width: number, height: number): boolean;

        /**
         * Sets the item's title to the provided value. Triggers titleChanged and stateChanged events
         * @param title the new title
         */
        setTitle(title: string): void;

        /**
         * Closes the container or returns false if that is not possible
         */
        close(): boolean;
    }

    export interface BrowserWindow {

      /**
       * True if the window has been opened and its GoldenLayout instance initialised.
       */
      isInitialised: boolean;

      /**
       * Creates a window configuration object from the Popout.
       */
      toConfig(): {dimensions: {width: number, height: number, left: number, top: number}, content: Config, parentId: string, indexInParent: number};

      /**
       * Returns the GoldenLayout instance from the child window
       */
      getGlInstance(): GoldenLayout;

      /**
       * Returns the native Window object
       */
      getWindow(): Window;

      /**
       * Closes the popout
       */
      close(): void;

      /**
       * Returns the popout to its original position as specified in parentId and indexInParent
       */
       popIn(): void;
    }

    export interface Header {
      /**
       * A reference to the LayoutManager instance
       */
      layoutManager: GoldenLayout;

      /**
       * A reference to the Stack this Header belongs to
       */
      parent: ContentItem;

      /**
       * An array of the Tabs within this header
       */
      tabs: Tab[];

      /**
       * The currently selected activeContentItem
       */
      activeContentItem: ContentItem;

      /**
       * The outer (jQuery) DOM element of this Header
       */
      element: JQuery;

      /**
       * The (jQuery) DOM element containing the tabs
       */
      tabsContainer: JQuery;

      /**
       * The (jQuery) DOM element containing the close, maximise and popout button
       */
      controlsContainer: JQuery;

      /**
       * Hides the currently selected contentItem, shows the specified one and highlights its tab.
       * @param contentItem The content item that will be selected
       */
      setActiveContentItem(contentItem: ContentItem): void;

      /**
       * Creates a new tab and associates it with a content item
       * @param contentItem The content item the tab will be associated with
       * @param index A zero based index, specifying the position of the new tab
       */
      createTab(contentItem: ContentItem, index?: number): void;

      /**
       * Finds a tab by its contentItem and removes it
       * @param contentItem The content item the tab is associated with
       */
      removeTab(contentItem: ContentItem): void;
    }

    export interface Tab {

      /**
       * True if this tab is the selected tab
       */
      isActive: boolean;

      /**
       * A reference to the header this tab is a child of
       */
      header: Header;

      /**
       * A reference to the content item this tab relates to
       */
      contentItem: ContentItem;

      /**
       * The tabs outer (jQuery) DOM element
       */
      element: JQuery;

      /**
       * The (jQuery) DOM element containing the title
       */
      titleElement: JQuery;

      /**
       * The (jQuery) DOM element that closes the tab
       */
      closeElement: JQuery;

      /**
       * Sets the tab's title. Does not affect the contentItem's title!
       * @param title The new title
       */
      setTitle(title: string): void;

      /**
       * Sets this tab's active state. To programmatically switch tabs, use header.setActiveContentItem( item ) instead.
       * @param isActive Whether the tab is active
       */
      setActive(isActive: boolean): void;
    }

    export interface EventEmitter {
        /**
         * Subscribe to an event
         * @param eventName The name of the event to describe to
         * @param callback The function that should be invoked when the event occurs
         * @param context The value of the this pointer in the callback function
         */
        on(eventName: string, callback: Function, context?: any): void;

        /**
         * Notify listeners of an event and pass arguments along
         * @param eventName The name of the event to emit
         */
        emit(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;

        /**
         * Alias for emit
         */
        trigger(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;

        /**
         * Unsubscribes either all listeners if just an eventName is provided, just a specific callback if invoked with
         * eventName and callback or just a specific callback with a specific context if invoked with all three
         * arguments.
         * @param eventName The name of the event to unsubscribe from
         * @param callback The function that should be invoked when the event occurs
         * @param context The value of the this pointer in the callback function
         */
        unbind(eventName: string, callback?: Function, context?: any): void;

        /**
         * Alias for unbind
         */
        off(eventName: string, callback?: Function, context?: any): void;
    }
}

export = GoldenLayout;


text:
//===--- TemplateBase.cpp - Common template AST class implementation ------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements common classes used throughout C++ template
// representations.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/TemplateBase.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/Diagnostic.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallString.h"
#include <algorithm>
#include <cctype>

using namespace clang;

/// \brief Print a template integral argument value.
///
/// \param TemplArg the TemplateArgument instance to print.
///
/// \param Out the raw_ostream instance to use for printing.
static void printIntegral(const TemplateArgument &TemplArg,
                          raw_ostream &Out) {
  const ::clang::Type *T = TemplArg.getIntegralType().getTypePtr();
  const llvm::APSInt *Val = TemplArg.getAsIntegral();

  if (T->isBooleanType()) {
    Out << (Val->getBoolValue() ? "true" : "false");
  } else if (T->isCharType()) {
    const char Ch = Val->getZExtValue();
    Out << ((Ch == '\'') ? "'\\" : "'");
    Out.write_escaped(StringRef(&Ch, 1), /*UseHexEscapes=*/ true);
    Out << "'";
  } else {
    Out << Val->toString(10);
  }
}

//===----------------------------------------------------------------------===//
// TemplateArgument Implementation
//===----------------------------------------------------------------------===//

TemplateArgument TemplateArgument::CreatePackCopy(ASTContext &Context,
                                                  const TemplateArgument *Args,
                                                  unsigned NumArgs) {
  if (NumArgs == 0)
    return TemplateArgument(0, 0);

  TemplateArgument *Storage = new (Context) TemplateArgument [NumArgs];
  std::copy(Args, Args + NumArgs, Storage);
  return TemplateArgument(Storage, NumArgs);
}

bool TemplateArgument::isDependent() const {
  switch (getKind()) {
  case Null:
    llvm_unreachable("Should not have a NULL template argument");

  case Type:
    return getAsType()->isDependentType();

  case Template:
    return getAsTemplate().isDependent();

  case TemplateExpansion:
    return true;

  case Declaration:
    if (Decl *D = getAsDecl()) {
      if (DeclContext *DC = dyn_cast<DeclContext>(D))
        return DC->isDependentContext();
      return D->getDeclContext()->isDependentContext();
    }

    return false;

  case Integral:
    // Never dependent
    return false;

  case Expression:
    return (getAsExpr()->isTypeDependent() || getAsExpr()->isValueDependent());

  case Pack:
    for (pack_iterator P = pack_begin(), PEnd = pack_end(); P != PEnd; ++P) {
      if (P->isDependent())
        return true;
    }

    return false;
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

bool TemplateArgument::isInstantiationDependent() const {
  switch (getKind()) {
  case Null:
    llvm_unreachable("Should not have a NULL template argument");

  case Type:
    return getAsType()->isInstantiationDependentType();

  case Template:
    return getAsTemplate().isInstantiationDependent();

  case TemplateExpansion:
    return true;

  case Declaration:
    if (Decl *D = getAsDecl()) {
      if (DeclContext *DC = dyn_cast<DeclContext>(D))
        return DC->isDependentContext();
      return D->getDeclContext()->isDependentContext();
    }
    return false;

  case Integral:
    // Never dependent
    return false;

  case Expression:
    return getAsExpr()->isInstantiationDependent();

  case Pack:
    for (pack_iterator P = pack_begin(), PEnd = pack_end(); P != PEnd; ++P) {
      if (P->isInstantiationDependent())
        return true;
    }

    return false;
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

bool TemplateArgument::isPackExpansion() const {
  switch (getKind()) {
  case Null:
  case Declaration:
  case Integral:
  case Pack:
  case Template:
    return false;

  case TemplateExpansion:
    return true;

  case Type:
    return isa<PackExpansionType>(getAsType());

  case Expression:
    return isa<PackExpansionExpr>(getAsExpr());
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

bool TemplateArgument::containsUnexpandedParameterPack() const {
  switch (getKind()) {
  case Null:
  case Declaration:
  case Integral:
  case TemplateExpansion:
    break;

  case Type:
    if (getAsType()->containsUnexpandedParameterPack())
      return true;
    break;

  case Template:
    if (getAsTemplate().containsUnexpandedParameterPack())
      return true;
    break;

  case Expression:
    if (getAsExpr()->containsUnexpandedParameterPack())
      return true;
    break;

  case Pack:
    for (pack_iterator P = pack_begin(), PEnd = pack_end(); P != PEnd; ++P)
      if (P->containsUnexpandedParameterPack())
        return true;

    break;
  }

  return false;
}

llvm::Optional<unsigned> TemplateArgument::getNumTemplateExpansions() const {
  assert(Kind == TemplateExpansion);
  if (TemplateArg.NumExpansions)
    return TemplateArg.NumExpansions - 1;

  return llvm::Optional<unsigned>();
}

void TemplateArgument::Profile(llvm::FoldingSetNodeID &ID,
                               const ASTContext &Context) const {
  ID.AddInteger(Kind);
  switch (Kind) {
  case Null:
    break;

  case Type:
    getAsType().Profile(ID);
    break;

  case Declaration:
    ID.AddPointer(getAsDecl()? getAsDecl()->getCanonicalDecl() : 0);
    break;

  case Template:
  case TemplateExpansion: {
    TemplateName Template = getAsTemplateOrTemplatePattern();
    if (TemplateTemplateParmDecl *TTP
          = dyn_cast_or_null<TemplateTemplateParmDecl>(
                                                Template.getAsTemplateDecl())) {
      ID.AddBoolean(true);
      ID.AddInteger(TTP->getDepth());
      ID.AddInteger(TTP->getPosition());
      ID.AddBoolean(TTP->isParameterPack());
    } else {
      ID.AddBoolean(false);
      ID.AddPointer(Context.getCanonicalTemplateName(Template)
                                                          .getAsVoidPointer());
    }
    break;
  }

  case Integral:
    getAsIntegral()->Profile(ID);
    getIntegralType().Profile(ID);
    break;

  case Expression:
    getAsExpr()->Profile(ID, Context, true);
    break;

  case Pack:
    ID.AddInteger(Args.NumArgs);
    for (unsigned I = 0; I != Args.NumArgs; ++I)
      Args.Args[I].Profile(ID, Context);
  }
}

bool TemplateArgument::structurallyEquals(const TemplateArgument &Other) const {
  if (getKind() != Other.getKind()) return false;

  switch (getKind()) {
  case Null:
  case Type:
  case Declaration:
  case Expression:
  case Template:
  case TemplateExpansion:
    return TypeOrValue == Other.TypeOrValue;

  case Integral:
    return getIntegralType() == Other.getIntegralType() &&
           *getAsIntegral() == *Other.getAsIntegral();

  case Pack:
    if (Args.NumArgs != Other.Args.NumArgs) return false;
    for (unsigned I = 0, E = Args.NumArgs; I != E; ++I)
      if (!Args.Args[I].structurallyEquals(Other.Args.Args[I]))
        return false;
    return true;
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

TemplateArgument TemplateArgument::getPackExpansionPattern() const {
  assert(isPackExpansion());

  switch (getKind()) {
  case Type:
    return getAsType()->getAs<PackExpansionType>()->getPattern();

  case Expression:
    return cast<PackExpansionExpr>(getAsExpr())->getPattern();

  case TemplateExpansion:
    return TemplateArgument(getAsTemplateOrTemplatePattern());

  case Declaration:
  case Integral:
  case Pack:
  case Null:
  case Template:
    return TemplateArgument();
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

void TemplateArgument::print(const PrintingPolicy &Policy,
                             raw_ostream &Out) const {
  switch (getKind()) {
  case Null:
    Out << "<no value>";
    break;

  case Type: {
    PrintingPolicy SubPolicy(Policy);
    SubPolicy.SuppressStrongLifetime = true;
    std::string TypeStr;
    getAsType().getAsStringInternal(TypeStr, SubPolicy);
    Out << TypeStr;
    break;
  }

  case Declaration: {
    if (NamedDecl *ND = dyn_cast_or_null<NamedDecl>(getAsDecl())) {
      if (ND->getDeclName()) {
        Out << *ND;
      } else {
        Out << "<anonymous>";
      }
    } else {
      Out << "nullptr";
    }
    break;
  }

  case Template:
    getAsTemplate().print(Out, Policy);
    break;

  case TemplateExpansion:
    getAsTemplateOrTemplatePattern().print(Out, Policy);
    Out << "...";
    break;

  case Integral: {
    printIntegral(*this, Out);
    break;
  }

  case Expression:
    getAsExpr()->printPretty(Out, 0, Policy);
    break;

  case Pack:
    Out << "<";
    bool First = true;
    for (TemplateArgument::pack_iterator P = pack_begin(), PEnd = pack_end();
         P != PEnd; ++P) {
      if (First)
        First = false;
      else
        Out << ", ";

      P->print(Policy, Out);
    }
    Out << ">";
    break;
  }
}

//===----------------------------------------------------------------------===//
// TemplateArgumentLoc Implementation
//===----------------------------------------------------------------------===//

TemplateArgumentLocInfo::TemplateArgumentLocInfo() {
  memset((void*)this, 0, sizeof(TemplateArgumentLocInfo));
}

SourceRange TemplateArgumentLoc::getSourceRange() const {
  switch (Argument.getKind()) {
  case TemplateArgument::Expression:
    return getSourceExpression()->getSourceRange();

  case TemplateArgument::Declaration:
    return getSourceDeclExpression()->getSourceRange();

  case TemplateArgument::Type:
    if (TypeSourceInfo *TSI = getTypeSourceInfo())
      return TSI->getTypeLoc().getSourceRange();
    else
      return SourceRange();

  case TemplateArgument::Template:
    if (getTemplateQualifierLoc())
      return SourceRange(getTemplateQualifierLoc().getBeginLoc(),
                         getTemplateNameLoc());
    return SourceRange(getTemplateNameLoc());

  case TemplateArgument::TemplateExpansion:
    if (getTemplateQualifierLoc())
      return SourceRange(getTemplateQualifierLoc().getBeginLoc(),
                         getTemplateEllipsisLoc());
    return SourceRange(getTemplateNameLoc(), getTemplateEllipsisLoc());

  case TemplateArgument::Integral:
  case TemplateArgument::Pack:
  case TemplateArgument::Null:
    return SourceRange();
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

TemplateArgumentLoc
TemplateArgumentLoc::getPackExpansionPattern(SourceLocation &Ellipsis,
                                       llvm::Optional<unsigned> &NumExpansions,
                                             ASTContext &Context) const {
  assert(Argument.isPackExpansion());

  switch (Argument.getKind()) {
  case TemplateArgument::Type: {
    // FIXME: We shouldn't ever have to worry about missing
    // type-source info!
    TypeSourceInfo *ExpansionTSInfo = getTypeSourceInfo();
    if (!ExpansionTSInfo)
      ExpansionTSInfo = Context.getTrivialTypeSourceInfo(
                                                     getArgument().getAsType(),
                                                         Ellipsis);
    PackExpansionTypeLoc Expansion
      = cast<PackExpansionTypeLoc>(ExpansionTSInfo->getTypeLoc());
    Ellipsis = Expansion.getEllipsisLoc();

    TypeLoc Pattern = Expansion.getPatternLoc();
    NumExpansions = Expansion.getTypePtr()->getNumExpansions();

    // FIXME: This is horrible. We know where the source location data is for
    // the pattern, and we have the pattern's type, but we are forced to copy
    // them into an ASTContext because TypeSourceInfo bundles them together
    // and TemplateArgumentLoc traffics in TypeSourceInfo pointers.
    TypeSourceInfo *PatternTSInfo
      = Context.CreateTypeSourceInfo(Pattern.getType(),
                                     Pattern.getFullDataSize());
    memcpy(PatternTSInfo->getTypeLoc().getOpaqueData(),
           Pattern.getOpaqueData(), Pattern.getFullDataSize());
    return TemplateArgumentLoc(TemplateArgument(Pattern.getType()),
                               PatternTSInfo);
  }

  case TemplateArgument::Expression: {
    PackExpansionExpr *Expansion
      = cast<PackExpansionExpr>(Argument.getAsExpr());
    Expr *Pattern = Expansion->getPattern();
    Ellipsis = Expansion->getEllipsisLoc();
    NumExpansions = Expansion->getNumExpansions();
    return TemplateArgumentLoc(Pattern, Pattern);
  }

  case TemplateArgument::TemplateExpansion:
    Ellipsis = getTemplateEllipsisLoc();
    NumExpansions = Argument.getNumTemplateExpansions();
    return TemplateArgumentLoc(Argument.getPackExpansionPattern(),
                               getTemplateQualifierLoc(),
                               getTemplateNameLoc());

  case TemplateArgument::Declaration:
  case TemplateArgument::Template:
  case TemplateArgument::Integral:
  case TemplateArgument::Pack:
  case TemplateArgument::Null:
    return TemplateArgumentLoc();
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB,
                                           const TemplateArgument &Arg) {
  switch (Arg.getKind()) {
  case TemplateArgument::Null:
    // This is bad, but not as bad as crashing because of argument
    // count mismatches.
    return DB << "(null template argument)";

  case TemplateArgument::Type:
    return DB << Arg.getAsType();

  case TemplateArgument::Declaration:
    if (Decl *D = Arg.getAsDecl())
      return DB << D;
    return DB << "nullptr";

  case TemplateArgument::Integral:
    return DB << Arg.getAsIntegral()->toString(10);

  case TemplateArgument::Template:
    return DB << Arg.getAsTemplate();

  case TemplateArgument::TemplateExpansion:
    return DB << Arg.getAsTemplateOrTemplatePattern() << "...";

  case TemplateArgument::Expression: {
    // This shouldn't actually ever happen, so it's okay that we're
    // regurgitating an expression here.
    // FIXME: We're guessing at LangOptions!
    SmallString<32> Str;
    llvm::raw_svector_ostream OS(Str);
    LangOptions LangOpts;
    LangOpts.CPlusPlus = true;
    PrintingPolicy Policy(LangOpts);
    Arg.getAsExpr()->printPretty(OS, 0, Policy);
    return DB << OS.str();
  }

  case TemplateArgument::Pack: {
    // FIXME: We're guessing at LangOptions!
    SmallString<32> Str;
    llvm::raw_svector_ostream OS(Str);
    LangOptions LangOpts;
    LangOpts.CPlusPlus = true;
    PrintingPolicy Policy(LangOpts);
    Arg.print(Policy, OS);
    return DB << OS.str();
  }
  }

  llvm_unreachable("Invalid TemplateArgument Kind!");
}

const ASTTemplateArgumentListInfo *
ASTTemplateArgumentListInfo::Create(ASTContext &C,
                                    const TemplateArgumentListInfo &List) {
  std::size_t size = sizeof(CXXDependentScopeMemberExpr) +
                     ASTTemplateArgumentListInfo::sizeFor(List.size());
  void *Mem = C.Allocate(size, llvm::alignOf<ASTTemplateArgumentListInfo>());
  ASTTemplateArgumentListInfo *TAI = new (Mem) ASTTemplateArgumentListInfo();
  TAI->initializeFrom(List);
  return TAI;
}

void ASTTemplateArgumentListInfo::initializeFrom(
                                      const TemplateArgumentListInfo &Info) {
  LAngleLoc = Info.getLAngleLoc();
  RAngleLoc = Info.getRAngleLoc();
  NumTemplateArgs = Info.size();

  TemplateArgumentLoc *ArgBuffer = getTemplateArgs();
  for (unsigned i = 0; i != NumTemplateArgs; ++i)
    new (&ArgBuffer[i]) TemplateArgumentLoc(Info[i]);
}

void ASTTemplateArgumentListInfo::initializeFrom(
                                          const TemplateArgumentListInfo &Info,
                                                  bool &Dependent,
                                                  bool &InstantiationDependent,
                                       bool &ContainsUnexpandedParameterPack) {
  LAngleLoc = Info.getLAngleLoc();
  RAngleLoc = Info.getRAngleLoc();
  NumTemplateArgs = Info.size();

  TemplateArgumentLoc *ArgBuffer = getTemplateArgs();
  for (unsigned i = 0; i != NumTemplateArgs; ++i) {
    Dependent = Dependent || Info[i].getArgument().isDependent();
    InstantiationDependent = InstantiationDependent ||
                             Info[i].getArgument().isInstantiationDependent();
    ContainsUnexpandedParameterPack
      = ContainsUnexpandedParameterPack ||
        Info[i].getArgument().containsUnexpandedParameterPack();

    new (&ArgBuffer[i]) TemplateArgumentLoc(Info[i]);
  }
}

void ASTTemplateArgumentListInfo::copyInto(
                                      TemplateArgumentListInfo &Info) const {
  Info.setLAngleLoc(LAngleLoc);
  Info.setRAngleLoc(RAngleLoc);
  for (unsigned I = 0; I != NumTemplateArgs; ++I)
    Info.addArgument(getTemplateArgs()[I]);
}

std::size_t ASTTemplateArgumentListInfo::sizeFor(unsigned NumTemplateArgs) {
  return sizeof(ASTTemplateArgumentListInfo) +
         sizeof(TemplateArgumentLoc) * NumTemplateArgs;
}

void
ASTTemplateKWAndArgsInfo::initializeFrom(SourceLocation TemplateKWLoc,
                                         const TemplateArgumentListInfo &Info) {
  Base::initializeFrom(Info);
  setTemplateKeywordLoc(TemplateKWLoc);
}

void
ASTTemplateKWAndArgsInfo
::initializeFrom(SourceLocation TemplateKWLoc,
                 const TemplateArgumentListInfo &Info,
                 bool &Dependent,
                 bool &InstantiationDependent,
                 bool &ContainsUnexpandedParameterPack) {
  Base::initializeFrom(Info, Dependent, InstantiationDependent,
                       ContainsUnexpandedParameterPack);
  setTemplateKeywordLoc(TemplateKWLoc);
}

void
ASTTemplateKWAndArgsInfo::initializeFrom(SourceLocation TemplateKWLoc) {
  // No explicit template arguments, but template keyword loc is valid.
  assert(TemplateKWLoc.isValid());
  LAngleLoc = SourceLocation();
  RAngleLoc = SourceLocation();
  NumTemplateArgs = 0;
  setTemplateKeywordLoc(TemplateKWLoc);
}

std::size_t
ASTTemplateKWAndArgsInfo::sizeFor(unsigned NumTemplateArgs) {
  // Add space for the template keyword location.
  return Base::sizeFor(NumTemplateArgs) + sizeof(SourceLocation);
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

		<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>Mac OS X Server 10.4.5 update breaks RagePro</title>
	<link rel="stylesheet" type="text/css" href="http://jonsharp.net/assets/css/styles_feeling_responsive.css" />

    <link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic|Volkhov' rel='stylesheet' type='text/css' />

  <meta name="google-site-verification" content="Vk0IOJ2jwG_qEoG7fuEXYqv0m2rLa8P778Fi_GrsgEQ" />

	<meta name="description" content="Personal website of Jon Sharp - a Seventh-day Adventist Christian, family man, lover of the outdoors, technology leader, enterprise architect, embedded systems engineer, and retrocomputing enthusiast." />

	<link rel="icon" sizes="32x32" href="http://jonsharp.net/assets/img/favicon-32x32.png" />

	<link rel="icon" sizes="192x192" href="http://jonsharp.net/assets/img/touch-icon-192x192.png" />

	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="http://jonsharp.net/assets/img/apple-touch-icon-180x180-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="152x152" href="http://jonsharp.net/assets/img/apple-touch-icon-152x152-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://jonsharp.net/assets/img/apple-touch-icon-144x144-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="120x120" href="http://jonsharp.net/assets/img/apple-touch-icon-120x120-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://jonsharp.net/assets/img/apple-touch-icon-114x114-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="76x76" href="http://jonsharp.net/assets/img/apple-touch-icon-76x76-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://jonsharp.net/assets/img/apple-touch-icon-72x72-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" href="http://jonsharp.net/assets/img/apple-touch-icon-precomposed.png" />

	<meta name="msapplication-TileImage" content="http://jonsharp.net/assets/img/msapplication_tileimage.png" />

	<meta name="msapplication-TileColor" content="#fabb00" />

	<meta property="og:locale" content="en_EN" />
	<meta property="og:type" content="website" />
	<meta property="og:title" content="Mac OS X Server 10.4.5 update breaks RagePro" />
	<meta property="og:description" content="Personal website of Jon Sharp - a Seventh-day Adventist Christian, family man, lover of the outdoors, technology leader, enterprise architect, embedded systems engineer, and retrocomputing enthusiast." />
	<meta property="og:url" content="http://jonsharp.net//mac-os-x-server-1045-update-breaks-ragepro/" />
	<meta property="og:site_name" content="Jon Sharp, logged on the web" />

	<link type="text/plain" rel="author" href="http://jonsharp.net/humans.txt" />

 Jon Sharp, logged on the web

Navigation

Search

Contact

Home

                Projects

Gameboy

Laptop Art

Video Game Development

                Blog

Blog Archive

                Misc

Pinhoti Trail

Sun

Wishlist

Mac OS X Server 10.4.5 update breaks RagePro

I'm probably only one of 3 people crazy enough to run Tiger Server on Beige G3 hardware, but I figure I'll post this for those 2 others that may find this helpful.  I recently applied the 10.4.5 update and was disappointed to see that my screen blanked upon reboot.  As I am running VNC server on the box, I connected remotely to it to discover that the video was indeed messed up, even in VNC.  I had been avoiding the "Patched RagePro" driver provided by XPostFacto because I had seen some artifacts when using it before, but the update has forced me to check that checkbox in XPostFacto to get any video.  Of course, if I happen to notice too many artifacts, I suppose I can always install the 10.4.4 driver.

BTW, for anyone who may be curious about performance of Tiger Server on such old hardware, it's really not that bad.  I mean, it's useful for browsing, email, testing, etc.  I actually use it as a backup server.  It runs Bacula backup software and backs up my network computers to an externally attached FireWire HD.

				<time class="icon-calendar pr20" datetime="2006-02-28" itemprop="datePublished"> 2006-02-28</time>

« Pleased with AppleCare

Archive

To the top of Big Frog and back »

        

About This Site

              Personal website of Jon Sharp - a Seventh-day Adventist Christian, family man, lover of the outdoors, technology leader, enterprise architect, embedded systems engineer, and retrocomputing enthusiast.
              More ›

Services

                    Contact

                    RSS

                    Atom

                    sitemap.xml

Thank you

                  Icons by Daniel Bruce

                  Built on Foundation

                  Using Backstretch by Scott Robbin

              Created with ♥
              by Jon Sharp
              with Jekyll
              based on Feeling Responsive.


text: Called 'the new Einstein' he works on a new quantum-reality theory


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/authenticatorActivityLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    tools:context="com.lnikkila.oidcsample.oidc.authenticator.OIDCClientConfigurationActivity">
    <ScrollView
        android:id="@+id/clientFormLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="20dp"
        android:paddingBottom="20dp"
        android:paddingRight="10dp"
        android:paddingLeft="10dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="visible"
            android:orientation="vertical">

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/useOauth2Switch"
                android:theme="@style/Theme.OidcLib.Switch"
                android:text="@string/OIDCuserOAuth2OptionHint"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <android.support.design.widget.TextInputLayout
                android:id="@+id/clientIdInputLayout"
                app:hintTextAppearance="@style/Theme.OidcLib.TextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <com.lnikkila.oidc.minsdkcompat.CompatEditText
                    android:id="@+id/clientIdEditText"
                    android:theme="@style/Theme.OidcLib.EditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/OIDCClientIdOptionHint"
                    android:inputType="textNoSuggestions"
                    android:singleLine="true" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/clientSecretInputLayout"
                app:hintTextAppearance="@style/Theme.OidcLib.TextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <com.lnikkila.oidc.minsdkcompat.CompatEditText
                    android:id="@+id/clientSecretEditText"
                    android:theme="@style/Theme.OidcLib.EditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword"
                    android:hint="@string/OIDCSecretOptionHint"
                    android:singleLine="true" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/redirectUriInputLayout"
                app:hintTextAppearance="@style/Theme.OidcLib.TextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <com.lnikkila.oidc.minsdkcompat.CompatEditText
                    android:id="@+id/redirectUriEditText"
                    android:theme="@style/Theme.OidcLib.EditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textUri"
                    android:hint="@string/OIDCRedirectOptionHint"
                    android:singleLine="true" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/issuerInputLayout"
                app:hintTextAppearance="@style/Theme.OidcLib.TextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <com.lnikkila.oidc.minsdkcompat.CompatEditText
                    android:id="@+id/issuerEditText"
                    android:theme="@style/Theme.OidcLib.EditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textUri"
                    android:hint="@string/OIDCIssuerOptionHint"
                    android:singleLine="true" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/scopesInputLayout"
                app:hintTextAppearance="@style/Theme.OidcLib.TextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <com.lnikkila.oidc.minsdkcompat.CompatEditText
                    android:id="@+id/scopesEditText"
                    android:theme="@style/Theme.OidcLib.EditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text"
                    android:hint="@string/OIDCScopesOptionHint"
                    android:singleLine="true" />
            </android.support.design.widget.TextInputLayout>

            <Spinner
                android:id="@+id/flowTypeSpinner"
                android:theme="@style/Theme.OidcLib.SpinnerStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="15dp"
                android:spinnerMode="dialog"
                tools:ignore="UnusedAttribute" />

            <Button
                android:id="@+id/setOIDCClientButton"
                android:theme="@style/Theme.OidcLib.Button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/OIDCSetOptionsButton"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="15dp" />
        </LinearLayout>
    </ScrollView>
</RelativeLayout>


text:
export default { title: 'Toast Dialog' };

export const primaryAction = () => `

User Privacy Preferences

            <button class="icon-btn icon-btn--transparent toast-dialog__close" type="button" aria-label="Close notification dialog">
                <svg class="icon icon--close icon--close-small" focusable="false">
                    <use href="#icon-close-small"></use>
                </svg>
            </button>

We detected something unusual about a recent sign-in to your eBay account.
            To help keep you safe, we recommend you change the password.

            <button accesskey="a" class="btn btn--primary">Accept</button>

`;

export const secondaryAction = () => `

User Privacy Preferences

            <button class="icon-btn icon-btn--transparent toast-dialog__close" type="button" aria-label="Close notification dialog">
                <svg class="icon icon--close icon--close-small" focusable="false">
                    <use href="#icon-close-small"></use>
                </svg>
            </button>

We detected something unusual about a recent sign-in to your eBay account.
            To help keep you safe, we recommend you change the password.

            <button accesskey="d" class="btn btn--secondary">Dismiss</button>
            <button accesskey="a" class="btn btn--primary">Accept</button>

`;

export const RTL = () => `

User Privacy Preferences

                <button class="icon-btn icon-btn--transparent toast-dialog__close" type="button" aria-label="Close notification dialog">
                    <svg class="icon icon--close icon--close-small" focusable="false">
                        <use href="#icon-close-small"></use>
                    </svg>
                </button>

We detected something unusual about a recent sign-in to your eBay account.
                To help keep you safe, we recommend you change the password.

                <button accesskey="d" class="btn btn--secondary">Dismiss</button>
                <button accesskey="a" class="btn btn--primary">Accept</button>

`;


text:
package docker

import (
	"os"
	"path/filepath"
	"strings"

	"github.com/Scalingo/acadock-monitoring/config"
	"github.com/pkg/errors"
)

func ExpandId(id string) (string, error) {
	fullId, err := expandIdFromCache(id)
	if err == nil {
		return fullId, nil
	}
	if err != IdNotInCache {
		return "", errors.Wrap(err, "fail to expand id from cache")
	}

	dir := filepath.Dir(config.CgroupPath("memory", id))
	switch config.ENV["CGROUP_SOURCE"] {
	case "systemd":
		id, err = expandSystemdId(dir, id)
	case "docker":
		id, err = expandDockerId(dir, id)
	default:
		panic("not a known CGROUP SOURCE")
	}
	if err != nil {
		return "", errors.Wrapf(err, "fail to expand id from cgroup source %v", config.ENV["CGROUP_SOURCE"])
	}

	containerIdsCache = append(containerIdsCache, id)
	return id, nil
}

func expandSystemdId(dir, id string) (string, error) {
	d, err := os.Open(dir)
	if err != nil {
		return "", errors.Wrapf(err, "fail to open '%v'", dir)
	}
	files, err := d.Readdirnames(0)
	if err != nil {
		return "", errors.Wrapf(err, "fail to read directory entries of '%v'", dir)
	}
	d.Close()
	for _, f := range files {
		if len(f) < 32 {
			continue
		}
		fullId := f[7 : len(f)-6]
		if strings.HasPrefix(fullId, id) {
			return fullId, nil
		}
	}
	return "", errors.New("id not found")
}

func expandDockerId(dir, id string) (string, error) {
	d, err := os.Open(dir)
	if err != nil {
		return "", errors.Wrapf(err, "fail to open '%v'", dir)
	}
	files, err := d.Readdirnames(0)
	if err != nil {
		return "", errors.Wrapf(err, "fail to read directory entries of '%v'", dir)
	}
	d.Close()
	for _, f := range files {
		if strings.HasPrefix(f, id) {
			return f, nil
		}
	}
	return "", errors.New("id not found")
}