code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/* * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "ArrayBuffer.h" #include "JSArrayBufferView.h" #include "Operations.h" #include <wtf/RefPtr.h> namespace JSC { bool ArrayBuffer::transfer(ArrayBufferContents& result) { RefPtr<ArrayBuffer> keepAlive(this); if (!m_contents.m_data) { result.m_data = 0; return false; } bool isNeuterable = !m_pinCount; if (isNeuterable) m_contents.transfer(result); else { m_contents.copyTo(result); if (!result.m_data) return false; } for (size_t i = numberOfIncomingReferences(); i--;) { JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(incomingReferenceAt(i)); if (view) view->neuter(); } return true; } } // namespace JSC
KnightSwarm/WebKitTi
Source/JavaScriptCore/runtime/ArrayBuffer.cpp
C++
lgpl-2.1
2,115
//------------------------------------------------------------------------------ // <auto-generated> // Este código fue generado por una herramienta. // Versión de runtime: <..> // // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si // se vuelve a generar el código. // </auto-generated> //------------------------------------------------------------------------------ #if !BUILD_LAND_XML using System; using System.IO; using System.Text; using System.Collections.Generic; using XmlSchemaProcessor.Common; namespace XmlSchemaProcessor.LandXml10 { public enum CurbType { [StringValue("unknown")] Unknown, } } #endif
jlroviramartin/XsdProcessor
LandXml10/CurbType.cs
C#
lgpl-2.1
736
package de.softwareforge.eyewiki.auth.modules; /* * ======================================================================== * * eyeWiki - a WikiWiki clone written in Java * * ======================================================================== * * Copyright (C) 2005 Henning Schmiedehausen <henning@software-forge.com> * * based on * * JSPWiki - a JSP-based WikiWiki clone. * Copyright (C) 2002-2005 Janne Jalkanen (Janne.Jalkanen@iki.fi) * * ======================================================================== * * This program 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 2.1 of the License, or * (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * ======================================================================== */ import java.security.Principal; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import org.apache.log4j.Logger; import de.softwareforge.eyewiki.WikiContext; import de.softwareforge.eyewiki.WikiEngine; import de.softwareforge.eyewiki.WikiPage; import de.softwareforge.eyewiki.auth.NoSuchPrincipalException; import de.softwareforge.eyewiki.auth.UndefinedPrincipal; import de.softwareforge.eyewiki.auth.UserDatabase; import de.softwareforge.eyewiki.auth.UserProfile; import de.softwareforge.eyewiki.auth.WikiGroup; import de.softwareforge.eyewiki.auth.WikiPrincipal; import de.softwareforge.eyewiki.filters.BasicPageFilter; import de.softwareforge.eyewiki.filters.FilterManager; import de.softwareforge.eyewiki.filters.PageFilter; import de.softwareforge.eyewiki.providers.ProviderException; import org.picocontainer.Startable; /** * This default UserDatabase implementation provides user profiles and groups to eyeWiki. * * <p> * UserProfiles are simply created upon request, and cached locally. More intricate providers might look up profiles in a remote * DB, provide an unauthenticatable object for unknown users, etc. * </p> * * <p> * The authentication of a user is done elsewhere (see WikiAuthenticator); newly created profiles should have login status * UserProfile.NONE. * </p> * * <p> * Groups are based on WikiPages. The name of the page determines the group name (as a convention, we suggest the name of the page * ends in Group, e.g. EditorGroup). By setting attribute 'members' on the page, the named members are added to the group: * <pre> * [{SET members fee fie foe foo}] * </pre> * </p> * * <p> * The list of members can be separated by commas or spaces. * </p> * * <p> * TODO: are 'named members' supposed to be usernames, or are group names allowed? (Suggestion: both) * </p> */ public class WikiDatabase implements UserDatabase, Startable { /** DOCUMENT ME! */ private static final Logger log = Logger.getLogger(WikiDatabase.class); /** The attribute to set on a page - [{SET members ...}] - to define members of the group named by that page. */ public static final String ATTR_MEMBERLIST = "members"; /** DOCUMENT ME! */ private WikiEngine m_engine; /** DOCUMENT ME! */ private HashMap m_groupPrincipals = new HashMap(); /** DOCUMENT ME! */ private HashMap m_userPrincipals = new HashMap(); /** * DOCUMENT ME! * * @param engine DOCUMENT ME! * @param filterManager DOCUMENT ME! */ public WikiDatabase(WikiEngine engine, FilterManager filterManager) { m_engine = engine; filterManager.addPageFilter(new SaveFilter()); } /** * DOCUMENT ME! */ public synchronized void start() { initUserDatabase(); } /** * DOCUMENT ME! */ public synchronized void stop() { // GNDN } // This class must contain a large cache for user databases. // FIXME: Needs to cache this somehow; this is far too slow! public List getGroupsForPrincipal(Principal p) throws NoSuchPrincipalException { List memberList = new ArrayList(); if (log.isDebugEnabled()) { log.debug("Finding groups for " + p.getName()); } for (Iterator i = m_groupPrincipals.values().iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof WikiGroup) { if (log.isDebugEnabled()) { log.debug(" Checking group: " + o); } if (((WikiGroup) o).isMember(p)) { if (log.isDebugEnabled()) { log.debug(" Is member"); } memberList.add(o); } } else { if (log.isDebugEnabled()) { log.debug(" Found strange object: " + o.getClass()); } } } return memberList; } /** * List contains a bunch of Strings to denote members of this group. * * @param groupName DOCUMENT ME! * @param memberList DOCUMENT ME! */ protected void updateGroup(String groupName, List memberList) { WikiGroup group = (WikiGroup) m_groupPrincipals.get(groupName); if ((group == null) && (memberList == null)) { return; } if ((group == null) && (memberList != null)) { if (log.isDebugEnabled()) { log.debug("Adding new group: " + groupName); } group = new WikiGroup(); group.setName(groupName); } if ((group != null) && (memberList == null)) { if (log.isDebugEnabled()) { log.debug("Detected removed group: " + groupName); } m_groupPrincipals.remove(groupName); return; } for (Iterator j = memberList.iterator(); j.hasNext();) { Principal udp = new UndefinedPrincipal((String) j.next()); group.addMember(udp); if (log.isDebugEnabled()) { log.debug("** Added member: " + udp.getName()); } } m_groupPrincipals.put(groupName, group); } /** * DOCUMENT ME! */ protected void initUserDatabase() { log.info("Initializing user database group information from wiki pages..."); try { Collection allPages = m_engine.getPageManager().getAllPages(); m_groupPrincipals.clear(); for (Iterator i = allPages.iterator(); i.hasNext();) { WikiPage p = (WikiPage) i.next(); // lazy loading of pages with PageAuthorizer not possible, // because the authentication information must be // present on wiki initialization List memberList = parseMemberList((String) p.getAttribute(ATTR_MEMBERLIST)); if (memberList != null) { updateGroup(p.getName(), memberList); } } } catch (ProviderException e) { log.fatal("Cannot start database", e); } } /** * Stores a UserProfile with expiry information. * * @param name DOCUMENT ME! * @param p DOCUMENT ME! */ private void storeUserProfile(String name, UserProfile p) { m_userPrincipals.put(name, new TimeStampWrapper(p, 24 * 3600 * 1000)); } /** * Returns a stored UserProfile, taking expiry into account. * * @param name DOCUMENT ME! * * @return DOCUMENT ME! */ private UserProfile getUserProfile(String name) { TimeStampWrapper w = (TimeStampWrapper) m_userPrincipals.get(name); if ((w != null) && (w.expires() < System.currentTimeMillis())) { w = null; m_userPrincipals.remove(name); } if (w != null) { return ((UserProfile) w.getContent()); } return (null); } /** * Returns a principal; UserPrincipal storage is scanned first, then WikiGroup storage. If neither contains the requested * principal, a new (empty) UserPrincipal is returned. * * @param name DOCUMENT ME! * * @return DOCUMENT ME! */ public WikiPrincipal getPrincipal(String name) { // FIX: requests for non-existent users can now override groups. WikiPrincipal rval = (WikiPrincipal) getUserProfile(name); if (rval == null) { rval = (WikiPrincipal) m_groupPrincipals.get(name); } if (rval == null) { rval = new UserProfile(); rval.setName(name); // Store, to reduce creation overhead. Expire in one day. storeUserProfile(name, (UserProfile) rval); } return (rval); } /** * Parses through the member list of a page. * * @param memberLine DOCUMENT ME! * * @return DOCUMENT ME! */ private List parseMemberList(String memberLine) { if (memberLine == null) { return null; } if (log.isDebugEnabled()) { log.debug("Parsing member list: " + memberLine); } StringTokenizer tok = new StringTokenizer(memberLine, ", "); ArrayList members = new ArrayList(); while (tok.hasMoreTokens()) { String uid = tok.nextToken(); if (log.isDebugEnabled()) { log.debug(" Adding member: " + uid); } members.add(uid); } return members; } /** * This special filter class is used to refresh the database after a page has been changed. */ // FIXME: eyeWiki should really take care of itself that any metadata // relevant to a page is refreshed. private class SaveFilter extends BasicPageFilter implements PageFilter { /** * Creates a new SaveFilter object. */ private SaveFilter() { super(null); } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public int getPriority() { return PageFilter.MAX_PRIORITY; } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public boolean isVisible() { return false; } /** * DOCUMENT ME! * * @param context DOCUMENT ME! * @param content DOCUMENT ME! */ public void postSave(WikiContext context, String content) { WikiPage p = context.getPage(); if (log.isDebugEnabled()) { log.debug("Skimming through page " + p.getName() + " to see if there are new users..."); } m_engine.textToHTML(context, content); String members = (String) p.getAttribute(ATTR_MEMBERLIST); updateGroup(p.getName(), parseMemberList(members)); } } /** * DOCUMENT ME! * * @author $author$ * @version $Revision$ */ public static class TimeStampWrapper { /** DOCUMENT ME! */ private Object contained = null; /** DOCUMENT ME! */ private long expirationTime = -1; /** * Creates a new TimeStampWrapper object. * * @param item DOCUMENT ME! * @param expiresIn DOCUMENT ME! */ public TimeStampWrapper(Object item, long expiresIn) { contained = item; expirationTime = System.currentTimeMillis() + expiresIn; } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Object getContent() { return (contained); } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public long expires() { return (expirationTime); } } }
hgschmie/EyeWiki
src/java/de/softwareforge/eyewiki/auth/modules/WikiDatabase.java
Java
lgpl-2.1
12,920
/* * JBoss, Home of Professional Open Source * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors * as indicated by the @author tags. All rights reserved. * See the copyright.txt in the distribution for a * full listing of individual contributors. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU Lesser General Public License, v. 2.1. * This program is distributed in the hope that it will be useful, but WITHOUT A * 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, * v.2.1 along with this distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ package org.jboss.as.console.client.shared.subsys.activemq.model; import java.util.List; import org.jboss.as.console.client.widgets.forms.Address; import org.jboss.as.console.client.widgets.forms.Binding; /** * @author Heiko Braun * @date 5/10/11 */ @Address("/subsystem=messaging-activemq/server={0}/connection-factory={1}") public interface ActivemqConnectionFactory { @Binding(skip = true) String getName(); void setName(String name); @Binding(detypedName = "group-id") String getGroupId(); void setGroupId(String id); @Binding(listType="java.lang.String") List<String> getEntries(); void setEntries(List<String> jndiNames); @Binding(listType = "java.lang.String") List<String> getConnectors(); void setConnectors(List<String> connectors); @Binding(detypedName = "call-timeout") Long getCallTimeout(); void setCallTimeout(Long timeout); @Binding(detypedName = "min-large-message-size") Long getMinLargeMessageSize(); void setMinLargeMessageSize(Long size); @Binding(detypedName = "compress-large-messages") boolean isCompressLarge(); void setCompressLarge(boolean b); @Binding(detypedName = "connection-ttl") Long getConnectionTTL(); void setConnectionTTL(Long ttl); @Binding(detypedName = "failover-on-initial-connection") boolean isFailoverInitial(); void setFailoverInitial(boolean b); @Binding(detypedName = "connection-load-balancing-policy-class-name") String getLoadbalancingClassName(); void setLoadbalancingClassName(String name); @Binding(detypedName = "max-retry-interval") Long getMaxRetryInterval(); void setMaxRetryInterval(Long interval); @Binding(detypedName = "reconnect-attempts") Long getReconnectAttempts(); void setReconnectAttempts(Long numAttempts); @Binding(detypedName = "retry-interval") Long getRetryInterval(); void setRetryInterval(Long interval); @Binding(detypedName = "thread-pool-max-size") Long getThreadPoolMax(); void setThreadPoolMax(Long max); @Binding(detypedName = "transaction-batch-size") Long getTransactionBatchSize(); void setTransactionBatchSize(Long size); @Binding(detypedName = "use-global-pools") boolean isUseGlobalPools(); void setUseGlobalPools(boolean b); }
hal/core
gui/src/main/java/org/jboss/as/console/client/shared/subsys/activemq/model/ActivemqConnectionFactory.java
Java
lgpl-2.1
3,295
/*************************************************************************** * * Function: FR16_TO_FLOAT -- Convert a fract16 to a floating-point value * * Synopsis: * * #include <fract2float_conv.h> * float fr16_to_float(fract16 x); * * Description: * * The fr16_to_float converts a fixed-point, 16-bit fractional number * in 1.15 notation into a single precision, 32-bit IEEE floating-point * value; no precision is lost during the conversion. * * Algorithm: * * The traditional algorithm to convert a 1.15 fractional numbers to * floating-point value is: * * (float)(x) / 32768.0 * * However on Blackfin, floating-point division is relatively slow, * and one can alternatively adapt the algorithm for converting from * a short int to a float and then subtracting 15 from the exponent * to simulate a division by 32768.0. * * The following is a slower C implementation of this function: #include <fract2float_conv.h> extern float fr16_to_float(fract16 x) { float result = fabsf(x); int *presult = (int *)(&result); if (result != 0.0) { *presult = *ptemp - 0x07800000; if (x < 0) result = -result; } return result; } * * WARNING: This algorithm assumes that the floating-point number * representation is conformant with IEEE. * * Cycle Counts: * * 22 cycles when the input is 0 * 25 cycles for all other input * * These cycle counts were measured using the BF532 cycle accurate * simulator and include the overheads involved in calling the function * as well as the costs associated with argument passing. * * Code Size: * * 38 bytes * * Registers Used: * * R0 - the input argument and result * R1 - various * R2 - various * * Copyright (C) 2006 Analog Devices, Inc. * * ***************************************************************************/ .file "fr2fl.asm"; #if !defined(__NO_LIBRARY_ATTRIBUTES__) .file_attr libGroup = floating_point_support; .file_attr libGroup = integer_support; .file_attr libName = librt; .file_attr libName = librt_fileio; .file_attr libFunc = fr16_to_float; .file_attr libFunc = _fr16_to_float; .file_attr FuncName = _fr16_to_float; .file_attr prefersMem = internal; .file_attr prefersMemNum = "30"; #endif /* Macro Definitions (to calculate the exponent) */ #define EXP_BIAS (0x7F) #define SIGNBITS_BIAS (30) #define SIGNBITS_ADJ (6) #define DIVIDE_BY_2_POW_15 (15) #define EXP_FIELD_ADJ (1) /* EXP_BIAS is the constant that is applied to every binary exponent ** before it becomes part of an IEEE representation. After this ** has been applied, all exponents greater than EXP_BIAS will ** represent powers of 2 that are +ve, and all exponents less ** than EXP_BIAS will represent powers of 2 that are -ve. ** ** SIGNBITS_BIAS ** The result of the SIGNBITS instruction is subtracted from ** this constant to give the unbias'ed exponent of the floating- ** point number. ** ** SIGNBITS_ADJ ** The algorithm subtracts this from the result of SIGNBITS ** and so we have to factor this into the calculation of the ** exponent. ** ** DIVIDE_BY_2_POW_15 is set to the binary power of 32768.0 ** ** EXP_FIELD_ADJ ** The algorithm initializes the exponent field to 1 and so ** we have to compensate. */ #define EXP_ADJUST (EXP_BIAS \ + SIGNBITS_BIAS \ - SIGNBITS_ADJ \ - DIVIDE_BY_2_POW_15 \ - EXP_FIELD_ADJ) /* The exponent of the result is calculated by subtracting the ** result of the SIGNBITS instruction from this constant. ** ** EXP_ADJUST = 135 */ .text; .align 2; .global _fr16_to_float; _fr16_to_float: /* Test for Special Case: X == 0 */ CC = R0 == 0; IF CC JUMP .return; /* Jump and return 0 if X is zero */ /* The following algorithm contains four tricks: ** ** Trick [1]: ** This is not a trick but it is worth pointing out that no rounding is ** required because all of the bits in X can be represented in the result. ** ** Trick [2]: ** After normalizing X, use its MSB as the LSB of the exponent - this ** means that we do not have to arrange for this bit (which represents the ** hidden bit of an IEEE floating-point number) to be discarded. What we ** do is shift the bit into the LSB of the exponent field and then *add* ** the (suitably-adjusted) value of the exponent into this field. ** ** Trick [3]: ** Implement a floating-point divide by 32767.0 by subtracting 15 from ** the exponent of the dividend (because 2^15 == 32768.0); this trick ** is utilized while calculating the required value of the exponent. ** ** Trick [4]: ** This is a short-cut to adding the sign bit to the final result - a ** typical way of doing this would be to set the MSB of the result but ** only if the original argument was negative - this particular trick ** uses two instructions by utilizing the ROT(ate) instruction. We start ** by making sure that CC is set if the input argument is -ve; we then ** perform a 1-bit rotate to the right, which rotates the source register ** by copying the CC register to the MSB of the result and copying the ** LSB of the source register into the CC register. So for this trick ** to work, we shall have to set up the exponent field in bits 31-24 ** (rather than bits 30-23), and the mantissa in bits 23-1. ** So the algorithm works as follows: ** ** Step [1]: ** Normalizes (shifts) X so that the MSB is at bit 24 (ie 0x01000000) ** ** Step [2]: ** Calculates the value of the exponent minus 1 and shifts it 24 bits ** to the left (so that it occupies the most significant byte) ** ** Step [3]: ** Adds Step [1] and Step [2] ** ** Step [4]: ** Sets CC if X is negative ** ** Step [5]: ** Rotates Step [3] one place to the right */ R1 = ABS R0; /* Only work with +ve values */ CC = BITTST(R0,31); /* Record whether X is negative */ R2.L = SIGNBITS R1; /* Number of sign bits minus 1 */ R2 = R2.L; /* Note: ** ** Anomalies 05-00-209 and 05-00-127 require the input ** for the SIGNBITS instruction to be created more than ** one instruction earlier. Then convert the result from ** a short int to an int to allow us to perform arithmetic ** on it. */ R2 += -SIGNBITS_ADJ; /* See Trick [2] + [4] above */ R1 = LSHIFT R1 BY R2.L; /* See Step [1] */ /* Calculate the Exponent and Move it into Position (see Step [2]) */ R0 = EXP_ADJUST; R0 = R0 - R2; R0 <<= 24; /* Form the Result (see Step [3] and Trick [4]) */ R0 = R0 + R1; R0 = ROT R0 BY -1; .return: RTS; .size _fr16_to_float, .-_fr16_to_float
lumenosys/libbfdsp
libdsp/fr2fl.asm
Assembly
lgpl-2.1
7,322
# Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. import os, sys def open_in_browser(link): browser = os.environ.get('BROWSER', 'firefox') child = os.fork() if child == 0: # We are the child try: os.spawnlp(os.P_NOWAIT, browser, browser, link) os._exit(0) except Exception, ex: print >>sys.stderr, "Error", ex os._exit(1) os.waitpid(child, 0)
pombredanne/zero-install
zeroinstall/0launch-gui/browser.py
Python
lgpl-2.1
419
import { ClientRect } from '@ephox/dom-globals'; import { AlloyComponent } from '../../api/component/ComponentApi'; const top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height'; // Screen offsets from bounding client rect const getBounds = (component: AlloyComponent): ClientRect => component.element().dom().getBoundingClientRect(); const getBoundsProperty = (bounds: ClientRect, property: string): number => bounds[property]; const getMinXBounds = (component: AlloyComponent): number => { const bounds = getBounds(component); return getBoundsProperty(bounds, left); }; const getMaxXBounds = (component: AlloyComponent): number => { const bounds = getBounds(component); return getBoundsProperty(bounds, right); }; const getMinYBounds = (component: AlloyComponent): number => { const bounds = getBounds(component); return getBoundsProperty(bounds, top); }; const getMaxYBounds = (component: AlloyComponent): number => { const bounds = getBounds(component); return getBoundsProperty(bounds, bottom); }; const getXScreenRange = (component: AlloyComponent): number => { const bounds = getBounds(component); return getBoundsProperty(bounds, width); }; const getYScreenRange = (component: AlloyComponent): number => { const bounds = getBounds(component); return getBoundsProperty(bounds, height); }; const getCenterOffsetOf = (componentMinEdge: number, componentMaxEdge: number, spectrumMinEdge: number): number => (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; const getXCenterOffSetOf = (component: AlloyComponent, spectrum: AlloyComponent): number => { const componentBounds = getBounds(component); const spectrumBounds = getBounds(spectrum); const componentMinEdge = getBoundsProperty(componentBounds, left); const componentMaxEdge = getBoundsProperty(componentBounds, right); const spectrumMinEdge = getBoundsProperty(spectrumBounds, left); return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); }; const getYCenterOffSetOf = (component: AlloyComponent, spectrum: AlloyComponent): number => { const componentBounds = getBounds(component); const spectrumBounds = getBounds(spectrum); const componentMinEdge = getBoundsProperty(componentBounds, top); const componentMaxEdge = getBoundsProperty(componentBounds, bottom); const spectrumMinEdge = getBoundsProperty(spectrumBounds, top); return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); }; export { getMinXBounds, getMaxXBounds, getMinYBounds, getMaxYBounds, getXScreenRange, getYScreenRange, getXCenterOffSetOf, getYCenterOffSetOf };
FernCreek/tinymce
modules/alloy/src/main/ts/ephox/alloy/ui/slider/SliderOffsets.ts
TypeScript
lgpl-2.1
2,694
// // Bareflank Hypervisor // // Copyright (C) 2015 Assured Information Security, Inc. // Author: Rian Quinn <quinnr@ainfosec.com> // Author: Brendan Kerrigan <kerriganb@ainfosec.com> // // This library 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 2.1 of the License, or (at your option) any later version. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <test.h> misc_ut::misc_ut() { } bool misc_ut::init() { return true; } bool misc_ut::fini() { return true; } bool misc_ut::list() { this->test_error_codes_valid(); this->test_error_codes_unknown(); this->test_string_literal(); this->test_string_to_string(); this->test_vector_find(); this->test_vector_cfind(); this->test_vector_take(); this->test_vector_remove(); this->test_guard_exceptions_no_return(); this->test_guard_exceptions_with_return(); this->test_bitmanip_set_bit(); this->test_bitmanip_clear_bit(); this->test_bitmanip_get_bit(); this->test_bitmanip_is_bit_set(); this->test_bitmanip_is_bit_cleared(); this->test_bitmanip_num_bits_set(); this->test_bitmanip_get_bits(); this->test_bitmanip_set_bits(); this->test_exceptions(); this->test_upper(); this->test_lower(); return true; } int main(int argc, char *argv[]) { return RUN_ALL_TESTS(misc_ut); }
RicoAntonioFelix/hypervisor
bfvmm/src/misc/test/test.cpp
C++
lgpl-2.1
1,918
/* Copyright (C) 2009 Conrad Parker */ #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/sendfile.h> #include <fcntl.h> #include <pthread.h> #include <oggz/oggz.h> #include "http-reqline.h" #include "http-status.h" #include "params.h" #include "resource.h" #include "stream.h" #include "tempfd.h" /*#define DEBUG*/ #define DEFAULT_CONTENT_TYPE "application/ogg" #define x_strdup(s) ((s)?strdup((s)):(NULL)) struct header_tracker { long serialno; size_t num_headers; }; struct oggstdin { const char * path; const char * content_type; pthread_t main_thread; int active; struct ringbuffer rb; int headers_fd; size_t headers_len; /* pointer to current writeable position in headers */ int in_headers; list_t *header_tracker; OGGZ * oggz; }; static struct oggstdin oggstdin_pvt; static int oggstdin_read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * data) { struct oggstdin * st = (struct oggstdin *)data; if (ogg_page_bos(og)) { if (st->in_headers == 0) { st->headers_len = 0; lseek (st->headers_fd, 0, SEEK_SET); } ++st->in_headers; } if (st->in_headers) { list_t *list = st->header_tracker; while (list && ((struct header_tracker*)list->data)->serialno != serialno) list = list->next; if (!list) { struct header_tracker *ht = malloc(sizeof(struct header_tracker)); ht->serialno = serialno; ht->num_headers = 0; list = st->header_tracker = list_prepend(st->header_tracker, ht); } ((struct header_tracker*)list->data)->num_headers += ogg_page_packets (og); write (st->headers_fd, og->header, og->header_len); st->headers_len += og->header_len; write (st->headers_fd, og->body, og->body_len); st->headers_len += og->body_len; fsync (st->headers_fd); if (((struct header_tracker*)list->data)->num_headers >= oggz_stream_get_numheaders(oggz, serialno)) { --st->in_headers; } } else { ringbuffer_write (&st->rb, og->header, og->header_len); ringbuffer_write (&st->rb, og->body, og->body_len); } return (st->active ? OGGZ_CONTINUE : OGGZ_STOP_OK); } static void * oggstdin_main (void * data) { struct oggstdin * st = (struct oggstdin *)data; st->oggz = oggz_open_stdio (stdin, OGGZ_READ); oggz_set_read_page (st->oggz, -1, oggstdin_read_page, st); oggz_run (st->oggz); oggz_close (st->oggz); return NULL; } int oggstdin_run (void) { struct oggstdin *st = &oggstdin_pvt; return pthread_create (&st->main_thread, NULL, oggstdin_main, st); } void oggstdin_sighandler (void) { struct oggstdin *st = &oggstdin_pvt; st->active = 0; pthread_join (st->main_thread, NULL); } static int oggstdin_check (http_request * request, void * data) { struct oggstdin * st = (struct oggstdin *)data; return !strncmp (request->path, st->path, strlen(st->path)); } static void oggstdin_head (http_request * request, params_t * request_headers, const char ** status_line, params_t ** response_headers, void * data) { struct oggstdin * st = (struct oggstdin *)data; params_t * r = *response_headers; *status_line = http_status_line (HTTP_STATUS_OK); r = params_append (r, "Content-Type", st->content_type); } static void oggstdin_body (int fd, http_request * request, params_t * request_headers, void * data) { struct oggstdin * st = (struct oggstdin *)data; size_t n, avail; off_t offset=0; int rd; while (st->in_headers) { usleep (10000); } if ((n = sendfile (fd, st->headers_fd, &offset, st->headers_len)) == -1) { perror ("OggStdin body write"); return; } fsync (fd); rd = ringbuffer_open (&st->rb); while (st->active) { while ((avail = ringbuffer_avail (&st->rb, rd)) == 0) usleep (10000); #ifdef DEBUG if (avail != 0) printf ("stream_reader: %ld bytes available\n", avail); #endif n = ringbuffer_writefd (fd, &st->rb, rd); if (n == -1) { break; } fsync (fd); #ifdef DEBUG if (n!=0 || avail != 0) printf ("stream_reader: wrote %ld of %ld bytes to socket\n", n, avail); #endif } ringbuffer_close (&st->rb, rd); } static void oggstdin_delete (void * data) { struct oggstdin * st = (struct oggstdin *)data; free (st->path); free (st->content_type); free (st->rb.data); list_free_with (st->header_tracker, &free); close (st->headers_fd); oggz_close (st->oggz); } struct resource * oggstdin_resource (const char * path, const char * content_type) { struct oggstdin * st = &oggstdin_pvt; unsigned char * data, * headers; size_t len = 4096*16*32; size_t header_len = 10 * 1024; if ((data = malloc (len)) == NULL) { return NULL; } if ((st->headers_fd = create_tempfd ("sighttpd-XXXXXXXXXX")) == -1) { perror ("create_tempfd"); return NULL; } st->path = x_strdup (path); if (st->path == NULL) { free (data); return NULL; } st->content_type = x_strdup (content_type); if (st->content_type == NULL) { free (data); free (st->path); return NULL; } ringbuffer_init (&st->rb, data, len); st->active = 1; st->headers_len = 0; st->in_headers = 0; st->header_tracker = list_new (); return resource_new (oggstdin_check, oggstdin_head, oggstdin_body, oggstdin_delete, st); } list_t * oggstdin_resources (Dictionary * config) { list_t * l; const char * path; const char * ctype; l = list_new(); path = dictionary_lookup (config, "Path"); ctype = dictionary_lookup (config, "Type"); if (!ctype) ctype = DEFAULT_CONTENT_TYPE; if (path) l = list_append (l, oggstdin_resource (path, ctype)); return l; }
kfish/sighttpd
src/ogg-stdin.c
C
lgpl-2.1
6,032
# cell definition # name = 'Epos_AD' # libname = 'can' inp = 0 outp = 1 parameters = dict() #parametriseerbare cell properties = {'Device ID': ' 0x01', 'Channel [0/1]': ' 0', 'name': 'epos_areadBlk'} #voor netlisten #view variables: iconSource = 'AD' views = {'icon':iconSource}
imec-myhdl/pycontrol-gui
BlockEditor/libraries/library_can/Epos_AD.py
Python
lgpl-2.1
283
/* * Copyright (C) 2012-2014 Red Hat, Inc. * * Licensed under the GNU Lesser General Public License Version 2.1 * * This library 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 2.1 of the License, or (at your option) any later version. * * This library 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 this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <Python.h> #include <stdio.h> #include <solv/util.h> #include "dnf-advisory.h" #include "hy-iutil.h" #include "hy-package.h" #include "hy-package-private.hpp" #include "dnf-reldep.h" #include "iutil-py.hpp" #include "package-py.hpp" #include "packagedelta-py.hpp" #include "sack-py.hpp" #include "pycomp.hpp" #include "libdnf/repo/solvable/DependencyContainer.hpp" typedef struct { PyObject_HEAD DnfPackage *package; PyObject *sack; } _PackageObject; long package_hash(_PackageObject *self); DnfPackage * packageFromPyObject(PyObject *o) { if (!PyType_IsSubtype(o->ob_type, &package_Type)) { PyErr_SetString(PyExc_TypeError, "Expected a Package object."); return NULL; } return ((_PackageObject *)o)->package; } int package_converter(PyObject *o, DnfPackage **pkg_ptr) { DnfPackage *pkg = packageFromPyObject(o); if (pkg == NULL) return 0; *pkg_ptr = pkg; return 1; } /* functions on the type */ static PyObject * package_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { _PackageObject *self = (_PackageObject*)type->tp_alloc(type, 0); if (self) { self->sack = NULL; self->package = NULL; } return (PyObject*)self; } static void package_dealloc(_PackageObject *self) { if (self->package) g_object_unref(self->package); Py_XDECREF(self->sack); Py_TYPE(self)->tp_free(self); } static int package_init(_PackageObject *self, PyObject *args, PyObject *kwds) { Id id; PyObject *sack; DnfSack *csack; if (!PyArg_ParseTuple(args, "(O!i)", &sack_Type, &sack, &id)) return -1; csack = sackFromPyObject(sack); if (csack == NULL) return -1; self->sack = sack; Py_INCREF(self->sack); self->package = dnf_package_new(csack, id); return 0; } static PyObject * package_py_richcompare(PyObject *self, PyObject *other, int op) { PyObject *v; DnfPackage *self_package, *other_package; if (!package_converter(self, &self_package) || !package_converter(other, &other_package)) { if(PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError)) PyErr_Clear(); Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } long result = dnf_package_cmp(self_package, other_package); switch (op) { case Py_EQ: v = TEST_COND(result == 0); break; case Py_NE: v = TEST_COND(result != 0); break; case Py_LE: v = TEST_COND(result <= 0); break; case Py_GE: v = TEST_COND(result >= 0); break; case Py_LT: v = TEST_COND(result < 0); break; case Py_GT: v = TEST_COND(result > 0); break; default: PyErr_BadArgument(); return NULL; } Py_INCREF(v); return v; } static PyObject * package_repr(_PackageObject *self) { DnfPackage *pkg = self->package; const char *nevra = dnf_package_get_nevra(pkg); PyObject *repr; repr = PyString_FromFormat("<hawkey.Package object id %ld, %s, %s>", package_hash(self), nevra, dnf_package_get_reponame(pkg)); return repr; } static PyObject * package_str(_PackageObject *self) { const char *cstr = dnf_package_get_nevra(self->package); PyObject *ret = PyString_FromString(cstr); return ret; } long package_hash(_PackageObject *self) { return dnf_package_get_id(self->package); } /* getsetters */ static PyObject * get_bool(_PackageObject *self, void *closure) { unsigned long (*func)(DnfPackage*); func = (unsigned long (*)(DnfPackage*))closure; return PyBool_FromLong(func(self->package)); } static PyObject * get_num(_PackageObject *self, void *closure) { guint64 (*func)(DnfPackage*); func = (guint64 (*)(DnfPackage*))closure; return PyLong_FromUnsignedLongLong(func(self->package)); } static PyObject * get_reldep(_PackageObject *self, void *closure) { DnfReldepList *(*func)(DnfPackage*) = (DnfReldepList *(*)(DnfPackage*))closure; std::unique_ptr<DnfReldepList> reldeplist(func(self->package)); assert(reldeplist); PyObject *list = reldeplist_to_pylist(reldeplist.get(), self->sack); return list; } static PyObject * get_str(_PackageObject *self, void *closure) { const char *(*func)(DnfPackage*); const char *cstr; func = (const char *(*)(DnfPackage*))closure; cstr = func(self->package); if (cstr == NULL) Py_RETURN_NONE; return PyUnicode_FromString(cstr); } static PyObject * get_str_array(_PackageObject *self, void *closure) { gchar ** (*func)(DnfPackage*); gchar ** strv; func = (gchar **(*)(DnfPackage*))closure; strv = func(self->package); PyObject *list = strlist_to_pylist((const char **)strv); g_strfreev(strv); return list; } static PyObject * get_chksum(_PackageObject *self, void *closure) { HyChecksum *(*func)(DnfPackage*, int *); int type; HyChecksum *cs; func = (HyChecksum *(*)(DnfPackage*, int *))closure; cs = func(self->package, &type); if (cs == 0) { Py_RETURN_NONE; } PyObject *res; int checksum_length = checksum_type2length(type); #if PY_MAJOR_VERSION < 3 res = Py_BuildValue("is#", type, cs, checksum_length); #else res = Py_BuildValue("iy#", type, cs, checksum_length); #endif return res; } static PyObject * get_changelogs(_PackageObject *self, void *closure) { return changelogslist_to_pylist(dnf_package_get_changelogs(self->package)); } static PyGetSetDef package_getsetters[] = { {(char*)"baseurl", (getter)get_str, NULL, NULL, (void *)dnf_package_get_baseurl}, {(char*)"files", (getter)get_str_array, NULL, NULL, (void *)dnf_package_get_files}, {(char*)"changelogs", (getter)get_changelogs, NULL, NULL, NULL}, {(char*)"hdr_end", (getter)get_num, NULL, NULL, (void *)dnf_package_get_hdr_end}, {(char*)"location", (getter)get_str, NULL, NULL, (void *)dnf_package_get_location}, {(char*)"sourcerpm", (getter)get_str, NULL, NULL, (void *)dnf_package_get_sourcerpm}, {(char*)"version", (getter)get_str, NULL, NULL, (void *)dnf_package_get_version}, {(char*)"release", (getter)get_str, NULL, NULL, (void *)dnf_package_get_release}, {(char*)"name", (getter)get_str, NULL, NULL, (void *)dnf_package_get_name}, {(char*)"arch", (getter)get_str, NULL, NULL, (void *)dnf_package_get_arch}, {(char*)"hdr_chksum", (getter)get_chksum, NULL, NULL, (void *)dnf_package_get_hdr_chksum}, {(char*)"chksum", (getter)get_chksum, NULL, NULL, (void *)dnf_package_get_chksum}, {(char*)"description", (getter)get_str, NULL, NULL, (void *)dnf_package_get_description}, {(char*)"evr", (getter)get_str, NULL, NULL, (void *)dnf_package_get_evr}, {(char*)"group", (getter)get_str, NULL, NULL, (void *)dnf_package_get_group}, {(char*)"license", (getter)get_str, NULL, NULL, (void *)dnf_package_get_license}, {(char*)"packager", (getter)get_str, NULL, NULL, (void *)dnf_package_get_packager}, {(char*)"reponame", (getter)get_str, NULL, NULL, (void *)dnf_package_get_reponame}, {(char*)"summary", (getter)get_str, NULL, NULL, (void *)dnf_package_get_summary}, {(char*)"url", (getter)get_str, NULL, NULL, (void *)dnf_package_get_url}, {(char*)"downloadsize", (getter)get_num, NULL, NULL, (void *)dnf_package_get_downloadsize}, {(char*)"epoch", (getter)get_num, NULL, NULL, (void *)dnf_package_get_epoch}, {(char*)"installsize", (getter)get_num, NULL, NULL, (void *)dnf_package_get_installsize}, {(char*)"buildtime", (getter)get_num, NULL, NULL, (void *)dnf_package_get_buildtime}, {(char*)"installtime", (getter)get_num, NULL, NULL, (void *)dnf_package_get_installtime}, {(char*)"installed", (getter)get_bool, NULL, NULL, (void *)dnf_package_installed}, {(char*)"medianr", (getter)get_num, NULL, NULL, (void *)dnf_package_get_medianr}, {(char*)"rpmdbid", (getter)get_num, NULL, NULL, (void *)dnf_package_get_rpmdbid}, {(char*)"size", (getter)get_num, NULL, NULL, (void *)dnf_package_get_size}, {(char*)"conflicts", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_conflicts}, {(char*)"enhances", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_enhances}, {(char*)"obsoletes", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_obsoletes}, {(char*)"requires_pre", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_requires_pre}, {(char*)"provides", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_provides}, {(char*)"recommends", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_recommends}, {(char*)"requires", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_requires}, {(char*)"suggests", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_suggests}, {(char*)"supplements", (getter)get_reldep, NULL, NULL, (void *)dnf_package_get_supplements}, {NULL} /* sentinel */ }; /* object methods */ static PyObject * evr_cmp(_PackageObject *self, PyObject *other) { DnfPackage *pkg2 = packageFromPyObject(other); if (pkg2 == NULL) return NULL; return PyLong_FromLong(dnf_package_evr_cmp(self->package, pkg2)); } static PyObject * get_delta_from_evr(_PackageObject *self, PyObject *evr_str) { PycompString evr(evr_str); if (!evr.getCString()) return NULL; DnfPackageDelta *delta_c = dnf_package_get_delta_from_evr(self->package, evr.getCString()); if (delta_c) return packageDeltaToPyObject(delta_c); Py_RETURN_NONE; } static PyObject * get_advisories(_PackageObject *self, PyObject *args) { int cmp_type; GPtrArray *advisories; PyObject *list; if (!PyArg_ParseTuple(args, "i", &cmp_type)) return NULL; advisories = dnf_package_get_advisories(self->package, cmp_type); list = advisorylist_to_pylist(advisories, self->sack); g_ptr_array_unref(advisories); return list; } static struct PyMethodDef package_methods[] = { {"evr_cmp", (PyCFunction)evr_cmp, METH_O, NULL}, {"get_delta_from_evr", (PyCFunction)get_delta_from_evr, METH_O, NULL}, {"get_advisories", (PyCFunction)get_advisories, METH_VARARGS, NULL}, {NULL} /* sentinel */ }; PyTypeObject package_Type = { PyVarObject_HEAD_INIT(NULL, 0) "_hawkey.Package", /*tp_name*/ sizeof(_PackageObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor) package_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ (reprfunc)package_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ (hashfunc)package_hash, /*tp_hash */ 0, /*tp_call*/ (reprfunc)package_str, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ "Package object", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ (richcmpfunc) package_py_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ package_methods, /* tp_methods */ 0, /* tp_members */ package_getsetters, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)package_init, /* tp_init */ 0, /* tp_alloc */ package_new, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ };
Conan-Kudo/libhif
python/hawkey/package-py.cpp
C++
lgpl-2.1
13,457
/* * SubSampler.java * * Created on March 4, 2006, 7:24 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. * * *Copyright March 4, 2006 Tobi Delbruck, Inst. of Neuroinformatics, UNI-ETH Zurich */ package net.sf.jaer.eventprocessing.filter; import net.sf.jaer.Description; import net.sf.jaer.DevelopmentStatus; import net.sf.jaer.chip.AEChip; import net.sf.jaer.event.EventPacket; import net.sf.jaer.event.OutputEventIterator; import net.sf.jaer.event.TypedEvent; import net.sf.jaer.eventprocessing.EventFilter2D; /** * Subsmaples input AE packets to produce output at some binary subsampling. * * @author tobi */ @Description("Subsamples X and Y addresses, by right shifting the X and Y addresses. Does not decrease event rate.") @DevelopmentStatus(DevelopmentStatus.Status.Stable) public class SubSampler extends EventFilter2D { private int bits; private boolean shiftToCenterEnabled=getBoolean("shiftToCenterEnabled", false); short shiftx, shifty; /** Creates a new instance of SubSampler */ public SubSampler(AEChip chip) { super(chip); setBits(getInt("bits",1)); computeShifts(); setPropertyTooltip("bits","Subsample by this many bits, by masking these off X and Y addreses"); setPropertyTooltip("shiftToCenterEnabled","Shifts output addresses to be centered. Disable to leave at lower left corner of scene"); } public Object getFilterState() { return null; } @Override public void resetFilter() { } @Override public void initFilter() { } public int getBits() { return bits; } @Override public synchronized void setFilterEnabled(boolean yes){ super.setFilterEnabled(yes); computeShifts(); } /** Sets the subsampler subsampling shift. @param bits the number of bits to subsample by, e.g. bits=1 divides by two */ synchronized public void setBits(int bits) { if(bits<0) { bits=0; } else if(bits>8) { bits=8; } this.bits = bits; putInt("bits",bits); computeShifts(); } private void computeShifts() { if(bits==0){ shiftx=0; shifty=0; return; } int s1=chip.getSizeX(); int s2=s1>>>bits; shiftx=(short)((s1-s2)/2); s1=chip.getSizeY(); s2=s1>>>bits; shifty=(short)((s1-s2)/2); } @Override synchronized public EventPacket filterPacket(EventPacket in) { if(in==null) { return null; } if(!filterEnabled) { return in; } if(enclosedFilter!=null) { in=enclosedFilter.filterPacket(in); } checkOutputPacketEventType(in); OutputEventIterator oi=out.outputIterator(); int sx=shiftToCenterEnabled?shiftx:0; int sy=shiftToCenterEnabled?shifty:0; for(Object obj:in){ TypedEvent e=(TypedEvent)obj; TypedEvent o=(TypedEvent)oi.nextOutput(); o.copyFrom(e); o.setX((short) ((e.x >>> bits) + sx)); o.setY((short) ((e.y >>> bits) + sy)); } return out; } /** * @return the shiftToCenterEnabled */ public boolean isShiftToCenterEnabled() { return shiftToCenterEnabled; } /** * @param shiftToCenterEnabled the shiftToCenterEnabled to set */ public void setShiftToCenterEnabled(boolean shiftToCenterEnabled) { this.shiftToCenterEnabled = shiftToCenterEnabled; putBoolean("shiftToCenterEnabled", shiftToCenterEnabled); } }
SensorsINI/jaer
src/net/sf/jaer/eventprocessing/filter/SubSampler.java
Java
lgpl-2.1
3,598
#include "IRremote.h" // Reverse Engineered by looking at RAW dumps generated by IRremote // I have since discovered that Denon publish all their IR codes: // https://www.google.co.uk/search?q=DENON+MASTER+IR+Hex+Command+Sheet // -> http://assets.denon.com/documentmaster/us/denon%20master%20ir%20hex.xls // Having looked at the official Denon Pronto sheet and reverse engineered // the timing values from it, it is obvious that Denon have a range of // different timings and protocols ...the values here work for my AVR-3801 Amp! //============================================================================== // DDDD EEEEE N N OOO N N // D D E NN N O O NN N // D D EEE N N N O O N N N // D D E N NN O O N NN // DDDD EEEEE N N OOO N N //============================================================================== #define BITS 14 // The number of bits in the command #define HDR_MARK 300 // The length of the Header:Mark #define HDR_SPACE 750 // The lenght of the Header:Space #define BIT_MARK 300 // The length of a Bit:Mark #define ONE_SPACE 1800 // The length of a Bit:Space for 1's #define ZERO_SPACE 750 // The length of a Bit:Space for 0's //+============================================================================= // #if SEND_DENON void IRsend::sendDenon(unsigned long data, int nbits) { // Set IR carrier frequency enableIROut(38); // Header mark(HDR_MARK); space(HDR_SPACE); // Data for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(BIT_MARK); space(ONE_SPACE); } else { mark(BIT_MARK); space(ZERO_SPACE); } } // Footer mark(BIT_MARK); space(0); // Always end with the LED off } #endif //+============================================================================= // #if DECODE_DENON bool IRrecv::decodeDenon(decode_results *results) { unsigned long data = 0; // Somewhere to build our code int offset = 1; // Skip the Gap reading // Check we have the right amount of data if (irparams.rawlen != 1 + 2 + (2 * BITS) + 1) { return false; } // Check initial Mark+Space match if (!MATCH_MARK(results->rawbuf[offset], HDR_MARK)) { return false; } offset++; if (!MATCH_SPACE(results->rawbuf[offset], HDR_SPACE)) { return false; } offset++; // Read the bits in for (int i = 0; i < BITS; i++) { // Each bit looks like: MARK + SPACE_1 -> 1 // or : MARK + SPACE_0 -> 0 if (!MATCH_MARK(results->rawbuf[offset], BIT_MARK)) { return false; } offset++; // IR data is big-endian, so we shuffle it in from the right: if (MATCH_SPACE(results->rawbuf[offset], ONE_SPACE)) { data = (data << 1) | 1; } else if (MATCH_SPACE(results->rawbuf[offset], ZERO_SPACE)) { data = (data << 1) | 0; } else { return false; } offset++; } // Success results->bits = BITS; results->value = data; results->decode_type = DENON; return true; } #endif
Seeed-Studio/IRSendRev
src/ir_Denon.cpp
C++
lgpl-2.1
3,461
#pragma once class LoginUi { public: LoginUi(void); ~LoginUi(void); public: bool Show(); private: void DoLogin(); bool OnWindowCreated(Base::NBaseObj* source, NEventData* eventData); bool OnBtnRetry(Base::NBaseObj* source, NEventData* eventData); static unsigned int WINAPI ThreadProc(void* data); private: NInstPtr<NWindow> window_; NLabel* statusLabel_; NImage* qrcode_; NButton* btnRetry_; bool loginOk_; bool stop_; HANDLE loginThread_; };
hufuman/nui
WeChat/LoginUi.h
C
lgpl-2.1
505
/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This 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 2.1 of * the License, or (at your option) any later version. * * This software 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 this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.ws.jaxws.samples.eardeployment; import javax.ejb.Stateless; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import org.jboss.logging.Logger; // Test that the wsdl can be read from the nested deployment @WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace="http://eardeployment.jaxws/", wsdlLocation = "META-INF/wsdl/Endpoint.wsdl") @SOAPBinding(style = SOAPBinding.Style.RPC) @Stateless public class EJB3Bean { private static Logger log = Logger.getLogger(EJB3Bean.class); @WebMethod @WebResult(name = "return") public String echo(@WebParam(name = "arg0") String input) { log.info("echo: " + input); return input; } }
jbossws/jbossws-cxf
modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/eardeployment/EJB3Bean.java
Java
lgpl-2.1
1,833
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 2.1 of * the License, or (at your option) any later version. * * This software 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 this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.xwiki.icon.rest; import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; import org.xwiki.icon.rest.model.jaxb.Icons; import org.xwiki.stability.Unstable; /** * Exposes the wiki icon themes and their icons through REST. * * @version $Id$ * @since 13.4RC1 */ @Path("/wikis/{wikiName}/iconThemes") @Unstable public interface IconThemesResource { /** * Returns the icons metadata of the requested icons list, for a given icon theme. * * @param wikiName the name of the wiki holding the icons * @param iconTheme the name of the icon theme holding the icons * @param names a list of icon names to return * @return the list of resolved icons metadata */ @GET @Path("/{iconTheme}/icons") Icons getIconsByTheme(@PathParam("wikiName") String wikiName, @PathParam("iconTheme") String iconTheme, @QueryParam("name") List<String> names); /** * Returns the icons metadata of the requested icons list, for the default icon theme. * * @param wikiName the name of the wiki holding the icons * @param names a list of icon names to return * @return the list of resolved icons metadata */ @GET @Path("/icons") Icons getIcons(@PathParam("wikiName") String wikiName, @QueryParam("name") List<String> names); }
xwiki/xwiki-platform
xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/src/main/java/org/xwiki/icon/rest/IconThemesResource.java
Java
lgpl-2.1
2,287
################################################################################ # Name : Makefile # Authors : Mikhail Gruzdev <michail.gruzdev@gmail.com> # Didier Barvaux <didier.barvaux@toulouse.viveris.com> # Thales Communications # Description: Build a test module for Linux kernel # (for the Linux kernel build system) ################################################################################ rohc_modname = rohc rohc_test_modname = rohc_test rohc_common_sources = \ ../../src/common/protocols/ip_numbers.c \ ../../src/common/rohc_common.c \ ../../src/common/rohc_profiles.c \ ../../src/common/rohc_packets.c \ ../../src/common/rohc_traces_internal.c \ ../../src/common/rohc_utils.c \ ../../src/common/crcany.c \ ../../src/common/crc.c \ ../../src/common/rohc_add_cid.c \ ../../src/common/interval.c \ ../../src/common/sdvl.c \ ../../src/common/ip.c \ ../../src/common/rohc_list.c \ ../../src/common/feedback_parse.c \ ../../src/common/csiphash.c \ ../../src/common/hashtable.c \ ../../src/common/hashtable_cr.c rohc_comp_sources = \ ../../src/comp/schemes/cid.c \ ../../src/comp/schemes/ip_id_offset.c \ ../../src/comp/schemes/comp_wlsb.c \ ../../src/comp/schemes/comp_scaled_rtp_ts.c \ ../../src/comp/schemes/comp_list.c \ ../../src/comp/schemes/comp_list_ipv6.c \ ../../src/comp/schemes/rfc4996.c \ ../../src/comp/schemes/tcp_sack.c \ ../../src/comp/schemes/tcp_ts.c \ ../../src/comp/schemes/ipv6_exts.c \ ../../src/comp/rohc_comp.c \ ../../src/comp/c_uncompressed.c \ ../../src/comp/rohc_comp_rfc3095.c \ ../../src/comp/c_ip.c \ ../../src/comp/c_udp.c \ ../../src/comp/c_rtp.c \ ../../src/comp/c_esp.c \ ../../src/comp/c_tcp_opts_list.c \ ../../src/comp/c_tcp_static.c \ ../../src/comp/c_tcp_dynamic.c \ ../../src/comp/c_tcp_replicate.c \ ../../src/comp/c_tcp_irregular.c \ ../../src/comp/c_tcp.c \ ../../src/comp/comp_rfc5225_ip.c \ ../../src/comp/comp_rfc5225_ip_esp.c \ ../../src/comp/comp_rfc5225_ip_udp.c \ ../../src/comp/comp_rfc5225_ip_udp_rtp.c rohc_decomp_sources = \ ../../src/decomp/schemes/decomp_crc.c \ ../../src/decomp/schemes/decomp_wlsb.c \ ../../src/decomp/schemes/ip_id_offset.c \ ../../src/decomp/schemes/decomp_scaled_rtp_ts.c \ ../../src/decomp/schemes/decomp_list.c \ ../../src/decomp/schemes/decomp_list_ipv6.c \ ../../src/decomp/schemes/rfc4996.c \ ../../src/decomp/schemes/tcp_ts.c \ ../../src/decomp/schemes/tcp_sack.c \ ../../src/decomp/rohc_decomp_detect_packet.c \ ../../src/decomp/rohc_decomp.c \ ../../src/decomp/feedback_create.c \ ../../src/decomp/d_uncompressed.c \ ../../src/decomp/rohc_decomp_rfc3095.c \ ../../src/decomp/d_ip.c \ ../../src/decomp/d_udp.c \ ../../src/decomp/d_rtp.c \ ../../src/decomp/d_esp.c \ ../../src/decomp/d_tcp_static.c \ ../../src/decomp/d_tcp_dynamic.c \ ../../src/decomp/d_tcp_replicate.c \ ../../src/decomp/d_tcp_irregular.c \ ../../src/decomp/d_tcp_opts_list.c \ ../../src/decomp/d_tcp.c \ ../../src/decomp/decomp_rfc5225_ip.c \ ../../src/decomp/decomp_rfc5225_ip_esp.c \ ../../src/decomp/decomp_rfc5225_ip_udp.c \ ../../src/decomp/decomp_rfc5225_ip_udp_rtp.c rohc_sources = \ ../kmod.c \ $(rohc_common_sources) \ $(rohc_comp_sources) \ $(rohc_decomp_sources) rohc_objs = $(patsubst %.c,%.o,$(rohc_sources)) EXTRA_CFLAGS += \ -Wall \ -I$(M)/../include \ -I$(M)/../.. \ -I$(M)/../../src \ -I$(M)/../../src/common \ -I$(M)/../../src/comp \ -I$(M)/../../src/decomp # Module that exports the ROHC library in kernel land obj-m += $(rohc_modname).o $(rohc_modname)-objs = \ $(rohc_objs) # Mobule that tests the ROHC library in kernel land obj-m += $(rohc_test_modname).o $(rohc_test_modname)-objs = \ ../kmod_test.o
didier-barvaux/rohc
linux/kmod/Makefile
Makefile
lgpl-2.1
3,737
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #include "NodalNormalsEvaluator.h" Threads::spin_mutex nodal_normals_evaluator_mutex; template<> InputParameters validParams<NodalNormalsEvaluator>() { InputParameters params = validParams<NodalUserObject>(); params.set<bool>("_dual_restrictable") = true; return params; } NodalNormalsEvaluator::NodalNormalsEvaluator(const std::string & name, InputParameters parameters) : NodalUserObject(name, parameters), _aux(_fe_problem.getAuxiliarySystem()) { } NodalNormalsEvaluator::~NodalNormalsEvaluator() { } void NodalNormalsEvaluator::execute() { if (_current_node->processor_id() == libMesh::processor_id()) { if (_current_node->n_dofs(_aux.number(), _fe_problem.getVariable(_tid, "nodal_normal_x").number()) > 0) { Threads::spin_mutex::scoped_lock lock(nodal_normals_evaluator_mutex); dof_id_type dof_x = _current_node->dof_number(_aux.number(), _fe_problem.getVariable(_tid, "nodal_normal_x").number(), 0); dof_id_type dof_y = _current_node->dof_number(_aux.number(), _fe_problem.getVariable(_tid, "nodal_normal_y").number(), 0); dof_id_type dof_z = _current_node->dof_number(_aux.number(), _fe_problem.getVariable(_tid, "nodal_normal_z").number(), 0); NumericVector<Number> & sln = _aux.solution(); Real nx = sln(dof_x); Real ny = sln(dof_y); Real nz = sln(dof_z); Real n = std::sqrt((nx * nx) + (ny * ny) + (nz * nz)); if (std::abs(n) >= 1e-13) { // divide by n only if it is not close to zero to avoid NaNs sln.set(dof_x, nx / n); sln.set(dof_y, ny / n); sln.set(dof_z, nz / n); } } } } void NodalNormalsEvaluator::initialize() { _aux.solution().close(); } void NodalNormalsEvaluator::finalize() { _aux.solution().close(); } void NodalNormalsEvaluator::threadJoin(const UserObject & /*uo*/) { }
amburan/moose
framework/src/userobject/NodalNormalsEvaluator.C
C++
lgpl-2.1
2,721
<?php /* * This file is part of EC-CUBE * * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. * https://www.ec-cube.co.jp/ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Plugin\Point\Helper\PointHistoryHelper; use Eccube\Common\Constant; use Eccube\Entity\Order; use Plugin\Point\Entity\Point; use Plugin\Point\Entity\PointSnapshot; use Plugin\Point\Entity\PointStatus; use Plugin\Point\Repository\PointStatusRepository; /** * ポイント履歴ヘルパー * Class PointHistoryHelper * @package Plugin\Point\Helper\PointHistoryHelper */ class PointHistoryHelper { // 保存内容(場所) const HISTORY_MESSAGE_MANUAL_EDIT = 'ポイント(手動変更)'; const HISTORY_MESSAGE_EDIT = 'ポイント'; const HISTORY_MESSAGE_USE_POINT = 'ポイント'; const HISTORY_MESSAGE_ORDER_EDIT = 'ポイント(受注内容変更)'; // 保存内容(ポイント種別) const HISTORY_MESSAGE_TYPE_CURRENT = '保有'; const HISTORY_MESSAGE_TYPE_ADD = '加算'; const HISTORY_MESSAGE_TYPE_PRE_USE = '仮利用'; const HISTORY_MESSAGE_TYPE_USE = '利用'; // 保存内容(ポイント種別) const STATE_CURRENT = 1; // 会員編集画面から手動更新される保有ポイント const STATE_ADD = 3; // 加算ポイント const STATE_USE = 4; // 利用ポイント const STATE_PRE_USE = 5; // 仮利用ポイント(購入中に利用ポイントとして登録されるポイント) protected $app; // アプリケーション protected $entities; // 保存時エンティティコレクション protected $currentActionName; // 保存時保存動作(場所 + ポイント種別) protected $historyType; // 保存種別( integer ) protected $historyActionType; // 保存ポイント種別( string ) /** * PointHistoryHelper constructor. */ public function __construct($app) { $this->app = $app; // 全てINSERTのために保存用エンティティを再生成 $this->refreshEntity(); // ポイント基本情報設定値 $this->entities['PointInfo'] = $this->app['eccube.plugin.point.repository.pointinfo']->getLastInsertData(); } /** * 履歴保存エンティティを新規作成 * - 履歴では常にINSERTのため */ public function refreshEntity() { $this->entities = array(); $this->entities['SnapShot'] = new PointSnapshot(); $this->entities['Point'] = new Point(); $this->entities['PointInfo'] = $this->app['eccube.plugin.point.repository.pointinfo']->getLastInsertData(); } /** * 計算に必要なエンティティを追加 * @param $entity */ public function addEntity($entity) { $entityName = explode('\\', get_class($entity)); $this->entities[array_pop($entityName)] = $entity; return; } /** * 保持エンティティコレクションを返却 * @return mixed */ public function getEntities() { return $this->entities; } /** * キーをもとに該当エンティティを削除 * @param $targetName */ public function removeEntity($targetName) { if (in_array($targetName, $this->entities[$targetName], true)) { unset($this->entities[$targetName]); } return; } /** * 加算ポイントの履歴登録 * - 受注管理画面 * @param $point */ public function saveAddPointByOrderEdit($point) { $this->currentActionName = self::HISTORY_MESSAGE_ORDER_EDIT; $this->historyActionType = self::HISTORY_MESSAGE_TYPE_ADD; $this->historyType = self::STATE_ADD; $this->saveHistoryPoint($point); } /** * 加算ポイントの履歴登録 * - フロント画面 * @param $point */ public function saveAddPoint($point) { $this->currentActionName = self::HISTORY_MESSAGE_EDIT; $this->historyActionType = self::HISTORY_MESSAGE_TYPE_ADD; $this->historyType = self::STATE_ADD; $this->saveHistoryPoint($point); } /** * 仮利用ポイント履歴登録 * - フロント画面 * @param $point */ public function savePreUsePoint($point) { $this->currentActionName = self::HISTORY_MESSAGE_USE_POINT; $this->historyActionType = self::HISTORY_MESSAGE_TYPE_PRE_USE; $this->historyType = self::STATE_PRE_USE; $this->saveHistoryPoint($point); } /** * 利用ポイント履歴登録 * - フロント画面 * @param $point */ public function saveUsePoint($point) { $this->currentActionName = self::HISTORY_MESSAGE_EDIT; $this->historyActionType = self::HISTORY_MESSAGE_TYPE_USE; $this->historyType = self::STATE_USE; $this->saveHistoryPoint($point); } /** * 手動登録(管理者)ポイント履歴登録 * - 管理画面・会員登録/編集 * @param $point */ public function saveManualPoint($point) { $this->currentActionName = self::HISTORY_MESSAGE_MANUAL_EDIT; $this->historyActionType = self::HISTORY_MESSAGE_TYPE_CURRENT; $this->historyType = self::STATE_CURRENT; $this->saveHistoryPoint($point); } /** * 受注編集による利用ポイント変更の保存 * @param $point */ public function saveUsePointByOrderEdit($point) { $this->currentActionName = self::HISTORY_MESSAGE_ORDER_EDIT; $this->historyActionType = self::HISTORY_MESSAGE_TYPE_USE; $this->historyType = self::STATE_USE; $this->saveHistoryPoint($point); } /** * 履歴登録共通処理 * @param $point * @return bool */ protected function saveHistoryPoint($point) { // 引数判定 if (!$this->hasEntity('Customer')) { return false; } if (!$this->hasEntity('PointInfo')) { return false; } if (isset($this->entities['Order'])) { $this->entities['Point']->setOrder($this->entities['Order']); } $this->entities['Point']->setPlgPointId(null); $this->entities['Point']->setCustomer($this->entities['Customer']); $this->entities['Point']->setPointInfo($this->entities['PointInfo']); $this->entities['Point']->setPlgDynamicPoint((integer)$point); $this->entities['Point']->setPlgPointActionName($this->historyActionType.$this->currentActionName); $this->entities['Point']->setPlgPointType($this->historyType); $this->app['orm.em']->persist($this->entities['Point']); $this->app['orm.em']->flush($this->entities['Point']); $this->app['orm.em']->clear($this->entities['Point']); return true; } /** * スナップショット情報登録 * @param $point * @return bool */ public function saveSnapShot($point) { // 必要エンティティ判定 if (!$this->hasEntity('Customer')) { return false; } $this->entities['SnapShot']->setPlgPointSnapshotId(null); $this->entities['SnapShot']->setCustomer($this->entities['Customer']); $this->entities['SnapShot']->setOrder($this->hasEntity('Order') ? $this->entities['Order'] : null); $this->entities['SnapShot']->setPlgPointAdd($point['add']); $this->entities['SnapShot']->setPlgPointCurrent((integer)$point['current']); $this->entities['SnapShot']->setPlgPointUse($point['use']); $this->entities['SnapShot']->setPlgPointSnapActionName($this->currentActionName); $this->app['orm.em']->persist($this->entities['SnapShot']); $this->app['orm.em']->flush($this->entities['SnapShot']); return true; } /** * エンティティの有無を確認 * - 引数で渡された値をキーにエンティティの有無を確認 * @param $name * @return bool */ protected function hasEntity($name) { if (isset($this->entities[$name])) { return true; } return false; } /** * 付与ポイントのステータスレコードを追加する * @return bool */ public function savePointStatus() { $this->entities['PointStatus'] = new PointStatus(); if (isset($this->entities['Order'])) { $this->entities['PointStatus']->setOrderId($this->entities['Order']->getId()); } if (isset($this->entities['Customer'])) { $this->entities['PointStatus']->setCustomerId($this->entities['Customer']->getId()); } $this->entities['PointStatus']->setStatus(PointStatusRepository::POINT_STATUS_UNFIX); $this->entities['PointStatus']->setDelFlg(Constant::DISABLED); $this->entities['PointStatus']->setPointFixDate(null); $this->app['orm.em']->persist($this->entities['PointStatus']); $this->app['orm.em']->flush($this->entities['PointStatus']); $this->app['orm.em']->clear($this->entities['PointStatus']); return true; } /** * ポイントステータスを確定状態にする */ public function fixPointStatus() { $orderId = $this->entities['Order']->getId(); $PointStatus = $this->app['eccube.plugin.point.repository.pointstatus']->findOneBy( array('order_id' => $orderId) ); if (!$PointStatus instanceof PointStatus) { $PointStatus = new PointStatus(); $PointStatus->setDelFlg(Constant::DISABLED); $PointStatus->setOrderId($this->entities['Order']->getId()); $PointStatus->setCustomerId($this->entities['Customer']->getId()); $this->app['orm.em']->persist($PointStatus); } /** @var PointStatus $pointStatus */ $PointStatus->setStatus($this->app['eccube.plugin.point.repository.pointstatus']->getFixStatusValue()); $PointStatus->setPointFixDate(new \DateTime()); $this->app['orm.em']->flush($PointStatus); } /** * ポイントステータスを削除状態にする * @param Order $order 対象オーダー */ public function deletePointStatus(Order $order) { $orderId = $order->getId(); $pointStatus = $this->app['eccube.plugin.point.repository.pointstatus']->findOneBy( array('order_id' => $orderId) ); if (!$pointStatus) { return; } /** @var PointStatus $pointStatus */ $pointStatus->setDelFlg(Constant::ENABLED); $this->app['orm.em']->flush($pointStatus); } }
EC-CUBE/point-plugin
Helper/PointHistoryHelper/PointHistoryHelper.php
PHP
lgpl-2.1
10,853
/* * Copyright 2001-2008 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sweet import org.testng.TestNG import org.testng.TestListenerAdapter /** * A suite of tests that can be run with either TestNG or ScalaTest. This trait allows you to mark any * method as a test using TestNG's <code>@Test</code> annotation, and supports all other TestNG annotations. * Here's an example: * </p> * * <pre> * import org.scalatest.testng.TestNGSuite * import org.testng.annotations.Test * import org.testng.annotations.Configuration * import scala.collection.mutable.ListBuffer * * class MySuite extends TestNGSuite { * * var sb: StringBuilder = _ * var lb: ListBuffer[String] = _ * * @Configuration { val beforeTestMethod = true } * def setUpFixture() { * sb = new StringBuilder("ScalaTest is ") * lb = new ListBuffer[String] * } * * @Test { val invocationCount = 3 } * def easyTest() { * sb.append("easy!") * assert(sb.toString === "ScalaTest is easy!") * assert(lb.isEmpty) * lb += "sweet" * } * * @Test { val groups = Array("com.mycompany.groups.SlowTest") } * def funTest() { * sb.append("fun!") * assert(sb.toString === "ScalaTest is fun!") * assert(lb.isEmpty) * } * } * </pre> * * <p> * To execute <code>TestNGSuite</code>s with ScalaTest's <code>Runner</code>, you must include TestNG's jar file on the class path or runpath. * This version of <code>TestNGSuite</code> was tested with TestNG version 5.7. * </p> * * @author Josh Cough */ trait TestNGSweet extends Sweet { thisSuite => /** * Execute this <code>TestNGSuite</code>. * * @param testName an optional name of one test to execute. If <code>None</code>, this class will execute all relevant tests. * I.e., <code>None</code> acts like a wildcard that means execute all relevant tests in this <code>TestNGSuite</code>. * @param reporter The reporter to be notified of test events (success, failure, etc). * @param groupsToInclude Contains the names of groups to run. Only tests in these groups will be executed. * @param groupsToExclude Tests in groups in this Set will not be executed. * * @param stopper the <code>Stopper</code> may be used to request an early termination of a suite of tests. However, because TestNG does * not support the notion of aborting a run early, this class ignores this parameter. * @param properties a <code>Map</code> of properties that can be used by the executing <code>Suite</code> of tests. This class * does not use this parameter. * @param distributor an optional <code>Distributor</code>, into which nested <code>Suite</code>s could be put to be executed * by another entity, such as concurrently by a pool of threads. If <code>None</code>, nested <code>Suite</code>s will be executed sequentially. * Because TestNG handles its own concurrency, this class ignores this parameter. * <br><br> */ override def run(reporter: SweetReporter) { runTestNG(reporter) } /** * Runs TestNG. The meat and potatoes. * * @param testName if present (Some), then only the method with the supplied name is executed and groups will be ignored * @param reporter the reporter to be notified of test events (success, failure, etc) * @param groupsToInclude contains the names of groups to run. only tests in these groups will be executed * @param groupsToExclude tests in groups in this Set will not be executed */ private def runTestNG(reporter: SweetReporter) { val testng = new TestNG() // only run the test methods in this class testng.setTestClasses(Array(this.getClass)) // setup the callback mechanism val tla = new MyTestListenerAdapter(reporter) testng.addListener(tla) // finally, run TestNG testng.run() } /** * This class hooks TestNG's callback mechanism (TestListenerAdapter) to ScalaTest's * reporting mechanism. TestNG has many different callback points which are a near one-to-one * mapping with ScalaTest. At each callback point, this class simply creates ScalaTest * reports and calls the appropriate method on the SweetReporter. * * TODO: * (12:02:27 AM) bvenners: onTestFailedButWithinSuccessPercentage(ITestResult tr) * (12:02:34 AM) bvenners: maybe a TestSucceeded with some extra info in the report */ private class MyTestListenerAdapter(SweetReporter: SweetReporter) extends TestListenerAdapter { import org.testng.ITestContext import org.testng.ITestResult private val className = TestNGSweet.this.getClass.getName /** * This method is called when TestNG starts, and maps to ScalaTest's suiteStarting. * @TODO TestNG doesn't seem to know how many tests are going to be executed. * We are currently telling ScalaTest that 0 tests are about to be run. Investigate * and/or chat with Cedric to determine if its possible to get this number from TestNG. */ override def onStart(itc: ITestContext) = { //SweetReporter(SuiteStarting(thisSuite.suiteName, Some(thisSuite.getClass.getName))) } /** * TestNG's onFinish maps cleanly to suiteCompleted. * TODO: TestNG does have some extra info here. One thing we could do is map the info * in the ITestContext object into ScalaTest Reports and fire InfoProvided */ override def onFinish(itc: ITestContext) = { //SweetReporter(SuiteCompleted(thisSuite.suiteName, Some(thisSuite.getClass.getName))) } /** * TestNG's onTestStart maps cleanly to TestStarting. Simply build a report * and pass it to the SweetReporter. */ override def onTestStart(result: ITestResult) = { SweetReporter(TestStarting(result.getName + params(result))) } /** * TestNG's onTestSuccess maps cleanly to TestSucceeded. Again, simply build * a report and pass it to the SweetReporter. */ override def onTestSuccess(result: ITestResult) = { SweetReporter(TestSucceeded(result.getName)) } /** * TestNG's onTestSkipped maps cleanly to TestIgnored. Again, simply build * a report and pass it to the SweetReporter. */ override def onTestSkipped(result: ITestResult) = { //SweetReporter(TestIgnored(thisSuite.suiteName, Some(thisSuite.getClass.getName), result.getName + params(result))) } /** * TestNG's onTestFailure maps cleanly to TestFailed. */ override def onTestFailure(result: ITestResult) = { val throwableOrNull = result.getThrowable val throwable = if (throwableOrNull != null) Some(throwableOrNull) else None //val message = if (throwableOrNull != null && throwableOrNull.getMessage != null) throwableOrNull.getMessage // TODO will need to check here for assertion failure and turn into SourAssertion SweetReporter(TestErrored(result.getName, throwable.getOrElse(new Exception("unknown error")))) } /** * A TestNG setup method resulted in an exception, and a test method will later fail to run. * This TestNG callback method has the exception that caused the problem, as well * as the name of the method that failed. Create a Report with the method name and the * exception and call SweetReporter(SuiteAborted). */ override def onConfigurationFailure(result: ITestResult) = { // val throwableOrNull = result.getThrowable // val throwable = if (throwableOrNull != null) Some(throwableOrNull) else None // val message = if (throwableOrNull != null && throwableOrNull.getMessage != null) throwableOrNull.getMessage else Resources("testNGConfigFailed") // SweetReporter(SuiteAborted(message, thisSuite.suiteName, Some(thisSuite.getClass.getName), throwable)) } /** * TestNG's onConfigurationSuccess doesn't have a clean mapping in ScalaTest. * Simply create a Report and fire InfoProvided. This works well * because there may be a large number of setup methods and InfoProvided doesn't * show up in your face on the UI, and so doesn't clutter the UI. */ override def onConfigurationSuccess(result: ITestResult) = { // TODO: Work on this report //SweetReporter(InfoProvided(result.getName, Some(NameInfo(thisSuite.suiteName, Some(thisSuite.getClass.getName), None)))) } private def params(itr: ITestResult): String = { itr.getParameters match { case Array() => "" case _ => "(" + itr.getParameters.mkString(",") + ")" } } } }
joshcough/Sweet
src/main/scala/sweet/TestNGSweet.scala
Scala
lgpl-2.1
9,161
/** ****************************************************************************** * @file stm32g4xx_hal_smartcard_ex.h * @author MCD Application Team * @brief Header file of SMARTCARD HAL Extended module. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef STM32G4xx_HAL_SMARTCARD_EX_H #define STM32G4xx_HAL_SMARTCARD_EX_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32g4xx_hal_def.h" /** @addtogroup STM32G4xx_HAL_Driver * @{ */ /** @addtogroup SMARTCARDEx * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /** @addtogroup SMARTCARDEx_Exported_Constants SMARTCARD Extended Exported Constants * @{ */ /** @defgroup SMARTCARDEx_Transmission_Completion_Indication SMARTCARD Transmission Completion Indication * @{ */ #define SMARTCARD_TCBGT SMARTCARD_IT_TCBGT /*!< SMARTCARD transmission complete before guard time */ #define SMARTCARD_TC SMARTCARD_IT_TC /*!< SMARTCARD transmission complete (flag raised when guard time has elapsed) */ /** * @} */ /** @defgroup SMARTCARDEx_Advanced_Features_Initialization_Type SMARTCARD advanced feature initialization type * @{ */ #define SMARTCARD_ADVFEATURE_NO_INIT 0x00000000U /*!< No advanced feature initialization */ #define SMARTCARD_ADVFEATURE_TXINVERT_INIT 0x00000001U /*!< TX pin active level inversion */ #define SMARTCARD_ADVFEATURE_RXINVERT_INIT 0x00000002U /*!< RX pin active level inversion */ #define SMARTCARD_ADVFEATURE_DATAINVERT_INIT 0x00000004U /*!< Binary data inversion */ #define SMARTCARD_ADVFEATURE_SWAP_INIT 0x00000008U /*!< TX/RX pins swap */ #define SMARTCARD_ADVFEATURE_RXOVERRUNDISABLE_INIT 0x00000010U /*!< RX overrun disable */ #define SMARTCARD_ADVFEATURE_DMADISABLEONERROR_INIT 0x00000020U /*!< DMA disable on Reception Error */ #define SMARTCARD_ADVFEATURE_MSBFIRST_INIT 0x00000080U /*!< Most significant bit sent/received first */ #define SMARTCARD_ADVFEATURE_TXCOMPLETION 0x00000100U /*!< TX completion indication before of after guard time */ /** * @} */ /** @defgroup SMARTCARDEx_FIFO_mode SMARTCARD FIFO mode * @brief SMARTCARD FIFO mode * @{ */ #define SMARTCARD_FIFOMODE_DISABLE 0x00000000U /*!< FIFO mode disable */ #define SMARTCARD_FIFOMODE_ENABLE USART_CR1_FIFOEN /*!< FIFO mode enable */ /** * @} */ /** @defgroup SMARTCARDEx_TXFIFO_threshold_level SMARTCARD TXFIFO threshold level * @brief SMARTCARD TXFIFO level * @{ */ #define SMARTCARD_TXFIFO_THRESHOLD_1_8 0x00000000U /*!< TXFIFO reaches 1/8 of its depth */ #define SMARTCARD_TXFIFO_THRESHOLD_1_4 USART_CR3_TXFTCFG_0 /*!< TXFIFO reaches 1/4 of its depth */ #define SMARTCARD_TXFIFO_THRESHOLD_1_2 USART_CR3_TXFTCFG_1 /*!< TXFIFO reaches 1/2 of its depth */ #define SMARTCARD_TXFIFO_THRESHOLD_3_4 (USART_CR3_TXFTCFG_0|USART_CR3_TXFTCFG_1) /*!< TXFIFO reaches 3/4 of its depth */ #define SMARTCARD_TXFIFO_THRESHOLD_7_8 USART_CR3_TXFTCFG_2 /*!< TXFIFO reaches 7/8 of its depth */ #define SMARTCARD_TXFIFO_THRESHOLD_8_8 (USART_CR3_TXFTCFG_2|USART_CR3_TXFTCFG_0) /*!< TXFIFO becomes empty */ /** * @} */ /** @defgroup SMARTCARDEx_RXFIFO_threshold_level SMARTCARD RXFIFO threshold level * @brief SMARTCARD RXFIFO level * @{ */ #define SMARTCARD_RXFIFO_THRESHOLD_1_8 0x00000000U /*!< RXFIFO FIFO reaches 1/8 of its depth */ #define SMARTCARD_RXFIFO_THRESHOLD_1_4 USART_CR3_RXFTCFG_0 /*!< RXFIFO FIFO reaches 1/4 of its depth */ #define SMARTCARD_RXFIFO_THRESHOLD_1_2 USART_CR3_RXFTCFG_1 /*!< RXFIFO FIFO reaches 1/2 of its depth */ #define SMARTCARD_RXFIFO_THRESHOLD_3_4 (USART_CR3_RXFTCFG_0|USART_CR3_RXFTCFG_1) /*!< RXFIFO FIFO reaches 3/4 of its depth */ #define SMARTCARD_RXFIFO_THRESHOLD_7_8 USART_CR3_RXFTCFG_2 /*!< RXFIFO FIFO reaches 7/8 of its depth */ #define SMARTCARD_RXFIFO_THRESHOLD_8_8 (USART_CR3_RXFTCFG_2|USART_CR3_RXFTCFG_0) /*!< RXFIFO FIFO becomes full */ /** * @} */ /** @defgroup SMARTCARDEx_Flags SMARTCARD Flags * Elements values convention: 0xXXXX * - 0xXXXX : Flag mask in the ISR register * @{ */ #define SMARTCARD_FLAG_TCBGT USART_ISR_TCBGT /*!< SMARTCARD transmission complete before guard time completion */ #define SMARTCARD_FLAG_REACK USART_ISR_REACK /*!< SMARTCARD receive enable acknowledge flag */ #define SMARTCARD_FLAG_TEACK USART_ISR_TEACK /*!< SMARTCARD transmit enable acknowledge flag */ #define SMARTCARD_FLAG_BUSY USART_ISR_BUSY /*!< SMARTCARD busy flag */ #define SMARTCARD_FLAG_EOBF USART_ISR_EOBF /*!< SMARTCARD end of block flag */ #define SMARTCARD_FLAG_RTOF USART_ISR_RTOF /*!< SMARTCARD receiver timeout flag */ #define SMARTCARD_FLAG_TXE USART_ISR_TXE_TXFNF /*!< SMARTCARD transmit data register empty */ #define SMARTCARD_FLAG_TXFNF USART_ISR_TXE_TXFNF /*!< SMARTCARD TXFIFO not full */ #define SMARTCARD_FLAG_TC USART_ISR_TC /*!< SMARTCARD transmission complete */ #define SMARTCARD_FLAG_RXNE USART_ISR_RXNE_RXFNE /*!< SMARTCARD read data register not empty */ #define SMARTCARD_FLAG_RXFNE USART_ISR_RXNE_RXFNE /*!< SMARTCARD RXFIFO not empty */ #define SMARTCARD_FLAG_IDLE USART_ISR_IDLE /*!< SMARTCARD idle line detection */ #define SMARTCARD_FLAG_ORE USART_ISR_ORE /*!< SMARTCARD overrun error */ #define SMARTCARD_FLAG_NE USART_ISR_NE /*!< SMARTCARD noise error */ #define SMARTCARD_FLAG_FE USART_ISR_FE /*!< SMARTCARD frame error */ #define SMARTCARD_FLAG_PE USART_ISR_PE /*!< SMARTCARD parity error */ #define SMARTCARD_FLAG_TXFE USART_ISR_TXFE /*!< SMARTCARD TXFIFO Empty flag */ #define SMARTCARD_FLAG_RXFF USART_ISR_RXFF /*!< SMARTCARD RXFIFO Full flag */ #define SMARTCARD_FLAG_RXFT USART_ISR_RXFT /*!< SMARTCARD RXFIFO threshold flag */ #define SMARTCARD_FLAG_TXFT USART_ISR_TXFT /*!< SMARTCARD TXFIFO threshold flag */ /** * @} */ /** @defgroup SMARTCARDEx_Interrupt_definition SMARTCARD Interrupts Definition * Elements values convention: 000ZZZZZ0XXYYYYYb * - YYYYY : Interrupt source position in the XX register (5 bits) * - XX : Interrupt source register (2 bits) * - 01: CR1 register * - 10: CR2 register * - 11: CR3 register * - ZZZZZ : Flag position in the ISR register(5 bits) * @{ */ #define SMARTCARD_IT_PE 0x0028U /*!< SMARTCARD parity error interruption */ #define SMARTCARD_IT_TXE 0x0727U /*!< SMARTCARD transmit data register empty interruption */ #define SMARTCARD_IT_TXFNF 0x0727U /*!< SMARTCARD TX FIFO not full interruption */ #define SMARTCARD_IT_TC 0x0626U /*!< SMARTCARD transmission complete interruption */ #define SMARTCARD_IT_RXNE 0x0525U /*!< SMARTCARD read data register not empty interruption */ #define SMARTCARD_IT_RXFNE 0x0525U /*!< SMARTCARD RXFIFO not empty interruption */ #define SMARTCARD_IT_IDLE 0x0424U /*!< SMARTCARD idle line detection interruption */ #define SMARTCARD_IT_ERR 0x0060U /*!< SMARTCARD error interruption */ #define SMARTCARD_IT_ORE 0x0300U /*!< SMARTCARD overrun error interruption */ #define SMARTCARD_IT_NE 0x0200U /*!< SMARTCARD noise error interruption */ #define SMARTCARD_IT_FE 0x0100U /*!< SMARTCARD frame error interruption */ #define SMARTCARD_IT_EOB 0x0C3BU /*!< SMARTCARD end of block interruption */ #define SMARTCARD_IT_RTO 0x0B3AU /*!< SMARTCARD receiver timeout interruption */ #define SMARTCARD_IT_TCBGT 0x1978U /*!< SMARTCARD transmission complete before guard time completion interruption */ #define SMARTCARD_IT_RXFF 0x183FU /*!< SMARTCARD RXFIFO full interruption */ #define SMARTCARD_IT_TXFE 0x173EU /*!< SMARTCARD TXFIFO empty interruption */ #define SMARTCARD_IT_RXFT 0x1A7CU /*!< SMARTCARD RXFIFO threshold reached interruption */ #define SMARTCARD_IT_TXFT 0x1B77U /*!< SMARTCARD TXFIFO threshold reached interruption */ /** * @} */ /** @defgroup SMARTCARDEx_IT_CLEAR_Flags SMARTCARD Interruption Clear Flags * @{ */ #define SMARTCARD_CLEAR_PEF USART_ICR_PECF /*!< SMARTCARD parity error clear flag */ #define SMARTCARD_CLEAR_FEF USART_ICR_FECF /*!< SMARTCARD framing error clear flag */ #define SMARTCARD_CLEAR_NEF USART_ICR_NECF /*!< SMARTCARD noise error detected clear flag */ #define SMARTCARD_CLEAR_OREF USART_ICR_ORECF /*!< SMARTCARD overrun error clear flag */ #define SMARTCARD_CLEAR_IDLEF USART_ICR_IDLECF /*!< SMARTCARD idle line detected clear flag */ #define SMARTCARD_CLEAR_TXFECF USART_ICR_TXFECF /*!< TXFIFO empty Clear Flag */ #define SMARTCARD_CLEAR_TCF USART_ICR_TCCF /*!< SMARTCARD transmission complete clear flag */ #define SMARTCARD_CLEAR_TCBGTF USART_ICR_TCBGTCF /*!< SMARTCARD transmission complete before guard time completion clear flag */ #define SMARTCARD_CLEAR_RTOF USART_ICR_RTOCF /*!< SMARTCARD receiver time out clear flag */ #define SMARTCARD_CLEAR_EOBF USART_ICR_EOBCF /*!< SMARTCARD end of block clear flag */ /** * @} */ /** * @} */ /* Exported macros -----------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/ /** @defgroup SMARTCARDEx_Private_Macros SMARTCARD Extended Private Macros * @{ */ /** @brief Set the Transmission Completion flag * @param __HANDLE__ specifies the SMARTCARD Handle. * @note If TCBGT (Transmission Complete Before Guard Time) flag is not available or if * AdvancedInit.TxCompletionIndication is not already filled, the latter is forced * to SMARTCARD_TC (transmission completion indication when guard time has elapsed). * @retval None */ #define SMARTCARD_TRANSMISSION_COMPLETION_SETTING(__HANDLE__) \ do { \ if (HAL_IS_BIT_CLR((__HANDLE__)->AdvancedInit.AdvFeatureInit, SMARTCARD_ADVFEATURE_TXCOMPLETION)) \ { \ (__HANDLE__)->AdvancedInit.TxCompletionIndication = SMARTCARD_TC; \ } \ else \ { \ assert_param(IS_SMARTCARD_TRANSMISSION_COMPLETION((__HANDLE__)->AdvancedInit.TxCompletionIndication)); \ } \ } while(0U) /** @brief Return the transmission completion flag. * @param __HANDLE__ specifies the SMARTCARD Handle. * @note Based on AdvancedInit.TxCompletionIndication setting, return TC or TCBGT flag. * When TCBGT flag (Transmission Complete Before Guard Time) is not available, TC flag is * reported. * @retval Transmission completion flag */ #define SMARTCARD_TRANSMISSION_COMPLETION_FLAG(__HANDLE__) \ (((__HANDLE__)->AdvancedInit.TxCompletionIndication == SMARTCARD_TC) ? (SMARTCARD_FLAG_TC) : (SMARTCARD_FLAG_TCBGT)) /** @brief Ensure that SMARTCARD frame transmission completion used flag is valid. * @param __TXCOMPLETE__ SMARTCARD frame transmission completion used flag. * @retval SET (__TXCOMPLETE__ is valid) or RESET (__TXCOMPLETE__ is invalid) */ #define IS_SMARTCARD_TRANSMISSION_COMPLETION(__TXCOMPLETE__) (((__TXCOMPLETE__) == SMARTCARD_TCBGT) || \ ((__TXCOMPLETE__) == SMARTCARD_TC)) /** @brief Ensure that SMARTCARD FIFO mode is valid. * @param __STATE__ SMARTCARD FIFO mode. * @retval SET (__STATE__ is valid) or RESET (__STATE__ is invalid) */ #define IS_SMARTCARD_FIFOMODE_STATE(__STATE__) (((__STATE__) == SMARTCARD_FIFOMODE_DISABLE ) || \ ((__STATE__) == SMARTCARD_FIFOMODE_ENABLE)) /** @brief Ensure that SMARTCARD TXFIFO threshold level is valid. * @param __THRESHOLD__ SMARTCARD TXFIFO threshold level. * @retval SET (__THRESHOLD__ is valid) or RESET (__THRESHOLD__ is invalid) */ #define IS_SMARTCARD_TXFIFO_THRESHOLD(__THRESHOLD__) (((__THRESHOLD__) == SMARTCARD_TXFIFO_THRESHOLD_1_8) || \ ((__THRESHOLD__) == SMARTCARD_TXFIFO_THRESHOLD_1_4) || \ ((__THRESHOLD__) == SMARTCARD_TXFIFO_THRESHOLD_1_2) || \ ((__THRESHOLD__) == SMARTCARD_TXFIFO_THRESHOLD_3_4) || \ ((__THRESHOLD__) == SMARTCARD_TXFIFO_THRESHOLD_7_8) || \ ((__THRESHOLD__) == SMARTCARD_TXFIFO_THRESHOLD_8_8)) /** @brief Ensure that SMARTCARD RXFIFO threshold level is valid. * @param __THRESHOLD__ SMARTCARD RXFIFO threshold level. * @retval SET (__THRESHOLD__ is valid) or RESET (__THRESHOLD__ is invalid) */ #define IS_SMARTCARD_RXFIFO_THRESHOLD(__THRESHOLD__) (((__THRESHOLD__) == SMARTCARD_RXFIFO_THRESHOLD_1_8) || \ ((__THRESHOLD__) == SMARTCARD_RXFIFO_THRESHOLD_1_4) || \ ((__THRESHOLD__) == SMARTCARD_RXFIFO_THRESHOLD_1_2) || \ ((__THRESHOLD__) == SMARTCARD_RXFIFO_THRESHOLD_3_4) || \ ((__THRESHOLD__) == SMARTCARD_RXFIFO_THRESHOLD_7_8) || \ ((__THRESHOLD__) == SMARTCARD_RXFIFO_THRESHOLD_8_8)) /** * @} */ /* Exported functions --------------------------------------------------------*/ /** @addtogroup SMARTCARDEx_Exported_Functions * @{ */ /* Initialization and de-initialization functions ****************************/ /* IO operation methods *******************************************************/ /** @addtogroup SMARTCARDEx_Exported_Functions_Group1 * @{ */ /* Peripheral Control functions ***********************************************/ void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t BlockLength); void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint32_t TimeOutValue); HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard); HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard); /** * @} */ /* Exported functions --------------------------------------------------------*/ /** @addtogroup SMARTCARDEx_Exported_Functions_Group2 * @{ */ /* IO operation functions *****************************************************/ void HAL_SMARTCARDEx_RxFifoFullCallback(SMARTCARD_HandleTypeDef *hsmartcard); void HAL_SMARTCARDEx_TxFifoEmptyCallback(SMARTCARD_HandleTypeDef *hsmartcard); /** * @} */ /** @addtogroup SMARTCARDEx_Exported_Functions_Group3 * @{ */ /* Peripheral Control functions ***********************************************/ HAL_StatusTypeDef HAL_SMARTCARDEx_EnableFifoMode(SMARTCARD_HandleTypeDef *hsmartcard); HAL_StatusTypeDef HAL_SMARTCARDEx_DisableFifoMode(SMARTCARD_HandleTypeDef *hsmartcard); HAL_StatusTypeDef HAL_SMARTCARDEx_SetTxFifoThreshold(SMARTCARD_HandleTypeDef *hsmartcard, uint32_t Threshold); HAL_StatusTypeDef HAL_SMARTCARDEx_SetRxFifoThreshold(SMARTCARD_HandleTypeDef *hsmartcard, uint32_t Threshold); /** * @} */ /** * @} */ /* Private functions ---------------------------------------------------------*/ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* STM32G4xx_HAL_SMARTCARD_EX_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
prefetchnta/crhack
src/naked/arm-stm32/stm32g4xx/stm32g4xx_hal_smartcard_ex.h
C
lgpl-2.1
18,955
/// \file /// \ingroup tutorial_spectrum /// \notebook /// /// This macro fits the source spectrum using the AWMI algorithm /// from the "TSpectrumFit" class ("TSpectrum" class is used to find peaks). /// /// To try this macro, in a ROOT (5 or 6) prompt, do: /// /// ~~~{.cpp} /// root > .x FitAwmi.C /// ~~~ /// /// or: /// /// ~~~{.cpp} /// root > .x FitAwmi.C++ /// root > FitAwmi(); // re-run with another random set of peaks /// ~~~ /// /// \macro_image /// \macro_output /// \macro_code /// /// \author #include "TROOT.h" #include "TMath.h" #include "TRandom.h" #include "TH1.h" #include "TF1.h" #include "TCanvas.h" #include "TSpectrum.h" #include "TSpectrumFit.h" #include "TPolyMarker.h" #include "TList.h" #include <iostream> TH1F *FitAwmi_Create_Spectrum(void) { Int_t nbins = 1000; Double_t xmin = -10., xmax = 10.; delete gROOT->FindObject("h"); // prevent "memory leak" TH1F *h = new TH1F("h", "simulated spectrum", nbins, xmin, xmax); h->SetStats(kFALSE); TF1 f("f", "TMath::Gaus(x, [0], [1], 1)", xmin, xmax); // f.SetParNames("mean", "sigma"); gRandom->SetSeed(0); // make it really random // create well separated peaks with exactly known means and areas // note: TSpectrumFit assumes that all peaks have the same sigma Double_t sigma = (xmax - xmin) / Double_t(nbins) * Int_t(gRandom->Uniform(2., 6.)); Int_t npeaks = 0; while (xmax > (xmin + 6. * sigma)) { npeaks++; xmin += 3. * sigma; // "mean" f.SetParameters(xmin, sigma); Double_t area = 1. * Int_t(gRandom->Uniform(1., 11.)); h->Add(&f, area, ""); // "" ... or ... "I" std::cout << "created " << xmin << " " << (area / sigma / TMath::Sqrt(TMath::TwoPi())) << " " << area << std::endl; xmin += 3. * sigma; } std::cout << "the total number of created peaks = " << npeaks << " with sigma = " << sigma << std::endl; return h; } void FitAwmi(void) { TH1F *h = FitAwmi_Create_Spectrum(); TCanvas *cFit = ((TCanvas *)(gROOT->GetListOfCanvases()->FindObject("cFit"))); if (!cFit) cFit = new TCanvas("cFit", "cFit", 10, 10, 1000, 700); else cFit->Clear(); h->Draw("L"); Int_t i, nfound, bin; Int_t nbins = h->GetNbinsX(); #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,00) // ROOT 6 Double_t *source = new Double_t[nbins]; Double_t *dest = new Double_t[nbins]; #else // ROOT 5 Float_t *source = new Float_t[nbins]; Float_t *dest = new Float_t[nbins]; #endif for (i = 0; i < nbins; i++) source[i] = h->GetBinContent(i + 1); TSpectrum *s = new TSpectrum(); // note: default maxpositions = 100 // searching for candidate peaks positions nfound = s->SearchHighRes(source, dest, nbins, 2., 2., kFALSE, 10000, kFALSE, 0); // filling in the initial estimates of the input parameters Bool_t *FixPos = new Bool_t[nfound]; Bool_t *FixAmp = new Bool_t[nfound]; for(i = 0; i < nfound; i++) FixAmp[i] = FixPos[i] = kFALSE; #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,00) Double_t *Pos, *Amp = new Double_t[nfound]; // ROOT 6 #else Float_t *Pos, *Amp = new Float_t[nfound]; // ROOT 5 #endif Pos = s->GetPositionX(); // 0 ... (nbins - 1) for (i = 0; i < nfound; i++) { bin = 1 + Int_t(Pos[i] + 0.5); // the "nearest" bin Amp[i] = h->GetBinContent(bin); } TSpectrumFit *pfit = new TSpectrumFit(nfound); pfit->SetFitParameters(0, (nbins - 1), 1000, 0.1, pfit->kFitOptimChiCounts, pfit->kFitAlphaHalving, pfit->kFitPower2, pfit->kFitTaylorOrderFirst); pfit->SetPeakParameters(2., kFALSE, Pos, FixPos, Amp, FixAmp); // pfit->SetBackgroundParameters(source[0], kFALSE, 0., kFALSE, 0., kFALSE); pfit->FitAwmi(source); Double_t *Positions = pfit->GetPositions(); Double_t *PositionsErrors = pfit->GetPositionsErrors(); Double_t *Amplitudes = pfit->GetAmplitudes(); Double_t *AmplitudesErrors = pfit->GetAmplitudesErrors(); Double_t *Areas = pfit->GetAreas(); Double_t *AreasErrors = pfit->GetAreasErrors(); delete gROOT->FindObject("d"); // prevent "memory leak" TH1F *d = new TH1F(*h); d->SetNameTitle("d", ""); d->Reset("M"); for (i = 0; i < nbins; i++) d->SetBinContent(i + 1, source[i]); Double_t x1 = d->GetBinCenter(1), dx = d->GetBinWidth(1); Double_t sigma, sigmaErr; pfit->GetSigma(sigma, sigmaErr); // current TSpectrumFit needs a sqrt(2) correction factor for sigma sigma /= TMath::Sqrt2(); sigmaErr /= TMath::Sqrt2(); // convert "bin numbers" into "x-axis values" sigma *= dx; sigmaErr *= dx; std::cout << "the total number of found peaks = " << nfound << " with sigma = " << sigma << " (+-" << sigmaErr << ")" << std::endl; std::cout << "fit chi^2 = " << pfit->GetChi() << std::endl; for (i = 0; i < nfound; i++) { bin = 1 + Int_t(Positions[i] + 0.5); // the "nearest" bin Pos[i] = d->GetBinCenter(bin); Amp[i] = d->GetBinContent(bin); // convert "bin numbers" into "x-axis values" Positions[i] = x1 + Positions[i] * dx; PositionsErrors[i] *= dx; Areas[i] *= dx; AreasErrors[i] *= dx; std::cout << "found " << Positions[i] << " (+-" << PositionsErrors[i] << ") " << Amplitudes[i] << " (+-" << AmplitudesErrors[i] << ") " << Areas[i] << " (+-" << AreasErrors[i] << ")" << std::endl; } d->SetLineColor(kRed); d->SetLineWidth(1); d->Draw("SAME L"); TPolyMarker *pm = ((TPolyMarker*)(h->GetListOfFunctions()->FindObject("TPolyMarker"))); if (pm) { h->GetListOfFunctions()->Remove(pm); delete pm; } pm = new TPolyMarker(nfound, Pos, Amp); h->GetListOfFunctions()->Add(pm); pm->SetMarkerStyle(23); pm->SetMarkerColor(kRed); pm->SetMarkerSize(1); // cleanup delete pfit; delete [] Amp; delete [] FixAmp; delete [] FixPos; delete s; delete [] dest; delete [] source; return; }
tc3t/qoot
tutorials/spectrum/FitAwmi.C
C++
lgpl-2.1
6,020
/* * Created on: May 10, 2012 * Author: mdonahue * * Copyright (C) 2012-2016 VMware, Inc. All rights reserved. -- VMware Confidential */ #ifndef AMQPIMPL_H_ #define AMQPIMPL_H_ #include "amqpClient/amqpImpl/IContentHeader.h" #include "amqpClient/amqpImpl/IMethod.h" namespace Caf { namespace AmqpClient { /** * @author mdonahue * @ingroup AmqpApiImpl * @remark LIBRARY IMPLEMENTATION - NOT PART OF THE PUBLIC API * @brief A set of helpers to convert c-api data structures into C++ objects */ class AMQPImpl { public: /** * @brief Convert a c-api method structure into the appropriate IMethod object * @param method c-api method data * @return IMethod object */ static SmartPtrIMethod methodFromFrame(const amqp_method_t * const method); /** * @brief Convert a c-api properties structure into the appropriate IContentHedaer object * @param properties c-api properties data * @return IContentHeader object */ static SmartPtrIContentHeader headerFromFrame(const SmartPtrCAmqpFrame& frame); }; }} #endif /* AMQPIMPL_H_ */
pexip/os-open-vm-tools
open-vm-tools/common-agent/Cpp/Communication/amqpCore/src/amqpClient/amqpImpl/AMQPImpl.h
C
lgpl-2.1
1,063
/* * BayesFactorsFrame.java * * Copyright (C) 2002-2007 Alexei Drummond and Andrew Rambaut * * This file is part of BEAST. * See the NOTICE file distributed with this work for additional * information regarding copyright ownership and licensing. * * BEAST 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 2 * of the License, or (at your option) any later version. * * BEAST 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 BEAST; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ package dr.app.tracer.analysis; import dr.inference.trace.MarginalLikelihoodAnalysis; import jam.framework.AuxilaryFrame; import jam.framework.DocumentFrame; import javax.swing.*; import javax.swing.plaf.BorderUIResource; import javax.swing.table.AbstractTableModel; import java.awt.*; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; public class BayesFactorsFrame extends AuxilaryFrame { private List<MarginalLikelihoodAnalysis> marginalLikelihoods = new ArrayList<MarginalLikelihoodAnalysis>(); private JPanel contentPanel; private JComboBox transformCombo; private BayesFactorsModel bayesFactorsModel; private JTable bayesFactorsTable; enum Transform { LOG10_BF("log10 Bayes Factors"), LN_BF("ln Bayes Factors"), BF("Bayes Factors"); Transform(String name) { this.name = name; } public String toString() { return name; } private String name; } public BayesFactorsFrame(DocumentFrame frame, String title, String info, boolean hasErrors) { super(frame); setTitle(title); bayesFactorsModel = new BayesFactorsModel(hasErrors); bayesFactorsTable = new JTable(bayesFactorsModel); bayesFactorsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); JScrollPane scrollPane1 = new JScrollPane(bayesFactorsTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); contentPanel = new JPanel(new BorderLayout(0, 0)); contentPanel.setOpaque(false); contentPanel.setBorder(new BorderUIResource.EmptyBorderUIResource( new java.awt.Insets(0, 0, 6, 0))); JToolBar toolBar = new JToolBar(); toolBar.setLayout(new FlowLayout(FlowLayout.LEFT)); toolBar.setFloatable(false); transformCombo = new JComboBox(Transform.values()); transformCombo.setFont(UIManager.getFont("SmallSystemFont")); JLabel label = new JLabel("Show:"); label.setFont(UIManager.getFont("SmallSystemFont")); label.setLabelFor(transformCombo); toolBar.add(label); toolBar.add(transformCombo); toolBar.add(new JToolBar.Separator(new Dimension(8, 8))); contentPanel.add(toolBar, BorderLayout.NORTH); transformCombo.addItemListener( new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent ev) { bayesFactorsModel.fireTableDataChanged(); } } ); JPanel panel1 = new JPanel(new BorderLayout(0, 0)); panel1.setOpaque(false); label = new JLabel(info); label.setFont(UIManager.getFont("SmallSystemFont")); panel1.add(label, BorderLayout.NORTH); panel1.add(scrollPane1, BorderLayout.CENTER); contentPanel.add(panel1, BorderLayout.CENTER); label = new JLabel("<html>Marginal likelihood estimated using the method Newton & Raftery <br>" + "(Newton M, Raftery A: Approximate Bayesian inference with the weighted likelihood bootstrap.<br>" + "Journal of the Royal Statistical Society, Series B 1994, 56:3-48)<br>" + "with the modifications proprosed by Suchard et al (2001, <i>MBE</i> <b>18</b>: 1001-1013)</html>"); label.setFont(UIManager.getFont("SmallSystemFont")); contentPanel.add(label, BorderLayout.SOUTH); setContentsPanel(contentPanel); getSaveAction().setEnabled(false); getSaveAsAction().setEnabled(false); getCutAction().setEnabled(false); getCopyAction().setEnabled(true); getPasteAction().setEnabled(false); getDeleteAction().setEnabled(false); getSelectAllAction().setEnabled(false); getFindAction().setEnabled(false); getZoomWindowAction().setEnabled(false); } public void addMarginalLikelihood(MarginalLikelihoodAnalysis marginalLikelihood) { this.marginalLikelihoods.add(marginalLikelihood); bayesFactorsModel.fireTableStructureChanged(); bayesFactorsTable.repaint(); } public void initializeComponents() { setSize(new Dimension(640, 480)); } public boolean useExportAction() { return true; } public JComponent getExportableComponent() { return contentPanel; } public void doCopy() { java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); java.awt.datatransfer.StringSelection selection = new java.awt.datatransfer.StringSelection(bayesFactorsModel.toString()); clipboard.setContents(selection, selection); } class BayesFactorsModel extends AbstractTableModel { String[] columnNames = {"Trace", "ln P(data | model)", "S.E."}; private DecimalFormat formatter2 = new DecimalFormat("####0.###"); private int columnCount; public BayesFactorsModel(boolean hasErrors) { this.columnCount = (hasErrors ? 3 : 2); } public int getColumnCount() { return columnCount + marginalLikelihoods.size(); } public int getRowCount() { return marginalLikelihoods.size(); } public Object getValueAt(int row, int col) { if (col == 0) { return marginalLikelihoods.get(row).getTraceName(); } if (col == 1) { return formatter2.format(marginalLikelihoods.get(row).getLogMarginalLikelihood()); } else if (columnCount > 2 && col == 2) { return " +/- " + formatter2.format(marginalLikelihoods.get(row).getBootstrappedSE()); } else { if (col - columnCount != row) { double lnML1 = marginalLikelihoods.get(row).getLogMarginalLikelihood(); double lnML2 = marginalLikelihoods.get(col - columnCount).getLogMarginalLikelihood(); double lnRatio = lnML1 - lnML2; double value; switch ((Transform) transformCombo.getSelectedItem()) { case BF: value = Math.exp(lnRatio); break; case LN_BF: value = lnRatio; break; case LOG10_BF: value = lnRatio / Math.log(10.0); break; default: throw new IllegalArgumentException("Unknown transform type"); } return formatter2.format(value); } else { return "-"; } } } public String getColumnName(int column) { if (column < columnCount) { return columnNames[column]; } return marginalLikelihoods.get(column - columnCount).getTraceName(); } public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(getColumnName(0)); for (int j = 1; j < getColumnCount(); j++) { buffer.append("\t"); buffer.append(getColumnName(j)); } buffer.append("\n"); for (int i = 0; i < getRowCount(); i++) { buffer.append(getValueAt(i, 0)); for (int j = 1; j < getColumnCount(); j++) { buffer.append("\t"); buffer.append(getValueAt(i, j)); } buffer.append("\n"); } return buffer.toString(); } } }
benb/beast-mcmc
src/dr/app/tracer/analysis/BayesFactorsFrame.java
Java
lgpl-2.1
8,990
using System; using System.Xml.Serialization; namespace MDFe.Classes.Informacoes { [Serializable] public class infLocalDescarrega { public string CEP { get; set; } [XmlIgnore] public decimal? latitude { get; set; } [XmlElement("latitude")] public string latitudeProxy { get { if (latitude == null) return null; return latitude.ToString(); } set { latitude = decimal.Parse(value); } } [XmlIgnore] public decimal? Longitude { get; set; } [XmlElement("Longitude")] public string LongitudeProxy { get { if (Longitude == null) return null; return Longitude.ToString(); } set { Longitude = decimal.Parse(value); } } } }
ernanisp/Zeus.Net.NFe.NFCe
MDFe.Classes/Informacoes/infLocalDescarrega.cs
C#
lgpl-2.1
901
package MinecartRouting.Flags; public enum Flags { ACCELERATION, LAUNCHER, CATCHER, SWITCH }
Obrekr/MinecartRouting
src/MinecartRouting/Flags/Flags.java
Java
lgpl-2.1
96
<?php /** * @author Laurent Jouanneau * @copyright 2015-2018 Laurent Jouanneau * @link http://www.jelix.org * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html */ /** */ class jfeedsModuleInstaller extends \Jelix\Installer\Module\Installer { function install(\Jelix\Installer\Module\API\InstallHelpers $helpers) { } }
jelix/feeds-module
jfeeds/install/install.php
PHP
lgpl-2.1
404
<?php // (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id$ //this script may only be included - so its better to die if called directly. if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) { header('location: index.php'); exit; } /** * Function to load jQuery code to insert an iconset icon into an element * Useful for when there's no other way to make 3rd party code consistent with the Tiki iconsets * * type - determines the js string that will be returned * iconname - set the icon to override the default * return - return the js code rather than add to the header * @param $params * @param $smarty * @return string * @throws Exception */ function smarty_function_js_insert_icon($params, $smarty) { if (! empty($params['type'])) { //set icon $iconmap = [ 'jscalendar' => 'calendar' ]; $iconname = ! empty($params['iconname']) ? $params['iconname'] : $iconmap[$params['type']]; $smarty->loadPlugin('smarty_function_icon'); $icon = smarty_function_icon(['name' => $iconname], $smarty); //set js switch ($params['type']) { case 'jscalendar': $js = "$('div.jscal > button.ui-datepicker-trigger').empty().append('$icon').addClass('btn btn-sm btn-link').css({'padding' : '0px', 'font-size': '16px'});"; break; } //load js if (! empty($js)) { if (isset($params['return']) && $params['return'] === 'y') { return $js; } else { $headerlib = TikiLib::lib('header'); $headerlib->add_jq_onready($js); } } } }
tikiorg/tiki
lib/smarty_tiki/function.js_insert_icon.php
PHP
lgpl-2.1
1,706
/*! * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program 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. * * Copyright (c) 2005-2017 Hitachi Vantara.. All rights reserved. */ package org.pentaho.reporting.engine.classic.extensions.modules.mailer.parser; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; import java.util.Properties; import org.apache.xerces.util.AttributesProxy; import org.apache.xerces.util.XMLAttributesImpl; import org.apache.xerces.xni.QName; import org.junit.Before; import org.junit.Test; import org.pentaho.reporting.libraries.xmlns.parser.RootXmlReadHandler; import org.pentaho.reporting.libraries.xmlns.parser.XmlReadHandler; import org.xml.sax.SAXException; public class SessionPropertiesReadHandlerTest { private static final String URI = "test/uri"; private static final String TAG_NAME = "tag"; private static final String ATTR_TYPE = "string"; private static final String PROP_NAME = "test-name"; private static final String PROP_VALUE = "test_val"; private SessionPropertiesReadHandler handler; private RootXmlReadHandler rootXmlReadHandler; @Before public void setUp() throws Exception { rootXmlReadHandler = mock( RootXmlReadHandler.class ); handler = new SessionPropertiesReadHandler(); handler.init( rootXmlReadHandler, URI, TAG_NAME ); } @Test public void testGetHandlerForChild() throws SAXException { XmlReadHandler result = handler.getHandlerForChild( "incorrect", TAG_NAME, null ); assertThat( result, is( nullValue() ) ); result = handler.getHandlerForChild( URI, TAG_NAME, null ); assertThat( result, is( nullValue() ) ); result = handler.getHandlerForChild( URI, "property", null ); assertThat( result, is( instanceOf( SessionPropertyReadHandler.class ) ) ); } @Test public void testDoneParsing() throws SAXException { Object prop = handler.getObject(); assertThat( prop, is( nullValue() ) ); XMLAttributesImpl attrs = new XMLAttributesImpl(); attrs.addAttribute( new QName( null, "name", null, URI ), ATTR_TYPE, PROP_NAME ); attrs.addAttribute( new QName( null, "value", null, URI ), ATTR_TYPE, PROP_VALUE ); AttributesProxy fAttributesProxy = new AttributesProxy( attrs ); XmlReadHandler childHandler = handler.getHandlerForChild( URI, "property", null ); SessionPropertyReadHandler readHandler = (SessionPropertyReadHandler) childHandler; readHandler.init( rootXmlReadHandler, URI, TAG_NAME ); readHandler.startParsing( fAttributesProxy ); handler.doneParsing(); prop = handler.getObject(); assertThat( prop, is( instanceOf( Properties.class ) ) ); assertThat( ( (Properties) prop ).getProperty( PROP_NAME ), is( equalTo( PROP_VALUE ) ) ); } }
mbatchelor/pentaho-reporting
engine/extensions/src/test/java/org/pentaho/reporting/engine/classic/extensions/modules/mailer/parser/SessionPropertiesReadHandlerTest.java
Java
lgpl-2.1
3,617
Writing a Device Driver in RIOT {#driver-guide} =============================== This document describes the requirement, design objectives, and some non-function details when writing device drivers in/for RIOT. The term device driver in this context includes all 'CPU-external' devices connected to the CPU typically via peripherals like SPI, I2C, UART, GPIO, and similar. CPU peripherals itself are in RIOT not considered to be device drivers, but peripheral or low-level drivers. Typical devices are network devices like radios, Ethernet adapters, sensors, and actuators. [TOC] # General Design Objectives {#driver-guide-design-objectives} Device drivers should be as easy to use as possible. This implies an 'initialize->ready' paradigm, meaning, that device drivers should be ready to use and in operation right after they have been initialized. On top, devices should work with physical values wherever possible. So e.g. sensors should return already converted values in some physical unit instead of RAW data, so that users can work directly with data from different devices directly without having to care about device specific conversion. However, please avoid the use of `float` or `double`. Instead, multiply to the next SI (or appropriate) unit. E.g. if an ADC would return values like `1.23 V`, chose to return `1230 mV` instead. Additionally towards ease of use, all device drivers in RIOT should provide a similar 'look and feel'. They should behave similar concerning things like their state after initialization, like their used data representation and so on. Secondly, all device drivers should be optimized for minimal RAM/ROM usage, as RIOT targets (very) constrained devices. This implies, that instead of exposing all thinkable functionality, the drivers should focus on exporting and implementing a device's core functionality, thus covering ~95% of the use cases. Furthermore great care should be put into ...(?) Third, it should always be possible, to handle more than a single device of one kind. Drivers and their interfaces are thus designed to keep their state information in a parameterized location instead of driver defined global variables. Fourth, RIOT defines high-level interfaces for certain groups of devices (i.e. netdev for network devices, SAUL for sensors and actuators), which enable users to work with a wide variety of devices without having to know anything about the actual device that is mapped. Fifth, during initialization we make sure that we can communicate with a device. Other functions should check the dev pointer is not void, and should also handle error return values from the lower layer peripheral driver implementations, where there are some. Sixth, device drivers SHOULD be implemented independent of any CPU/board code. To achieve this, the driver implementations should strictly be based on platform independent interfaces as the peripheral drivers, xtimer, etc. # General {#driver-guide-general} ## Documentation {#driver-guide-doc} Document what your driver does! Most devices come with a very large number of features, while the corresponding device driver only supports a sub-set of them. This should be clearly stated in the device driver's documentation, so that anyone wanting to use the driver can find out the supported features without having to scan through the code. ## Device descriptor and parameter configuration {#driver-guide-types} Each device MUST supply a data structure, holding the devices state and configuration, using the naming scheme of `DEVNAME_t` (e.g. `dht_t`, or `at86rf2xx_t`). In the context of RIOT, we call this data structure the device descriptor. This device descriptor MUST contain all the state data of a device. By this, we are not limited on the number of instances of the driver we can run concurrently. The descriptor is hereby used for identifying the device we want to interact with, and SHOULD always be the first parameter for all device driver related functions. Typical things found in these descriptors are e.g. used peripherals (e.g. SPI or I2C bus used, interfacing GPIO pins), data buffers (e.g. RX/TX buffers where needed), or state machine information. On top of the device descriptor, each device driver MUST also define a data structure holding the needed configuration data. The naming scheme for this type is `DEVNAME_params_t`. In contrary to the device descriptor, this data structure should only contain static information, that is needed for the device initialization as it is preferably allocated in ROM. A simple I2C temperature sensors's device descriptor could look like this: @code{.c} typedef struct { tmpabc_params_t p; /**< device configuration parameter like I2C bus and bus addr */ int scale; /**< some custom scaling factor for converting the results */ } tmpabc_t; /* with params being */ typedef struct { i2c_t bus; /**< I2C bus the device is connected to */ uint8_t addr; /**< the device's address on the bus */ } tmpabc_params_t; @endcode **NOTE:** In many cases it makes sense, to copy the `xxx_params` data into the device descriptor during initialization. In some cases, it is however better to just link the `params` data via pointer and only copy selected data. This way, configuration data that is only used once can be read directly from ROM, while often used fields (e.g. used peripherals) are stored directly in the device descriptor and one saves hereby one de-referencing step when accessing them. ## Default device configuration {#driver-guide-config} Each device driver in RIOT MUST supply a default configuration file, named `DEVNAME_params.h`. This file should be located in the `RIOT/drivers/...`. The idea is, that this file can be overridden by an application or a board, by simply putting a file with the same name in the application's or the board's include folders, while RIOT's build system takes care of preferring those files instead of the default params file. A default parameter header file for the example temperature sensor above would look like this (`tmpabc_params.h`): @code{.c} /* ... */ #include "board.h" /* THIS INCLUDE IS MANDATORY */ #include "tmpabc.h" /* ... */ /** * @brief Default configuration parameters for TMPABC sensors * @{ */ #ifndef TMPABC_PARAM_I2C #define TMPABC_PARAM_I2C (I2C_DEV(0)) #endif #ifndef TMPABC_PARAM_ADDR #define TMPABC_PARAM_ADDR (0xab) #endif #ifndef TMPABC_PARAMS #define TMPABC_PARAMS { .i2c = TMPABC_PARAM_I2C \ .addr = TMPABC_PARAM_ADDR } #endif /** @} */ /** * @brief Allocation of TMPABC configuration */ static const tmpabc_params_t tmpabc_params[] = { TMPABC_PARAMS } /* ... */ @endcode Now to influence the default configuration parameters, we have these options: First, we can override one or more of the parameter from the makesystem, e.g. @code{.sh} CFLAGS="-DTMPABC_PARAM_ADDR=0x23" make all @endcode Second, we can override selected parameters from the board configuration (`board.h`): @code.{c} /* ... */ /** * @brief TMPABC sensor configuration * @{ */ #define TMPABC_PARAM_I2C (I2C_DEV(1)) #define TMPABC_PARAM_ADDR (0x17) /** @} */ /* ... */ @endcode Third, we can define more than a single device in the board configuration (`board.h`): @code{.c} /* ... */ /** * @brief Configure the on-board temperature sensors * @{ */ #define TMPABC_PARAMS { \ .i2c = I2C_DEV(1), \ .addr = 0x31 \ }, \ { \ .i2c = I2C_DEV(1), \ .addr = 0x21 \ } /** @} */ /* ... */ @endcode And finally, we can simply override the `tmpabc_params.h` file as described above. ## Initialization {#driver-guide-initialization} In general, the initialization functions should to the following: - initialize the device descriptor - initialize non-shared peripherals they use, e.g. GPIO pins - test for device connectivity, e.g. does a SPI/I2C slave react - reset the device to a well defined state, e.g. use external reset lines or do a software rest - do the actual device initialization For testing a device's connectivity, it is recommended to read certain configuration data with a defined value from the device. Some devices offer `WHO_AM_I` or `DEVICE_ID` registers for this purpose. Writing and reading back some data to the device is another valid option for testing it's responsiveness. For more detailed information on how the signature of the init functions should look like, please refer below to the specific requirements for network devices and sensors. ## Return values {#driver-guide-return-values} As stated above, we check communication of a device during initialization, and handle error return values from the lower layers, where they exist. To prevent subsequent misuse by passing NULL pointers and similar to the subsequent functions, the recommended way is to check parameter using `assert`, e.g.: @code{.c} int16_t tmpabc_read(const tmpabc_t *dev) { assert(dev); /* ... */ return value; } @endcode Whenever status/error return values are implemented by you in your driver, they should be named, meaning that the driver MUST define an enum assigning names to the actual used value, e.g. @code{.c} enum { TMPABC_OK = 0, /**< all went as expected */ TMPABC_NOI2C = -1, /**< error using the I2C bus */ TMPABC_NODEV = -2 /**< no device with the configured address found on the bus */ }; @endcode ## General Device Driver Checklist {#driver-guide-general-checklist} - *MUST*: the supported feature set and any custom behavior is clearly documented - *MUST*: device descriptor is defined: `devab_t` - *MUST*: device parameter `struct` is defined: `devab_params_t` - *MUST*: a default parameter configuration file is present, e.g. `RIOT/drivers/devab/include/devab_params.h` - *MUST*: all error and status return codes are named, e.g. `DEVAB_OK, DEVAB_NOSPI, DEVAB_OVERFLOW, ...` - *MUST*: use `const devab_t *dev` when the device descriptor can be access read-only ## Helper tools To help you start writing a device driver, the RIOT build system provides the `generate-driver` make target. It is a wrapper around the [riotgen](https://pypi.org/project/riotgen/) command line tool that is helpful when starting to implement a driver: all minimum files are generated with copyright headers, doxygen groups, etc, so you can concentrate on the driver implementation. **Usage:** From the RIOT base directory, run: ``` make generate-driver ``` Then answer a few questions about the driver: - Driver name: enter a name for your driver. It will be used as both the name of the driver directory where the source files are created and the build system module. - Driver doxygen group name: Enter the name of driver, as displayed in the Doxygen documentation. - Brief doxygen description: Describe in one line what is this driver about. - Parent driver Doxygen group: Enter the Doxygen group the driver belongs to. It can be `actuators`, `display`, `misc`, `netdev`, `sensors`, `storage`. Other global information (author name, email, organization) should be retrieved automatically from your git configuration. # Sensors {#driver-guide-sensors} ## SAUL {#driver-guide-saul} All sensor drivers SHOULD implement the SAUL interface. It is however recommended, that the drivers are written in a way, that the drivers do not solely export the SAUL interface, but map the SAUL interface upon a driver specific one. For example, a temperature driver provides the following function (`tmpabc.c`): @code{.c} int16_t tmpabc_read(tmpabc_t *dev); @endcode which then can easily be mapped to SAUL (`tmpabc_saul.c`): @code{.c} int saul_read(saul_t *dev, phydat_t *data) { memset(data, 0, sizeof(phydat_t)); data->x = tmpabc_read((tmpabc_t *)dev); data->unit = UNIT_TEMP_C; data->scale = -2; return 1; } @endcode This ensures the versatility of the device driver, having in mind that one might want to use the driver without SAUL or maybe in a context without RIOT. ## Initialization {#driver-guide-sensor-initialization} Sensor device drivers are expected to implement a single initialization function, `DEVNAME_init`, taking the device descriptor and the device's parameter struct as argument: @code{.c} int tmpabc_init(tmpabc_t *dev, const tmpabc_params_t *params); @endcode After this function is called, the device MUST be running and usable. ## Value handling {#driver-guide-sensor-value-handling} ### Value semantics {#driver-guide-sensor-value-semantics} All sensors in RIOT MUST return their reading results as real physical values. When working with sensor data, these are the values of interest, and the overhead of the conversion is normally neglectable. ### Typing {#driver-guide-sensor-types} All values SHOULD be returned using integer types, with `int16_t` being the preferred type where applicable. In many situations, the physical values cannot be mapped directly to integer values. For example, we do not want to map temperature values to integers directly while using their fraction. The recommended way to solve this is by scaling the result value using decimal fixed point arithmetic, in other words just return centi-degree instead of degree (e.g. 2372c°C instead of 23.72°C). ## Additional Sensor Driver Checklist {#driver-guide-sensor-checklist} - *MUST*: mandatory device parameters are configurable through this file, e.g. sampling rate, resolution, sensitivity - *MUST*: an init function in the style of `int devab_init(devab_t *dev, const devab_params_t *params);` exists - *MUST*: after initialization, the device must be operational - *MUST*: all error and return values are named, e.g. `DEVAB_OK, DEVAB_NODEV, ...` - *MUST*: all 'read' functions return values in their physical representation, e.g. `centi-degree, Pa, lux, mili-G` - *MUST*: all 'read' functions return integer values, preferably `int16_t` - *SHOULD*: if multiple dimensions are read, they SHOULD be combined into a data structure - *SHOULD*: the driver implements the SAUL interface - *SHOULD*: the driver exports functions for putting it to sleep and waking up the device # Network devices {#driver-guide-netdev} ## Initialization {#driver-guide-netdev-init} The initialization process MUST be split into 2 steps: first initialize the device descriptor and if applicable the used peripherals, and secondly do the actual device initialization. The reason for this is, that before a device is actually activated and can start to process data, the network stack for the device needs to be initialized. By supplying a second init function, that does the actual initialization, we can hand the control over when this is done to the actual network stacks. The initialization functions SHOULD follow this naming scheme: @code{.c} void netabc_setup(netabc_t *dev, const netabc_params_t *params); int netabs_init(netabc_t *dev); @endcode ## netdev {#driver-guide-netdev-interface} Device driver for network device SHOULD implement the `netdev` interface. It is up to the implementer, if the device driver also offers a device specific interface which is then mapped to the `netdev` interface, or if the device driver can be purely interfaced using `netdev`. While the second option is recommended for efficiency reasons, this is not mandatory. ## Additional Network Device Driver Checklist {#driver-guide-netdev-checklist} - *MUST*: a setup function in the style of `int devab_setup(devab_t *dev, const devab_params_t *params);` exists - *MUST*: an init function in the style of `int devnet_init(devnet_t *dev)` exists - *SHOULD*: the driver implements 'netdev' [if applicable] # TODO {#driver-guide-todo} Add some information about how to handle multiple threads, when to use mutexes, and how to deal with interrupts? And especially patterns for being nice from other threads and power consumption point of view...
basilfx/RIOT
doc/doxygen/src/driver-guide.md
Markdown
lgpl-2.1
16,788
/** ****************************************************************************** * @file hal_radio.c * @author AMG - RF Application team * @version V1.1.0 * @date 3-April-2018 * @brief BlueNRG-1,2 HAL radio APIs ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2017 STMicroelectronics</center></h2> ****************************************************************************** */ #include "hal_radio.h" static ActionPacket aPacket[2]; static uint32_t networkID = 0x88DF88DF; static uint8_t CondRoutineTrue(ActionPacket* p) { return TRUE; } static uint8_t dataRoutineNull(ActionPacket* current_action_packet, ActionPacket* next) { return TRUE; } static uint8_t CondRoutineRxTrue(ActionPacket* p) { /* received a packet */ if( ((p->status & BIT_TX_MODE) == 0) && ((p->status & IRQ_RCV_OK) != 0) ) { /* packet received without CRC error */ return TRUE; } return FALSE; } /** * @brief This routine sets the network ID field for packet transmission and filtering for the receiving. * Only two devices with same networkID can communicate with each other. * @param ID: network ID based on bluetooth specification: * 1. It shall have no more than six consecutive zeros or ones. * 2. It shall not have all four octets equal. * 3. It shall have no more than 24 transitions. * 4. It shall have a minimum of two transitions in the most significant six bits. * * @retval uint8_t: return value * - 0x00 : Success. * - 0xC0 : Invalid parameter. */ uint8_t HAL_RADIO_SetNetworkID(uint32_t ID) { networkID = ID; return 0; } /** * @brief This routine sends a packet on a specific channel and at a specific time. * @param channel: Frequency channel between 0 to 39. * @param wakeup_time: Time of transmission in us. This is relative time regarding now. * The relative time cannot be less than 100 us otherwise it might wrap around after 32.7 second. * @param txBuffer: Pointer to TX data buffer. Second byte of this buffer must be the length of the data. * @param Callback: This function is being called as data routine. * First ActionPacket is current action packet and the second one is next action packet. * @retval uint8_t return value * - 0x00 : Success. * - 0xC0 : Invalid parameter. * - 0xC4 : Radio is busy, receiving has not been triggered. */ uint8_t HAL_RADIO_SendPacket(uint8_t channel, uint32_t wakeup_time, uint8_t* txBuffer, uint8_t (*Callback)(ActionPacket*, ActionPacket*) ) { uint8_t returnValue = SUCCESS_0; uint32_t dummy; if(channel > 39) { returnValue = INVALID_PARAMETER_C0; } if(RADIO_GetStatus(&dummy) != BLUE_IDLE_0) { returnValue = RADIO_BUSY_C4; } if(returnValue == SUCCESS_0) { uint8_t map[5]= {0xFF,0xFF,0xFF,0xFF,0xFF}; RADIO_SetChannelMap(0, &map[0]); RADIO_SetChannel(0, channel, 0); RADIO_SetTxAttributes(0, networkID, 0x555555, SCA_DEFAULTVALUE); aPacket[0].StateMachineNo = STATE_MACHINE_0; aPacket[0].ActionTag = TXRX | PLL_TRIG | TIMER_WAKEUP | RELATIVE; aPacket[0].WakeupTime = wakeup_time; aPacket[0].ReceiveWindowLength = 0; /* does not affect for Tx */ aPacket[0].data = txBuffer; aPacket[0].next_true = NULL_0; aPacket[0].next_false = NULL_0; aPacket[0].condRoutine = CondRoutineTrue; aPacket[0].dataRoutine = Callback; RADIO_SetReservedArea(&aPacket[0]); returnValue = RADIO_MakeActionPacketPending(&aPacket[0]); } return returnValue; } /** * @brief This routine sends a packet on a specific channel and at a certain time then wait for receiving acknowledge. * @param channel: Frequency channel between 0 to 39. * @param wakeup_time: Time of transmission based on us. This is relative time regarding now. * The relative time cannot be less than 100 us otherwise it might wrap around after 32.7 second. * @param txBuffer: Pointer to TX data buffer. Secound byte of this buffer must be the length of the data. * @param rxBuffer: Pointer to RX data buffer. Secound byte of this buffer must be the length of the data. * @param receive_timeout: Time of RX window used to wait for the packet on us. * @param callback: This function is being called as data routine. * First ActionPacket is current action packet and the second one is next action packet. * @retval uint8_t return value * - 0x00 : Success. * - 0xC0 : Invalid parameter. * - 0xC4 : Radio is busy, receiving has not been triggered. */ uint8_t HAL_RADIO_SendPacketWithAck(uint8_t channel, uint32_t wakeup_time, uint8_t* txBuffer, uint8_t* rxBuffer, uint32_t receive_timeout, uint8_t (*Callback)(ActionPacket*, ActionPacket*) ) { uint8_t returnValue = SUCCESS_0; uint32_t dummy; if(channel > 39) { returnValue = INVALID_PARAMETER_C0; } if(RADIO_GetStatus(&dummy) != BLUE_IDLE_0) { returnValue = RADIO_BUSY_C4; } if(returnValue == SUCCESS_0) { uint8_t map[5]= {0xFF,0xFF,0xFF,0xFF,0xFF}; RADIO_SetChannelMap(0, &map[0]); RADIO_SetChannel(0, channel, 0); RADIO_SetTxAttributes(0, networkID, 0x555555, SCA_DEFAULTVALUE); aPacket[0].StateMachineNo = STATE_MACHINE_0; aPacket[0].ActionTag = TXRX | PLL_TRIG | TIMER_WAKEUP | RELATIVE; aPacket[0].WakeupTime = wakeup_time; aPacket[0].ReceiveWindowLength = 0; /* does not affect for Tx */ aPacket[0].data = txBuffer; aPacket[0].next_true = &aPacket[1]; aPacket[0].next_false = &aPacket[1]; aPacket[0].condRoutine = CondRoutineTrue; aPacket[0].dataRoutine = dataRoutineNull; aPacket[1].StateMachineNo = STATE_MACHINE_0; aPacket[1].ActionTag = 0; aPacket[1].WakeupTime = wakeup_time; aPacket[1].ReceiveWindowLength = receive_timeout; aPacket[1].data = rxBuffer; aPacket[1].next_true = NULL_0; aPacket[1].next_false = NULL_0; aPacket[1].condRoutine = CondRoutineTrue; aPacket[1].dataRoutine = Callback; RADIO_SetReservedArea(&aPacket[0]); RADIO_SetReservedArea(&aPacket[1]); returnValue = RADIO_MakeActionPacketPending(&aPacket[0]); } return returnValue; } /** * @brief This routine receives a packet on a specific channel and at a certain time. * @param channel: Frequency channel between 0 to 39. * @param wakeup_time: Time of transmission based on us. This is relative time regarding now. * The relative time cannot be less than 100 us otherwise it might wrap around after 32.7 second. * @param rxBuffer: Pointer to RX data buffer. Secound byte of this buffer must be the length of the data. * @param receive_timeout: Time of RX window used to wait for the packet on us. * @param callback: This function is being called as data routine. * First ActionPacket is current action packet and the second one is next action packet. * @retval uint8_t return value * - 0x00 : Success. * - 0xC0 : Invalid parameter. * - 0xC4 : Radio is busy, receiving has not been triggered. */ uint8_t HAL_RADIO_ReceivePacket(uint8_t channel, uint32_t wakeup_time, uint8_t* rxBuffer, uint32_t receive_timeout, uint8_t (*Callback)(ActionPacket*, ActionPacket*) ) { uint8_t returnValue = SUCCESS_0; uint32_t dummy; if(channel > 39) { returnValue = INVALID_PARAMETER_C0; } if(RADIO_GetStatus(&dummy) != BLUE_IDLE_0) { returnValue = RADIO_BUSY_C4; } if(returnValue == SUCCESS_0) { uint8_t map[5]= {0xFF,0xFF,0xFF,0xFF,0xFF}; RADIO_SetChannelMap(0, &map[0]); RADIO_SetChannel(0, channel, 0); RADIO_SetTxAttributes(0, networkID, 0x555555, SCA_DEFAULTVALUE); aPacket[0].StateMachineNo = STATE_MACHINE_0; aPacket[0].ActionTag = PLL_TRIG | TIMER_WAKEUP | RELATIVE; aPacket[0].WakeupTime = wakeup_time; aPacket[0].ReceiveWindowLength = receive_timeout; aPacket[0].data = rxBuffer; aPacket[0].next_true = NULL_0; aPacket[0].next_false = NULL_0; aPacket[0].condRoutine = CondRoutineTrue; aPacket[0].dataRoutine = Callback; RADIO_SetReservedArea(&aPacket[0]); returnValue = RADIO_MakeActionPacketPending(&aPacket[0]); } return returnValue; } /** * @brief This routine receives a packet on a specific channel and at a certain time. * Then sends a packet as an acknowledgment. * @param channel: frequency channel between 0 to 39. * @param wakeup_time: time of transmission based on us. This is relative time regarding now. * The relative time cannot be less than 100 us otherwise it might wrap around after 32.7 second. * @param rxBuffer: points to received data buffer. second byte of this buffer determines the length of the data. * @param txBuffer: points to data buffer to send. secound byte of this buffer must be the length of the buffer. * @param receive_timeout: Time of RX window used to wait for the packet on us. * @param callback: This function is being called as data routine. * First ActionPacket is current action packet and the second one is next action packet. * @retval uint8_t return value * - 0x00 : Success. * - 0xC0 : Invalid parameter. * - 0xC4 : Radio is busy, receiving has not been triggered. */ uint8_t HAL_RADIO_ReceivePacketWithAck(uint8_t channel, uint32_t wakeup_time, uint8_t* rxBuffer, uint8_t* txBuffer, uint32_t receive_timeout, uint8_t (*Callback)(ActionPacket*, ActionPacket*) ) { uint8_t returnValue = SUCCESS_0; uint32_t dummy; if(channel > 39) { returnValue = INVALID_PARAMETER_C0; } if(RADIO_GetStatus(&dummy) != BLUE_IDLE_0) { returnValue = RADIO_BUSY_C4; } if(returnValue == SUCCESS_0) { uint8_t map[5]= {0xFF,0xFF,0xFF,0xFF,0xFF}; RADIO_SetChannelMap(0, &map[0]); RADIO_SetChannel(0,channel,0); RADIO_SetTxAttributes(0, networkID,0x555555,SCA_DEFAULTVALUE); aPacket[0].StateMachineNo = STATE_MACHINE_0; aPacket[0].ActionTag = PLL_TRIG | TIMER_WAKEUP | RELATIVE; aPacket[0].WakeupTime = wakeup_time; aPacket[0].ReceiveWindowLength = receive_timeout; aPacket[0].data = rxBuffer; aPacket[0].next_true = &aPacket[1]; aPacket[0].next_false = NULL_0; aPacket[0].condRoutine = CondRoutineRxTrue; aPacket[0].dataRoutine = Callback; aPacket[1].StateMachineNo = STATE_MACHINE_0; aPacket[1].ActionTag = TXRX; aPacket[1].WakeupTime = wakeup_time; aPacket[1].ReceiveWindowLength = 0; /* does not affect for Tx */ aPacket[1].data = txBuffer; aPacket[1].next_true = NULL_0; aPacket[1].next_false = NULL_0; aPacket[1].condRoutine = CondRoutineTrue; aPacket[1].dataRoutine = Callback; RADIO_SetReservedArea(&aPacket[0]); RADIO_SetReservedArea(&aPacket[1]); returnValue = RADIO_MakeActionPacketPending(&aPacket[0]); } return returnValue; } /******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
prefetchnta/crhack
src/naked/arm-stm32/bluenrg1/ble/hal/src/hal_radio.c
C
lgpl-2.1
12,436
<?php if(!defined('__XE__')) exit(); $query = new Query(); $query->setQueryId("deletePackage"); $query->setAction("delete"); $query->setPriority(""); ${'path8_argument'} = new ConditionArgument('path', $args->path, 'equal'); ${'path8_argument'}->checkNotNull(); ${'path8_argument'}->createConditionValue(); if(!${'path8_argument'}->isValid()) return ${'path8_argument'}->getErrorMessage(); if(${'path8_argument'} !== null) ${'path8_argument'}->setColumnType('varchar'); $query->setTables(array( new Table('`xe_autoinstall_packages`', '`autoinstall_packages`') )); $query->setConditions(array( new ConditionGroup(array( new ConditionWithArgument('`path`',$path8_argument,"equal"))) )); $query->setGroups(array()); $query->setOrder(array()); $query->setLimit(); return $query; ?>
einsss/counsel_project
files/cache/queries/autoinstall.deletePackage.1.8.15.mysql_innodb.cache.php
PHP
lgpl-2.1
779
// Copyright (c) 1996-2010, Live Networks, Inc. All rights reserved // Version information for the LIVE555 Media Server application // Header file #ifndef _MEDIA_SERVER_VERSION_HH #define _MEDIA_SERVER_VERSION_HH #define MEDIA_SERVER_VERSION_STRING "0.5" #endif
willisyi/LiveServer
mediaServer/version.hh
C++
lgpl-2.1
266
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Content-Centric Networking in Java: org.ccnx.ccn.impl.security.crypto.KDFContentKeys Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main&nbsp;Page</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> <li><a href="namespaces.html"><span>Packages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li> <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li> </ul> </div> <div class="navpath"><b>org</b>.<b>ccnx</b>.<b>ccn</b>.<a class="el" href="namespaceorg_1_1ccnx_1_1ccn_1_1impl.html">impl</a>.<b>security</b>.<b>crypto</b>.<a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html">KDFContentKeys</a> </div> </div> <div class="contents"> <h1>org.ccnx.ccn.impl.security.crypto.KDFContentKeys Class Reference</h1><!-- doxytag: class="org::ccnx::ccn::impl::security::crypto::KDFContentKeys" --><!-- doxytag: inherits="org::ccnx::ccn::impl::security::crypto::EncryptedIVStaticContentKeys,Cloneable" --> <p>A subclass of <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_encrypted_i_v_static_content_keys.html" title="Specifies encryption algorithm, keys and if necessary IV to use for encrypting or...">EncryptedIVStaticContentKeys</a> that uses the methods from that class to derive a per-segment key and IV from a master seed, that itself is derived from content name and publisher information (plus a text label) using the key derivation function described in <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_key_derivation_function.html" title="This class takes a master symmetric key, and derives from it a key and initialization...">KeyDerivationFunction</a>. <a href="#_details">More...</a></p> <p><a href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html#a04f0f2931f8269a30d828d9d0a88326b">KDFContentKeys</a> (String encryptionAlgorithm, byte[] masterKey, String label) throws NoSuchAlgorithmException, NoSuchPaddingException </td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_encrypted_i_v_static_content_keys.html" title="Specifies encryption algorithm, keys and if necessary IV to use for encrypting or...">EncryptedIVStaticContentKeys</a> constructor. <a href="#a04f0f2931f8269a30d828d9d0a88326b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html#afef083981b45acd89e2be2d16eafb4ce">KDFContentKeys</a> (byte[] masterKey, String label) throws NoSuchAlgorithmException, NoSuchPaddingException </td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_encrypted_i_v_static_content_keys.html" title="Specifies encryption algorithm, keys and if necessary IV to use for encrypting or...">EncryptedIVStaticContentKeys</a> with the default algorithm. <a href="#afef083981b45acd89e2be2d16eafb4ce"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4e6d1fe46010ff265672e54c0d3dc20e"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::KDFContentKeys" ref="a4e6d1fe46010ff265672e54c0d3dc20e" args="(String encryptionAlgorithm, Key masterKey, String label)" --> &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html#a4e6d1fe46010ff265672e54c0d3dc20e">KDFContentKeys</a> (String encryptionAlgorithm, Key masterKey, String label) throws NoSuchAlgorithmException, NoSuchPaddingException </td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html" title="A subclass of EncryptedIVStaticContentKeys that uses the methods from that class...">KDFContentKeys</a> constructor. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a29454ddfa7653dd623c373ca2dd78c18"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::KDFContentKeys" ref="a29454ddfa7653dd623c373ca2dd78c18" args="(KDFContentKeys other)" --> &nbsp;</td><td class="memItemRight" valign="bottom"><b>KDFContentKeys</b> (<a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html">KDFContentKeys</a> other)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14e8f3e301e9ca2dc31529bc361dd967"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::KDFContentKeys" ref="a14e8f3e301e9ca2dc31529bc361dd967" args="(ContentKeys other, String label)" --> &nbsp;</td><td class="memItemRight" valign="bottom"><b>KDFContentKeys</b> (<a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_content_keys.html">ContentKeys</a> other, String label)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9b8951d2ceb46a5538356f5694724851"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::clone" ref="a9b8951d2ceb46a5538356f5694724851" args="()" --> <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html">KDFContentKeys</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>clone</b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1d349b9203f7806904bc01cf3d8a468f"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::getLabel" ref="a1d349b9203f7806904bc01cf3d8a468f" args="()" --> String&nbsp;</td><td class="memItemRight" valign="bottom"><b>getLabel</b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6458f4d4bbe7c1cacc0bfea295f1d4c"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::setLabel" ref="aa6458f4d4bbe7c1cacc0bfea295f1d4c" args="(String newLabel)" --> void&nbsp;</td><td class="memItemRight" valign="bottom"><b>setLabel</b> (String newLabel)</td></tr> <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static synchronized <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_content_keys.html">ContentKeys</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html#aaf391609687b3b8cf45bd8a2bf42465f">generateRandomKeys</a> (String label) throws NoSuchAlgorithmException, NoSuchPaddingException </td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a set of random encryption/decryption keys using the default algorithm. <a href="#aaf391609687b3b8cf45bd8a2bf42465f"></a><br/></td></tr> <tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa8fb551dd3a28b19315247d6d31a8aa2"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::getKeyAndIVForContent" ref="aa8fb551dd3a28b19315247d6d31a8aa2" args="(ContentName contentName, PublisherPublicKeyDigest publisher, long segmentNumber)" --> synchronized <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_content_keys_1_1_key_and_i_v.html">KeyAndIV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>getKeyAndIVForContent</b> (<a class="el" href="classorg_1_1ccnx_1_1ccn_1_1protocol_1_1_content_name.html">ContentName</a> contentName, <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1protocol_1_1_publisher_public_key_digest.html">PublisherPublicKeyDigest</a> publisher, long segmentNumber) throws InvalidKeyException, ContentEncodingException </td></tr> <tr><td colspan="2"><h2>Protected Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4fd74e3ed341301bfde500d757b6aff2"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::_label" ref="a4fd74e3ed341301bfde500d757b6aff2" args="" --> String&nbsp;</td><td class="memItemRight" valign="bottom"><b>_label</b></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>A subclass of <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_encrypted_i_v_static_content_keys.html" title="Specifies encryption algorithm, keys and if necessary IV to use for encrypting or...">EncryptedIVStaticContentKeys</a> that uses the methods from that class to derive a per-segment key and IV from a master seed, that itself is derived from content name and publisher information (plus a text label) using the key derivation function described in <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_key_derivation_function.html" title="This class takes a master symmetric key, and derives from it a key and initialization...">KeyDerivationFunction</a>. </p> <hr/><h2>Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a04f0f2931f8269a30d828d9d0a88326b"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::KDFContentKeys" ref="a04f0f2931f8269a30d828d9d0a88326b" args="(String encryptionAlgorithm, byte[] masterKey, String label)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">org.ccnx.ccn.impl.security.crypto.KDFContentKeys.KDFContentKeys </td> <td>(</td> <td class="paramtype">String&nbsp;</td> <td class="paramname"> <em>encryptionAlgorithm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">byte[]&nbsp;</td> <td class="paramname"> <em>masterKey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">String&nbsp;</td> <td class="paramname"> <em>label</em></td><td>&nbsp;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> throws NoSuchAlgorithmException, NoSuchPaddingException </td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_encrypted_i_v_static_content_keys.html" title="Specifies encryption algorithm, keys and if necessary IV to use for encrypting or...">EncryptedIVStaticContentKeys</a> constructor. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>encryptionAlgorithm</em>&nbsp;</td><td>(e.g. AES/CTR/NoPadding) the encryption algorithm to use. First component of algorithm should be the algorithm associated with the key. </td></tr> <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>key material to be used </td></tr> <tr><td valign="top"></td><td valign="top"><em>ivctr</em>&nbsp;</td><td>iv or counter material to be used with specified algorithm </td></tr> </table> </dd> </dl> <dl><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>NoSuchPaddingException</em>&nbsp;</td><td></td></tr> <tr><td valign="top"></td><td valign="top"><em>NoSuchAlgorithmException</em>&nbsp;</td><td></td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="afef083981b45acd89e2be2d16eafb4ce"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::KDFContentKeys" ref="afef083981b45acd89e2be2d16eafb4ce" args="(byte[] masterKey, String label)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">org.ccnx.ccn.impl.security.crypto.KDFContentKeys.KDFContentKeys </td> <td>(</td> <td class="paramtype">byte[]&nbsp;</td> <td class="paramname"> <em>masterKey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">String&nbsp;</td> <td class="paramname"> <em>label</em></td><td>&nbsp;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> throws NoSuchAlgorithmException, NoSuchPaddingException </td> </tr> </table> </div> <div class="memdoc"> <p>Create a <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_encrypted_i_v_static_content_keys.html" title="Specifies encryption algorithm, keys and if necessary IV to use for encrypting or...">EncryptedIVStaticContentKeys</a> with the default algorithm. </p> <dl><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>NoSuchPaddingException</em>&nbsp;</td><td></td></tr> <tr><td valign="top"></td><td valign="top"><em>NoSuchAlgorithmException</em>&nbsp;</td><td></td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="aaf391609687b3b8cf45bd8a2bf42465f"></a><!-- doxytag: member="org::ccnx::ccn::impl::security::crypto::KDFContentKeys::generateRandomKeys" ref="aaf391609687b3b8cf45bd8a2bf42465f" args="(String label)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static synchronized <a class="el" href="classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_content_keys.html">ContentKeys</a> org.ccnx.ccn.impl.security.crypto.KDFContentKeys.generateRandomKeys </td> <td>(</td> <td class="paramtype">String&nbsp;</td> <td class="paramname"> <em>label</em></td> <td>&nbsp;)&nbsp;</td> <td> throws NoSuchAlgorithmException, NoSuchPaddingException <code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create a set of random encryption/decryption keys using the default algorithm. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>a randomly-generated set of keys and IV that can be used for encryption </dd></dl> <dl><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>NoSuchPaddingException</em>&nbsp;</td><td></td></tr> <tr><td valign="top"></td><td valign="top"><em>NoSuchAlgorithmException</em>&nbsp;</td><td></td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>src/org/ccnx/ccn/impl/security/crypto/KDFContentKeys.java</li> </ul> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Aug 21 14:55:22 2012 for Content-Centric Networking in Java by&nbsp; <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>
ryanrhymes/mobiccnx
doc/javacode/html/classorg_1_1ccnx_1_1ccn_1_1impl_1_1security_1_1crypto_1_1_k_d_f_content_keys.html
HTML
lgpl-2.1
16,358
#!/bin/bash # # for platform in windows linux macosx; do pushd $platform; ls -l esptool-*; shasum -a 256 esptool-*; popd; done; # # ver=`git describe --tags` outdir=esp8266-$ver srcdir=../hardware/esp8266com/esp8266/ mkdir -p $outdir cp -R $srcdir/* $outdir/ cp -R ../libraries/SD $outdir/libraries/ cp -R ../libraries/Adafruit_ILI9341 $outdir/libraries/ cp -R ../libraries/OneWire $outdir/libraries/ cat $srcdir/platform.txt | \ gsed 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \ gsed 's/runtime.tools.esptool.path={runtime.platform.path}\/tools//g' | \ gsed 's/tools.esptool.path={runtime.platform.path}\/tools/tools.esptool.path=\{runtime.tools.esptool.path\}/g' \ > $outdir/platform.txt zip -r $outdir.zip $outdir rm -rf $outdir sha=`shasum -a 256 $outdir.zip | cut -f 1 -d ' '` size=`/bin/ls -l $outdir.zip | awk '{print $5}'` echo Size: $size echo SHA-256: $sha if [ "$upload" == "prod" ]; then remote="http://arduino.esp8266.com" path="" elif [ "$upload" == "stag" ]; then remote="http://arduino.esp8266.com" path="staging/" else upload="" remote="http://localhost:8000" fi cat << EOF > package_esp8266com_index.json { "packages": [ { "name":"esp8266", "maintainer":"ESP8266 Community", "websiteURL":"https://github.com/esp8266/Arduino", "email":"ivan@esp8266.com", "help":{ "online":"http://esp8266.com" }, "platforms": [ { "name":"esp8266", "architecture":"esp8266", "version":"$ver", "category":"ESP8266", "url":"$remote/$path/$outdir.zip", "archiveFileName":"$outdir.zip", "checksum":"SHA-256:$sha", "size":"$size", "help":{ "online":"http://esp8266.com" }, "boards":[ { "name":"Generic ESP8266 Module" }, { "name":"Olimex MOD-WIFI-ESP8266(-DEV)" }, { "name":"NodeMCU 0.9 (ESP-12 Module)" }, { "name":"NodeMCU 1.0 (ESP-12E Module)" }, { "name":"Adafruit HUZZAH ESP8266 (ESP-12)" } ], "toolsDependencies":[ { "packager":"esp8266", "name":"esptool", "version":"0.4.5" }, { "packager":"esp8266", "name":"xtensa-lx106-elf-gcc", "version":"1.20.0-26-gb404fb9" } ] } ], "tools": [ { "name":"esptool", "version":"0.4.5", "systems": [ { "host":"i686-mingw32", "url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-win32.zip", "archiveFileName":"esptool-0.4.5-win32.zip", "checksum":"SHA-256:1b0a7d254e74942d820a09281aa5dc2af1c8314ae5ee1a5abb0653d0580e531b", "size":"17408" }, { "host":"x86_64-apple-darwin", "url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-osx.tar.gz", "archiveFileName":"esptool-0.4.5-osx.tar.gz", "checksum":"SHA-256:924d31c64f4bb9f748e70806dafbabb15e5eb80afcdde33715f3ec884be1652d", "size":"11359" }, { "host":"x86_64-pc-linux-gnu", "url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-linux64.tar.gz", "archiveFileName":"esptool-0.4.5-linux64.tar.gz", "checksum":"SHA-256:4ce799e13fbd89f8a8f08a08db77dc3b1362c4486306fe1b3801dee80cfa3203", "size":"12789" }, { "host":"i686-pc-linux-gnu", "url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-linux32.tar.gz", "archiveFileName":"esptool-0.4.5-linux32.tar.gz", "checksum":"SHA-256:4aa81b97a470641771cf371e5d470ac92d3b177adbe8263c4aae66e607b67755", "size":"12044" } ] }, { "name":"xtensa-lx106-elf-gcc", "version":"1.20.0-26-gb404fb9", "systems": [ { "host":"i686-mingw32", "url":"http://arduino.esp8266.com/win32-xtensa-lx106-elf-gb404fb9.tar.gz", "archiveFileName":"win32-xtensa-lx106-elf-gb404fb9.tar.gz", "checksum":"SHA-256:1561ec85cc58cab35cc48bfdb0d0087809f89c043112a2c36b54251a13bf781f", "size":"153807368" }, { "host":"x86_64-apple-darwin", "url":"http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", "archiveFileName":"osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", "checksum":"SHA-256:0cf150193997bd1355e0f49d3d49711730035257bc1aee1eaaad619e56b9e4e6", "size":"35385382" }, { "host":"x86_64-pc-linux-gnu", "url":"http://arduino.esp8266.com/linux64-xtensa-lx106-elf-gb404fb9.tar.gz", "archiveFileName":"linux64-xtensa-lx106-elf-gb404fb9.tar.gz", "checksum":"SHA-256:46f057fbd8b320889a26167daf325038912096d09940b2a95489db92431473b7", "size":"30262903" }, { "host":"i686-pc-linux-gnu", "url":"http://arduino.esp8266.com/linux32-xtensa-lx106-elf.tar.gz", "archiveFileName":"linux32-xtensa-lx106-elf.tar.gz", "checksum":"SHA-256:b24817819f0078fb05895a640e806e0aca9aa96b47b80d2390ac8e2d9ddc955a", "size":"32734156" } ] } ] } ] } EOF if [ ! -z "$upload" ]; then remote_path=dl:apps/download_files/download/$path scp $outdir.zip $remote_path scp package_esp8266com_index.json $remote_path scp -r $srcdir/doc $remote_path else python -m SimpleHTTPServer fi
Protoneer/Arduino
build/build_board_manager_package.sh
Shell
lgpl-2.1
5,638
/* GDK - The GIMP Drawing Kit * Copyright (C) 2013 Jan Arne Petersen * * This library 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 2 of the License, or (at your option) any later version. * * This library 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 this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __GDK_WAYLAND_DEVICE_H__ #define __GDK_WAYLAND_DEVICE_H__ #if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdkwayland.h> can be included directly." #endif #include <gdk/gdk.h> #include <wayland-client.h> G_BEGIN_DECLS #ifdef GDK_COMPILATION typedef struct _GdkWaylandDevice GdkWaylandDevice; #else typedef GdkDevice GdkWaylandDevice; #endif typedef struct _GdkWaylandDeviceClass GdkWaylandDeviceClass; #define GDK_TYPE_WAYLAND_DEVICE (gdk_wayland_device_get_type ()) #define GDK_WAYLAND_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_WAYLAND_DEVICE, GdkWaylandDevice)) #define GDK_WAYLAND_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_WAYLAND_DEVICE, GdkWaylandDeviceClass)) #define GDK_IS_WAYLAND_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_WAYLAND_DEVICE)) #define GDK_IS_WAYLAND_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_WAYLAND_DEVICE)) #define GDK_WAYLAND_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_WAYLAND_DEVICE, GdkWaylandDeviceClass)) GDK_AVAILABLE_IN_ALL GType gdk_wayland_device_get_type (void); GDK_AVAILABLE_IN_ALL struct wl_seat *gdk_wayland_device_get_wl_seat (GdkDevice *device); GDK_AVAILABLE_IN_ALL struct wl_pointer *gdk_wayland_device_get_wl_pointer (GdkDevice *device); GDK_AVAILABLE_IN_ALL struct wl_keyboard *gdk_wayland_device_get_wl_keyboard (GdkDevice *device); GDK_AVAILABLE_IN_3_20 struct wl_seat *gdk_wayland_seat_get_wl_seat (GdkSeat *seat); G_END_DECLS #endif /* __GDK_WAYLAND_DEVICE_H__ */
grubersjoe/adwaita
gdk/wayland/gdkwaylanddevice.h
C
lgpl-2.1
2,380
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with ** the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef ORGANIZERITEMTRANSFORM_H_ #define ORGANIZERITEMTRANSFORM_H_ #include <QList> #include <qmobilityglobal.h> #include "qorganizeritemdetaildefinition.h" QTM_BEGIN_NAMESPACE class QOrganizerItem; QTM_END_NAMESPACE QTM_USE_NAMESPACE class CCalEntry; class CCalInstance; class OrganizerItemDetailTransform; class OrganizerItemTransform { public: OrganizerItemTransform(); ~OrganizerItemTransform(); void modifyBaseSchemaDefinitions(QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > &schemaDefs) const; void toEntryL(const QOrganizerItem &item, CCalEntry *entry); void toItemL(const CCalEntry &entry, QOrganizerItem *item) const; void toItemPostSaveL(const CCalEntry &entry, QOrganizerItem *item, QString managerUri) const; void toItemOccurrenceL(const CCalInstance &instance, QOrganizerItem *itemOccurrence) const; private: QList<OrganizerItemDetailTransform *> m_detailTransforms; }; #endif /* ORGANIZERITEMTRANSFORM_H_ */
robclark/qtmobility-1.1.0
plugins/organizer/symbian/organizeritemtransform.h
C
lgpl-2.1
2,941
<?php /** * Live Help online chat and stats * * @copyright Copyright (c) 2006 Live Help team; * @license LGPL+MIT License; */ if ( !defined('AREA') ) { die('Access denied'); } // // Static configuration // Registry::set('livehelp_config', array( 'freshness_time' => 5, 'freshness_time_operator' => 15, 'freshness_time_visitor' => 6, 'chat_interval' => 3000, 'obsolete_time' => 3, 'visitor_data_clean_period' => 86400, )); // // Directories // define('DIR_LH_UPLOADS', DIR_ROOT . '/var/lh_uploads'); // // Constants // // Visitor status define('LH_STATUS_IDLE', 0); define('LH_STATUS_WAITING', 1); define('LH_STATUS_CHATTING', 2); define('LH_STATUS_REQUEST_SENT', 3); define('LH_STATUS_DECLINED', 4); // Message directions define('LH_DIRECTION_VISITOR_OPERATOR', 0); define('LH_DIRECTION_OPERATOR_VISITOR', 1); define('LH_DIRECTION_OPERATOR_OPERATOR', 2); // Last messages map directions define('LH_DIRECTION_MAP_SESSIONS', 0); define('LH_DIRECTION_MAP_OPERATORS', 1); // Typing notifications define('LH_TYPING_ON', 1); define('LH_TYPING_OFF', -1); // Visitor logging events define('LH_LOG_CHAT_STARTED', 1); define('LH_LOG_OPERATOR_JOINED', 2); define('LH_LOG_SENT_INVITATION', 3); define('LH_LOG_ACCEPTED_INVITATION', 4); define('LH_LOG_DECLINED_INVITATION', 5); define('LH_LOG_PAGE_CHANGED', 11); // Auth result define('LH_AUTH_RESULT_OK', 1); define('LH_AUTH_RESULT_FAIL', 2); define('LH_AUTH_RESULT_ACTIVE', 3); ?>
cscart/livehelp
server/addons/live_help/config.php
PHP
lgpl-2.1
1,442
/* "polygonist", a framework for creating real-time graphics applications Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Aleksi Juvani <aleksi@aleksijuvani.com> This library 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 2.1 of the License, or (at your option) any later version. This library 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 this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include <list> #include <polygonist/polygonist.hpp> #include <polygonist/graphics/camera.hpp> #include <polygonist/ecs/entity.hpp> namespace polygonist { class entity; } namespace polygonist::graphics { class framebuffer; } namespace polygonist { class POLYGONIST_API scene { public: scene() = default; void add(std::shared_ptr<ecs::entity> entity); void remove(std::shared_ptr<ecs::entity> entity); void update(); void render(const graphics::framebuffer& framebuffer, const graphics::camera& camera, graphics::camera::render_flags_t render_flags = graphics::camera::render_flags_none) const; const std::list<std::shared_ptr<ecs::entity>>& get_entities(); const std::list<std::shared_ptr<const ecs::entity>>& get_entities() const; private: // Need to maintain two lists for const-correctness because of how // the standard containers work.. mutable std::list<std::shared_ptr<ecs::entity>> entities; mutable std::list<std::shared_ptr<const ecs::entity>> const_entities; }; }
aleksijuvani/polygonist
source/polygonist/scene.hpp
C++
lgpl-2.1
2,101
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_07) on Tue Jul 29 17:23:16 CEST 2008 --> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE> NotificationChannelTest (reader 0.5.1-SNAPSHOT Test API) </TITLE> <META NAME="date" CONTENT="2008-07-29"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="NotificationChannelTest (reader 0.5.1-SNAPSHOT Test API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NotificationChannelTest.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/fosstrak/reader/rprm/core/AntennaReadPointTest.html" title="class in org.fosstrak.reader.rprm.core"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/fosstrak/reader/rprm/core/ReaderDeviceTest.html" title="class in org.fosstrak.reader.rprm.core"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/fosstrak/reader/rprm/core/NotificationChannelTest.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NotificationChannelTest.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.fosstrak.reader.rprm.core</FONT> <BR> Class NotificationChannelTest</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by ">junit.framework.Assert <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by ">junit.framework.TestCase <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.fosstrak.reader.rprm.core.NotificationChannelTest</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>junit.framework.Test</DD> </DL> <HR> <DL> <DT><PRE>public class <B>NotificationChannelTest</B><DT>extends junit.framework.TestCase</DL> </PRE> <P> Tests for the class <code>org.fosstrak.reader.NotificationChannel</code>. <P> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#NotificationChannelTest()">NotificationChannelTest</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;args)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runs the test using the gui runner.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#setUp()">setUp</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets up the test.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#tearDown()">tearDown</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does the cleanup.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#testGetOperStatus()">testGetOperStatus</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests the <code>getOperStatus()</code> method.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#testIncreaseOperStateSuppressions()">testIncreaseOperStateSuppressions</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests the <code>increaseOperStateSuppressions()</code> method.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/fosstrak/reader/rprm/core/NotificationChannelTest.html#testResetOperStateSuppressions()">testResetOperStateSuppressions</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests the <code>resetOperStateSuppressions()</code> method.</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_junit.framework.TestCase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class junit.framework.TestCase</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString</CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_junit.framework.Assert"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class junit.framework.Assert</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail</CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="NotificationChannelTest()"><!-- --></A><H3> NotificationChannelTest</H3> <PRE> public <B>NotificationChannelTest</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setUp()"><!-- --></A><H3> setUp</H3> <PRE> protected final void <B>setUp</B>() throws java.lang.Exception</PRE> <DL> <DD>Sets up the test. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE>setUp</CODE> in class <CODE>junit.framework.TestCase</CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE> - An error occurred</DL> </DD> </DL> <HR> <A NAME="tearDown()"><!-- --></A><H3> tearDown</H3> <PRE> protected final void <B>tearDown</B>() throws java.lang.Exception</PRE> <DL> <DD>Does the cleanup. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE>tearDown</CODE> in class <CODE>junit.framework.TestCase</CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE> - An error occurred</DL> </DD> </DL> <HR> <A NAME="testGetOperStatus()"><!-- --></A><H3> testGetOperStatus</H3> <PRE> public final void <B>testGetOperStatus</B>()</PRE> <DL> <DD>Tests the <code>getOperStatus()</code> method. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testIncreaseOperStateSuppressions()"><!-- --></A><H3> testIncreaseOperStateSuppressions</H3> <PRE> public final void <B>testIncreaseOperStateSuppressions</B>()</PRE> <DL> <DD>Tests the <code>increaseOperStateSuppressions()</code> method. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testResetOperStateSuppressions()"><!-- --></A><H3> testResetOperStateSuppressions</H3> <PRE> public final void <B>testResetOperStateSuppressions</B>()</PRE> <DL> <DD>Tests the <code>resetOperStateSuppressions()</code> method. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="main(java.lang.String[])"><!-- --></A><H3> main</H3> <PRE> public static void <B>main</B>(java.lang.String[]&nbsp;args)</PRE> <DL> <DD>Runs the test using the gui runner. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>args</CODE> - No arguments</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NotificationChannelTest.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/fosstrak/reader/rprm/core/AntennaReadPointTest.html" title="class in org.fosstrak.reader.rprm.core"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/fosstrak/reader/rprm/core/ReaderDeviceTest.html" title="class in org.fosstrak.reader.rprm.core"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/fosstrak/reader/rprm/core/NotificationChannelTest.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NotificationChannelTest.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2008. All Rights Reserved. </BODY> </HTML>
Fosstrak/fosstrak.github.io
reader/testapidocs/org/fosstrak/reader/rprm/core/NotificationChannelTest.html
HTML
lgpl-2.1
16,178
#!/bin/bash set -e set +h function postinstall() { if ! grep dovecot /etc/group &> /dev/null; then groupadd -g 42 dovecot && useradd -c "Dovecot unprivileged user" -d /dev/null -u 42 \ -g dovecot -s /bin/false dovecot && groupadd -g 43 dovenull && useradd -c "Dovecot login user" -d /dev/null -u 43 \ -g dovenull -s /bin/false dovenull fi } preinstall() { echo "#" } $1
FluidIdeas/parsers
blfs-resources/extrascripts/dovecot-appconfig.sh
Shell
lgpl-2.1
395
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Qt 4.7: gradients.h Example File (demos/gradients/gradients.h)</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> </head> <body class="offline narrow creator"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li> <li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li> <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu sf-js-enabled sf-shadow" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul id="topmenuLook"> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="licensing.html">Licenses and Credits</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul id="topmenuTopic"> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UI's &amp; Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li> <li><a href="platform-specific.html">Platform-specific info</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul id="topmenuexample"> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UI's &amp; Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li> <li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Bread crumbs goes here --> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content"> <h1 class="title">gradients.h Example File</h1> <span class="small-subtitle">demos/gradients/gradients.h</span> <!-- $$$demos/gradients/gradients.h-description --> <div class="descr"> <a name="details"></a> <pre class="highlightedCode brush: cpp"><span class="comment"> /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/</span> #ifndef GRADIENTS_H #define GRADIENTS_H #include &quot;arthurwidgets.h&quot; #include &lt;QtGui&gt; class HoverPoints; class ShadeWidget : public QWidget { Q_OBJECT public: enum ShadeType { RedShade, GreenShade, BlueShade, ARGBShade }; ShadeWidget(ShadeType type, QWidget *parent); void setGradientStops(const QGradientStops &amp;stops); void paintEvent(QPaintEvent *e); QSize sizeHint() const { return QSize(150, 40); } QPolygonF points() const; HoverPoints *hoverPoints() const { return m_hoverPoints; } uint colorAt(int x); signals: void colorsChanged(); private: void generateShade(); ShadeType m_shade_type; QImage m_shade; HoverPoints *m_hoverPoints; QLinearGradient m_alpha_gradient; }; class GradientEditor : public QWidget { Q_OBJECT public: GradientEditor(QWidget *parent); void setGradientStops(const QGradientStops &amp;stops); public slots: void pointsUpdated(); signals: void gradientStopsChanged(const QGradientStops &amp;stops); private: ShadeWidget *m_red_shade; ShadeWidget *m_green_shade; ShadeWidget *m_blue_shade; ShadeWidget *m_alpha_shade; }; class GradientRenderer : public ArthurFrame { Q_OBJECT public: GradientRenderer(QWidget *parent); void paint(QPainter *p); QSize sizeHint() const { return QSize(400, 400); } HoverPoints *hoverPoints() const { return m_hoverPoints; } void mousePressEvent(QMouseEvent *e); public slots: void setGradientStops(const QGradientStops &amp;stops); void setPadSpread() { m_spread = QGradient::PadSpread; update(); } void setRepeatSpread() { m_spread = QGradient::RepeatSpread; update(); } void setReflectSpread() { m_spread = QGradient::ReflectSpread; update(); } void setLinearGradient() { m_gradientType = Qt::LinearGradientPattern; update(); } void setRadialGradient() { m_gradientType = Qt::RadialGradientPattern; update(); } void setConicalGradient() { m_gradientType = Qt::ConicalGradientPattern; update(); } private: QGradientStops m_stops; HoverPoints *m_hoverPoints; QGradient::Spread m_spread; Qt::BrushStyle m_gradientType; }; class GradientWidget : public QWidget { Q_OBJECT public: GradientWidget(QWidget *parent); public slots: void setDefault1() { setDefault(1); } void setDefault2() { setDefault(2); } void setDefault3() { setDefault(3); } void setDefault4() { setDefault(4); } private: void setDefault(int i); GradientRenderer *m_renderer; GradientEditor *m_editor; QRadioButton *m_linearButton; QRadioButton *m_radialButton; QRadioButton *m_conicalButton; QRadioButton *m_padSpreadButton; QRadioButton *m_reflectSpreadButton; QRadioButton *m_repeatSpreadButton; }; #endif <span class="comment">// GRADIENTS_H</span></pre> </div> <!-- @@@demos/gradients/gradients.h --> <div class="feedback t_button"> [+] Documentation Feedback</div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2008-2010 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.</p> <p> All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p> <br /> <p> Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.</p> <p> Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> </div> <div id="feedbackBox"> <div id="feedcloseX" class="feedclose t_button">X</div> <form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get"> <p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and requests, please use the <a href="http://bugreports.qt.nokia.com/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p> <p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p> <p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p> </form> </div> <div id="blurpage"> </div> </body> </html>
sunblithe/qt-everywhere-opensource-src-4.7.1
doc/html/demos-gradients-gradients-h.html
HTML
lgpl-2.1
13,675
package wtf.worldgen.generators.queuedgen; import net.minecraft.block.state.IBlockState; import wtf.init.BlockSets; import wtf.init.BlockSets.Modifier; public class QModify implements QueuedGenerator { private final Modifier modifier; public QModify(Modifier modifier){ this.modifier = modifier; } @Override public IBlockState getBlockState(IBlockState oldstate) { return BlockSets.getTransformedState(oldstate, modifier); } }
Tencao/Expedition
src/main/java/wtf/worldgen/generators/queuedgen/QModify.java
Java
lgpl-2.1
445
/* Copyright (C) 2006 Imperial College London and others. Please see the AUTHORS file in the main source directory for a full list of copyright holders. Prof. C Pain Applied Modelling and Computation Group Department of Earth Science and Engineering Imperial College London amcgsoftware@imperial.ac.uk This library 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, version 2.1 of the License. This library 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 this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <iostream> #include <map> #include <sstream> #include <stdlib.h> #include <stdio.h> #include "confdefs.h" #include "c++debug.h" #ifdef HAVE_MPI #include <mpi.h> #endif using namespace std; extern "C"{ void flredecomp(const char* input_basename, size_t input_basename_len, const char* output_basename, size_t output_basename_len, int input_nprocs, int target_nprocs); } void Usage(){ cerr << "Usage: flredecomp [OPTIONS] ... INPUT OUTPUT\n" << "\n" << "Performs a re-decomposition of a Fluidity checkpoint. Must be run on\n" << "max(input no. procs, target no. procs) processors.\n" << "\n" << "Options:\n" << "\n" << "-h\t\tDisplay this help\n" << "-i\t\tInput number of processors\n" << "-l\t\tWrite output to log files\n" << "-o\t\tTarget number of processors\n" << "-v\t\tVerbose mode" << endl; } int main(int argc, char** argv){ #ifdef HAVE_MPI MPI::Init(argc, argv); // Undo some MPI init shenanigans chdir(getenv("PWD")); #endif // Modified version of fldecomp argument parsing // Get any command line arguments // Reset optarg so we can detect changes optarg = NULL; char c; map<char, string> args; while((c = getopt(argc, argv, "i:o:hlv")) != -1){ if (c != '?'){ if(optarg == NULL){ args[c] = "true"; }else{ args[c] = optarg; } }else{ if(isprint(optopt)){ cerr << "Unknown option " << optopt << endl; }else{ cerr << "Unknown option " << hex << optopt << endl; } Usage(); exit(-1); } } // Logging if(args.count('l')){ int rank = 0; #ifdef HAVE_MPI if(MPI::Is_initialized()){ rank = MPI::COMM_WORLD.Get_rank(); } #endif ostringstream buffer; buffer << "flredecomp.log-" << rank; if(freopen(buffer.str().c_str(), "w", stdout) == NULL){ cerr << "Failed to redirect stdout" << endl; exit(-1); } buffer.str(""); buffer << "flredecomp.err-" << rank; if(freopen(buffer.str().c_str(), "w", stderr) == NULL){ cerr << "Failed to redirect stderr" << endl; exit(-1); } buffer.str(""); } // Help if(args.count('h')){ Usage(); exit(0); } // Verbosity int verbosity = 0; if(args.count('v') > 0){ verbosity = 3; } set_global_debug_level_fc(&verbosity); // Input and output base names string input_basename, output_basename; if(argc > optind + 2){ input_basename = argv[optind + 1]; output_basename = argv[optind + 2]; }else if(argc == optind + 2){ input_basename = argv[optind]; output_basename = argv[optind + 1]; }else{ Usage(); exit(-1); } // Input number of processors if(args.count('i') == 0){ Usage(); exit(-1); } int input_nprocs = atoi(args['i'].c_str()); // Target number of processors if(args.count('o') == 0){ Usage(); exit(-1); } int target_nprocs = atoi(args['o'].c_str()); size_t input_basename_len = input_basename.size(); size_t output_basename_len = output_basename.size(); flredecomp(input_basename.c_str(), input_basename_len, output_basename.c_str(), output_basename_len, input_nprocs, target_nprocs); #ifdef HAVE_MPI MPI::Finalize(); #endif return 0; }
FluidityProject/multifluids
tools/Flredecomp_main.cpp
C++
lgpl-2.1
4,368
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- q3listbox.cpp --> <title>Qt 4.8: Q3ListBoxPixmap Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li>Qt3SupportLight</li> <li>Q3ListBoxPixmap</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#protected-functions">Protected Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">Q3ListBoxPixmap Class Reference</h1> <!-- $$$Q3ListBoxPixmap-brief --> <p>The Q3ListBoxPixmap class provides list box items with a pixmap and optional text. <a href="#details">More...</a></p> <!-- @@@Q3ListBoxPixmap --> <pre class="cpp"> <span class="preprocessor">#include &lt;Q3ListBoxPixmap&gt;</span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html">Porting to Qt 4</a> for more information.</p> <p><b>Inherits: </b><a href="q3listboxitem.html">Q3ListBoxItem</a>.</p> <ul> <li><a href="q3listboxpixmap-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#Q3ListBoxPixmap">Q3ListBoxPixmap</a></b> ( Q3ListBox * <i>listbox</i>, const QPixmap &amp; <i>pixmap</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#Q3ListBoxPixmap-2">Q3ListBoxPixmap</a></b> ( const QPixmap &amp; <i>pixmap</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#Q3ListBoxPixmap-3">Q3ListBoxPixmap</a></b> ( Q3ListBox * <i>listbox</i>, const QPixmap &amp; <i>pixmap</i>, Q3ListBoxItem * <i>after</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#Q3ListBoxPixmap-4">Q3ListBoxPixmap</a></b> ( Q3ListBox * <i>listbox</i>, const QPixmap &amp; <i>pix</i>, const QString &amp; <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#Q3ListBoxPixmap-5">Q3ListBoxPixmap</a></b> ( const QPixmap &amp; <i>pix</i>, const QString &amp; <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#Q3ListBoxPixmap-6">Q3ListBoxPixmap</a></b> ( Q3ListBox * <i>listbox</i>, const QPixmap &amp; <i>pix</i>, const QString &amp; <i>text</i>, Q3ListBoxItem * <i>after</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#dtor.Q3ListBoxPixmap">~Q3ListBoxPixmap</a></b> ()</td></tr> </table> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#height">height</a></b> ( const Q3ListBox * <i>lb</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual const QPixmap * </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#pixmap">pixmap</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#rtti">rtti</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#width">width</a></b> ( const Q3ListBox * <i>lb</i> ) const</td></tr> </table> <ul> <li class="fn">14 public functions inherited from <a href="q3listboxitem.html#public-functions">Q3ListBoxItem</a></li> </ul> <a name="reimplemented-protected-functions"></a> <h2>Reimplemented Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3listboxpixmap.html#paint">paint</a></b> ( QPainter * <i>painter</i> )</td></tr> </table> <ul> <li class="fn">3 protected functions inherited from <a href="q3listboxitem.html#protected-functions">Q3ListBoxItem</a></li> </ul> <a name="details"></a> <!-- $$$Q3ListBoxPixmap-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The Q3ListBoxPixmap class provides list box items with a pixmap and optional text.</p> <p>Items of this class are drawn with the pixmap on the left with the optional text to the right of the pixmap.</p> </div> <p><b>See also </b><a href="q3listbox.html">Q3ListBox</a> and <a href="q3listboxitem.html">Q3ListBoxItem</a>.</p> <!-- @@@Q3ListBoxPixmap --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$Q3ListBoxPixmap[overload1]$$$Q3ListBoxPixmapQ3ListBox*constQPixmap& --> <h3 class="fn"><a name="Q3ListBoxPixmap"></a>Q3ListBoxPixmap::<span class="name">Q3ListBoxPixmap</span> ( <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>listbox</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pixmap</i> )</h3> <p>Constructs a new list box item in list box <i>listbox</i> showing the pixmap <i>pixmap</i>.</p> <!-- @@@Q3ListBoxPixmap --> <!-- $$$Q3ListBoxPixmap$$$Q3ListBoxPixmapconstQPixmap& --> <h3 class="fn"><a name="Q3ListBoxPixmap-2"></a>Q3ListBoxPixmap::<span class="name">Q3ListBoxPixmap</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pixmap</i> )</h3> <p>Constructs a new list box item showing the pixmap <i>pixmap</i>.</p> <!-- @@@Q3ListBoxPixmap --> <!-- $$$Q3ListBoxPixmap$$$Q3ListBoxPixmapQ3ListBox*constQPixmap&Q3ListBoxItem* --> <h3 class="fn"><a name="Q3ListBoxPixmap-3"></a>Q3ListBoxPixmap::<span class="name">Q3ListBoxPixmap</span> ( <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>listbox</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pixmap</i>, <span class="type"><a href="q3listboxitem.html">Q3ListBoxItem</a></span> * <i>after</i> )</h3> <p>Constructs a new list box item in list box <i>listbox</i> showing the pixmap <i>pixmap</i>. The item gets inserted after the item <i>after</i>, or at the beginning if <i>after</i> is 0.</p> <!-- @@@Q3ListBoxPixmap --> <!-- $$$Q3ListBoxPixmap$$$Q3ListBoxPixmapQ3ListBox*constQPixmap&constQString& --> <h3 class="fn"><a name="Q3ListBoxPixmap-4"></a>Q3ListBoxPixmap::<span class="name">Q3ListBoxPixmap</span> ( <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>listbox</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pix</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3> <p>Constructs a new list box item in list box <i>listbox</i> showing the pixmap <i>pix</i> and the text <i>text</i>.</p> <!-- @@@Q3ListBoxPixmap --> <!-- $$$Q3ListBoxPixmap$$$Q3ListBoxPixmapconstQPixmap&constQString& --> <h3 class="fn"><a name="Q3ListBoxPixmap-5"></a>Q3ListBoxPixmap::<span class="name">Q3ListBoxPixmap</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pix</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3> <p>Constructs a new list box item showing the pixmap <i>pix</i> and the text to <i>text</i>.</p> <!-- @@@Q3ListBoxPixmap --> <!-- $$$Q3ListBoxPixmap$$$Q3ListBoxPixmapQ3ListBox*constQPixmap&constQString&Q3ListBoxItem* --> <h3 class="fn"><a name="Q3ListBoxPixmap-6"></a>Q3ListBoxPixmap::<span class="name">Q3ListBoxPixmap</span> ( <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>listbox</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pix</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, <span class="type"><a href="q3listboxitem.html">Q3ListBoxItem</a></span> * <i>after</i> )</h3> <p>Constructs a new list box item in list box <i>listbox</i> showing the pixmap <i>pix</i> and the string <i>text</i>. The item gets inserted after the item <i>after</i>, or at the beginning if <i>after</i> is 0.</p> <!-- @@@Q3ListBoxPixmap --> <!-- $$$~Q3ListBoxPixmap[overload1]$$$~Q3ListBoxPixmap --> <h3 class="fn"><a name="dtor.Q3ListBoxPixmap"></a>Q3ListBoxPixmap::<span class="name">~Q3ListBoxPixmap</span> ()</h3> <p>Destroys the item.</p> <!-- @@@~Q3ListBoxPixmap --> <!-- $$$height[overload1]$$$heightconstQ3ListBox* --> <h3 class="fn"><a name="height"></a><span class="type">int</span> Q3ListBoxPixmap::<span class="name">height</span> ( const <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>lb</i> ) const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="q3listboxitem.html#height">Q3ListBoxItem::height</a>().</p> <p>Returns the height of the pixmap in list box <i>lb</i>.</p> <p><b>See also </b><a href="q3listboxpixmap.html#paint">paint</a>() and <a href="q3listboxpixmap.html#width">width</a>().</p> <!-- @@@height --> <!-- $$$paint[overload1]$$$paintQPainter* --> <h3 class="fn"><a name="paint"></a><span class="type">void</span> Q3ListBoxPixmap::<span class="name">paint</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i> )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="q3listboxitem.html#paint">Q3ListBoxItem::paint</a>().</p> <p>Draws the pixmap using <i>painter</i>.</p> <!-- @@@paint --> <!-- $$$pixmap[overload1]$$$pixmap --> <h3 class="fn"><a name="pixmap"></a>const <span class="type"><a href="qpixmap.html">QPixmap</a></span> * Q3ListBoxPixmap::<span class="name">pixmap</span> () const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="q3listboxitem.html#pixmap">Q3ListBoxItem::pixmap</a>().</p> <p>Returns the pixmap associated with the item.</p> <!-- @@@pixmap --> <!-- $$$rtti[overload1]$$$rtti --> <h3 class="fn"><a name="rtti"></a><span class="type">int</span> Q3ListBoxPixmap::<span class="name">rtti</span> () const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="q3listboxitem.html#rtti">Q3ListBoxItem::rtti</a>().</p> <p>Returns 2.</p> <p>Make your derived classes return their own values for rtti(), and you can distinguish between listbox items. You should use values greater than 1000 preferably a large random number, to allow for extensions to this class.</p> <!-- @@@rtti --> <!-- $$$width[overload1]$$$widthconstQ3ListBox* --> <h3 class="fn"><a name="width"></a><span class="type">int</span> Q3ListBoxPixmap::<span class="name">width</span> ( const <span class="type"><a href="q3listbox.html">Q3ListBox</a></span> * <i>lb</i> ) const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="q3listboxitem.html#width">Q3ListBoxItem::width</a>().</p> <p>Returns the width of the pixmap plus some margin in list box <i>lb</i>.</p> <p><b>See also </b><a href="q3listboxpixmap.html#paint">paint</a>() and <a href="q3listboxpixmap.html#height">height</a>().</p> <!-- @@@width --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2012 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>
sicily/qt4.8.4
doc/html/q3listboxpixmap.html
HTML
lgpl-2.1
20,134
/** * Copyright (C) 2010 Orbeon, Inc. * * This program 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 * 2.1 of the License, or (at your option) any later version. * * This program 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. * * The full text of the license is available at http://www.gnu.org/copyleft/lesser.html */ package org.orbeon.oxf.xforms.control.controls import org.orbeon.dom.Element import org.orbeon.oxf.xforms.analysis.controls.LHHA import org.orbeon.oxf.xforms.control.{FocusableTrait, XFormsControl, XFormsSingleNodeControl} import org.orbeon.oxf.xforms.xbl.XBLContainer /** * Represents an xf:trigger control. * * TODO: Use inheritance/interface to make this a single-node control that doesn't hold a value. */ class XFormsTriggerControl(container: XBLContainer, parent: XFormsControl, element: Element, id: String) extends XFormsSingleNodeControl(container, parent, element, id) with FocusableTrait { import org.orbeon.oxf.xforms.control.controls.XFormsTriggerControl._ override def lhhaHTMLSupport = TriggerLhhaHtmlSupport // NOTE: We used to make the trigger non-relevant if it was static-readonly. But this caused issues: // // - at the time computeRelevant() is called, MIPs haven't been read yet // - even if we specially read the readonly value from the binding here, then: // - the static-readonly control becomes non-relevant // - therefore its readonly value becomes false (the default) // - therefore isStaticReadonly() returns false! // // So we keep the control relevant in this case. // Don't output anything for triggers in static readonly mode override def supportAjaxUpdates = ! isStaticReadonly } private object XFormsTriggerControl { val TriggerLhhaHtmlSupport = LHHA.DefaultLHHAHTMLSupport - LHHA.Hint }
brunobuzzi/orbeon-forms
xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/control/controls/XFormsTriggerControl.scala
Scala
lgpl-2.1
2,122
/**************************************************************************** ** ** Copyright (C) 2014 Debao Zhang ** Contact: hello@debao.me ** ** This file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ****************************************************************************/ #include "xlsxast_p.h" namespace XlsxAST { // } // namespace XlsxAST
dbzhang800/ExamplesForQLALR
xlsxformulaengine/src/xlsxast.cpp
C++
lgpl-2.1
784
/* * cpu_s390.c: CPU driver for s390(x) CPUs * * Copyright (C) 2013 Red Hat, Inc. * Copyright IBM Corp. 2012 * * This library 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 2.1 of the License, or (at your option) any later version. * * This library 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 this library. If not, see * <http://www.gnu.org/licenses/>. */ #include <config.h> #include "viralloc.h" #include "virstring.h" #include "cpu.h" #define VIR_FROM_THIS VIR_FROM_CPU static const virArch archs[] = { VIR_ARCH_S390, VIR_ARCH_S390X }; static virCPUCompareResult virCPUs390Compare(virCPUDefPtr host G_GNUC_UNUSED, virCPUDefPtr cpu G_GNUC_UNUSED, bool failMessages G_GNUC_UNUSED) { /* s390 relies on QEMU to perform all runability checking. Return * VIR_CPU_COMPARE_IDENTICAL to bypass Libvirt checking. */ return VIR_CPU_COMPARE_IDENTICAL; } static int virCPUs390Update(virCPUDefPtr guest, const virCPUDef *host) { g_autoptr(virCPUDef) updated = NULL; size_t i; if (guest->mode == VIR_CPU_MODE_CUSTOM) { if (guest->match == VIR_CPU_MATCH_MINIMUM) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("match mode %s not supported"), virCPUMatchTypeToString(guest->match)); } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("optional CPU features are not supported")); } return -1; } if (!host) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("unknown host CPU model")); return -1; } if (!(updated = virCPUDefCopyWithoutModel(guest))) return -1; updated->mode = VIR_CPU_MODE_CUSTOM; if (virCPUDefCopyModel(updated, host, true) < 0) return -1; for (i = 0; i < guest->nfeatures; i++) { if (virCPUDefUpdateFeature(updated, guest->features[i].name, guest->features[i].policy) < 0) return -1; } virCPUDefStealModel(guest, updated, false); guest->mode = VIR_CPU_MODE_CUSTOM; guest->match = VIR_CPU_MATCH_EXACT; return 0; } static int virCPUs390ValidateFeatures(virCPUDefPtr cpu) { size_t i; for (i = 0; i < cpu->nfeatures; i++) { if (cpu->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("only cpu feature policies 'require' and " "'disable' are supported for %s"), cpu->features[i].name); return -1; } } return 0; } struct cpuArchDriver cpuDriverS390 = { .name = "s390", .arch = archs, .narch = G_N_ELEMENTS(archs), .compare = virCPUs390Compare, .decode = NULL, .encode = NULL, .baseline = NULL, .update = virCPUs390Update, .validateFeatures = virCPUs390ValidateFeatures, };
jardasgit/libvirt
src/cpu/cpu_s390.c
C
lgpl-2.1
3,483
import json import maps import traceback from requests import get from requests import post from requests import put from tendrl.commons.utils import log_utils as logger from tendrl.monitoring_integration.grafana import constants from tendrl.monitoring_integration.grafana import exceptions from tendrl.monitoring_integration.grafana import utils def _post_datasource(datasource_json): config = maps.NamedDict(NS.config.data) if utils.port_open(config.grafana_port, config.grafana_host): resp = post( "http://{}:{}/api/datasources".format( config.grafana_host, config.grafana_port ), headers=constants.HEADERS, auth=config.credentials, data=datasource_json ) else: raise exceptions.ConnectionFailedException return resp def form_datasource_json(): config = maps.NamedDict(NS.config.data) url = "http://" + str(config.datasource_host) + ":" \ + str(config.datasource_port) datasource_json = ( {'name': config.datasource_name, 'type': config.datasource_type, 'url': url, 'access': config.access, 'basicAuth': config.basicAuth, 'isDefault': config.isDefault } ) return datasource_json def create_datasource(): try: datasource_json = form_datasource_json() response = _post_datasource(json.dumps(datasource_json)) return response except exceptions.ConnectionFailedException: logger.log("error", NS.get("publisher_id", None), {'message': str(traceback.print_stack())}) raise exceptions.ConnectionFailedException def get_data_source(): config = maps.NamedDict(NS.config.data) if utils.port_open(config.grafana_port, config.grafana_host): resp = get( "http://{}:{}/api/datasources/id/{}".format( config.grafana_host, config.grafana_port, config.datasource_name ), auth=config.credentials ) else: raise exceptions.ConnectionFailedException return resp def update_datasource(datasource_id): try: config = maps.NamedDict(NS.config.data) datasource_json = form_datasource_json() datasource_str = json.dumps(datasource_json) if utils.port_open(config.grafana_port, config.grafana_host): response = put( "http://{}:{}/api/datasources/{}".format( config.grafana_host, config.grafana_port, datasource_id ), headers=constants.HEADERS, auth=config.credentials, data=datasource_str ) else: raise exceptions.ConnectionFailedException return response except exceptions.ConnectionFailedException as ex: logger.log("error", NS.get("publisher_id", None), {'message': str(ex)}) raise ex
Tendrl/monitoring-integration
tendrl/monitoring_integration/grafana/datasource_utils.py
Python
lgpl-2.1
3,062
/* * PKCS #11 PAM Login Module * Copyright (C) 2003 Mario Strasser <mast@gmx.net>, * * This library 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 2.1 of the License, or (at your option) any later version. * * This library 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. * * $Id$ */ #ifndef __PKCS11_LIB_H__ #define __PKCS11_LIB_H__ #include "cert_st.h" typedef struct cert_object_str cert_object_t; typedef struct pkcs11_handle_str pkcs11_handle_t; #ifndef __PKCS11_LIB_C__ #define PKCS11_EXTERN extern #else #define PKCS11_EXTERN #endif PKCS11_EXTERN int crypto_init(cert_policy *policy); PKCS11_EXTERN int load_pkcs11_module(const char *module, pkcs11_handle_t **h); PKCS11_EXTERN int init_pkcs11_module(pkcs11_handle_t *h,int flag); PKCS11_EXTERN int find_slot_by_number(pkcs11_handle_t *h,unsigned int slot_num, unsigned int *slot); PKCS11_EXTERN int find_slot_by_number_and_label(pkcs11_handle_t *h, int slot_num, const char *slot_label, unsigned int *slot); PKCS11_EXTERN const char *get_slot_tokenlabel(pkcs11_handle_t *h); PKCS11_EXTERN int wait_for_token(pkcs11_handle_t *h, int wanted_slot_num, const char *wanted_token_label, unsigned int *slot); PKCS11_EXTERN int find_slot_by_slotlabel(pkcs11_handle_t *h, const char *wanted_slot_label, unsigned int *slot); PKCS11_EXTERN int find_slot_by_slotlabel_and_tokenlabel(pkcs11_handle_t *h, const char *wanted_slot_label, const char *wanted_token_label, unsigned int *slot); PKCS11_EXTERN int wait_for_token_by_slotlabel(pkcs11_handle_t *h, const char *wanted_slot_label, const char *wanted_token_label, unsigned int *slot); PKCS11_EXTERN const X509 *get_X509_certificate(cert_object_t *cert); PKCS11_EXTERN void release_pkcs11_module(pkcs11_handle_t *h); PKCS11_EXTERN int open_pkcs11_session(pkcs11_handle_t *h, unsigned int slot); PKCS11_EXTERN int close_pkcs11_session(pkcs11_handle_t *h); PKCS11_EXTERN int pkcs11_login(pkcs11_handle_t *h, char *password); PKCS11_EXTERN int pkcs11_pass_login(pkcs11_handle_t *h, int nullok); PKCS11_EXTERN int get_slot_login_required(pkcs11_handle_t *h); PKCS11_EXTERN int get_slot_protected_authentication_path(pkcs11_handle_t *h); PKCS11_EXTERN cert_object_t **get_certificate_list(pkcs11_handle_t *h, int *ncert); PKCS11_EXTERN int get_private_key(pkcs11_handle_t *h, cert_object_t *); PKCS11_EXTERN int sign_value(pkcs11_handle_t *h, cert_object_t *, unsigned char *data, unsigned long length, unsigned char **signature, unsigned long *signature_length); PKCS11_EXTERN int get_random_value(unsigned char *data, int length); #undef PKCS11_EXTERN /* end of pkcs11_lib.h */ #endif
milgner/pam_pkcs11
src/common/pkcs11_lib.h
C
lgpl-2.1
3,478
/* * Copyright (c) 2013 Anton Golinko * * This library 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 2.1 of the License, or (at your option) any later version. * * This library 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 this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ package org.pdfparse.cds; import org.pdfparse.cos.COSArray; import org.pdfparse.cos.COSObject; import org.pdfparse.exception.EParseError; import org.pdfparse.parser.PDFParser; import org.pdfparse.parser.PDFRawData; import java.io.IOException; import java.io.OutputStream; public class PDFRectangle implements COSObject { /** lower left x */ private float llx; /** lower left y */ private float lly; /** upper right x */ private float urx; /** upper right y */ private float ury; // constructors /** * Constructs a <CODE>PdfRectangle</CODE>-object. * * @param llx lower left x * @param lly lower left y * @param urx upper right x * @param ury upper right y * */ public PDFRectangle(float llx, float lly, float urx, float ury) { this.llx = llx; this.lly = lly; this.urx = urx; this.ury = ury; normalize(); } public PDFRectangle(COSArray array) { this.llx = array.getInt(0); this.lly = array.getInt(1); this.urx = array.getInt(2); this.ury = array.getInt(3); normalize(); } @Override public void parse(PDFRawData src, PDFParser pdfFile) throws EParseError { COSArray array = new COSArray(src, pdfFile); this.llx = array.getInt(0); this.lly = array.getInt(1); this.urx = array.getInt(2); this.ury = array.getInt(3); normalize(); } @Override public void produce(OutputStream dst, PDFParser pdfFile) throws IOException { String s = String.format("[%.2f %.2f %.2f %.2f]", llx, lly, urx, ury); dst.write(s.getBytes()); } /** * Return a string representation of this rectangle. * * @return This object as a string. */ public String toString() { return String.format("[%.2f %.2f %.2f %.2f]", llx, lly, urx, ury); } public void normalize() { float t; if (llx > urx) { t = llx; llx = urx; urx = t; } if (lly > ury) { t = lly; lly = ury; ury = t; } } /** * Method to determine if the x/y point is inside this rectangle. * @param x The x-coordinate to test. * @param y The y-coordinate to test. * @return True if the point is inside this rectangle. */ public boolean contains( float x, float y ) { return x >= llx && x <= urx && y >= lly && y <= ury; } /** * Get the width of this rectangle as calculated by * upperRightX - lowerLeftX. * * @return The width of this rectangle. */ public float getWidth() { return urx - llx; } /** * Get the height of this rectangle as calculated by * upperRightY - lowerLeftY. * * @return The height of this rectangle. */ public float getHeight() { return ury - lly; } /** * Move the rectangle the given relative amount. * * @param dx positive values will move rectangle to the right, negative's to the left. * @param dy positive values will move the rectangle up, negative's down. */ public void move(float dx, float dy) { llx += dx; lly += dy; urx += dx; ury += dy; } }
agolinko/pdfparse
pdfparse-lib/src/main/java/org/pdfparse/cds/PDFRectangle.java
Java
lgpl-2.1
4,155
################################################################################################### # # # This file is part of HPMPC. # # # # HPMPC -- Library for High-Performance implementation of solvers for MPC. # # Copyright (C) 2014-2015 by Technical University of Denmark. All rights reserved. # # # # HPMPC 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 2.1 of the License, or (at your option) any later version. # # # # HPMPC 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 HPMPC; if not, write to the Free Software # # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # # # Author: Gianluca Frison, giaf (at) dtu.dk # # # ################################################################################################### include ../Makefile.rule OBJS = d_ip_hard.o d_ip2_hard.o d_res_ip_hard.o d_ip_soft.o d_ip2_soft.o d_res_ip_soft.o d_admm_box.o d_admm_soft.o s_ip_box.o s_ip2_box.o s_res_ip_box.o s_admm_box.o s_admm_soft.o obj: $(OBJS) ifeq ($(TARGET), X64_AVX2) make -C avx obj endif ifeq ($(TARGET), X64_AVX) make -C avx obj endif ifeq ($(TARGET), X64_SSE3) make -C c99 obj endif ifeq ($(TARGET), C99_4X4) make -C c99 obj endif ifeq ($(TARGET), C99_4X4_PREFETCH) make -C c99 obj endif ifeq ($(TARGET), CORTEX_A15) make -C c99 obj endif ifeq ($(TARGET), CORTEX_A9) make -C c99 obj endif ifeq ($(TARGET), CORTEX_A7) make -C c99 obj endif clean: rm -f *.o make -C avx clean make -C c99 clean
wuyou33/hpmpc
mpc_solvers/Makefile
Makefile
lgpl-2.1
3,091
/* * Copyright (C) 2018 OTA keys S.A. * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup examples * @{ * * @file * @brief File system usage example application * * @author Vincent Dupont <vincent@otakeys.com> * * @} */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include "shell.h" #include "board.h" /* MTD_0 is defined in board.h */ /* Configure MTD device for SD card if none is provided */ #if !defined(MTD_0) && MODULE_MTD_SDCARD #include "mtd_sdcard.h" #include "sdcard_spi.h" #include "sdcard_spi_params.h" #define SDCARD_SPI_NUM ARRAY_SIZE(sdcard_spi_params) /* SD card devices are provided by drivers/sdcard_spi/sdcard_spi.c */ extern sdcard_spi_t sdcard_spi_devs[SDCARD_SPI_NUM]; /* Configure MTD device for the first SD card */ static mtd_sdcard_t mtd_sdcard_dev = { .base = { .driver = &mtd_sdcard_driver }, .sd_card = &sdcard_spi_devs[0], .params = &sdcard_spi_params[0], }; static mtd_dev_t *mtd0 = (mtd_dev_t*)&mtd_sdcard_dev; #define MTD_0 mtd0 #endif /* Flash mount point */ #define FLASH_MOUNT_POINT "/sda" /* In this example, MTD_0 is used as mtd interface for littlefs or spiffs */ /* littlefs and spiffs basic usage are shown */ #ifdef MTD_0 /* File system descriptor initialization */ #if defined(MODULE_LITTLEFS) /* include file system header for driver */ #include "fs/littlefs_fs.h" /* file system specific descriptor * for littlefs, some fields can be tweaked to define the size * of the partition, see header documentation. * In this example, default behavior will be used, i.e. the entire * memory will be used (parameters come from mtd) */ static littlefs_desc_t fs_desc = { .lock = MUTEX_INIT, }; /* littlefs file system driver will be used */ #define FS_DRIVER littlefs_file_system #elif defined(MODULE_LITTLEFS2) /* include file system header for driver */ #include "fs/littlefs2_fs.h" /* file system specific descriptor * for littlefs2, some fields can be tweaked to define the size * of the partition, see header documentation. * In this example, default behavior will be used, i.e. the entire * memory will be used (parameters come from mtd) */ static littlefs2_desc_t fs_desc = { .lock = MUTEX_INIT, }; /* littlefs file system driver will be used */ #define FS_DRIVER littlefs2_file_system #elif defined(MODULE_SPIFFS) /* include file system header */ #include "fs/spiffs_fs.h" /* file system specific descriptor * as for littlefs, some fields can be changed if needed, * this example focus on basic usage, i.e. entire memory used */ static spiffs_desc_t fs_desc = { .lock = MUTEX_INIT, }; /* spiffs driver will be used */ #define FS_DRIVER spiffs_file_system #elif defined(MODULE_FATFS_VFS) /* include file system header */ #include "fs/fatfs.h" /* file system specific descriptor * as for littlefs, some fields can be changed if needed, * this example focus on basic usage, i.e. entire memory used */ static fatfs_desc_t fs_desc; /* provide mtd devices for use within diskio layer of fatfs */ mtd_dev_t *fatfs_mtd_devs[FF_VOLUMES]; /* fatfs driver will be used */ #define FS_DRIVER fatfs_file_system #endif /* this structure defines the vfs mount point: * - fs field is set to the file system driver * - mount_point field is the mount point name * - private_data depends on the underlying file system. For both spiffs and * littlefs, it needs to be a pointer to the file system descriptor */ static vfs_mount_t flash_mount = { .fs = &FS_DRIVER, .mount_point = FLASH_MOUNT_POINT, .private_data = &fs_desc, }; #endif /* MTD_0 */ /* Add simple macro to check if an MTD device together with a filesystem is * compiled in */ #if defined(MTD_0) && \ (defined(MODULE_SPIFFS) || \ defined(MODULE_LITTLEFS) || \ defined(MODULE_LITTLEFS2) || \ defined(MODULE_FATFS_VFS)) #define FLASH_AND_FILESYSTEM_PRESENT 1 #else #define FLASH_AND_FILESYSTEM_PRESENT 0 #endif /* constfs example */ #include "fs/constfs.h" #define HELLO_WORLD_CONTENT "Hello World!\n" #define HELLO_RIOT_CONTENT "Hello RIOT!\n" /* this defines two const files in the constfs */ static constfs_file_t constfs_files[] = { { .path = "/hello-world", .size = sizeof(HELLO_WORLD_CONTENT), .data = (const uint8_t *)HELLO_WORLD_CONTENT, }, { .path = "/hello-riot", .size = sizeof(HELLO_RIOT_CONTENT), .data = (const uint8_t *)HELLO_RIOT_CONTENT, } }; /* this is the constfs specific descriptor */ static constfs_t constfs_desc = { .nfiles = ARRAY_SIZE(constfs_files), .files = constfs_files, }; /* constfs mount point, as for previous example, it needs a file system driver, * a mount point and private_data as a pointer to the constfs descriptor */ static vfs_mount_t const_mount = { .fs = &constfs_file_system, .mount_point = "/const", .private_data = &constfs_desc, }; /* Command handlers */ static int _mount(int argc, char **argv) { (void)argc; (void)argv; #if FLASH_AND_FILESYSTEM_PRESENT int res = vfs_mount(&flash_mount); if (res < 0) { printf("Error while mounting %s...try format\n", FLASH_MOUNT_POINT); return 1; } printf("%s successfully mounted\n", FLASH_MOUNT_POINT); return 0; #else puts("No external flash file system selected"); return 1; #endif } static int _format(int argc, char **argv) { (void)argc; (void)argv; #if FLASH_AND_FILESYSTEM_PRESENT int res = vfs_format(&flash_mount); if (res < 0) { printf("Error while formatting %s\n", FLASH_MOUNT_POINT); return 1; } printf("%s successfully formatted\n", FLASH_MOUNT_POINT); return 0; #else puts("No external flash file system selected"); return 1; #endif } static int _umount(int argc, char **argv) { (void)argc; (void)argv; #if FLASH_AND_FILESYSTEM_PRESENT int res = vfs_umount(&flash_mount); if (res < 0) { printf("Error while unmounting %s\n", FLASH_MOUNT_POINT); return 1; } printf("%s successfully unmounted\n", FLASH_MOUNT_POINT); return 0; #else puts("No external flash file system selected"); return 1; #endif } static int _cat(int argc, char **argv) { if (argc < 2) { printf("Usage: %s <file>\n", argv[0]); return 1; } /* With newlib or picolibc, low-level syscalls are plugged to RIOT vfs * on native, open/read/write/close/... are plugged to RIOT vfs */ #if defined(MODULE_NEWLIB) || defined(MODULE_PICOLIBC) FILE *f = fopen(argv[1], "r"); if (f == NULL) { printf("file %s does not exist\n", argv[1]); return 1; } char c; while (fread(&c, 1, 1, f) != 0) { putchar(c); } fclose(f); #else int fd = open(argv[1], O_RDONLY); if (fd < 0) { printf("file %s does not exist\n", argv[1]); return 1; } char c; while (read(fd, &c, 1) != 0) { putchar(c); } close(fd); #endif fflush(stdout); return 0; } static int _tee(int argc, char **argv) { if (argc != 3) { printf("Usage: %s <file> <str>\n", argv[0]); return 1; } #if defined(MODULE_NEWLIB) || defined(MODULE_PICOLIBC) FILE *f = fopen(argv[1], "w+"); if (f == NULL) { printf("error while trying to create %s\n", argv[1]); return 1; } if (fwrite(argv[2], 1, strlen(argv[2]), f) != strlen(argv[2])) { puts("Error while writing"); } fclose(f); #else int fd = open(argv[1], O_RDWR | O_CREAT); if (fd < 0) { printf("error while trying to create %s\n", argv[1]); return 1; } if (write(fd, argv[2], strlen(argv[2])) != (ssize_t)strlen(argv[2])) { puts("Error while writing"); } close(fd); #endif return 0; } static const shell_command_t shell_commands[] = { { "mount", "mount flash filesystem", _mount }, { "format", "format flash file system", _format }, { "umount", "unmount flash filesystem", _umount }, { "cat", "print the content of a file", _cat }, { "tee", "write a string in a file", _tee }, { NULL, NULL, NULL } }; int main(void) { #if defined(MTD_0) && (defined(MODULE_SPIFFS) || defined(MODULE_LITTLEFS) || defined(MODULE_LITTLEFS2)) /* spiffs and littlefs need a mtd pointer * by default the whole memory is used */ fs_desc.dev = MTD_0; #elif defined(MTD_0) && defined(MODULE_FATFS_VFS) fatfs_mtd_devs[fs_desc.vol_idx] = MTD_0; #endif int res = vfs_mount(&const_mount); if (res < 0) { puts("Error while mounting constfs"); } else { puts("constfs mounted successfully"); } char line_buf[SHELL_DEFAULT_BUFSIZE]; shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE); return 0; }
kYc0o/RIOT
examples/filesystem/main.c
C
lgpl-2.1
8,943
REM TODO: need way to specify serial port. cd .. tools\avr\bin\uisp -dpart=ATmega8 -dprog=stk500 -dserial=com1 -dspeed=115200 --wr_lock=0xFF tools\avr\bin\uisp -dpart=ATmega8 -dprog=stk500 -dserial=com1 -dspeed=115200 --wr_fuse_l=0xdf --wr_fuse_h=0xca tools\avr\bin\uisp -dpart=ATmega8 -dprog=stk500 -dserial=com1 -dspeed=115200 --erase --upload --verify if=bootloader\ATMegaBOOT.hex tools\avr\bin\uisp -dpart=ATmega8 -dprog=stk500 -dserial=com1 -dspeed=115200 --wr_lock=0xCF cd bootloader
electricFeel/antipasto_arduino
build/windows/dist/bootloader/burn.bat
Batchfile
lgpl-2.1
491
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor ** the names of its contributors may be used to endorse or promote ** products derived from this software without specific prior written ** permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QLabel> #include <QPainter> #include <QPushButton> #include <QApplication> #include <QGraphicsView> #include <QGraphicsScene> #include <QGraphicsWidget> #include <QGraphicsProxyWidget> #include <QGraphicsAnchorLayout> #include <QGraphicsSceneResizeEvent> class PixmapWidget : public QGraphicsLayoutItem { public: PixmapWidget(const QPixmap &pix) : QGraphicsLayoutItem() { original = new QGraphicsPixmapItem(pix); setGraphicsItem(original); original->show(); r = QRectF(QPointF(0, 0), pix.size()); } ~PixmapWidget() { setGraphicsItem(0); delete original; } void setZValue(qreal z) { original->setZValue(z); } void setGeometry (const QRectF &rect) { original->scale(rect.width() / r.width(), rect.height() / r.height()); original->setPos(rect.x(), rect.y()); r = rect; } protected: QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const { Q_UNUSED(constraint); QSizeF sh; switch (which) { case Qt::MinimumSize: sh = QSizeF(0, 0); break; case Qt::PreferredSize: sh = QSizeF(50, 50); break; case Qt::MaximumSize: sh = QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); break; default: break; } return sh; } private: QGraphicsPixmapItem *original; QRectF r; }; class PlaceWidget : public QGraphicsWidget { Q_OBJECT public: PlaceWidget(const QPixmap &pix) : QGraphicsWidget(), original(pix), scaled(pix) { } void paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) { QPointF reflection = QPointF(); reflection.setY(scaled.height() + 2); painter->drawPixmap(QPointF(), scaled); QPixmap tmp(scaled.size()); tmp.fill(Qt::transparent); QPainter p(&tmp); // create gradient QPoint p1(scaled.width() / 2, 0); QPoint p2(scaled.width() / 2, scaled.height()); QLinearGradient linearGrad(p1, p2); linearGrad.setColorAt(0, QColor(0, 0, 0, 0)); linearGrad.setColorAt(0.65, QColor(0, 0, 0, 127)); linearGrad.setColorAt(1, QColor(0, 0, 0, 255)); // apply 'mask' p.setBrush(linearGrad); p.fillRect(0, 0, tmp.width(), tmp.height(), QBrush(linearGrad)); p.fillRect(0, 0, tmp.width(), tmp.height(), QBrush(linearGrad)); // paint the image flipped p.setCompositionMode(QPainter::CompositionMode_DestinationOver); p.drawPixmap(0, 0, QPixmap::fromImage(scaled.toImage().mirrored(false, true))); p.end(); painter->drawPixmap(reflection, tmp); } void resizeEvent(QGraphicsSceneResizeEvent *event) { QSize newSize = event->newSize().toSize(); newSize.setHeight(newSize.height() / 2); scaled = original.scaled(newSize); } QRectF boundingRect() const { QSize size(scaled.width(), scaled.height() * 2 + 2); return QRectF(QPointF(0, 0), size); } private: QPixmap original; QPixmap scaled; }; int main(int argc, char **argv) { Q_INIT_RESOURCE(weatheranchorlayout); QApplication app(argc, argv); QGraphicsScene scene; scene.setSceneRect(0, 0, 800, 480); // pixmaps widgets PixmapWidget *title = new PixmapWidget(QPixmap(":/images/title.jpg")); PlaceWidget *place = new PlaceWidget(QPixmap(":/images/place.jpg")); PixmapWidget *details = new PixmapWidget(QPixmap(":/images/5days.jpg")); PixmapWidget *sunnyWeather = new PixmapWidget(QPixmap(":/images/weather-few-clouds.png")); PixmapWidget *tabbar = new PixmapWidget(QPixmap(":/images/tabbar.jpg")); // setup sizes title->setPreferredSize(QSizeF(348, 45)); title->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); place->setPreferredSize(QSizeF(96, 72)); place->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); details->setMinimumSize(QSizeF(200, 112)); details->setPreferredSize(QSizeF(200, 112)); details->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); tabbar->setPreferredSize(QSizeF(70, 24)); tabbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); sunnyWeather->setPreferredSize(QSizeF(128, 97)); sunnyWeather->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); sunnyWeather->setZValue(9999); // start anchor layout QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout; l->setSpacing(0); // setup the main widget QGraphicsWidget *w = new QGraphicsWidget(0, Qt::Window); QPalette p; p.setColor(QPalette::Window, Qt::black); w->setPalette(p); w->setPos(20, 20); w->setLayout(l); // vertical anchors QGraphicsAnchor *anchor = l->addAnchor(title, Qt::AnchorTop, l, Qt::AnchorTop); anchor = l->addAnchor(place, Qt::AnchorTop, title, Qt::AnchorBottom); anchor->setSpacing(12); anchor = l->addAnchor(place, Qt::AnchorBottom, l, Qt::AnchorBottom); anchor->setSpacing(12); anchor = l->addAnchor(sunnyWeather, Qt::AnchorTop, title, Qt::AnchorTop); anchor = l->addAnchor(sunnyWeather, Qt::AnchorBottom, l, Qt::AnchorVerticalCenter); anchor = l->addAnchor(tabbar, Qt::AnchorTop, title, Qt::AnchorBottom); anchor->setSpacing(5); anchor = l->addAnchor(details, Qt::AnchorTop, tabbar, Qt::AnchorBottom); anchor->setSpacing(2); anchor = l->addAnchor(details, Qt::AnchorBottom, l, Qt::AnchorBottom); anchor->setSpacing(12); // horizontal anchors anchor = l->addAnchor(l, Qt::AnchorLeft, title, Qt::AnchorLeft); anchor = l->addAnchor(title, Qt::AnchorRight, l, Qt::AnchorRight); anchor = l->addAnchor(place, Qt::AnchorLeft, l, Qt::AnchorLeft); anchor->setSpacing(15); anchor = l->addAnchor(place, Qt::AnchorRight, details, Qt::AnchorLeft); anchor->setSpacing(35); anchor = l->addAnchor(sunnyWeather, Qt::AnchorLeft, place, Qt::AnchorHorizontalCenter); anchor = l->addAnchor(sunnyWeather, Qt::AnchorRight, l, Qt::AnchorHorizontalCenter); anchor = l->addAnchor(tabbar, Qt::AnchorHorizontalCenter, details, Qt::AnchorHorizontalCenter); anchor = l->addAnchor(details, Qt::AnchorRight, l, Qt::AnchorRight); // QGV setup scene.addItem(w); scene.setBackgroundBrush(Qt::white); QGraphicsView *view = new QGraphicsView(&scene); view->show(); return app.exec(); } #include "main.moc"
sunblithe/qt-everywhere-opensource-src-4.7.1
examples/graphicsview/weatheranchorlayout/main.cpp
C++
lgpl-2.1
8,634
<?php namespace wcf\data\sudoku\grid\iterator; use wcf\data\sudoku\grid\SudokuGrid; use wcf\util\MathUtil; /** * Implementation of iterator. Randomly jumps around the grid. * * @author Oliver Kliebisch * @copyright 2012 Oliver Kliebisch * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package de.packageforge.wcf.sudoku * @subpackage data.sudoku.iterator * @category Community Framework */ class RandomIterator implements GridIterator { public function iterate(&$row, &$column) { $row = MathUtil::getRandomValue(1, SudokuGrid::GRID_SIZE); $column = MathUtil::getRandomValue(1, SudokuGrid::GRID_SIZE); } }
TacHawkes/de.packageforge.wcf.sudoku
files/lib/data/sudoku/grid/iterator/RandomIterator.class.php
PHP
lgpl-2.1
672
/* (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp <dok@directfb.org>, Andreas Hundt <andi@fischlustig.de>, Sven Neumann <neo@directfb.org>, Ville Syrjälä <syrjala@sci.fi> and Claudio Ciccani <klan@users.sf.net>. This library 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 2 of the License, or (at your option) any later version. This library 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 this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __CORE__LAYERS_INTERNAL_H__ #define __CORE__LAYERS_INTERNAL_H__ #include <directfb.h> #include <core/coredefs.h> #include <core/coretypes.h> #include <fusion/object.h> #include <fusion/property.h> #include <fusion/vector.h> #include <core/layers.h> #include <core/layer_region.h> #include <core/state.h> typedef struct { FusionVector stack; int active; CoreLayerContext *primary; } CoreLayerContexts; typedef struct { int index; DFBDisplayLayerSourceDescription description; } CoreLayerSource; typedef struct { DFBDisplayLayerID layer_id; DFBDisplayLayerDescription description; DFBDisplayLayerConfig default_config; DFBColorAdjustment default_adjustment; CoreLayerSource *sources; void *layer_data; FusionSkirmish lock; CoreLayerContexts contexts; bool suspended; FusionVector added_regions; FusionSHMPoolShared *shmpool; } CoreLayerShared; struct __DFB_CoreLayer { CoreLayerShared *shared; CoreDFB *core; CoreGraphicsDevice *device; CoreScreen *screen; void *driver_data; void *layer_data; /* copy of shared->layer_data */ const DisplayLayerFuncs *funcs; CardState state; }; typedef enum { CLLM_LOCATION, /* Keep normalized area. */ CLLM_CENTER, /* Center layer after resizing destination area. */ CLLM_POSITION, /* Keep pixel position, but resize area. */ CLLM_RECTANGLE /* Keep pixel based area. */ } CoreLayerLayoutMode; struct __DFB_CoreLayerContext { FusionObject object; int magic; DFBDisplayLayerID layer_id; FusionSkirmish lock; bool active; /* Is this the active context? */ DFBDisplayLayerConfig config; /* Current layer configuration. */ int rotation; FusionVector regions; /* All regions created within this context. */ struct { CoreLayerRegion *region; /* Region of layer config if buffer mode is not DLBM_WINDOWS. */ CoreLayerRegionConfig config; /* Region config used to implement layer config and settings. */ } primary; struct { DFBLocation location; /* Normalized screen location. */ DFBRectangle rectangle; /* Pixel based position and size. */ CoreLayerLayoutMode mode; /* ...and how resizing influences them. */ } screen; DFBColorAdjustment adjustment; /* Color adjustment of the layer.*/ CoreWindowStack *stack; /* Every layer has its own windowstack as every layer has its own pixel buffer. */ FusionSHMPoolShared *shmpool; }; typedef enum { CLRSF_NONE = 0x00000000, CLRSF_CONFIGURED = 0x00000001, CLRSF_ENABLED = 0x00000002, CLRSF_ACTIVE = 0x00000004, CLRSF_REALIZED = 0x00000008, CLRSF_FROZEN = 0x00000010, CLRSF_ALL = 0x0000001F } CoreLayerRegionStateFlags; struct __DFB_CoreLayerRegion { FusionObject object; CoreLayerContext *context; FusionSkirmish lock; CoreLayerRegionStateFlags state; CoreLayerRegionConfig config; CoreSurface *surface; CoreSurfaceBufferLock surface_lock; GlobalReaction surface_reaction; void *region_data; }; /* Called at the end of dfb_layer_region_create(). */ DFBResult dfb_layer_context_add_region( CoreLayerContext *context, CoreLayerRegion *region ); /* Called early in the region_destructor(). */ DFBResult dfb_layer_context_remove_region( CoreLayerContext *context, CoreLayerRegion *region ); /* Called by dfb_layer_activate_context(), dfb_layer_remove_context() and dfb_layer_resume(). */ DFBResult dfb_layer_context_activate ( CoreLayerContext *context ); /* Called by dfb_layer_deactivate_context(), dfb_layer_remove_context() and dfb_layer_suspend(). */ DFBResult dfb_layer_context_deactivate( CoreLayerContext *context ); /* global reactions */ ReactionResult _dfb_layer_region_surface_listener( const void *msg_data, void *ctx ); #endif
pocketbook-free/browser
DirectFB-1.4.2/src/core/layers_internal.h
C
lgpl-2.1
6,199
 using Mag.Shared; using Decal.Adapter; namespace MagTools.Client { static class ChatSizeManager { public enum ChatState { Unknown, Minimized, Maximized, } public static ChatState CurrentState = ChatState.Unknown; public static bool Minimize(bool force = false) { if (CurrentState == ChatState.Minimized && !force) return false; System.Drawing.Rectangle rect = CoreManager.Current.Actions.UIElementRegion(Decal.Adapter.Wrappers.UIElementType.Chat); PostMessageTools.SendMouseClick(rect.X + 459, rect.Y + 11); CurrentState = ChatState.Minimized; return true; } public static bool Maximize(bool force = false) { if (CurrentState == ChatState.Maximized && !force) return false; System.Drawing.Rectangle rect = CoreManager.Current.Actions.UIElementRegion(Decal.Adapter.Wrappers.UIElementType.Chat); PostMessageTools.SendMouseClick(rect.X + 459, rect.Y + 11); CurrentState = ChatState.Maximized; return true; } } }
Mag-nus/Mag-Plugins
Mag-Tools/Client/ChatSizeManager.cs
C#
lgpl-2.1
1,043
// Virvo - Virtual Reality Volume Rendering // Copyright (C) 1999-2003 University of Stuttgart, 2004-2005 Brown University // Contact: Jurgen P. Schulze, jschulze@ucsd.edu // // This file is part of Virvo. // // Virvo 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 2.1 of the License, or (at your option) any later version. // // This library 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 this library (see license.txt); if not, write to the // Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "vvcompress.h" #include "vvcompressedvector.h" #ifdef HAVE_CONFIG_H #include "vvconfig.h" #endif #ifdef HAVE_SNAPPY #include <snappy.h> bool virvo::encodeSnappy(std::vector<unsigned char>& data) { if (data.empty()) return true; std::vector<unsigned char> compressed(snappy::MaxCompressedLength(data.size())); size_t len = 0; snappy::RawCompress((char const*)&data[0], data.size(), (char*)&compressed[0], &len); compressed.resize(len); data.swap(compressed); return true; } bool virvo::decodeSnappy(std::vector<unsigned char>& data) { if (data.empty()) return true; size_t len = 0; if (!snappy::GetUncompressedLength((char const*)&data[0], data.size(), &len)) return false; std::vector<unsigned char> uncompressed(len); if (!snappy::RawUncompress((char const*)&data[0], data.size(), (char*)&uncompressed[0])) return false; data.swap(uncompressed); return true; } #else // HAVE_SNAPPY bool virvo::encodeSnappy(std::vector<unsigned char>& /*data*/) { return false; } bool virvo::decodeSnappy(std::vector<unsigned char>& /*data*/) { return false; } #endif // !HAVE_SNAPPY bool virvo::encodeSnappy(CompressedVector& data) { if (data.getCompressionType() != Compress_None) return false; if (encodeSnappy(data.vector())) { data.setCompressionType(Compress_Snappy); return true; } return false; } bool virvo::decodeSnappy(CompressedVector& data) { if (data.getCompressionType() != Compress_Snappy) return false; if (decodeSnappy(data.vector())) { data.setCompressionType(Compress_None); return true; } return false; }
deskvox/deskvox
virvo/virvo/private/vvcompress_snappy.cpp
C++
lgpl-2.1
2,696
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Qt 4.8: webkit-guide.pro Example File (webkit/webkit-guide/webkit-guide.pro)</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <h1 class="title">webkit-guide.pro Example File</h1> <span class="small-subtitle">webkit/webkit-guide/webkit-guide.pro</span> <!-- $$$webkit/webkit-guide/webkit-guide.pro-description --> <div class="descr"> <a name="details"></a> <pre class="cpp"> #A simple .pro file to make Qt aware of the webkit-guide files. #For documentation generation #TEMPLATE += subdirs SOURCES = anim_accord.htm \ anim_demo-rotate.htm \ anim_demo-scale.htm \ anim_demo-skew.htm \ anim_gallery.htm \ anim_panel.htm \ anim_pulse.htm \ anim_skew.htm \ anim_slide1.htm \ anim_slide2.htm \ anim_slide3.htm \ anim_tabbedSkew.htm \ _copyright.txt \ css3_backgrounds.htm \ css3_border-img.htm \ css3_gradientBack.htm \ css3_gradientBackStop.htm \ css3_gradientButton.htm \ css3_grad-radial.htm \ css3_mask-grad.htm \ css3_mask-img.htm \ css3_multicol.htm \ css3_reflect.htm \ css3_scroll.htm \ css3_sel-nth.htm \ css3_shadow.htm \ css3_text-overflow.htm \ css3_text-shadow.htm \ css3_text-stroke.htm \ form_tapper.htm \ form_toggler.htm \ _image_assets.htm \ _index.html \ layout_link-fmt.htm \ layout_tbl-keyhole.htm \ mob_condjs.htm \ mob_layout.htm \ mob_mediaquery.htm \ storage.htm \ css/anim_accord.css \ css/anim_demo-rotate.css \ css/anim_demo-scale.css \ css/anim_demo-skew.css \ css/anim_gallery.css \ css/anim_panel.css \ css/anim_pulse.css \ css/anim_skew.css \ css/anim_slide.css \ css/anim_tabbedSkew.css \ css/css3_backgrounds.css \ css/css3_border-img.css \ css/css3_gradientBack.css \ css/css3_gradientBackStop.css \ css/css3_gradientButton.css \ css/css3_grad-radial.css \ css/css3_mask-grad.css \ css/css3_mask-img.css \ css/css3_multicol.css \ css/css3_reflect.css \ css/css3_scroll.css \ css/css3_sel-nth.css \ css/css3_shadowBlur.css \ css/css3_shadow.css \ css/css3_text-overflow.css \ css/css3_text-shadow.css \ css/css3_text-stroke.css \ css/form_tapper.css \ css/form_toggler.css \ css/layout_link-fmt.css \ css/layout_tbl-keyhole.css \ css/mob_condjs.css \ css/mobile.css \ css/mob_mediaquery.css \ css/mq_desktop.css \ css/mqlayout_desktop.css \ css/mqlayout_mobile.css \ css/mqlayout_touch.css \ css/mq_mobile.css \ css/mq_touch.css \ css/storage.css \ img/border-frame.png \ img/gal1.jpg \ img/gal2.jpg \ img/gal3.jpg \ img/gal4.jpg \ img/gal5.jpg \ img/gal6.jpg \ img/gal7.jpg \ img/gal8.jpg \ img/gradient.jpg \ img/gray_icon_close.png \ img/ic_ag_016.png \ img/ic_ag_032.png \ img/ic_ag_036.png \ img/ic_ag_048.png \ img/ic_al_016.png \ img/ic_al_032.png \ img/ic_al_036.png \ img/ic_al_048.png \ img/ic_ar_016.png \ img/ic_ar_032.png \ img/ic_ar_036.png \ img/ic_ar_048.png \ img/ic_b_016.png \ img/ic_b_032.png \ img/ic_b_036.png \ img/ic_b_048.png \ img/ic_be_016.png \ img/ic_be_032.png \ img/ic_be_036.png \ img/ic_be_048.png \ img/ic_c_016.png \ img/ic_c_032.png \ img/ic_c_036.png \ img/ic_c_048.png \ img/ic_ca_016.png \ img/ic_ca_032.png \ img/ic_ca_036.png \ img/ic_ca_048.png \ img/ic_cl_016.png \ img/ic_cl_032.png \ img/ic_cl_036.png \ img/ic_cl_048.png \ img/ic_cu_016.png \ img/ic_cu_032.png \ img/ic_cu_036.png \ img/ic_cu_048.png \ img/ic_f_016.png \ img/ic_f_032.png \ img/ic_f_036.png \ img/ic_f_048.png \ img/ic_fe_016.png \ img/ic_fe_032.png \ img/ic_fe_036.png \ img/ic_fe_048.png \ img/ic_h_016.png \ img/ic_h_032.png \ img/ic_h_036.png \ img/ic_h_048.png \ img/ic_he_016.png \ img/ic_he_032.png \ img/ic_he_036.png \ img/ic_he_048.png \ img/ic_k_016.png \ img/ic_k_032.png \ img/ic_k_036.png \ img/ic_k_048.png \ img/ic_li_016.png \ img/ic_li_032.png \ img/ic_li_036.png \ img/ic_li_048.png \ img/ic_mg_016.png \ img/ic_mg_032.png \ img/ic_mg_036.png \ img/ic_mg_048.png \ img/ic_n_016.png \ img/ic_n_032.png \ img/ic_n_036.png \ img/ic_n_048.png \ img/ic_na_016.png \ img/ic_na_032.png \ img/ic_na_036.png \ img/ic_na_048.png \ img/ic_ne_016.png \ img/ic_ne_032.png \ img/ic_ne_036.png \ img/ic_ne_048.png \ img/ic_ni_016.png \ img/ic_ni_032.png \ img/ic_ni_036.png \ img/ic_ni_048.png \ img/ic_o_016.png \ img/ic_o_032.png \ img/ic_o_036.png \ img/ic_o_048.png \ img/icon_check.png \ img/icon_check_x24green.png \ img/icon_dismiss.png \ img/icon_dismiss_x22.png \ img/icon_drill-down.png \ img/icon_drill-down_x32.png \ img/icon_drill-up.png \ img/icon_drill-up_x32.png \ img/icon_expand-nav.png \ img/icon_head-collapsed.png \ img/icon_head-collapsed_x13.png \ img/icon_head-expanded.png \ img/icon_head-expanded_x13.png \ img/icon_info.png \ img/icon_info_x24.png \ img/icon_link-doc.png \ img/icon_link-email.png \ img/icon_link-external.png \ img/icon_link-pdf.png \ img/icon_link-ppt.png \ img/icon_link-rss.png \ img/icon_link-sms.png \ img/icon_link-tel.png \ img/icon_link-xls.png \ img/icon_list-all_circ.png \ img/icon_list-all.png \ img/icon_nav_end.png \ img/icon_nav-start.png \ img/icon_nav-top.png \ img/icon_nav-up.png \ img/icon_question.png \ img/icon_scroll-left.png \ img/icon_scroll-right.png \ img/icon_trash.png \ img/ic_pt_016.png \ img/ic_pt_032.png \ img/ic_pt_036.png \ img/ic_pt_048.png \ img/ic_si_016.png \ img/ic_si_032.png \ img/ic_si_036.png \ img/ic_si_048.png \ img/ic_zn_016.png \ img/ic_zn_032.png \ img/ic_zn_036.png \ img/ic_zn_048.png \ img/land1.jpg \ img/land2.jpg \ img/land3.jpg \ img/land4.jpg \ img/land5.jpg \ img/land6.jpg \ img/land7.jpg \ img/land8.jpg \ img/mask.png \ img/tnail_gal1.png \ img/tnail_gal2.png \ img/tnail_gal3.png \ img/tnail_gal4.png \ img/tnail_gal5.png \ img/tnail_gal6.png \ img/tnail_gal7.png \ img/tnail_gal8.png \ js/anim_accord.js \ js/anim_gallery.js \ js/anim_panel.js \ js/anim_skew.js \ js/css3_backgrounds.js \ js/css3_border-img.js \ js/css3_grad-radial.js \ js/css3_mask-grad.js \ js/css3_mask-img.js \ js/css3_text-overflow.js \ js/form_tapper.js \ js/mob_condjs.js \ js/mobile.js \ js/storage.js \</pre> </div> <!-- @@@webkit/webkit-guide/webkit-guide.pro --> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2012 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>
sicily/qt4.8.4
doc/html/webkit-webkit-guide-webkit-guide-pro.html
HTML
lgpl-2.1
15,011
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #include "MooseEnum.h" #include "MooseUtils.h" #include "MooseError.h" #include <sstream> #include <algorithm> #include <iterator> #include <limits> #include <string> #include <iostream> MooseEnum::MooseEnum(std::string names, std::string default_name, bool allow_out_of_range) : MooseEnumBase(names, allow_out_of_range), _current("", INVALID_ID) { *this = default_name; } MooseEnum::MooseEnum(const MooseEnum & other_enum) : MooseEnumBase(other_enum), _current(other_enum._current) { } /** * Private constuctor for use by libmesh::Parameters */ MooseEnum::MooseEnum() : _current("", INVALID_ID) {} MooseEnum & MooseEnum::operator=(const std::string & name) { if (name == "") { _current = MooseEnumItem("", INVALID_ID); return *this; } std::string upper(MooseUtils::toUpper(name)); checkDeprecatedBase(upper); std::set<MooseEnumItem>::const_iterator iter = find(upper); if (iter == _items.end()) { if (_out_of_range_index == 0) // Are out of range values allowed? mooseError(std::string("Invalid option \"") + upper + "\" in MooseEnum. Valid options (not case-sensitive) are \"" + getRawNames() + "\"."); else { _current = MooseEnumItem(name, _out_of_range_index++); _items.insert(_current); } } else _current = *iter; return *this; } bool MooseEnum::operator==(const char * name) const { std::string upper(MooseUtils::toUpper(name)); std::set<MooseEnumItem>::const_iterator iter = find(upper); mooseAssert(_out_of_range_index != 0 || iter != _items.end(), std::string("Invalid string comparison \"") + upper + "\" in MooseEnum. Valid options (not case-sensitive) are \"" + getRawNames() + "\"."); return _current == upper; } bool MooseEnum::operator!=(const char * name) const { return !(*this == name); } bool MooseEnum::operator==(int value) const { return value == _current; } bool MooseEnum::operator!=(int value) const { return value != _current; } bool MooseEnum::operator==(unsigned short value) const { return value == _current; } bool MooseEnum::operator!=(unsigned short value) const { return value != _current; } bool MooseEnum::compareCurrent(const MooseEnum & other, CompareMode mode) const { switch (mode) { case CompareMode::COMPARE_BOTH: return (_current.id() == other._current.id()) && (_current.name() == other._current.name()); case CompareMode::COMPARE_NAME: return _current.name() == other._current.name(); case CompareMode::COMPARE_ID: return _current.id() == other._current.id(); } return false; } bool MooseEnum::operator==(const MooseEnum & value) const { mooseDeprecated("This method will be removed becuase the meaning is not well defined, please use " "the 'compareCurrent' method instead."); return value._current.name() == _current.name(); } bool MooseEnum::operator!=(const MooseEnum & value) const { mooseDeprecated("This method will be removed becuase the meaning is not well defined, please use " "the 'compareCurrent' method instead."); return value._current.name() != _current.name(); } void MooseEnum::checkDeprecated() const { checkDeprecatedBase(_current.name()); }
liuwenf/moose
framework/src/utils/MooseEnum.C
C++
lgpl-2.1
4,162
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import glob import os.path class Xbraid(MakefilePackage): """XBraid: Parallel time integration with Multigrid""" homepage = "https://computing.llnl.gov/projects/parallel-time-integration-multigrid/software" url = "https://github.com/XBraid/xbraid/archive/v2.2.0.tar.gz" version('2.2.0', sha256='082623b2ddcd2150b3ace65b96c1e00be637876ec6c94dc8fefda88743b35ba3') depends_on('mpi') def build(self, spec, prefix): make('libbraid.a') # XBraid doesn't have a real install target, so it has to be done # manually def install(self, spec, prefix): # Install headers mkdirp(prefix.include) headers = glob.glob('*.h') for f in headers: install(f, join_path(prefix.include, os.path.basename(f))) # Install library mkdirp(prefix.lib) library = 'libbraid.a' install(library, join_path(prefix.lib, library)) # Install other material (e.g., examples, tests, docs) mkdirp(prefix.share) install('makefile.inc', prefix.share) install_tree('examples', prefix.share.examples) install_tree('drivers', prefix.share.drivers) # TODO: Some of the scripts in 'test' are useful, even for # users; some could be deleted from an installation because # they're not useful to users install_tree('test', prefix.share.test) install_tree('user_utils', prefix.share.user_utils) install_tree('docs', prefix.share.docs) @property def libs(self): return find_libraries('libbraid', root=self.prefix, shared=False, recursive=True)
rspavel/spack
var/spack/repos/builtin/packages/xbraid/package.py
Python
lgpl-2.1
1,879
--- title: "Category:GtkGL" lastmodified: '2007-03-12' redirect_from: - /Category%3AGtkGL/ --- Category:GtkGL ============== (n/a)
znlgis/sod
docs/archived/categorygtkgl.md
Markdown
lgpl-2.1
136
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("VrPlayer.Effects.NoEffect")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("VrPlayer.Effects.NoEffect")] [assembly: AssemblyCopyright("Copyright © Microsoft 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9171ba3f-c9d3-4bcd-9663-a9cb8d601aca")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
univerio/vrplayer-cv1
VrPlayer.Effects/VrPlayer.Effects.None/Properties/AssemblyInfo.cs
C#
lgpl-2.1
1,444
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Authors: Jeffrey Stedfast <fejj@ximian.com> * * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU Lesser General Public * License as published by the Free Software Foundation. * * This program 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 * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <ctype.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <glib/gi18n-lib.h> #include "camel-charset-map.h" #include "camel-iconv.h" #include "camel-mime-utils.h" #include "camel-net-utils.h" #include "camel-network-settings.h" #ifdef G_OS_WIN32 #include <winsock2.h> #include <ws2tcpip.h> #ifdef HAVE_WSPIAPI_H #include <wspiapi.h> #endif #endif #include "camel-sasl-digest-md5.h" #define d(x) #define PARANOID(x) x #define CAMEL_SASL_DIGEST_MD5_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Private)) /* Implements rfc2831 */ static CamelServiceAuthType sasl_digest_md5_auth_type = { N_("DIGEST-MD5"), N_("This option will connect to the server using a " "secure DIGEST-MD5 password, if the server supports it."), "DIGEST-MD5", TRUE }; enum { STATE_AUTH, STATE_FINAL }; typedef struct { const gchar *name; guint type; } DataType; enum { DIGEST_REALM, DIGEST_NONCE, DIGEST_QOP, DIGEST_STALE, DIGEST_MAXBUF, DIGEST_CHARSET, DIGEST_ALGORITHM, DIGEST_CIPHER, DIGEST_UNKNOWN }; static DataType digest_args[] = { { "realm", DIGEST_REALM }, { "nonce", DIGEST_NONCE }, { "qop", DIGEST_QOP }, { "stale", DIGEST_STALE }, { "maxbuf", DIGEST_MAXBUF }, { "charset", DIGEST_CHARSET }, { "algorithm", DIGEST_ALGORITHM }, { "cipher", DIGEST_CIPHER }, { NULL, DIGEST_UNKNOWN } }; #define QOP_AUTH (1 << 0) #define QOP_AUTH_INT (1 << 1) #define QOP_AUTH_CONF (1 << 2) #define QOP_INVALID (1 << 3) static DataType qop_types[] = { { "auth", QOP_AUTH }, { "auth-int", QOP_AUTH_INT }, { "auth-conf", QOP_AUTH_CONF }, { NULL, QOP_INVALID } }; #define CIPHER_DES (1 << 0) #define CIPHER_3DES (1 << 1) #define CIPHER_RC4 (1 << 2) #define CIPHER_RC4_40 (1 << 3) #define CIPHER_RC4_56 (1 << 4) #define CIPHER_INVALID (1 << 5) static DataType cipher_types[] = { { "des", CIPHER_DES }, { "3des", CIPHER_3DES }, { "rc4", CIPHER_RC4 }, { "rc4-40", CIPHER_RC4_40 }, { "rc4-56", CIPHER_RC4_56 }, { NULL, CIPHER_INVALID } }; struct _param { gchar *name; gchar *value; }; struct _DigestChallenge { GPtrArray *realms; gchar *nonce; guint qop; gboolean stale; gint32 maxbuf; gchar *charset; gchar *algorithm; guint cipher; GList *params; }; struct _DigestURI { gchar *type; gchar *host; gchar *name; }; struct _DigestResponse { gchar *username; gchar *realm; gchar *nonce; gchar *cnonce; gchar nc[9]; guint qop; struct _DigestURI *uri; gchar resp[33]; guint32 maxbuf; gchar *charset; guint cipher; gchar *authzid; gchar *param; }; struct _CamelSaslDigestMd5Private { struct _DigestChallenge *challenge; struct _DigestResponse *response; gint state; }; G_DEFINE_TYPE (CamelSaslDigestMd5, camel_sasl_digest_md5, CAMEL_TYPE_SASL) static void decode_lwsp (const gchar **in) { const gchar *inptr = *in; while (isspace (*inptr)) inptr++; *in = inptr; } static gchar * decode_quoted_string (const gchar **in) { const gchar *inptr = *in; gchar *out = NULL, *outptr; gint outlen; gint c; decode_lwsp (&inptr); if (*inptr == '"') { const gchar *intmp; gint skip = 0; /* first, calc length */ inptr++; intmp = inptr; while ((c = *intmp++) && c != '"') { if (c == '\\' && *intmp) { intmp++; skip++; } } outlen = intmp - inptr - skip; out = outptr = g_malloc (outlen + 1); while ((c = *inptr++) && c != '"') { if (c == '\\' && *inptr) { c = *inptr++; } *outptr++ = c; } *outptr = '\0'; } *in = inptr; return out; } static gchar * decode_token (const gchar **in) { const gchar *inptr = *in; const gchar *start; decode_lwsp (&inptr); start = inptr; while (*inptr && *inptr != '=' && *inptr != ',') inptr++; if (inptr > start) { *in = inptr; return g_strndup (start, inptr - start); } else { return NULL; } } static gchar * decode_value (const gchar **in) { const gchar *inptr = *in; decode_lwsp (&inptr); if (*inptr == '"') { d(printf ("decoding quoted string token\n")); return decode_quoted_string (in); } else { d(printf ("decoding string token\n")); return decode_token (in); } } static GList * parse_param_list (const gchar *tokens) { GList *params = NULL; struct _param *param; const gchar *ptr; for (ptr = tokens; ptr && *ptr; ) { param = g_new0 (struct _param, 1); param->name = decode_token (&ptr); if (*ptr == '=') { ptr++; param->value = decode_value (&ptr); } params = g_list_prepend (params, param); if (*ptr == ',') ptr++; } return params; } static guint decode_data_type (DataType *dtype, const gchar *name) { gint i; for (i = 0; dtype[i].name; i++) { if (!g_ascii_strcasecmp (dtype[i].name, name)) break; } return dtype[i].type; } #define get_digest_arg(name) decode_data_type (digest_args, name) #define decode_qop(name) decode_data_type (qop_types, name) #define decode_cipher(name) decode_data_type (cipher_types, name) static const gchar * type_to_string (DataType *dtype, guint type) { gint i; for (i = 0; dtype[i].name; i++) { if (dtype[i].type == type) break; } return dtype[i].name; } #define qop_to_string(type) type_to_string (qop_types, type) #define cipher_to_string(type) type_to_string (cipher_types, type) static void digest_abort (gboolean *have_type, gboolean *abort) { if (*have_type) *abort = TRUE; *have_type = TRUE; } static struct _DigestChallenge * parse_server_challenge (const gchar *tokens, gboolean *abort) { struct _DigestChallenge *challenge = NULL; GList *params, *p; const gchar *ptr; #ifdef PARANOID gboolean got_algorithm = FALSE; gboolean got_stale = FALSE; gboolean got_maxbuf = FALSE; gboolean got_charset = FALSE; #endif /* PARANOID */ params = parse_param_list (tokens); if (!params) { *abort = TRUE; return NULL; } *abort = FALSE; challenge = g_new0 (struct _DigestChallenge, 1); challenge->realms = g_ptr_array_new (); challenge->maxbuf = 65536; for (p = params; p; p = p->next) { struct _param *param = p->data; gint type; type = get_digest_arg (param->name); switch (type) { case DIGEST_REALM: for (ptr = param->value; ptr && *ptr; ) { gchar *token; token = decode_token (&ptr); if (token) g_ptr_array_add (challenge->realms, token); if (*ptr == ',') ptr++; } g_free (param->value); g_free (param->name); g_free (param); break; case DIGEST_NONCE: g_free (challenge->nonce); challenge->nonce = param->value; g_free (param->name); g_free (param); break; case DIGEST_QOP: for (ptr = param->value; ptr && *ptr; ) { gchar *token; token = decode_token (&ptr); if (token) challenge->qop |= decode_qop (token); if (*ptr == ',') ptr++; } if (challenge->qop & QOP_INVALID) challenge->qop = QOP_INVALID; g_free (param->value); g_free (param->name); g_free (param); break; case DIGEST_STALE: PARANOID (digest_abort (&got_stale, abort)); if (!g_ascii_strcasecmp (param->value, "true")) challenge->stale = TRUE; else challenge->stale = FALSE; g_free (param->value); g_free (param->name); g_free (param); break; case DIGEST_MAXBUF: PARANOID (digest_abort (&got_maxbuf, abort)); challenge->maxbuf = atoi (param->value); g_free (param->value); g_free (param->name); g_free (param); break; case DIGEST_CHARSET: PARANOID (digest_abort (&got_charset, abort)); g_free (challenge->charset); if (param->value && *param->value) challenge->charset = param->value; else challenge->charset = NULL; g_free (param->name); g_free (param); break; case DIGEST_ALGORITHM: PARANOID (digest_abort (&got_algorithm, abort)); g_free (challenge->algorithm); challenge->algorithm = param->value; g_free (param->name); g_free (param); break; case DIGEST_CIPHER: for (ptr = param->value; ptr && *ptr; ) { gchar *token; token = decode_token (&ptr); if (token) challenge->cipher |= decode_cipher (token); if (*ptr == ',') ptr++; } if (challenge->cipher & CIPHER_INVALID) challenge->cipher = CIPHER_INVALID; g_free (param->value); g_free (param->name); g_free (param); break; default: challenge->params = g_list_prepend (challenge->params, param); break; } } g_list_free (params); return challenge; } static gchar * digest_uri_to_string (struct _DigestURI *uri) { if (uri->name) return g_strdup_printf ("%s/%s/%s", uri->type, uri->host, uri->name); else return g_strdup_printf ("%s/%s", uri->type, uri->host); } static void compute_response (struct _DigestResponse *resp, const gchar *passwd, gboolean client, guchar out[33]) { GString *buffer; GChecksum *checksum; guint8 *digest; gsize length; gchar *hex_a1; gchar *hex_a2; gchar *hex_kd; gchar *uri; buffer = g_string_sized_new (256); length = g_checksum_type_get_length (G_CHECKSUM_MD5); digest = g_alloca (length); /* Compute A1. */ g_string_append (buffer, resp->username); g_string_append_c (buffer, ':'); g_string_append (buffer, resp->realm); g_string_append_c (buffer, ':'); g_string_append (buffer, passwd); checksum = g_checksum_new (G_CHECKSUM_MD5); g_checksum_update ( checksum, (const guchar *) buffer->str, buffer->len); g_checksum_get_digest (checksum, digest, &length); g_checksum_free (checksum); /* Clear the buffer. */ g_string_truncate (buffer, 0); g_string_append_len (buffer, (gchar *) digest, length); g_string_append_c (buffer, ':'); g_string_append (buffer, resp->nonce); g_string_append_c (buffer, ':'); g_string_append (buffer, resp->cnonce); if (resp->authzid != NULL) { g_string_append_c (buffer, ':'); g_string_append (buffer, resp->authzid); } hex_a1 = g_compute_checksum_for_string ( G_CHECKSUM_MD5, buffer->str, buffer->len); /* Clear the buffer. */ g_string_truncate (buffer, 0); /* Compute A2. */ if (client) { /* We are calculating the client response. */ g_string_append (buffer, "AUTHENTICATE:"); } else { /* We are calculating the server rspauth. */ g_string_append_c (buffer, ':'); } uri = digest_uri_to_string (resp->uri); g_string_append (buffer, uri); g_free (uri); if (resp->qop == QOP_AUTH_INT || resp->qop == QOP_AUTH_CONF) g_string_append (buffer, ":00000000000000000000000000000000"); hex_a2 = g_compute_checksum_for_string ( G_CHECKSUM_MD5, buffer->str, buffer->len); /* Clear the buffer. */ g_string_truncate (buffer, 0); /* Compute KD. */ g_string_append (buffer, hex_a1); g_string_append_c (buffer, ':'); g_string_append (buffer, resp->nonce); g_string_append_c (buffer, ':'); g_string_append_len (buffer, resp->nc, 8); g_string_append_c (buffer, ':'); g_string_append (buffer, resp->cnonce); g_string_append_c (buffer, ':'); g_string_append (buffer, qop_to_string (resp->qop)); g_string_append_c (buffer, ':'); g_string_append (buffer, hex_a2); hex_kd = g_compute_checksum_for_string ( G_CHECKSUM_MD5, buffer->str, buffer->len); g_strlcpy ((gchar *) out, hex_kd, 33); g_free (hex_a1); g_free (hex_a2); g_free (hex_kd); g_string_free (buffer, TRUE); } static struct _DigestResponse * generate_response (struct _DigestChallenge *challenge, const gchar *host, const gchar *protocol, const gchar *user, const gchar *passwd) { struct _DigestResponse *resp; struct _DigestURI *uri; GChecksum *checksum; guint8 *digest; gsize length; gchar *bgen; length = g_checksum_type_get_length (G_CHECKSUM_MD5); digest = g_alloca (length); resp = g_new0 (struct _DigestResponse, 1); resp->username = g_strdup (user); /* FIXME: we should use the preferred realm */ if (challenge->realms && challenge->realms->len > 0) resp->realm = g_strdup (challenge->realms->pdata[0]); else resp->realm = g_strdup (""); resp->nonce = g_strdup (challenge->nonce); /* generate the cnonce */ bgen = g_strdup_printf ("%p:%lu:%lu", (gpointer) resp, (gulong) getpid (), (gulong) time (NULL)); checksum = g_checksum_new (G_CHECKSUM_MD5); g_checksum_update (checksum, (guchar *) bgen, -1); g_checksum_get_digest (checksum, digest, &length); g_checksum_free (checksum); g_free (bgen); /* take our recommended 64 bits of entropy */ resp->cnonce = g_base64_encode ((guchar *) digest, 8); /* we don't support re-auth so the nonce count is always 1 */ strcpy (resp->nc, "00000001"); /* choose the QOP */ /* FIXME: choose - probably choose "auth" ??? */ resp->qop = QOP_AUTH; /* create the URI */ uri = g_new0 (struct _DigestURI, 1); uri->type = g_strdup (protocol); uri->host = g_strdup (host); uri->name = NULL; resp->uri = uri; /* charsets... yay */ if (challenge->charset) { /* I believe that this is only ever allowed to be * UTF-8. We strdup the charset specified by the * challenge anyway, just in case it's not UTF-8. */ resp->charset = g_strdup (challenge->charset); } resp->cipher = CIPHER_INVALID; if (resp->qop == QOP_AUTH_CONF) { /* FIXME: choose a cipher? */ resp->cipher = CIPHER_INVALID; } /* we don't really care about this... */ resp->authzid = NULL; compute_response (resp, passwd, TRUE, (guchar *) resp->resp); return resp; } static GByteArray * digest_response (struct _DigestResponse *resp) { GByteArray *buffer; const gchar *str; gchar *buf; buffer = g_byte_array_new (); g_byte_array_append (buffer, (guint8 *) "username=\"", 10); if (resp->charset) { /* Encode the username using the requested charset */ gchar *username, *outbuf; const gchar *charset; gsize len, outlen; const gchar *inbuf; iconv_t cd; charset = camel_iconv_locale_charset (); if (!charset) charset = "iso-8859-1"; cd = camel_iconv_open (resp->charset, charset); len = strlen (resp->username); outlen = 2 * len; /* plenty of space */ outbuf = username = g_malloc0 (outlen + 1); inbuf = resp->username; if (cd == (iconv_t) -1 || camel_iconv (cd, &inbuf, &len, &outbuf, &outlen) == (gsize) -1) { /* We can't convert to UTF-8 - pretend we never got a charset param? */ g_free (resp->charset); resp->charset = NULL; /* Set the username to the non-UTF-8 version */ g_free (username); username = g_strdup (resp->username); } if (cd != (iconv_t) -1) camel_iconv_close (cd); g_byte_array_append (buffer, (guint8 *) username, strlen (username)); g_free (username); } else { g_byte_array_append (buffer, (guint8 *) resp->username, strlen (resp->username)); } g_byte_array_append (buffer, (guint8 *) "\",realm=\"", 9); g_byte_array_append (buffer, (guint8 *) resp->realm, strlen (resp->realm)); g_byte_array_append (buffer, (guint8 *) "\",nonce=\"", 9); g_byte_array_append (buffer, (guint8 *) resp->nonce, strlen (resp->nonce)); g_byte_array_append (buffer, (guint8 *) "\",cnonce=\"", 10); g_byte_array_append (buffer, (guint8 *) resp->cnonce, strlen (resp->cnonce)); g_byte_array_append (buffer, (guint8 *) "\",nc=", 5); g_byte_array_append (buffer, (guint8 *) resp->nc, 8); g_byte_array_append (buffer, (guint8 *) ",qop=", 5); str = qop_to_string (resp->qop); g_byte_array_append (buffer, (guint8 *) str, strlen (str)); g_byte_array_append (buffer, (guint8 *) ",digest-uri=\"", 13); buf = digest_uri_to_string (resp->uri); g_byte_array_append (buffer, (guint8 *) buf, strlen (buf)); g_free (buf); g_byte_array_append (buffer, (guint8 *) "\",response=", 11); g_byte_array_append (buffer, (guint8 *) resp->resp, 32); if (resp->maxbuf > 0) { g_byte_array_append (buffer, (guint8 *) ",maxbuf=", 8); buf = g_strdup_printf ("%u", resp->maxbuf); g_byte_array_append (buffer, (guint8 *) buf, strlen (buf)); g_free (buf); } if (resp->charset) { g_byte_array_append (buffer, (guint8 *) ",charset=", 9); g_byte_array_append (buffer, (guint8 *) resp->charset, strlen ((gchar *) resp->charset)); } if (resp->cipher != CIPHER_INVALID) { str = cipher_to_string (resp->cipher); if (str) { g_byte_array_append (buffer, (guint8 *) ",cipher=\"", 9); g_byte_array_append (buffer, (guint8 *) str, strlen (str)); g_byte_array_append (buffer, (guint8 *) "\"", 1); } } if (resp->authzid) { g_byte_array_append (buffer, (guint8 *) ",authzid=\"", 10); g_byte_array_append (buffer, (guint8 *) resp->authzid, strlen (resp->authzid)); g_byte_array_append (buffer, (guint8 *) "\"", 1); } return buffer; } static void sasl_digest_md5_finalize (GObject *object) { CamelSaslDigestMd5 *sasl = CAMEL_SASL_DIGEST_MD5 (object); struct _DigestChallenge *c = sasl->priv->challenge; struct _DigestResponse *r = sasl->priv->response; GList *p; gint i; if (c != NULL) { for (i = 0; i < c->realms->len; i++) g_free (c->realms->pdata[i]); g_ptr_array_free (c->realms, TRUE); g_free (c->nonce); g_free (c->charset); g_free (c->algorithm); for (p = c->params; p; p = p->next) { struct _param *param = p->data; g_free (param->name); g_free (param->value); g_free (param); } g_list_free (c->params); g_free (c); } if (r != NULL) { g_free (r->username); g_free (r->realm); g_free (r->nonce); g_free (r->cnonce); if (r->uri) { g_free (r->uri->type); g_free (r->uri->host); g_free (r->uri->name); } g_free (r->charset); g_free (r->authzid); g_free (r->param); g_free (r); } /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (camel_sasl_digest_md5_parent_class)->finalize (object); } static GByteArray * sasl_digest_md5_challenge_sync (CamelSasl *sasl, GByteArray *token, GCancellable *cancellable, GError **error) { CamelSaslDigestMd5 *sasl_digest = CAMEL_SASL_DIGEST_MD5 (sasl); struct _CamelSaslDigestMd5Private *priv = sasl_digest->priv; CamelNetworkSettings *network_settings; CamelSettings *settings; CamelService *service; struct _param *rspauth; GByteArray *ret = NULL; gboolean abort = FALSE; const gchar *ptr; guchar out[33]; gchar *tokens; struct addrinfo *ai, hints; const gchar *service_name; const gchar *password; gchar *host; gchar *user; /* Need to wait for the server */ if (!token) return NULL; service = camel_sasl_get_service (sasl); service_name = camel_sasl_get_service_name (sasl); settings = camel_service_get_settings (service); g_return_val_if_fail (CAMEL_IS_NETWORK_SETTINGS (settings), NULL); network_settings = CAMEL_NETWORK_SETTINGS (settings); host = camel_network_settings_dup_host (network_settings); user = camel_network_settings_dup_user (network_settings); g_return_val_if_fail (user != NULL, NULL); if (host == NULL) host = g_strdup ("localhost"); password = camel_service_get_password (service); g_return_val_if_fail (password != NULL, NULL); switch (priv->state) { case STATE_AUTH: if (token->len > 2048) { g_set_error ( error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, _("Server challenge too long (>2048 octets)")); goto exit; } tokens = g_strndup ((gchar *) token->data, token->len); priv->challenge = parse_server_challenge (tokens, &abort); g_free (tokens); if (!priv->challenge || abort) { g_set_error ( error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, _("Server challenge invalid\n")); goto exit; } if (priv->challenge->qop == QOP_INVALID) { g_set_error ( error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, _("Server challenge contained invalid " "\"Quality of Protection\" token")); goto exit; } memset (&hints, 0, sizeof (hints)); hints.ai_flags = AI_CANONNAME; ai = camel_getaddrinfo ( host, NULL, &hints, cancellable, NULL); if (ai && ai->ai_canonname) ptr = ai->ai_canonname; else ptr = "localhost.localdomain"; priv->response = generate_response ( priv->challenge, ptr, service_name, user, password); if (ai) camel_freeaddrinfo (ai); ret = digest_response (priv->response); break; case STATE_FINAL: if (token->len) tokens = g_strndup ((gchar *) token->data, token->len); else tokens = NULL; if (!tokens || !*tokens) { g_free (tokens); g_set_error ( error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, _("Server response did not contain " "authorization data")); goto exit; } rspauth = g_new0 (struct _param, 1); ptr = tokens; rspauth->name = decode_token (&ptr); if (*ptr == '=') { ptr++; rspauth->value = decode_value (&ptr); } g_free (tokens); if (!rspauth->value) { g_free (rspauth->name); g_free (rspauth); g_set_error ( error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, _("Server response contained incomplete " "authorization data")); goto exit; } compute_response (priv->response, password, FALSE, out); if (memcmp (out, rspauth->value, 32) != 0) { g_free (rspauth->name); g_free (rspauth->value); g_free (rspauth); g_set_error ( error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, _("Server response does not match")); camel_sasl_set_authenticated (sasl, TRUE); goto exit; } g_free (rspauth->name); g_free (rspauth->value); g_free (rspauth); ret = g_byte_array_new (); camel_sasl_set_authenticated (sasl, TRUE); default: break; } priv->state++; exit: g_free (host); g_free (user); return ret; } static void camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *class) { GObjectClass *object_class; CamelSaslClass *sasl_class; g_type_class_add_private (class, sizeof (CamelSaslDigestMd5Private)); object_class = G_OBJECT_CLASS (class); object_class->finalize = sasl_digest_md5_finalize; sasl_class = CAMEL_SASL_CLASS (class); sasl_class->auth_type = &sasl_digest_md5_auth_type; sasl_class->challenge_sync = sasl_digest_md5_challenge_sync; } static void camel_sasl_digest_md5_init (CamelSaslDigestMd5 *sasl) { sasl->priv = CAMEL_SASL_DIGEST_MD5_GET_PRIVATE (sasl); }
gcampax/evolution-data-server
camel/camel-sasl-digest-md5.c
C
lgpl-2.1
23,237
/*****************************************************************************\ * ANALYSIS PERFORMANCE TOOLS * * Extrae * * Instrumentation package for parallel applications * ***************************************************************************** * ___ This library is free software; you can redistribute it and/or * * / __ modify it under the terms of the GNU LGPL as published * * / / _____ by the Free Software Foundation; either version 2.1 * * / / / \ of the License, or (at your option) any later version. * * ( ( ( B S C ) * * \ \ \_____/ This library is distributed in 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 LGPL for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * The GNU LEsser General Public License is contained in the file COPYING. * * --------- * * Barcelona Supercomputing Center - Centro Nacional de Supercomputacion * \*****************************************************************************/ #ifndef _OMP_SNIPPETS_H_INCLUDED_ #define _OMP_SNIPPETS_H_INCLUDED_ #include <BPatch.h> #include "applicationType.h" void InstrumentOMPruntime (bool locks, ApplicationType *at, BPatch_image *appImage); void InstrumentOMPruntime_Intel (BPatch_image *appImage, BPatch_process *appProcess); #endif
bsc-performance-tools/extrae
src/launcher/dyninst/ompSnippets.h
C
lgpl-2.1
2,040
/* -*- OpenSAF -*- * * (C) Copyright 2008 The OpenSAF Foundation * * This program 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. This file and program are licensed * under the GNU Lesser General Public License Version 2.1, February 1999. * The complete license can be accessed from the following location: * http://opensource.org/licenses/lgpl-license.php * See the Copying file included with the OpenSAF distribution for full * licensing terms. * * Author(s): Emerson Network Power * */ /***************************************************************************** .............................................................................. .............................................................................. DESCRIPTION: ****************************************************************************** */ #ifndef MDA_PVT_API_H #define MDA_PVT_API_H #include "ncs_ubaid.h" #include "ncs_util.h" #include "ncs_lib.h" #define VDA_SVC_PVT_VER 1 #define VDA_WRT_VDS_SUBPART_VER_MIN 1 #define VDA_WRT_VDS_SUBPART_VER_MAX 1 #define VDA_WRT_VDS_SUBPART_VER_RANGE \ (VDA_WRT_VDS_SUBPART_VER_MAX - \ VDA_WRT_VDS_SUBPART_VER_MIN +1) #define m_NCS_VDA_ENC_MSG_FMT_GET m_NCS_ENC_MSG_FMT_GET #define m_NCS_VDA_MSG_FORMAT_IS_VALID m_NCS_MSG_FORMAT_IS_VALID /***********************************************************************\ VDA-PRIVATE APIs used by VDS. \***********************************************************************/ EXTERN_C uns32 vda_chg_role_vdest(MDS_DEST *i_vdest, V_DEST_RL i_new_role); EXTERN_C uns32 vda_create_vdest_locally(uns32 i_policy, MDS_DEST *i_vdest, MDS_HDL *o_mds_vdest_hdl); EXTERN_C uns32 vda_util_enc_8bit(NCS_UBAID *uba, uns8 data); EXTERN_C uns8 vda_util_dec_8bit(NCS_UBAID *uba); #define vda_util_enc_n_octets(uba, size, buff) ncs_encode_n_octets_in_uba(uba, buff, size) #define vda_util_dec_n_octets(uba, size, buff) ncs_decode_n_octets_from_uba(uba, buff, size) EXTERN_C uns32 vda_util_enc_vdest_name(NCS_UBAID *uba, SaNameT *name); EXTERN_C uns32 vda_util_dec_vdest_name(NCS_UBAID *uba, SaNameT *name); EXTERN_C uns32 vda_util_enc_vdest(NCS_UBAID *uba, MDS_DEST *dest); EXTERN_C uns32 vda_util_dec_vdest(NCS_UBAID *uba, MDS_DEST *dest); /***********************************************************************\ ada_lib_req : This API initializes ADA (Absolute Destination Agent code) \***********************************************************************/ /* Service provider abstract name */ #define m_ADA_SP_ABST_NAME "NCS_ADA" EXTERN_C uns32 ada_lib_req(NCS_LIB_REQ_INFO *req); /***********************************************************************\ vda_lib_req : This API initializes VDA (Virtual Destination Agent code) \***********************************************************************/ /* Service provider abstract name */ #define m_VDA_SP_ABST_NAME "NCS_VDA" EXTERN_C uns32 vda_lib_req(NCS_LIB_REQ_INFO *req); typedef enum { MDA_INST_NAME_TYPE_NULL, MDA_INST_NAME_TYPE_ADEST, MDA_INST_NAME_TYPE_UNNAMED_VDEST, MDA_INST_NAME_TYPE_NAMED_VDEST, } MDA_INST_NAME_TYPE; MDA_INST_NAME_TYPE mda_get_inst_name_type(SaNameT *name); #ifndef MDA_TRACE_LEVEL #define MDA_TRACE_LEVEL 0 #endif #if (MDA_TRACE_LEVEL == 1) #define MDA_TRACE1_ARG1(x) printf(x) #define MDA_TRACE1_ARG2(x,y) printf(x,y) #else #define MDA_TRACE1_ARG1(x) #define MDA_TRACE1_ARG2(x,y) #endif #endif
kenzaburo/OpenSaf-FrameWork
osaf/libs/core/mds/include/mda_pvt_api.h
C
lgpl-2.1
3,567
/* Copyright (C) 2006 EBI This library 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 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the itmplied 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 this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.biomart.common.utils; import java.beans.PropertyChangeEvent; import java.util.Set; /** * This class wraps an existing set, and causes {@link PropertyChangeEvent} * events to be fired whenever it changes. * <p> * Adding objects to the set will result in events where the before value is * null and the after value is the value being added. * <p> * Removing them will result in events where the before value is they value * being removed and the after value is null. * <p> * Multiple add/remove events will have both before and after values of null. * <p> * All events will have a property of {@link BeanSet#propertyName}. * * @author Richard Holland <holland@ebi.ac.uk> * @version $Revision: 1.2 $, $Date: 2007-10-03 10:41:02 $, modified by * $Author: rh4 $ * @since 0.7 */ public class BeanSet extends BeanCollection implements Set { private static final long serialVersionUID = 1L; /** * Construct a new instance that wraps the delegate set and produces * {@link PropertyChangeEvent} events whenever the delegate set changes. * * @param delegate * the delegate set. */ public BeanSet(final Set delegate) { super(delegate); } }
pubmed2ensembl/MartScript
src/org/biomart/common/utils/BeanSet.java
Java
lgpl-2.1
1,943
REM Run this cmd from the sln folder to copy all generated images over the originals. REM Only do this if you have checked that the generated images are correct. REM todo: run unit tests C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe xcopy .\Tests\Mapsui.Rendering.Skia.Tests\bin\Debug\Resources\Images\Generated .\Tests\Mapsui.Rendering.Skia.Tests\Resources\Images\Original /Y xcopy .\Tests\Mapsui.Rendering.Xaml.Tests\bin\Debug\Resources\Images\Generated .\Tests\Mapsui.Rendering.Xaml.Tests\Resources\Images\Original /Y
tebben/Mapsui
Scripts/test-image-copier.cmd
Batchfile
lgpl-2.1
544
package org.epoxide.commons; import java.util.logging.Logger; import org.epoxide.commons.registry.Identifier; public class EpoxideCommons { /** * The logger used by Epoxide Commons. By default this is an anonymous logger, however you * can use {@link #setLogger(Logger)} to change it to a new one. */ private static Logger log = Logger.getAnonymousLogger(); /** * The default value to use for namespaced objects like {@link Identifier}. */ private static String defaultName = "epoxide"; /** * Sets the logger for Epoxide Commons to use. This will create a new * {@link java.util.logging.Logger} using {@link Logger#getLogger(String)}. * * @param name The name for the logger. */ public static void setLogger (String name) { setLogger(Logger.getLogger(name)); } /** * Sets the logger for Epoxide Commons to use. * * @param logger The logger for EpoxideCommons to use. */ public static void setLogger (Logger logger) { log = logger; } /** * Gets the logger for Epoxide Commons. This should only be used internally to post * messages. Using it for other reasons is fine though. * * @return The logger used by Epoxide Commons. */ public static Logger getLogger () { return log; } /** * Gets the default name for things like namespaced objects. * * @return The default name to use for things like namespaced objects. */ public static String getDefaultName () { return defaultName; } /** * Sets the default name for things like namespaced objects. * * @param name The new name for namespaced objects to use by default. */ public static void setDefaultName (String name) { defaultName = name; } }
Epoxide-Software/Epoxide-Commons
src/main/java/org/epoxide/commons/EpoxideCommons.java
Java
lgpl-2.1
1,856
// Jubatus: Online machine learning framework for distributed environment // Copyright (C) 2011,2012 Preferred Infrastructure and Nippon Telegraph and Telephone Corporation. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License version 2.1 as published by the Free Software Foundation. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef JUBATUS_CORE_FRAMEWORK_MIXABLE_HPP_ #define JUBATUS_CORE_FRAMEWORK_MIXABLE_HPP_ #include <iostream> #include <string> #include <vector> #include <msgpack.hpp> #include <pficommon/concurrent/rwmutex.h> #include <pficommon/lang/shared_ptr.h> #include "../common/exception.hpp" #include "../common/byte_buffer.hpp" namespace jubatus { namespace core { namespace framework { class mixable0 { public: mixable0() { } virtual ~mixable0() { } virtual common::byte_buffer get_diff() const = 0; virtual void put_diff(const common::byte_buffer&) = 0; virtual void mix(const common::byte_buffer&, const common::byte_buffer&, common::byte_buffer&) const = 0; virtual void save(std::ostream& ofs) = 0; virtual void load(std::istream& ifs) = 0; virtual void clear() = 0; }; class mixable_holder { public: typedef std::vector<mixable0*> mixable_list; mixable_holder() { } virtual ~mixable_holder() { } void register_mixable(mixable0* m) { mixables_.push_back(m); } mixable_list get_mixables() const { return mixables_; } pfi::concurrent::rw_mutex& rw_mutex() { return rw_mutex_; } protected: pfi::concurrent::rw_mutex rw_mutex_; std::vector<mixable0*> mixables_; }; template<typename Model, typename Diff> class mixable : public mixable0 { public: typedef Model model_type; typedef Diff diff_type; typedef pfi::lang::shared_ptr<Model> model_ptr; virtual ~mixable() { } virtual void clear() = 0; virtual Diff get_diff_impl() const = 0; virtual void put_diff_impl(const Diff&) = 0; virtual void mix_impl(const Diff&, const Diff&, Diff&) const = 0; void set_model(model_ptr m) { model_ = m; } common::byte_buffer get_diff() const { if (model_) { common::byte_buffer buf; pack_(get_diff_impl(), buf); return buf; } else { throw JUBATUS_EXCEPTION(common::config_not_set()); } } void put_diff(const common::byte_buffer& d) { if (model_) { Diff diff; unpack_(d, diff); put_diff_impl(diff); } else { throw JUBATUS_EXCEPTION(common::config_not_set()); } } void mix( const common::byte_buffer& lhs, const common::byte_buffer& rhs, common::byte_buffer& mixed_buf) const { Diff left, right, mixed; unpack_(lhs, left); unpack_(rhs, right); mix_impl(left, right, mixed); pack_(mixed, mixed_buf); } void save(std::ostream& os) { model_->save(os); } void load(std::istream& is) { model_->load(is); } model_ptr get_model() const { return model_; } private: void unpack_(const common::byte_buffer& buf, Diff& d) const { msgpack::unpacked msg; msgpack::unpack(&msg, buf.ptr(), buf.size()); msg.get().convert(&d); } void pack_(const Diff& d, common::byte_buffer& buf) const { msgpack::sbuffer sbuf; msgpack::pack(sbuf, d); buf.assign(sbuf.data(), sbuf.size()); } model_ptr model_; }; } // namespace framework } // namespace core } // namespace jubatus #endif // JUBATUS_CORE_FRAMEWORK_MIXABLE_HPP_
abetv/jubatus
jubatus/core/framework/mixable.hpp
C++
lgpl-2.1
3,965
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_22) on Mon May 24 23:03:26 CEST 2010 --> <TITLE> Uses of Package org.mockito.internal.runners.util (Mockito API) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Uses of Package org.mockito.internal.runners.util (Mockito API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/mockito/internal/runners/util/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Package<br>org.mockito.internal.runners.util</B></H2> </CENTER> No usage of org.mockito.internal.runners.util <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/mockito/internal/runners/util/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
cacheonix/cacheonix-core
3rdparty/mockito-1.8.5/javadoc/org/mockito/internal/runners/util/package-use.html
HTML
lgpl-2.1
5,679
/**************************************************************************** ** ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtWinExtras module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qwinfunctions.h" #include "qwinfunctions_p.h" #include "qwineventfilter_p.h" #include "windowsguidsdefs_p.h" #include <QGuiApplication> #include <QWindow> #include <QSettings> #include <QPixmap> #include <QBitmap> #include <QImage> #include <QColor> #include <QRegion> #include <QMargins> #include <comdef.h> #include "winshobjidl_p.h" QT_BEGIN_NAMESPACE Q_GUI_EXPORT HBITMAP qt_createIconMask(const QBitmap &bitmap); Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0); Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p); Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h); Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon); /*! \namespace QtWin \inmodule QtWinExtras \brief The QtWin namespace contains miscellaneous Windows-specific functions. \inheaderfile QtWin */ /*! \since 5.2 Creates a \c HBITMAP equivalent of the QBitmap \a bitmap. It is the caller's responsibility to free the \c HBITMAP data after use. \sa toHBITMAP() */ HBITMAP QtWin::createMask(const QBitmap &bitmap) { return qt_createIconMask(bitmap); } /*! \since 5.2 Creates a \c HBITMAP equivalent of the QPixmap \a p, based on the given \a format. Returns the \c HBITMAP handle. It is the caller's responsibility to free the \c HBITMAP data after use. \sa fromHBITMAP() */ HBITMAP QtWin::toHBITMAP(const QPixmap &p, QtWin::HBitmapFormat format) { return qt_pixmapToWinHBITMAP(p, format); } /*! \since 5.2 Returns a QPixmap that is equivalent to the given \a bitmap. The conversion is based on the specified \a format. \sa toHBITMAP() */ QPixmap QtWin::fromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format) { return qt_pixmapFromWinHBITMAP(bitmap, format); } /*! \since 5.2 Creates a \c HICON equivalent of the QPixmap \a p. Returns the \c HICON handle. It is the caller's responsibility to free the \c HICON data after use. \sa fromHICON() */ HICON QtWin::toHICON(const QPixmap &p) { return qt_pixmapToWinHICON(p); } /*! \since 5.2 Returns a QImage that is equivalent to the given \a bitmap. The conversion is based on the specified \c HDC context \a hdc using the specified \a width and \a height. \sa toHBITMAP() */ QImage QtWin::imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height) { return qt_imageFromWinHBITMAP(hdc, bitmap, width, height); } /*! \since 5.2 Returns a QPixmap that is equivalent to the given \a icon. \sa toHICON() */ QPixmap QtWin::fromHICON(HICON icon) { return qt_pixmapFromWinHICON(icon); } HRGN qt_RectToHRGN(const QRect &rc) { return CreateRectRgn(rc.left(), rc.top(), rc.right()+1, rc.bottom()+1); } /*! \since 5.2 Returns a HRGN that is equivalent to the given \a region. */ HRGN QtWin::toHRGN(const QRegion &region) { if (region.isNull() || region.rectCount() == 0) { return 0; } HRGN resultRgn = 0; QVector<QRect> rects = region.rects(); resultRgn = qt_RectToHRGN(rects.at(0)); const int size = rects.size(); for (int i = 1; i < size; i++) { HRGN tmpRgn = qt_RectToHRGN(rects.at(i)); int err = CombineRgn(resultRgn, resultRgn, tmpRgn, RGN_OR); if (err == ERROR) qWarning("Error combining HRGNs."); DeleteObject(tmpRgn); } return resultRgn; } /*! \since 5.2 Returns a QRegion that is equivalent to the given \a hrgn. */ QRegion QtWin::fromHRGN(HRGN hrgn) { DWORD regionDataSize = GetRegionData(hrgn, 0, NULL); if (regionDataSize == 0) return QRegion(); LPRGNDATA regionData = (LPRGNDATA)malloc(regionDataSize); if (!regionData) return QRegion(); QRegion region; if (GetRegionData(hrgn, regionDataSize, regionData) == regionDataSize) { LPRECT pRect = (LPRECT)regionData->Buffer; for (DWORD i = 0; i < regionData->rdh.nCount; ++i) region += QRect(pRect[i].left, pRect[i].top, pRect[i].right - pRect[i].left, pRect[i].bottom - pRect[i].top); } free(regionData); return region; } /*! \since 5.2 Returns a message string that explains the \a hresult error id specified or an empty string if the explanation cannot be found. */ QString QtWin::stringFromHresult(HRESULT hresult) { _com_error error(hresult); QString errorMsg; if (sizeof(TCHAR) == sizeof(wchar_t)) errorMsg = QString::fromWCharArray((wchar_t*) error.ErrorMessage()); else errorMsg = QString::fromLocal8Bit((char*) error.ErrorMessage()); return errorMsg; } /*! \since 5.2 Returns the code name of the \a hresult error id specified (usually the name of the WinAPI macro) or an empty string if the message is unknown. */ QString QtWin::errorStringFromHresult(HRESULT hresult) { switch (hresult) { case 0x8000FFFF : return QStringLiteral("E_UNEXPECTED"); case 0x80004001 : return QStringLiteral("E_NOTIMPL"); case 0x8007000E : return QStringLiteral("E_OUTOFMEMORY"); case 0x80070057 : return QStringLiteral("E_INVALIDARG"); case 0x80004002 : return QStringLiteral("E_NOINTERFACE"); case 0x80004003 : return QStringLiteral("E_POINTER"); case 0x80070006 : return QStringLiteral("E_HANDLE"); case 0x80004004 : return QStringLiteral("E_ABORT"); case 0x80004005 : return QStringLiteral("E_FAIL"); case 0x80070005 : return QStringLiteral("E_ACCESSDENIED"); case 0x8000000A : return QStringLiteral("E_PENDING"); case 0x80004006 : return QStringLiteral("CO_E_INIT_TLS"); case 0x80004007 : return QStringLiteral("CO_E_INIT_SHARED_ALLOCATOR"); case 0x80004008 : return QStringLiteral("CO_E_INIT_MEMORY_ALLOCATOR"); case 0x80004009 : return QStringLiteral("CO_E_INIT_CLASS_CACHE"); case 0x8000400A : return QStringLiteral("CO_E_INIT_RPC_CHANNEL"); case 0x8000400B : return QStringLiteral("CO_E_INIT_TLS_SET_CHANNEL_CONTROL"); case 0x8000400C : return QStringLiteral("CO_E_INIT_TLS_CHANNEL_CONTROL"); case 0x8000400D : return QStringLiteral("CO_E_INIT_UNACCEPTED_USER_ALLOCATOR"); case 0x8000400E : return QStringLiteral("CO_E_INIT_SCM_MUTEX_EXISTS"); case 0x8000400F : return QStringLiteral("CO_E_INIT_SCM_FILE_MAPPING_EXISTS"); case 0x80004010 : return QStringLiteral("CO_E_INIT_SCM_MAP_VIEW_OF_FILE"); case 0x80004011 : return QStringLiteral("CO_E_INIT_SCM_EXEC_FAILURE"); case 0x80004012 : return QStringLiteral("CO_E_INIT_ONLY_SINGLE_THREADED"); case 0x80004013 : return QStringLiteral("CO_E_CANT_REMOTE"); case 0x80004014 : return QStringLiteral("CO_E_BAD_SERVER_NAME"); case 0x80004015 : return QStringLiteral("CO_E_WRONG_SERVER_IDENTITY"); case 0x80004016 : return QStringLiteral("CO_E_OLE1DDE_DISABLED"); case 0x80004017 : return QStringLiteral("CO_E_RUNAS_SYNTAX"); case 0x80004018 : return QStringLiteral("CO_E_CREATEPROCESS_FAILURE"); case 0x80004019 : return QStringLiteral("CO_E_RUNAS_CREATEPROCESS_FAILURE"); case 0x8000401A : return QStringLiteral("CO_E_RUNAS_LOGON_FAILURE"); case 0x8000401B : return QStringLiteral("CO_E_LAUNCH_PERMSSION_DENIED"); case 0x8000401C : return QStringLiteral("CO_E_START_SERVICE_FAILURE"); case 0x8000401D : return QStringLiteral("CO_E_REMOTE_COMMUNICATION_FAILURE"); case 0x8000401E : return QStringLiteral("CO_E_SERVER_START_TIMEOUT"); case 0x8000401F : return QStringLiteral("CO_E_CLSREG_INCONSISTENT"); case 0x80004020 : return QStringLiteral("CO_E_IIDREG_INCONSISTENT"); case 0x80004021 : return QStringLiteral("CO_E_NOT_SUPPORTED"); case 0x80004022 : return QStringLiteral("CO_E_RELOAD_DLL"); case 0x80004023 : return QStringLiteral("CO_E_MSI_ERROR"); case 0x80004024 : return QStringLiteral("CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT"); case 0x80004025 : return QStringLiteral("CO_E_SERVER_PAUSED"); case 0x80004026 : return QStringLiteral("CO_E_SERVER_NOT_PAUSED"); case 0x80004027 : return QStringLiteral("CO_E_CLASS_DISABLED"); case 0x80004028 : return QStringLiteral("CO_E_CLRNOTAVAILABLE"); case 0x80004029 : return QStringLiteral("CO_E_ASYNC_WORK_REJECTED"); case 0x8000402A : return QStringLiteral("CO_E_SERVER_INIT_TIMEOUT"); case 0x8000402B : return QStringLiteral("CO_E_NO_SECCTX_IN_ACTIVATE"); case 0x80004030 : return QStringLiteral("CO_E_TRACKER_CONFIG"); case 0x80004031 : return QStringLiteral("CO_E_THREADPOOL_CONFIG"); case 0x80004032 : return QStringLiteral("CO_E_SXS_CONFIG"); case 0x80004033 : return QStringLiteral("CO_E_MALFORMED_SPN"); case 0x80040000 : return QStringLiteral("OLE_E_OLEVERB"); case 0x80040001 : return QStringLiteral("OLE_E_ADVF"); case 0x80040002 : return QStringLiteral("OLE_E_ENUM_NOMORE"); case 0x80040003 : return QStringLiteral("OLE_E_ADVISENOTSUPPORTED"); case 0x80040004 : return QStringLiteral("OLE_E_NOCONNECTION"); case 0x80040005 : return QStringLiteral("OLE_E_NOTRUNNING"); case 0x80040006 : return QStringLiteral("OLE_E_NOCACHE"); case 0x80040007 : return QStringLiteral("OLE_E_BLANK"); case 0x80040008 : return QStringLiteral("OLE_E_CLASSDIFF"); case 0x80040009 : return QStringLiteral("OLE_E_CANT_GETMONIKER"); case 0x8004000A : return QStringLiteral("OLE_E_CANT_BINDTOSOURCE"); case 0x8004000B : return QStringLiteral("OLE_E_STATIC"); case 0x8004000C : return QStringLiteral("OLE_E_PROMPTSAVECANCELLED"); case 0x8004000D : return QStringLiteral("OLE_E_INVALIDRECT"); case 0x8004000E : return QStringLiteral("OLE_E_WRONGCOMPOBJ"); case 0x8004000F : return QStringLiteral("OLE_E_INVALIDHWND"); case 0x80040010 : return QStringLiteral("OLE_E_NOT_INPLACEACTIVE"); case 0x80040011 : return QStringLiteral("OLE_E_CANTCONVERT"); case 0x80040012 : return QStringLiteral("OLE_E_NOSTORAGE"); case 0x80040064 : return QStringLiteral("DV_E_FORMATETC"); case 0x80040065 : return QStringLiteral("DV_E_DVTARGETDEVICE"); case 0x80040066 : return QStringLiteral("DV_E_STGMEDIUM"); case 0x80040067 : return QStringLiteral("DV_E_STATDATA"); case 0x80040068 : return QStringLiteral("DV_E_LINDEX"); case 0x80040069 : return QStringLiteral("DV_E_TYMED"); case 0x8004006A : return QStringLiteral("DV_E_CLIPFORMAT"); case 0x8004006B : return QStringLiteral("DV_E_DVASPECT"); case 0x8004006C : return QStringLiteral("DV_E_DVTARGETDEVICE_SIZE"); case 0x8004006D : return QStringLiteral("DV_E_NOIVIEWOBJECT"); case 0x80040100 : return QStringLiteral("DRAGDROP_E_NOTREGISTERED"); case 0x80040101 : return QStringLiteral("DRAGDROP_E_ALREADYREGISTERED"); case 0x80040102 : return QStringLiteral("DRAGDROP_E_INVALIDHWND"); case 0x80040110 : return QStringLiteral("CLASS_E_NOAGGREGATION"); case 0x80040111 : return QStringLiteral("CLASS_E_CLASSNOTAVAILABLE"); case 0x80040112 : return QStringLiteral("CLASS_E_NOTLICENSED"); case 0x80040140 : return QStringLiteral("VIEW_E_DRAW"); case 0x80040150 : return QStringLiteral("REGDB_E_READREGDB"); case 0x80040151 : return QStringLiteral("REGDB_E_WRITEREGDB"); case 0x80040152 : return QStringLiteral("REGDB_E_KEYMISSING"); case 0x80040153 : return QStringLiteral("REGDB_E_INVALIDVALUE"); case 0x80040154 : return QStringLiteral("REGDB_E_CLASSNOTREG"); case 0x80040155 : return QStringLiteral("REGDB_E_IIDNOTREG"); case 0x80040156 : return QStringLiteral("REGDB_E_BADTHREADINGMODEL"); case 0x80040160 : return QStringLiteral("CAT_E_CATIDNOEXIST"); case 0x80040161 : return QStringLiteral("CAT_E_NODESCRIPTION"); case 0x80040164 : return QStringLiteral("CS_E_PACKAGE_NOTFOUND"); case 0x80040165 : return QStringLiteral("CS_E_NOT_DELETABLE"); case 0x80040166 : return QStringLiteral("CS_E_CLASS_NOTFOUND"); case 0x80040167 : return QStringLiteral("CS_E_INVALID_VERSION"); case 0x80040168 : return QStringLiteral("CS_E_NO_CLASSSTORE"); case 0x80040169 : return QStringLiteral("CS_E_OBJECT_NOTFOUND"); case 0x8004016A : return QStringLiteral("CS_E_OBJECT_ALREADY_EXISTS"); case 0x8004016B : return QStringLiteral("CS_E_INVALID_PATH"); case 0x8004016C : return QStringLiteral("CS_E_NETWORK_ERROR"); case 0x8004016D : return QStringLiteral("CS_E_ADMIN_LIMIT_EXCEEDED"); case 0x8004016E : return QStringLiteral("CS_E_SCHEMA_MISMATCH"); case 0x8004016F : return QStringLiteral("CS_E_INTERNAL_ERROR"); case 0x80040170 : return QStringLiteral("CACHE_E_NOCACHE_UPDATED"); case 0x80040180 : return QStringLiteral("OLEOBJ_E_NOVERBS"); case 0x80040181 : return QStringLiteral("OLEOBJ_E_INVALIDVERB"); case 0x800401A0 : return QStringLiteral("INPLACE_E_NOTUNDOABLE"); case 0x800401A1 : return QStringLiteral("INPLACE_E_NOTOOLSPACE"); case 0x800401C0 : return QStringLiteral("CONVERT10_E_OLESTREAM_GET"); case 0x800401C1 : return QStringLiteral("CONVERT10_E_OLESTREAM_PUT"); case 0x800401C2 : return QStringLiteral("CONVERT10_E_OLESTREAM_FMT"); case 0x800401C3 : return QStringLiteral("CONVERT10_E_OLESTREAM_BITMAP_TO_DIB"); case 0x800401C4 : return QStringLiteral("CONVERT10_E_STG_FMT"); case 0x800401C5 : return QStringLiteral("CONVERT10_E_STG_NO_STD_STREAM"); case 0x800401C6 : return QStringLiteral("CONVERT10_E_STG_DIB_TO_BITMAP"); case 0x800401D0 : return QStringLiteral("CLIPBRD_E_CANT_OPEN"); case 0x800401D1 : return QStringLiteral("CLIPBRD_E_CANT_EMPTY"); case 0x800401D2 : return QStringLiteral("CLIPBRD_E_CANT_SET"); case 0x800401D3 : return QStringLiteral("CLIPBRD_E_BAD_DATA"); case 0x800401D4 : return QStringLiteral("CLIPBRD_E_CANT_CLOSE"); case 0x800401E0 : return QStringLiteral("MK_E_CONNECTMANUALLY"); case 0x800401E1 : return QStringLiteral("MK_E_EXCEEDEDDEADLINE"); case 0x800401E2 : return QStringLiteral("MK_E_NEEDGENERIC"); case 0x800401E3 : return QStringLiteral("MK_E_UNAVAILABLE"); case 0x800401E4 : return QStringLiteral("MK_E_SYNTAX"); case 0x800401E5 : return QStringLiteral("MK_E_NOOBJECT"); case 0x800401E6 : return QStringLiteral("MK_E_INVALIDEXTENSION"); case 0x800401E7 : return QStringLiteral("MK_E_INTERMEDIATEINTERFACENOTSUPPORTED"); case 0x800401E8 : return QStringLiteral("MK_E_NOTBINDABLE"); case 0x800401E9 : return QStringLiteral("MK_E_NOTBOUND"); case 0x800401EA : return QStringLiteral("MK_E_CANTOPENFILE"); case 0x800401EB : return QStringLiteral("MK_E_MUSTBOTHERUSER"); case 0x800401EC : return QStringLiteral("MK_E_NOINVERSE"); case 0x800401ED : return QStringLiteral("MK_E_NOSTORAGE"); case 0x800401EE : return QStringLiteral("MK_E_NOPREFIX"); case 0x800401EF : return QStringLiteral("MK_E_ENUMERATION_FAILED"); case 0x800401F0 : return QStringLiteral("CO_E_NOTINITIALIZED"); case 0x800401F1 : return QStringLiteral("CO_E_ALREADYINITIALIZED"); case 0x800401F2 : return QStringLiteral("CO_E_CANTDETERMINECLASS"); case 0x800401F3 : return QStringLiteral("CO_E_CLASSSTRING"); case 0x800401F4 : return QStringLiteral("CO_E_IIDSTRING"); case 0x800401F5 : return QStringLiteral("CO_E_APPNOTFOUND"); case 0x800401F6 : return QStringLiteral("CO_E_APPSINGLEUSE"); case 0x800401F7 : return QStringLiteral("CO_E_ERRORINAPP"); case 0x800401F8 : return QStringLiteral("CO_E_DLLNOTFOUND"); case 0x800401F9 : return QStringLiteral("CO_E_ERRORINDLL"); case 0x800401FA : return QStringLiteral("CO_E_WRONGOSFORAPP"); case 0x800401FB : return QStringLiteral("CO_E_OBJNOTREG"); case 0x800401FC : return QStringLiteral("CO_E_OBJISREG"); case 0x800401FD : return QStringLiteral("CO_E_OBJNOTCONNECTED"); case 0x800401FE : return QStringLiteral("CO_E_APPDIDNTREG"); case 0x800401FF : return QStringLiteral("CO_E_RELEASED"); case 0x00040200 : return QStringLiteral("EVENT_S_SOME_SUBSCRIBERS_FAILED"); case 0x80040201 : return QStringLiteral("EVENT_E_ALL_SUBSCRIBERS_FAILED"); case 0x00040202 : return QStringLiteral("EVENT_S_NOSUBSCRIBERS"); case 0x80040203 : return QStringLiteral("EVENT_E_QUERYSYNTAX"); case 0x80040204 : return QStringLiteral("EVENT_E_QUERYFIELD"); case 0x80040205 : return QStringLiteral("EVENT_E_INTERNALEXCEPTION"); case 0x80040206 : return QStringLiteral("EVENT_E_INTERNALERROR"); case 0x80040207 : return QStringLiteral("EVENT_E_INVALID_PER_USER_SID"); case 0x80040208 : return QStringLiteral("EVENT_E_USER_EXCEPTION"); case 0x80040209 : return QStringLiteral("EVENT_E_TOO_MANY_METHODS"); case 0x8004020A : return QStringLiteral("EVENT_E_MISSING_EVENTCLASS"); case 0x8004020B : return QStringLiteral("EVENT_E_NOT_ALL_REMOVED"); case 0x8004020C : return QStringLiteral("EVENT_E_COMPLUS_NOT_INSTALLED"); case 0x8004020D : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT"); case 0x8004020E : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT"); case 0x8004020F : return QStringLiteral("EVENT_E_INVALID_EVENT_CLASS_PARTITION"); case 0x80040210 : return QStringLiteral("EVENT_E_PER_USER_SID_NOT_LOGGED_ON"); case 0x8004D000 : return QStringLiteral("XACT_E_ALREADYOTHERSINGLEPHASE"); case 0x8004D001 : return QStringLiteral("XACT_E_CANTRETAIN"); case 0x8004D002 : return QStringLiteral("XACT_E_COMMITFAILED"); case 0x8004D003 : return QStringLiteral("XACT_E_COMMITPREVENTED"); case 0x8004D004 : return QStringLiteral("XACT_E_HEURISTICABORT"); case 0x8004D005 : return QStringLiteral("XACT_E_HEURISTICCOMMIT"); case 0x8004D006 : return QStringLiteral("XACT_E_HEURISTICDAMAGE"); case 0x8004D007 : return QStringLiteral("XACT_E_HEURISTICDANGER"); case 0x8004D008 : return QStringLiteral("XACT_E_ISOLATIONLEVEL"); case 0x8004D009 : return QStringLiteral("XACT_E_NOASYNC"); case 0x8004D00A : return QStringLiteral("XACT_E_NOENLIST"); case 0x8004D00B : return QStringLiteral("XACT_E_NOISORETAIN"); case 0x8004D00C : return QStringLiteral("XACT_E_NORESOURCE"); case 0x8004D00D : return QStringLiteral("XACT_E_NOTCURRENT"); case 0x8004D00E : return QStringLiteral("XACT_E_NOTRANSACTION"); case 0x8004D00F : return QStringLiteral("XACT_E_NOTSUPPORTED"); case 0x8004D010 : return QStringLiteral("XACT_E_UNKNOWNRMGRID"); case 0x8004D011 : return QStringLiteral("XACT_E_WRONGSTATE"); case 0x8004D012 : return QStringLiteral("XACT_E_WRONGUOW"); case 0x8004D013 : return QStringLiteral("XACT_E_XTIONEXISTS"); case 0x8004D014 : return QStringLiteral("XACT_E_NOIMPORTOBJECT"); case 0x8004D015 : return QStringLiteral("XACT_E_INVALIDCOOKIE"); case 0x8004D016 : return QStringLiteral("XACT_E_INDOUBT"); case 0x8004D017 : return QStringLiteral("XACT_E_NOTIMEOUT"); case 0x8004D018 : return QStringLiteral("XACT_E_ALREADYINPROGRESS"); case 0x8004D019 : return QStringLiteral("XACT_E_ABORTED"); case 0x8004D01A : return QStringLiteral("XACT_E_LOGFULL"); case 0x8004D01B : return QStringLiteral("XACT_E_TMNOTAVAILABLE"); case 0x8004D01C : return QStringLiteral("XACT_E_CONNECTION_DOWN"); case 0x8004D01D : return QStringLiteral("XACT_E_CONNECTION_DENIED"); case 0x8004D01E : return QStringLiteral("XACT_E_REENLISTTIMEOUT"); case 0x8004D01F : return QStringLiteral("XACT_E_TIP_CONNECT_FAILED"); case 0x8004D020 : return QStringLiteral("XACT_E_TIP_PROTOCOL_ERROR"); case 0x8004D021 : return QStringLiteral("XACT_E_TIP_PULL_FAILED"); case 0x8004D022 : return QStringLiteral("XACT_E_DEST_TMNOTAVAILABLE"); case 0x8004D023 : return QStringLiteral("XACT_E_TIP_DISABLED"); case 0x8004D024 : return QStringLiteral("XACT_E_NETWORK_TX_DISABLED"); case 0x8004D025 : return QStringLiteral("XACT_E_PARTNER_NETWORK_TX_DISABLED"); case 0x8004D026 : return QStringLiteral("XACT_E_XA_TX_DISABLED"); case 0x8004D027 : return QStringLiteral("XACT_E_UNABLE_TO_READ_DTC_CONFIG"); case 0x8004D028 : return QStringLiteral("XACT_E_UNABLE_TO_LOAD_DTC_PROXY"); case 0x8004D029 : return QStringLiteral("XACT_E_ABORTING"); case 0x8004D080 : return QStringLiteral("XACT_E_CLERKNOTFOUND"); case 0x8004D081 : return QStringLiteral("XACT_E_CLERKEXISTS"); case 0x8004D082 : return QStringLiteral("XACT_E_RECOVERYINPROGRESS"); case 0x8004D083 : return QStringLiteral("XACT_E_TRANSACTIONCLOSED"); case 0x8004D084 : return QStringLiteral("XACT_E_INVALIDLSN"); case 0x8004D085 : return QStringLiteral("XACT_E_REPLAYREQUEST"); case 0x0004D000 : return QStringLiteral("XACT_S_ASYNC"); case 0x0004D001 : return QStringLiteral("XACT_S_DEFECT"); case 0x0004D002 : return QStringLiteral("XACT_S_READONLY"); case 0x0004D003 : return QStringLiteral("XACT_S_SOMENORETAIN"); case 0x0004D004 : return QStringLiteral("XACT_S_OKINFORM"); case 0x0004D005 : return QStringLiteral("XACT_S_MADECHANGESCONTENT"); case 0x0004D006 : return QStringLiteral("XACT_S_MADECHANGESINFORM"); case 0x0004D007 : return QStringLiteral("XACT_S_ALLNORETAIN"); case 0x0004D008 : return QStringLiteral("XACT_S_ABORTING"); case 0x0004D009 : return QStringLiteral("XACT_S_SINGLEPHASE"); case 0x0004D00A : return QStringLiteral("XACT_S_LOCALLY_OK"); case 0x0004D010 : return QStringLiteral("XACT_S_LASTRESOURCEMANAGER"); case 0x8004E002 : return QStringLiteral("CONTEXT_E_ABORTED"); case 0x8004E003 : return QStringLiteral("CONTEXT_E_ABORTING"); case 0x8004E004 : return QStringLiteral("CONTEXT_E_NOCONTEXT"); case 0x8004E005 : return QStringLiteral("CONTEXT_E_WOULD_DEADLOCK"); case 0x8004E006 : return QStringLiteral("CONTEXT_E_SYNCH_TIMEOUT"); case 0x8004E007 : return QStringLiteral("CONTEXT_E_OLDREF"); case 0x8004E00C : return QStringLiteral("CONTEXT_E_ROLENOTFOUND"); case 0x8004E00F : return QStringLiteral("CONTEXT_E_TMNOTAVAILABLE"); case 0x8004E021 : return QStringLiteral("CO_E_ACTIVATIONFAILED"); case 0x8004E022 : return QStringLiteral("CO_E_ACTIVATIONFAILED_EVENTLOGGED"); case 0x8004E023 : return QStringLiteral("CO_E_ACTIVATIONFAILED_CATALOGERROR"); case 0x8004E024 : return QStringLiteral("CO_E_ACTIVATIONFAILED_TIMEOUT"); case 0x8004E025 : return QStringLiteral("CO_E_INITIALIZATIONFAILED"); case 0x8004E026 : return QStringLiteral("CONTEXT_E_NOJIT"); case 0x8004E027 : return QStringLiteral("CONTEXT_E_NOTRANSACTION"); case 0x8004E028 : return QStringLiteral("CO_E_THREADINGMODEL_CHANGED"); case 0x8004E029 : return QStringLiteral("CO_E_NOIISINTRINSICS"); case 0x8004E02A : return QStringLiteral("CO_E_NOCOOKIES"); case 0x8004E02B : return QStringLiteral("CO_E_DBERROR"); case 0x8004E02C : return QStringLiteral("CO_E_NOTPOOLED"); case 0x8004E02D : return QStringLiteral("CO_E_NOTCONSTRUCTED"); case 0x8004E02E : return QStringLiteral("CO_E_NOSYNCHRONIZATION"); case 0x8004E02F : return QStringLiteral("CO_E_ISOLEVELMISMATCH"); case 0x00040000 : return QStringLiteral("OLE_S_USEREG"); case 0x00040001 : return QStringLiteral("OLE_S_STATIC"); case 0x00040002 : return QStringLiteral("OLE_S_MAC_CLIPFORMAT"); case 0x00040100 : return QStringLiteral("DRAGDROP_S_DROP"); case 0x00040101 : return QStringLiteral("DRAGDROP_S_CANCEL"); case 0x00040102 : return QStringLiteral("DRAGDROP_S_USEDEFAULTCURSORS"); case 0x00040130 : return QStringLiteral("DATA_S_SAMEFORMATETC"); case 0x00040140 : return QStringLiteral("VIEW_S_ALREADY_FROZEN"); case 0x00040170 : return QStringLiteral("CACHE_S_FORMATETC_NOTSUPPORTED"); case 0x00040171 : return QStringLiteral("CACHE_S_SAMECACHE"); case 0x00040172 : return QStringLiteral("CACHE_S_SOMECACHES_NOTUPDATED"); case 0x00040180 : return QStringLiteral("OLEOBJ_S_INVALIDVERB"); case 0x00040181 : return QStringLiteral("OLEOBJ_S_CANNOT_DOVERB_NOW"); case 0x00040182 : return QStringLiteral("OLEOBJ_S_INVALIDHWND"); case 0x000401A0 : return QStringLiteral("INPLACE_S_TRUNCATED"); case 0x000401C0 : return QStringLiteral("CONVERT10_S_NO_PRESENTATION"); case 0x000401E2 : return QStringLiteral("MK_S_REDUCED_TO_SELF"); case 0x000401E4 : return QStringLiteral("MK_S_ME"); case 0x000401E5 : return QStringLiteral("MK_S_HIM"); case 0x000401E6 : return QStringLiteral("MK_S_US"); case 0x000401E7 : return QStringLiteral("MK_S_MONIKERALREADYREGISTERED"); case 0x00041300 : return QStringLiteral("SCHED_S_TASK_READY"); case 0x00041301 : return QStringLiteral("SCHED_S_TASK_RUNNING"); case 0x00041302 : return QStringLiteral("SCHED_S_TASK_DISABLED"); case 0x00041303 : return QStringLiteral("SCHED_S_TASK_HAS_NOT_RUN"); case 0x00041304 : return QStringLiteral("SCHED_S_TASK_NO_MORE_RUNS"); case 0x00041305 : return QStringLiteral("SCHED_S_TASK_NOT_SCHEDULED"); case 0x00041306 : return QStringLiteral("SCHED_S_TASK_TERMINATED"); case 0x00041307 : return QStringLiteral("SCHED_S_TASK_NO_VALID_TRIGGERS"); case 0x00041308 : return QStringLiteral("SCHED_S_EVENT_TRIGGER"); case 0x80041309 : return QStringLiteral("SCHED_E_TRIGGER_NOT_FOUND"); case 0x8004130A : return QStringLiteral("SCHED_E_TASK_NOT_READY"); case 0x8004130B : return QStringLiteral("SCHED_E_TASK_NOT_RUNNING"); case 0x8004130C : return QStringLiteral("SCHED_E_SERVICE_NOT_INSTALLED"); case 0x8004130D : return QStringLiteral("SCHED_E_CANNOT_OPEN_TASK"); case 0x8004130E : return QStringLiteral("SCHED_E_INVALID_TASK"); case 0x8004130F : return QStringLiteral("SCHED_E_ACCOUNT_INFORMATION_NOT_SET"); case 0x80041310 : return QStringLiteral("SCHED_E_ACCOUNT_NAME_NOT_FOUND"); case 0x80041311 : return QStringLiteral("SCHED_E_ACCOUNT_DBASE_CORRUPT"); case 0x80041312 : return QStringLiteral("SCHED_E_NO_SECURITY_SERVICES"); case 0x80041313 : return QStringLiteral("SCHED_E_UNKNOWN_OBJECT_VERSION"); case 0x80041314 : return QStringLiteral("SCHED_E_UNSUPPORTED_ACCOUNT_OPTION"); case 0x80041315 : return QStringLiteral("SCHED_E_SERVICE_NOT_RUNNING"); case 0x80080001 : return QStringLiteral("CO_E_CLASS_CREATE_FAILED"); case 0x80080002 : return QStringLiteral("CO_E_SCM_ERROR"); case 0x80080003 : return QStringLiteral("CO_E_SCM_RPC_FAILURE"); case 0x80080004 : return QStringLiteral("CO_E_BAD_PATH"); case 0x80080005 : return QStringLiteral("CO_E_SERVER_EXEC_FAILURE"); case 0x80080006 : return QStringLiteral("CO_E_OBJSRV_RPC_FAILURE"); case 0x80080007 : return QStringLiteral("MK_E_NO_NORMALIZED"); case 0x80080008 : return QStringLiteral("CO_E_SERVER_STOPPING"); case 0x80080009 : return QStringLiteral("MEM_E_INVALID_ROOT"); case 0x80080010 : return QStringLiteral("MEM_E_INVALID_LINK"); case 0x80080011 : return QStringLiteral("MEM_E_INVALID_SIZE"); case 0x00080012 : return QStringLiteral("CO_S_NOTALLINTERFACES"); case 0x00080013 : return QStringLiteral("CO_S_MACHINENAMENOTFOUND"); case 0x80020001 : return QStringLiteral("DISP_E_UNKNOWNINTERFACE"); case 0x80020003 : return QStringLiteral("DISP_E_MEMBERNOTFOUND"); case 0x80020004 : return QStringLiteral("DISP_E_PARAMNOTFOUND"); case 0x80020005 : return QStringLiteral("DISP_E_TYPEMISMATCH"); case 0x80020006 : return QStringLiteral("DISP_E_UNKNOWNNAME"); case 0x80020007 : return QStringLiteral("DISP_E_NONAMEDARGS"); case 0x80020008 : return QStringLiteral("DISP_E_BADVARTYPE"); case 0x80020009 : return QStringLiteral("DISP_E_EXCEPTION"); case 0x8002000A : return QStringLiteral("DISP_E_OVERFLOW"); case 0x8002000B : return QStringLiteral("DISP_E_BADINDEX"); case 0x8002000C : return QStringLiteral("DISP_E_UNKNOWNLCID"); case 0x8002000D : return QStringLiteral("DISP_E_ARRAYISLOCKED"); case 0x8002000E : return QStringLiteral("DISP_E_BADPARAMCOUNT"); case 0x8002000F : return QStringLiteral("DISP_E_PARAMNOTOPTIONAL"); case 0x80020010 : return QStringLiteral("DISP_E_BADCALLEE"); case 0x80020011 : return QStringLiteral("DISP_E_NOTACOLLECTION"); case 0x80020012 : return QStringLiteral("DISP_E_DIVBYZERO"); case 0x80020013 : return QStringLiteral("DISP_E_BUFFERTOOSMALL"); case 0x80028016 : return QStringLiteral("TYPE_E_BUFFERTOOSMALL"); case 0x80028017 : return QStringLiteral("TYPE_E_FIELDNOTFOUND"); case 0x80028018 : return QStringLiteral("TYPE_E_INVDATAREAD"); case 0x80028019 : return QStringLiteral("TYPE_E_UNSUPFORMAT"); case 0x8002801C : return QStringLiteral("TYPE_E_REGISTRYACCESS"); case 0x8002801D : return QStringLiteral("TYPE_E_LIBNOTREGISTERED"); case 0x80028027 : return QStringLiteral("TYPE_E_UNDEFINEDTYPE"); case 0x80028028 : return QStringLiteral("TYPE_E_QUALIFIEDNAMEDISALLOWED"); case 0x80028029 : return QStringLiteral("TYPE_E_INVALIDSTATE"); case 0x8002802A : return QStringLiteral("TYPE_E_WRONGTYPEKIND"); case 0x8002802B : return QStringLiteral("TYPE_E_ELEMENTNOTFOUND"); case 0x8002802C : return QStringLiteral("TYPE_E_AMBIGUOUSNAME"); case 0x8002802D : return QStringLiteral("TYPE_E_NAMECONFLICT"); case 0x8002802E : return QStringLiteral("TYPE_E_UNKNOWNLCID"); case 0x8002802F : return QStringLiteral("TYPE_E_DLLFUNCTIONNOTFOUND"); case 0x800288BD : return QStringLiteral("TYPE_E_BADMODULEKIND"); case 0x800288C5 : return QStringLiteral("TYPE_E_SIZETOOBIG"); case 0x800288C6 : return QStringLiteral("TYPE_E_DUPLICATEID"); case 0x800288CF : return QStringLiteral("TYPE_E_INVALIDID"); case 0x80028CA0 : return QStringLiteral("TYPE_E_TYPEMISMATCH"); case 0x80028CA1 : return QStringLiteral("TYPE_E_OUTOFBOUNDS"); case 0x80028CA2 : return QStringLiteral("TYPE_E_IOERROR"); case 0x80028CA3 : return QStringLiteral("TYPE_E_CANTCREATETMPFILE"); case 0x80029C4A : return QStringLiteral("TYPE_E_CANTLOADLIBRARY"); case 0x80029C83 : return QStringLiteral("TYPE_E_INCONSISTENTPROPFUNCS"); case 0x80029C84 : return QStringLiteral("TYPE_E_CIRCULARTYPE"); case 0x80030001 : return QStringLiteral("STG_E_INVALIDFUNCTION"); case 0x80030002 : return QStringLiteral("STG_E_FILENOTFOUND"); case 0x80030003 : return QStringLiteral("STG_E_PATHNOTFOUND"); case 0x80030004 : return QStringLiteral("STG_E_TOOMANYOPENFILES"); case 0x80030005 : return QStringLiteral("STG_E_ACCESSDENIED"); case 0x80030006 : return QStringLiteral("STG_E_INVALIDHANDLE"); case 0x80030008 : return QStringLiteral("STG_E_INSUFFICIENTMEMORY"); case 0x80030009 : return QStringLiteral("STG_E_INVALIDPOINTER"); case 0x80030012 : return QStringLiteral("STG_E_NOMOREFILES"); case 0x80030013 : return QStringLiteral("STG_E_DISKISWRITEPROTECTED"); case 0x80030019 : return QStringLiteral("STG_E_SEEKERROR"); case 0x8003001D : return QStringLiteral("STG_E_WRITEFAULT"); case 0x8003001E : return QStringLiteral("STG_E_READFAULT"); case 0x80030020 : return QStringLiteral("STG_E_SHAREVIOLATION"); case 0x80030021 : return QStringLiteral("STG_E_LOCKVIOLATION"); case 0x80030050 : return QStringLiteral("STG_E_FILEALREADYEXISTS"); case 0x80030057 : return QStringLiteral("STG_E_INVALIDPARAMETER"); case 0x80030070 : return QStringLiteral("STG_E_MEDIUMFULL"); case 0x800300F0 : return QStringLiteral("STG_E_PROPSETMISMATCHED"); case 0x800300FA : return QStringLiteral("STG_E_ABNORMALAPIEXIT"); case 0x800300FB : return QStringLiteral("STG_E_INVALIDHEADER"); case 0x800300FC : return QStringLiteral("STG_E_INVALIDNAME"); case 0x800300FD : return QStringLiteral("STG_E_UNKNOWN"); case 0x800300FE : return QStringLiteral("STG_E_UNIMPLEMENTEDFUNCTION"); case 0x800300FF : return QStringLiteral("STG_E_INVALIDFLAG"); case 0x80030100 : return QStringLiteral("STG_E_INUSE"); case 0x80030101 : return QStringLiteral("STG_E_NOTCURRENT"); case 0x80030102 : return QStringLiteral("STG_E_REVERTED"); case 0x80030103 : return QStringLiteral("STG_E_CANTSAVE"); case 0x80030104 : return QStringLiteral("STG_E_OLDFORMAT"); case 0x80030105 : return QStringLiteral("STG_E_OLDDLL"); case 0x80030106 : return QStringLiteral("STG_E_SHAREREQUIRED"); case 0x80030107 : return QStringLiteral("STG_E_NOTFILEBASEDSTORAGE"); case 0x80030108 : return QStringLiteral("STG_E_EXTANTMARSHALLINGS"); case 0x80030109 : return QStringLiteral("STG_E_DOCFILECORRUPT"); case 0x80030110 : return QStringLiteral("STG_E_BADBASEADDRESS"); case 0x80030111 : return QStringLiteral("STG_E_DOCFILETOOLARGE"); case 0x80030112 : return QStringLiteral("STG_E_NOTSIMPLEFORMAT"); case 0x80030201 : return QStringLiteral("STG_E_INCOMPLETE"); case 0x80030202 : return QStringLiteral("STG_E_TERMINATED"); case 0x00030200 : return QStringLiteral("STG_S_CONVERTED"); case 0x00030201 : return QStringLiteral("STG_S_BLOCK"); case 0x00030202 : return QStringLiteral("STG_S_RETRYNOW"); case 0x00030203 : return QStringLiteral("STG_S_MONITORING"); case 0x00030204 : return QStringLiteral("STG_S_MULTIPLEOPENS"); case 0x00030205 : return QStringLiteral("STG_S_CONSOLIDATIONFAILED"); case 0x00030206 : return QStringLiteral("STG_S_CANNOTCONSOLIDATE"); case 0x80030305 : return QStringLiteral("STG_E_STATUS_COPY_PROTECTION_FAILURE"); case 0x80030306 : return QStringLiteral("STG_E_CSS_AUTHENTICATION_FAILURE"); case 0x80030307 : return QStringLiteral("STG_E_CSS_KEY_NOT_PRESENT"); case 0x80030308 : return QStringLiteral("STG_E_CSS_KEY_NOT_ESTABLISHED"); case 0x80030309 : return QStringLiteral("STG_E_CSS_SCRAMBLED_SECTOR"); case 0x8003030A : return QStringLiteral("STG_E_CSS_REGION_MISMATCH"); case 0x8003030B : return QStringLiteral("STG_E_RESETS_EXHAUSTED"); case 0x80010001 : return QStringLiteral("RPC_E_CALL_REJECTED"); case 0x80010002 : return QStringLiteral("RPC_E_CALL_CANCELED"); case 0x80010003 : return QStringLiteral("RPC_E_CANTPOST_INSENDCALL"); case 0x80010004 : return QStringLiteral("RPC_E_CANTCALLOUT_INASYNCCALL"); case 0x80010005 : return QStringLiteral("RPC_E_CANTCALLOUT_INEXTERNALCALL"); case 0x80010006 : return QStringLiteral("RPC_E_CONNECTION_TERMINATED"); case 0x80010007 : return QStringLiteral("RPC_E_SERVER_DIED"); case 0x80010008 : return QStringLiteral("RPC_E_CLIENT_DIED"); case 0x80010009 : return QStringLiteral("RPC_E_INVALID_DATAPACKET"); case 0x8001000A : return QStringLiteral("RPC_E_CANTTRANSMIT_CALL"); case 0x8001000B : return QStringLiteral("RPC_E_CLIENT_CANTMARSHAL_DATA"); case 0x8001000C : return QStringLiteral("RPC_E_CLIENT_CANTUNMARSHAL_DATA"); case 0x8001000D : return QStringLiteral("RPC_E_SERVER_CANTMARSHAL_DATA"); case 0x8001000E : return QStringLiteral("RPC_E_SERVER_CANTUNMARSHAL_DATA"); case 0x8001000F : return QStringLiteral("RPC_E_INVALID_DATA"); case 0x80010010 : return QStringLiteral("RPC_E_INVALID_PARAMETER"); case 0x80010011 : return QStringLiteral("RPC_E_CANTCALLOUT_AGAIN"); case 0x80010012 : return QStringLiteral("RPC_E_SERVER_DIED_DNE"); case 0x80010100 : return QStringLiteral("RPC_E_SYS_CALL_FAILED"); case 0x80010101 : return QStringLiteral("RPC_E_OUT_OF_RESOURCES"); case 0x80010102 : return QStringLiteral("RPC_E_ATTEMPTED_MULTITHREAD"); case 0x80010103 : return QStringLiteral("RPC_E_NOT_REGISTERED"); case 0x80010104 : return QStringLiteral("RPC_E_FAULT"); case 0x80010105 : return QStringLiteral("RPC_E_SERVERFAULT"); case 0x80010106 : return QStringLiteral("RPC_E_CHANGED_MODE"); case 0x80010107 : return QStringLiteral("RPC_E_INVALIDMETHOD"); case 0x80010108 : return QStringLiteral("RPC_E_DISCONNECTED"); case 0x80010109 : return QStringLiteral("RPC_E_RETRY"); case 0x8001010A : return QStringLiteral("RPC_E_SERVERCALL_RETRYLATER"); case 0x8001010B : return QStringLiteral("RPC_E_SERVERCALL_REJECTED"); case 0x8001010C : return QStringLiteral("RPC_E_INVALID_CALLDATA"); case 0x8001010D : return QStringLiteral("RPC_E_CANTCALLOUT_ININPUTSYNCCALL"); case 0x8001010E : return QStringLiteral("RPC_E_WRONG_THREAD"); case 0x8001010F : return QStringLiteral("RPC_E_THREAD_NOT_INIT"); case 0x80010110 : return QStringLiteral("RPC_E_VERSION_MISMATCH"); case 0x80010111 : return QStringLiteral("RPC_E_INVALID_HEADER"); case 0x80010112 : return QStringLiteral("RPC_E_INVALID_EXTENSION"); case 0x80010113 : return QStringLiteral("RPC_E_INVALID_IPID"); case 0x80010114 : return QStringLiteral("RPC_E_INVALID_OBJECT"); case 0x80010115 : return QStringLiteral("RPC_S_CALLPENDING"); case 0x80010116 : return QStringLiteral("RPC_S_WAITONTIMER"); case 0x80010117 : return QStringLiteral("RPC_E_CALL_COMPLETE"); case 0x80010118 : return QStringLiteral("RPC_E_UNSECURE_CALL"); case 0x80010119 : return QStringLiteral("RPC_E_TOO_LATE"); case 0x8001011A : return QStringLiteral("RPC_E_NO_GOOD_SECURITY_PACKAGES"); case 0x8001011B : return QStringLiteral("RPC_E_ACCESS_DENIED"); case 0x8001011C : return QStringLiteral("RPC_E_REMOTE_DISABLED"); case 0x8001011D : return QStringLiteral("RPC_E_INVALID_OBJREF"); case 0x8001011E : return QStringLiteral("RPC_E_NO_CONTEXT"); case 0x8001011F : return QStringLiteral("RPC_E_TIMEOUT"); case 0x80010120 : return QStringLiteral("RPC_E_NO_SYNC"); case 0x80010121 : return QStringLiteral("RPC_E_FULLSIC_REQUIRED"); case 0x80010122 : return QStringLiteral("RPC_E_INVALID_STD_NAME"); case 0x80010123 : return QStringLiteral("CO_E_FAILEDTOIMPERSONATE"); case 0x80010124 : return QStringLiteral("CO_E_FAILEDTOGETSECCTX"); case 0x80010125 : return QStringLiteral("CO_E_FAILEDTOOPENTHREADTOKEN"); case 0x80010126 : return QStringLiteral("CO_E_FAILEDTOGETTOKENINFO"); case 0x80010127 : return QStringLiteral("CO_E_TRUSTEEDOESNTMATCHCLIENT"); case 0x80010128 : return QStringLiteral("CO_E_FAILEDTOQUERYCLIENTBLANKET"); case 0x80010129 : return QStringLiteral("CO_E_FAILEDTOSETDACL"); case 0x8001012A : return QStringLiteral("CO_E_ACCESSCHECKFAILED"); case 0x8001012B : return QStringLiteral("CO_E_NETACCESSAPIFAILED"); case 0x8001012C : return QStringLiteral("CO_E_WRONGTRUSTEENAMESYNTAX"); case 0x8001012D : return QStringLiteral("CO_E_INVALIDSID"); case 0x8001012E : return QStringLiteral("CO_E_CONVERSIONFAILED"); case 0x8001012F : return QStringLiteral("CO_E_NOMATCHINGSIDFOUND"); case 0x80010130 : return QStringLiteral("CO_E_LOOKUPACCSIDFAILED"); case 0x80010131 : return QStringLiteral("CO_E_NOMATCHINGNAMEFOUND"); case 0x80010132 : return QStringLiteral("CO_E_LOOKUPACCNAMEFAILED"); case 0x80010133 : return QStringLiteral("CO_E_SETSERLHNDLFAILED"); case 0x80010134 : return QStringLiteral("CO_E_FAILEDTOGETWINDIR"); case 0x80010135 : return QStringLiteral("CO_E_PATHTOOLONG"); case 0x80010136 : return QStringLiteral("CO_E_FAILEDTOGENUUID"); case 0x80010137 : return QStringLiteral("CO_E_FAILEDTOCREATEFILE"); case 0x80010138 : return QStringLiteral("CO_E_FAILEDTOCLOSEHANDLE"); case 0x80010139 : return QStringLiteral("CO_E_EXCEEDSYSACLLIMIT"); case 0x8001013A : return QStringLiteral("CO_E_ACESINWRONGORDER"); case 0x8001013B : return QStringLiteral("CO_E_INCOMPATIBLESTREAMVERSION"); case 0x8001013C : return QStringLiteral("CO_E_FAILEDTOOPENPROCESSTOKEN"); case 0x8001013D : return QStringLiteral("CO_E_DECODEFAILED"); case 0x8001013F : return QStringLiteral("CO_E_ACNOTINITIALIZED"); case 0x80010140 : return QStringLiteral("CO_E_CANCEL_DISABLED"); case 0x8001FFFF : return QStringLiteral("RPC_E_UNEXPECTED"); case 0xC0090001 : return QStringLiteral("ERROR_AUDITING_DISABLED"); case 0xC0090002 : return QStringLiteral("ERROR_ALL_SIDS_FILTERED"); case 0x80090001 : return QStringLiteral("NTE_BAD_UID"); case 0x80090002 : return QStringLiteral("NTE_BAD_HASH"); case 0x80090003 : return QStringLiteral("NTE_BAD_KEY"); case 0x80090004 : return QStringLiteral("NTE_BAD_LEN"); case 0x80090005 : return QStringLiteral("NTE_BAD_DATA"); case 0x80090006 : return QStringLiteral("NTE_BAD_SIGNATURE"); case 0x80090007 : return QStringLiteral("NTE_BAD_VER"); case 0x80090008 : return QStringLiteral("NTE_BAD_ALGID"); case 0x80090009 : return QStringLiteral("NTE_BAD_FLAGS"); case 0x8009000A : return QStringLiteral("NTE_BAD_TYPE"); case 0x8009000B : return QStringLiteral("NTE_BAD_KEY_STATE"); case 0x8009000C : return QStringLiteral("NTE_BAD_HASH_STATE"); case 0x8009000D : return QStringLiteral("NTE_NO_KEY"); case 0x8009000E : return QStringLiteral("NTE_NO_MEMORY"); case 0x8009000F : return QStringLiteral("NTE_EXISTS"); case 0x80090010 : return QStringLiteral("NTE_PERM"); case 0x80090011 : return QStringLiteral("NTE_NOT_FOUND"); case 0x80090012 : return QStringLiteral("NTE_DOUBLE_ENCRYPT"); case 0x80090013 : return QStringLiteral("NTE_BAD_PROVIDER"); case 0x80090014 : return QStringLiteral("NTE_BAD_PROV_TYPE"); case 0x80090015 : return QStringLiteral("NTE_BAD_PUBLIC_KEY"); case 0x80090016 : return QStringLiteral("NTE_BAD_KEYSET"); case 0x80090017 : return QStringLiteral("NTE_PROV_TYPE_NOT_DEF"); case 0x80090018 : return QStringLiteral("NTE_PROV_TYPE_ENTRY_BAD"); case 0x80090019 : return QStringLiteral("NTE_KEYSET_NOT_DEF"); case 0x8009001A : return QStringLiteral("NTE_KEYSET_ENTRY_BAD"); case 0x8009001B : return QStringLiteral("NTE_PROV_TYPE_NO_MATCH"); case 0x8009001C : return QStringLiteral("NTE_SIGNATURE_FILE_BAD"); case 0x8009001D : return QStringLiteral("NTE_PROVIDER_DLL_FAIL"); case 0x8009001E : return QStringLiteral("NTE_PROV_DLL_NOT_FOUND"); case 0x8009001F : return QStringLiteral("NTE_BAD_KEYSET_PARAM"); case 0x80090020 : return QStringLiteral("NTE_FAIL"); case 0x80090021 : return QStringLiteral("NTE_SYS_ERR"); case 0x80090022 : return QStringLiteral("NTE_SILENT_CONTEXT"); case 0x80090023 : return QStringLiteral("NTE_TOKEN_KEYSET_STORAGE_FULL"); case 0x80090024 : return QStringLiteral("NTE_TEMPORARY_PROFILE"); case 0x80090025 : return QStringLiteral("NTE_FIXEDPARAMETER"); case 0x80090300 : return QStringLiteral("SEC_E_INSUFFICIENT_MEMORY"); case 0x80090301 : return QStringLiteral("SEC_E_INVALID_HANDLE"); case 0x80090302 : return QStringLiteral("SEC_E_UNSUPPORTED_FUNCTION"); case 0x80090303 : return QStringLiteral("SEC_E_TARGET_UNKNOWN"); case 0x80090304 : return QStringLiteral("SEC_E_INTERNAL_ERROR"); case 0x80090305 : return QStringLiteral("SEC_E_SECPKG_NOT_FOUND"); case 0x80090306 : return QStringLiteral("SEC_E_NOT_OWNER"); case 0x80090307 : return QStringLiteral("SEC_E_CANNOT_INSTALL"); case 0x80090308 : return QStringLiteral("SEC_E_INVALID_TOKEN"); case 0x80090309 : return QStringLiteral("SEC_E_CANNOT_PACK"); case 0x8009030A : return QStringLiteral("SEC_E_QOP_NOT_SUPPORTED"); case 0x8009030B : return QStringLiteral("SEC_E_NO_IMPERSONATION"); case 0x8009030C : return QStringLiteral("SEC_E_LOGON_DENIED"); case 0x8009030D : return QStringLiteral("SEC_E_UNKNOWN_CREDENTIALS"); case 0x8009030E : return QStringLiteral("SEC_E_NO_CREDENTIALS"); case 0x8009030F : return QStringLiteral("SEC_E_MESSAGE_ALTERED"); case 0x80090310 : return QStringLiteral("SEC_E_OUT_OF_SEQUENCE"); case 0x80090311 : return QStringLiteral("SEC_E_NO_AUTHENTICATING_AUTHORITY"); case 0x00090312 : return QStringLiteral("SEC_I_CONTINUE_NEEDED"); case 0x00090313 : return QStringLiteral("SEC_I_COMPLETE_NEEDED"); case 0x00090314 : return QStringLiteral("SEC_I_COMPLETE_AND_CONTINUE"); case 0x00090315 : return QStringLiteral("SEC_I_LOCAL_LOGON"); case 0x80090316 : return QStringLiteral("SEC_E_BAD_PKGID"); case 0x80090317 : return QStringLiteral("SEC_E_CONTEXT_EXPIRED"); case 0x00090317 : return QStringLiteral("SEC_I_CONTEXT_EXPIRED"); case 0x80090318 : return QStringLiteral("SEC_E_INCOMPLETE_MESSAGE"); case 0x80090320 : return QStringLiteral("SEC_E_INCOMPLETE_CREDENTIALS"); case 0x80090321 : return QStringLiteral("SEC_E_BUFFER_TOO_SMALL"); case 0x00090320 : return QStringLiteral("SEC_I_INCOMPLETE_CREDENTIALS"); case 0x00090321 : return QStringLiteral("SEC_I_RENEGOTIATE"); case 0x80090322 : return QStringLiteral("SEC_E_WRONG_PRINCIPAL"); case 0x00090323 : return QStringLiteral("SEC_I_NO_LSA_CONTEXT"); case 0x80090324 : return QStringLiteral("SEC_E_TIME_SKEW"); case 0x80090325 : return QStringLiteral("SEC_E_UNTRUSTED_ROOT"); case 0x80090326 : return QStringLiteral("SEC_E_ILLEGAL_MESSAGE"); case 0x80090327 : return QStringLiteral("SEC_E_CERT_UNKNOWN"); case 0x80090328 : return QStringLiteral("SEC_E_CERT_EXPIRED"); case 0x80090329 : return QStringLiteral("SEC_E_ENCRYPT_FAILURE"); case 0x80090330 : return QStringLiteral("SEC_E_DECRYPT_FAILURE"); case 0x80090331 : return QStringLiteral("SEC_E_ALGORITHM_MISMATCH"); case 0x80090332 : return QStringLiteral("SEC_E_SECURITY_QOS_FAILED"); case 0x80090333 : return QStringLiteral("SEC_E_UNFINISHED_CONTEXT_DELETED"); case 0x80090334 : return QStringLiteral("SEC_E_NO_TGT_REPLY"); case 0x80090335 : return QStringLiteral("SEC_E_NO_IP_ADDRESSES"); case 0x80090336 : return QStringLiteral("SEC_E_WRONG_CREDENTIAL_HANDLE"); case 0x80090337 : return QStringLiteral("SEC_E_CRYPTO_SYSTEM_INVALID"); case 0x80090338 : return QStringLiteral("SEC_E_MAX_REFERRALS_EXCEEDED"); case 0x80090339 : return QStringLiteral("SEC_E_MUST_BE_KDC"); case 0x8009033A : return QStringLiteral("SEC_E_STRONG_CRYPTO_NOT_SUPPORTED"); case 0x8009033B : return QStringLiteral("SEC_E_TOO_MANY_PRINCIPALS"); case 0x8009033C : return QStringLiteral("SEC_E_NO_PA_DATA"); case 0x8009033D : return QStringLiteral("SEC_E_PKINIT_NAME_MISMATCH"); case 0x8009033E : return QStringLiteral("SEC_E_SMARTCARD_LOGON_REQUIRED"); case 0x8009033F : return QStringLiteral("SEC_E_SHUTDOWN_IN_PROGRESS"); case 0x80090340 : return QStringLiteral("SEC_E_KDC_INVALID_REQUEST"); case 0x80090341 : return QStringLiteral("SEC_E_KDC_UNABLE_TO_REFER"); case 0x80090342 : return QStringLiteral("SEC_E_KDC_UNKNOWN_ETYPE"); case 0x80090343 : return QStringLiteral("SEC_E_UNSUPPORTED_PREAUTH"); case 0x80090345 : return QStringLiteral("SEC_E_DELEGATION_REQUIRED"); case 0x80090346 : return QStringLiteral("SEC_E_BAD_BINDINGS"); case 0x80090347 : return QStringLiteral("SEC_E_MULTIPLE_ACCOUNTS"); case 0x80090348 : return QStringLiteral("SEC_E_NO_KERB_KEY"); case 0x80090349 : return QStringLiteral("SEC_E_CERT_WRONG_USAGE"); case 0x80090350 : return QStringLiteral("SEC_E_DOWNGRADE_DETECTED"); case 0x80090351 : return QStringLiteral("SEC_E_SMARTCARD_CERT_REVOKED"); case 0x80090352 : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED"); case 0x80090353 : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_C"); case 0x80090354 : return QStringLiteral("SEC_E_PKINIT_CLIENT_FAILURE"); case 0x80090355 : return QStringLiteral("SEC_E_SMARTCARD_CERT_EXPIRED"); case 0x80090356 : return QStringLiteral("SEC_E_NO_S4U_PROT_SUPPORT"); case 0x80090357 : return QStringLiteral("SEC_E_CROSSREALM_DELEGATION_FAILURE"); case 0x80090358 : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_KDC"); case 0x80090359 : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED_KDC"); case 0x8009035A : return QStringLiteral("SEC_E_KDC_CERT_EXPIRED"); case 0x8009035B : return QStringLiteral("SEC_E_KDC_CERT_REVOKED"); case 0x80091001 : return QStringLiteral("CRYPT_E_MSG_ERROR"); case 0x80091002 : return QStringLiteral("CRYPT_E_UNKNOWN_ALGO"); case 0x80091003 : return QStringLiteral("CRYPT_E_OID_FORMAT"); case 0x80091004 : return QStringLiteral("CRYPT_E_INVALID_MSG_TYPE"); case 0x80091005 : return QStringLiteral("CRYPT_E_UNEXPECTED_ENCODING"); case 0x80091006 : return QStringLiteral("CRYPT_E_AUTH_ATTR_MISSING"); case 0x80091007 : return QStringLiteral("CRYPT_E_HASH_VALUE"); case 0x80091008 : return QStringLiteral("CRYPT_E_INVALID_INDEX"); case 0x80091009 : return QStringLiteral("CRYPT_E_ALREADY_DECRYPTED"); case 0x8009100A : return QStringLiteral("CRYPT_E_NOT_DECRYPTED"); case 0x8009100B : return QStringLiteral("CRYPT_E_RECIPIENT_NOT_FOUND"); case 0x8009100C : return QStringLiteral("CRYPT_E_CONTROL_TYPE"); case 0x8009100D : return QStringLiteral("CRYPT_E_ISSUER_SERIALNUMBER"); case 0x8009100E : return QStringLiteral("CRYPT_E_SIGNER_NOT_FOUND"); case 0x8009100F : return QStringLiteral("CRYPT_E_ATTRIBUTES_MISSING"); case 0x80091010 : return QStringLiteral("CRYPT_E_STREAM_MSG_NOT_READY"); case 0x80091011 : return QStringLiteral("CRYPT_E_STREAM_INSUFFICIENT_DATA"); case 0x00091012 : return QStringLiteral("CRYPT_I_NEW_PROTECTION_REQUIRED"); case 0x80092001 : return QStringLiteral("CRYPT_E_BAD_LEN"); case 0x80092002 : return QStringLiteral("CRYPT_E_BAD_ENCODE"); case 0x80092003 : return QStringLiteral("CRYPT_E_FILE_ERROR"); case 0x80092004 : return QStringLiteral("CRYPT_E_NOT_FOUND"); case 0x80092005 : return QStringLiteral("CRYPT_E_EXISTS"); case 0x80092006 : return QStringLiteral("CRYPT_E_NO_PROVIDER"); case 0x80092007 : return QStringLiteral("CRYPT_E_SELF_SIGNED"); case 0x80092008 : return QStringLiteral("CRYPT_E_DELETED_PREV"); case 0x80092009 : return QStringLiteral("CRYPT_E_NO_MATCH"); case 0x8009200A : return QStringLiteral("CRYPT_E_UNEXPECTED_MSG_TYPE"); case 0x8009200B : return QStringLiteral("CRYPT_E_NO_KEY_PROPERTY"); case 0x8009200C : return QStringLiteral("CRYPT_E_NO_DECRYPT_CERT"); case 0x8009200D : return QStringLiteral("CRYPT_E_BAD_MSG"); case 0x8009200E : return QStringLiteral("CRYPT_E_NO_SIGNER"); case 0x8009200F : return QStringLiteral("CRYPT_E_PENDING_CLOSE"); case 0x80092010 : return QStringLiteral("CRYPT_E_REVOKED"); case 0x80092011 : return QStringLiteral("CRYPT_E_NO_REVOCATION_DLL"); case 0x80092012 : return QStringLiteral("CRYPT_E_NO_REVOCATION_CHECK"); case 0x80092013 : return QStringLiteral("CRYPT_E_REVOCATION_OFFLINE"); case 0x80092014 : return QStringLiteral("CRYPT_E_NOT_IN_REVOCATION_DATABASE"); case 0x80092020 : return QStringLiteral("CRYPT_E_INVALID_NUMERIC_STRING"); case 0x80092021 : return QStringLiteral("CRYPT_E_INVALID_PRINTABLE_STRING"); case 0x80092022 : return QStringLiteral("CRYPT_E_INVALID_IA5_STRING"); case 0x80092023 : return QStringLiteral("CRYPT_E_INVALID_X500_STRING"); case 0x80092024 : return QStringLiteral("CRYPT_E_NOT_CHAR_STRING"); case 0x80092025 : return QStringLiteral("CRYPT_E_FILERESIZED"); case 0x80092026 : return QStringLiteral("CRYPT_E_SECURITY_SETTINGS"); case 0x80092027 : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_DLL"); case 0x80092028 : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_CHECK"); case 0x80092029 : return QStringLiteral("CRYPT_E_VERIFY_USAGE_OFFLINE"); case 0x8009202A : return QStringLiteral("CRYPT_E_NOT_IN_CTL"); case 0x8009202B : return QStringLiteral("CRYPT_E_NO_TRUSTED_SIGNER"); case 0x8009202C : return QStringLiteral("CRYPT_E_MISSING_PUBKEY_PARA"); case 0x80093000 : return QStringLiteral("CRYPT_E_OSS_ERROR"); case 0x80093001 : return QStringLiteral("OSS_MORE_BUF"); case 0x80093002 : return QStringLiteral("OSS_NEGATIVE_UINTEGER"); case 0x80093003 : return QStringLiteral("OSS_PDU_RANGE"); case 0x80093004 : return QStringLiteral("OSS_MORE_INPUT"); case 0x80093005 : return QStringLiteral("OSS_DATA_ERROR"); case 0x80093006 : return QStringLiteral("OSS_BAD_ARG"); case 0x80093007 : return QStringLiteral("OSS_BAD_VERSION"); case 0x80093008 : return QStringLiteral("OSS_OUT_MEMORY"); case 0x80093009 : return QStringLiteral("OSS_PDU_MISMATCH"); case 0x8009300A : return QStringLiteral("OSS_LIMITED"); case 0x8009300B : return QStringLiteral("OSS_BAD_PTR"); case 0x8009300C : return QStringLiteral("OSS_BAD_TIME"); case 0x8009300D : return QStringLiteral("OSS_INDEFINITE_NOT_SUPPORTED"); case 0x8009300E : return QStringLiteral("OSS_MEM_ERROR"); case 0x8009300F : return QStringLiteral("OSS_BAD_TABLE"); case 0x80093010 : return QStringLiteral("OSS_TOO_LONG"); case 0x80093011 : return QStringLiteral("OSS_CONSTRAINT_VIOLATED"); case 0x80093012 : return QStringLiteral("OSS_FATAL_ERROR"); case 0x80093013 : return QStringLiteral("OSS_ACCESS_SERIALIZATION_ERROR"); case 0x80093014 : return QStringLiteral("OSS_NULL_TBL"); case 0x80093015 : return QStringLiteral("OSS_NULL_FCN"); case 0x80093016 : return QStringLiteral("OSS_BAD_ENCRULES"); case 0x80093017 : return QStringLiteral("OSS_UNAVAIL_ENCRULES"); case 0x80093018 : return QStringLiteral("OSS_CANT_OPEN_TRACE_WINDOW"); case 0x80093019 : return QStringLiteral("OSS_UNIMPLEMENTED"); case 0x8009301A : return QStringLiteral("OSS_OID_DLL_NOT_LINKED"); case 0x8009301B : return QStringLiteral("OSS_CANT_OPEN_TRACE_FILE"); case 0x8009301C : return QStringLiteral("OSS_TRACE_FILE_ALREADY_OPEN"); case 0x8009301D : return QStringLiteral("OSS_TABLE_MISMATCH"); case 0x8009301E : return QStringLiteral("OSS_TYPE_NOT_SUPPORTED"); case 0x8009301F : return QStringLiteral("OSS_REAL_DLL_NOT_LINKED"); case 0x80093020 : return QStringLiteral("OSS_REAL_CODE_NOT_LINKED"); case 0x80093021 : return QStringLiteral("OSS_OUT_OF_RANGE"); case 0x80093022 : return QStringLiteral("OSS_COPIER_DLL_NOT_LINKED"); case 0x80093023 : return QStringLiteral("OSS_CONSTRAINT_DLL_NOT_LINKED"); case 0x80093024 : return QStringLiteral("OSS_COMPARATOR_DLL_NOT_LINKED"); case 0x80093025 : return QStringLiteral("OSS_COMPARATOR_CODE_NOT_LINKED"); case 0x80093026 : return QStringLiteral("OSS_MEM_MGR_DLL_NOT_LINKED"); case 0x80093027 : return QStringLiteral("OSS_PDV_DLL_NOT_LINKED"); case 0x80093028 : return QStringLiteral("OSS_PDV_CODE_NOT_LINKED"); case 0x80093029 : return QStringLiteral("OSS_API_DLL_NOT_LINKED"); case 0x8009302A : return QStringLiteral("OSS_BERDER_DLL_NOT_LINKED"); case 0x8009302B : return QStringLiteral("OSS_PER_DLL_NOT_LINKED"); case 0x8009302C : return QStringLiteral("OSS_OPEN_TYPE_ERROR"); case 0x8009302D : return QStringLiteral("OSS_MUTEX_NOT_CREATED"); case 0x8009302E : return QStringLiteral("OSS_CANT_CLOSE_TRACE_FILE"); case 0x80093100 : return QStringLiteral("CRYPT_E_ASN1_ERROR"); case 0x80093101 : return QStringLiteral("CRYPT_E_ASN1_INTERNAL"); case 0x80093102 : return QStringLiteral("CRYPT_E_ASN1_EOD"); case 0x80093103 : return QStringLiteral("CRYPT_E_ASN1_CORRUPT"); case 0x80093104 : return QStringLiteral("CRYPT_E_ASN1_LARGE"); case 0x80093105 : return QStringLiteral("CRYPT_E_ASN1_CONSTRAINT"); case 0x80093106 : return QStringLiteral("CRYPT_E_ASN1_MEMORY"); case 0x80093107 : return QStringLiteral("CRYPT_E_ASN1_OVERFLOW"); case 0x80093108 : return QStringLiteral("CRYPT_E_ASN1_BADPDU"); case 0x80093109 : return QStringLiteral("CRYPT_E_ASN1_BADARGS"); case 0x8009310A : return QStringLiteral("CRYPT_E_ASN1_BADREAL"); case 0x8009310B : return QStringLiteral("CRYPT_E_ASN1_BADTAG"); case 0x8009310C : return QStringLiteral("CRYPT_E_ASN1_CHOICE"); case 0x8009310D : return QStringLiteral("CRYPT_E_ASN1_RULE"); case 0x8009310E : return QStringLiteral("CRYPT_E_ASN1_UTF8"); case 0x80093133 : return QStringLiteral("CRYPT_E_ASN1_PDU_TYPE"); case 0x80093134 : return QStringLiteral("CRYPT_E_ASN1_NYI"); case 0x80093201 : return QStringLiteral("CRYPT_E_ASN1_EXTENDED"); case 0x80093202 : return QStringLiteral("CRYPT_E_ASN1_NOEOD"); case 0x80094001 : return QStringLiteral("CERTSRV_E_BAD_REQUESTSUBJECT"); case 0x80094002 : return QStringLiteral("CERTSRV_E_NO_REQUEST"); case 0x80094003 : return QStringLiteral("CERTSRV_E_BAD_REQUESTSTATUS"); case 0x80094004 : return QStringLiteral("CERTSRV_E_PROPERTY_EMPTY"); case 0x80094005 : return QStringLiteral("CERTSRV_E_INVALID_CA_CERTIFICATE"); case 0x80094006 : return QStringLiteral("CERTSRV_E_SERVER_SUSPENDED"); case 0x80094007 : return QStringLiteral("CERTSRV_E_ENCODING_LENGTH"); case 0x80094008 : return QStringLiteral("CERTSRV_E_ROLECONFLICT"); case 0x80094009 : return QStringLiteral("CERTSRV_E_RESTRICTEDOFFICER"); case 0x8009400A : return QStringLiteral("CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED"); case 0x8009400B : return QStringLiteral("CERTSRV_E_NO_VALID_KRA"); case 0x8009400C : return QStringLiteral("CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL"); case 0x8009400D : return QStringLiteral("CERTSRV_E_NO_CAADMIN_DEFINED"); case 0x8009400E : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE"); case 0x8009400F : return QStringLiteral("CERTSRV_E_NO_DB_SESSIONS"); case 0x80094010 : return QStringLiteral("CERTSRV_E_ALIGNMENT_FAULT"); case 0x80094011 : return QStringLiteral("CERTSRV_E_ENROLL_DENIED"); case 0x80094012 : return QStringLiteral("CERTSRV_E_TEMPLATE_DENIED"); case 0x80094013 : return QStringLiteral("CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE"); case 0x80094800 : return QStringLiteral("CERTSRV_E_UNSUPPORTED_CERT_TYPE"); case 0x80094801 : return QStringLiteral("CERTSRV_E_NO_CERT_TYPE"); case 0x80094802 : return QStringLiteral("CERTSRV_E_TEMPLATE_CONFLICT"); case 0x80094803 : return QStringLiteral("CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED"); case 0x80094804 : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_REQUIRED"); case 0x80094805 : return QStringLiteral("CERTSRV_E_SMIME_REQUIRED"); case 0x80094806 : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_SUBJECT"); case 0x80094807 : return QStringLiteral("CERTSRV_E_BAD_TEMPLATE_VERSION"); case 0x80094808 : return QStringLiteral("CERTSRV_E_TEMPLATE_POLICY_REQUIRED"); case 0x80094809 : return QStringLiteral("CERTSRV_E_SIGNATURE_POLICY_REQUIRED"); case 0x8009480A : return QStringLiteral("CERTSRV_E_SIGNATURE_COUNT"); case 0x8009480B : return QStringLiteral("CERTSRV_E_SIGNATURE_REJECTED"); case 0x8009480C : return QStringLiteral("CERTSRV_E_ISSUANCE_POLICY_REQUIRED"); case 0x8009480D : return QStringLiteral("CERTSRV_E_SUBJECT_UPN_REQUIRED"); case 0x8009480E : return QStringLiteral("CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED"); case 0x8009480F : return QStringLiteral("CERTSRV_E_SUBJECT_DNS_REQUIRED"); case 0x80094810 : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_UNEXPECTED"); case 0x80094811 : return QStringLiteral("CERTSRV_E_KEY_LENGTH"); case 0x80094812 : return QStringLiteral("CERTSRV_E_SUBJECT_EMAIL_REQUIRED"); case 0x80094813 : return QStringLiteral("CERTSRV_E_UNKNOWN_CERT_TYPE"); case 0x80094814 : return QStringLiteral("CERTSRV_E_CERT_TYPE_OVERLAP"); case 0x80095000 : return QStringLiteral("XENROLL_E_KEY_NOT_EXPORTABLE"); case 0x80095001 : return QStringLiteral("XENROLL_E_CANNOT_ADD_ROOT_CERT"); case 0x80095002 : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND"); case 0x80095003 : return QStringLiteral("XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH"); case 0x80095004 : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_MISMATCH"); case 0x80095005 : return QStringLiteral("XENROLL_E_KEYSPEC_SMIME_MISMATCH"); case 0x80096001 : return QStringLiteral("TRUST_E_SYSTEM_ERROR"); case 0x80096002 : return QStringLiteral("TRUST_E_NO_SIGNER_CERT"); case 0x80096003 : return QStringLiteral("TRUST_E_COUNTER_SIGNER"); case 0x80096004 : return QStringLiteral("TRUST_E_CERT_SIGNATURE"); case 0x80096005 : return QStringLiteral("TRUST_E_TIME_STAMP"); case 0x80096010 : return QStringLiteral("TRUST_E_BAD_DIGEST"); case 0x80096019 : return QStringLiteral("TRUST_E_BASIC_CONSTRAINTS"); case 0x8009601E : return QStringLiteral("TRUST_E_FINANCIAL_CRITERIA"); case 0x80097001 : return QStringLiteral("MSSIPOTF_E_OUTOFMEMRANGE"); case 0x80097002 : return QStringLiteral("MSSIPOTF_E_CANTGETOBJECT"); case 0x80097003 : return QStringLiteral("MSSIPOTF_E_NOHEADTABLE"); case 0x80097004 : return QStringLiteral("MSSIPOTF_E_BAD_MAGICNUMBER"); case 0x80097005 : return QStringLiteral("MSSIPOTF_E_BAD_OFFSET_TABLE"); case 0x80097006 : return QStringLiteral("MSSIPOTF_E_TABLE_TAGORDER"); case 0x80097007 : return QStringLiteral("MSSIPOTF_E_TABLE_LONGWORD"); case 0x80097008 : return QStringLiteral("MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT"); case 0x80097009 : return QStringLiteral("MSSIPOTF_E_TABLES_OVERLAP"); case 0x8009700A : return QStringLiteral("MSSIPOTF_E_TABLE_PADBYTES"); case 0x8009700B : return QStringLiteral("MSSIPOTF_E_FILETOOSMALL"); case 0x8009700C : return QStringLiteral("MSSIPOTF_E_TABLE_CHECKSUM"); case 0x8009700D : return QStringLiteral("MSSIPOTF_E_FILE_CHECKSUM"); case 0x80097010 : return QStringLiteral("MSSIPOTF_E_FAILED_POLICY"); case 0x80097011 : return QStringLiteral("MSSIPOTF_E_FAILED_HINTS_CHECK"); case 0x80097012 : return QStringLiteral("MSSIPOTF_E_NOT_OPENTYPE"); case 0x80097013 : return QStringLiteral("MSSIPOTF_E_FILE"); case 0x80097014 : return QStringLiteral("MSSIPOTF_E_CRYPT"); case 0x80097015 : return QStringLiteral("MSSIPOTF_E_BADVERSION"); case 0x80097016 : return QStringLiteral("MSSIPOTF_E_DSIG_STRUCTURE"); case 0x80097017 : return QStringLiteral("MSSIPOTF_E_PCONST_CHECK"); case 0x80097018 : return QStringLiteral("MSSIPOTF_E_STRUCTURE"); case 0x800B0001 : return QStringLiteral("TRUST_E_PROVIDER_UNKNOWN"); case 0x800B0002 : return QStringLiteral("TRUST_E_ACTION_UNKNOWN"); case 0x800B0003 : return QStringLiteral("TRUST_E_SUBJECT_FORM_UNKNOWN"); case 0x800B0004 : return QStringLiteral("TRUST_E_SUBJECT_NOT_TRUSTED"); case 0x800B0005 : return QStringLiteral("DIGSIG_E_ENCODE"); case 0x800B0006 : return QStringLiteral("DIGSIG_E_DECODE"); case 0x800B0007 : return QStringLiteral("DIGSIG_E_EXTENSIBILITY"); case 0x800B0008 : return QStringLiteral("DIGSIG_E_CRYPTO"); case 0x800B0009 : return QStringLiteral("PERSIST_E_SIZEDEFINITE"); case 0x800B000A : return QStringLiteral("PERSIST_E_SIZEINDEFINITE"); case 0x800B000B : return QStringLiteral("PERSIST_E_NOTSELFSIZING"); case 0x800B0100 : return QStringLiteral("TRUST_E_NOSIGNATURE"); case 0x800B0101 : return QStringLiteral("CERT_E_EXPIRED"); case 0x800B0102 : return QStringLiteral("CERT_E_VALIDITYPERIODNESTING"); case 0x800B0103 : return QStringLiteral("CERT_E_ROLE"); case 0x800B0104 : return QStringLiteral("CERT_E_PATHLENCONST"); case 0x800B0105 : return QStringLiteral("CERT_E_CRITICAL"); case 0x800B0106 : return QStringLiteral("CERT_E_PURPOSE"); case 0x800B0107 : return QStringLiteral("CERT_E_ISSUERCHAINING"); case 0x800B0108 : return QStringLiteral("CERT_E_MALFORMED"); case 0x800B0109 : return QStringLiteral("CERT_E_UNTRUSTEDROOT"); case 0x800B010A : return QStringLiteral("CERT_E_CHAINING"); case 0x800B010B : return QStringLiteral("TRUST_E_FAIL"); case 0x800B010C : return QStringLiteral("CERT_E_REVOKED"); case 0x800B010D : return QStringLiteral("CERT_E_UNTRUSTEDTESTROOT"); case 0x800B010E : return QStringLiteral("CERT_E_REVOCATION_FAILURE"); case 0x800B010F : return QStringLiteral("CERT_E_CN_NO_MATCH"); case 0x800B0110 : return QStringLiteral("CERT_E_WRONG_USAGE"); case 0x800B0111 : return QStringLiteral("TRUST_E_EXPLICIT_DISTRUST"); case 0x800B0112 : return QStringLiteral("CERT_E_UNTRUSTEDCA"); case 0x800B0113 : return QStringLiteral("CERT_E_INVALID_POLICY"); case 0x800B0114 : return QStringLiteral("CERT_E_INVALID_NAME"); case 0x800F0000 : return QStringLiteral("SPAPI_E_EXPECTED_SECTION_NAME"); case 0x800F0001 : return QStringLiteral("SPAPI_E_BAD_SECTION_NAME_LINE"); case 0x800F0002 : return QStringLiteral("SPAPI_E_SECTION_NAME_TOO_LONG"); case 0x800F0003 : return QStringLiteral("SPAPI_E_GENERAL_SYNTAX"); case 0x800F0100 : return QStringLiteral("SPAPI_E_WRONG_INF_STYLE"); case 0x800F0101 : return QStringLiteral("SPAPI_E_SECTION_NOT_FOUND"); case 0x800F0102 : return QStringLiteral("SPAPI_E_LINE_NOT_FOUND"); case 0x800F0103 : return QStringLiteral("SPAPI_E_NO_BACKUP"); case 0x800F0200 : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_CLASS"); case 0x800F0201 : return QStringLiteral("SPAPI_E_CLASS_MISMATCH"); case 0x800F0202 : return QStringLiteral("SPAPI_E_DUPLICATE_FOUND"); case 0x800F0203 : return QStringLiteral("SPAPI_E_NO_DRIVER_SELECTED"); case 0x800F0204 : return QStringLiteral("SPAPI_E_KEY_DOES_NOT_EXIST"); case 0x800F0205 : return QStringLiteral("SPAPI_E_INVALID_DEVINST_NAME"); case 0x800F0206 : return QStringLiteral("SPAPI_E_INVALID_CLASS"); case 0x800F0207 : return QStringLiteral("SPAPI_E_DEVINST_ALREADY_EXISTS"); case 0x800F0208 : return QStringLiteral("SPAPI_E_DEVINFO_NOT_REGISTERED"); case 0x800F0209 : return QStringLiteral("SPAPI_E_INVALID_REG_PROPERTY"); case 0x800F020A : return QStringLiteral("SPAPI_E_NO_INF"); case 0x800F020B : return QStringLiteral("SPAPI_E_NO_SUCH_DEVINST"); case 0x800F020C : return QStringLiteral("SPAPI_E_CANT_LOAD_CLASS_ICON"); case 0x800F020D : return QStringLiteral("SPAPI_E_INVALID_CLASS_INSTALLER"); case 0x800F020E : return QStringLiteral("SPAPI_E_DI_DO_DEFAULT"); case 0x800F020F : return QStringLiteral("SPAPI_E_DI_NOFILECOPY"); case 0x800F0210 : return QStringLiteral("SPAPI_E_INVALID_HWPROFILE"); case 0x800F0211 : return QStringLiteral("SPAPI_E_NO_DEVICE_SELECTED"); case 0x800F0212 : return QStringLiteral("SPAPI_E_DEVINFO_LIST_LOCKED"); case 0x800F0213 : return QStringLiteral("SPAPI_E_DEVINFO_DATA_LOCKED"); case 0x800F0214 : return QStringLiteral("SPAPI_E_DI_BAD_PATH"); case 0x800F0215 : return QStringLiteral("SPAPI_E_NO_CLASSINSTALL_PARAMS"); case 0x800F0216 : return QStringLiteral("SPAPI_E_FILEQUEUE_LOCKED"); case 0x800F0217 : return QStringLiteral("SPAPI_E_BAD_SERVICE_INSTALLSECT"); case 0x800F0218 : return QStringLiteral("SPAPI_E_NO_CLASS_DRIVER_LIST"); case 0x800F0219 : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_SERVICE"); case 0x800F021A : return QStringLiteral("SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE"); case 0x800F021B : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_ACTIVE"); case 0x800F021C : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_REMOVED"); case 0x800F021D : return QStringLiteral("SPAPI_E_BAD_INTERFACE_INSTALLSECT"); case 0x800F021E : return QStringLiteral("SPAPI_E_NO_SUCH_INTERFACE_CLASS"); case 0x800F021F : return QStringLiteral("SPAPI_E_INVALID_REFERENCE_STRING"); case 0x800F0220 : return QStringLiteral("SPAPI_E_INVALID_MACHINENAME"); case 0x800F0221 : return QStringLiteral("SPAPI_E_REMOTE_COMM_FAILURE"); case 0x800F0222 : return QStringLiteral("SPAPI_E_MACHINE_UNAVAILABLE"); case 0x800F0223 : return QStringLiteral("SPAPI_E_NO_CONFIGMGR_SERVICES"); case 0x800F0224 : return QStringLiteral("SPAPI_E_INVALID_PROPPAGE_PROVIDER"); case 0x800F0225 : return QStringLiteral("SPAPI_E_NO_SUCH_DEVICE_INTERFACE"); case 0x800F0226 : return QStringLiteral("SPAPI_E_DI_POSTPROCESSING_REQUIRED"); case 0x800F0227 : return QStringLiteral("SPAPI_E_INVALID_COINSTALLER"); case 0x800F0228 : return QStringLiteral("SPAPI_E_NO_COMPAT_DRIVERS"); case 0x800F0229 : return QStringLiteral("SPAPI_E_NO_DEVICE_ICON"); case 0x800F022A : return QStringLiteral("SPAPI_E_INVALID_INF_LOGCONFIG"); case 0x800F022B : return QStringLiteral("SPAPI_E_DI_DONT_INSTALL"); case 0x800F022C : return QStringLiteral("SPAPI_E_INVALID_FILTER_DRIVER"); case 0x800F022D : return QStringLiteral("SPAPI_E_NON_WINDOWS_NT_DRIVER"); case 0x800F022E : return QStringLiteral("SPAPI_E_NON_WINDOWS_DRIVER"); case 0x800F022F : return QStringLiteral("SPAPI_E_NO_CATALOG_FOR_OEM_INF"); case 0x800F0230 : return QStringLiteral("SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE"); case 0x800F0231 : return QStringLiteral("SPAPI_E_NOT_DISABLEABLE"); case 0x800F0232 : return QStringLiteral("SPAPI_E_CANT_REMOVE_DEVINST"); case 0x800F0233 : return QStringLiteral("SPAPI_E_INVALID_TARGET"); case 0x800F0234 : return QStringLiteral("SPAPI_E_DRIVER_NONNATIVE"); case 0x800F0235 : return QStringLiteral("SPAPI_E_IN_WOW64"); case 0x800F0236 : return QStringLiteral("SPAPI_E_SET_SYSTEM_RESTORE_POINT"); case 0x800F0237 : return QStringLiteral("SPAPI_E_INCORRECTLY_COPIED_INF"); case 0x800F0238 : return QStringLiteral("SPAPI_E_SCE_DISABLED"); case 0x800F0239 : return QStringLiteral("SPAPI_E_UNKNOWN_EXCEPTION"); case 0x800F023A : return QStringLiteral("SPAPI_E_PNP_REGISTRY_ERROR"); case 0x800F023B : return QStringLiteral("SPAPI_E_REMOTE_REQUEST_UNSUPPORTED"); case 0x800F023C : return QStringLiteral("SPAPI_E_NOT_AN_INSTALLED_OEM_INF"); case 0x800F023D : return QStringLiteral("SPAPI_E_INF_IN_USE_BY_DEVICES"); case 0x800F023E : return QStringLiteral("SPAPI_E_DI_FUNCTION_OBSOLETE"); case 0x800F023F : return QStringLiteral("SPAPI_E_NO_AUTHENTICODE_CATALOG"); case 0x800F0240 : return QStringLiteral("SPAPI_E_AUTHENTICODE_DISALLOWED"); case 0x800F0241 : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER"); case 0x800F0242 : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED"); case 0x800F0243 : return QStringLiteral("SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED"); case 0x800F0244 : return QStringLiteral("SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH"); case 0x800F0245 : return QStringLiteral("SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE"); case 0x800F0300 : return QStringLiteral("SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW"); case 0x800F1000 : return QStringLiteral("SPAPI_E_ERROR_NOT_INSTALLED"); case 0x80100001 : return QStringLiteral("SCARD_F_INTERNAL_ERROR"); case 0x80100002 : return QStringLiteral("SCARD_E_CANCELLED"); case 0x80100003 : return QStringLiteral("SCARD_E_INVALID_HANDLE"); case 0x80100004 : return QStringLiteral("SCARD_E_INVALID_PARAMETER"); case 0x80100005 : return QStringLiteral("SCARD_E_INVALID_TARGET"); case 0x80100006 : return QStringLiteral("SCARD_E_NO_MEMORY"); case 0x80100007 : return QStringLiteral("SCARD_F_WAITED_TOO_LONG"); case 0x80100008 : return QStringLiteral("SCARD_E_INSUFFICIENT_BUFFER"); case 0x80100009 : return QStringLiteral("SCARD_E_UNKNOWN_READER"); case 0x8010000A : return QStringLiteral("SCARD_E_TIMEOUT"); case 0x8010000B : return QStringLiteral("SCARD_E_SHARING_VIOLATION"); case 0x8010000C : return QStringLiteral("SCARD_E_NO_SMARTCARD"); case 0x8010000D : return QStringLiteral("SCARD_E_UNKNOWN_CARD"); case 0x8010000E : return QStringLiteral("SCARD_E_CANT_DISPOSE"); case 0x8010000F : return QStringLiteral("SCARD_E_PROTO_MISMATCH"); case 0x80100010 : return QStringLiteral("SCARD_E_NOT_READY"); case 0x80100011 : return QStringLiteral("SCARD_E_INVALID_VALUE"); case 0x80100012 : return QStringLiteral("SCARD_E_SYSTEM_CANCELLED"); case 0x80100013 : return QStringLiteral("SCARD_F_COMM_ERROR"); case 0x80100014 : return QStringLiteral("SCARD_F_UNKNOWN_ERROR"); case 0x80100015 : return QStringLiteral("SCARD_E_INVALID_ATR"); case 0x80100016 : return QStringLiteral("SCARD_E_NOT_TRANSACTED"); case 0x80100017 : return QStringLiteral("SCARD_E_READER_UNAVAILABLE"); case 0x80100018 : return QStringLiteral("SCARD_P_SHUTDOWN"); case 0x80100019 : return QStringLiteral("SCARD_E_PCI_TOO_SMALL"); case 0x8010001A : return QStringLiteral("SCARD_E_READER_UNSUPPORTED"); case 0x8010001B : return QStringLiteral("SCARD_E_DUPLICATE_READER"); case 0x8010001C : return QStringLiteral("SCARD_E_CARD_UNSUPPORTED"); case 0x8010001D : return QStringLiteral("SCARD_E_NO_SERVICE"); case 0x8010001E : return QStringLiteral("SCARD_E_SERVICE_STOPPED"); case 0x8010001F : return QStringLiteral("SCARD_E_UNEXPECTED"); case 0x80100020 : return QStringLiteral("SCARD_E_ICC_INSTALLATION"); case 0x80100021 : return QStringLiteral("SCARD_E_ICC_CREATEORDER"); case 0x80100022 : return QStringLiteral("SCARD_E_UNSUPPORTED_FEATURE"); case 0x80100023 : return QStringLiteral("SCARD_E_DIR_NOT_FOUND"); case 0x80100024 : return QStringLiteral("SCARD_E_FILE_NOT_FOUND"); case 0x80100025 : return QStringLiteral("SCARD_E_NO_DIR"); case 0x80100026 : return QStringLiteral("SCARD_E_NO_FILE"); case 0x80100027 : return QStringLiteral("SCARD_E_NO_ACCESS"); case 0x80100028 : return QStringLiteral("SCARD_E_WRITE_TOO_MANY"); case 0x80100029 : return QStringLiteral("SCARD_E_BAD_SEEK"); case 0x8010002A : return QStringLiteral("SCARD_E_INVALID_CHV"); case 0x8010002B : return QStringLiteral("SCARD_E_UNKNOWN_RES_MNG"); case 0x8010002C : return QStringLiteral("SCARD_E_NO_SUCH_CERTIFICATE"); case 0x8010002D : return QStringLiteral("SCARD_E_CERTIFICATE_UNAVAILABLE"); case 0x8010002E : return QStringLiteral("SCARD_E_NO_READERS_AVAILABLE"); case 0x8010002F : return QStringLiteral("SCARD_E_COMM_DATA_LOST"); case 0x80100030 : return QStringLiteral("SCARD_E_NO_KEY_CONTAINER"); case 0x80100031 : return QStringLiteral("SCARD_E_SERVER_TOO_BUSY"); case 0x80100065 : return QStringLiteral("SCARD_W_UNSUPPORTED_CARD"); case 0x80100066 : return QStringLiteral("SCARD_W_UNRESPONSIVE_CARD"); case 0x80100067 : return QStringLiteral("SCARD_W_UNPOWERED_CARD"); case 0x80100068 : return QStringLiteral("SCARD_W_RESET_CARD"); case 0x80100069 : return QStringLiteral("SCARD_W_REMOVED_CARD"); case 0x8010006A : return QStringLiteral("SCARD_W_SECURITY_VIOLATION"); case 0x8010006B : return QStringLiteral("SCARD_W_WRONG_CHV"); case 0x8010006C : return QStringLiteral("SCARD_W_CHV_BLOCKED"); case 0x8010006D : return QStringLiteral("SCARD_W_EOF"); case 0x8010006E : return QStringLiteral("SCARD_W_CANCELLED_BY_USER"); case 0x8010006F : return QStringLiteral("SCARD_W_CARD_NOT_AUTHENTICATED"); case 0x80100070 : return QStringLiteral("SCARD_W_CACHE_ITEM_NOT_FOUND"); case 0x80100071 : return QStringLiteral("SCARD_W_CACHE_ITEM_STALE"); case 0x80110401 : return QStringLiteral("COMADMIN_E_OBJECTERRORS"); case 0x80110402 : return QStringLiteral("COMADMIN_E_OBJECTINVALID"); case 0x80110403 : return QStringLiteral("COMADMIN_E_KEYMISSING"); case 0x80110404 : return QStringLiteral("COMADMIN_E_ALREADYINSTALLED"); case 0x80110407 : return QStringLiteral("COMADMIN_E_APP_FILE_WRITEFAIL"); case 0x80110408 : return QStringLiteral("COMADMIN_E_APP_FILE_READFAIL"); case 0x80110409 : return QStringLiteral("COMADMIN_E_APP_FILE_VERSION"); case 0x8011040A : return QStringLiteral("COMADMIN_E_BADPATH"); case 0x8011040B : return QStringLiteral("COMADMIN_E_APPLICATIONEXISTS"); case 0x8011040C : return QStringLiteral("COMADMIN_E_ROLEEXISTS"); case 0x8011040D : return QStringLiteral("COMADMIN_E_CANTCOPYFILE"); case 0x8011040F : return QStringLiteral("COMADMIN_E_NOUSER"); case 0x80110410 : return QStringLiteral("COMADMIN_E_INVALIDUSERIDS"); case 0x80110411 : return QStringLiteral("COMADMIN_E_NOREGISTRYCLSID"); case 0x80110412 : return QStringLiteral("COMADMIN_E_BADREGISTRYPROGID"); case 0x80110413 : return QStringLiteral("COMADMIN_E_AUTHENTICATIONLEVEL"); case 0x80110414 : return QStringLiteral("COMADMIN_E_USERPASSWDNOTVALID"); case 0x80110418 : return QStringLiteral("COMADMIN_E_CLSIDORIIDMISMATCH"); case 0x80110419 : return QStringLiteral("COMADMIN_E_REMOTEINTERFACE"); case 0x8011041A : return QStringLiteral("COMADMIN_E_DLLREGISTERSERVER"); case 0x8011041B : return QStringLiteral("COMADMIN_E_NOSERVERSHARE"); case 0x8011041D : return QStringLiteral("COMADMIN_E_DLLLOADFAILED"); case 0x8011041E : return QStringLiteral("COMADMIN_E_BADREGISTRYLIBID"); case 0x8011041F : return QStringLiteral("COMADMIN_E_APPDIRNOTFOUND"); case 0x80110423 : return QStringLiteral("COMADMIN_E_REGISTRARFAILED"); case 0x80110424 : return QStringLiteral("COMADMIN_E_COMPFILE_DOESNOTEXIST"); case 0x80110425 : return QStringLiteral("COMADMIN_E_COMPFILE_LOADDLLFAIL"); case 0x80110426 : return QStringLiteral("COMADMIN_E_COMPFILE_GETCLASSOBJ"); case 0x80110427 : return QStringLiteral("COMADMIN_E_COMPFILE_CLASSNOTAVAIL"); case 0x80110428 : return QStringLiteral("COMADMIN_E_COMPFILE_BADTLB"); case 0x80110429 : return QStringLiteral("COMADMIN_E_COMPFILE_NOTINSTALLABLE"); case 0x8011042A : return QStringLiteral("COMADMIN_E_NOTCHANGEABLE"); case 0x8011042B : return QStringLiteral("COMADMIN_E_NOTDELETEABLE"); case 0x8011042C : return QStringLiteral("COMADMIN_E_SESSION"); case 0x8011042D : return QStringLiteral("COMADMIN_E_COMP_MOVE_LOCKED"); case 0x8011042E : return QStringLiteral("COMADMIN_E_COMP_MOVE_BAD_DEST"); case 0x80110430 : return QStringLiteral("COMADMIN_E_REGISTERTLB"); case 0x80110433 : return QStringLiteral("COMADMIN_E_SYSTEMAPP"); case 0x80110434 : return QStringLiteral("COMADMIN_E_COMPFILE_NOREGISTRAR"); case 0x80110435 : return QStringLiteral("COMADMIN_E_COREQCOMPINSTALLED"); case 0x80110436 : return QStringLiteral("COMADMIN_E_SERVICENOTINSTALLED"); case 0x80110437 : return QStringLiteral("COMADMIN_E_PROPERTYSAVEFAILED"); case 0x80110438 : return QStringLiteral("COMADMIN_E_OBJECTEXISTS"); case 0x80110439 : return QStringLiteral("COMADMIN_E_COMPONENTEXISTS"); case 0x8011043B : return QStringLiteral("COMADMIN_E_REGFILE_CORRUPT"); case 0x8011043C : return QStringLiteral("COMADMIN_E_PROPERTY_OVERFLOW"); case 0x8011043E : return QStringLiteral("COMADMIN_E_NOTINREGISTRY"); case 0x8011043F : return QStringLiteral("COMADMIN_E_OBJECTNOTPOOLABLE"); case 0x80110446 : return QStringLiteral("COMADMIN_E_APPLID_MATCHES_CLSID"); case 0x80110447 : return QStringLiteral("COMADMIN_E_ROLE_DOES_NOT_EXIST"); case 0x80110448 : return QStringLiteral("COMADMIN_E_START_APP_NEEDS_COMPONENTS"); case 0x80110449 : return QStringLiteral("COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM"); case 0x8011044A : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY"); case 0x8011044B : return QStringLiteral("COMADMIN_E_CAN_NOT_START_APP"); case 0x8011044C : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_SYS_APP"); case 0x8011044D : return QStringLiteral("COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT"); case 0x8011044E : return QStringLiteral("COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER"); case 0x8011044F : return QStringLiteral("COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE"); case 0x80110450 : return QStringLiteral("COMADMIN_E_BASE_PARTITION_ONLY"); case 0x80110451 : return QStringLiteral("COMADMIN_E_START_APP_DISABLED"); case 0x80110457 : return QStringLiteral("COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME"); case 0x80110458 : return QStringLiteral("COMADMIN_E_CAT_INVALID_PARTITION_NAME"); case 0x80110459 : return QStringLiteral("COMADMIN_E_CAT_PARTITION_IN_USE"); case 0x8011045A : return QStringLiteral("COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES"); case 0x8011045B : return QStringLiteral("COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED"); case 0x8011045C : return QStringLiteral("COMADMIN_E_AMBIGUOUS_APPLICATION_NAME"); case 0x8011045D : return QStringLiteral("COMADMIN_E_AMBIGUOUS_PARTITION_NAME"); case 0x80110472 : return QStringLiteral("COMADMIN_E_REGDB_NOTINITIALIZED"); case 0x80110473 : return QStringLiteral("COMADMIN_E_REGDB_NOTOPEN"); case 0x80110474 : return QStringLiteral("COMADMIN_E_REGDB_SYSTEMERR"); case 0x80110475 : return QStringLiteral("COMADMIN_E_REGDB_ALREADYRUNNING"); case 0x80110480 : return QStringLiteral("COMADMIN_E_MIG_VERSIONNOTSUPPORTED"); case 0x80110481 : return QStringLiteral("COMADMIN_E_MIG_SCHEMANOTFOUND"); case 0x80110482 : return QStringLiteral("COMADMIN_E_CAT_BITNESSMISMATCH"); case 0x80110483 : return QStringLiteral("COMADMIN_E_CAT_UNACCEPTABLEBITNESS"); case 0x80110484 : return QStringLiteral("COMADMIN_E_CAT_WRONGAPPBITNESS"); case 0x80110485 : return QStringLiteral("COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED"); case 0x80110486 : return QStringLiteral("COMADMIN_E_CAT_SERVERFAULT"); case 0x80110600 : return QStringLiteral("COMQC_E_APPLICATION_NOT_QUEUED"); case 0x80110601 : return QStringLiteral("COMQC_E_NO_QUEUEABLE_INTERFACES"); case 0x80110602 : return QStringLiteral("COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE"); case 0x80110603 : return QStringLiteral("COMQC_E_NO_IPERSISTSTREAM"); case 0x80110604 : return QStringLiteral("COMQC_E_BAD_MESSAGE"); case 0x80110605 : return QStringLiteral("COMQC_E_UNAUTHENTICATED"); case 0x80110606 : return QStringLiteral("COMQC_E_UNTRUSTED_ENQUEUER"); case 0x80110701 : return QStringLiteral("MSDTC_E_DUPLICATE_RESOURCE"); case 0x80110808 : return QStringLiteral("COMADMIN_E_OBJECT_PARENT_MISSING"); case 0x80110809 : return QStringLiteral("COMADMIN_E_OBJECT_DOES_NOT_EXIST"); case 0x8011080A : return QStringLiteral("COMADMIN_E_APP_NOT_RUNNING"); case 0x8011080B : return QStringLiteral("COMADMIN_E_INVALID_PARTITION"); case 0x8011080D : return QStringLiteral("COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE"); case 0x8011080E : return QStringLiteral("COMADMIN_E_USER_IN_SET"); case 0x8011080F : return QStringLiteral("COMADMIN_E_CANTRECYCLELIBRARYAPPS"); case 0x80110811 : return QStringLiteral("COMADMIN_E_CANTRECYCLESERVICEAPPS"); case 0x80110812 : return QStringLiteral("COMADMIN_E_PROCESSALREADYRECYCLED"); case 0x80110813 : return QStringLiteral("COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED"); case 0x80110814 : return QStringLiteral("COMADMIN_E_CANTMAKEINPROCSERVICE"); case 0x80110815 : return QStringLiteral("COMADMIN_E_PROGIDINUSEBYCLSID"); case 0x80110816 : return QStringLiteral("COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET"); case 0x80110817 : return QStringLiteral("COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED"); case 0x80110818 : return QStringLiteral("COMADMIN_E_PARTITION_ACCESSDENIED"); case 0x80110819 : return QStringLiteral("COMADMIN_E_PARTITION_MSI_ONLY"); case 0x8011081A : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT"); case 0x8011081B : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS"); case 0x8011081C : return QStringLiteral("COMADMIN_E_COMP_MOVE_SOURCE"); case 0x8011081D : return QStringLiteral("COMADMIN_E_COMP_MOVE_DEST"); case 0x8011081E : return QStringLiteral("COMADMIN_E_COMP_MOVE_PRIVATE"); case 0x8011081F : return QStringLiteral("COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET"); case 0x80110820 : return QStringLiteral("COMADMIN_E_CANNOT_ALIAS_EVENTCLASS"); case 0x80110821 : return QStringLiteral("COMADMIN_E_PRIVATE_ACCESSDENIED"); case 0x80110822 : return QStringLiteral("COMADMIN_E_SAFERINVALID"); case 0x80110823 : return QStringLiteral("COMADMIN_E_REGISTRY_ACCESSDENIED"); case 0x80110824 : return QStringLiteral("COMADMIN_E_PARTITIONS_DISABLED"); case 0x80042301 : return QStringLiteral("VSS_E_BAD_STATE"); case 0x800423F7 : return QStringLiteral("VSS_E_LEGACY_PROVIDER"); case 0x800423FF : return QStringLiteral("VSS_E_RESYNC_IN_PROGRESS"); case 0x8004232B : return QStringLiteral("VSS_E_SNAPSHOT_NOT_IN_SET"); case 0x80042312 : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED"); case 0x80042317 : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED"); case 0x8004232C : return QStringLiteral("VSS_E_NESTED_VOLUME_LIMIT"); case 0x80042308 : return QStringLiteral("VSS_E_OBJECT_NOT_FOUND"); case 0x80042304 : return QStringLiteral("VSS_E_PROVIDER_NOT_REGISTERED"); case 0x80042306 : return QStringLiteral("VSS_E_PROVIDER_VETO"); case 0x8004230C : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED"); case 0x8004230E : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER"); case 0x80042302 : return QStringLiteral("VSS_E_UNEXPECTED"); case 0x8004230F : return QStringLiteral("VSS_E_UNEXPECTED_PROVIDER_ERROR"); case 0x8004232A : return QStringLiteral("VSS_E_UNSELECTED_VOLUME"); case 0x800423FE : return QStringLiteral("VSS_E_CANNOT_REVERT_DISKID"); case 0x80042311 : return QStringLiteral("VSS_E_INVALID_XML_DOCUMENT"); case 0x8004230D : return QStringLiteral("VSS_E_OBJECT_ALREADY_EXISTS"); case 0x80284001 : return QStringLiteral("TBS_E_INTERNAL_ERROR"); case 0x80284002 : return QStringLiteral("TBS_E_BAD_PARAMETER"); case 0x80284003 : return QStringLiteral("TBS_E_INVALID_OUTPUT_POINTER"); case 0x80284005 : return QStringLiteral("TBS_E_INSUFFICIENT_BUFFER"); case 0x80284006 : return QStringLiteral("TBS_E_IOERROR"); case 0x80284007 : return QStringLiteral("TBS_E_INVALID_CONTEXT_PARAM"); case 0x80284008 : return QStringLiteral("TBS_E_SERVICE_NOT_RUNNING"); case 0x80284009 : return QStringLiteral("TBS_E_TOO_MANY_TBS_CONTEXTS"); case 0x8028400B : return QStringLiteral("TBS_E_SERVICE_START_PENDING"); case 0x8028400E : return QStringLiteral("TBS_E_BUFFER_TOO_LARGE"); case 0x8028400F : return QStringLiteral("TBS_E_TPM_NOT_FOUND"); case 0x80284010 : return QStringLiteral("TBS_E_SERVICE_DISABLED"); case 0x80284016 : return QStringLiteral("TBS_E_DEACTIVATED"); case 0x80320001 : return QStringLiteral("FWP_E_CALLOUT_NOT_FOUND"); case 0x80320002 : return QStringLiteral("FWP_E_CONDITION_NOT_FOUND"); case 0x80320003 : return QStringLiteral("FWP_E_FILTER_NOT_FOUND"); case 0x80320004 : return QStringLiteral("FWP_E_LAYER_NOT_FOUND"); case 0x80320005 : return QStringLiteral("FWP_E_PROVIDER_NOT_FOUND"); case 0x80320006 : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_NOT_FOUND"); case 0x80320007 : return QStringLiteral("FWP_E_SUBLAYER_NOT_FOUND"); case 0x80320008 : return QStringLiteral("FWP_E_NOT_FOUND"); case 0x80320009 : return QStringLiteral("FWP_E_ALREADY_EXISTS"); case 0x8032000A : return QStringLiteral("FWP_E_IN_USE"); case 0x8032000B : return QStringLiteral("FWP_E_DYNAMIC_SESSION_IN_PROGRESS"); case 0x8032000C : return QStringLiteral("FWP_E_WRONG_SESSION"); case 0x8032000D : return QStringLiteral("FWP_E_NO_TXN_IN_PROGRESS"); case 0x8032000E : return QStringLiteral("FWP_E_TXN_IN_PROGRESS"); case 0x8032000F : return QStringLiteral("FWP_E_TXN_ABORTED"); case 0x80320010 : return QStringLiteral("FWP_E_SESSION_ABORTED"); case 0x80320011 : return QStringLiteral("FWP_E_INCOMPATIBLE_TXN"); case 0x80320012 : return QStringLiteral("FWP_E_TIMEOUT"); case 0x80320013 : return QStringLiteral("FWP_E_NET_EVENTS_DISABLED"); case 0x80320014 : return QStringLiteral("FWP_E_INCOMPATIBLE_LAYER"); case 0x80320015 : return QStringLiteral("FWP_E_KM_CLIENTS_ONLY"); case 0x80320016 : return QStringLiteral("FWP_E_LIFETIME_MISMATCH"); case 0x80320017 : return QStringLiteral("FWP_E_BUILTIN_OBJECT"); case 0x80320018 : return QStringLiteral("FWP_E_TOO_MANY_CALLOUTS"); case 0x80320019 : return QStringLiteral("FWP_E_NOTIFICATION_DROPPED"); case 0x8032001A : return QStringLiteral("FWP_E_TRAFFIC_MISMATCH"); case 0x8032001B : return QStringLiteral("FWP_E_INCOMPATIBLE_SA_STATE"); case 0x8032001C : return QStringLiteral("FWP_E_NULL_POINTER"); case 0x8032001D : return QStringLiteral("FWP_E_INVALID_ENUMERATOR"); case 0x8032001E : return QStringLiteral("FWP_E_INVALID_FLAGS"); case 0x8032001F : return QStringLiteral("FWP_E_INVALID_NET_MASK"); case 0x80320020 : return QStringLiteral("FWP_E_INVALID_RANGE"); case 0x80320021 : return QStringLiteral("FWP_E_INVALID_INTERVAL"); case 0x80320022 : return QStringLiteral("FWP_E_ZERO_LENGTH_ARRAY"); case 0x80320023 : return QStringLiteral("FWP_E_NULL_DISPLAY_NAME"); case 0x80320024 : return QStringLiteral("FWP_E_INVALID_ACTION_TYPE"); case 0x80320025 : return QStringLiteral("FWP_E_INVALID_WEIGHT"); case 0x80320026 : return QStringLiteral("FWP_E_MATCH_TYPE_MISMATCH"); case 0x80320027 : return QStringLiteral("FWP_E_TYPE_MISMATCH"); case 0x80320028 : return QStringLiteral("FWP_E_OUT_OF_BOUNDS"); case 0x80320029 : return QStringLiteral("FWP_E_RESERVED"); case 0x8032002A : return QStringLiteral("FWP_E_DUPLICATE_CONDITION"); case 0x8032002B : return QStringLiteral("FWP_E_DUPLICATE_KEYMOD"); case 0x8032002C : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER"); case 0x8032002D : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER"); case 0x8032002E : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER"); case 0x8032002F : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT"); case 0x80320030 : return QStringLiteral("FWP_E_INCOMPATIBLE_AUTH_METHOD"); case 0x80320031 : return QStringLiteral("FWP_E_INCOMPATIBLE_DH_GROUP"); case 0x80320032 : return QStringLiteral("FWP_E_EM_NOT_SUPPORTED"); case 0x80320033 : return QStringLiteral("FWP_E_NEVER_MATCH"); case 0x80320034 : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_MISMATCH"); case 0x80320035 : return QStringLiteral("FWP_E_INVALID_PARAMETER"); case 0x80320036 : return QStringLiteral("FWP_E_TOO_MANY_SUBLAYERS"); case 0x80320037 : return QStringLiteral("FWP_E_CALLOUT_NOTIFICATION_FAILED"); case 0x80320038 : return QStringLiteral("FWP_E_INVALID_AUTH_TRANSFORM"); case 0x80320039 : return QStringLiteral("FWP_E_INVALID_CIPHER_TRANSFORM"); default : return QString(); } } /*! \since 5.2 Returns the DWM colorization color. After the function returns, the optional \a opaqueBlend will contain true if the color is an opaque blend and false otherwise. */ QColor QtWin::colorizationColor(bool *opaqueBlend) { QWinEventFilter::setup(); DWORD colorization; BOOL dummy; qt_DwmGetColorizationColor(&colorization, &dummy); if (opaqueBlend) *opaqueBlend = dummy; return QColor::fromRgba(colorization); } /*! \since 5.2 Returns the real colorization color, set by the user, using an undocumented registry key. The API-based function \c getColorizationColor() returns an alpha-blended color which often turns out a semitransparent gray rather than something similar to what is chosen by the user. \sa colorizationColor() */ QColor QtWin::realColorizationColor() { QWinEventFilter::setup(); bool ok = false; const QLatin1String path("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\DWM"); QSettings registry(path, QSettings::NativeFormat); QRgb color = registry.value(QLatin1String("ColorizationColor")).toUInt(&ok); if (!ok) qDebug("Failed to read colorization color."); return ok ? QColor::fromRgba(color) : QColor(); } /*! \fn QtWin::setWindowExcludedFromPeek(QWidget *window, bool exclude) \since 5.2 \overload QtWin::setWindowExcludedFromPeek() */ /*! \since 5.2 Excludes the specified \a window from Aero Peek if \a exclude is true. */ void QtWin::setWindowExcludedFromPeek(QWindow *window, bool exclude) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); BOOL value = exclude; qt_DwmSetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK, &value, sizeof(value)); } /*! \fn bool QtWin::isWindowExcludedFromPeek(QWidget *window) \since 5.2 \overload QtWin::isWindowExcludedFromPeek() */ /*! \since 5.2 Returns true if the specified \a window is excluded from Aero Peek. */ bool QtWin::isWindowExcludedFromPeek(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); BOOL value; qt_DwmGetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK, &value, sizeof(value)); return value; } /*! \fn void QtWin::setWindowDisallowPeek(QWidget *window, bool disallow) \since 5.2 \overload QtWin::setWindowDisallowPeek() */ /*! \since 5.2 Disables Aero Peek for the specified \a window when hovering over the taskbar thumbnail of the window with the mouse pointer if \a disallow is true; otherwise allows it. The default is false. */ void QtWin::setWindowDisallowPeek(QWindow *window, bool disallow) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); BOOL value = disallow; qt_DwmSetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK, &value, sizeof(value)); } /*! \fn bool QtWin::isWindowPeekDisallowed(QWidget *window) \since 5.2 \overload QtWin::isWindowPeekDisallowed() */ /*! \since 5.2 Returns true if Aero Peek is disallowed on the thumbnail of the specified \a window. */ bool QtWin::isWindowPeekDisallowed(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); BOOL value; qt_DwmGetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK, &value, sizeof(value)); return value; } /*! \fn void QtWin::setWindowFlip3DPolicy(QWidget *window, QtWin::WindowFlip3DPolicy policy) \since 5.2 \overload QtWin::setWindowFlip3DPolicy() */ /*! \since 5.2 Sets the Flip3D policy \a policy for the specified \a window. */ void QtWin::setWindowFlip3DPolicy(QWindow *window, QtWin::WindowFlip3DPolicy policy) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); HWND handle = reinterpret_cast<HWND>(window->winId()); // Policy should be defaulted first, bug or smth. DWORD value = qt_DWMFLIP3D_DEFAULT; qt_DwmSetWindowAttribute(handle, qt_DWMWA_FLIP3D_POLICY, &value, sizeof(value)); switch (policy) { default : case FlipDefault : value = -1; break; case FlipExcludeBelow : value = qt_DWMFLIP3D_EXCLUDEBELOW; break; case FlipExcludeAbove : value = qt_DWMFLIP3D_EXCLUDEABOVE; break; } if (qt_DWMFLIP3D_DEFAULT != value) qt_DwmSetWindowAttribute(handle, qt_DWMWA_FLIP3D_POLICY, &value, sizeof(value)); } /*! \fn QtWin::WindowFlip3DPolicy QtWin::windowFlip3DPolicy(QWidget *window) \since 5.2 \overload QtWin::windowFlip3DPolicy() */ /*! \since 5.2 Returns the current Flip3D policy for the specified \a window. */ QtWin::WindowFlip3DPolicy QtWin::windowFlip3DPolicy(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); DWORD value; QtWin::WindowFlip3DPolicy policy; qt_DwmGetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_FLIP3D_POLICY, &value, sizeof(value)); switch (value) { case qt_DWMFLIP3D_EXCLUDEABOVE : policy = QtWin::FlipExcludeAbove; break; case qt_DWMFLIP3D_EXCLUDEBELOW : policy = QtWin::FlipExcludeBelow; break; default : policy = QtWin::FlipDefault; break; } return policy; } void qt_ExtendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom) { QWinEventFilter::setup(); MARGINS margins = {left, right, top, bottom}; qt_DwmExtendFrameIntoClientArea(reinterpret_cast<HWND>(window->winId()), &margins); } /*! \fn void QtWin::extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom) \since 5.2 \overload QtWin::extendFrameIntoClientArea() */ /*! \since 5.2 Extends the glass frame into the client area of the specified \a window using the \a left, \a top, \a right, and \a bottom margin values. Pass -1 as values for any of the four margins to fully extend the frame, creating a \e {sheet of glass} effect. If you want the extended frame to act like a standard window border, you should handle that yourself. \note If \a window is a QWidget handle, set the Qt::WA_NoSystemBackground attribute for your widget. \sa resetExtendedFrame() */ void QtWin::extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); qt_ExtendFrameIntoClientArea(window, left, top, right, bottom); } /*! \fn void QtWin::extendFrameIntoClientArea(QWidget *window, const QMargins &margins) \since 5.2 \overload QtWin::extendFrameIntoClientArea() Convenience overload that allows passing frame sizes in a \a margins structure. */ /*! \since 5.2 \overload QtWin::extendFrameIntoClientArea() Extends the glass frame into the client area of the specified \a window using the specified \a margins. */ void QtWin::extendFrameIntoClientArea(QWindow *window, const QMargins &margins) { QtWin::extendFrameIntoClientArea(window, margins.left(), margins.top(), margins.right(), margins.bottom()); } /*! \fn void QtWin::resetExtendedFrame(QWidget *window) \since 5.2 \overload QtWin::resetExtendedFrame() */ /*! \since 5.2 Resets the glass frame and restores the \a window attributes. This convenience function calls extendFrameIntoClientArea() with margins set to 0. \note You must unset the Qt::WA_NoSystemBackground attribute for extendFrameIntoClientArea() to work. \sa extendFrameIntoClientArea() */ void QtWin::resetExtendedFrame(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); qt_ExtendFrameIntoClientArea(window, 0, 0, 0, 0); } /*! \fn void QtWin::enableBlurBehindWindow(QWidget *window, const QRegion &region) \since 5.2 \overload QtWin::enableBlurBehindWindow() */ /*! \since 5.2 Enables the blur effect for the specified \a region of the specified \a window. \sa disableBlurBehindWindow() */ void QtWin::enableBlurBehindWindow(QWindow *window, const QRegion &region) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); qt_DWM_BLURBEHIND dwmbb = {0, 0, 0, 0}; dwmbb.dwFlags = qt_DWM_BB_ENABLE; dwmbb.fEnable = TRUE; HRGN rgn = 0; if (!region.isNull()) { rgn = toHRGN(region); if (rgn) { dwmbb.hRgnBlur = rgn; dwmbb.dwFlags |= qt_DWM_BB_BLURREGION; } } qt_DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); if (rgn) DeleteObject(rgn); } /*! \fn void QtWin::enableBlurBehindWindow(QWidget *window) \since 5.2 \overload QtWin::enableBlurBehindWindow() */ /*! \since 5.2 Enables the blur effect for the specified \a window. \sa disableBlurBehindWindow() */ void QtWin::enableBlurBehindWindow(QWindow *window) { QtWin::enableBlurBehindWindow(window, QRegion()); } /*! \fn void QtWin::disableBlurBehindWindow(QWidget *window) \since 5.2 \overload QtWin::disableBlurBehindWindow() */ /*! \since 5.2 Disables the previously enabled blur effect for the specified \a window. \sa enableBlurBehindWindow() */ void QtWin::disableBlurBehindWindow(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); qt_DWM_BLURBEHIND dwmbb = {0, 0, 0, 0}; dwmbb.dwFlags = qt_DWM_BB_ENABLE; dwmbb.fEnable = FALSE; qt_DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); } /*! \since 5.2 Returns the DWM composition state. */ bool QtWin::isCompositionEnabled() { QWinEventFilter::setup(); BOOL enabled; qt_DwmIsCompositionEnabled(&enabled); return enabled; } /*! \since 5.2 Sets whether the Windows Desktop composition is \a enabled. \note The underlying function was declared deprecated as of Windows 8 and takes no effect. */ void QtWin::setCompositionEnabled(bool enabled) { QWinEventFilter::setup(); UINT compositionEnabled = enabled; qt_DwmEnableComposition(compositionEnabled); } /*! \since 5.2 Returns whether the colorization color is an opaque blend. */ bool QtWin::isCompositionOpaque() { bool opaque; colorizationColor(&opaque); return opaque; } /*! \since 5.2 Sets the Application User Model ID \a id. For more information, see \l{http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459.aspx} {Application User Model IDs}. */ void QtWin::setCurrentProcessExplicitAppUserModelID(const QString &id) { wchar_t *wid = qt_qstringToNullTerminated(id); qt_SetCurrentProcessExplicitAppUserModelID(wid); delete[] wid; } /*! \internal */ ITaskbarList3 *qt_createITaskbarList3() { ITaskbarList3 *pTbList = 0; HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); pTbList = 0; } } return pTbList; } /*! \internal */ ITaskbarList2 *qt_createITaskbarList2() { ITaskbarList3 *pTbList = 0; HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); pTbList = 0; } } return pTbList; } /*! \fn void QtWin::markFullscreenWindow(QWidget *window, bool fullscreen) \since 5.2 \overload QtWin::markFullscreenWindow() */ /*! \since 5.2 Marks the specified \a window as running in the full-screen mode if \a fullscreen is true, so that the shell handles it correctly. Otherwise, removes the mark. \note You do not usually need to call this function, because the Windows taskbar always tries to determine whether a window is running in the full-screen mode. */ void QtWin::markFullscreenWindow(QWindow *window, bool fullscreen) { ITaskbarList2 *pTbList = qt_createITaskbarList2(); if (pTbList) { pTbList->MarkFullscreenWindow(reinterpret_cast<HWND>(window->winId()), fullscreen); pTbList->Release(); } } /*! \fn void QtWin::taskbarActivateTab(QWidget *window) \since 5.2 \overload QtWin::taskbarActivateTab() */ /*! \since 5.2 Activates an item on the taskbar without activating the \a window itself. */ void QtWin::taskbarActivateTab(QWindow *window) { ITaskbarList *pTbList = qt_createITaskbarList2(); if (pTbList) { pTbList->ActivateTab(reinterpret_cast<HWND>(window->winId())); pTbList->Release(); } } /*! \fn void QtWin::taskbarActivateTabAlt(QWidget *window) \since 5.2 \overload QtWin::taskbarActivateTabAlt() */ /*! \since 5.2 Marks the item that represents the specified \a window on the taskbar as active, but does not activate it visually. */ void QtWin::taskbarActivateTabAlt(QWindow *window) { ITaskbarList *pTbList = qt_createITaskbarList2(); if (pTbList) { pTbList->SetActiveAlt(reinterpret_cast<HWND>(window->winId())); pTbList->Release(); } } /*! \fn void QtWin::taskbarAddTab(QWidget *window) \since 5.2 \overload QtWin::taskbarAddTab() */ /*! \since 5.2 Adds an item for the specified \a window to the taskbar. */ void QtWin::taskbarAddTab(QWindow *window) { ITaskbarList *pTbList = qt_createITaskbarList2(); if (pTbList) { pTbList->AddTab(reinterpret_cast<HWND>(window->winId())); pTbList->Release(); } } /*! \fn void QtWin::taskbarDeleteTab(QWidget *window) \since 5.2 \overload QtWin::taskbarDeleteTab() */ /*! \since 5.2 Removes the specified \a window from the taskbar. */ void QtWin::taskbarDeleteTab(QWindow *window) { ITaskbarList *pTbList = qt_createITaskbarList3(); if (pTbList) { pTbList->DeleteTab(reinterpret_cast<HWND>(window->winId())); pTbList->Release(); } } /*! \enum QtWin::HBitmapFormat \since 5.2 This enum defines how the conversion between \c HBITMAP and QPixmap is performed. \value HBitmapNoAlpha The alpha channel is ignored and always treated as being set to fully opaque. This is preferred if the \c HBITMAP is used with standard GDI calls, such as \c BitBlt(). \value HBitmapPremultipliedAlpha The \c HBITMAP is treated as having an alpha channel and premultiplied colors. This is preferred if the \c HBITMAP is accessed through the \c AlphaBlend() GDI function. \value HBitmapAlpha The \c HBITMAP is treated as having a plain alpha channel. This is the preferred format if the \c HBITMAP is going to be used as an application icon or a systray icon. \sa fromHBITMAP(), toHBITMAP() */ /*! \enum QtWin::WindowFlip3DPolicy \since 5.2 This enum type specifies the Flip3D window policy. \value FlipDefault Let the OS decide whether to include the window in the Flip3D rendering. \value FlipExcludeAbove Exclude the window from Flip3D and display it above the Flip3D rendering. \value FlipExcludeBelow Exclude the window from Flip3D and display it below the Flip3D rendering. \sa setWindowFlip3DPolicy() */ QT_END_NAMESPACE
CodeDJ/qt5-hidpi
qt/qtwinextras/src/winextras/qwinfunctions.cpp
C++
lgpl-2.1
107,141
/** * * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. * * This library 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 2.1 of the License, or (at your option) any later version. * * This library 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 this library. If not, see <http://www.gnu.org/licenses/>. * **/ package lucee.runtime.monitor; import java.io.IOException; import java.lang.reflect.Method; import java.util.Map; import lucee.commons.lang.ExceptionUtil; import lucee.runtime.exp.PageException; import lucee.runtime.op.Caster; import lucee.runtime.type.Query; public class IntervallMonitorWrap extends MonitorWrap implements IntervallMonitor { private static final Object[] PARAMS_LOG = new Object[0]; private Method log; private Method getData; public IntervallMonitorWrap(Object monitor) { super(monitor, TYPE_INTERVAL); } @Override public void log() throws IOException { try { if (log == null) { log = monitor.getClass().getMethod("log", new Class[0]); } log.invoke(monitor, PARAMS_LOG); } catch (Exception e) { throw ExceptionUtil.toIOException(e); } } @Override public Query getData(Map<String, Object> arguments) throws PageException { try { if (getData == null) { getData = monitor.getClass().getMethod("getData", new Class[] { Map.class }); } return (Query) getData.invoke(monitor, new Object[] { arguments }); } catch (Exception e) { throw Caster.toPageException(e); } } }
lucee/Lucee
core/src/main/java/lucee/runtime/monitor/IntervallMonitorWrap.java
Java
lgpl-2.1
1,910
<?php /* Smarty version Smarty-3.1.21, created on 2017-06-01 17:41:52 compiled from "D:\xampp\htdocs\tiki\templates\layout_fullscreen_check.tpl" */ ?> <?php /*%%SmartyHeaderCode:11102593035c047a490-64075437%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed'); $_valid = $_smarty_tpl->decodeProperties(array ( 'file_dependency' => array ( 'c9f4e452c0f8f25d2171a8d3081ad85520a0fde1' => array ( 0 => 'D:\\xampp\\htdocs\\tiki\\templates\\layout_fullscreen_check.tpl', 1 => 1496331454, 2 => 'file', ), ), 'nocache_hash' => '11102593035c047a490-64075437', 'function' => array ( ), 'variables' => array ( 'prefs' => 0, 'filegals_manager' => 0, 'print_page' => 0, ), 'has_nocache_code' => false, 'version' => 'Smarty-3.1.21', 'unifunc' => 'content_593035c0490dd7_58556726', ),false); /*/%%SmartyHeaderCode%%*/?> <?php if ($_valid && !is_callable('content_593035c0490dd7_58556726')) {function content_593035c0490dd7_58556726($_smarty_tpl) {?><?php if (!is_callable('smarty_block_self_link')) include 'D:/xampp/htdocs/tiki/lib/smarty_tiki\\block.self_link.php'; ?> <?php if ($_smarty_tpl->tpl_vars['prefs']->value['feature_fullscreen']=='y'&&$_smarty_tpl->tpl_vars['filegals_manager']->value==''&&$_smarty_tpl->tpl_vars['print_page']->value!='y') {?> <div id="fullscreenbutton"> <?php if ($_SESSION['fullscreen']=='n') {?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('self_link', array('fullscreen'=>"y",'_ajax'=>'n','_icon_name'=>'expand','_title'=>"Fullscreen")); $_block_repeat=true; echo smarty_block_self_link(array('fullscreen'=>"y",'_ajax'=>'n','_icon_name'=>'expand','_title'=>"Fullscreen"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start(); $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_self_link(array('fullscreen'=>"y",'_ajax'=>'n','_icon_name'=>'expand','_title'=>"Fullscreen"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?> <?php } else { ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('self_link', array('fullscreen'=>"n",'_ajax'=>'n','_icon_name'=>'compress','_title'=>"Cancel Fullscreen")); $_block_repeat=true; echo smarty_block_self_link(array('fullscreen'=>"n",'_ajax'=>'n','_icon_name'=>'compress','_title'=>"Cancel Fullscreen"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start(); $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_self_link(array('fullscreen'=>"n",'_ajax'=>'n','_icon_name'=>'compress','_title'=>"Cancel Fullscreen"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?> <?php }?> </div> <?php }?> <?php }} ?>
lorddavy/TikiWiki-Improvement-Project
templates_c/en_basic^c9f4e452c0f8f25d2171a8d3081ad85520a0fde1.file.layout_fullscreen_check.tpl.php
PHP
lgpl-2.1
2,752
/* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef ImageLoaderClient_h #define ImageLoaderClient_h namespace WebCore { class Element; class ImageLoaderClient { public: virtual ~ImageLoaderClient() { } virtual Element* sourceElement() = 0; virtual Element* imageElement() = 0; virtual void refSourceElement() = 0; virtual void derefSourceElement() = 0; }; template<typename T> class ImageLoaderClientBase : public ImageLoaderClient { public: Element* sourceElement() { return static_cast<T*>(this); } Element* imageElement() { return static_cast<T*>(this); } void refSourceElement() { static_cast<T*>(this)->ref(); } void derefSourceElement() { static_cast<T*>(this)->deref(); } }; } #endif
youfoh/webkit-efl
Source/WebCore/loader/ImageLoaderClient.h
C
lgpl-2.1
2,259
// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Gtk { using System; public delegate void SelectionClearEventHandler(object o, SelectionClearEventArgs args); public class SelectionClearEventArgs : GLib.SignalArgs { public Gdk.EventSelection Event{ get { return (Gdk.EventSelection) Args [0]; } } } }
akrisiun/gtk-sharp
gtk/generated/Gtk/SelectionClearEventHandler.cs
C#
lgpl-2.1
388
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2017 the original author or authors. // // This library 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 2.1 of the License, or (at your option) any later version. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle.utils; import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; import java.util.List; import org.junit.Test; import com.puppycrawl.tools.checkstyle.DefaultLogger; import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; import com.puppycrawl.tools.checkstyle.TreeWalkerFilter; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.AuditListener; import com.puppycrawl.tools.checkstyle.api.AutomaticBean; import com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilter; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.FileText; import com.puppycrawl.tools.checkstyle.api.Filter; import com.puppycrawl.tools.checkstyle.api.RootModule; public class ModuleReflectionUtilsTest { @Test public void testIsProperUtilsClass() throws ReflectiveOperationException { assertTrue("Constructor is not private", isUtilsClassHasPrivateConstructor(ModuleReflectionUtils.class, true)); } @Test public void testIsCheckstyleModule() { assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(CheckClass.class)); assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(FileSetModuleClass.class)); assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(FilterClass.class)); assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(TreeWalkerFilterClass.class)); assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(FileFilterModuleClass.class)); assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(AuditListenerClass.class)); assertTrue("Should return true when checkstyle module is passed", ModuleReflectionUtils.isCheckstyleModule(RootModuleClass.class)); } @Test public void testIsValidCheckstyleClass() { assertTrue("Should return true when valid checkstyle class is passed", ModuleReflectionUtils.isValidCheckstyleClass(ValidCheckstyleClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils .isValidCheckstyleClass(InvalidNonAutomaticBeanClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isValidCheckstyleClass(AbstractInvalidClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils .isValidCheckstyleClass(InvalidNonDefaultConstructorClass.class)); } @Test public void testIsCheckstyleCheck() { assertTrue("Should return true when valid checkstyle check is passed", ModuleReflectionUtils.isCheckstyleCheck(CheckClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isCheckstyleCheck(NotCheckstyleCheck.class)); } @Test public void testIsFileSetModule() { assertTrue("Should return true when valid checkstyle file set module is passed", ModuleReflectionUtils.isFileSetModule(FileSetModuleClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isFileSetModule(NotCheckstyleCheck.class)); } @Test public void testIsFilterModule() { assertTrue("Should return true when valid checkstyle filter module is passed", ModuleReflectionUtils.isFilterModule(FilterClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isFilterModule(NotCheckstyleCheck.class)); } @Test public void testIsFileFilterModule() { assertTrue("Should return true when valid checkstyle file filter module is passed", ModuleReflectionUtils.isFileFilterModule(FileFilterModuleClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isFileFilterModule(NotCheckstyleCheck.class)); } @Test public void testIsTreeWalkerFilterModule() { assertTrue("Should return true when valid checkstyle TreeWalker filter module is passed", ModuleReflectionUtils.isTreeWalkerFilterModule(TreeWalkerFilterClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isTreeWalkerFilterModule(NotCheckstyleCheck.class)); } @Test public void testIsAuditListener() { assertTrue("Should return true when valid checkstyle AuditListener module is passed", ModuleReflectionUtils.isAuditListener(DefaultLogger.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isAuditListener(NotCheckstyleCheck.class)); } @Test public void testIsRootModule() { assertTrue("Should return true when valid checkstyle root module is passed", ModuleReflectionUtils.isRootModule(RootModuleClass.class)); assertFalse("Should return false when invalid class is passed", ModuleReflectionUtils.isRootModule(NotCheckstyleCheck.class)); } @Test public void testKeepEclipseHappy() { final InvalidNonDefaultConstructorClass test = new InvalidNonDefaultConstructorClass(0); assertNotNull("should use constructor", test); assertEquals("should use field", 1, test.getField()); } /** @noinspection SuperClassHasFrequentlyUsedInheritors */ private static class ValidCheckstyleClass extends AutomaticBean { // empty, use default constructor } private static class InvalidNonAutomaticBeanClass { // empty, use default constructor } /** @noinspection AbstractClassNeverImplemented */ private abstract static class AbstractInvalidClass extends AutomaticBean { public abstract void method(); } private static class CheckClass extends AbstractCheck { @Override public int[] getDefaultTokens() { return new int[] {0}; } @Override public int[] getAcceptableTokens() { return getDefaultTokens(); } @Override public int[] getRequiredTokens() { return getDefaultTokens(); } } private static class FileSetModuleClass extends AbstractFileSetCheck { @Override protected void processFiltered(File file, FileText fileText) throws CheckstyleException { //dummy method } } private static class FilterClass extends AutomaticBean implements Filter { @Override public boolean accept(AuditEvent event) { return false; } } private static class FileFilterModuleClass extends AutomaticBean implements BeforeExecutionFileFilter { @Override public boolean accept(String uri) { return false; } } private static class RootModuleClass extends AutomaticBean implements RootModule { @Override public void addListener(AuditListener listener) { //dummy method } @Override public int process(List<File> files) throws CheckstyleException { return 0; } @Override public void destroy() { //dummy method } @Override public void setModuleClassLoader(ClassLoader moduleClassLoader) { //dummy method } } private static class TreeWalkerFilterClass extends AutomaticBean implements TreeWalkerFilter { @Override public boolean accept(TreeWalkerAuditEvent treeWalkerAuditEvent) { return false; } } private static class AuditListenerClass extends AutomaticBean implements AuditListener { @Override public void auditStarted(AuditEvent event) { //dummy method } @Override public void auditFinished(AuditEvent event) { //dummy method } @Override public void fileStarted(AuditEvent event) { //dummy method } @Override public void fileFinished(AuditEvent event) { //dummy method } @Override public void addError(AuditEvent event) { //dummy method } @Override public void addException(AuditEvent event, Throwable throwable) { //dummy method } } private static class NotCheckstyleCheck { // empty, use default constructor } private static class InvalidNonDefaultConstructorClass extends AutomaticBean { private int field; protected InvalidNonDefaultConstructorClass(int data) { //keep pmd calm and happy field = 0; method(data); } public final void method(int data) { field++; if (data > 0) { method(data - 1); } } public int getField() { return field; } } }
jochenvdv/checkstyle
src/test/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtilsTest.java
Java
lgpl-2.1
11,040
# devices/md.py # # Copyright (C) 2009-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY expressed or implied, including the implied warranties of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. You should have received a copy of the # GNU General Public License along with this program; if not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. Any Red Hat trademarks that are incorporated in the # source code or documentation are not subject to the GNU General Public # License and may only be used or replicated with the express permission of # Red Hat, Inc. # # Red Hat Author(s): David Lehman <dlehman@redhat.com> # import os import six from gi.repository import BlockDev as blockdev from ..devicelibs import mdraid, raid from .. import errors from .. import util from ..flags import flags from ..storage_log import log_method_call from .. import udev from ..size import Size import logging log = logging.getLogger("blivet") from .storage import StorageDevice from .container import ContainerDevice from .raid import RaidDevice class MDRaidArrayDevice(ContainerDevice, RaidDevice): """ An mdraid (Linux RAID) device. """ _type = "mdarray" _packages = ["mdadm"] _devDir = "/dev/md" _formatClassName = property(lambda s: "mdmember") _formatUUIDAttr = property(lambda s: "mdUuid") def __init__(self, name, level=None, major=None, minor=None, size=None, memberDevices=None, totalDevices=None, uuid=None, fmt=None, exists=False, metadataVersion=None, parents=None, sysfsPath=''): """ :param name: the device name (generally a device node's basename) :type name: str :keyword exists: does this device exist? :type exists: bool :keyword size: the device's size :type size: :class:`~.size.Size` :keyword parents: a list of parent devices :type parents: list of :class:`StorageDevice` :keyword fmt: this device's formatting :type fmt: :class:`~.formats.DeviceFormat` or a subclass of it :keyword sysfsPath: sysfs device path :type sysfsPath: str :keyword uuid: the device UUID :type uuid: str :keyword level: the device's RAID level :type level: any valid RAID level descriptor :keyword int memberDevices: the number of active member devices :keyword int totalDevices: the total number of member devices :keyword metadataVersion: the version of the device's md metadata :type metadataVersion: str (eg: "0.90") :keyword minor: the device minor (obsolete?) :type minor: int """ # pylint: disable=unused-argument # These attributes are used by _addParent, so they must be initialized # prior to instantiating the superclass. self._memberDevices = 0 # the number of active (non-spare) members self._totalDevices = 0 # the total number of members # avoid attribute-defined-outside-init pylint warning self._level = None super(MDRaidArrayDevice, self).__init__(name, fmt=fmt, uuid=uuid, exists=exists, size=size, parents=parents, sysfsPath=sysfsPath) try: self.level = level except errors.DeviceError as e: # Could not set the level, so set loose the parents that were # added in superclass constructor. for dev in self.parents: dev.removeChild() raise e self.uuid = uuid self._totalDevices = util.numeric_type(totalDevices) self.memberDevices = util.numeric_type(memberDevices) self.chunkSize = mdraid.MD_CHUNK_SIZE if not self.exists and not isinstance(metadataVersion, str): self.metadataVersion = "default" else: self.metadataVersion = metadataVersion if self.parents and self.parents[0].type == "mdcontainer" and self.type != "mdbiosraidarray": raise errors.DeviceError("A device with mdcontainer member must be mdbiosraidarray.") if self.exists and self.mdadmFormatUUID and not flags.testing: # this is a hack to work around mdadm's insistence on giving # really high minors to arrays it has no config entry for with open("/etc/mdadm.conf", "a") as c: c.write("ARRAY %s UUID=%s\n" % (self.path, self.mdadmFormatUUID)) @property def mdadmFormatUUID(self): """ This array's UUID, formatted for external use. :returns: the array's UUID in mdadm format, if available :rtype: str or NoneType """ formatted_uuid = None if self.uuid is not None: try: formatted_uuid = blockdev.md.get_md_uuid(self.uuid) except blockdev.MDRaidError: pass return formatted_uuid @property def level(self): """ Return the raid level :returns: raid level value :rtype: an object that represents a RAID level """ return self._level @property def _levels(self): """ Allowed RAID level for this type of device.""" return mdraid.RAID_levels @level.setter def level(self, value): """ Set the RAID level and enforce restrictions based on it. :param value: new raid level :param type: object :raises :class:`~.errors.DeviceError`: if value does not describe a valid RAID level :returns: None """ try: level = self._getLevel(value, self._levels) except ValueError as e: raise errors.DeviceError(e) self._level = level @property def createBitmap(self): """ Whether or not a bitmap should be created on the array. If the the array is sufficiently small, a bitmap yields no benefit. If the array has no redundancy, a bitmap is just pointless. """ try: return self.level.has_redundancy() and self.size >= Size(1000) and self.format.type != "swap" except errors.RaidError: # If has_redundancy() raises an exception then this device has # a level for which the redundancy question is meaningless. In # that case, creating a write-intent bitmap would be a meaningless # action. return False def getSuperBlockSize(self, raw_array_size): """Estimate the superblock size for a member of an array, given the total available memory for this array and raid level. :param raw_array_size: total available for this array and level :type raw_array_size: :class:`~.size.Size` :returns: estimated superblock size :rtype: :class:`~.size.Size` """ return blockdev.md.get_superblock_size(raw_array_size, version=self.metadataVersion) @property def size(self): """Returns the actual or estimated size depending on whether or not the array exists. """ if not self.exists or not self.mediaPresent: try: size = self.level.get_size([d.size for d in self.devices], self.memberDevices, self.chunkSize, self.getSuperBlockSize) except (blockdev.MDRaidError, errors.RaidError) as e: log.info("could not calculate size of device %s for raid level %s: %s", self.name, self.level, e) size = Size(0) log.debug("non-existent RAID %s size == %s", self.level, size) else: size = self.currentSize log.debug("existing RAID %s size == %s", self.level, size) return size def updateSize(self): # pylint: disable=bad-super-call super(ContainerDevice, self).updateSize() @property def description(self): levelstr = self.level.nick if self.level.nick else self.level.name return "MDRAID set (%s)" % levelstr def __repr__(self): s = StorageDevice.__repr__(self) s += (" level = %(level)s spares = %(spares)s\n" " members = %(memberDevices)s\n" " total devices = %(totalDevices)s" " metadata version = %(metadataVersion)s" % {"level": self.level, "spares": self.spares, "memberDevices": self.memberDevices, "totalDevices": self.totalDevices, "metadataVersion": self.metadataVersion}) return s @property def dict(self): d = super(MDRaidArrayDevice, self).dict d.update({"level": str(self.level), "spares": self.spares, "memberDevices": self.memberDevices, "totalDevices": self.totalDevices, "metadataVersion": self.metadataVersion}) return d @property def mdadmConfEntry(self): """ This array's mdadm.conf entry. """ uuid = self.mdadmFormatUUID if self.memberDevices is None or not uuid: raise errors.DeviceError("array is not fully defined", self.name) fmt = "ARRAY %s level=%s num-devices=%d UUID=%s\n" return fmt % (self.path, self.level, self.memberDevices, uuid) @property def totalDevices(self): """ Total number of devices in the array, including spares. """ if not self.exists: return self._totalDevices else: return len(self.parents) def _getMemberDevices(self): return self._memberDevices def _setMemberDevices(self, number): if not isinstance(number, six.integer_types): raise ValueError("memberDevices must be an integer") if not self.exists and number > self.totalDevices: raise ValueError("memberDevices cannot be greater than totalDevices") self._memberDevices = number memberDevices = property(_getMemberDevices, _setMemberDevices, doc="number of member devices") def _getSpares(self): spares = 0 if self.memberDevices is not None: if self.totalDevices is not None and \ self.totalDevices > self.memberDevices: spares = self.totalDevices - self.memberDevices elif self.totalDevices is None: spares = self.memberDevices self._totalDevices = self.memberDevices return spares def _setSpares(self, spares): max_spares = self.level.get_max_spares(len(self.parents)) if spares > max_spares: log.debug("failed to set new spares value %d (max is %d)", spares, max_spares) raise errors.DeviceError("new spares value is too large") if self.totalDevices > spares: self.memberDevices = self.totalDevices - spares spares = property(_getSpares, _setSpares) def _addParent(self, member): super(MDRaidArrayDevice, self)._addParent(member) if self.status and member.format.exists: # we always probe since the device may not be set up when we want # information about it self._size = self.currentSize # These should be incremented when adding new member devices except # during devicetree.populate. When detecting existing arrays we will # have gotten these values from udev and will use them to determine # whether we found all of the members, so we shouldn't change them in # that case. if not member.format.exists: self._totalDevices += 1 self.memberDevices += 1 def _removeParent(self, member): error_msg = self._validateParentRemoval(self.level, member) if error_msg: raise errors.DeviceError(error_msg) super(MDRaidArrayDevice, self)._removeParent(member) self.memberDevices -= 1 @property def _trueStatusStrings(self): """ Strings in state file for which status() should return True.""" return ("clean", "active", "active-idle", "readonly", "read-auto") @property def status(self): """ This device's status. For now, this should return a boolean: True the device is open and ready for use False the device is not open """ # check the status in sysfs status = False if not self.exists: return status if os.path.exists(self.path) and not self.sysfsPath: # the array has been activated from outside of blivet self.updateSysfsPath() # make sure the active array is the one we expect info = udev.get_device(self.sysfsPath) uuid = udev.device_get_md_uuid(info) if uuid and uuid != self.uuid: log.warning("md array %s is active, but has UUID %s -- not %s", self.path, uuid, self.uuid) self.sysfsPath = "" return status state_file = "%s/md/array_state" % self.sysfsPath try: state = open(state_file).read().strip() if state in self._trueStatusStrings: status = True except IOError: status = False return status def memberStatus(self, member): if not (self.status and member.status): return member_name = os.path.basename(member.sysfsPath) path = "/sys/%s/md/dev-%s/state" % (self.sysfsPath, member_name) try: state = open(path).read().strip() except IOError: state = None return state @property def degraded(self): """ Return True if the array is running in degraded mode. """ rc = False degraded_file = "%s/md/degraded" % self.sysfsPath if os.access(degraded_file, os.R_OK): val = open(degraded_file).read().strip() if val == "1": rc = True return rc @property def members(self): """ Returns this array's members. :rtype: list of :class:`StorageDevice` """ return list(self.parents) @property def complete(self): """ An MDRaidArrayDevice is complete if it has at least as many component devices as its count of active devices. """ return (self.memberDevices <= len(self.members)) or not self.exists @property def devices(self): """ Return a list of this array's member device instances. """ return self.parents def _postSetup(self): super(MDRaidArrayDevice, self)._postSetup() self.updateSysfsPath() def _setup(self, orig=False): """ Open, or set up, a device. """ log_method_call(self, self.name, orig=orig, status=self.status, controllable=self.controllable) disks = [] for member in self.devices: member.setup(orig=orig) disks.append(member.path) blockdev.md.activate(self.path, members=disks, uuid=self.mdadmFormatUUID) def _postTeardown(self, recursive=False): super(MDRaidArrayDevice, self)._postTeardown(recursive=recursive) # mdadm reuses minors indiscriminantly when there is no mdadm.conf, so # we need to clear the sysfs path now so our status method continues to # give valid results self.sysfsPath = '' def teardown(self, recursive=None): """ Close, or tear down, a device. """ log_method_call(self, self.name, status=self.status, controllable=self.controllable) # we don't really care about the return value of _preTeardown here. # see comment just above md_deactivate call self._preTeardown(recursive=recursive) # We don't really care what the array's state is. If the device # file exists, we want to deactivate it. mdraid has too many # states. if self.exists and os.path.exists(self.path): blockdev.md.deactivate(self.path) self._postTeardown(recursive=recursive) def _postCreate(self): # this is critical since our status method requires a valid sysfs path self.exists = True # this is needed to run updateSysfsPath self.updateSysfsPath() StorageDevice._postCreate(self) # update our uuid attribute with the new array's UUID # XXX this won't work for containers since no UUID is reported for them info = blockdev.md.detail(self.path) self.uuid = info.uuid for member in self.devices: member.format.mdUuid = self.uuid def _create(self): """ Create the device. """ log_method_call(self, self.name, status=self.status) disks = [disk.path for disk in self.devices] spares = len(self.devices) - self.memberDevices level = None if self.level: level = str(self.level) blockdev.md.create(self.path, level, disks, spares, version=self.metadataVersion, bitmap=self.createBitmap) udev.settle() def _remove(self, member): self.setup() # see if the device must be marked as failed before it can be removed fail = (self.memberStatus(member) == "in_sync") blockdev.md.remove(self.path, member.path, fail) def _add(self, member): """ Add a member device to an array. :param str member: the member's path :raises: blockdev.MDRaidError """ self.setup() raid_devices = None try: if not self.level.has_redundancy(): if self.level is not raid.Linear: raid_devices = int(blockdev.md.detail(self.name).raid_devices) + 1 except errors.RaidError: pass blockdev.md.add(self.path, member.path, raid_devs=raid_devices) @property def formatArgs(self): formatArgs = [] if self.format.type == "ext2": recommended_stride = self.level.get_recommended_stride(self.memberDevices) if recommended_stride: formatArgs = ['-R', 'stride=%d' % recommended_stride ] return formatArgs @property def model(self): return self.description def dracutSetupArgs(self): return set(["rd.md.uuid=%s" % self.mdadmFormatUUID]) def populateKSData(self, data): if self.isDisk: return super(MDRaidArrayDevice, self).populateKSData(data) data.level = self.level.name data.spares = self.spares data.members = ["raid.%d" % p.id for p in self.parents] data.preexist = self.exists data.device = self.name class MDContainerDevice(MDRaidArrayDevice): _type = "mdcontainer" def __init__(self, name, **kwargs): kwargs['level'] = raid.Container super(MDContainerDevice, self).__init__(name, **kwargs) @property def _levels(self): return mdraid.MDRaidLevels(["container"]) @property def description(self): return "BIOS RAID container" @property def mdadmConfEntry(self): uuid = self.mdadmFormatUUID if not uuid: raise errors.DeviceError("array is not fully defined", self.name) return "ARRAY %s UUID=%s\n" % (self.path, uuid) @property def _trueStatusStrings(self): return ("clean", "active", "active-idle", "readonly", "read-auto", "inactive") def teardown(self, recursive=None): log_method_call(self, self.name, status=self.status, controllable=self.controllable) # we don't really care about the return value of _preTeardown here. # see comment just above md_deactivate call self._preTeardown(recursive=recursive) # Since BIOS RAID sets (containers in mdraid terminology) never change # there is no need to stop them and later restart them. Not stopping # (and thus also not starting) them also works around bug 523334 return @property def mediaPresent(self): # Containers should not get any format handling done # (the device node does not allow read / write calls) return False class MDBiosRaidArrayDevice(MDRaidArrayDevice): _type = "mdbiosraidarray" _formatClassName = property(lambda s: None) _isDisk = True _partitionable = True def __init__(self, name, **kwargs): super(MDBiosRaidArrayDevice, self).__init__(name, **kwargs) # For container members probe size now, as we cannot determine it # when teared down. self._size = self.currentSize @property def size(self): # For container members return probed size, as we cannot determine it # when teared down. return self._size @property def description(self): levelstr = self.level.nick if self.level.nick else self.level.name return "BIOS RAID set (%s)" % levelstr @property def mdadmConfEntry(self): uuid = self.mdadmFormatUUID if not uuid: raise errors.DeviceError("array is not fully defined", self.name) return "ARRAY %s UUID=%s\n" % (self.path, uuid) @property def members(self): # If the array is a BIOS RAID array then its unique parent # is a container and its actual member devices are the # container's parents. return list(self.parents[0].parents) def teardown(self, recursive=None): log_method_call(self, self.name, status=self.status, controllable=self.controllable) # we don't really care about the return value of _preTeardown here. # see comment just above md_deactivate call self._preTeardown(recursive=recursive) # Since BIOS RAID sets (containers in mdraid terminology) never change # there is no need to stop them and later restart them. Not stopping # (and thus also not starting) them also works around bug 523334 return
dwlehman/blivet
blivet/devices/md.py
Python
lgpl-2.1
22,939
/*************************************************************************** * Copyright (C) 2013 by Jeroen Broekhuizen * * jengine.sse@live.nl * * * * This library 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 2.1 of the * * License, or (at your option) any later version. * * * * This library 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 Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef SPRITE_FACTORY_H #define SPRITE_FACTORY_H #include "core/core_base.h" #include <memory> namespace Graphics { class Device; } namespace c2d { class Sprite; class SpriteDefinition; class CORE_API SpriteFactory { public: static Sprite create(Graphics::Device& device, SpriteDefinition& definition); }; } #endif // SPRITE_FACTORY_H
crafter2d/crafter2d
src/core/graphics/sprites/spritefactory.h
C
lgpl-2.1
1,834
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 2.1 of * the License, or (at your option) any later version. * * This software 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 this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package com.xpn.xwiki.events; import javax.inject.Named; import javax.inject.Singleton; import org.xwiki.component.annotation.Component; /** * Descriptor for the {@link org.xwiki.bridge.event.DocumentCreatedEvent}. * * @version $Id$ * @since 9.2RC1 */ @Component @Singleton @Named(DocumentCreatedEventDescriptor.EVENT_TYPE) public class DocumentCreatedEventDescriptor extends AbstractXWikiRecordableEventDescriptor { /** * Name of the supported type (as it is stored in Activity Stream). */ public static final String EVENT_TYPE = "create"; /** * Construct a DocumentCreatedEventDescriptor. */ public DocumentCreatedEventDescriptor() { super("core.events.create.description", "core.events.appName"); } @Override public String getEventType() { // Match the name used by Activity Stream. return EVENT_TYPE; } @Override public EventFilter getFilter() { return EventFilter.WIKI_SPACE_AND_DOCUMENT_FILTER; } }
pbondoer/xwiki-platform
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/events/DocumentCreatedEventDescriptor.java
Java
lgpl-2.1
1,930
import { UiFinder, Waiter } from '@ephox/agar'; import { describe, it } from '@ephox/bedrock-client'; import { TinyHooks, TinyUiActions } from '@ephox/mcagar'; import { Focus, Insert, Remove, SugarBody, SugarElement } from '@ephox/sugar'; import Editor from 'tinymce/core/api/Editor'; import Theme from 'tinymce/themes/silver/Theme'; describe('browser.tinymce.themes.silver.editor.ToolbarPersistTest', () => { const hook = TinyHooks.bddSetup<Editor>({ inline: true, base_url: '/project/tinymce/js/tinymce', toolbar_persist: true }, [ Theme ]); const unfocusEditor = () => { const div = SugarElement.fromTag('input'); Insert.append(SugarBody.body(), div); Focus.focus(div); Remove.remove(div); }; it('TINY-4847: With toolbar_persist focus & unfocus should not affect toolbar visibility', async () => { const editor = hook.editor(); await TinyUiActions.pWaitForPopup(editor, '.tox-tinymce-inline'); unfocusEditor(); await Waiter.pWait(200); // Need to wait since nothing should happen. await TinyUiActions.pWaitForPopup(editor, '.tox-tinymce-inline'); editor.ui.hide(); await UiFinder.pWaitForHidden('Wait for editor to be hidden', SugarBody.body(), '.tox-tinymce-inline'); editor.focus(); editor.nodeChanged(); await Waiter.pWait(200); // Need to wait since nothing should happen. await UiFinder.pWaitForHidden('Wait for editor to be hidden', SugarBody.body(), '.tox-tinymce-inline'); editor.ui.show(); await TinyUiActions.pWaitForPopup(editor, '.tox-tinymce-inline'); }); });
TeamupCom/tinymce
modules/tinymce/src/themes/silver/test/ts/browser/editor/ToolbarPersistTest.ts
TypeScript
lgpl-2.1
1,575
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3.1"/> <title>Core3: CreateVendorSuiCallback Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Core3 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="class_create_vendor_sui_callback-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">CreateVendorSuiCallback Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="_create_vendor_sui_callback_8h_source.html">CreateVendorSuiCallback.h</a>&gt;</code></p> <div class="dynheader"> Inheritance diagram for CreateVendorSuiCallback:</div> <div class="dyncontent"> <div class="center"> <img src="class_create_vendor_sui_callback.png" usemap="#CreateVendorSuiCallback_map" alt=""/> <map id="CreateVendorSuiCallback_map" name="CreateVendorSuiCallback_map"> <area href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html" alt="server::zone::objects::player::sui::SuiCallback" shape="rect" coords="0,56,265,80"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a7e6eb825e16f8ed4a789e2c3d128d0ca"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_create_vendor_sui_callback.html#a7e6eb825e16f8ed4a789e2c3d128d0ca">CreateVendorSuiCallback</a> (<a class="el" href="classserver_1_1zone_1_1_zone_server.html">ZoneServer</a> *<a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html#ac34216449614d4462589bd1486b0c0a1">server</a>)</td></tr> <tr class="separator:a7e6eb825e16f8ed4a789e2c3d128d0ca"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a864781bbb70e687759d54812fed8d378"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_create_vendor_sui_callback.html#a864781bbb70e687759d54812fed8d378">run</a> (<a class="el" href="classserver_1_1zone_1_1objects_1_1creature_1_1_creature_object.html">CreatureObject</a> *player, <a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_box.html">SuiBox</a> *suiBox, bool cancelPressed, Vector&lt; UnicodeString &gt; *args)</td></tr> <tr class="separator:a864781bbb70e687759d54812fed8d378"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html">server::zone::objects::player::sui::SuiCallback</a></td></tr> <tr class="memitem:ab92d75a9b04756c766191964ee587167 inherit pub_methods_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html#ab92d75a9b04756c766191964ee587167">SuiCallback</a> (<a class="el" href="classserver_1_1zone_1_1_zone_server.html">ZoneServer</a> *serv)</td></tr> <tr class="separator:ab92d75a9b04756c766191964ee587167 inherit pub_methods_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pro_attribs_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html">server::zone::objects::player::sui::SuiCallback</a></td></tr> <tr class="memitem:ac34216449614d4462589bd1486b0c0a1 inherit pro_attribs_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback"><td class="memItemLeft" align="right" valign="top">ManagedReference&lt; <a class="el" href="classserver_1_1zone_1_1_zone_server.html">ZoneServer</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html#ac34216449614d4462589bd1486b0c0a1">server</a></td></tr> <tr class="separator:ac34216449614d4462589bd1486b0c0a1 inherit pro_attribs_classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"> <p>Definition at line <a class="el" href="_create_vendor_sui_callback_8h_source.html#l00015">15</a> of file <a class="el" href="_create_vendor_sui_callback_8h_source.html">CreateVendorSuiCallback.h</a>.</p> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a7e6eb825e16f8ed4a789e2c3d128d0ca"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">CreateVendorSuiCallback::CreateVendorSuiCallback </td> <td>(</td> <td class="paramtype"><a class="el" href="classserver_1_1zone_1_1_zone_server.html">ZoneServer</a> *&#160;</td> <td class="paramname"><em>server</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Definition at line <a class="el" href="_create_vendor_sui_callback_8h_source.html#l00017">17</a> of file <a class="el" href="_create_vendor_sui_callback_8h_source.html">CreateVendorSuiCallback.h</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a864781bbb70e687759d54812fed8d378"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void CreateVendorSuiCallback::run </td> <td>(</td> <td class="paramtype"><a class="el" href="classserver_1_1zone_1_1objects_1_1creature_1_1_creature_object.html">CreatureObject</a> *&#160;</td> <td class="paramname"><em>player</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_box.html">SuiBox</a> *&#160;</td> <td class="paramname"><em>suiBox</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>cancelPressed</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Vector&lt; UnicodeString &gt; *&#160;</td> <td class="paramname"><em>args</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">player</td><td>The player that this suibox is assigned to. </td></tr> <tr><td class="paramname">suiBox</td><td>The actual SuiBox object. </td></tr> <tr><td class="paramname">cancelPressed</td><td>Was the cancel button pressed, or was the sui box closed via a similar method. (this might actually be more of a dialogResult type variable) </td></tr> <tr><td class="paramname">args</td><td>A vector of UnicodeStrings containing the arguments passed to the sui box from the client. </td></tr> </table> </dd> </dl> <p>Implements <a class="el" href="classserver_1_1zone_1_1objects_1_1player_1_1sui_1_1_sui_callback.html#a518cc139dba7f7f30a5ca367e8a61686">server::zone::objects::player::sui::SuiCallback</a>.</p> <p>Definition at line <a class="el" href="_create_vendor_sui_callback_8h_source.html#l00021">21</a> of file <a class="el" href="_create_vendor_sui_callback_8h_source.html">CreateVendorSuiCallback.h</a>.</p> <p>References <a class="el" href="_create_vendor_session_8cpp_source.html#l00050">server::zone::objects::player::sessions::vendor::CreateVendorSession::cancelSession()</a>, <a class="el" href="_session_facade_type_8h_source.html#l00017">SessionFacadeType::CREATEVENDOR</a>, <a class="el" href="server_2zone_2objects_2scene_2_scene_object_8cpp_source.html#l01012">server::zone::objects::scene::SceneObject::getActiveSession()</a>, <a class="el" href="_sui_list_box_8cpp_source.html#l00092">server::zone::objects::player::sui::listbox::SuiListBox::getMenuObjectID()</a>, and <a class="el" href="_sui_box_8cpp_source.html#l00302">server::zone::objects::player::sui::SuiBox::isListBox()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>/Users/victor/git/Core3Mda/MMOCoreORB/src/server/zone/objects/player/sessions/vendor/sui/<a class="el" href="_create_vendor_sui_callback_8h_source.html">CreateVendorSuiCallback.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Oct 15 2013 17:29:24 for Core3 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.3.1 </small></address> </body> </html>
kidaa/Awakening-Core3
doc/html/class_create_vendor_sui_callback.html
HTML
lgpl-3.0
11,752
<?php class H_Bis { //put your code here } ?>
lunarnet76/CRUDsader
project/Testold/Parts/Fakelib/NoNamespace/H/Bis.php
PHP
lgpl-3.0
50
<?php namespace app\modules\Disqus; use Morrow\Factory; use Morrow\Debug; class _Default extends Factory { public function __construct() { } }
MINISTRYGmbH/morrow-docs
modules/Disqus/_Default.php
PHP
lgpl-3.0
147
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Data filter converting CSTBox v2 event logs to v3 format. Usage: ./cbx-2to3.py < /path/to/input/file > /path/to/output/file """ __author__ = 'Eric Pascual - CSTB (eric.pascual@cstb.fr)' import fileinput import json for line in fileinput.input(): ts, var_type, var_name, value, data = line.split('\t') # next 3 lines are specific to Actility box at home files conversion if var_name.startswith('home.'): var_name = var_name[5:] var_name = '.'.join((var_type, var_name)) data = data.strip().strip('{}') if data: pairs = data.split(',') data = json.dumps(dict([(k.lower(), v) for k, v in (pair.split('=') for pair in pairs)])) else: data = "{}" print('\t'.join((ts, var_type, var_name, value, data)))
cstbox/devel
bin/cbx-2to3.py
Python
lgpl-3.0
821
/*- * #%L * Mathematical morphology library and plugins for ImageJ/Fiji. * %% * Copyright (C) 2014 - 2017 INRA. * %% * This program 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. * * This program 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 General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ package inra.ijpb.data.border; import java.awt.Point; import ij.process.ImageProcessor; /** * Periodic border that considers image is mirrored indefinitely in all * directions. * @author David Legland * */ public class MirroringBorder implements BorderManager { ImageProcessor image; /** * Creates a new Mirroring Border Manager * * @param image * the image to expand */ public MirroringBorder(ImageProcessor image) { this.image = image; } /** * @see inra.ijpb.data.border.BorderManager#get(int, int) */ @Override public int get(int x, int y) { Point p = computeCoords(x, y); return this.image.get(p.x, p.y); } @Override public float getf(int x, int y) { Point p = computeCoords(x, y); return this.image.getf(p.x, p.y); } private Point computeCoords(int x, int y) { int width = this.image.getWidth(); int height = this.image.getHeight(); x = x % (2 * width); y = y % (2 * height); if (x < 0) x = -x - 1; if (y < 0) y = -y - 1; if (x >= width) x = 2 * width - 1 - x; if (y >= height) y = 2 * height - 1 - y; return new Point(x, y); } }
ijpb/MorphoLibJ
src/main/java/inra/ijpb/data/border/MirroringBorder.java
Java
lgpl-3.0
1,948
#ifndef QINPUTMETHODEVENT #define QINPUTMETHODEVENT class DummyQInputMethodEvent : public DummyQEvent { // Q_OBJECT; public: knh_RawPtr_t *self; std::map<std::string, knh_Func_t *> *event_map; std::map<std::string, knh_Func_t *> *slot_map; DummyQInputMethodEvent(); virtual ~DummyQInputMethodEvent(); void setSelf(knh_RawPtr_t *ptr); bool eventDispatcher(QEvent *event); bool addEvent(knh_Func_t *callback_func, std::string str); bool signalConnect(knh_Func_t *callback_func, std::string str); knh_Object_t** reftrace(CTX ctx, knh_RawPtr_t *p FTRARG); void connection(QObject *o); }; class KQInputMethodEvent : public QInputMethodEvent { // Q_OBJECT; public: int magic_num; knh_RawPtr_t *self; DummyQInputMethodEvent *dummy; KQInputMethodEvent(); ~KQInputMethodEvent(); void setSelf(knh_RawPtr_t *ptr); }; #endif //QINPUTMETHODEVENT
imasahiro/konohascript
package/konoha.qt4/include/KQInputMethodEvent.hpp
C++
lgpl-3.0
854
<?php namespace Znerol\Component\Stringprep\Profile; use Znerol\Component\Stringprep\Profile; /** * XMPP PolicyMIB profile for stringprep defined in RFC 4011, Section 9.1.1 */ class PolicyMIB extends Profile { /** * Use RFC3454 table B.1 */ protected $removeZWS = true; /** * No casefolding */ protected $casefold = self::CASEFOLD_NONE; /** * The Unicode normalization used: Form KC */ protected $normalize = self::NORM_NFKC; /** * Prohibited output */ protected $prohibit = array( self::PROHIBIT_C_2_1, self::PROHIBIT_C_2_2, self::PROHIBIT_C_3, self::PROHIBIT_C_4, self::PROHIBIT_C_5, self::PROHIBIT_C_6, self::PROHIBIT_C_7, self::PROHIBIT_C_8, self::PROHIBIT_C_9 ); /** * Bidirectional character handling: not performed */ protected $checkbidi = false; }
znerol/Stringprep
Profile/PolicyMIB.php
PHP
lgpl-3.0
853
from typing import Callable, Any from ..model import MetaEvent, Event from ..exceptions import PropertyStatechartError __all__ = ['InternalEventListener', 'PropertyStatechartListener'] class InternalEventListener: """ Listener that filters and propagates internal events as external events. """ def __init__(self, callable: Callable[[Event], Any]) -> None: self._callable = callable def __call__(self, event: MetaEvent) -> None: if event.name == 'event sent': self._callable(Event(event.event.name, **event.event.data)) class PropertyStatechartListener: """ Listener that propagates meta-events to given property statechart, executes the property statechart, and checks it. """ def __init__(self, interpreter) -> None: self._interpreter = interpreter def __call__(self, event: MetaEvent) -> None: self._interpreter.queue(event) self._interpreter.execute() if self._interpreter.final: raise PropertyStatechartError(self._interpreter)
AlexandreDecan/sismic
sismic/interpreter/listener.py
Python
lgpl-3.0
1,061
using System.ComponentModel.DataAnnotations.Schema; namespace TrackerEnabledDbContext.Common.Testing.Models { [Table("ModelWithCustomTableAndColumnNames")] public class TrackedModelWithCustomTableAndColumnNames { public long Id { get; set; } [Column("MagnitudeOfForce")] public int Magnitude { get; set; } public string Direction { get; set; } public string Subject { get; set; } } }
bilal-fazlani/tracker-enabled-dbcontext
TrackerEnabledDbContext.Common.Testing/Models/TrackedModelWithCustomTableAndColumnNames.cs
C#
lgpl-3.0
447
/* * This file is part of the libusbhost library * hosted at http://github.com/libusbhost/libusbhost * * Copyright (C) 2015 Amir Hammad <amir.hammad@hotmail.com> * * * libusbhost 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. * * This library 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 this library. If not, see <http://www.gnu.org/licenses/>. * */ #include "usbh_driver_hub_private.h" #include "driver/usbh_device_driver.h" #include "usart_helpers.h" #include "usbh_config.h" #include <stddef.h> #include <stdint.h> static hub_device_t hub_device[USBH_MAX_HUBS]; static bool initialized = false; void hub_driver_init(void) { uint32_t i; initialized = true; for (i = 0; i < USBH_MAX_HUBS; i++) { hub_device[i].device[0] = 0; hub_device[i].ports_num = 0; hub_device[i].current_port = CURRENT_PORT_NONE; } } static void *init(usbh_device_t *usbh_dev) { if (!initialized) { LOG_PRINTF("\n%s/%d : driver not initialized\n", __FILE__, __LINE__); return 0; } uint32_t i; hub_device_t *drvdata = NULL; // find free data space for hub device for (i = 0; i < USBH_MAX_HUBS; i++) { if (hub_device[i].device[0] == 0) { break; } } LOG_PRINTF("{%d}",i); if (i == USBH_MAX_HUBS) { LOG_PRINTF("Unable to initialize hub driver"); return 0; } drvdata = &hub_device[i]; drvdata->state = EVENT_STATE_NONE; drvdata->ports_num = 0; drvdata->device[0] = usbh_dev; drvdata->busy = 0; drvdata->endpoint_in_address = 0; drvdata->endpoint_in_maxpacketsize = 0; return drvdata; } /** * @returns true if all needed data are parsed */ static bool analyze_descriptor(void *drvdata, void *descriptor) { hub_device_t *hub = (hub_device_t *)drvdata; uint8_t desc_type = ((uint8_t *)descriptor)[1]; switch (desc_type) { case USB_DT_ENDPOINT: { struct usb_endpoint_descriptor *ep = (struct usb_endpoint_descriptor *)descriptor; if ((ep->bmAttributes&0x03) == USB_ENDPOINT_ATTR_INTERRUPT) { uint8_t epaddr = ep->bEndpointAddress; if (epaddr & (1<<7)) { hub->endpoint_in_address = epaddr&0x7f; hub->endpoint_in_maxpacketsize = ep->wMaxPacketSize; } } LOG_PRINTF("ENDPOINT DESCRIPTOR FOUND\n"); } break; case USB_DT_HUB: { struct usb_hub_descriptor *desc = (struct usb_hub_descriptor *)descriptor; if ( desc->head.bNbrPorts <= USBH_HUB_MAX_DEVICES) { hub->ports_num = desc->head.bNbrPorts; } else { LOG_PRINTF("INCREASE NUMBER OF ENABLED PORTS\n"); hub->ports_num = USBH_HUB_MAX_DEVICES; } LOG_PRINTF("HUB DESCRIPTOR FOUND \n"); } break; default: LOG_PRINTF("TYPE: %02X \n",desc_type); break; } if (hub->endpoint_in_address) { hub->state = EVENT_STATE_INITIAL; LOG_PRINTF("end enum"); return true; } return false; } // Enumerate static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) { hub_device_t *hub = (hub_device_t *)dev->drvdata; LOG_PRINTF("\nHUB->STATE = %d\n", hub->state); switch (hub->state) { case EVENT_STATE_POLL: switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { uint8_t i; uint8_t *buf = hub->buffer; uint32_t psc = 0; // Limit: up to 4 bytes... for (i = 0; i < cb_data.transferred_length; i++) { psc += buf[i] << (i*8); } int8_t port = 0; LOG_PRINTF("psc:%d\n",psc); // Driver error... port not found if (!psc) { // Continue reading status change endpoint hub->state = EVENT_STATE_POLL_REQ; break; } for (i = 0; i <= hub->ports_num; i++) { if (psc & (1<<i)) { port = i; psc = 0; break; } } if (hub->current_port >= 1) { if (hub->current_port != port) { LOG_PRINTF("X"); hub->state = EVENT_STATE_POLL_REQ; break; } } struct usb_setup_data setup_data; // If regular port event, else hub event if (port) { setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; } else { setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE; } setup_data.bRequest = USB_REQ_GET_STATUS; setup_data.wValue = 0; setup_data.wIndex = port; setup_data.wLength = 4; hub->state = EVENT_STATE_GET_STATUS_COMPLETE; hub->current_port = port; LOG_PRINTF("\n\nPORT FOUND: %d\n", port); device_control(dev, event, &setup_data, &hub->hub_and_port_status[port]); } break; default: ERROR(cb_data.status); hub->state = EVENT_STATE_NONE; break; case USBH_PACKET_CALLBACK_STATUS_EAGAIN: // In case of EAGAIN error, retry read on status endpoint hub->state = EVENT_STATE_POLL_REQ; LOG_PRINTF("HUB: Retrying...\n"); break; } break; case EVENT_STATE_READ_HUB_DESCRIPTOR_COMPLETE:// Hub descriptor found { switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { struct usb_hub_descriptor *hub_descriptor = (struct usb_hub_descriptor *)hub->buffer; // Check size if (hub_descriptor->head.bDescLength > hub->desc_len) { struct usb_setup_data setup_data; hub->desc_len = hub_descriptor->head.bDescLength; setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE; setup_data.bRequest = USB_REQ_GET_DESCRIPTOR; setup_data.wValue = 0x29<<8; setup_data.wIndex = 0; setup_data.wLength = hub->desc_len; hub->state = EVENT_STATE_READ_HUB_DESCRIPTOR_COMPLETE; device_control(dev, event, &setup_data, hub->buffer); break; } else if (hub_descriptor->head.bDescLength == hub->desc_len) { hub->ports_num = hub_descriptor->head.bNbrPorts; hub->state = EVENT_STATE_ENABLE_PORTS; hub->index = 0; cb_data.status = USBH_PACKET_CALLBACK_STATUS_OK; event(dev, cb_data); } else { //try again } } break; case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: { LOG_PRINTF("->\t\t\t\t\t ERRSIZ: deschub\n"); struct usb_hub_descriptor*hub_descriptor = (struct usb_hub_descriptor *)hub->buffer; if (cb_data.transferred_length >= sizeof(struct usb_hub_descriptor_head)) { if (cb_data.transferred_length == hub_descriptor->head.bDescLength) { // Process HUB descriptor if ( hub_descriptor->head.bNbrPorts <= USBH_HUB_MAX_DEVICES) { hub->ports_num = hub_descriptor->head.bNbrPorts; } else { LOG_PRINTF("INCREASE NUMBER OF ENABLED PORTS\n"); hub->ports_num = USBH_HUB_MAX_DEVICES; } hub->state = EVENT_STATE_ENABLE_PORTS; hub->index = 0; cb_data.status = USBH_PACKET_CALLBACK_STATUS_OK; event(dev, cb_data); } } } break; default: ERROR(cb_data.status); break; } } break; case EVENT_STATE_ENABLE_PORTS:// enable ports { switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: if (hub->index < hub->ports_num) { hub->index++; struct usb_setup_data setup_data; LOG_PRINTF("[!%d!]",hub->index); setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; setup_data.bRequest = HUB_REQ_SET_FEATURE; setup_data.wValue = HUB_FEATURE_PORT_POWER; setup_data.wIndex = hub->index; setup_data.wLength = 0; device_control(dev, event, &setup_data, 0); } else { // TODO: // Delay Based on hub descriptor field bPwr2PwrGood // delay_ms_busy_loop(200); LOG_PRINTF("\nHUB CONFIGURED & PORTS POWERED\n"); // get device status struct usb_setup_data setup_data; setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE; setup_data.bRequest = USB_REQ_GET_STATUS; setup_data.wValue = 0; setup_data.wIndex = 0; setup_data.wLength = 4; hub->state = EVENT_STATE_GET_PORT_STATUS; hub->index = 0; device_control(dev, event, &setup_data, hub->buffer); } break; default: ERROR(cb_data.status); break; } } break; case EVENT_STATE_GET_PORT_STATUS: { switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { if (hub->index < hub->ports_num) { //TODO: process data contained in hub->buffer struct usb_setup_data setup_data; setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; setup_data.bRequest = USB_REQ_GET_STATUS; setup_data.wValue = 0; setup_data.wIndex = ++hub->index; setup_data.wLength = 4; hub->state = EVENT_STATE_GET_PORT_STATUS; device_control(dev, event, &setup_data, hub->buffer); } else { hub->busy = 0; hub->state = EVENT_STATE_POLL_REQ; } } break; default: ERROR(cb_data.status); break; } } break; case EVENT_STATE_GET_STATUS_COMPLETE: { switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { int8_t port = hub->current_port; LOG_PRINTF("|%d",port); // Get Port status, else Get Hub status if (port) { uint16_t stc = hub->hub_and_port_status[port].stc; // Connection status changed if (stc & (1<<HUB_FEATURE_PORT_CONNECTION)) { // Check, whether device is in connected state if (!hub->device[port]) { if (!usbh_enum_available() || hub->busy) { LOG_PRINTF("\n\t\t\tCannot enumerate %d %d\n", !usbh_enum_available(), hub->busy); hub->state = EVENT_STATE_POLL_REQ; break; } } // clear feature C_PORT_CONNECTION struct usb_setup_data setup_data; setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; setup_data.bRequest = HUB_REQ_CLEAR_FEATURE; setup_data.wValue = HUB_FEATURE_C_PORT_CONNECTION; setup_data.wIndex = port; setup_data.wLength = 0; hub->state = EVENT_STATE_PORT_RESET_REQ; device_control(dev, event, &setup_data, 0); } else if(stc & (1<<HUB_FEATURE_PORT_RESET)) { // clear feature C_PORT_RESET // Reset processing is complete, enumerate device struct usb_setup_data setup_data; setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; setup_data.bRequest = HUB_REQ_CLEAR_FEATURE; setup_data.wValue = HUB_FEATURE_C_PORT_RESET; setup_data.wIndex = port; setup_data.wLength = 0; hub->state = EVENT_STATE_PORT_RESET_COMPLETE; LOG_PRINTF("RESET"); device_control(dev, event, &setup_data, 0); } else { LOG_PRINTF("another STC %d\n", stc); } } else { hub->state = EVENT_STATE_POLL_REQ; LOG_PRINTF("HUB status change\n"); } } break; default: ERROR(cb_data.status); // continue hub->state = EVENT_STATE_POLL_REQ; break; } } break; case EVENT_STATE_PORT_RESET_REQ: { switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { int8_t port = hub->current_port; uint16_t stc = hub->hub_and_port_status[port].stc; if (!hub->device[port]) { if ((stc) & (1<<HUB_FEATURE_PORT_CONNECTION)) { struct usb_setup_data setup_data; setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; setup_data.bRequest = HUB_REQ_SET_FEATURE; setup_data.wValue = HUB_FEATURE_PORT_RESET; setup_data.wIndex = port; setup_data.wLength = 0; hub->state = EVENT_STATE_GET_PORT_STATUS; LOG_PRINTF("CONN"); hub->busy = 1; device_control(dev, event, &setup_data, 0); } } else { LOG_PRINTF("\t\t\t\tDISCONNECT EVENT\n"); device_remove(hub->device[port]); hub->device[port] = 0; hub->current_port = CURRENT_PORT_NONE; hub->state = EVENT_STATE_POLL_REQ; hub->busy = 0; } } break; default: ERROR(cb_data.status); // continue hub->state = EVENT_STATE_POLL_REQ; break; } } break; case EVENT_STATE_PORT_RESET_COMPLETE: // RESET COMPLETE, start enumeration { switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { LOG_PRINTF("\nPOLL\n"); int8_t port = hub->current_port; uint16_t sts = hub->hub_and_port_status[port].sts; if (sts & (1<<HUB_FEATURE_PORT_ENABLE)) { hub->device[port] = usbh_get_free_device(dev); if (!hub->device[port]) { LOG_PRINTF("\nFATAL ERROR\n"); return;// DEAD END } if ((sts & (1<<(HUB_FEATURE_PORT_LOWSPEED))) && !(sts & (1<<(HUB_FEATURE_PORT_HIGHSPEED)))) { #define DISABLE_LOW_SPEED #ifdef DISABLE_LOW_SPEED LOG_PRINTF("Low speed device"); // Disable Low speed device immediately struct usb_setup_data setup_data; setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT; setup_data.bRequest = HUB_REQ_CLEAR_FEATURE; setup_data.wValue = HUB_FEATURE_PORT_ENABLE; setup_data.wIndex = port; setup_data.wLength = 0; // After write process another devices, poll for events //Expecting all ports are powered (constant/non-changeable after init) hub->state = EVENT_STATE_GET_PORT_STATUS; hub->current_port = CURRENT_PORT_NONE; device_control(dev, event, &setup_data, 0); #else hub->device[port]->speed = USBH_SPEED_LOW; LOG_PRINTF("Low speed device"); hub->timestamp_us = hub->time_curr_us; hub->state = EVENT_STATE_SLEEP_500_MS; // schedule wait for 500ms #endif } else if (!(sts & (1<<(HUB_FEATURE_PORT_LOWSPEED))) && !(sts & (1<<(HUB_FEATURE_PORT_HIGHSPEED)))) { hub->device[port]->speed = USBH_SPEED_FULL; LOG_PRINTF("Full speed device"); hub->timestamp_us = hub->time_curr_us; hub->state = EVENT_STATE_SLEEP_500_MS; // schedule wait for 500ms } } else { LOG_PRINTF("%s:%d Do not know what to do, when device is disabled after reset\n", __FILE__, __LINE__); hub->state = EVENT_STATE_POLL_REQ; return; } } break; default: ERROR(cb_data.status); // continue hub->state = EVENT_STATE_POLL_REQ; break; } } break; default: LOG_PRINTF("UNHANDLED EVENT %d\n",hub->state); break; } } static void read_ep1(void *drvdata) { hub_device_t *hub = (hub_device_t *)drvdata; usbh_packet_t packet; packet.address = hub->device[0]->address; packet.data.in = hub->buffer; packet.datalen = hub->endpoint_in_maxpacketsize; packet.endpoint_address = hub->endpoint_in_address; packet.endpoint_size_max = hub->endpoint_in_maxpacketsize; packet.endpoint_type = USBH_ENDPOINT_TYPE_INTERRUPT; packet.speed = hub->device[0]->speed; packet.callback = event; packet.callback_arg = hub->device[0]; packet.toggle = &hub->endpoint_in_toggle; hub->state = EVENT_STATE_POLL; usbh_read(hub->device[0], &packet); LOG_PRINTF("@hub %d/EP1 | \n", hub->device[0]->address); } /** * @param time_curr_us - monotically rising time * unit is microseconds * @see usbh_poll() */ static void poll(void *drvdata, uint32_t time_curr_us) { hub_device_t *hub = (hub_device_t *)drvdata; usbh_device_t *dev = hub->device[0]; hub->time_curr_us = time_curr_us; switch (hub->state) { case EVENT_STATE_POLL_REQ: { if (usbh_enum_available()) { read_ep1(hub); } else { LOG_PRINTF("enum not available\n"); } } break; case EVENT_STATE_INITIAL: { if (hub->ports_num) { hub->index = 0; hub->state = EVENT_STATE_ENABLE_PORTS; LOG_PRINTF("No need to get HUB DESC\n"); event(dev, (usbh_packet_callback_data_t){0, 0}); } else { hub->endpoint_in_toggle = 0; struct usb_setup_data setup_data; hub->desc_len = hub->device[0]->packet_size_max0; setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE; setup_data.bRequest = USB_REQ_GET_DESCRIPTOR; setup_data.wValue = 0x29 << 8; setup_data.wIndex = 0; setup_data.wLength = hub->desc_len; hub->state = EVENT_STATE_READ_HUB_DESCRIPTOR_COMPLETE; device_control(dev, event, &setup_data, hub->buffer); LOG_PRINTF("DO Need to get HUB DESC\n"); } } break; case EVENT_STATE_SLEEP_500_MS: if (hub->time_curr_us - hub->timestamp_us > 500000) { int8_t port = hub->current_port; LOG_PRINTF("PORT: %d\n", port); LOG_PRINTF("NEW device at address: %d\n", hub->device[port]->address); hub->device[port]->lld = hub->device[0]->lld; device_enumeration_start(hub->device[port]); hub->current_port = CURRENT_PORT_NONE; // Maybe error, when assigning address is taking too long // // Detail: // USB hub cannot enable another port while the device // the current one is also in address state (has address==0) // Only one device on bus can have address==0 hub->busy = 0; hub->state = EVENT_STATE_POLL_REQ; } break; default: break; } if (usbh_enum_available()) { uint32_t i; for (i = 1; i < USBH_HUB_MAX_DEVICES + 1; i++) { if (hub->device[i]) { if (hub->device[i]->drv && hub->device[i]->drvdata) { hub->device[i]->drv->poll(hub->device[i]->drvdata, time_curr_us); } } } } } static void remove(void *drvdata) { hub_device_t *hub = (hub_device_t *)drvdata; uint8_t i; hub->state = EVENT_STATE_NONE; hub->endpoint_in_address = 0; hub->busy = 0; for (i = 0; i < USBH_HUB_MAX_DEVICES + 1; i++) { hub->device[i] = 0; } } static const usbh_dev_driver_info_t driver_info = { .deviceClass = 0x09, .deviceSubClass = -1, .deviceProtocol = -1, .idVendor = -1, .idProduct = -1, .ifaceClass = 0x09, .ifaceSubClass = -1, .ifaceProtocol = -1 }; const usbh_dev_driver_t usbh_hub_driver = { .init = init, .analyze_descriptor = analyze_descriptor, .poll = poll, .remove = remove, .info = &driver_info };
libusbhost/libusbhost
src/usbh_driver_hub.c
C
lgpl-3.0
19,007
include $(GOROOT)/src/Make.inc TARG=launchpad.net/goamz/aws GOFILES=\ aws.go\ include $(GOROOT)/src/Make.pkg GOFMT=gofmt BADFMT=$(shell $(GOFMT) -l $(GOFILES) $(wildcard *_test.go) 2> /dev/null) gofmt: $(BADFMT) @for F in $(BADFMT); do $(GOFMT) -w $$F && echo $$F; done ifneq ($(BADFMT),) ifneq ($(MAKECMDGOALS),gofmt) #$(warning WARNING: make gofmt: $(BADFMT)) endif endif
usiegj00/goamz-aws
Makefile
Makefile
lgpl-3.0
382
<?php /* * * ____ _ _ __ __ _ __ __ ____ * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \ * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) | * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/ * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_| * * This program 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. * * @author PocketMine Team * @link http://www.pocketmine.net/ * * */ declare(strict_types=1); namespace pocketmine\item; use pocketmine\block\Block; use pocketmine\block\tile\Banner as TileBanner; use pocketmine\block\utils\BannerPatternLayer; use pocketmine\block\utils\DyeColor; use pocketmine\data\bedrock\BannerPatternTypeIdMap; use pocketmine\data\bedrock\DyeColorIdMap; use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\ListTag; use function count; class Banner extends ItemBlockWallOrFloor{ public const TAG_PATTERNS = TileBanner::TAG_PATTERNS; public const TAG_PATTERN_COLOR = TileBanner::TAG_PATTERN_COLOR; public const TAG_PATTERN_NAME = TileBanner::TAG_PATTERN_NAME; /** @var DyeColor */ private $color; /** * @var BannerPatternLayer[] * @phpstan-var list<BannerPatternLayer> */ private $patterns = []; public function __construct(ItemIdentifier $identifier, Block $floorVariant, Block $wallVariant){ parent::__construct($identifier, $floorVariant, $wallVariant); $this->color = DyeColor::BLACK(); } public function getColor() : DyeColor{ return $this->color; } /** @return $this */ public function setColor(DyeColor $color) : self{ $this->color = $color; return $this; } public function getMeta() : int{ return DyeColorIdMap::getInstance()->toInvertedId($this->color); } /** * @return BannerPatternLayer[] * @phpstan-return list<BannerPatternLayer> */ public function getPatterns() : array{ return $this->patterns; } /** * @param BannerPatternLayer[] $patterns * * @phpstan-param list<BannerPatternLayer> $patterns * * @return $this */ public function setPatterns(array $patterns) : self{ $this->patterns = $patterns; return $this; } public function getFuelTime() : int{ return 300; } protected function deserializeCompoundTag(CompoundTag $tag) : void{ parent::deserializeCompoundTag($tag); $this->patterns = []; $colorIdMap = DyeColorIdMap::getInstance(); $patternIdMap = BannerPatternTypeIdMap::getInstance(); $patterns = $tag->getListTag(self::TAG_PATTERNS); if($patterns !== null){ /** @var CompoundTag $t */ foreach($patterns as $t){ $patternColor = $colorIdMap->fromInvertedId($t->getInt(self::TAG_PATTERN_COLOR)) ?? DyeColor::BLACK(); //TODO: missing pattern colour should be an error $patternType = $patternIdMap->fromId($t->getString(self::TAG_PATTERN_NAME)); if($patternType === null){ continue; //TODO: this should be an error } $this->patterns[] = new BannerPatternLayer($patternType, $patternColor); } } } protected function serializeCompoundTag(CompoundTag $tag) : void{ parent::serializeCompoundTag($tag); if(count($this->patterns) > 0){ $patterns = new ListTag(); $colorIdMap = DyeColorIdMap::getInstance(); $patternIdMap = BannerPatternTypeIdMap::getInstance(); foreach($this->patterns as $pattern){ $patterns->push(CompoundTag::create() ->setString(self::TAG_PATTERN_NAME, $patternIdMap->toId($pattern->getType())) ->setInt(self::TAG_PATTERN_COLOR, $colorIdMap->toInvertedId($pattern->getColor())) ); } $tag->setTag(self::TAG_PATTERNS, $patterns); }else{ $tag->removeTag(self::TAG_PATTERNS); } } }
pmmp/PocketMine-MP
src/item/Banner.php
PHP
lgpl-3.0
3,873
package nc.noumea.mairie.appock.event; /*- * #%L * Logiciel de Gestion des approvisionnements et des stocks des fournitures administratives de la Mairie de Nouméa * %% * Copyright (C) 2017 Mairie de Nouméa, Nouvelle-Calédonie * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ import org.junit.Assert; import org.junit.Test; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests; import nc.noumea.mairie.appock.core.security.AppUser; @ContextConfiguration(locations = { "/META-INF/spring/applicationContext-test.xml" }) public class RechargeOngletAbstractEntityEventTest extends AbstractTransactionalJUnit4SpringContextTests { @Test public void constructorEtGetter() { AppUser appUser = new AppUser(); RechargeOngletAbstractEntityEvent event = new RechargeOngletAbstractEntityEvent(appUser, null, null); Assert.assertEquals(event.getAbstractEntity(), appUser); } }
DSI-Ville-Noumea/appock
src/test/java/nc/noumea/mairie/appock/event/RechargeOngletAbstractEntityEventTest.java
Java
lgpl-3.0
1,617
{-# LANGUAGE RecordWildCards #-} -- | 'Ktx' is the only format can handle all sorts of textures available -- among OpenGL [ES] implementations. This library holds any Texture as 'Ktx' -- internally. module Graphics.TextureContainer.KTX where import Control.Applicative import Control.Exception import Control.Monad import qualified Data.ByteString as B import Data.Packer import Data.Word -- | Khronos Texture Container Format -- -- Spec: <http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/> data Ktx = Ktx { ktxName :: FilePath -- ^ Debug purpose , ktxContent :: B.ByteString -- ^ Holding the original ForeignPtr. , ktxGlType :: Word32 , ktxGlTypeSize :: Word32 , ktxGlFormat :: Word32 , ktxGlInternalFormat :: Word32 , ktxGlBaseInternalFormat :: Word32 , ktxPixelWidth :: Word32 , ktxPixelHeight :: Word32 , ktxPixelDepth :: Word32 , ktxNumElems :: Word32 , ktxNumFaces :: Word32 , ktxNumMipLevels :: Word32 , ktxMap :: [(B.ByteString, B.ByteString)] -- ^ \[(utf8 string, any)] -- Note that if the value is utf8, it includes NULL terminator. , ktxImage :: [[B.ByteString]] } deriving Show -- | 'Unpacking' instance. unpackKtx :: FilePath -> B.ByteString -> Unpacking Ktx unpackKtx name orig = do let w = getWord32 -- '«', 'K', 'T', 'X', ' ', '1', '1', '»', '\r', '\n', '\x1A', '\n' (0x58544BAB, 0xBB313120, 0x0A1A0A0D) <- (,,) <$> w <*> w <*> w -- Endianness -- Assuming Big-endian is a loser of history, just ignore it. -- Note: All modern platforms (Android, iOS, Windows, ...) -- runs Little-endian nevertheless the processor is bi-endian. 0x04030201 <- getWord32 ktx <- Ktx name orig <$> w <*> w <*> w <*> w <*> w <*> w <*> w <*> w <*> w <*> w <*> w bytesOfKeyValueData <- getWord32 let getKVP 0 = return [] getKVP i = do keyAndValueByteSize <- getWord32 x <- getBytes (fromIntegral keyAndValueByteSize) let padding = 3 - (keyAndValueByteSize + 3) `mod` 4 unpackSkip (fromIntegral padding) xs <- getKVP (i - keyAndValueByteSize - padding) return (x:xs) kvp <- map (B.breakByte 0) <$> getKVP bytesOfKeyValueData let Ktx{..} = ktx kvp [] imgs <- forM [1..max 1 ktxNumMipLevels] $ \_ -> do imageSize <- getWord32 forM [1..max 1 ktxNumFaces] $ \_ -> do img <- getBytes (fromIntegral imageSize) unpackSkip $ fromIntegral (3 - (imageSize + 3) `mod` 4) return img return $ ktx kvp imgs -- | Build 'Ktx' from given path. ktxFromFile :: FilePath -> IO Ktx ktxFromFile path = B.readFile path >>= return . readKtx path -- | Build 'Ktx' with arbitrary resource name and actual data. readKtx :: FilePath -> B.ByteString -> Ktx readKtx path bs = runUnpacking (unpackKtx path bs) bs -- | Same as 'readKtx' except error handling is explicit. tryKtx :: FilePath -> B.ByteString -> Either SomeException Ktx tryKtx path bs = tryUnpacking (unpackKtx path bs) bs {- type MipmapData = [Face or ArrayElements] type ArrayElements = B.ByteString type Face = B.ByteString KTX Spec --------- Byte[12] identifier UInt32 endianness UInt32 glType UInt32 glTypeSize UInt32 glFormat Uint32 glInternalFormat Uint32 glBaseInternalFormat UInt32 pixelWidth UInt32 pixelHeight UInt32 pixelDepth UInt32 numberOfArrayElements UInt32 numberOfFaces UInt32 numberOfMipmapLevels UInt32 bytesOfKeyValueData for each keyValuePair that fits in bytesOfKeyValueData UInt32 keyAndValueByteSize Byte keyAndValue[keyAndValueByteSize] Byte valuePadding[3 - ((keyAndValueByteSize + 3) % 4)] end for each mipmap_level in numberOfMipmapLevels* UInt32 imageSize; for each array_element in numberOfArrayElements* for each face in numberOfFaces for each z_slice in pixelDepth* for each row or row_of_blocks in pixelHeight* for each pixel or block_of_pixels in pixelWidth Byte data[format-specific-number-of-bytes]** end end end Byte cubePadding[0-3] end end Byte mipPadding[3 - ((imageSize + 3) % 4)] end * Replace with 1 if this field is 0. ** Uncompressed texture data matches a GL_UNPACK_ALIGNMENT of 4. -}
capsjac/opengles
src/Graphics/TextureContainer/KTX.hs
Haskell
lgpl-3.0
4,142
#region LICENSE // TStreamSource - MPEG Stream Tools // Copyright (C) 2011 MarkTwen (mktwen@gmail.com) // http://www.TStreamSource.com // This library 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. // This library 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 this library; // If not, see <http://www.gnu.org/licenses/>. #endregion namespace TStreamSource.Core.DShow { /// <summary> /// The interface to directshow support graph. /// </summary> public interface IGraphConfigurator : IConfigurator { } }
markTwen/TStreamSource
TStreamSource.Core/DShow/IGraphConfigurator.cs
C#
lgpl-3.0
1,059
/** * Site Members Groups component GET method */ function main() { var siteId, theUrl, json, membership, data; siteId = page.url.templateArgs.site; // get the membership info for the current user in the current site theUrl = "/api/sites/" + siteId + "/memberships/" + encodeURIComponent(user.name); json = remote.call(theUrl); membership = JSON.parse(json); // add the role to the model model.currentUserRole = membership.role ? membership.role : ""; // get the roles available in the current site theUrl = "/api/sites/" + siteId + "/roles"; json = remote.call(theUrl); data = JSON.parse(json); // add all roles except "None" model.siteRoles = []; if (json.status == 200 && data.siteRoles) { for (var i = 0, j = data.siteRoles.length; i < j; i++) { if (data.siteRoles[i] != "None") { model.siteRoles.push(data.siteRoles[i]); } } } else { model.error = membership.message; } // Widget instantiation metadata... var searchConfig = config.scoped['Search']['search'], defaultMinSearchTermLength = searchConfig.getChildValue('min-search-term-length'), defaultMaxSearchResults = searchConfig.getChildValue('max-search-results'); var siteGroups = { id : "SiteGroups", name : "Alfresco.SiteGroups", options : { siteId : (page.url.templateArgs.site != null) ? page.url.templateArgs.site : "", currentUser : user.name, currentUserRole : model.currentUserRole, roles : model.siteRoles, minSearchTermLength : parseInt((args.minSearchTermLength != null) ? args.minSearchTermLength : defaultMinSearchTermLength), maxSearchResults : parseInt((args.maxSearchResults != null) ? args.maxSearchResults : defaultMaxSearchResults), setFocus : (args.setFocus == "true") } }; if (model.error) { siteGroups.options.error = model.error; } model.widgets = [siteGroups]; } main();
loftuxab/community-edition-old
projects/slingshot/config/alfresco/site-webscripts/org/alfresco/components/site-members/site-groups.get.js
JavaScript
lgpl-3.0
2,046
<?php namespace Quark\Extensions\MediaProcessing\PDFDocument; /** * Interface IQuarkPDFDocumentEntity * * @package Quark\Extensions\MediaProcessing\PDFDocument */ interface IQuarkPDFDocumentEntity { /** * @return string */ public function PDFEntityType(); /** * @return PDFDocumentObject[] */ public function PDFEntityObjectList(); /** * @param PDFDocumentObject $object * * @return IQuarkPDFDocumentEntity */ public function PDFEntityPopulate(PDFDocumentObject &$object); }
Qybercom/quark
Extensions/MediaProcessing/PDFDocument/IQuarkPDFDocumentEntity.php
PHP
lgpl-3.0
503
class SitesController < ApplicationController # GET /site # GET /site.xml def show @site = current_site end # GET /site/new # GET /site/new.xml def new redirect_to edit_site_path end # GET /site/edit def edit @site = current_site end # POST /site # POST /site.xml def create update end # PUT /site # PUT /site.xml def update respond_to do |format| if current_site.update_attributes(params[:current_site]) flash[:success] = t('site.updated') format.html { redirect_to site_path } format.xml { head :ok } else @site = current_site format.html { render :action => "edit" } format.xml { render :xml => @site.errors, :status => :unprocessable_entity } end end end # DELETE /site # DELETE /site.xml def destroy current_site.destroy if Site.count > 0 respond_to do |format| format.html { redirect_to root_path } format.xml { head :ok } end end end
atd/station
app/controllers/sites_controller.rb
Ruby
lgpl-3.0
1,012