code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
package mezz.texturedump.dumpers; import com.google.gson.stream.JsonWriter; import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.StartupMessageManager; import net.minecraftforge.forgespi.language.IModFileInfo; import net.minecraftforge.forgespi.language.IModInfo; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import javax.annotation.Nullable; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Path; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class ModStatsDumper { private static final Logger LOGGER = LogManager.getLogger(); public Path saveModStats(String name, TextureAtlas map, Path modStatsDir) throws IOException { Map<String, Long> modPixelCounts = map.texturesByName.values().stream() .collect(Collectors.groupingBy( sprite -> sprite.getName().getNamespace(), Collectors.summingLong(sprite -> (long) sprite.getWidth() * sprite.getHeight())) ); final long totalPixels = modPixelCounts.values().stream().mapToLong(longValue -> longValue).sum(); final String filename = name + "_mod_statistics"; Path output = modStatsDir.resolve(filename + ".js"); List<Map.Entry<String, Long>> sortedEntries = modPixelCounts.entrySet().stream() .sorted(Collections.reverseOrder(Map.Entry.comparingByValue())) .collect(Collectors.toList()); StartupMessageManager.addModMessage("Dumping Mod TextureMap Statistics"); FileWriter fileWriter = new FileWriter(output.toFile()); fileWriter.write("var modStatistics = \n//Start of Data\n"); JsonWriter jsonWriter = new JsonWriter(fileWriter); jsonWriter.setIndent(" "); jsonWriter.beginArray(); { for (Map.Entry<String, Long> modPixels : sortedEntries) { String resourceDomain = modPixels.getKey(); long pixelCount = modPixels.getValue(); writeModStatisticsObject(jsonWriter, resourceDomain, pixelCount, totalPixels); } } jsonWriter.endArray(); jsonWriter.close(); fileWriter.close(); LOGGER.info("Saved mod statistics to {}.", output.toString()); return output; } private static void writeModStatisticsObject(JsonWriter jsonWriter, String resourceDomain, long pixelCount, long totalPixels) throws IOException { IModInfo modInfo = getModMetadata(resourceDomain); String modName = modInfo != null ? modInfo.getDisplayName() : ""; jsonWriter.beginObject() .name("resourceDomain").value(resourceDomain) .name("pixelCount").value(pixelCount) .name("percentOfTextureMap").value(pixelCount * 100f / totalPixels) .name("modName").value(modName) .name("url").value(getModConfigValue(modInfo, "displayURL")) .name("issueTrackerUrl").value(getModConfigValue(modInfo, "issueTrackerURL")); jsonWriter.name("authors").beginArray(); { String authors = getModConfigValue(modInfo, "authors"); if (!authors.isEmpty()) { String[] authorList = authors.split(","); for (String author : authorList) { jsonWriter.value(author.trim()); } } } jsonWriter.endArray(); jsonWriter.endObject(); } private static String getModConfigValue(@Nullable IModInfo modInfo, String key) { if (modInfo == null) { return ""; } Map<String, Object> modConfig = modInfo.getModProperties(); Object value = modConfig.getOrDefault(key, ""); if (value instanceof String) { return (String) value; } return ""; } @Nullable private static IModInfo getModMetadata(String resourceDomain) { ModList modList = ModList.get(); IModFileInfo modFileInfo = modList.getModFileById(resourceDomain); if (modFileInfo == null) { return null; } return modFileInfo.getMods() .stream() .findFirst() .orElse(null); } }
mezz/TextureDump
src/main/java/mezz/texturedump/dumpers/ModStatsDumper.java
Java
lgpl-2.1
3,817
/* * Copyright 2005-2006 UniVis Explorer development team. * * This file is part of UniVis Explorer * (http://phobos22.inf.uni-konstanz.de/univis). * * UniVis Explorer 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. * * Please see COPYING for the complete licence. */ package unikn.dbis.univis.message; /** * TODO: document me!!! * <p/> * <code>Internationalizable+</code>. * <p/> * User: raedler, weiler * Date: 18.05.2006 * Time: 01:39:22 * * @author Roman R&auml;dle * @author Andreas Weiler * @version $Id: Internationalizable.java 338 2006-10-08 23:11:30Z raedler $ * @since UniVis Explorer 0.1 */ public interface Internationalizable { public void internationalize(); }
raedle/univis
src/java/unikn/dbis/univis/message/Internationalizable.java
Java
lgpl-2.1
899
package soot.jimple.toolkits.callgraph; /*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 2003 Ondrej Lhotak * %% * 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 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-2.1.html>. * #L% */ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; import soot.AnySubType; import soot.ArrayType; import soot.FastHierarchy; import soot.G; import soot.NullType; import soot.PhaseOptions; import soot.RefType; import soot.Scene; import soot.Singletons; import soot.SootClass; import soot.SootMethod; import soot.Type; import soot.jimple.SpecialInvokeExpr; import soot.options.CGOptions; import soot.toolkits.scalar.Pair; import soot.util.Chain; import soot.util.HashMultiMap; import soot.util.LargeNumberedMap; import soot.util.MultiMap; import soot.util.NumberedString; import soot.util.SmallNumberedMap; import soot.util.queue.ChunkedQueue; /** * Resolves virtual calls. * * @author Ondrej Lhotak */ public class VirtualCalls { private CGOptions options = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")); public VirtualCalls(Singletons.Global g) { } public static VirtualCalls v() { return G.v().soot_jimple_toolkits_callgraph_VirtualCalls(); } private final LargeNumberedMap<Type, SmallNumberedMap<SootMethod>> typeToVtbl = new LargeNumberedMap<Type, SmallNumberedMap<SootMethod>>(Scene.v().getTypeNumberer()); public SootMethod resolveSpecial(SpecialInvokeExpr iie, NumberedString subSig, SootMethod container) { return resolveSpecial(iie, subSig, container, false); } public SootMethod resolveSpecial(SpecialInvokeExpr iie, NumberedString subSig, SootMethod container, boolean appOnly) { SootMethod target = iie.getMethod(); /* cf. JVM spec, invokespecial instruction */ if (Scene.v().getOrMakeFastHierarchy().canStoreType(container.getDeclaringClass().getType(), target.getDeclaringClass().getType()) && container.getDeclaringClass().getType() != target.getDeclaringClass().getType() && !target.getName().equals("<init>") && subSig != sigClinit) { return resolveNonSpecial(container.getDeclaringClass().getSuperclass().getType(), subSig, appOnly); } else { return target; } } public SootMethod resolveNonSpecial(RefType t, NumberedString subSig) { return resolveNonSpecial(t, subSig, false); } public SootMethod resolveNonSpecial(RefType t, NumberedString subSig, boolean appOnly) { SmallNumberedMap<SootMethod> vtbl = typeToVtbl.get(t); if (vtbl == null) { typeToVtbl.put(t, vtbl = new SmallNumberedMap<SootMethod>()); } SootMethod ret = vtbl.get(subSig); if (ret != null) { return ret; } SootClass cls = t.getSootClass(); if (appOnly && cls.isLibraryClass()) { return null; } SootMethod m = cls.getMethodUnsafe(subSig); if (m != null) { if (!m.isAbstract()) { ret = m; } } else { SootClass c = cls.getSuperclassUnsafe(); if (c != null) { ret = resolveNonSpecial(c.getType(), subSig); } } vtbl.put(subSig, ret); return ret; } protected MultiMap<Type, Type> baseToSubTypes = new HashMultiMap<Type, Type>(); protected MultiMap<Pair<Type, NumberedString>, Pair<Type, NumberedString>> baseToPossibleSubTypes = new HashMultiMap<Pair<Type, NumberedString>, Pair<Type, NumberedString>>(); public void resolve(Type t, Type declaredType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets) { resolve(t, declaredType, null, subSig, container, targets); } public void resolve(Type t, Type declaredType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly) { resolve(t, declaredType, null, subSig, container, targets, appOnly); } public void resolve(Type t, Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets) { resolve(t, declaredType, sigType, subSig, container, targets, false); } public void resolve(Type t, Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly) { if (declaredType instanceof ArrayType) { declaredType = RefType.v("java.lang.Object"); } if (sigType instanceof ArrayType) { sigType = RefType.v("java.lang.Object"); } if (t instanceof ArrayType) { t = RefType.v("java.lang.Object"); } FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); if (declaredType != null && !fastHierachy.canStoreType(t, declaredType)) { return; } if (sigType != null && !fastHierachy.canStoreType(t, sigType)) { return; } if (t instanceof RefType) { SootMethod target = resolveNonSpecial((RefType) t, subSig, appOnly); if (target != null) { targets.add(target); } } else if (t instanceof AnySubType) { RefType base = ((AnySubType) t).getBase(); /* * Whenever any sub type of a specific type is considered as receiver for a method to call and the base type is an * interface, calls to existing methods with matching signature (possible implementation of method to call) are also * added. As Javas' subtyping allows contra-variance for return types and co-variance for parameters when overriding a * method, these cases are also considered here. * * Example: Classes A, B (B sub type of A), interface I with method public A foo(B b); and a class C with method public * B foo(A a) { ... }. The extended class hierarchy will contain C as possible implementation of I. * * Since Java has no multiple inheritance call by signature resolution is only activated if the base is an interface. */ if (options.library() == CGOptions.library_signature_resolution && base.getSootClass().isInterface()) { resolveLibrarySignature(declaredType, sigType, subSig, container, targets, appOnly, base); } else { resolveAnySubType(declaredType, sigType, subSig, container, targets, appOnly, base); } } else if (t instanceof NullType) { } else { throw new RuntimeException("oops " + t); } } public void resolveSuperType(Type t, Type declaredType, NumberedString subSig, ChunkedQueue<SootMethod> targets, boolean appOnly) { if (declaredType == null) { return; } if (t == null) { return; } if (declaredType instanceof ArrayType) { declaredType = RefType.v("java.lang.Object"); } if (t instanceof ArrayType) { t = RefType.v("java.lang.Object"); } if (declaredType instanceof RefType) { RefType parent = (RefType)declaredType; SootClass parentClass = parent.getSootClass(); RefType child; SootClass childClass; if (t instanceof AnySubType) { child = ((AnySubType) t).getBase(); } else if (t instanceof RefType) { child = (RefType)t; } else { return; } childClass = child.getSootClass(); FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); if (fastHierachy.canStoreClass(childClass,parentClass)) { SootMethod target = resolveNonSpecial(child, subSig, appOnly); if (target != null) { targets.add(target); } } } } protected void resolveAnySubType(Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly, RefType base) { FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); { Set<Type> subTypes = baseToSubTypes.get(base); if (subTypes != null && !subTypes.isEmpty()) { for (final Type st : subTypes) { resolve(st, declaredType, sigType, subSig, container, targets, appOnly); } return; } } Set<Type> newSubTypes = new HashSet<>(); newSubTypes.add(base); LinkedList<SootClass> worklist = new LinkedList<SootClass>(); HashSet<SootClass> workset = new HashSet<SootClass>(); FastHierarchy fh = fastHierachy; SootClass cl = base.getSootClass(); if (workset.add(cl)) { worklist.add(cl); } while (!worklist.isEmpty()) { cl = worklist.removeFirst(); if (cl.isInterface()) { for (Iterator<SootClass> cIt = fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext();) { final SootClass c = cIt.next(); if (workset.add(c)) { worklist.add(c); } } } else { if (cl.isConcrete()) { resolve(cl.getType(), declaredType, sigType, subSig, container, targets, appOnly); newSubTypes.add(cl.getType()); } for (Iterator<SootClass> cIt = fh.getSubclassesOf(cl).iterator(); cIt.hasNext();) { final SootClass c = cIt.next(); if (workset.add(c)) { worklist.add(c); } } } } baseToSubTypes.putAll(base, newSubTypes); } protected void resolveLibrarySignature(Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly, RefType base) { FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); assert (declaredType instanceof RefType); Pair<Type, NumberedString> pair = new Pair<Type, NumberedString>(base, subSig); { Set<Pair<Type, NumberedString>> types = baseToPossibleSubTypes.get(pair); // if this type and method has been resolved earlier we can // just retrieve the previous result. if (types != null) { for (Pair<Type, NumberedString> tuple : types) { Type st = tuple.getO1(); if (!fastHierachy.canStoreType(st, declaredType)) { resolve(st, st, sigType, subSig, container, targets, appOnly); } else { resolve(st, declaredType, sigType, subSig, container, targets, appOnly); } } return; } } Set<Pair<Type, NumberedString>> types = new HashSet<Pair<Type, NumberedString>>(); // get return type; method name; parameter types String[] split = subSig.getString().replaceAll("(.*) (.*)\\((.*)\\)", "$1;$2;$3").split(";"); Type declaredReturnType = Scene.v().getType(split[0]); String declaredName = split[1]; List<Type> declaredParamTypes = new ArrayList<Type>(); // separate the parameter types if (split.length == 3) { for (String type : split[2].split(",")) { declaredParamTypes.add(Scene.v().getType(type)); } } Chain<SootClass> classes = Scene.v().getClasses(); for (SootClass sc : classes) { for (SootMethod sm : sc.getMethods()) { if (!sm.isAbstract()) { // method name has to match if (!sm.getName().equals(declaredName)) { continue; } // the return type has to be a the declared return // type or a sub type of it if (!fastHierachy.canStoreType(sm.getReturnType(), declaredReturnType)) { continue; } List<Type> paramTypes = sm.getParameterTypes(); // method parameters have to match to the declared // ones (same type or super type). if (declaredParamTypes.size() != paramTypes.size()) { continue; } boolean check = true; for (int i = 0; i < paramTypes.size(); i++) { if (!fastHierachy.canStoreType(declaredParamTypes.get(i), paramTypes.get(i))) { check = false; break; } } if (check) { Type st = sc.getType(); if (!fastHierachy.canStoreType(st, declaredType)) { // final classes can not be extended and // therefore not used in library client if (!sc.isFinal()) { NumberedString newSubSig = sm.getNumberedSubSignature(); resolve(st, st, sigType, newSubSig, container, targets, appOnly); types.add(new Pair<Type, NumberedString>(st, newSubSig)); } } else { resolve(st, declaredType, sigType, subSig, container, targets, appOnly); types.add(new Pair<Type, NumberedString>(st, subSig)); } } } } } baseToPossibleSubTypes.putAll(pair, types); } public final NumberedString sigClinit = Scene.v().getSubSigNumberer().findOrAdd("void <clinit>()"); public final NumberedString sigStart = Scene.v().getSubSigNumberer().findOrAdd("void start()"); public final NumberedString sigRun = Scene.v().getSubSigNumberer().findOrAdd("void run()"); }
plast-lab/soot
src/main/java/soot/jimple/toolkits/callgraph/VirtualCalls.java
Java
lgpl-2.1
13,477
// The libMesh Finite Element Library. // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner // 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 #ifndef LIBMESH_CELL_INF_PRISM_H #define LIBMESH_CELL_INF_PRISM_H #include "libmesh/libmesh_config.h" #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS // Local includes #include "libmesh/cell_inf.h" namespace libMesh { /** * The \p InfPrism is an element in 3D with 4 sides. * The \f$ 5^{th} \f$ side is theoretically located at infinity, * and therefore not accounted for. * However, one could say that the \f$ 5^{th} \f$ side actually * @e does exist in the mesh, since the outer nodes are located * at a specific distance from the mesh origin (and therefore * define a side). Still, this face is not to be used! */ class InfPrism : public InfCell { public: /** * Default infinite prism element, takes number of nodes and * parent. Derived classes implement 'true' elements. */ InfPrism(const unsigned int nn, Elem* p, Node** nodelinkdata); // /** // * @returns 4 for the base \p s=0 and 2 for side faces. // */ // unsigned int n_children_per_side(const unsigned int s) const; /** * @returns 4. Infinite elements have one side less * than their conventional counterparts, since one * side is supposed to be located at infinity. */ unsigned int n_sides() const { return 4; } /** * @returns 6. All infinite prisms (in our * setting) have 6 vertices. */ unsigned int n_vertices() const { return 6; } /** * @returns 6. All infinite prismahedrals have 6 edges, * 3 lying in the base, and 3 perpendicular to the base. */ unsigned int n_edges() const { return 6; } /** * @returns 4. All prisms have 4 faces. */ unsigned int n_faces() const { return 4; } /** * @returns 4 */ unsigned int n_children() const { return 4; } /* * @returns true iff the specified child is on the * specified side */ virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const; /* * @returns true iff the specified edge is on the specified side */ virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const; /** * @returns an id associated with the \p s side of this element. * The id is not necessariy unique, but should be close. This is * particularly useful in the \p MeshBase::find_neighbors() routine. */ dof_id_type key (const unsigned int s) const; /** * @returns a primitive (3-noded) tri or (4-noded) infquad for * face i. */ AutoPtr<Elem> side (const unsigned int i) const; protected: /** * Data for links to parent/neighbor/interior_parent elements. */ Elem* _elemlinks_data[5+(LIBMESH_DIM>3)]; }; // ------------------------------------------------------------ // InfPrism class member functions inline InfPrism::InfPrism(const unsigned int nn, Elem* p, Node** nodelinkdata) : InfCell(nn, InfPrism::n_sides(), p, _elemlinks_data, nodelinkdata) { } // inline // unsigned int InfPrism::n_children_per_side(const unsigned int s) const // { // libmesh_assert_less (s, this->n_sides()); // switch (s) // { // case 0: // // every infinite prism has 4 children in the base side // return 4; // default: // // on infinite faces (sides), only 2 children exist // // // // note that the face at infinity is already caught by the libmesh_assertion // return 2; // } // } } // namespace libMesh #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS #endif // LIBMESH_CELL_INF_PRISM_H
Mbewu/libmesh
include/geom/cell_inf_prism.h
C
lgpl-2.1
4,354
/* Copyright (C) 2000-2001 by Jorrit Tyberghein This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "cssysdef.h" #include "csqsqrt.h" #include "csgeom/box.h" #include "csgeom/math.h" #include "csgeom/math3d.h" #include "csgeom/math2d.h" #include "csgeom/transfrm.h" #include "csgfx/renderbuffer.h" #include "cstool/rbuflock.h" #include "cstool/rviewclipper.h" #include "csutil/scfarray.h" #include "ivaria/reporter.h" #include "iengine/movable.h" #include "iengine/rview.h" #include "ivideo/graph3d.h" #include "ivideo/graph2d.h" #include "ivideo/material.h" #include "ivideo/rendermesh.h" #include "iengine/material.h" #include "iengine/camera.h" #include "igeom/clip2d.h" #include "iengine/engine.h" #include "iengine/light.h" #include "iutil/objreg.h" #include "spr2d.h" CS_PLUGIN_NAMESPACE_BEGIN(Spr2D) { CS_LEAKGUARD_IMPLEMENT (csSprite2DMeshObject); CS_LEAKGUARD_IMPLEMENT (csSprite2DMeshObject::RenderBufferAccessor); CS_LEAKGUARD_IMPLEMENT (csSprite2DMeshObjectFactory); csSprite2DMeshObject::csSprite2DMeshObject (csSprite2DMeshObjectFactory* factory) : scfImplementationType (this), uvani (0), vertices_dirty (true), texels_dirty (true), colors_dirty (true), indicesSize ((size_t)-1), logparent (0), factory (factory), initialized (false), current_lod (1), current_features (0) { ifactory = scfQueryInterface<iMeshObjectFactory> (factory); material = factory->GetMaterialWrapper (); lighting = factory->HasLighting (); MixMode = factory->GetMixMode (); } csSprite2DMeshObject::~csSprite2DMeshObject () { delete uvani; } iColoredVertices* csSprite2DMeshObject::GetVertices () { if (!scfVertices.IsValid()) return factory->GetVertices (); return scfVertices; } csColoredVertices* csSprite2DMeshObject::GetCsVertices () { if (!scfVertices.IsValid()) return factory->GetCsVertices (); return &vertices; } void csSprite2DMeshObject::SetupObject () { if (!initialized) { initialized = true; float max_sq_dist = 0; size_t i; csColoredVertices* vertices = GetCsVertices (); bbox_2d.StartBoundingBox((*vertices)[0].pos); for (i = 0 ; i < vertices->GetSize () ; i++) { csSprite2DVertex& v = (*vertices)[i]; bbox_2d.AddBoundingVertexSmart(v.pos); if (!lighting) { // If there is no lighting then we need to copy the color_init // array to color. v.color = (*vertices)[i].color_init; v.color.Clamp (2, 2, 2); } float sqdist = v.pos.x*v.pos.x + v.pos.y*v.pos.y; if (sqdist > max_sq_dist) max_sq_dist = sqdist; } radius = csQsqrt (max_sq_dist); bufferHolder.AttachNew (new csRenderBufferHolder); csRef<iRenderBufferAccessor> newAccessor; newAccessor.AttachNew (new RenderBufferAccessor (this)); bufferHolder->SetAccessor (newAccessor, (uint32)CS_BUFFER_ALL_MASK); svcontext.AttachNew (new csShaderVariableContext); } } static csVector3 cam; void csSprite2DMeshObject::UpdateLighting ( const csSafeCopyArray<csLightInfluence>& lights, const csVector3& pos) { if (!lighting) return; csColor color (0, 0, 0); // @@@ GET AMBIENT //csSector* sect = movable.GetSector (0); //if (sect) //{ //int r, g, b; //sect->GetAmbientColor (r, g, b); //color.Set (r / 128.0, g / 128.0, b / 128.0); //} int i; int num_lights = (int)lights.GetSize (); for (i = 0; i < num_lights; i++) { iLight* li = lights[i].light; if (!li) continue; csColor light_color = li->GetColor () * (256. / CS_NORMAL_LIGHT_LEVEL); float sq_light_radius = csSquare (li->GetCutoffDistance ()); // Compute light position. csVector3 wor_light_pos = li->GetMovable ()->GetFullPosition (); float wor_sq_dist = csSquaredDist::PointPoint (wor_light_pos, pos); if (wor_sq_dist >= sq_light_radius) continue; float wor_dist = csQsqrt (wor_sq_dist); float cosinus = 1.0f; cosinus /= wor_dist; light_color *= cosinus * li->GetBrightnessAtDistance (wor_dist); color += light_color; } csColoredVertices* vertices = GetCsVertices (); for (size_t j = 0 ; j < vertices->GetSize () ; j++) { (*vertices)[j].color = (*vertices)[j].color_init + color; (*vertices)[j].color.Clamp (2, 2, 2); } colors_dirty = true; } void csSprite2DMeshObject::UpdateLighting ( const csSafeCopyArray<csLightInfluence>& lights, iMovable* movable, csVector3 offset) { if (!lighting) return; csVector3 pos = movable->GetFullPosition (); UpdateLighting (lights, pos + offset); } csRenderMesh** csSprite2DMeshObject::GetRenderMeshes (int &n, iRenderView* rview, iMovable* movable, uint32 frustum_mask, csVector3 offset) { SetupObject (); if (!material) { csReport (factory->object_reg, CS_REPORTER_SEVERITY_ERROR, "crystalspace.mesh.sprite2d", "Error! Trying to draw a sprite with no material!"); return 0; } iCamera* camera = rview->GetCamera (); // Camera transformation for the single 'position' vector. cam = rview->GetCamera ()->GetTransform ().Other2This ( movable->GetFullPosition () + offset); if (cam.z < SMALL_Z) { n = 0; return 0; } if (factory->light_mgr) { csSafeCopyArray<csLightInfluence> lightInfluences; scfArrayWrap<iLightInfluenceArray, csSafeCopyArray<csLightInfluence> > relevantLights (lightInfluences); //Yes, know, its on the stack... factory->light_mgr->GetRelevantLights (logparent, &relevantLights, -1); UpdateLighting (lightInfluences, movable, offset); } csReversibleTransform temp = camera->GetTransform (); if (!movable->IsFullTransformIdentity ()) temp /= movable->GetFullTransform (); int clip_portal, clip_plane, clip_z_plane; CS::RenderViewClipper::CalculateClipSettings (rview->GetRenderContext (), frustum_mask, clip_portal, clip_plane, clip_z_plane); csReversibleTransform tr_o2c; tr_o2c.SetO2TTranslation (-temp.Other2This (offset)); bool meshCreated; csRenderMesh*& rm = rmHolder.GetUnusedMesh (meshCreated, rview->GetCurrentFrameNumber ()); if (meshCreated) { rm->meshtype = CS_MESHTYPE_TRIANGLEFAN; rm->buffers = bufferHolder; rm->variablecontext = svcontext; rm->geometryInstance = this; } rm->material = material;//Moved this statement out of the above 'if' //to make the change of the material possible at any time //(thru a call to either iSprite2DState::SetMaterialWrapper () or //csSprite2DMeshObject::SetMaterialWrapper (). Luca rm->mixmode = MixMode; rm->clip_portal = clip_portal; rm->clip_plane = clip_plane; rm->clip_z_plane = clip_z_plane; rm->do_mirror = false/* camera->IsMirrored () */; /* Force to false as the front-face culling will let the sprite disappear. */ rm->indexstart = 0; rm->worldspace_origin = movable->GetFullPosition (); rm->object2world = tr_o2c.GetInverse () * camera->GetTransform (); rm->bbox = GetObjectBoundingBox(); rm->indexend = (uint)GetCsVertices ()->GetSize (); n = 1; return &rm; } void csSprite2DMeshObject::PreGetBuffer (csRenderBufferHolder* holder, csRenderBufferName buffer) { if (!holder) return; csColoredVertices* vertices = GetCsVertices (); if (buffer == CS_BUFFER_INDEX) { size_t indexSize = vertices->GetSize (); if (!index_buffer.IsValid() || (indicesSize != indexSize)) { index_buffer = csRenderBuffer::CreateIndexRenderBuffer ( indexSize, CS_BUF_DYNAMIC, CS_BUFCOMP_UNSIGNED_INT, 0, vertices->GetSize () - 1); holder->SetRenderBuffer (CS_BUFFER_INDEX, index_buffer); csRenderBufferLock<uint> indexLock (index_buffer); uint* ptr = indexLock; for (size_t i = 0; i < vertices->GetSize (); i++) { *ptr++ = (uint)i; } indicesSize = indexSize; } } else if (buffer == CS_BUFFER_TEXCOORD0) { if (texels_dirty) { int texels_count; const csVector2 *uvani_uv = 0; if (!uvani) texels_count = (int)vertices->GetSize (); else uvani_uv = uvani->GetVertices (texels_count); size_t texelSize = texels_count; if (!texel_buffer.IsValid() || (texel_buffer->GetSize() != texelSize * sizeof(float) * 2)) { texel_buffer = csRenderBuffer::CreateRenderBuffer ( texelSize, CS_BUF_STATIC, CS_BUFCOMP_FLOAT, 2); holder->SetRenderBuffer (CS_BUFFER_TEXCOORD0, texel_buffer); } csRenderBufferLock<csVector2> texelLock (texel_buffer); for (size_t i = 0; i < (size_t)texels_count; i++) { csVector2& v = texelLock[i]; if (!uvani) { v.x = (*vertices)[i].u; v.y = (*vertices)[i].v; } else { v.x = uvani_uv[i].x; v.y = uvani_uv[i].y; } } texels_dirty = false; } } else if (buffer == CS_BUFFER_COLOR) { if (colors_dirty) { size_t color_size = vertices->GetSize (); if (!color_buffer.IsValid() || (color_buffer->GetSize() != color_size * sizeof(float) * 2)) { color_buffer = csRenderBuffer::CreateRenderBuffer ( color_size, CS_BUF_STATIC, CS_BUFCOMP_FLOAT, 3); holder->SetRenderBuffer (CS_BUFFER_COLOR, color_buffer); } csRenderBufferLock<csColor> colorLock (color_buffer); for (size_t i = 0; i < vertices->GetSize (); i++) { colorLock[i] = (*vertices)[i].color; } colors_dirty = false; } } else if (buffer == CS_BUFFER_POSITION) { if (vertices_dirty) { size_t vertices_size = vertices->GetSize (); if (!vertex_buffer.IsValid() || (vertex_buffer->GetSize() != vertices_size * sizeof(float) * 3)) { vertex_buffer = csRenderBuffer::CreateRenderBuffer ( vertices_size, CS_BUF_STATIC, CS_BUFCOMP_FLOAT, 3); holder->SetRenderBuffer (CS_BUFFER_POSITION, vertex_buffer); } csRenderBufferLock<csVector3> vertexLock (vertex_buffer); for (size_t i = 0; i < vertices->GetSize (); i++) { vertexLock[i].Set ((*vertices)[i].pos.x, (*vertices)[i].pos.y, 0.0f); } vertices_dirty = false; } } } const csBox3& csSprite2DMeshObject::GetObjectBoundingBox () { SetupObject (); obj_bbox.Set (-radius, radius); return obj_bbox; } void csSprite2DMeshObject::SetObjectBoundingBox (const csBox3&) { // @@@ TODO } void csSprite2DMeshObject::HardTransform (const csReversibleTransform& t) { (void)t; //@@@ TODO } void csSprite2DMeshObject::CreateRegularVertices (int n, bool setuv) { double angle_inc = TWO_PI / n; double angle = 0.0; csColoredVertices* vertices = GetCsVertices (); vertices->SetSize (n); size_t i; for (i = 0; i < vertices->GetSize (); i++, angle += angle_inc) { (*vertices) [i].pos.y = cos (angle); (*vertices) [i].pos.x = sin (angle); if (setuv) { // reuse sin/cos values and scale to [0..1] (*vertices) [i].u = (*vertices) [i].pos.x / 2.0f + 0.5f; (*vertices) [i].v = (*vertices) [i].pos.y / 2.0f + 0.5f; } (*vertices) [i].color.Set (1, 1, 1); (*vertices) [i].color_init.Set (1, 1, 1); } vertices_dirty = true; texels_dirty = true; colors_dirty = true; ShapeChanged (); } void csSprite2DMeshObject::NextFrame (csTicks current_time, const csVector3& /*pos*/, uint /*currentFrame*/) { if (uvani && !uvani->halted) { int old_frame_index = uvani->frameindex; uvani->Advance (current_time); texels_dirty |= (old_frame_index != uvani->frameindex); } } void csSprite2DMeshObject::UpdateLighting ( const csSafeCopyArray<csLightInfluence>& lights, const csReversibleTransform& transform) { csVector3 new_pos = transform.This2Other (part_pos); UpdateLighting (lights, new_pos); } void csSprite2DMeshObject::AddColor (const csColor& col) { iColoredVertices* vertices = GetVertices (); size_t i; for (i = 0 ; i < vertices->GetSize(); i++) vertices->Get (i).color_init += col; if (!lighting) for (i = 0 ; i < vertices->GetSize(); i++) vertices->Get (i).color = vertices->Get (i).color_init; colors_dirty = true; } bool csSprite2DMeshObject::SetColor (const csColor& col) { iColoredVertices* vertices = GetVertices (); size_t i; for (i = 0 ; i < vertices->GetSize(); i++) vertices->Get (i).color_init = col; if (!lighting) for (i = 0 ; i < vertices->GetSize(); i++) vertices->Get (i).color = col; colors_dirty = true; return true; } void csSprite2DMeshObject::ScaleBy (float factor) { iColoredVertices* vertices = GetVertices (); size_t i; for (i = 0 ; i < vertices->GetSize(); i++) vertices->Get (i).pos *= factor; vertices_dirty = true; ShapeChanged (); } void csSprite2DMeshObject::Rotate (float angle) { iColoredVertices* vertices = GetVertices (); size_t i; for (i = 0 ; i < vertices->GetSize(); i++) vertices->Get (i).pos.Rotate (angle); vertices_dirty = true; ShapeChanged (); } void csSprite2DMeshObject::SetUVAnimation (const char *name, int style, bool loop) { if (name) { iSprite2DUVAnimation *ani = factory->GetUVAnimation (name); if (ani && ani->GetFrameCount ()) { uvani = new uvAnimationControl (); uvani->ani = ani; uvani->last_time = 0; uvani->frameindex = 0; uvani->framecount = ani->GetFrameCount (); uvani->frame = ani->GetFrame (0); uvani->style = style; uvani->counter = 0; uvani->loop = loop; uvani->halted = false; } } else { // stop animation and show the normal texture delete uvani; uvani = 0; } } void csSprite2DMeshObject::StopUVAnimation (int idx) { if (uvani) { if (idx != -1) { uvani->frameindex = csMin (csMax (idx, 0), uvani->framecount-1); uvani->frame = uvani->ani->GetFrame (uvani->frameindex); } uvani->halted = true; } } void csSprite2DMeshObject::PlayUVAnimation (int idx, int style, bool loop) { if (uvani) { if (idx != -1) { uvani->frameindex = csMin (csMax (idx, 0), uvani->framecount-1); uvani->frame = uvani->ani->GetFrame (uvani->frameindex); } uvani->halted = false; uvani->counter = 0; uvani->last_time = 0; uvani->loop = loop; uvani->style = style; } } int csSprite2DMeshObject::GetUVAnimationCount () const { return factory->GetUVAnimationCount (); } iSprite2DUVAnimation *csSprite2DMeshObject::CreateUVAnimation () { return factory->CreateUVAnimation (); } void csSprite2DMeshObject::RemoveUVAnimation ( iSprite2DUVAnimation *anim) { factory->RemoveUVAnimation (anim); } iSprite2DUVAnimation *csSprite2DMeshObject::GetUVAnimation ( const char *name) const { return factory->GetUVAnimation (name); } iSprite2DUVAnimation *csSprite2DMeshObject::GetUVAnimation ( int idx) const { return factory->GetUVAnimation (idx); } iSprite2DUVAnimation *csSprite2DMeshObject::GetUVAnimation ( int idx, int &style, bool &loop) const { style = uvani->style; loop = uvani->loop; return factory->GetUVAnimation (idx); } void csSprite2DMeshObject::EnsureVertexCopy () { if (!scfVertices.IsValid()) { scfVertices.AttachNew (new scfArrayWrap<iColoredVertices, csColoredVertices> (vertices)); vertices = *(factory->GetCsVertices()); } } void csSprite2DMeshObject::uvAnimationControl::Advance (csTicks current_time) { int oldframeindex = frameindex; // the goal is to find the next frame to show if (style < 0) { // every (-1*style)-th frame show a new pic counter--; if (counter < style) { counter = 0; frameindex++; if (frameindex == framecount) { if (loop) frameindex = 0; else { frameindex = framecount-1; halted = true; } } } } else if (style > 0) { // skip to next frame every <style> millisecond if (last_time == 0) last_time = current_time; counter += (current_time - last_time); last_time = current_time; while (counter > style) { counter -= style; frameindex++; if (frameindex == framecount) { if (loop) frameindex = 0; else { frameindex = framecount-1; halted = true; } } } } else { // style == 0 -> use time indices attached to the frames if (last_time == 0) last_time = current_time; while (frame->GetDuration () + last_time < current_time) { frameindex++; if (frameindex == framecount) { if (loop) { frameindex = 0; } else { frameindex = framecount-1; halted = true; break; } } } last_time += frame->GetDuration (); frame = ani->GetFrame (frameindex); } if (oldframeindex != frameindex) frame = ani->GetFrame (frameindex); } const csVector2 *csSprite2DMeshObject::uvAnimationControl::GetVertices ( int &num) { num = frame->GetUVCount (); return frame->GetUVCoo (); } // The hit beam methods in sprite2d make a couple of small presumptions. // 1) The sprite is always facing the start of the beam. // 2) Since it is always facing the beam, only one side // of its bounding box can be hit (if at all). void csSprite2DMeshObject::CheckBeam (const csVector3& /*start*/, const csVector3& pl, float sqr, csMatrix3& o2t) { // This method is an optimized version of LookAt() based on // the presumption that the up vector is always (0,1,0). // This is used to create a transform to move the intersection // to the sprites vector space, then it is tested against the 2d // coords, which are conveniently located at z=0. // The transformation matrix is stored and used again if the // start vector for the beam is in the same position. MHV. csVector3 pl2 = pl * csQisqrt (sqr); csVector3 v1( pl2.z, 0, -pl2.x); sqr = v1*v1; v1 *= csQisqrt(sqr); csVector3 v2(pl2.y * v1.z, pl2.z * v1.x - pl2.x * v1.z, -pl2.y * v1.x); o2t.Set (v1.x, v2.x, pl2.x, v1.y, v2.y, pl2.y, v1.z, v2.z, pl2.z); } bool csSprite2DMeshObject::HitBeamOutline(const csVector3& start, const csVector3& end, csVector3& isect, float* pr) { csVector2 cen = bbox_2d.GetCenter(); csVector3 pl = start - csVector3(cen.x, cen.y, 0); float sqr = pl * pl; if (sqr < SMALL_EPSILON) return false; // Too close, Cannot intersect float dist; csIntersect3::SegmentPlane(start, end, pl, 0, isect, dist); if (pr) { *pr = dist; } csMatrix3 o2t; CheckBeam (start, pl, sqr, o2t); csVector3 r = o2t * isect; csColoredVertices* vertices = GetCsVertices (); int trail, len = (int)vertices->GetSize (); trail = len - 1; csVector2 isec(r.x, r.y); int i; for (i = 0; i < len; trail = i++) { if (csMath2::WhichSide2D(isec, (*vertices)[trail].pos, (*vertices)[i].pos) > 0) return false; } return true; } bool csSprite2DMeshObject::HitBeamObject (const csVector3& start, const csVector3& end, csVector3& isect, float* pr, int* polygon_idx, iMaterialWrapper** material, bool bf) { if (material) *material = csSprite2DMeshObject::material; if (polygon_idx) *polygon_idx = -1; return HitBeamOutline (start, end, isect, pr); } //---------------------------------------------------------------------- csSprite2DMeshObjectFactory::csSprite2DMeshObjectFactory (iMeshObjectType* pParent, iObjectRegistry* object_reg) : scfImplementationType (this, pParent), material (0), logparent (0), spr2d_type (pParent), MixMode (0), lighting (true), object_reg (object_reg) { light_mgr = csQueryRegistry<iLightManager> (object_reg); g3d = csQueryRegistry<iGraphics3D> (object_reg); scfVertices.AttachNew (new scfArrayWrap<iColoredVertices, csColoredVertices> (vertices)); ax = -10; } csSprite2DMeshObjectFactory::~csSprite2DMeshObjectFactory () { } csPtr<iMeshObject> csSprite2DMeshObjectFactory::NewInstance () { csRef<csSprite2DMeshObject> cm; cm.AttachNew (new csSprite2DMeshObject (this)); csRef<iMeshObject> im (scfQueryInterface<iMeshObject> (cm)); return csPtr<iMeshObject> (im); } //---------------------------------------------------------------------- SCF_IMPLEMENT_FACTORY (csSprite2DMeshObjectType) csSprite2DMeshObjectType::csSprite2DMeshObjectType (iBase* pParent) : scfImplementationType (this, pParent) { } csSprite2DMeshObjectType::~csSprite2DMeshObjectType () { } csPtr<iMeshObjectFactory> csSprite2DMeshObjectType::NewFactory () { csRef<csSprite2DMeshObjectFactory> cm; cm.AttachNew (new csSprite2DMeshObjectFactory (this, object_reg)); csRef<iMeshObjectFactory> ifact = scfQueryInterface<iMeshObjectFactory> (cm); return csPtr<iMeshObjectFactory> (ifact); } bool csSprite2DMeshObjectType::Initialize (iObjectRegistry* object_reg) { csSprite2DMeshObjectType::object_reg = object_reg; return true; } } CS_PLUGIN_NAMESPACE_END(Spr2D)
baoboa/Crystal-Space
plugins/mesh/spr2d/object/spr2d.cpp
C++
lgpl-2.1
21,393
/* Copyright (C) 1991,92,96,97,99,2000,2001,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C 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. The GNU C 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 the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _STRINGS_H #define _STRINGS_H 1 /* We don't need and should not read this file if <string.h> was already read. The one exception being that if __USE_BSD isn't defined, then these aren't defined in string.h, so we need to define them here. */ /* keep this file in sync w/ string.h, the glibc version is out of date */ #if !defined _STRING_H || !defined __USE_BSD # include <features.h> # define __need_size_t # include <stddef.h> __BEGIN_DECLS # ifdef __UCLIBC_SUSV3_LEGACY__ /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW __nonnull ((1, 2)); /* Set N bytes of S to 0. */ extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Find the first occurrence of C in S (same as strchr). */ extern char *index (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); /* Find the last occurrence of C in S (same as strrchr). */ extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # else # ifdef __UCLIBC_SUSV3_LEGACY_MACROS__ /* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3. * They are replaced as proposed by SuSv3. Don't sync this part * with glibc and keep it in sync with string.h. */ # define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0) # define bzero(s,n) (memset((s), '\0', (n)), (void) 0) # define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n)) # define index(s,c) strchr((s), (c)) # define rindex(s,c) strrchr((s), (c)) # endif # endif /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs (int __i) __THROW __attribute__ ((__const__)); libc_hidden_proto(ffs) /* The following two functions are non-standard but necessary for non-32 bit platforms. */ # ifdef __USE_GNU extern int ffsl (long int __l) __THROW __attribute__ ((__const__)); # ifdef __GNUC__ __extension__ extern int ffsll (long long int __ll) __THROW __attribute__ ((__const__)); # endif # endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); libc_hidden_proto(strcasecmp) /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); libc_hidden_proto(strncasecmp) #if defined __USE_XOPEN2K8 && defined __UCLIBC_HAS_XLOCALE__ /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ # include <xlocale.h> /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); libc_hidden_proto(strcasecmp_l) extern int strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 4)); libc_hidden_proto(strncasecmp_l) #endif __END_DECLS #ifdef _LIBC /* comment is wrong and will face this, when HAS_GNU option will be added * header is SuSv standard */ #error "<strings.h> should not be included from libc." #endif #endif /* string.h */ #endif /* strings.h */
czankel/xtensa-uclibc
include/strings.h
C
lgpl-2.1
4,588
/* * JBoss, Home of Professional Open Source. * Copyright 2021, Red Hat, Inc., 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.wildfly.clustering.infinispan.spi.persistence.sifs; import static org.infinispan.configuration.cache.AbstractStoreConfiguration.SEGMENTED; import static org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration.COMPACTION_THRESHOLD; import static org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration.OPEN_FILES_LIMIT; import org.infinispan.commons.configuration.attributes.Attribute; import org.infinispan.configuration.cache.AbstractStoreConfigurationBuilder; import org.infinispan.configuration.cache.AsyncStoreConfiguration; import org.infinispan.configuration.cache.PersistenceConfigurationBuilder; import org.infinispan.configuration.global.GlobalConfiguration; import org.infinispan.configuration.global.GlobalStateConfiguration; import org.infinispan.persistence.PersistenceUtil; import org.infinispan.persistence.sifs.Log; import org.infinispan.persistence.sifs.NonBlockingSoftIndexFileStore; import org.infinispan.persistence.sifs.configuration.DataConfiguration; import org.infinispan.persistence.sifs.configuration.DataConfigurationBuilder; import org.infinispan.persistence.sifs.configuration.IndexConfiguration; import org.infinispan.persistence.sifs.configuration.IndexConfigurationBuilder; import org.infinispan.util.logging.LogFactory; /** * Workaround for ISPN-13605. * @author Paul Ferraro */ public class SoftIndexFileStoreConfigurationBuilder extends AbstractStoreConfigurationBuilder<SoftIndexFileStoreConfiguration, SoftIndexFileStoreConfigurationBuilder> { private static final Log LOG = LogFactory.getLog(SoftIndexFileStoreConfigurationBuilder.class, Log.class); protected final IndexConfigurationBuilder index = new IndexConfigurationBuilder(); protected final DataConfigurationBuilder data = new DataConfigurationBuilder(); public SoftIndexFileStoreConfigurationBuilder(PersistenceConfigurationBuilder builder) { super(builder, org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration.attributeDefinitionSet(), AsyncStoreConfiguration.attributeDefinitionSet()); } /** * The path where the Soft-Index store will keep its data files. Under this location the store will create * a directory named after the cache name, under which a <code>data</code> directory will be created. * * The default behaviour is to use the {@link GlobalStateConfiguration#persistentLocation()}. */ public SoftIndexFileStoreConfigurationBuilder dataLocation(String dataLocation) { this.data.dataLocation(dataLocation); return this; } /** * The path where the Soft-Index store will keep its index files. Under this location the store will create * a directory named after the cache name, under which a <code>index</code> directory will be created. * * The default behaviour is to use the {@link GlobalStateConfiguration#persistentLocation()}. */ public SoftIndexFileStoreConfigurationBuilder indexLocation(String indexLocation) { this.index.indexLocation(indexLocation); return this; } /** * Number of index segment files. Increasing this value improves throughput but requires more threads to be spawned. * <p> * Defaults to <code>16</code>. */ public SoftIndexFileStoreConfigurationBuilder indexSegments(int indexSegments) { this.index.indexSegments(indexSegments); return this; } /** * Sets the maximum size of single data file with entries, in bytes. * * Defaults to <code>16777216</code> (16MB). */ public SoftIndexFileStoreConfigurationBuilder maxFileSize(int maxFileSize) { this.data.maxFileSize(maxFileSize); return this; } /** * If the size of the node (continuous block on filesystem used in index implementation) drops below this threshold, * the node will try to balance its size with some neighbour node, possibly causing join of multiple nodes. * * Defaults to <code>0</code>. */ public SoftIndexFileStoreConfigurationBuilder minNodeSize(int minNodeSize) { this.index.minNodeSize(minNodeSize); return this; } /** * Max size of node (continuous block on filesystem used in index implementation), in bytes. * * Defaults to <code>4096</code>. */ public SoftIndexFileStoreConfigurationBuilder maxNodeSize(int maxNodeSize) { this.index.maxNodeSize(maxNodeSize); return this; } /** * Sets the maximum number of entry writes that are waiting to be written to the index, per index segment. * * Defaults to <code>1000</code>. */ public SoftIndexFileStoreConfigurationBuilder indexQueueLength(int indexQueueLength) { this.index.indexQueueLength(indexQueueLength); return this; } /** * Sets whether writes shoud wait to be fsynced to disk. * * Defaults to <code>false</code>. */ public SoftIndexFileStoreConfigurationBuilder syncWrites(boolean syncWrites) { this.data.syncWrites(syncWrites); return this; } /** * Sets the maximum number of open files. * * Defaults to <code>1000</code>. */ public SoftIndexFileStoreConfigurationBuilder openFilesLimit(int openFilesLimit) { this.attributes.attribute(OPEN_FILES_LIMIT).set(openFilesLimit); return this; } /** * If the amount of unused space in some data file gets above this threshold, the file is compacted - entries from that file are copied to a new file and the old file is deleted. * * Defaults to <code>0.5</code> (50%). */ public SoftIndexFileStoreConfigurationBuilder compactionThreshold(double compactionThreshold) { this.attributes.attribute(COMPACTION_THRESHOLD).set(compactionThreshold); return this; } @Override public SoftIndexFileStoreConfiguration create() { return new SoftIndexFileStoreConfiguration(this.attributes.protect(), this.async.create(), this.index.create(), this.data.create()); } @Override public SoftIndexFileStoreConfigurationBuilder read(SoftIndexFileStoreConfiguration template) { super.read(template); this.index.read(template.index()); this.data.read(template.data()); return this; } @Override public SoftIndexFileStoreConfigurationBuilder self() { return this; } @Override protected void validate (boolean skipClassChecks) { Attribute<Boolean> segmentedAttribute = this.attributes.attribute(SEGMENTED); if (segmentedAttribute.isModified() && !segmentedAttribute.get()) { throw org.infinispan.util.logging.Log.CONFIG.storeRequiresBeingSegmented(NonBlockingSoftIndexFileStore.class.getSimpleName()); } super.validate(skipClassChecks); this.index.validate(); double compactionThreshold = this.attributes.attribute(COMPACTION_THRESHOLD).get(); if (compactionThreshold <= 0 || compactionThreshold > 1) { throw LOG.invalidCompactionThreshold(compactionThreshold); } } @Override public void validate(GlobalConfiguration globalConfig) { PersistenceUtil.validateGlobalStateStoreLocation(globalConfig, NonBlockingSoftIndexFileStore.class.getSimpleName(), this.data.attributes().attribute(DataConfiguration.DATA_LOCATION), this.index.attributes().attribute(IndexConfiguration.INDEX_LOCATION)); super.validate(globalConfig); } @Override public String toString () { return String.format("SoftIndexFileStoreConfigurationBuilder{index=%s, data=%s, attributes=%s, async=%s}", this.index, this.data, this.attributes, this.async); } }
jstourac/wildfly
clustering/infinispan/spi/src/main/java/org/wildfly/clustering/infinispan/spi/persistence/sifs/SoftIndexFileStoreConfigurationBuilder.java
Java
lgpl-2.1
8,817
/* * qemu_domain.h: QEMU domain private state * * Copyright (C) 2006-2011 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * 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 * * Author: Daniel P. Berrange <[email protected]> */ #include <config.h> #include "qemu_domain.h" #include "qemu_command.h" #include "memory.h" #include "logging.h" #include "virterror_internal.h" #include "c-ctype.h" #include <sys/time.h> #include <libxml/xpathInternals.h> #define VIR_FROM_THIS VIR_FROM_QEMU #define QEMU_NAMESPACE_HREF "http://libvirt.org/schemas/domain/qemu/1.0" #define timeval_to_ms(tv) (((tv).tv_sec * 1000ull) + ((tv).tv_usec / 1000)) static void *qemuDomainObjPrivateAlloc(void) { qemuDomainObjPrivatePtr priv; if (VIR_ALLOC(priv) < 0) return NULL; return priv; } static void qemuDomainObjPrivateFree(void *data) { qemuDomainObjPrivatePtr priv = data; qemuDomainPCIAddressSetFree(priv->pciaddrs); virDomainChrSourceDefFree(priv->monConfig); VIR_FREE(priv->vcpupids); /* This should never be non-NULL if we get here, but just in case... */ if (priv->mon) { VIR_ERROR0(_("Unexpected QEMU monitor still active during domain deletion")); qemuMonitorClose(priv->mon); } VIR_FREE(priv); } static int qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data) { qemuDomainObjPrivatePtr priv = data; const char *monitorpath; /* priv->monitor_chr is set only for qemu */ if (priv->monConfig) { switch (priv->monConfig->type) { case VIR_DOMAIN_CHR_TYPE_UNIX: monitorpath = priv->monConfig->data.nix.path; break; default: case VIR_DOMAIN_CHR_TYPE_PTY: monitorpath = priv->monConfig->data.file.path; break; } virBufferEscapeString(buf, " <monitor path='%s'", monitorpath); if (priv->monJSON) virBufferAddLit(buf, " json='1'"); virBufferVSprintf(buf, " type='%s'/>\n", virDomainChrTypeToString(priv->monConfig->type)); } if (priv->nvcpupids) { int i; virBufferAddLit(buf, " <vcpus>\n"); for (i = 0 ; i < priv->nvcpupids ; i++) { virBufferVSprintf(buf, " <vcpu pid='%d'/>\n", priv->vcpupids[i]); } virBufferAddLit(buf, " </vcpus>\n"); } return 0; } static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) { qemuDomainObjPrivatePtr priv = data; char *monitorpath; char *tmp; int n, i; xmlNodePtr *nodes = NULL; if (VIR_ALLOC(priv->monConfig) < 0) { virReportOOMError(); goto error; } if (!(monitorpath = virXPathString("string(./monitor[1]/@path)", ctxt))) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no monitor path")); goto error; } tmp = virXPathString("string(./monitor[1]/@type)", ctxt); if (tmp) priv->monConfig->type = virDomainChrTypeFromString(tmp); else priv->monConfig->type = VIR_DOMAIN_CHR_TYPE_PTY; VIR_FREE(tmp); if (virXPathBoolean("count(./monitor[@json = '1']) > 0", ctxt)) { priv->monJSON = 1; } else { priv->monJSON = 0; } switch (priv->monConfig->type) { case VIR_DOMAIN_CHR_TYPE_PTY: priv->monConfig->data.file.path = monitorpath; break; case VIR_DOMAIN_CHR_TYPE_UNIX: priv->monConfig->data.nix.path = monitorpath; break; default: VIR_FREE(monitorpath); qemuReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported monitor type '%s'"), virDomainChrTypeToString(priv->monConfig->type)); goto error; } n = virXPathNodeSet("./vcpus/vcpu", ctxt, &nodes); if (n < 0) goto error; if (n) { priv->nvcpupids = n; if (VIR_REALLOC_N(priv->vcpupids, priv->nvcpupids) < 0) { virReportOOMError(); goto error; } for (i = 0 ; i < n ; i++) { char *pidstr = virXMLPropString(nodes[i], "pid"); if (!pidstr) goto error; if (virStrToLong_i(pidstr, NULL, 10, &(priv->vcpupids[i])) < 0) { VIR_FREE(pidstr); goto error; } VIR_FREE(pidstr); } VIR_FREE(nodes); } return 0; error: virDomainChrSourceDefFree(priv->monConfig); priv->monConfig = NULL; VIR_FREE(nodes); return -1; } static void qemuDomainDefNamespaceFree(void *nsdata) { qemuDomainCmdlineDefPtr cmd = nsdata; unsigned int i; if (!cmd) return; for (i = 0; i < cmd->num_args; i++) VIR_FREE(cmd->args[i]); for (i = 0; i < cmd->num_env; i++) { VIR_FREE(cmd->env_name[i]); VIR_FREE(cmd->env_value[i]); } VIR_FREE(cmd->args); VIR_FREE(cmd->env_name); VIR_FREE(cmd->env_value); VIR_FREE(cmd); } static int qemuDomainDefNamespaceParse(xmlDocPtr xml, xmlNodePtr root, xmlXPathContextPtr ctxt, void **data) { qemuDomainCmdlineDefPtr cmd = NULL; xmlNsPtr ns; xmlNodePtr *nodes = NULL; int n, i; ns = xmlSearchNs(xml, root, BAD_CAST "qemu"); if (!ns) /* this is fine; it just means there was no qemu namespace listed */ return 0; if (STRNEQ((const char *)ns->href, QEMU_NAMESPACE_HREF)) { qemuReportError(VIR_ERR_INTERNAL_ERROR, _("Found namespace '%s' doesn't match expected '%s'"), ns->href, QEMU_NAMESPACE_HREF); return -1; } if (xmlXPathRegisterNs(ctxt, ns->prefix, ns->href) < 0) { qemuReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to register xml namespace '%s'"), ns->href); return -1; } if (VIR_ALLOC(cmd) < 0) { virReportOOMError(); return -1; } /* first handle the extra command-line arguments */ n = virXPathNodeSet("./qemu:commandline/qemu:arg", ctxt, &nodes); if (n < 0) /* virXPathNodeSet already set the error */ goto error; if (n && VIR_ALLOC_N(cmd->args, n) < 0) goto no_memory; for (i = 0; i < n; i++) { cmd->args[cmd->num_args] = virXMLPropString(nodes[i], "value"); if (cmd->args[cmd->num_args] == NULL) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("No qemu command-line argument specified")); goto error; } cmd->num_args++; } VIR_FREE(nodes); /* now handle the extra environment variables */ n = virXPathNodeSet("./qemu:commandline/qemu:env", ctxt, &nodes); if (n < 0) /* virXPathNodeSet already set the error */ goto error; if (n && VIR_ALLOC_N(cmd->env_name, n) < 0) goto no_memory; if (n && VIR_ALLOC_N(cmd->env_value, n) < 0) goto no_memory; for (i = 0; i < n; i++) { char *tmp; tmp = virXMLPropString(nodes[i], "name"); if (tmp == NULL) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("No qemu environment name specified")); goto error; } if (tmp[0] == '\0') { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Empty qemu environment name specified")); goto error; } if (!c_isalpha(tmp[0]) && tmp[0] != '_') { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid environment name, it must begin with a letter or underscore")); goto error; } if (strspn(tmp, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_") != strlen(tmp)) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid environment name, it must contain only alphanumerics and underscore")); goto error; } cmd->env_name[cmd->num_env] = tmp; cmd->env_value[cmd->num_env] = virXMLPropString(nodes[i], "value"); /* a NULL value for command is allowed, since it might be empty */ cmd->num_env++; } VIR_FREE(nodes); *data = cmd; return 0; no_memory: virReportOOMError(); error: VIR_FREE(nodes); qemuDomainDefNamespaceFree(cmd); return -1; } static int qemuDomainDefNamespaceFormatXML(virBufferPtr buf, void *nsdata) { qemuDomainCmdlineDefPtr cmd = nsdata; unsigned int i; if (!cmd->num_args && !cmd->num_env) return 0; virBufferAddLit(buf, " <qemu:commandline>\n"); for (i = 0; i < cmd->num_args; i++) virBufferEscapeString(buf, " <qemu:arg value='%s'/>\n", cmd->args[i]); for (i = 0; i < cmd->num_env; i++) { virBufferVSprintf(buf, " <qemu:env name='%s'", cmd->env_name[i]); if (cmd->env_value[i]) virBufferEscapeString(buf, " value='%s'", cmd->env_value[i]); virBufferAddLit(buf, "/>\n"); } virBufferAddLit(buf, " </qemu:commandline>\n"); return 0; } static const char * qemuDomainDefNamespaceHref(void) { return "xmlns:qemu='" QEMU_NAMESPACE_HREF "'"; } void qemuDomainSetPrivateDataHooks(virCapsPtr caps) { /* Domain XML parser hooks */ caps->privateDataAllocFunc = qemuDomainObjPrivateAlloc; caps->privateDataFreeFunc = qemuDomainObjPrivateFree; caps->privateDataXMLFormat = qemuDomainObjPrivateXMLFormat; caps->privateDataXMLParse = qemuDomainObjPrivateXMLParse; } void qemuDomainSetNamespaceHooks(virCapsPtr caps) { /* Domain Namespace XML parser hooks */ caps->ns.parse = qemuDomainDefNamespaceParse; caps->ns.free = qemuDomainDefNamespaceFree; caps->ns.format = qemuDomainDefNamespaceFormatXML; caps->ns.href = qemuDomainDefNamespaceHref; } /* * obj must be locked before calling, qemud_driver must NOT be locked * * This must be called by anything that will change the VM state * in any way, or anything that will use the QEMU monitor. * * Upon successful return, the object will have its ref count increased, * successful calls must be followed by EndJob eventually */ /* Give up waiting for mutex after 30 seconds */ #define QEMU_JOB_WAIT_TIME (1000ull * 30) int qemuDomainObjBeginJob(virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; struct timeval now; unsigned long long then; if (gettimeofday(&now, NULL) < 0) { virReportSystemError(errno, "%s", _("cannot get time of day")); return -1; } then = timeval_to_ms(now) + QEMU_JOB_WAIT_TIME; virDomainObjRef(obj); while (priv->jobActive) { if (virCondWaitUntil(&priv->jobCond, &obj->lock, then) < 0) { virDomainObjUnref(obj); if (errno == ETIMEDOUT) qemuReportError(VIR_ERR_OPERATION_TIMEOUT, "%s", _("cannot acquire state change lock")); else virReportSystemError(errno, "%s", _("cannot acquire job mutex")); return -1; } } priv->jobActive = QEMU_JOB_UNSPECIFIED; priv->jobSignals = 0; memset(&priv->jobSignalsData, 0, sizeof(priv->jobSignalsData)); priv->jobStart = timeval_to_ms(now); memset(&priv->jobInfo, 0, sizeof(priv->jobInfo)); return 0; } /* * obj must be locked before calling, qemud_driver must be locked * * This must be called by anything that will change the VM state * in any way, or anything that will use the QEMU monitor. */ int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver, virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; struct timeval now; unsigned long long then; if (gettimeofday(&now, NULL) < 0) { virReportSystemError(errno, "%s", _("cannot get time of day")); return -1; } then = timeval_to_ms(now) + QEMU_JOB_WAIT_TIME; virDomainObjRef(obj); qemuDriverUnlock(driver); while (priv->jobActive) { if (virCondWaitUntil(&priv->jobCond, &obj->lock, then) < 0) { virDomainObjUnref(obj); if (errno == ETIMEDOUT) qemuReportError(VIR_ERR_OPERATION_TIMEOUT, "%s", _("cannot acquire state change lock")); else virReportSystemError(errno, "%s", _("cannot acquire job mutex")); qemuDriverLock(driver); return -1; } } priv->jobActive = QEMU_JOB_UNSPECIFIED; priv->jobSignals = 0; memset(&priv->jobSignalsData, 0, sizeof(priv->jobSignalsData)); priv->jobStart = timeval_to_ms(now); memset(&priv->jobInfo, 0, sizeof(priv->jobInfo)); virDomainObjUnlock(obj); qemuDriverLock(driver); virDomainObjLock(obj); return 0; } /* * obj must be locked before calling, qemud_driver does not matter * * To be called after completing the work associated with the * earlier qemuDomainBeginJob() call * * Returns remaining refcount on 'obj', maybe 0 to indicated it * was deleted */ int qemuDomainObjEndJob(virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; priv->jobActive = QEMU_JOB_NONE; priv->jobSignals = 0; memset(&priv->jobSignalsData, 0, sizeof(priv->jobSignalsData)); priv->jobStart = 0; memset(&priv->jobInfo, 0, sizeof(priv->jobInfo)); virCondSignal(&priv->jobCond); return virDomainObjUnref(obj); } /* * obj must be locked before calling, qemud_driver must be unlocked * * To be called immediately before any QEMU monitor API call * Must have already called qemuDomainObjBeginJob(), and checked * that the VM is still active. * * To be followed with qemuDomainObjExitMonitor() once complete */ void qemuDomainObjEnterMonitor(virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; qemuMonitorLock(priv->mon); qemuMonitorRef(priv->mon); virDomainObjUnlock(obj); } /* obj must NOT be locked before calling, qemud_driver must be unlocked * * Should be paired with an earlier qemuDomainObjEnterMonitor() call */ void qemuDomainObjExitMonitor(virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; int refs; refs = qemuMonitorUnref(priv->mon); if (refs > 0) qemuMonitorUnlock(priv->mon); virDomainObjLock(obj); if (refs == 0) { priv->mon = NULL; } } /* * obj must be locked before calling, qemud_driver must be locked * * To be called immediately before any QEMU monitor API call * Must have already called qemuDomainObjBeginJob(). * * To be followed with qemuDomainObjExitMonitorWithDriver() once complete */ void qemuDomainObjEnterMonitorWithDriver(struct qemud_driver *driver, virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; qemuMonitorLock(priv->mon); qemuMonitorRef(priv->mon); virDomainObjUnlock(obj); qemuDriverUnlock(driver); } /* obj must NOT be locked before calling, qemud_driver must be unlocked, * and will be locked after returning * * Should be paired with an earlier qemuDomainObjEnterMonitorWithDriver() call */ void qemuDomainObjExitMonitorWithDriver(struct qemud_driver *driver, virDomainObjPtr obj) { qemuDomainObjPrivatePtr priv = obj->privateData; int refs; refs = qemuMonitorUnref(priv->mon); if (refs > 0) qemuMonitorUnlock(priv->mon); qemuDriverLock(driver); virDomainObjLock(obj); if (refs == 0) { priv->mon = NULL; } } void qemuDomainObjEnterRemoteWithDriver(struct qemud_driver *driver, virDomainObjPtr obj) { virDomainObjRef(obj); virDomainObjUnlock(obj); qemuDriverUnlock(driver); } void qemuDomainObjExitRemoteWithDriver(struct qemud_driver *driver, virDomainObjPtr obj) { qemuDriverLock(driver); virDomainObjLock(obj); virDomainObjUnref(obj); }
sshah-solarflare/Libvirt-PCI-passthrough-
src/qemu/qemu_domain.c
C
lgpl-2.1
17,049
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "./"; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _addClass = __webpack_require__(25); var _addClass2 = _interopRequireDefault(_addClass); var _removeClass = __webpack_require__(26); var _removeClass2 = _interopRequireDefault(_removeClass); var _after = __webpack_require__(96); var _after2 = _interopRequireDefault(_after); var _browser = __webpack_require__(97); var _browser2 = _interopRequireDefault(_browser); var _fix = __webpack_require__(98); var _fix2 = _interopRequireDefault(_fix); var _util = __webpack_require__(27); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // fix hexo 不支持的配置 function isPathMatch(path, href) { var reg = /\/|index.html/g; return path.replace(reg, '') === href.replace(reg, ''); } // 浏览器判断 function tabActive() { var $tabs = document.querySelectorAll('.js-header-menu li a'); var path = window.location.pathname; for (var i = 0, len = $tabs.length; i < len; i++) { var $tab = $tabs[i]; if (isPathMatch(path, $tab.getAttribute('href'))) { (0, _addClass2.default)($tab, 'active'); } } } function getElementLeft(element) { var actualLeft = element.offsetLeft; var current = element.offsetParent; while (current !== null) { actualLeft += current.offsetLeft; current = current.offsetParent; } return actualLeft; } function getElementTop(element) { var actualTop = element.offsetTop; var current = element.offsetParent; while (current !== null) { actualTop += current.offsetTop; current = current.offsetParent; } return actualTop; } function scrollStop($dom, top, limit, zIndex, diff) { var nowLeft = getElementLeft($dom); var nowTop = getElementTop($dom) - top; if (nowTop - limit <= diff) { var $newDom = $dom.$newDom; if (!$newDom) { $newDom = $dom.cloneNode(true); (0, _after2.default)($dom, $newDom); $dom.$newDom = $newDom; $newDom.style.position = 'fixed'; $newDom.style.top = (limit || nowTop) + 'px'; $newDom.style.left = nowLeft + 'px'; $newDom.style.zIndex = zIndex || 2; $newDom.style.width = '100%'; $newDom.style.color = '#fff'; } $newDom.style.visibility = 'visible'; $dom.style.visibility = 'hidden'; } else { $dom.style.visibility = 'visible'; var _$newDom = $dom.$newDom; if (_$newDom) { _$newDom.style.visibility = 'hidden'; } } } function handleScroll() { var $overlay = document.querySelector('.js-overlay'); var $menu = document.querySelector('.js-header-menu'); scrollStop($overlay, document.body.scrollTop, -63, 2, 0); scrollStop($menu, document.body.scrollTop, 1, 3, 0); } function bindScroll() { document.querySelector('#container').addEventListener('scroll', function (e) { handleScroll(); }); window.addEventListener('scroll', function (e) { handleScroll(); }); handleScroll(); } function init() { if (_browser2.default.versions.mobile && window.screen.width < 800) { tabActive(); bindScroll(); } } init(); (0, _util.addLoadEvent)(function () { _fix2.default.init(); }); module.exports = {}; /***/ }, /* 1 */, /* 2 */, /* 3 */, /* 4 */, /* 5 */, /* 6 */, /* 7 */, /* 8 */, /* 9 */, /* 10 */, /* 11 */, /* 12 */, /* 13 */, /* 14 */, /* 15 */, /* 16 */, /* 17 */, /* 18 */, /* 19 */, /* 20 */, /* 21 */, /* 22 */, /* 23 */, /* 24 */, /* 25 */ /***/ function(module, exports) { /** * addClass : addClass(el, className) * Adds a class name to an element. Compare with `$.fn.addClass`. * * var addClass = require('dom101/add-class'); * * addClass(el, 'active'); */ function addClass (el, className) { if (el.classList) { el.classList.add(className); } else { el.className += ' ' + className; } } module.exports = addClass; /***/ }, /* 26 */ /***/ function(module, exports) { /** * removeClass : removeClass(el, className) * Removes a classname. * * var removeClass = require('dom101/remove-class'); * * el.className = 'selected active'; * removeClass(el, 'active'); * * el.className * => "selected" */ function removeClass (el, className) { if (el.classList) { el.classList.remove(className); } else { var expr = new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'); el.className = el.className.replace(expr, ' '); } } module.exports = removeClass; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _typeof2 = __webpack_require__(28); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var e = function () { function r(e, r, n) { return r || n ? String.fromCharCode(r || n) : u[e] || e; } function n(e) { return p[e]; } var t = /&quot;|&lt;|&gt;|&amp;|&nbsp;|&apos;|&#(\d+);|&#(\d+)/g, o = /['<> "&]/g, u = { "&quot;": '"', "&lt;": "<", "&gt;": ">", "&amp;": "&", "&nbsp;": " " }, c = /\u00a0/g, a = /<br\s*\/?>/gi, i = /\r?\n/g, f = /\s/g, p = {}; for (var s in u) { p[u[s]] = s; }return u["&apos;"] = "'", p["'"] = "&#39;", { encode: function encode(e) { return e ? ("" + e).replace(o, n).replace(i, "<br/>").replace(f, "&nbsp;") : ""; }, decode: function decode(e) { return e ? ("" + e).replace(a, "\n").replace(t, r).replace(c, " ") : ""; }, encodeBase16: function encodeBase16(e) { if (!e) return e; e += ""; for (var r = [], n = 0, t = e.length; t > n; n++) { r.push(e.charCodeAt(n).toString(16).toUpperCase()); }return r.join(""); }, encodeBase16forJSON: function encodeBase16forJSON(e) { if (!e) return e; e = e.replace(/[\u4E00-\u9FBF]/gi, function (e) { return escape(e).replace("%u", "\\u"); }); for (var r = [], n = 0, t = e.length; t > n; n++) { r.push(e.charCodeAt(n).toString(16).toUpperCase()); }return r.join(""); }, decodeBase16: function decodeBase16(e) { if (!e) return e; e += ""; for (var r = [], n = 0, t = e.length; t > n; n += 2) { r.push(String.fromCharCode("0x" + e.slice(n, n + 2))); }return r.join(""); }, encodeObject: function encodeObject(r) { if (r instanceof Array) for (var n = 0, t = r.length; t > n; n++) { r[n] = e.encodeObject(r[n]); } else if ("object" == (typeof r === "undefined" ? "undefined" : (0, _typeof3.default)(r))) for (var o in r) { r[o] = e.encodeObject(r[o]); } else if ("string" == typeof r) return e.encode(r); return r; }, loadScript: function loadScript(path) { var $script = document.createElement('script'); document.getElementsByTagName('body')[0].appendChild($script); $script.setAttribute('src', path); }, addLoadEvent: function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != "function") { window.onload = func; } else { window.onload = function () { oldonload(); func(); }; } } }; }(); module.exports = e; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _iterator = __webpack_require__(29); var _iterator2 = _interopRequireDefault(_iterator); var _symbol = __webpack_require__(80); var _symbol2 = _interopRequireDefault(_symbol); var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof(obj); } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); }; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(30), __esModule: true }; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(31); __webpack_require__(75); module.exports = __webpack_require__(79).f('iterator'); /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $at = __webpack_require__(32)(true); // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(35)(String, 'String', function(iterated){ this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var O = this._t , index = this._i , point; if(index >= O.length)return {value: undefined, done: true}; point = $at(O, index); this._i += point.length; return {value: point, done: false}; }); /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(33) , defined = __webpack_require__(34); // true -> String#at // false -> String#codePointAt module.exports = function(TO_STRING){ return function(that, pos){ var s = String(defined(that)) , i = toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }, /* 33 */ /***/ function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }, /* 34 */ /***/ function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var LIBRARY = __webpack_require__(36) , $export = __webpack_require__(37) , redefine = __webpack_require__(52) , hide = __webpack_require__(42) , has = __webpack_require__(53) , Iterators = __webpack_require__(54) , $iterCreate = __webpack_require__(55) , setToStringTag = __webpack_require__(71) , getPrototypeOf = __webpack_require__(73) , ITERATOR = __webpack_require__(72)('iterator') , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` , FF_ITERATOR = '@@iterator' , KEYS = 'keys' , VALUES = 'values'; var returnThis = function(){ return this; }; module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ $iterCreate(Constructor, NAME, next); var getMethod = function(kind){ if(!BUGGY && kind in proto)return proto[kind]; switch(kind){ case KEYS: return function keys(){ return new Constructor(this, kind); }; case VALUES: return function values(){ return new Constructor(this, kind); }; } return function entries(){ return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator' , DEF_VALUES = DEFAULT == VALUES , VALUES_BUG = false , proto = Base.prototype , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] , $default = $native || getMethod(DEFAULT) , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined , $anyNative = NAME == 'Array' ? proto.entries || $native : $native , methods, key, IteratorPrototype; // Fix native if($anyNative){ IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); if(IteratorPrototype !== Object.prototype){ // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if(DEF_VALUES && $native && $native.name !== VALUES){ VALUES_BUG = true; $default = function values(){ return $native.call(this); }; } // Define iterator if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if(DEFAULT){ methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if(FORCED)for(key in methods){ if(!(key in proto))redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }, /* 36 */ /***/ function(module, exports) { module.exports = true; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(38) , core = __webpack_require__(39) , ctx = __webpack_require__(40) , hide = __webpack_require__(42) , PROTOTYPE = 'prototype'; var $export = function(type, name, source){ var IS_FORCED = type & $export.F , IS_GLOBAL = type & $export.G , IS_STATIC = type & $export.S , IS_PROTO = type & $export.P , IS_BIND = type & $export.B , IS_WRAP = type & $export.W , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) , expProto = exports[PROTOTYPE] , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] , key, own, out; if(IS_GLOBAL)source = name; for(key in source){ // contains in native own = !IS_FORCED && target && target[key] !== undefined; if(own && key in exports)continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function(C){ var F = function(a, b, c){ if(this instanceof C){ switch(arguments.length){ case 0: return new C; case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if(IS_PROTO){ (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); } } }; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }, /* 38 */ /***/ function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef /***/ }, /* 39 */ /***/ function(module, exports) { var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(41); module.exports = function(fn, that, length){ aFunction(fn); if(that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); }; case 2: return function(a, b){ return fn.call(that, a, b); }; case 3: return function(a, b, c){ return fn.call(that, a, b, c); }; } return function(/* ...args */){ return fn.apply(that, arguments); }; }; /***/ }, /* 41 */ /***/ function(module, exports) { module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { var dP = __webpack_require__(43) , createDesc = __webpack_require__(51); module.exports = __webpack_require__(47) ? function(object, key, value){ return dP.f(object, key, createDesc(1, value)); } : function(object, key, value){ object[key] = value; return object; }; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { var anObject = __webpack_require__(44) , IE8_DOM_DEFINE = __webpack_require__(46) , toPrimitive = __webpack_require__(50) , dP = Object.defineProperty; exports.f = __webpack_require__(47) ? Object.defineProperty : function defineProperty(O, P, Attributes){ anObject(O); P = toPrimitive(P, true); anObject(Attributes); if(IE8_DOM_DEFINE)try { return dP(O, P, Attributes); } catch(e){ /* empty */ } if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); if('value' in Attributes)O[P] = Attributes.value; return O; }; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(45); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; /***/ }, /* 45 */ /***/ function(module, exports) { module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(47) && !__webpack_require__(48)(function(){ return Object.defineProperty(__webpack_require__(49)('div'), 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(48)(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }, /* 48 */ /***/ function(module, exports) { module.exports = function(exec){ try { return !!exec(); } catch(e){ return true; } }; /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(45) , document = __webpack_require__(38).document // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); module.exports = function(it){ return is ? document.createElement(it) : {}; }; /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(45); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function(it, S){ if(!isObject(it))return it; var fn, val; if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }, /* 51 */ /***/ function(module, exports) { module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; }; /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(42); /***/ }, /* 53 */ /***/ function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; /***/ }, /* 54 */ /***/ function(module, exports) { module.exports = {}; /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var create = __webpack_require__(56) , descriptor = __webpack_require__(51) , setToStringTag = __webpack_require__(71) , IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__(42)(IteratorPrototype, __webpack_require__(72)('iterator'), function(){ return this; }); module.exports = function(Constructor, NAME, next){ Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = __webpack_require__(44) , dPs = __webpack_require__(57) , enumBugKeys = __webpack_require__(69) , IE_PROTO = __webpack_require__(66)('IE_PROTO') , Empty = function(){ /* empty */ } , PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function(){ // Thrash, waste and sodomy: IE GC bug var iframe = __webpack_require__(49)('iframe') , i = enumBugKeys.length , lt = '<' , gt = '>' , iframeDocument; iframe.style.display = 'none'; __webpack_require__(70).appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties){ var result; if(O !== null){ Empty[PROTOTYPE] = anObject(O); result = new Empty; Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { var dP = __webpack_require__(43) , anObject = __webpack_require__(44) , getKeys = __webpack_require__(58); module.exports = __webpack_require__(47) ? Object.defineProperties : function defineProperties(O, Properties){ anObject(O); var keys = getKeys(Properties) , length = keys.length , i = 0 , P; while(length > i)dP.f(O, P = keys[i++], Properties[P]); return O; }; /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(59) , enumBugKeys = __webpack_require__(69); module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { var has = __webpack_require__(53) , toIObject = __webpack_require__(60) , arrayIndexOf = __webpack_require__(63)(false) , IE_PROTO = __webpack_require__(66)('IE_PROTO'); module.exports = function(object, names){ var O = toIObject(object) , i = 0 , result = [] , key; for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(names.length > i)if(has(O, key = names[i++])){ ~arrayIndexOf(result, key) || result.push(key); } return result; }; /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(61) , defined = __webpack_require__(34); module.exports = function(it){ return IObject(defined(it)); }; /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(62); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }, /* 62 */ /***/ function(module, exports) { var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(60) , toLength = __webpack_require__(64) , toIndex = __webpack_require__(65); module.exports = function(IS_INCLUDES){ return function($this, el, fromIndex){ var O = toIObject($this) , length = toLength(O.length) , index = toIndex(fromIndex, length) , value; // Array#includes uses SameValueZero equality algorithm if(IS_INCLUDES && el != el)while(length > index){ value = O[index++]; if(value != value)return true; // Array#toIndex ignores holes, Array#includes - not } else for(;length > index; index++)if(IS_INCLUDES || index in O){ if(O[index] === el)return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(33) , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(33) , max = Math.max , min = Math.min; module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { var shared = __webpack_require__(67)('keys') , uid = __webpack_require__(68); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(38) , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; /***/ }, /* 68 */ /***/ function(module, exports) { var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }, /* 69 */ /***/ function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }, /* 70 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(38).document && document.documentElement; /***/ }, /* 71 */ /***/ function(module, exports, __webpack_require__) { var def = __webpack_require__(43).f , has = __webpack_require__(53) , TAG = __webpack_require__(72)('toStringTag'); module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; /***/ }, /* 72 */ /***/ function(module, exports, __webpack_require__) { var store = __webpack_require__(67)('wks') , uid = __webpack_require__(68) , Symbol = __webpack_require__(38).Symbol , USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function(name){ return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; /***/ }, /* 73 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = __webpack_require__(53) , toObject = __webpack_require__(74) , IE_PROTO = __webpack_require__(66)('IE_PROTO') , ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function(O){ O = toObject(O); if(has(O, IE_PROTO))return O[IE_PROTO]; if(typeof O.constructor == 'function' && O instanceof O.constructor){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; /***/ }, /* 74 */ /***/ function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(34); module.exports = function(it){ return Object(defined(it)); }; /***/ }, /* 75 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(76); var global = __webpack_require__(38) , hide = __webpack_require__(42) , Iterators = __webpack_require__(54) , TO_STRING_TAG = __webpack_require__(72)('toStringTag'); for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ var NAME = collections[i] , Collection = global[NAME] , proto = Collection && Collection.prototype; if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } /***/ }, /* 76 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var addToUnscopables = __webpack_require__(77) , step = __webpack_require__(78) , Iterators = __webpack_require__(54) , toIObject = __webpack_require__(60); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = __webpack_require__(35)(Array, 'Array', function(iterated, kind){ this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var O = this._t , kind = this._k , index = this._i++; if(!O || index >= O.length){ this._t = undefined; return step(1); } if(kind == 'keys' )return step(0, index); if(kind == 'values')return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }, /* 77 */ /***/ function(module, exports) { module.exports = function(){ /* empty */ }; /***/ }, /* 78 */ /***/ function(module, exports) { module.exports = function(done, value){ return {value: value, done: !!done}; }; /***/ }, /* 79 */ /***/ function(module, exports, __webpack_require__) { exports.f = __webpack_require__(72); /***/ }, /* 80 */ /***/ function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(81), __esModule: true }; /***/ }, /* 81 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(82); __webpack_require__(93); __webpack_require__(94); __webpack_require__(95); module.exports = __webpack_require__(39).Symbol; /***/ }, /* 82 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // ECMAScript 6 symbols shim var global = __webpack_require__(38) , has = __webpack_require__(53) , DESCRIPTORS = __webpack_require__(47) , $export = __webpack_require__(37) , redefine = __webpack_require__(52) , META = __webpack_require__(83).KEY , $fails = __webpack_require__(48) , shared = __webpack_require__(67) , setToStringTag = __webpack_require__(71) , uid = __webpack_require__(68) , wks = __webpack_require__(72) , wksExt = __webpack_require__(79) , wksDefine = __webpack_require__(84) , keyOf = __webpack_require__(85) , enumKeys = __webpack_require__(86) , isArray = __webpack_require__(89) , anObject = __webpack_require__(44) , toIObject = __webpack_require__(60) , toPrimitive = __webpack_require__(50) , createDesc = __webpack_require__(51) , _create = __webpack_require__(56) , gOPNExt = __webpack_require__(90) , $GOPD = __webpack_require__(92) , $DP = __webpack_require__(43) , $keys = __webpack_require__(58) , gOPD = $GOPD.f , dP = $DP.f , gOPN = gOPNExt.f , $Symbol = global.Symbol , $JSON = global.JSON , _stringify = $JSON && $JSON.stringify , PROTOTYPE = 'prototype' , HIDDEN = wks('_hidden') , TO_PRIMITIVE = wks('toPrimitive') , isEnum = {}.propertyIsEnumerable , SymbolRegistry = shared('symbol-registry') , AllSymbols = shared('symbols') , OPSymbols = shared('op-symbols') , ObjectProto = Object[PROTOTYPE] , USE_NATIVE = typeof $Symbol == 'function' , QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function(){ return _create(dP({}, 'a', { get: function(){ return dP(this, 'a', {value: 7}).a; } })).a != 7; }) ? function(it, key, D){ var protoDesc = gOPD(ObjectProto, key); if(protoDesc)delete ObjectProto[key]; dP(it, key, D); if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); } : dP; var wrap = function(tag){ var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ return typeof it == 'symbol'; } : function(it){ return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D){ if(it === ObjectProto)$defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if(has(AllSymbols, key)){ if(!D.enumerable){ if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; D = _create(D, {enumerable: createDesc(0, false)}); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P){ anObject(it); var keys = enumKeys(P = toIObject(P)) , i = 0 , l = keys.length , key; while(l > i)$defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P){ return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key){ var E = isEnum.call(this, key = toPrimitive(key, true)); if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ it = toIObject(it); key = toPrimitive(key, true); if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; var D = gOPD(it, key); if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it){ var names = gOPN(toIObject(it)) , result = [] , i = 0 , key; while(names.length > i){ if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ var IS_OP = it === ObjectProto , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) , result = [] , i = 0 , key; while(names.length > i){ if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if(!USE_NATIVE){ $Symbol = function Symbol(){ if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function(value){ if(this === ObjectProto)$set.call(OPSymbols, value); if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString(){ return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; __webpack_require__(91).f = gOPNExt.f = $getOwnPropertyNames; __webpack_require__(88).f = $propertyIsEnumerable; __webpack_require__(87).f = $getOwnPropertySymbols; if(DESCRIPTORS && !__webpack_require__(36)){ redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function(name){ return wrap(wks(name)); } } $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); for(var symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(key){ if(isSymbol(key))return keyOf(SymbolRegistry, key); throw TypeError(key + ' is not a symbol!'); }, useSetter: function(){ setter = true; }, useSimple: function(){ setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it){ if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined var args = [it] , i = 1 , replacer, $replacer; while(arguments.length > i)args.push(arguments[i++]); replacer = args[1]; if(typeof replacer == 'function')$replacer = replacer; if($replacer || !isArray(replacer))replacer = function(key, value){ if($replacer)value = $replacer.call(this, key, value); if(!isSymbol(value))return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(42)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); /***/ }, /* 83 */ /***/ function(module, exports, __webpack_require__) { var META = __webpack_require__(68)('meta') , isObject = __webpack_require__(45) , has = __webpack_require__(53) , setDesc = __webpack_require__(43).f , id = 0; var isExtensible = Object.isExtensible || function(){ return true; }; var FREEZE = !__webpack_require__(48)(function(){ return isExtensible(Object.preventExtensions({})); }); var setMeta = function(it){ setDesc(it, META, {value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs }}); }; var fastKey = function(it, create){ // return primitive with prefix if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if(!has(it, META)){ // can't set metadata to uncaught frozen object if(!isExtensible(it))return 'F'; // not necessary to add metadata if(!create)return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function(it, create){ if(!has(it, META)){ // can't set metadata to uncaught frozen object if(!isExtensible(it))return true; // not necessary to add metadata if(!create)return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function(it){ if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; /***/ }, /* 84 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(38) , core = __webpack_require__(39) , LIBRARY = __webpack_require__(36) , wksExt = __webpack_require__(79) , defineProperty = __webpack_require__(43).f; module.exports = function(name){ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; /***/ }, /* 85 */ /***/ function(module, exports, __webpack_require__) { var getKeys = __webpack_require__(58) , toIObject = __webpack_require__(60); module.exports = function(object, el){ var O = toIObject(object) , keys = getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; /***/ }, /* 86 */ /***/ function(module, exports, __webpack_require__) { // all enumerable object keys, includes symbols var getKeys = __webpack_require__(58) , gOPS = __webpack_require__(87) , pIE = __webpack_require__(88); module.exports = function(it){ var result = getKeys(it) , getSymbols = gOPS.f; if(getSymbols){ var symbols = getSymbols(it) , isEnum = pIE.f , i = 0 , key; while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); } return result; }; /***/ }, /* 87 */ /***/ function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }, /* 88 */ /***/ function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }, /* 89 */ /***/ function(module, exports, __webpack_require__) { // 7.2.2 IsArray(argument) var cof = __webpack_require__(62); module.exports = Array.isArray || function isArray(arg){ return cof(arg) == 'Array'; }; /***/ }, /* 90 */ /***/ function(module, exports, __webpack_require__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = __webpack_require__(60) , gOPN = __webpack_require__(91).f , toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function(it){ try { return gOPN(it); } catch(e){ return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it){ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; /***/ }, /* 91 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = __webpack_require__(59) , hiddenKeys = __webpack_require__(69).concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ return $keys(O, hiddenKeys); }; /***/ }, /* 92 */ /***/ function(module, exports, __webpack_require__) { var pIE = __webpack_require__(88) , createDesc = __webpack_require__(51) , toIObject = __webpack_require__(60) , toPrimitive = __webpack_require__(50) , has = __webpack_require__(53) , IE8_DOM_DEFINE = __webpack_require__(46) , gOPD = Object.getOwnPropertyDescriptor; exports.f = __webpack_require__(47) ? gOPD : function getOwnPropertyDescriptor(O, P){ O = toIObject(O); P = toPrimitive(P, true); if(IE8_DOM_DEFINE)try { return gOPD(O, P); } catch(e){ /* empty */ } if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); }; /***/ }, /* 93 */ /***/ function(module, exports) { /***/ }, /* 94 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(84)('asyncIterator'); /***/ }, /* 95 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(84)('observable'); /***/ }, /* 96 */ /***/ function(module, exports) { /** * after : after(el, newEl) * Inserts a new element `newEl` just after `el`. * * var after = require('dom101/after'); * var newNode = document.createElement('div'); * var button = document.querySelector('#submit'); * * after(button, newNode); */ function after (el, newEl) { if (typeof newEl === 'string') { return el.insertAdjacentHTML('afterend', newEl); } else { var next = el.nextSibling; if (next) { return el.parentNode.insertBefore(newEl, next); } else { return el.parentNode.appendChild(newEl); } } } module.exports = after; /***/ }, /* 97 */ /***/ function(module, exports) { 'use strict'; var browser = { versions: function () { var u = window.navigator.userAgent; return { trident: u.indexOf('Trident') > -1, //IE内核 presto: u.indexOf('Presto') > -1, //opera内核 webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器 iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者安卓QQ浏览器 iPad: u.indexOf('iPad') > -1, //是否为iPad webApp: u.indexOf('Safari') == -1, //是否为web应用程序,没有头部与底部 weixin: u.indexOf('MicroMessenger') == -1 //是否为微信浏览器 }; }() }; module.exports = browser; /***/ }, /* 98 */ /***/ function(module, exports) { 'use strict'; function init() { // 由于hexo分页不支持,手工美化 var $nav = document.querySelector('#page-nav'); if ($nav && !document.querySelector('#page-nav .extend.prev')) { $nav.innerHTML = '<a class="extend prev disabled" rel="prev">&laquo; Prev</a>' + $nav.innerHTML; } if ($nav && !document.querySelector('#page-nav .extend.next')) { $nav.innerHTML = $nav.innerHTML + '<a class="extend next disabled" rel="next">Next &raquo;</a>'; } // 新窗口打开 if (yiliaConfig && yiliaConfig.open_in_new) { var $a = document.querySelectorAll('.article-entry a:not(.article-more-a)'); $a.forEach(function ($em) { $em.setAttribute('target', '_blank'); }); } // about me 转义 var $aboutme = document.querySelector('#js-aboutme'); if ($aboutme && $aboutme.length !== 0) { $aboutme.innerHTML = $aboutme.innerText; } } module.exports = { init: init }; /***/ } /******/ ]);
halochen90/Hexo-Theme-Luna
source/mobile.09c351.js
JavaScript
lgpl-2.1
51,975
/* aim_rxqueue.c This file contains the management routines for the receive (incoming packet) queue. The actual packet handlers are in aim_rxhandlers.c. */ #include "aim.h" /* This is a modified read() to make SURE we get the number of bytes we are told to, otherwise block. */ int Read(int fd, u_char *buf, int len) { int i = 0; int j = 0; while ((i < len) && (!(i < 0))) { j = read(fd, &(buf[i]), len-i); if ( (j < 0) && (errno != EAGAIN)) return -errno; /* fail */ else i += j; /* success, continue */ } #if 0 printf("\nRead Block: (%d/%04x)\n", len, len); printf("\t"); for (j = 0; j < len; j++) { if (j % 8 == 0) printf("\n\t"); if (buf[j] >= ' ' && buf[j] < 127) printf("%c=%02x ",buf[j], buf[j]); else printf("0x%02x ", buf[j]); } printf("\n\n"); #endif return i; } /* struct command_struct * get_generic( struct connection_info struct *, struct command_struct * ) Grab as many command sequences as we can off the socket, and enqueue each command in the incoming event queue in a seperate struct. */ int aim_get_command(void) { int i, readgood, j, isav, err; int s; fd_set fds; struct timeval tv; char generic[6]; struct command_rx_struct *workingStruct = NULL; struct command_rx_struct *workingPtr = NULL; struct aim_conn_t *conn = NULL; #if debug > 0 printf("Reading generic/unknown response..."); #endif /* dont wait at all (ie, never call this unless something is there) */ tv.tv_sec = 0; tv.tv_usec = 0; conn = aim_select(&tv); if (conn==NULL) return 0; /* nothing waiting */ s = conn->fd; FD_ZERO(&fds); FD_SET(s, &fds); tv.tv_sec = 0; /* wait, but only for 10us */ tv.tv_usec = 10; generic[0] = 0x00; readgood = 0; i = 0; j = 0; /* read first 6 bytes (the FLAP header only) off the socket */ while ( (select(s+1, &fds, NULL, NULL, &tv) == 1) && (i < 6)) { if ((err = Read(s, &(generic[i]), 1)) < 0) { /* error is probably not recoverable...(must be a pessimistic day) */ aim_conn_close(conn); return err; } if (readgood == 0) { if (generic[i] == 0x2a) { readgood = 1; #if debug > 1 printf("%x ", generic[i]); fflush(stdout); #endif i++; } else { #if debug > 1 printf("skipping 0x%d ", generic[i]); fflush(stdout); #endif j++; } } else { #if debug > 1 printf("%x ", generic[i]); #endif i++; } FD_ZERO(&fds); FD_SET(s, &fds); tv.tv_sec= 2; tv.tv_usec= 2; } if (generic[0] != 0x2a) { /* this really shouldn't happen, since the main loop select() should protect us from entering this function without data waiting */ printf("Bad incoming data!"); return -1; } isav = i; /* allocate a new struct */ workingStruct = (struct command_rx_struct *) malloc(sizeof(struct command_rx_struct)); workingStruct->lock = 1; /* lock the struct */ /* store type -- byte 2 */ workingStruct->type = (char) generic[1]; /* store seqnum -- bytes 3 and 4 */ workingStruct->seqnum = ( (( (unsigned int) generic[2]) & 0xFF) << 8); workingStruct->seqnum += ( (unsigned int) generic[3]) & 0xFF; /* store commandlen -- bytes 5 and 6 */ workingStruct->commandlen = ( (( (unsigned int) generic[4]) & 0xFF ) << 8); workingStruct->commandlen += ( (unsigned int) generic[5]) & 0xFF; /* malloc for data portion */ workingStruct->data = (char *) malloc(workingStruct->commandlen); /* read the data portion of the packet */ i = Read(s, workingStruct->data, workingStruct->commandlen); if (i < 0) { aim_conn_close(conn); return i; } #if debug > 0 printf(" done. (%db+%db read, %db skipped)\n", isav, i, j); #endif workingStruct->conn = conn; workingStruct->next = NULL; /* this will always be at the bottom */ workingStruct->lock = 0; /* unlock */ /* enqueue this packet */ if (aim_queue_incoming == NULL) aim_queue_incoming = workingStruct; else { workingPtr = aim_queue_incoming; while (workingPtr->next != NULL) workingPtr = workingPtr->next; workingPtr->next = workingStruct; } return 0; } /* purge_rxqueue() This is just what it sounds. It purges the receive (rx) queue of all handled commands. This is normally called from inside aim_rxdispatch() after it's processed all the commands in the queue. */ struct command_rx_struct *aim_purge_rxqueue(struct command_rx_struct *queue) { int i = 0; struct command_rx_struct *workingPtr = NULL; struct command_rx_struct *workingPtr2 = NULL; workingPtr = queue; if (queue == NULL) { return queue; } else if (queue->next == NULL) { if (queue->handled == 1) { workingPtr2 = queue; queue = NULL; free(workingPtr2->data); free(workingPtr2); } return queue; } else { for (i = 0; workingPtr != NULL; i++) { if (workingPtr->next->handled == 1) { /* save struct */ workingPtr2 = workingPtr->next; /* dequeue */ workingPtr->next = workingPtr2->next; /* free */ free(workingPtr2->data); free(workingPtr2); } workingPtr = workingPtr->next; } } return queue; }
midendian/libfaim
deprecated/aim_rxqueue.orig.c
C
lgpl-2.1
5,386
// // Created by Ulrich Eck on 26/07/2015. // #ifndef UBITRACK_GLFW_RENDERMANAGER_H #define UBITRACK_GLFW_RENDERMANAGER_H #include <string> #ifdef HAVE_GLEW #include "GL/glew.h" #endif #include <GLFW/glfw3.h> #include <utVisualization/utRenderAPI.h> namespace Ubitrack { namespace Visualization { class GLFWWindowImpl : public VirtualWindow { public: GLFWWindowImpl(int _width, int _height, const std::string& _title); ~GLFWWindowImpl(); virtual void pre_render(); virtual void post_render(); virtual void reshape(int w, int h); //custom extensions virtual void setFullscreen(bool fullscreen); virtual void onExit(); // Implementation of Public interface virtual bool is_valid(); virtual bool create(); virtual void initGL(boost::shared_ptr<CameraHandle>& cam); virtual void destroy(); private: GLFWwindow* m_pWindow; boost::shared_ptr<CameraHandle> m_pEventHandler; }; // callback implementations for GLFW inline static void WindowResizeCallback( GLFWwindow *win, int w, int h) { CameraHandle *cam = static_cast<CameraHandle*>(glfwGetWindowUserPointer(win)); cam->on_window_size(w, h); } inline static void WindowRefreshCallback(GLFWwindow *win) { CameraHandle *cam = static_cast<CameraHandle*>(glfwGetWindowUserPointer(win)); cam->on_render(glfwGetTime()); } inline static void WindowCloseCallback(GLFWwindow *win) { CameraHandle *cam = static_cast<CameraHandle*>(glfwGetWindowUserPointer(win)); cam->on_window_close(); } inline static void WindowKeyCallback(GLFWwindow *win, int key, int scancode, int action, int mods) { CameraHandle *cam = static_cast<CameraHandle*>(glfwGetWindowUserPointer(win)); if ((action == GLFW_PRESS) && (mods & GLFW_MOD_ALT)) { switch (key) { case GLFW_KEY_F: cam->on_fullscreen(); return; default: break; } } if (action == GLFW_PRESS) { switch (key) { case GLFW_KEY_ESCAPE: cam->on_exit(); return; default: cam->on_keypress(key, scancode, action, mods); break; } } } inline static void WindowCursorPosCallback(GLFWwindow *win, double xpos, double ypos) { CameraHandle *cam = static_cast<CameraHandle*>(glfwGetWindowUserPointer(win)); cam->on_cursorpos(xpos, ypos); } } } #endif //UBITRACK_GLFW_RENDERMANAGER_H
Ubitrack/utvisualization
apps/GLFWConsole/glfw_rendermanager.h
C
lgpl-2.1
2,941
///////////////////////////////////////////////////////////////////////////// // Name: help.cpp // Purpose: wxHtml sample: help test // Author: ? // Modified by: // Created: ? // RCS-ID: $Id$ // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWidgets headers #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wx/image.h" #include "wx/html/helpfrm.h" #include "wx/html/helpctrl.h" #include "wx/filesys.h" #include "wx/fs_zip.h" #ifndef wxHAS_IMAGES_IN_RESOURCES #include "../../sample.xpm" #endif // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- // Define a new application type, each program should derive a class from wxApp class MyApp : public wxApp { public: // override base class virtuals // ---------------------------- // this one is called on application startup and is a good place for the app // initialization (doing it here and not in the ctor allows to have an error // return: if OnInit() returns false, the application terminates) virtual bool OnInit(); }; // Define a new frame type: this is going to be our main frame class MyFrame : public wxFrame { public: // ctor(s) MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); // event handlers (these functions should _not_ be virtual) void OnQuit(wxCommandEvent& event); void OnHelp(wxCommandEvent& event); void OnClose(wxCloseEvent& event); private: wxHtmlHelpController help; // any class wishing to process wxWidgets events must use this macro DECLARE_EVENT_TABLE() }; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // IDs for the controls and the menu commands enum { // menu items Minimal_Quit = 1, Minimal_Help }; // ---------------------------------------------------------------------------- // event tables and other macros for wxWidgets // ---------------------------------------------------------------------------- // the event tables connect the wxWidgets events with the functions (event // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(Minimal_Quit, MyFrame::OnQuit) EVT_MENU(Minimal_Help, MyFrame::OnHelp) EVT_CLOSE(MyFrame::OnClose) END_EVENT_TABLE() // Create a new application object: this macro will allow wxWidgets to create // the application object during program execution (it's better than using a // static object for many reasons) and also declares the accessor function // wxGetApp() which will return the reference of the right type (i.e. MyApp and // not wxApp) IMPLEMENT_APP(MyApp) // ============================================================================ // implementation // ============================================================================ // ---------------------------------------------------------------------------- // the application class // ---------------------------------------------------------------------------- // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { if ( !wxApp::OnInit() ) return false; wxInitAllImageHandlers(); #if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB wxFileSystem::AddHandler(new wxZipFSHandler); #endif SetVendorName(wxT("wxWidgets")); SetAppName(wxT("wxHTMLHelp")); // Create the main application window MyFrame *frame = new MyFrame(_("HTML Help Sample"), wxDefaultPosition, wxDefaultSize); // Show it frame->Show(true); // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned false here, the // application would exit immediately. return true; } // ---------------------------------------------------------------------------- // main frame // ---------------------------------------------------------------------------- // frame constructor MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size), help(wxHF_DEFAULT_STYLE | wxHF_OPEN_FILES) { SetIcon(wxICON(sample)); // create a menu bar wxMenu *menuFile = new wxMenu; menuFile->Append(Minimal_Help, _("&Help")); menuFile->Append(Minimal_Quit, _("E&xit")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; menuBar->Append(menuFile, _("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); help.UseConfig(wxConfig::Get()); bool ret; help.SetTempDir(wxT(".")); ret = help.AddBook(wxFileName(wxT("helpfiles/testing.hhp"), wxPATH_UNIX)); if (! ret) wxMessageBox(wxT("Failed adding book helpfiles/testing.hhp")); ret = help.AddBook(wxFileName(wxT("helpfiles/another.hhp"), wxPATH_UNIX)); if (! ret) wxMessageBox(_("Failed adding book helpfiles/another.hhp")); } // event handlers void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { // true is to force the frame to close Close(true); } void MyFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) { help.Display(wxT("Test HELPFILE")); } void MyFrame::OnClose(wxCloseEvent& event) { // Close the help frame; this will cause the config data to // get written. if ( help.GetFrame() ) // returns NULL if no help frame active help.GetFrame()->Close(true); // now we can safely delete the config pointer event.Skip(); delete wxConfig::Set(NULL); }
enachb/freetel-code
src/wxWidgets-2.9.4/samples/html/help/help.cpp
C++
lgpl-2.1
6,219
<?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: imageprovider-example.qml Example File (declarative/cppextensions/imageprovider/imageprovider-example.qml)</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">imageprovider-example.qml Example File</h1> <span class="small-subtitle">declarative/cppextensions/imageprovider/imageprovider-example.qml</span> <!-- $$$declarative/cppextensions/imageprovider/imageprovider-example.qml-description --> <div class="descr"> <a name="details"></a> <pre class="highlightedCode brush: cpp"> /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** 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: ** ** &quot;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 ** &quot;AS IS&quot; 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.&quot; ** $QT_END_LICENSE$ ** ****************************************************************************/ import QtQuick 1.0 import &quot;ImageProviderCore&quot; // import the plugin that registers the color image provider Column { Image { source: &quot;image://colors/yellow&quot; } Image { source: &quot;image://colors/red&quot; } }</pre> </div> <!-- @@@declarative/cppextensions/imageprovider/imageprovider-example.qml --> <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/declarative-cppextensions-imageprovider-imageprovider-example-qml.html
HTML
lgpl-2.1
11,196
<?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$ /** * @group unit */ abstract class Search_Index_StemmingTest extends PHPUnit_Framework_TestCase { protected $index; protected function populate($index) { $typeFactory = $index->getTypeFactory(); $index->addDocument( [ 'object_type' => $typeFactory->identifier('wikipage?!'), 'object_id' => $typeFactory->identifier('Comité Wiki'), 'description' => $typeFactory->plaintext('a descriptions for the pages éducation Case'), 'contents' => $typeFactory->plaintext('a descriptions for the pages éducation Case'), 'hebrew' => $typeFactory->plaintext('מחשב הוא מכונה המעבדת נתונים על פי תוכנית, כלומר על פי רצף פקודות נתון מראש. מחשבים הם חלק בלתי נפרד מחיי היומיום '), ] ); } function testSearchWithAdditionalS() { $query = new Search_Query('description'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testSearchWithMissingS() { $query = new Search_Query('page'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testSearchAccents() { $query = new Search_Query('education'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testSearchAccentExactMatch() { $query = new Search_Query('éducation'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testSearchExtraAccents() { $query = new Search_Query('pagé'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testCaseSensitivity() { $query = new Search_Query('casE'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testFilterIdentifierExactly() { $query = new Search_Query; $query->filterType('wikipage?!'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testSearchObject() { $query = new Search_Query; $query->addObject('wikipage?!', 'Comité Wiki'); $this->assertGreaterThan(0, count($query->search($this->index))); } function testStopWords() { $query = new Search_Query('a for the'); $this->assertEquals(0, count($query->search($this->index))); } function testHebrewString() { $query = new Search_Query; $query->filterContent('מחשב', 'hebrew'); $this->assertEquals(1, count($query->search($this->index))); } }
tikiorg/tiki
lib/test/core/Search/Index/StemmingTest.php
PHP
lgpl-2.1
2,655
/* Copyright (C) 2009-2010 Red Hat, Inc. 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 the copyright holder 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 HOLDER 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 HOLDER 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 _H_MESSAGES #define _H_MESSAGES #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <spice/protocol.h> #include <spice/macros.h> #ifdef USE_SMARTCARD_012 #include <vscard_common.h> #else #ifdef USE_SMARTCARD #include <libcacard.h> #endif #endif #include "draw.h" SPICE_BEGIN_DECLS typedef struct SpiceMsgData { uint32_t data_size; uint8_t data[0]; } SpiceMsgData; typedef struct SpiceMsgCompressedData { uint8_t type; uint32_t uncompressed_size; uint32_t compressed_size; uint8_t *compressed_data; } SpiceMsgCompressedData; typedef struct SpiceMsgEmpty { uint8_t padding; } SpiceMsgEmpty; typedef struct SpiceMsgInputsInit { uint32_t keyboard_modifiers; } SpiceMsgInputsInit; typedef struct SpiceMsgInputsKeyModifiers { uint32_t modifiers; } SpiceMsgInputsKeyModifiers; typedef struct SpiceMsgMainMultiMediaTime { uint32_t time; } SpiceMsgMainMultiMediaTime; typedef struct SpiceMigrationDstInfo { uint16_t port; uint16_t sport; uint32_t host_size; uint8_t *host_data; uint16_t pub_key_type; uint32_t pub_key_size; uint8_t *pub_key_data; uint32_t cert_subject_size; uint8_t *cert_subject_data; } SpiceMigrationDstInfo; typedef struct SpiceMsgMainMigrationBegin { SpiceMigrationDstInfo dst_info; } SpiceMsgMainMigrationBegin; typedef struct SpiceMsgMainMigrateBeginSeamless { SpiceMigrationDstInfo dst_info; uint32_t src_mig_version; } SpiceMsgMainMigrateBeginSeamless; typedef struct SpiceMsgcMainMigrateDstDoSeamless { uint32_t src_version; } SpiceMsgcMainMigrateDstDoSeamless; typedef struct SpiceMsgMainMigrationSwitchHost { uint16_t port; uint16_t sport; uint32_t host_size; uint8_t *host_data; uint32_t cert_subject_size; uint8_t *cert_subject_data; } SpiceMsgMainMigrationSwitchHost; typedef struct SpiceMsgMigrate { uint32_t flags; } SpiceMsgMigrate; typedef struct SpiceResourceID { uint8_t type; uint64_t id; } SpiceResourceID; typedef struct SpiceResourceList { uint16_t count; SpiceResourceID resources[0]; } SpiceResourceList; typedef struct SpiceMsgSetAck { uint32_t generation; uint32_t window; } SpiceMsgSetAck; typedef struct SpiceMsgcAckSync { uint32_t generation; } SpiceMsgcAckSync; typedef struct SpiceWaitForChannel { uint8_t channel_type; uint8_t channel_id; uint64_t message_serial; } SpiceWaitForChannel; typedef struct SpiceMsgWaitForChannels { uint8_t wait_count; SpiceWaitForChannel wait_list[0]; } SpiceMsgWaitForChannels; typedef struct SpiceChannelId { uint8_t type; uint8_t id; } SpiceChannelId; typedef struct SpiceMsgMainInit { uint32_t session_id; uint32_t display_channels_hint; uint32_t supported_mouse_modes; uint32_t current_mouse_mode; uint32_t agent_connected; uint32_t agent_tokens; uint32_t multi_media_time; uint32_t ram_hint; } SpiceMsgMainInit; typedef struct SpiceMsgDisconnect { uint64_t time_stamp; uint32_t reason; // SPICE_ERR_? } SpiceMsgDisconnect; typedef struct SpiceMsgNotify { uint64_t time_stamp; uint32_t severity; uint32_t visibilty; uint32_t what; uint32_t message_len; uint8_t message[0]; } SpiceMsgNotify; typedef struct SpiceMsgChannels { uint32_t num_of_channels; SpiceChannelId channels[0]; } SpiceMsgChannels; typedef struct SpiceMsgMainName { uint32_t name_len; uint8_t name[0]; } SpiceMsgMainName; typedef struct SpiceMsgMainUuid { uint8_t uuid[16]; } SpiceMsgMainUuid; typedef struct SpiceMsgMainMouseMode { uint32_t supported_modes; uint32_t current_mode; } SpiceMsgMainMouseMode; typedef struct SpiceMsgPing { uint32_t id; uint64_t timestamp; void *data; uint32_t data_len; } SpiceMsgPing; typedef struct SpiceMsgMainAgentDisconnect { uint32_t error_code; // SPICE_ERR_? } SpiceMsgMainAgentDisconnect; #define SPICE_AGENT_MAX_DATA_SIZE 2048 typedef struct SpiceMsgMainAgentTokens { uint32_t num_tokens; } SpiceMsgMainAgentTokens, SpiceMsgcMainAgentTokens, SpiceMsgcMainAgentStart; typedef struct SpiceMsgMainAgentTokens SpiceMsgMainAgentConnectedTokens; typedef struct SpiceMsgcClientInfo { uint64_t cache_size; } SpiceMsgcClientInfo; typedef struct SpiceMsgcMainMouseModeRequest { uint32_t mode; } SpiceMsgcMainMouseModeRequest; typedef struct SpiceCursor { uint32_t flags; SpiceCursorHeader header; uint32_t data_size; uint8_t *data; } SpiceCursor; typedef struct SpiceMsgDisplayMode { uint32_t x_res; uint32_t y_res; uint32_t bits; } SpiceMsgDisplayMode; typedef struct SpiceMsgSurfaceCreate { uint32_t surface_id; uint32_t width; uint32_t height; uint32_t format; uint32_t flags; } SpiceMsgSurfaceCreate; typedef struct SpiceMsgSurfaceDestroy { uint32_t surface_id; } SpiceMsgSurfaceDestroy; typedef struct SpiceMsgDisplayBase { uint32_t surface_id; SpiceRect box; SpiceClip clip; } SpiceMsgDisplayBase; typedef struct SpiceMsgDisplayDrawFill { SpiceMsgDisplayBase base; SpiceFill data; } SpiceMsgDisplayDrawFill; typedef struct SpiceMsgDisplayDrawOpaque { SpiceMsgDisplayBase base; SpiceOpaque data; } SpiceMsgDisplayDrawOpaque; typedef struct SpiceMsgDisplayDrawCopy { SpiceMsgDisplayBase base; SpiceCopy data; } SpiceMsgDisplayDrawCopy; typedef struct SpiceMsgDisplayDrawTransparent { SpiceMsgDisplayBase base; SpiceTransparent data; } SpiceMsgDisplayDrawTransparent; typedef struct SpiceMsgDisplayDrawAlphaBlend { SpiceMsgDisplayBase base; SpiceAlphaBlend data; } SpiceMsgDisplayDrawAlphaBlend; typedef struct SpiceMsgDisplayDrawComposite { SpiceMsgDisplayBase base; SpiceComposite data; } SpiceMsgDisplayDrawComposite; typedef struct SpiceMsgDisplayCopyBits { SpiceMsgDisplayBase base; SpicePoint src_pos; } SpiceMsgDisplayCopyBits; typedef SpiceMsgDisplayDrawCopy SpiceMsgDisplayDrawBlend; typedef struct SpiceMsgDisplayDrawRop3 { SpiceMsgDisplayBase base; SpiceRop3 data; } SpiceMsgDisplayDrawRop3; typedef struct SpiceMsgDisplayDrawBlackness { SpiceMsgDisplayBase base; SpiceBlackness data; } SpiceMsgDisplayDrawBlackness; typedef struct SpiceMsgDisplayDrawWhiteness { SpiceMsgDisplayBase base; SpiceWhiteness data; } SpiceMsgDisplayDrawWhiteness; typedef struct SpiceMsgDisplayDrawInvers { SpiceMsgDisplayBase base; SpiceInvers data; } SpiceMsgDisplayDrawInvers; typedef struct SpiceMsgDisplayDrawStroke { SpiceMsgDisplayBase base; SpiceStroke data; } SpiceMsgDisplayDrawStroke; typedef struct SpiceMsgDisplayDrawText { SpiceMsgDisplayBase base; SpiceText data; } SpiceMsgDisplayDrawText; typedef struct SpiceMsgDisplayInvalOne { uint64_t id; } SpiceMsgDisplayInvalOne; typedef struct SpiceMsgDisplayStreamCreate { uint32_t surface_id; uint32_t id; uint32_t flags; uint32_t codec_type; uint64_t stamp; uint32_t stream_width; uint32_t stream_height; uint32_t src_width; uint32_t src_height; SpiceRect dest; SpiceClip clip; } SpiceMsgDisplayStreamCreate; typedef struct SpiceStreamDataHeader { uint32_t id; uint32_t multi_media_time; } SpiceStreamDataHeader; typedef struct SpiceMsgDisplayStreamData { SpiceStreamDataHeader base; uint32_t data_size; uint8_t data[0]; } SpiceMsgDisplayStreamData; typedef struct SpiceMsgDisplayStreamDataSized { SpiceStreamDataHeader base; uint32_t width; uint32_t height; SpiceRect dest; uint32_t data_size; uint8_t data[0]; } SpiceMsgDisplayStreamDataSized; typedef struct SpiceMsgDisplayStreamClip { uint32_t id; SpiceClip clip; } SpiceMsgDisplayStreamClip; typedef struct SpiceMsgDisplayStreamDestroy { uint32_t id; } SpiceMsgDisplayStreamDestroy; typedef struct SpiceMsgDisplayStreamActivateReport { uint32_t stream_id; uint32_t unique_id; uint32_t max_window_size; uint32_t timeout_ms; } SpiceMsgDisplayStreamActivateReport; typedef struct SpiceMsgcDisplayStreamReport { uint32_t stream_id; uint32_t unique_id; uint32_t start_frame_mm_time; uint32_t end_frame_mm_time; uint32_t num_frames; uint32_t num_drops; int32_t last_frame_delay; uint32_t audio_delay; } SpiceMsgcDisplayStreamReport; typedef struct SpiceMsgcDisplayGlDrawDone { } SpiceMsgcDisplayGlDrawDone; typedef struct SpiceMsgCursorInit { SpicePoint16 position; uint16_t trail_length; uint16_t trail_frequency; uint8_t visible; SpiceCursor cursor; } SpiceMsgCursorInit; typedef struct SpiceMsgCursorSet { SpicePoint16 position; uint8_t visible; SpiceCursor cursor; } SpiceMsgCursorSet; typedef struct SpiceMsgCursorMove { SpicePoint16 position; } SpiceMsgCursorMove; typedef struct SpiceMsgCursorTrail { uint16_t length; uint16_t frequency; } SpiceMsgCursorTrail; typedef struct SpiceMsgcDisplayInit { uint8_t pixmap_cache_id; int64_t pixmap_cache_size; //in pixels uint8_t glz_dictionary_id; int32_t glz_dictionary_window_size; // in pixels } SpiceMsgcDisplayInit; typedef struct SpiceMsgcKeyDown { uint32_t code; } SpiceMsgcKeyDown; typedef struct SpiceMsgcKeyUp { uint32_t code; } SpiceMsgcKeyUp; typedef struct SpiceMsgcKeyModifiers { uint32_t modifiers; } SpiceMsgcKeyModifiers; typedef struct SpiceMsgcMouseMotion { int32_t dx; int32_t dy; uint32_t buttons_state; } SpiceMsgcMouseMotion; typedef struct SpiceMsgcMousePosition { uint32_t x; uint32_t y; uint32_t buttons_state; uint8_t display_id; } SpiceMsgcMousePosition; typedef struct SpiceMsgcMousePress { int32_t button; int32_t buttons_state; } SpiceMsgcMousePress; typedef struct SpiceMsgcMouseRelease { int32_t button; int32_t buttons_state; } SpiceMsgcMouseRelease; typedef struct SpiceMsgAudioVolume { uint8_t nchannels; uint16_t volume[0]; } SpiceMsgAudioVolume; typedef struct SpiceMsgAudioMute { uint8_t mute; } SpiceMsgAudioMute; typedef struct SpiceMsgPlaybackMode { uint32_t time; uint32_t mode; //SPICE_AUDIO_DATA_MODE_? uint8_t *data; uint32_t data_size; } SpiceMsgPlaybackMode, SpiceMsgcRecordMode; typedef struct SpiceMsgPlaybackStart { uint32_t channels; uint32_t format; //SPICE_AUDIO_FMT_? uint32_t frequency; uint32_t time; } SpiceMsgPlaybackStart; typedef struct SpiceMsgPlaybackPacket { uint32_t time; uint8_t *data; uint32_t data_size; } SpiceMsgPlaybackPacket, SpiceMsgcRecordPacket; typedef struct SpiceMsgPlaybackLatency { uint32_t latency_ms; } SpiceMsgPlaybackLatency; typedef struct SpiceMsgRecordStart { uint32_t channels; uint32_t format; //SPICE_AUDIO_FMT_? uint32_t frequency; } SpiceMsgRecordStart; typedef struct SpiceMsgcRecordStartMark { uint32_t time; } SpiceMsgcRecordStartMark; typedef struct SpiceMsgTunnelInit { uint16_t max_num_of_sockets; uint32_t max_socket_data_size; } SpiceMsgTunnelInit; typedef uint8_t SpiceTunnelIPv4[4]; typedef struct SpiceMsgTunnelIpInfo { uint16_t type; union { SpiceTunnelIPv4 ipv4; } u; uint8_t data[0]; } SpiceMsgTunnelIpInfo; typedef struct SpiceMsgTunnelServiceIpMap { uint32_t service_id; SpiceMsgTunnelIpInfo virtual_ip; } SpiceMsgTunnelServiceIpMap; typedef struct SpiceMsgTunnelSocketOpen { uint16_t connection_id; uint32_t service_id; uint32_t tokens; } SpiceMsgTunnelSocketOpen; /* connection id must be the first field in msgs directed to a specific connection */ typedef struct SpiceMsgTunnelSocketFin { uint16_t connection_id; } SpiceMsgTunnelSocketFin; typedef struct SpiceMsgTunnelSocketClose { uint16_t connection_id; } SpiceMsgTunnelSocketClose; typedef struct SpiceMsgTunnelSocketData { uint16_t connection_id; uint8_t data[0]; } SpiceMsgTunnelSocketData; typedef struct SpiceMsgTunnelSocketTokens { uint16_t connection_id; uint32_t num_tokens; } SpiceMsgTunnelSocketTokens; typedef struct SpiceMsgTunnelSocketClosedAck { uint16_t connection_id; } SpiceMsgTunnelSocketClosedAck; typedef struct SpiceMsgcTunnelAddGenericService { uint32_t type; uint32_t id; uint32_t group; uint32_t port; uint64_t name; uint64_t description; union { SpiceMsgTunnelIpInfo ip; } u; } SpiceMsgcTunnelAddGenericService; typedef struct SpiceMsgcTunnelRemoveService { uint32_t id; } SpiceMsgcTunnelRemoveService; /* connection id must be the first field in msgs directed to a specific connection */ typedef struct SpiceMsgcTunnelSocketOpenAck { uint16_t connection_id; uint32_t tokens; } SpiceMsgcTunnelSocketOpenAck; typedef struct SpiceMsgcTunnelSocketOpenNack { uint16_t connection_id; } SpiceMsgcTunnelSocketOpenNack; typedef struct SpiceMsgcTunnelSocketData { uint16_t connection_id; uint8_t data[0]; } SpiceMsgcTunnelSocketData; typedef struct SpiceMsgcTunnelSocketFin { uint16_t connection_id; } SpiceMsgcTunnelSocketFin; typedef struct SpiceMsgcTunnelSocketClosed { uint16_t connection_id; } SpiceMsgcTunnelSocketClosed; typedef struct SpiceMsgcTunnelSocketClosedAck { uint16_t connection_id; } SpiceMsgcTunnelSocketClosedAck; typedef struct SpiceMsgcTunnelSocketTokens { uint16_t connection_id; uint32_t num_tokens; } SpiceMsgcTunnelSocketTokens; #ifdef USE_SMARTCARD typedef struct SpiceMsgSmartcard { VSCMsgType type; uint32_t length; uint32_t reader_id; uint8_t data[0]; } SpiceMsgSmartcard; typedef struct SpiceMsgcSmartcard { VSCMsgHeader header; union { VSCMsgError error; VSCMsgATR atr_data; VSCMsgReaderAdd add; }; } SpiceMsgcSmartcard; #endif typedef struct SpiceMsgDisplayHead { uint32_t id; uint32_t surface_id; uint32_t width; uint32_t height; uint32_t x; uint32_t y; uint32_t flags; } SpiceHead; typedef struct SpiceMsgDisplayMonitorsConfig { uint16_t count; uint16_t max_allowed; SpiceHead heads[0]; } SpiceMsgDisplayMonitorsConfig; typedef struct SpiceMsgPortInit { uint32_t name_size; uint8_t *name; uint8_t opened; } SpiceMsgPortInit; typedef struct SpiceMsgPortEvent { uint8_t event; } SpiceMsgPortEvent; typedef struct SpiceMsgcPortEvent { uint8_t event; } SpiceMsgcPortEvent; typedef struct SpiceMsgcDisplayPreferredVideoCodecType { uint8_t num_of_codecs; uint8_t codecs[0]; } SpiceMsgcDisplayPreferredVideoCodecType; typedef struct SpiceMsgcDisplayPreferredCompression { uint8_t image_compression; } SpiceMsgcDisplayPreferredCompression; typedef struct SpiceMsgDisplayGlScanoutUnix { int drm_dma_buf_fd; uint32_t width; uint32_t height; uint32_t stride; uint32_t drm_fourcc_format; uint32_t flags; } SpiceMsgDisplayGlScanoutUnix; typedef struct SpiceMsgDisplayGlDraw { uint32_t x; uint32_t y; uint32_t w; uint32_t h; } SpiceMsgDisplayGlDraw; SPICE_END_DECLS #endif /* _H_SPICE_PROTOCOL */
fgouget/spice-common
common/messages.h
C
lgpl-2.1
16,591
/* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat, Inc., 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.as.controller.interfaces; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.jboss.as.controller.logging.ControllerLogger; import org.wildfly.security.manager.WildFlySecurityManager; /** * Overall interface criteria. Encapsulates a set of individual criteria and selects interfaces and addresses * that meet them all. */ public final class OverallInterfaceCriteria implements InterfaceCriteria { // java.net properties static final String PREFER_IPV4_STACK = "java.net.preferIPv4Stack"; static final String PREFER_IPV6_ADDRESSES = "java.net.preferIPv6Addresses"; private static final long serialVersionUID = -5417786897309925997L; private final String interfaceName; private final Set<InterfaceCriteria> interfaceCriteria; public OverallInterfaceCriteria(final String interfaceName, Set<InterfaceCriteria> criteria) { this.interfaceName = interfaceName; this.interfaceCriteria = criteria; } @Override public Map<NetworkInterface, Set<InetAddress>> getAcceptableAddresses(Map<NetworkInterface, Set<InetAddress>> candidates) throws SocketException { Map<NetworkInterface, Set<InetAddress>> result = AbstractInterfaceCriteria.cloneCandidates(candidates); Set<InterfaceCriteria> sorted = new TreeSet<>(interfaceCriteria); for (InterfaceCriteria criteria : sorted) { result = criteria.getAcceptableAddresses(result); if (result.size() == 0) { break; } } if (result.size() > 0) { if (hasMultipleMatches(result)) { // Multiple options matched the criteria. Eliminate the same address showing up in both // a subinterface (an alias) and in the parent result = pruneAliasDuplicates(result); } if (hasMultipleMatches(result)) { // Multiple options matched the criteria. Try and narrow the selection based on // preferences indirectly expressed via -Djava.net.preferIPv4Stack and -Djava.net.preferIPv6Addresses result = pruneIPTypes(result); } if (hasMultipleMatches(result)) { // Multiple options matched the criteria; Pick one Map<NetworkInterface, Set<InetAddress>> selected = selectInterfaceAndAddress(result); // Warn user their criteria was insufficiently exact if (interfaceName != null) { // will be null if the resolution is being performed for the "resolved-address" // user query operation in which case we don't want to log a WARN Map.Entry<NetworkInterface, Set<InetAddress>> entry = selected.entrySet().iterator().next(); warnMultipleValidInterfaces(interfaceName, result, entry.getKey(), entry.getValue().iterator().next()); } result = selected; } } return result; } public String toString() { StringBuilder sb = new StringBuilder("OverallInterfaceCriteria("); for (InterfaceCriteria criteria : interfaceCriteria) { sb.append(criteria.toString()); sb.append(","); } sb.setLength(sb.length() - 1); sb.append(")"); return sb.toString(); } @Override public int compareTo(InterfaceCriteria o) { if (this.equals(o)) { return 0; } return 1; } private Map<NetworkInterface, Set<InetAddress>> pruneIPTypes(Map<NetworkInterface, Set<InetAddress>> candidates) { Boolean preferIPv4Stack = getBoolean(PREFER_IPV4_STACK); Boolean preferIPv6Stack = (preferIPv4Stack != null && !preferIPv4Stack) ? Boolean.TRUE : getBoolean(PREFER_IPV6_ADDRESSES); if (preferIPv4Stack == null && preferIPv6Stack == null) { // No meaningful user input return candidates; } final Map<NetworkInterface, Set<InetAddress>> result = new HashMap<NetworkInterface, Set<InetAddress>>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : candidates.entrySet()) { Set<InetAddress> good = null; for (InetAddress address : entry.getValue()) { if ((preferIPv4Stack != null && preferIPv4Stack && address instanceof Inet4Address) || (preferIPv6Stack != null && preferIPv6Stack && address instanceof Inet6Address)) { if (good == null) { good = new HashSet<InetAddress>(); result.put(entry.getKey(), good); } good.add(address); } } } return result.size() == 0 ? candidates : result; } static Map<NetworkInterface, Set<InetAddress>> pruneAliasDuplicates(Map<NetworkInterface, Set<InetAddress>> result) { final Map<NetworkInterface, Set<InetAddress>> pruned = new HashMap<NetworkInterface, Set<InetAddress>>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : result.entrySet()) { NetworkInterface ni = entry.getKey(); if (ni.getParent() != null) { pruned.put(ni, entry.getValue()); } else { Set<InetAddress> retained = new HashSet<InetAddress>(entry.getValue()); Enumeration<NetworkInterface> subInterfaces = ni.getSubInterfaces(); while (subInterfaces.hasMoreElements()) { NetworkInterface sub = subInterfaces.nextElement(); Set<InetAddress> subAddresses = result.get(sub); if (subAddresses != null) { retained.removeAll(subAddresses); } } if (retained.size() > 0) { pruned.put(ni, retained); } } } return pruned; } private static Boolean getBoolean(final String property) { final String value = WildFlySecurityManager.getPropertyPrivileged(property, null); return value == null ? null : value.equalsIgnoreCase("true"); } private static Map<NetworkInterface, Set<InetAddress>> selectInterfaceAndAddress(Map<NetworkInterface, Set<InetAddress>> acceptable) throws SocketException { // Give preference to NetworkInterfaces that are 1) up, 2) not loopback 3) not point-to-point. // If any of these criteria eliminate all interfaces, discard it. if (acceptable.size() > 1) { Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (NetworkInterface ni : acceptable.keySet()) { if (ni.isUp()) { preferred.put(ni, acceptable.get(ni)); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } if (acceptable.size() > 1) { Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (NetworkInterface ni : acceptable.keySet()) { if (!ni.isLoopback()) { preferred.put(ni, acceptable.get(ni)); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } if (acceptable.size() > 1) { Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (NetworkInterface ni : acceptable.keySet()) { if (!ni.isPointToPoint()) { preferred.put(ni, acceptable.get(ni)); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } if (hasMultipleMatches(acceptable)) { // Give preference to non-link-local addresses Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : acceptable.entrySet()) { Set<InetAddress> acceptableAddresses = entry.getValue(); if (acceptableAddresses.size() > 1) { Set<InetAddress> preferredAddresses = null; for (InetAddress addr : acceptableAddresses) { if (!addr.isLinkLocalAddress()) { if (preferredAddresses == null) { preferredAddresses = new HashSet<InetAddress>(); preferred.put(entry.getKey(), preferredAddresses); } preferredAddresses.add(addr); } } } else { acceptable.put(entry.getKey(), acceptableAddresses); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } Map.Entry<NetworkInterface, Set<InetAddress>> entry = acceptable.entrySet().iterator().next(); return Collections.singletonMap(entry.getKey(), Collections.singleton(entry.getValue().iterator().next())); } private static boolean hasMultipleMatches(Map<NetworkInterface, Set<InetAddress>> map) { return map.size() > 1 || (map.size() == 1 && map.values().iterator().next().size() > 1); } private static void warnMultipleValidInterfaces(String interfaceName, Map<NetworkInterface, Set<InetAddress>> acceptable, NetworkInterface selectedInterface, InetAddress selectedAddress) { Set<String> nis = new HashSet<String>(); Set<InetAddress> addresses = new HashSet<InetAddress>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : acceptable.entrySet()) { nis.add(entry.getKey().getName()); addresses.addAll(entry.getValue()); } ControllerLogger.ROOT_LOGGER.multipleMatchingAddresses(interfaceName, addresses, nis, selectedAddress, selectedInterface.getName()); } }
JiriOndrusek/wildfly-core
controller/src/main/java/org/jboss/as/controller/interfaces/OverallInterfaceCriteria.java
Java
lgpl-2.1
11,851
/* * CLiC, Framework for Command Line Interpretation in Eclipse * * Copyright (C) 2013 Worldline or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the 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. * * 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 */ package com.worldline.clic.internal.assist; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Text; /** * This class allows to deal with autocompletion for all commands. * * @author mvanbesien * @since 1.0 * @version 1.0 */ public class ContentAssistProvider { private final StyledText text; private final IProcessor[] processors; private final Map<String, Object> properties = new HashMap<String, Object>(); private IStructuredContentProvider assistContentProvider; private Listener textKeyListener; private Listener assistTablePopulationListener; private Listener onSelectionListener; private Listener onEscapeListener; private IDoubleClickListener tableDoubleClickListener; private Listener focusOutListener; private Listener vanishListener; private Table table; private TableViewer viewer; private Shell popupShell; public ContentAssistProvider(final StyledText text, final IProcessor... processors) { this.text = text; this.processors = processors; build(); } public void setProperty(final String key, final Object value) { properties.put(key, value); } private void build() { // Creation of graphical elements final Display display = text.getDisplay(); popupShell = new Shell(display, SWT.ON_TOP); popupShell.setLayout(new FillLayout()); table = new Table(popupShell, SWT.SINGLE); viewer = new TableViewer(table); assistContentProvider = newAssistContentProvider(); textKeyListener = newTextKeyListener(); assistTablePopulationListener = newAssistTablePopulationListener(); onSelectionListener = newOnSelectionListener(); onEscapeListener = newOnEscapeListener(); tableDoubleClickListener = newDoubleClickListener(); focusOutListener = newFocusOutListener(); vanishListener = newVanishListener(); viewer.setContentProvider(assistContentProvider); text.addListener(SWT.KeyDown, textKeyListener); text.addListener(SWT.Modify, assistTablePopulationListener); table.addListener(SWT.DefaultSelection, onSelectionListener); table.addListener(SWT.KeyDown, onEscapeListener); viewer.addDoubleClickListener(tableDoubleClickListener); table.addListener(SWT.FocusOut, focusOutListener); text.addListener(SWT.FocusOut, focusOutListener); text.getShell().addListener(SWT.Move, vanishListener); text.addDisposeListener(newDisposeListener()); } private DisposeListener newDisposeListener() { return new DisposeListener() { @Override public void widgetDisposed(final DisposeEvent e) { text.removeListener(SWT.KeyDown, textKeyListener); text.removeListener(SWT.Modify, assistTablePopulationListener); table.removeListener(SWT.DefaultSelection, onSelectionListener); table.removeListener(SWT.KeyDown, onEscapeListener); viewer.removeDoubleClickListener(tableDoubleClickListener); table.removeListener(SWT.FocusOut, focusOutListener); text.removeListener(SWT.FocusOut, focusOutListener); text.getShell().removeListener(SWT.Move, vanishListener); table.dispose(); popupShell.dispose(); } }; } private IStructuredContentProvider newAssistContentProvider() { return new IStructuredContentProvider() { @Override public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) { } @Override public void dispose() { } @Override public Object[] getElements(final Object inputElement) { final Collection<String> results = new ArrayList<String>(); if (inputElement instanceof String) { final String input = (String) inputElement; final ProcessorContext pc = new ProcessorContext(input, text.getCaretOffset(), properties); for (final IProcessor processor : processors) results.addAll(processor.getProposals(pc)); } return results.toArray(); } }; } private Listener newAssistTablePopulationListener() { return new Listener() { @Override public void handleEvent(final Event event) { if (event.widget instanceof Text) { final Text text = (Text) event.widget; final String string = text.getText(); if (string.length() == 0) // if (popupShell.isVisible()) popupShell.setVisible(false); else { viewer.setInput(string); final Rectangle textBounds = text.getDisplay().map( text.getParent(), null, text.getBounds()); popupShell.setBounds(textBounds.x, textBounds.y + textBounds.height, textBounds.width, 80); // if (!popupShell.isVisible()) popupShell.setVisible(true); } } } }; } private Listener newVanishListener() { return new Listener() { @Override public void handleEvent(final Event event) { popupShell.setVisible(false); } }; } private Listener newTextKeyListener() { return new Listener() { @Override public void handleEvent(final Event event) { switch (event.keyCode) { case SWT.ARROW_DOWN: int index = (table.getSelectionIndex() + 1) % table.getItemCount(); table.setSelection(index); event.doit = false; break; case SWT.ARROW_UP: index = table.getSelectionIndex() - 1; if (index < 0) index = table.getItemCount() - 1; table.setSelection(index); event.doit = false; break; case SWT.ARROW_RIGHT: if (popupShell.isVisible() && table.getSelectionIndex() != -1) { text.setText(table.getSelection()[0].getText()); text.setSelection(text.getText().length()); popupShell.setVisible(false); } break; case SWT.ESC: popupShell.setVisible(false); break; } } }; } private IDoubleClickListener newDoubleClickListener() { return new IDoubleClickListener() { @Override public void doubleClick(final DoubleClickEvent event) { if (popupShell.isVisible() && table.getSelectionIndex() != -1) { text.setText(table.getSelection()[0].getText()); text.setSelection(text.getText().length()); popupShell.setVisible(false); } } }; } private Listener newOnSelectionListener() { return new Listener() { @Override public void handleEvent(final Event event) { if (event.widget instanceof Text) { final Text text = (Text) event.widget; final ISelection selection = viewer.getSelection(); if (selection instanceof IStructuredSelection) { text.setText(((IStructuredSelection) selection) .getFirstElement().toString()); text.setSelection(text.getText().length() - 1); } popupShell.setVisible(false); } } }; } private Listener newOnEscapeListener() { return new Listener() { @Override public void handleEvent(final Event event) { if (event.keyCode == SWT.ESC) popupShell.setVisible(false); } }; } private Listener newFocusOutListener() { return new Listener() { @Override public void handleEvent(final Event event) { popupShell.setVisible(false); } }; } }
awltech/clic
com.worldline.clic/src/main/java/com/worldline/clic/internal/assist/ContentAssistProvider.java
Java
lgpl-2.1
8,789
// LICENSE: (Please see the file COPYING for details) // // NUS - Nemesis Utilities System: A C++ application development framework // Copyright (C) 2006, 2007 Otavio Rodolfo Piske // // This file is part of NUS // // 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // #include "nthread.h" void *nthread_start_routine(void *data) { NThread *thread = static_cast<NThread *>(data); thread->threadStart(); return NULL; } NThread::NThread(void) : NObject() { } void NThread::threadCreate() { int ret = 0; pthread_t a_thread; ret = pthread_create(&a_thread, NULL, nthread_start_routine, (void *) this); }
orpiske/nus
src/base/osal/unix/nthread.cpp
C++
lgpl-2.1
1,277
package com.stek101.projectzulu.common.core; /** * For usage see: {@link Pair} */ public class PairDirectoryFile<K, V> { private final K directory; private final V file; public static <K, V> PairDirectoryFile<K, V> createPair(K directory, V file) { return new PairDirectoryFile<K, V>(directory, file); } public PairDirectoryFile(K directory, V file) { this.file = file; this.directory = directory; } public K getDirectory() { return directory; } public V getFile() { return file; } @Override public boolean equals(Object object){ if (! (object instanceof PairDirectoryFile)) { return false; } PairDirectoryFile pair = (PairDirectoryFile)object; return directory.equals(pair.directory) && file.equals(pair.file); } @Override public int hashCode(){ return 7 * directory.hashCode() + 13 * file.hashCode(); } }
soultek101/projectzulu1.7.10
src/main/java/com/stek101/projectzulu/common/core/PairDirectoryFile.java
Java
lgpl-2.1
1,073
using System; namespace InSimDotNet.Packets { /// <summary> /// Message to connection packet. /// </summary> /// <remarks> /// Used to send a message to a specific connection or player (can only be used on hosts). /// </remarks> public class IS_MTC : IPacket, ISendable { /// <summary> /// Gets the size of the packet. /// </summary> public int Size { get; private set; } /// <summary> /// Gets the type of the packet. /// </summary> public PacketType Type { get; private set; } /// <summary> /// Gets or sets the request ID. /// </summary> public byte ReqI { get; set; } /// <summary> /// Gets or sets the sound effect. /// </summary> public MessageSound Sound { get; set; } /// <summary> /// Gets or sets the unique ID of the connection to send the message to (0 = host / 255 = all). /// </summary> public byte UCID { get; set; } /// <summary> /// Gets or sets the unique ID of the player to send the message to (if 0 use UCID). /// </summary> public byte PLID { get; set; } /// <summary> /// Gets or sets the message to send. /// </summary> public string Msg { get; set; } /// <summary> /// Creates a new message to connection packet. /// </summary> public IS_MTC() { Size = 8; Type = PacketType.ISP_MTC; Msg = String.Empty; } /// <summary> /// Returns the packet data. /// </summary> /// <returns>The packet data.</returns> public byte[] GetBuffer() { // Encode string first so we can figure out the packet size. byte[] buffer = new byte[128]; int length = LfsEncoding.Current.GetBytes(Msg, buffer, 0, 128); // Get the packet size (MTC needs trailing zero). Size = (byte)(8 + Math.Min(length + (4 - (length % 4)), 128)); PacketWriter writer = new PacketWriter(Size); writer.WriteSize(Size); writer.Write((byte)Type); writer.Write(ReqI); writer.Write((byte)Sound); writer.Write(UCID); writer.Write(PLID); writer.Skip(2); writer.Write(buffer, length); return writer.GetBuffer(); } } }
alexmcbride/insimdotnet
InSimDotNet/Packets/IS_MTC.cs
C#
lgpl-2.1
2,537
// BESWWW.h // This file is part of bes, A C++ back-end server implementation framework // for the OPeNDAP Data Access Protocol. // Copyright (c) 2004,2005 University Corporation for Atmospheric Research // Author: Patrick West <[email protected]> and Jose Garcia <[email protected]> // // 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 // // You can contact University Corporation for Atmospheric Research at // 3080 Center Green Drive, Boulder, CO 80301 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005 // Please read the full copyright statement in the file COPYRIGHT_UCAR. // // Authors: // pwest Patrick West <[email protected]> // jgarcia Jose Garcia <[email protected]> #ifndef I_BESWWW_h #define I_BESWWW_h 1 #include "BESResponseObject.h" #include "BESDASResponse.h" #include "BESDDSResponse.h" /** @brief container for a DAS and DDS needed to write out the usage * information for a dataset. * * This is a container for the usage response information, which needs a DAS * and a DDS. An instances of BESWWW takes ownership of the das and dds * passed to it and deletes it in the destructor. * * @see BESResponseObject * @see DAS * @see DDS */ class BESWWW : public BESResponseObject { private: #if 0 BESDASResponse *_das ; #endif BESDDSResponse *_dds ; BESWWW() {} public: BESWWW( /* BESDASResponse *das,*/ BESDDSResponse *dds ) : /*_das( das ),*/ _dds( dds ) {} virtual ~ BESWWW() { #if 0 if (_das) delete _das; #endif if (_dds) delete _dds; } #if 0 BESDASResponse *get_das() { return _das ; } #endif BESDDSResponse *get_dds() { return _dds ; } /** @brief dumps information about this object * * Displays the pointer value of this instance along with the das object * created * * @param strm C++ i/o stream to dump the information to */ virtual void dump(ostream & strm) const { strm << BESIndent::LMarg << "dump - (" << (void *) this << ")" << endl; BESIndent::Indent(); #if 0 strm << BESIndent::LMarg << "das: " << *_das << endl; #endif strm << BESIndent::LMarg << "dds: " << *_dds << endl; BESIndent::UnIndent(); } } ; #endif // I_BESWWW_h
OPENDAP/dap-server
www-interface/BESWWW.h
C
lgpl-2.1
2,948
package fastSim.data; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.*; //import fanweizhu.fastSim.util.Config; //import fanweizhu.fastSim.util.IndexManager; //import fanweizhu.fastSim.util.KeyValuePair; //import fanweizhu.fastSim.util.MapCapacity; import fastSim.util.*; import fastSim.util.io.DataReader; import fastSim.util.io.DataWriter; public class PrimeSim implements Serializable{ /** * */ private static final long serialVersionUID = -7028575305146090045L; private List<Integer> hubs; protected Map<Integer, Map<Integer,Double>> map; protected boolean outG; protected List<Integer> meetingNodes; /*public PrimeSim(int capacity) { super(capacity); hubs = new ArrayList<Integer>(); }*/ public PrimeSim() { map = new HashMap<Integer, Map<Integer,Double>>(); hubs = new ArrayList<Integer>(); meetingNodes = new ArrayList<Integer>(); } public PrimeSim(int numNodes) { //need to change MapCapacity when double->Map? map = new HashMap<Integer, Map<Integer,Double>>(MapCapacity.compute(numNodes)); hubs = new ArrayList<Integer>(); } public Set<Integer> getLengths(){ return map.keySet(); } public int numHubs() { return hubs.size(); } public int numLength(){ return map.size(); } public Map<Integer,Map<Integer,Double>> getMap(){ return map; } public int getHubId(int index) { return hubs.get(index); } public List<Integer> getMeetingNodes(){ return meetingNodes; } public void addNewNode(Node h, String simType){ h.isVisited = true; if(h.isHub) hubs.add(h.id); if(simType=="in" && h.out.size()>1) //store meeting nodes for ingraphs //meetingnodes refer to >1 nodes (descendants) meetingNodes.add(h.id); } public void set(int l, Node n, double value) { // if (n.isVisited == false){ // if (n.isHub) // hubs.add(n.id); // if (graphType=="in" && n.in.size()>1) // meetingNodes.add(n.id); // } // Map<Integer, Double> nodesVal; if (map.get(l)!= null) { nodesVal = map.get(l); nodesVal.put(n.id, value); map.put(l, nodesVal); } else { nodesVal = new HashMap<Integer,Double>(); nodesVal.put(n.id, value); map.put(l, nodesVal); } } public void set(int l, Map<Integer,Double> nodeValuePairs){ //System.out.println(l); Map<Integer, Double> nodesVal = map.get(l); // for(Integer i:nodeValuePairs.keySet()) { // System.out.println("PS node: "+ i + " rea: " +nodeValuePairs.get(i)); // } if(nodesVal == null) { map.put(l, nodeValuePairs); } else{ System.out.println("####PrimeSim line108: should not go to here."); nodesVal.putAll(nodeValuePairs); map.put(l, nodesVal); } //System.out.println("length_Test:" + l + " Map_Size:" + map.get(l).size()); // for(Integer i: map.get(l).keySet()) // System.out.println(map.get(l).get(i)); } public long computeStorageInBytes() { long nodeIdSize = (1 + hubs.size()) * 4; long mapSize = (1 + map.size()) * 4 + map.size() * 8; return nodeIdSize + mapSize; } public String getCountInfo() { //int graphSize = map.size(); int hubSize = hubs.size(); int meetingNodesSize = meetingNodes.size(); return "hub size: " + hubSize + " meetingNodesSize: " + meetingNodesSize ; } public void trim(double clip) { Map<Integer, Map<Integer,Double>> newMap = new HashMap<Integer, Map<Integer,Double>>(); List<Integer> newHublist = new ArrayList<Integer>(); List<Integer> newXlist = new ArrayList<Integer>(); for (int l: map.keySet()){ Map<Integer, Double> pairMap =map.get(l); Map<Integer, Double> newPairs = new HashMap<Integer, Double>(); for (int nid: pairMap.keySet()){ double score = pairMap.get(nid); if (score > clip){ newPairs.put(nid, score); if(hubs.contains(nid) && !newHublist.contains(nid)) newHublist.add(nid); if(meetingNodes.contains(nid) && !newXlist.contains(nid)) newXlist.add(nid); } } newMap.put(l, newPairs); } this.map = newMap; this.hubs = newHublist; this.meetingNodes = newXlist; } public void saveToDisk(int id,String type,boolean doTrim) throws Exception { String path = ""; if(type == "out") //path = "./outSim/" + Integer.toString(id); path = IndexManager.getIndexDeepDir() + "out/" +Integer.toString(id); else if(type == "in") //path = "./inSim/" + Integer.toString(id); path = IndexManager.getIndexDeepDir() + "in/" +Integer.toString(id); else{ System.out.println("Type of prime graph should be either out or in."); System.exit(0); } // System.out.println(path+"/"+id); DataWriter out = new DataWriter(path); if (doTrim) trim(Config.clip); out.writeInteger(hubs.size()); for (int i : hubs) { out.writeInteger(i); } out.writeInteger(meetingNodes.size()); for(int i: meetingNodes){ out.writeInteger(i); } out.writeInteger(map.size()); for(int i=0; i<map.size();i++){ int pairNum = map.get(i).size(); Map<Integer,Double> pairMap = map.get(i); out.writeInteger(pairNum); for(int j: pairMap.keySet()){ out.writeInteger(j); out.writeDouble(pairMap.get(j)); } } out.close(); /*//test: read all the content DataReader in = new DataReader(path); while(true){ double oneNum =in.readDouble(); if (oneNum == -1.11) break; System.out.print(oneNum+"\t"); } System.out.println(); in.close();*/ } public void loadFromDisk(int id,String type) throws Exception { String path = ""; if(type == "out") path = IndexManager.getIndexDeepDir() + "out/" + Integer.toString(id); else if(type == "in") path = IndexManager.getIndexDeepDir() + "in/" + Integer.toString(id); else { System.out.println("Type of prime graph should be either out or in."); System.exit(0); } //============== DataReader in = new DataReader(path); int n = in.readInteger(); this.hubs = new ArrayList<Integer>(n); for (int i = 0; i < n; i++) this.hubs.add(in.readInteger()); int numM = in.readInteger(); this.meetingNodes=new ArrayList<Integer>(numM); for(int i =0; i<numM; i++) this.meetingNodes.add(in.readInteger()); int numL = in.readInteger(); for(int i=0; i<numL; i++){ int numPair = in.readInteger(); Map<Integer,Double> pairMap = new HashMap<Integer, Double>(); for(int j=0; j<numPair; j++){ int nodeId = in.readInteger(); double nodeScore = in.readDouble(); pairMap.put(nodeId, nodeScore); } this.map.put(i, pairMap); } in.close(); } public PrimeSim duplicate() { // TODO Auto-generated method stub PrimeSim sim = new PrimeSim(); sim.map.putAll(this.map); return sim; } public void addFrom(PrimeSim nextOut, Map<Integer, Double> oneHubValue) { // TODO Auto-generated method stub for (int lenToHub : oneHubValue.keySet()){ double hubScoreoflen = oneHubValue.get(lenToHub); for (int lenFromHub : nextOut.getMap().keySet()){ if(lenFromHub == 0){ // the new score of hub (over length==0) is just the score on prime graph continue; } int newLen = lenToHub + lenFromHub; if (!this.getMap().containsKey(newLen)) this.getMap().put(newLen, new HashMap<Integer,Double>()); for(int toNode: nextOut.getMap().get(lenFromHub).keySet()){ double oldValue = this.getMap().get(newLen).keySet() .contains(toNode) ? this.getMap().get(newLen).get(toNode): 0.0; //System.out.println(oldValue); double newValue = hubScoreoflen *nextOut.getMap().get(lenFromHub).get(toNode); // //added aug-29 // if (newValue<Config.epsilon) // continue; this.getMap().get(newLen).put(toNode, oldValue + newValue) ; // PrintInfor.printDoubleMap(this.getMap(), "assemble simout of the hub at length: " + lenFromHub +" node: "+ toNode ); // System.out.println(this.getMap()); } } } } public void addMeetingNodes(List<Integer> nodes){ for (int nid: nodes){ if (!this.meetingNodes.contains(nid)) this.meetingNodes.add(nid); } //System.out.println("====PrimeSim: line 195: meetingnodes Size " + this.meetingNodes.size()); } }
fastsim2016/FastSim
fastSim_SS_pre/src/fastSim/data/PrimeSim.java
Java
lgpl-2.1
8,347
/* Copyright (c) 2013-2014 Boundless and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/edl-v10.html * * Contributors: * Gabriel Roldan (Boundless) - initial implementation */ package org.locationtech.geogig.geotools.data; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.NoSuchElementException; import org.eclipse.jdt.annotation.Nullable; import org.geotools.data.DataStore; import org.geotools.data.Transaction; import org.geotools.data.simple.SimpleFeatureSource; import org.geotools.data.store.ContentDataStore; import org.geotools.data.store.ContentEntry; import org.geotools.data.store.ContentState; import org.geotools.feature.NameImpl; import org.locationtech.geogig.data.FindFeatureTypeTrees; import org.locationtech.geogig.model.ObjectId; import org.locationtech.geogig.model.Ref; import org.locationtech.geogig.model.RevObject.TYPE; import org.locationtech.geogig.model.RevTree; import org.locationtech.geogig.model.SymRef; import org.locationtech.geogig.plumbing.ForEachRef; import org.locationtech.geogig.plumbing.RefParse; import org.locationtech.geogig.plumbing.RevParse; import org.locationtech.geogig.plumbing.TransactionBegin; import org.locationtech.geogig.porcelain.AddOp; import org.locationtech.geogig.porcelain.CheckoutOp; import org.locationtech.geogig.porcelain.CommitOp; import org.locationtech.geogig.repository.Context; import org.locationtech.geogig.repository.GeogigTransaction; import org.locationtech.geogig.repository.NodeRef; import org.locationtech.geogig.repository.Repository; import org.locationtech.geogig.repository.WorkingTree; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.feature.type.Name; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Throwables; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; /** * A GeoTools {@link DataStore} that serves and edits {@link SimpleFeature}s in a geogig repository. * <p> * Multiple instances of this kind of data store may be created against the same repository, * possibly working against different {@link #setHead(String) heads}. * <p> * A head is any commit in GeoGig. If a head has a branch pointing at it then the store allows * transactions, otherwise no data modifications may be made. * * A branch in Geogig is a separate line of history that may or may not share a common ancestor with * another branch. In the later case the branch is called "orphan" and by convention the default * branch is called "master", which is created when the geogig repo is first initialized, but does * not necessarily exist. * <p> * Every read operation (like in {@link #getFeatureSource(Name)}) reads committed features out of * the configured "head" branch. Write operations are only supported if a {@link Transaction} is * set, in which case a {@link GeogigTransaction} is tied to the geotools transaction by means of a * {@link GeogigTransactionState}. During the transaction, read operations will read from the * transaction's {@link WorkingTree} in order to "see" features that haven't been committed yet. * <p> * When the transaction is committed, the changes made inside that transaction are merged onto the * actual repository. If any other change was made to the repository meanwhile, a rebase will be * attempted, and the transaction commit will fail if the rebase operation finds any conflict. This * provides for optimistic locking and reduces thread contention. * */ public class GeoGigDataStore extends ContentDataStore implements DataStore { private final Repository geogig; /** @see #setHead(String) */ private String refspec; /** When the configured head is not a branch, we disallow transactions */ private boolean allowTransactions = true; public GeoGigDataStore(Repository geogig) { super(); Preconditions.checkNotNull(geogig); this.geogig = geogig; } @Override public void dispose() { super.dispose(); geogig.close(); } /** * Instructs the datastore to operate against the specified refspec, or against the checked out * branch, whatever it is, if the argument is {@code null}. * * Editing capabilities are disabled if the refspec is not a local branch. * * @param refspec the name of the branch to work against, or {@code null} to default to the * currently checked out branch * @see #getConfiguredBranch() * @see #getOrFigureOutHead() * @throws IllegalArgumentException if {@code refspec} is not null and no such commit exists in * the repository */ public void setHead(@Nullable final String refspec) throws IllegalArgumentException { if (refspec == null) { allowTransactions = true; // when no branch name is set we assume we should make // transactions against the current HEAD } else { final Context context = getCommandLocator(null); Optional<ObjectId> rev = context.command(RevParse.class).setRefSpec(refspec).call(); if (!rev.isPresent()) { throw new IllegalArgumentException("Bad ref spec: " + refspec); } Optional<Ref> branchRef = context.command(RefParse.class).setName(refspec).call(); if (branchRef.isPresent()) { Ref ref = branchRef.get(); if (ref instanceof SymRef) { ref = context.command(RefParse.class).setName(((SymRef) ref).getTarget()).call() .orNull(); } Preconditions.checkArgument(ref != null, "refSpec is a dead symref: " + refspec); if (ref.getName().startsWith(Ref.HEADS_PREFIX)) { allowTransactions = true; } else { allowTransactions = false; } } else { allowTransactions = false; } } this.refspec = refspec; } public String getOrFigureOutHead() { String branch = getConfiguredHead(); if (branch != null) { return branch; } return getCheckedOutBranch(); } public Repository getGeogig() { return geogig; } /** * @return the configured refspec of the commit this datastore works against, or {@code null} if * no head in particular has been set, meaning the data store works against whatever the * currently checked out branch is. */ @Nullable public String getConfiguredHead() { return this.refspec; } /** * @return whether or not we can support transactions against the configured head */ public boolean isAllowTransactions() { return this.allowTransactions; } /** * @return the name of the currently checked out branch in the repository, not necessarily equal * to {@link #getConfiguredBranch()}, or {@code null} in the (improbable) case HEAD is * on a dettached state (i.e. no local branch is currently checked out) */ @Nullable public String getCheckedOutBranch() { Optional<Ref> head = getCommandLocator(null).command(RefParse.class).setName(Ref.HEAD) .call(); if (!head.isPresent()) { return null; } Ref headRef = head.get(); if (!(headRef instanceof SymRef)) { return null; } String refName = ((SymRef) headRef).getTarget(); Preconditions.checkState(refName.startsWith(Ref.HEADS_PREFIX)); String branchName = refName.substring(Ref.HEADS_PREFIX.length()); return branchName; } public ImmutableList<String> getAvailableBranches() { ImmutableSet<Ref> heads = getCommandLocator(null).command(ForEachRef.class) .setPrefixFilter(Ref.HEADS_PREFIX).call(); List<String> list = Lists.newArrayList(Collections2.transform(heads, (ref) -> { String branchName = ref.getName().substring(Ref.HEADS_PREFIX.length()); return branchName; })); Collections.sort(list); return ImmutableList.copyOf(list); } public Context getCommandLocator(@Nullable Transaction transaction) { Context commandLocator = null; if (transaction != null && !Transaction.AUTO_COMMIT.equals(transaction)) { GeogigTransactionState state; state = (GeogigTransactionState) transaction.getState(GeogigTransactionState.class); Optional<GeogigTransaction> geogigTransaction = state.getGeogigTransaction(); if (geogigTransaction.isPresent()) { commandLocator = geogigTransaction.get(); } } if (commandLocator == null) { commandLocator = geogig.context(); } return commandLocator; } public Name getDescriptorName(NodeRef treeRef) { Preconditions.checkNotNull(treeRef); Preconditions.checkArgument(TYPE.TREE.equals(treeRef.getType())); Preconditions.checkArgument(!treeRef.getMetadataId().isNull(), "NodeRef '%s' is not a feature type reference", treeRef.path()); return new NameImpl(getNamespaceURI(), NodeRef.nodeFromPath(treeRef.path())); } public NodeRef findTypeRef(Name typeName, @Nullable Transaction tx) { Preconditions.checkNotNull(typeName); final String localName = typeName.getLocalPart(); final List<NodeRef> typeRefs = findTypeRefs(tx); Collection<NodeRef> matches = Collections2.filter(typeRefs, new Predicate<NodeRef>() { @Override public boolean apply(NodeRef input) { return NodeRef.nodeFromPath(input.path()).equals(localName); } }); switch (matches.size()) { case 0: throw new NoSuchElementException( String.format("No tree ref matched the name: %s", localName)); case 1: return matches.iterator().next(); default: throw new IllegalArgumentException(String .format("More than one tree ref matches the name %s: %s", localName, matches)); } } @Override protected ContentState createContentState(ContentEntry entry) { return new ContentState(entry); } @Override protected ImmutableList<Name> createTypeNames() throws IOException { List<NodeRef> typeTrees = findTypeRefs(Transaction.AUTO_COMMIT); return ImmutableList .copyOf(Collections2.transform(typeTrees, (ref) -> getDescriptorName(ref))); } private List<NodeRef> findTypeRefs(@Nullable Transaction tx) { final String rootRef = getRootRef(tx); Context commandLocator = getCommandLocator(tx); List<NodeRef> typeTrees = commandLocator.command(FindFeatureTypeTrees.class) .setRootTreeRef(rootRef).call(); return typeTrees; } String getRootRef(@Nullable Transaction tx) { final String rootRef; if (null == tx || Transaction.AUTO_COMMIT.equals(tx)) { rootRef = getOrFigureOutHead(); } else { rootRef = Ref.WORK_HEAD; } return rootRef; } @Override protected GeogigFeatureStore createFeatureSource(ContentEntry entry) throws IOException { return new GeogigFeatureStore(entry); } /** * Creates a new feature type tree on the {@link #getOrFigureOutHead() current branch}. * <p> * Implementation detail: the operation is the homologous to starting a transaction, checking * out the current/configured branch, creating the type tree inside the transaction, issueing a * geogig commit, and committing the transaction for the created tree to be merged onto the * configured branch. */ @Override public void createSchema(SimpleFeatureType featureType) throws IOException { if (!allowTransactions) { throw new IllegalStateException("Configured head " + refspec + " is not a branch; transactions are not supported."); } GeogigTransaction tx = getCommandLocator(null).command(TransactionBegin.class).call(); boolean abort = false; try { String treePath = featureType.getName().getLocalPart(); // check out the datastore branch on the transaction space final String branch = getOrFigureOutHead(); tx.command(CheckoutOp.class).setForce(true).setSource(branch).call(); // now we can use the transaction working tree with the correct branch checked out WorkingTree workingTree = tx.workingTree(); workingTree.createTypeTree(treePath, featureType); tx.command(AddOp.class).addPattern(treePath).call(); tx.command(CommitOp.class).setMessage("Created feature type tree " + treePath).call(); tx.commit(); } catch (IllegalArgumentException alreadyExists) { abort = true; throw new IOException(alreadyExists.getMessage(), alreadyExists); } catch (Exception e) { abort = true; throw Throwables.propagate(e); } finally { if (abort) { tx.abort(); } } } // Deliberately leaving the @Override annotation commented out so that the class builds // both against GeoTools 10.x and 11.x (as the method was added to DataStore in 11.x) // @Override public void removeSchema(Name name) throws IOException { throw new UnsupportedOperationException( "removeSchema not yet supported by geogig DataStore"); } // Deliberately leaving the @Override annotation commented out so that the class builds // both against GeoTools 10.x and 11.x (as the method was added to DataStore in 11.x) // @Override public void removeSchema(String name) throws IOException { throw new UnsupportedOperationException( "removeSchema not yet supported by geogig DataStore"); } public static enum ChangeType { ADDED, REMOVED, CHANGED_NEW, CHANGED_OLD; } /** * Builds a FeatureSource (read-only) that fetches features out of the differences between two * root trees: a provided tree-ish as the left side of the comparison, and the datastore's * configured HEAD as the right side of the comparison. * <p> * E.g., to get all features of a given feature type that were removed between a given commit * and its parent: * * <pre> * <code> * String commitId = ... * GeoGigDataStore store = new GeoGigDataStore(geogig); * store.setHead(commitId); * FeatureSource removed = store.getDiffFeatureSource("roads", commitId + "~1", ChangeType.REMOVED); * </code> * </pre> * * @param typeName the feature type name to look up a type tree for in the datastore's current * {@link #getOrFigureOutHead() HEAD} * @param oldRoot a tree-ish string that resolves to the ROOT tree to be used as the left side * of the diff * @param changeType the type of change between {@code oldRoot} and {@link #getOrFigureOutHead() * head} to pick as the features to return. * @return a feature source whose features are computed out of the diff between the feature type * diffs between the given {@code oldRoot} and the datastore's * {@link #getOrFigureOutHead() HEAD}. */ public SimpleFeatureSource getDiffFeatureSource(final String typeName, final String oldRoot, final ChangeType changeType) throws IOException { Preconditions.checkNotNull(typeName, "typeName"); Preconditions.checkNotNull(oldRoot, "oldRoot"); Preconditions.checkNotNull(changeType, "changeType"); final Name name = name(typeName); final ContentEntry entry = ensureEntry(name); GeogigFeatureSource featureSource = new GeogigFeatureSource(entry); featureSource.setTransaction(Transaction.AUTO_COMMIT); featureSource.setChangeType(changeType); if (ObjectId.NULL.toString().equals(oldRoot) || RevTree.EMPTY_TREE_ID.toString().equals(oldRoot)) { featureSource.setOldRoot(null); } else { featureSource.setOldRoot(oldRoot); } return featureSource; } }
jodygarnett/GeoGig
src/datastore/src/main/java/org/locationtech/geogig/geotools/data/GeoGigDataStore.java
Java
lgpl-2.1
17,024
/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as INT64 */ #include "test.h" #include <inttypes.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #include <errno.h> int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_close(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; }
syntheticpp/dirfile
test/convert_int32_int64.c
C
lgpl-2.1
2,026
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2003-2008, Open Source Geospatial Foundation (OSGeo) * * 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. */ package org.geotools.data.vpf.exc; /** * Class VPFHeaderFormatException.java is responsible for * * <p>Created: Tue Jan 21 15:12:10 2003 * * @author <a href="mailto:[email protected]">Artur Hefczyc</a> * @source $URL$ * @version 1.0.0 */ public class VPFHeaderFormatException extends VPFDataException { /** serialVersionUID */ private static final long serialVersionUID = 4680952037855445222L; /** Creates a new VPFHeaderFormatException object. */ public VPFHeaderFormatException() { super(); } /** * Creates a new VPFHeaderFormatException object. * * @param message DOCUMENT ME! */ public VPFHeaderFormatException(String message) { super(message); } } // VPFHeaderFormatException
geotools/geotools
modules/unsupported/vpf/src/main/java/org/geotools/data/vpf/exc/VPFHeaderFormatException.java
Java
lgpl-2.1
1,418
#!/usr/bin/env python import sys import gobject import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default = True) import telepathy DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties' def get_registry(): reg = telepathy.client.ManagerRegistry() reg.LoadManagers() return reg def get_connection_manager(reg): cm = reg.GetManager('bluewire') return cm class Action(object): def __init__(self): self._action = None def queue_action(self): pass def append_action(self, action): assert self._action is None self._action = action def get_next_action(self): assert self._action is not None return self._action def _on_done(self): if self._action is None: return self._action.queue_action() def _on_error(self, error): print error def _on_generic_message(self, *args): pass class DummyAction(Action): def queue_action(self): gobject.idle_add(self._on_done) class QuitLoop(Action): def __init__(self, loop): super(QuitLoop, self).__init__() self._loop = loop def queue_action(self): self._loop.quit() class DisplayParams(Action): def __init__(self, cm): super(DisplayParams, self).__init__() self._cm = cm def queue_action(self): self._cm[telepathy.interfaces.CONN_MGR_INTERFACE].GetParameters( 'bluetooth, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, params): print "Connection Parameters:" for name, flags, signature, default in params: print "\t%s (%s)" % (name, signature), if flags & telepathy.constants.CONN_MGR_PARAM_FLAG_REQUIRED: print "required", if flags & telepathy.constants.CONN_MGR_PARAM_FLAG_REGISTER: print "register", if flags & telepathy.constants.CONN_MGR_PARAM_FLAG_SECRET: print "secret", if flags & telepathy.constants.CONN_MGR_PARAM_FLAG_DBUS_PROPERTY: print "dbus-property", if flags & telepathy.constants.CONN_MGR_PARAM_FLAG_HAS_DEFAULT: print "has-default(%s)" % default, print "" super(DisplayParams, self)._on_done() class RequestConnection(Action): def __init__(self, cm, username, password, forward): super(RequestConnection, self).__init__() self._cm = cm self._conn = None self._serviceName = None self._username = username self._password = password self._forward = forward @property def conn(self): return self._conn @property def serviceName(self): return self._serviceName def queue_action(self): self._cm[telepathy.server.CONNECTION_MANAGER].RequestConnection( 'bluetooth", { 'account': self._username, 'password': self._password, 'forward': self._forward, }, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, busName, objectPath): self._serviceName = busName self._conn = telepathy.client.Connection(busName, objectPath) super(RequestConnection, self)._on_done() class Connect(Action): def __init__(self, connAction): super(Connect, self).__init__() self._connAction = connAction def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION].connect_to_signal( 'StatusChanged', self._on_change, ) self._connAction.conn[telepathy.server.CONNECTION].Connect( reply_handler = self._on_generic_message, error_handler = self._on_error, ) def _on_done(self): super(Connect, self)._on_done() def _on_change(self, status, reason): if status == telepathy.constants.CONNECTION_STATUS_DISCONNECTED: print "Disconnected!" self._conn = None elif status == telepathy.constants.CONNECTION_STATUS_CONNECTED: print "Connected" self._on_done() elif status == telepathy.constants.CONNECTION_STATUS_CONNECTING: print "Connecting" else: print "Status: %r" % status class SimplePresenceOptions(Action): def __init__(self, connAction): super(SimplePresenceOptions, self).__init__() self._connAction = connAction def queue_action(self): self._connAction.conn[DBUS_PROPERTIES].Get( telepathy.server.CONNECTION_INTERFACE_SIMPLE_PRESENCE, 'Statuses', reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, statuses): print "\tAvailable Statuses" for (key, value) in statuses.iteritems(): print "\t\t - %s" % key super(SimplePresenceOptions, self)._on_done() class NullHandle(object): @property def handle(self): return 0 @property def handles(self): return [] class UserHandle(Action): def __init__(self, connAction): super(UserHandle, self).__init__() self._connAction = connAction self._handle = None @property def handle(self): return self._handle @property def handles(self): return [self._handle] def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION].GetSelfHandle( reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, handle): self._handle = handle super(UserHandle, self)._on_done() class RequestHandle(Action): def __init__(self, connAction, handleType, handleNames): super(RequestHandle, self).__init__() self._connAction = connAction self._handle = None self._handleType = handleType self._handleNames = handleNames @property def handle(self): return self._handle @property def handles(self): return [self._handle] def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION].RequestHandles( self._handleType, self._handleNames, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, handles): self._handle = handles[0] super(RequestHandle, self)._on_done() class RequestChannel(Action): def __init__(self, connAction, handleAction, channelType, handleType): super(RequestChannel, self).__init__() self._connAction = connAction self._handleAction = handleAction self._channel = None self._channelType = channelType self._handleType = handleType @property def channel(self): return self._channel def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION].RequestChannel( self._channelType, self._handleType, self._handleAction.handle, True, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, channelObjectPath): self._channel = telepathy.client.Channel(self._connAction.serviceName, channelObjectPath) super(RequestChannel, self)._on_done() class EnsureChannel(Action): def __init__(self, connAction, channelType, handleType, handleId): super(EnsureChannel, self).__init__() self._connAction = connAction self._channel = None self._channelType = channelType self._handleType = handleType self._handleId = handleId self._handle = None @property def channel(self): return self._channel @property def handle(self): return self._handle @property def handles(self): return [self._handle] def queue_action(self): properties = { telepathy.server.CHANNEL_INTERFACE+".ChannelType": self._channelType, telepathy.server.CHANNEL_INTERFACE+".TargetHandleType": self._handleType, telepathy.server.CHANNEL_INTERFACE+".TargetID": self._handleId, } self._connAction.conn[telepathy.server.CONNECTION_INTERFACE_REQUESTS].EnsureChannel( properties, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, yours, channelObjectPath, properties): print "Create?", not not yours print "Path:", channelObjectPath print "Properties:", properties self._channel = telepathy.client.Channel(self._connAction.serviceName, channelObjectPath) self._handle = properties[telepathy.server.CHANNEL_INTERFACE+".TargetHandle"] super(EnsureChannel, self)._on_done() class CloseChannel(Action): def __init__(self, connAction, chanAction): super(CloseChannel, self).__init__() self._connAction = connAction self._chanAction = chanAction self._handles = [] def queue_action(self): self._chanAction.channel[telepathy.server.CHANNEL].Close( reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self): super(CloseChannel, self)._on_done() class ContactHandles(Action): def __init__(self, connAction, chanAction): super(ContactHandles, self).__init__() self._connAction = connAction self._chanAction = chanAction self._handles = [] @property def handles(self): return self._handles def queue_action(self): self._chanAction.channel[DBUS_PROPERTIES].Get( telepathy.server.CHANNEL_INTERFACE_GROUP, 'Members', reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, handles): self._handles = list(handles) super(ContactHandles, self)._on_done() class SimplePresenceStatus(Action): def __init__(self, connAction, handleAction): super(SimplePresenceStatus, self).__init__() self._connAction = connAction self._handleAction = handleAction def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION_INTERFACE_SIMPLE_PRESENCE].GetPresences( self._handleAction.handles, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, aliases): print "\tPresences:" for hid, (presenceType, presence, presenceMessage) in aliases.iteritems(): print "\t\t%s:" % hid, presenceType, presence, presenceMessage super(SimplePresenceStatus, self)._on_done() class SetSimplePresence(Action): def __init__(self, connAction, status, message): super(SetSimplePresence, self).__init__() self._connAction = connAction self._status = status self._message = message def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION_INTERFACE_SIMPLE_PRESENCE].SetPresence( self._status, self._message, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self): super(SetSimplePresence, self)._on_done() class Aliases(Action): def __init__(self, connAction, handleAction): super(Aliases, self).__init__() self._connAction = connAction self._handleAction = handleAction def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION_INTERFACE_ALIASING].RequestAliases( self._handleAction.handles, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, aliases): print "\tAliases:" for h, alias in zip(self._handleAction.handles, aliases): print "\t\t", h, alias super(Aliases, self)._on_done() class Call(Action): def __init__(self, connAction, chanAction, handleAction): super(Call, self).__init__() self._connAction = connAction self._chanAction = chanAction self._handleAction = handleAction def queue_action(self): self._chanAction.channel[telepathy.server.CHANNEL_TYPE_STREAMED_MEDIA].RequestStreams( self._handleAction.handle, [telepathy.constants.MEDIA_STREAM_TYPE_AUDIO], reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self, handle): print "Call started" super(Call, self)._on_done() class SendText(Action): def __init__(self, connAction, chanAction, handleAction, messageType, message): super(SendText, self).__init__() self._connAction = connAction self._chanAction = chanAction self._handleAction = handleAction self._messageType = messageType self._message = message def queue_action(self): self._chanAction.channel[telepathy.server.CHANNEL_TYPE_TEXT].Send( self._messageType, self._message, reply_handler = self._on_done, error_handler = self._on_error, ) def _on_done(self,): print "Message sent" super(SendText, self)._on_done() class Sleep(Action): def __init__(self, length): super(Sleep, self).__init__() self._length = length def queue_action(self): gobject.timeout_add(self._length, self._on_done) class Block(Action): def __init__(self): super(Block, self).__init__() def queue_action(self): print "Blocking" def _on_done(self): #super(SendText, self)._on_done() pass class Disconnect(Action): def __init__(self, connAction): super(Disconnect, self).__init__() self._connAction = connAction def queue_action(self): self._connAction.conn[telepathy.server.CONNECTION].Disconnect( reply_handler = self._on_done, error_handler = self._on_error, ) if __name__ == '__main__': loop = gobject.MainLoop() reg = get_registry() cm = get_connection_manager(reg) nullHandle = NullHandle() dummy = DummyAction() firstAction = dummy lastAction = dummy if True: dp = DisplayParams(cm) lastAction.append_action(dp) lastAction = lastAction.get_next_action() if True: username = sys.argv[1] password = sys.argv[2] forward = sys.argv[3] reqcon = RequestConnection(cm, username, password, forward) lastAction.append_action(reqcon) lastAction = lastAction.get_next_action() if False: reqcon = RequestConnection(cm, username, password, forward) lastAction.append_action(reqcon) lastAction = lastAction.get_next_action() con = Connect(reqcon) lastAction.append_action(con) lastAction = lastAction.get_next_action() if True: spo = SimplePresenceOptions(reqcon) lastAction.append_action(spo) lastAction = lastAction.get_next_action() if True: uh = UserHandle(reqcon) lastAction.append_action(uh) lastAction = lastAction.get_next_action() ua = Aliases(reqcon, uh) lastAction.append_action(ua) lastAction = lastAction.get_next_action() sps = SimplePresenceStatus(reqcon, uh) lastAction.append_action(sps) lastAction = lastAction.get_next_action() if False: setdnd = SetSimplePresence(reqcon, "dnd", "") lastAction.append_action(setdnd) lastAction = lastAction.get_next_action() sps = SimplePresenceStatus(reqcon, uh) lastAction.append_action(sps) lastAction = lastAction.get_next_action() setdnd = SetSimplePresence(reqcon, "available", "") lastAction.append_action(setdnd) lastAction = lastAction.get_next_action() sps = SimplePresenceStatus(reqcon, uh) lastAction.append_action(sps) lastAction = lastAction.get_next_action() if False: sl = Sleep(10 * 1000) lastAction.append_action(sl) lastAction = lastAction.get_next_action() if False: rclh = RequestHandle(reqcon, telepathy.HANDLE_TYPE_LIST, ["subscribe"]) lastAction.append_action(rclh) lastAction = lastAction.get_next_action() rclc = RequestChannel( reqcon, rclh, telepathy.CHANNEL_TYPE_CONTACT_LIST, telepathy.HANDLE_TYPE_LIST, ) lastAction.append_action(rclc) lastAction = lastAction.get_next_action() ch = ContactHandles(reqcon, rclc) lastAction.append_action(ch) lastAction = lastAction.get_next_action() ca = Aliases(reqcon, ch) lastAction.append_action(ca) lastAction = lastAction.get_next_action() if True: accountNumber = sys.argv[4] enChan = EnsureChannel(reqcon, telepathy.CHANNEL_TYPE_TEXT, telepathy.HANDLE_TYPE_CONTACT, accountNumber) lastAction.append_action(enChan) lastAction = lastAction.get_next_action() sendDebugtext = SendText(reqcon, enChan, enChan, telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Boo!") lastAction.append_action(sendDebugtext) lastAction = lastAction.get_next_action() if False: rch = RequestHandle(reqcon, telepathy.HANDLE_TYPE_CONTACT, ["18005558355"]) #(1-800-555-TELL) lastAction.append_action(rch) lastAction = lastAction.get_next_action() # making a phone call if True: smHandle = rch smHandleType = telepathy.HANDLE_TYPE_CONTACT else: smHandle = nullHandle smHandleType = telepathy.HANDLE_TYPE_NONE rsmc = RequestChannel( reqcon, smHandle, telepathy.CHANNEL_TYPE_STREAMED_MEDIA, smHandleType, ) lastAction.append_action(rsmc) lastAction = lastAction.get_next_action() if False: call = Call(reqcon, rsmc, rch) lastAction.append_action(call) lastAction = lastAction.get_next_action() # sending a text rtc = RequestChannel( reqcon, rch, telepathy.CHANNEL_TYPE_TEXT, smHandleType, ) lastAction.append_action(rtc) lastAction = lastAction.get_next_action() if True: closechan = CloseChannel(reqcon, rtc) lastAction.append_action(closechan) lastAction = lastAction.get_next_action() rtc = RequestChannel( reqcon, rch, telepathy.CHANNEL_TYPE_TEXT, smHandleType, ) lastAction.append_action(rtc) lastAction = lastAction.get_next_action() if False: sendtext = SendText(reqcon, rtc, rch, telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Boo!") lastAction.append_action(sendtext) lastAction = lastAction.get_next_action() if False: bl = Block() lastAction.append_action(bl) lastAction = lastAction.get_next_action() if False: sl = Sleep(30 * 1000) lastAction.append_action(sl) lastAction = lastAction.get_next_action() dis = Disconnect(reqcon) lastAction.append_action(dis) lastAction = lastAction.get_next_action() quitter = QuitLoop(loop) lastAction.append_action(quitter) lastAction = lastAction.get_next_action() firstAction.queue_action() loop.run()
epage/telepathy-bluewire
hand_tests/generic.py
Python
lgpl-2.1
17,072
// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Pango { using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; #region Autogenerated code public partial class FontFace : GLib.Object { public FontFace (IntPtr raw) : base(raw) {} protected FontFace() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr pango_font_face_describe(IntPtr raw); public Pango.FontDescription Describe() { IntPtr raw_ret = pango_font_face_describe(Handle); Pango.FontDescription ret = raw_ret == IntPtr.Zero ? null : (Pango.FontDescription) GLib.Opaque.GetOpaque (raw_ret, typeof (Pango.FontDescription), true); return ret; } [DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr pango_font_face_get_face_name(IntPtr raw); public string FaceName { get { IntPtr raw_ret = pango_font_face_get_face_name(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr pango_font_face_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = pango_font_face_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern bool pango_font_face_is_synthesized(IntPtr raw); public bool IsSynthesized { get { bool raw_ret = pango_font_face_is_synthesized(Handle); bool ret = raw_ret; return ret; } } [DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void pango_font_face_list_sizes(IntPtr raw, out int sizes, out int n_sizes); public void ListSizes(out int sizes, out int n_sizes) { pango_font_face_list_sizes(Handle, out sizes, out n_sizes); } #endregion } }
akrisiun/gtk-sharp
pango/generated/Pango/FontFace.cs
C#
lgpl-2.1
2,141
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="ia"> <context> <name>LxQtTaskButton</name> <message> <location filename="../lxqttaskbutton.cpp" line="367"/> <source>Application</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="400"/> <source>To &amp;Desktop</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="402"/> <source>&amp;All Desktops</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="410"/> <source>Desktop &amp;%1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="417"/> <source>&amp;To Current Desktop</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="426"/> <source>Ma&amp;ximize</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="433"/> <source>Maximize vertically</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="438"/> <source>Maximize horizontally</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="444"/> <source>&amp;Restore</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="448"/> <source>Mi&amp;nimize</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="454"/> <source>Roll down</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="460"/> <source>Roll up</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="468"/> <source>&amp;Layer</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="470"/> <source>Always on &amp;top</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="476"/> <source>&amp;Normal</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="482"/> <source>Always on &amp;bottom</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbutton.cpp" line="490"/> <source>&amp;Close</source> <translation type="unfinished"></translation> </message> </context> <context> <name>LxQtTaskbarConfiguration</name> <message> <location filename="../lxqttaskbarconfiguration.ui" line="14"/> <source>Task Manager Settings</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="20"/> <source>Taskbar Contents</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="26"/> <source>Show windows from current desktop</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="49"/> <source>Taskbar Appearance</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="65"/> <source>Minimum button width</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="88"/> <source>Auto&amp;rotate buttons when the panel is vertical</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="98"/> <source>Close on middle-click</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="36"/> <source>Show windows from all desktops</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.ui" line="55"/> <source>Button style</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.cpp" line="46"/> <source>Icon and text</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.cpp" line="47"/> <source>Only icon</source> <translation type="unfinished"></translation> </message> <message> <location filename="../lxqttaskbarconfiguration.cpp" line="48"/> <source>Only text</source> <translation type="unfinished"></translation> </message> </context> </TS>
npmiller/lxqt-panel
plugin-taskbar/translations/taskbar_ia.ts
TypeScript
lgpl-2.1
5,821
// // Copyright (c) 2013, Ford Motor Company // 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 the Ford Motor Company 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 HOLDER 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 NSSMARTDEVICELINKRPCV2_SCROLLABLEMESSAGE_RESPONSEMARSHALLER_INCLUDE #define NSSMARTDEVICELINKRPCV2_SCROLLABLEMESSAGE_RESPONSEMARSHALLER_INCLUDE #include <string> #include <json/json.h> #include "../include/JSONHandler/SDLRPCObjects/V2/ScrollableMessage_response.h" /* interface Ford Sync RAPI version 2.0O date 2012-11-02 generated at Thu Jan 24 06:36:23 2013 source stamp Thu Jan 24 06:35:41 2013 author RC */ namespace NsSmartDeviceLinkRPCV2 { struct ScrollableMessage_responseMarshaller { static bool checkIntegrity(ScrollableMessage_response& e); static bool checkIntegrityConst(const ScrollableMessage_response& e); static bool fromString(const std::string& s,ScrollableMessage_response& e); static const std::string toString(const ScrollableMessage_response& e); static bool fromJSON(const Json::Value& s,ScrollableMessage_response& e); static Json::Value toJSON(const ScrollableMessage_response& e); }; } #endif
Luxoft/SDLP
SDL_Core/src/components/JSONHandler/src/SDLRPCObjectsImpl/V2/ScrollableMessage_responseMarshaller.h
C
lgpl-2.1
2,554
/* * Copyright (C) 2007-2010 Red Hat, Inc. * * 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 * * Authors: * Mark McLoughlin <[email protected]> */ #include <config.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <errno.h> #include <limits.h> #include <unistd.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #ifdef HAVE_PATHS_H # include <paths.h> #endif #include "internal.h" #include "iptables.h" #include "util.h" #include "memory.h" #include "virterror_internal.h" #include "logging.h" enum { ADD = 0, REMOVE }; typedef struct { char *table; char *chain; } iptRules; struct _iptablesContext { iptRules *input_filter; iptRules *forward_filter; iptRules *nat_postrouting; }; static void iptRulesFree(iptRules *rules) { VIR_FREE(rules->table); VIR_FREE(rules->chain); VIR_FREE(rules); } static iptRules * iptRulesNew(const char *table, const char *chain) { iptRules *rules; if (VIR_ALLOC(rules) < 0) return NULL; if (!(rules->table = strdup(table))) goto error; if (!(rules->chain = strdup(chain))) goto error; return rules; error: iptRulesFree(rules); return NULL; } static int ATTRIBUTE_SENTINEL iptablesAddRemoveRule(iptRules *rules, int action, const char *arg, ...) { va_list args; int retval = ENOMEM; const char **argv; const char *s; int n; n = 1 + /* /sbin/iptables */ 2 + /* --table foo */ 2 + /* --insert bar */ 1; /* arg */ va_start(args, arg); while (va_arg(args, const char *)) n++; va_end(args); if (VIR_ALLOC_N(argv, n + 1) < 0) goto error; n = 0; if (!(argv[n++] = strdup(IPTABLES_PATH))) goto error; if (!(argv[n++] = strdup("--table"))) goto error; if (!(argv[n++] = strdup(rules->table))) goto error; if (!(argv[n++] = strdup(action == ADD ? "--insert" : "--delete"))) goto error; if (!(argv[n++] = strdup(rules->chain))) goto error; if (!(argv[n++] = strdup(arg))) goto error; va_start(args, arg); while ((s = va_arg(args, const char *))) { if (!(argv[n++] = strdup(s))) { va_end(args); goto error; } } va_end(args); if (virRun(argv, NULL) < 0) { retval = errno; goto error; } retval = 0; error: if (argv) { n = 0; while (argv[n]) VIR_FREE(argv[n++]); VIR_FREE(argv); } return retval; } /** * iptablesContextNew: * * Create a new IPtable context * * Returns a pointer to the new structure or NULL in case of error */ iptablesContext * iptablesContextNew(void) { iptablesContext *ctx; if (VIR_ALLOC(ctx) < 0) return NULL; if (!(ctx->input_filter = iptRulesNew("filter", "INPUT"))) goto error; if (!(ctx->forward_filter = iptRulesNew("filter", "FORWARD"))) goto error; if (!(ctx->nat_postrouting = iptRulesNew("nat", "POSTROUTING"))) goto error; return ctx; error: iptablesContextFree(ctx); return NULL; } /** * iptablesContextFree: * @ctx: pointer to the IP table context * * Free the resources associated with an IP table context */ void iptablesContextFree(iptablesContext *ctx) { if (ctx->input_filter) iptRulesFree(ctx->input_filter); if (ctx->forward_filter) iptRulesFree(ctx->forward_filter); if (ctx->nat_postrouting) iptRulesFree(ctx->nat_postrouting); VIR_FREE(ctx); } static int iptablesInput(iptablesContext *ctx, const char *iface, int port, int action, int tcp) { char portstr[32]; snprintf(portstr, sizeof(portstr), "%d", port); portstr[sizeof(portstr) - 1] = '\0'; return iptablesAddRemoveRule(ctx->input_filter, action, "--in-interface", iface, "--protocol", tcp ? "tcp" : "udp", "--destination-port", portstr, "--jump", "ACCEPT", NULL); } /** * iptablesAddTcpInput: * @ctx: pointer to the IP table context * @iface: the interface name * @port: the TCP port to add * * Add an input to the IP table allowing access to the given @port on * the given @iface interface for TCP packets * * Returns 0 in case of success or an error code in case of error */ int iptablesAddTcpInput(iptablesContext *ctx, const char *iface, int port) { return iptablesInput(ctx, iface, port, ADD, 1); } /** * iptablesRemoveTcpInput: * @ctx: pointer to the IP table context * @iface: the interface name * @port: the TCP port to remove * * Removes an input from the IP table, hence forbidding access to the given * @port on the given @iface interface for TCP packets * * Returns 0 in case of success or an error code in case of error */ int iptablesRemoveTcpInput(iptablesContext *ctx, const char *iface, int port) { return iptablesInput(ctx, iface, port, REMOVE, 1); } /** * iptablesAddUdpInput: * @ctx: pointer to the IP table context * @iface: the interface name * @port: the UDP port to add * * Add an input to the IP table allowing access to the given @port on * the given @iface interface for UDP packets * * Returns 0 in case of success or an error code in case of error */ int iptablesAddUdpInput(iptablesContext *ctx, const char *iface, int port) { return iptablesInput(ctx, iface, port, ADD, 0); } /** * iptablesRemoveUdpInput: * @ctx: pointer to the IP table context * @iface: the interface name * @port: the UDP port to remove * * Removes an input from the IP table, hence forbidding access to the given * @port on the given @iface interface for UDP packets * * Returns 0 in case of success or an error code in case of error */ int iptablesRemoveUdpInput(iptablesContext *ctx, const char *iface, int port) { return iptablesInput(ctx, iface, port, REMOVE, 0); } /* Allow all traffic coming from the bridge, with a valid network address * to proceed to WAN */ static int iptablesForwardAllowOut(iptablesContext *ctx, const char *network, const char *iface, const char *physdev, int action) { if (physdev && physdev[0]) { return iptablesAddRemoveRule(ctx->forward_filter, action, "--source", network, "--in-interface", iface, "--out-interface", physdev, "--jump", "ACCEPT", NULL); } else { return iptablesAddRemoveRule(ctx->forward_filter, action, "--source", network, "--in-interface", iface, "--jump", "ACCEPT", NULL); } } /** * iptablesAddForwardAllowOut: * @ctx: pointer to the IP table context * @network: the source network name * @iface: the source interface name * @physdev: the physical output device * * Add a rule to the IP table context to allow the traffic for the * network @network via interface @iface to be forwarded to * @physdev device. This allow the outbound traffic on a bridge. * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardAllowOut(iptablesContext *ctx, const char *network, const char *iface, const char *physdev) { return iptablesForwardAllowOut(ctx, network, iface, physdev, ADD); } /** * iptablesRemoveForwardAllowOut: * @ctx: pointer to the IP table context * @network: the source network name * @iface: the source interface name * @physdev: the physical output device * * Remove a rule from the IP table context hence forbidding forwarding * of the traffic for the network @network via interface @iface * to the @physdev device output. This stops the outbound traffic on a bridge. * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardAllowOut(iptablesContext *ctx, const char *network, const char *iface, const char *physdev) { return iptablesForwardAllowOut(ctx, network, iface, physdev, REMOVE); } /* Allow all traffic destined to the bridge, with a valid network address * and associated with an existing connection */ static int iptablesForwardAllowRelatedIn(iptablesContext *ctx, const char *network, const char *iface, const char *physdev, int action) { if (physdev && physdev[0]) { return iptablesAddRemoveRule(ctx->forward_filter, action, "--destination", network, "--in-interface", physdev, "--out-interface", iface, "--match", "state", "--state", "ESTABLISHED,RELATED", "--jump", "ACCEPT", NULL); } else { return iptablesAddRemoveRule(ctx->forward_filter, action, "--destination", network, "--out-interface", iface, "--match", "state", "--state", "ESTABLISHED,RELATED", "--jump", "ACCEPT", NULL); } } /** * iptablesAddForwardAllowRelatedIn: * @ctx: pointer to the IP table context * @network: the source network name * @iface: the output interface name * @physdev: the physical input device or NULL * * Add rules to the IP table context to allow the traffic for the * network @network on @physdev device to be forwarded to * interface @iface, if it is part of an existing connection. * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardAllowRelatedIn(iptablesContext *ctx, const char *network, const char *iface, const char *physdev) { return iptablesForwardAllowRelatedIn(ctx, network, iface, physdev, ADD); } /** * iptablesRemoveForwardAllowRelatedIn: * @ctx: pointer to the IP table context * @network: the source network name * @iface: the output interface name * @physdev: the physical input device or NULL * * Remove rules from the IP table context hence forbidding the traffic for * network @network on @physdev device to be forwarded to * interface @iface, if it is part of an existing connection. * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardAllowRelatedIn(iptablesContext *ctx, const char *network, const char *iface, const char *physdev) { return iptablesForwardAllowRelatedIn(ctx, network, iface, physdev, REMOVE); } /* Allow all traffic destined to the bridge, with a valid network address */ static int iptablesForwardAllowIn(iptablesContext *ctx, const char *network, const char *iface, const char *physdev, int action) { if (physdev && physdev[0]) { return iptablesAddRemoveRule(ctx->forward_filter, action, "--destination", network, "--in-interface", physdev, "--out-interface", iface, "--jump", "ACCEPT", NULL); } else { return iptablesAddRemoveRule(ctx->forward_filter, action, "--destination", network, "--out-interface", iface, "--jump", "ACCEPT", NULL); } } /** * iptablesAddForwardAllowIn: * @ctx: pointer to the IP table context * @network: the source network name * @iface: the output interface name * @physdev: the physical input device or NULL * * Add rules to the IP table context to allow the traffic for the * network @network on @physdev device to be forwarded to * interface @iface. This allow the inbound traffic on a bridge. * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardAllowIn(iptablesContext *ctx, const char *network, const char *iface, const char *physdev) { return iptablesForwardAllowIn(ctx, network, iface, physdev, ADD); } /** * iptablesRemoveForwardAllowIn: * @ctx: pointer to the IP table context * @network: the source network name * @iface: the output interface name * @physdev: the physical input device or NULL * * Remove rules from the IP table context hence forbidding the traffic for * network @network on @physdev device to be forwarded to * interface @iface. This stops the inbound traffic on a bridge. * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardAllowIn(iptablesContext *ctx, const char *network, const char *iface, const char *physdev) { return iptablesForwardAllowIn(ctx, network, iface, physdev, REMOVE); } /* Allow all traffic between guests on the same bridge, * with a valid network address */ static int iptablesForwardAllowCross(iptablesContext *ctx, const char *iface, int action) { return iptablesAddRemoveRule(ctx->forward_filter, action, "--in-interface", iface, "--out-interface", iface, "--jump", "ACCEPT", NULL); } /** * iptablesAddForwardAllowCross: * @ctx: pointer to the IP table context * @iface: the input/output interface name * * Add rules to the IP table context to allow traffic to cross that * interface. It allows all traffic between guests on the same bridge * represented by that interface. * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardAllowCross(iptablesContext *ctx, const char *iface) { return iptablesForwardAllowCross(ctx, iface, ADD); } /** * iptablesRemoveForwardAllowCross: * @ctx: pointer to the IP table context * @iface: the input/output interface name * * Remove rules to the IP table context to block traffic to cross that * interface. It forbids traffic between guests on the same bridge * represented by that interface. * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardAllowCross(iptablesContext *ctx, const char *iface) { return iptablesForwardAllowCross(ctx, iface, REMOVE); } /* Drop all traffic trying to forward from the bridge. * ie the bridge is the in interface */ static int iptablesForwardRejectOut(iptablesContext *ctx, const char *iface, int action) { return iptablesAddRemoveRule(ctx->forward_filter, action, "--in-interface", iface, "--jump", "REJECT", NULL); } /** * iptablesAddForwardRejectOut: * @ctx: pointer to the IP table context * @iface: the output interface name * * Add rules to the IP table context to forbid all traffic to that * interface. It forbids forwarding from the bridge to that interface. * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardRejectOut(iptablesContext *ctx, const char *iface) { return iptablesForwardRejectOut(ctx, iface, ADD); } /** * iptablesRemoveForwardRejectOut: * @ctx: pointer to the IP table context * @iface: the output interface name * * Remove rules from the IP table context forbidding all traffic to that * interface. It reallow forwarding from the bridge to that interface. * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardRejectOut(iptablesContext *ctx, const char *iface) { return iptablesForwardRejectOut(ctx, iface, REMOVE); } /* Drop all traffic trying to forward to the bridge. * ie the bridge is the out interface */ static int iptablesForwardRejectIn(iptablesContext *ctx, const char *iface, int action) { return iptablesAddRemoveRule(ctx->forward_filter, action, "--out-interface", iface, "--jump", "REJECT", NULL); } /** * iptablesAddForwardRejectIn: * @ctx: pointer to the IP table context * @iface: the input interface name * * Add rules to the IP table context to forbid all traffic from that * interface. It forbids forwarding from that interface to the bridge. * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardRejectIn(iptablesContext *ctx, const char *iface) { return iptablesForwardRejectIn(ctx, iface, ADD); } /** * iptablesRemoveForwardRejectIn: * @ctx: pointer to the IP table context * @iface: the input interface name * * Remove rules from the IP table context forbidding all traffic from that * interface. It allows forwarding from that interface to the bridge. * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardRejectIn(iptablesContext *ctx, const char *iface) { return iptablesForwardRejectIn(ctx, iface, REMOVE); } /* Masquerade all traffic coming from the network associated * with the bridge */ static int iptablesForwardMasquerade(iptablesContext *ctx, const char *network, const char *physdev, int action) { if (physdev && physdev[0]) { return iptablesAddRemoveRule(ctx->nat_postrouting, action, "--source", network, "!", "--destination", network, "--out-interface", physdev, "--jump", "MASQUERADE", NULL); } else { return iptablesAddRemoveRule(ctx->nat_postrouting, action, "--source", network, "!", "--destination", network, "--jump", "MASQUERADE", NULL); } } /** * iptablesAddForwardMasquerade: * @ctx: pointer to the IP table context * @network: the source network name * @physdev: the physical input device or NULL * * Add rules to the IP table context to allow masquerading * network @network on @physdev. This allow the bridge to * masquerade for that network (on @physdev). * * Returns 0 in case of success or an error code otherwise */ int iptablesAddForwardMasquerade(iptablesContext *ctx, const char *network, const char *physdev) { return iptablesForwardMasquerade(ctx, network, physdev, ADD); } /** * iptablesRemoveForwardMasquerade: * @ctx: pointer to the IP table context * @network: the source network name * @physdev: the physical input device or NULL * * Remove rules from the IP table context to stop masquerading * network @network on @physdev. This stops the bridge from * masquerading for that network (on @physdev). * * Returns 0 in case of success or an error code otherwise */ int iptablesRemoveForwardMasquerade(iptablesContext *ctx, const char *network, const char *physdev) { return iptablesForwardMasquerade(ctx, network, physdev, REMOVE); }
hjwsm1989/libvirt
src/util/iptables.c
C
lgpl-2.1
21,945
package compiler.ASTNodes.Operators; import compiler.ASTNodes.GeneralNodes.Node; import compiler.ASTNodes.GeneralNodes.UnaryNode; import compiler.ASTNodes.SyntaxNodes.ExprNode; import compiler.Visitors.AbstractVisitor; public class UnaryMinusNode extends ExprNode { public UnaryMinusNode(Node child) { super(child, null); } @Override public Object Accept(AbstractVisitor v) { return v.visit(this); } }
TobiasMorell/P4
Minecraft/src/main/java/compiler/ASTNodes/Operators/UnaryMinusNode.java
Java
lgpl-2.1
415
#include <QtGui> #include "btglobal.h" #include "btqlistdelegate.h" //#include <QMetaType> btQListDeletgate::btQListDeletgate(QObject *parent) : QItemDelegate(parent) { } QWidget *btQListDeletgate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { //qRegisterMetaType<btChildWeights>("btChildWeights"); //qRegisterMetaType<btParallelConditions>("btParallelConditions"); QComboBox *comboBox = new QComboBox(parent); comboBox->addItem("int", QVariant("int")); comboBox->addItem("QString", QVariant("QString")); comboBox->addItem("double", QVariant("double")); comboBox->addItem("QVariantList", QVariant("QVariantList")); //comboBox->addItem("btChildWeights", QVariant("btChildWeights")); comboBox->setCurrentIndex(comboBox->findData(index.data())); return comboBox; } void btQListDeletgate::setEditorData(QWidget *editor, const QModelIndex &index) const { QString value = index.model()->data(index, Qt::EditRole).toString(); QComboBox *comboBox = static_cast<QComboBox*>(editor); comboBox->setCurrentIndex(comboBox->findText(value));//comboBox->findData(value)); } void btQListDeletgate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { QComboBox *comboBox = static_cast<QComboBox*>(editor); QString value = comboBox->currentText(); model->setData(index, value, Qt::EditRole); } void btQListDeletgate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const { editor->setGeometry(option.rect); } #include "btqlistdelegate.moc"
pranavrc/gluon
smarts/editor/btqlistdelegate.cpp
C++
lgpl-2.1
1,655
/** * NativeFmod Project * * Want to use FMOD API (www.fmod.org) in the Java language ? NativeFmod is made for you. * Copyright © 2004-2007 Jérôme JOUVIE (Jouvieje) * * Created on 28 avr. 2004 * @version NativeFmod v3.4 (for FMOD v3.75) * @author Jérôme JOUVIE (Jouvieje) * * * WANT TO CONTACT ME ? * E-mail : * [email protected] * My web sites : * http://jerome.jouvie.free.fr/ * * * INTRODUCTION * Fmod is an API (Application Programming Interface) that allow you to use music * and creating sound effects with a lot of sort of musics. * Fmod is at : * http://www.fmod.org/ * The reason of this project is that Fmod can't be used in Java direcly, so I've created * NativeFmod project. * * * GNU LESSER GENERAL PUBLIC LICENSE * * 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.jouvieje.Fmod.Structures; import org.jouvieje.Fmod.Misc.Pointer; /** * Structure defining the properties for a reverb source, related to a FSOUND channel. * For more indepth descriptions of the reverb properties under win32, please see the EAX3 * documentation at http://developer.creative.com/ under the 'downloads' section. * If they do not have the EAX3 documentation, then most information can be attained from * the EAX2 documentation, as EAX3 only adds some more parameters and functionality on top of * EAX2. * Note the default reverb properties are the same as the FSOUND_PRESET_GENERIC preset. * Note that integer values that typically range from -10,000 to 1000 are represented in * decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear. * PORTABILITY: Each member has the platform it supports in braces ie (win32/xbox). * Some reverb parameters are only supported in win32 and some only on xbox. If all parameters are set then * the reverb should product a similar effect on either platform. * Linux and FMODCE do not support the reverb api. * The numerical values listed below are the maximum, minimum and default values for each variable respectively. */ public class FSOUND_REVERB_CHANNELPROPERTIES extends Pointer { /** * Create a view of the <code>Pointer</code> object as a <code>FSOUND_REVERB_CHANNELPROPERTIES</code> object.<br> * This view is valid only if the memory holded by the <code>Pointer</code> holds a FSOUND_REVERB_CHANNELPROPERTIES object. */ public static FSOUND_REVERB_CHANNELPROPERTIES createView(Pointer pointer) { return new FSOUND_REVERB_CHANNELPROPERTIES(Pointer.getPointer(pointer)); } /** * Create a new <code>FSOUND_REVERB_CHANNELPROPERTIES</code>.<br> * The call <code>isNull()</code> on the object created will return false.<br> * <pre><code> FSOUND_REVERB_CHANNELPROPERTIES obj = FSOUND_REVERB_CHANNELPROPERTIES.create(); * (obj == null) <=> obj.isNull() <=> false * </code></pre> */ public static FSOUND_REVERB_CHANNELPROPERTIES create() { return new FSOUND_REVERB_CHANNELPROPERTIES(StructureJNI.new_FSOUND_REVERB_CHANNELPROPERTIES()); } protected FSOUND_REVERB_CHANNELPROPERTIES(long pointer) { super(pointer); } /** * Create an object that holds a null <code>FSOUND_REVERB_CHANNELPROPERTIES</code>.<br> * The call <code>isNull()</code> on the object created will returns true.<br> * <pre><code> FSOUND_REVERB_CHANNELPROPERTIES obj = new FSOUND_REVERB_CHANNELPROPERTIES(); * (obj == null) <=> false * obj.isNull() <=> true * </code></pre> * To creates a new <code>FSOUND_REVERB_CHANNELPROPERTIES</code>, use the static "constructor" : * <pre><code> FSOUND_REVERB_CHANNELPROPERTIES obj = FSOUND_REVERB_CHANNELPROPERTIES.create();</code></pre> * @see FSOUND_REVERB_CHANNELPROPERTIES#create() */ public FSOUND_REVERB_CHANNELPROPERTIES() { super(); } public void release() { if(pointer != 0) { StructureJNI.delete_FSOUND_REVERB_CHANNELPROPERTIES(pointer); } pointer = 0; } /** * -10000, 1000, 0, direct path level (at low and mid frequencies) (WIN32/XBOX) */ public void setDirect(int Direct) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Direct(pointer, Direct); } /** * @return value of Direct */ public int getDirect() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Direct(pointer); } /** * -10000, 0, 0, relative direct path level at high frequencies (WIN32/XBOX) */ public void setDirectHF(int DirectHF) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_DirectHF(pointer, DirectHF); } /** * @return value of DirectHF */ public int getDirectHF() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_DirectHF(pointer); } /** * -10000, 1000, 0, room effect level (at low and mid frequencies) (WIN32/XBOX/PS2) */ public void setRoom(int Room) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Room(pointer, Room); } /** * @return value of Room */ public int getRoom() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Room(pointer); } /** * -10000, 0, 0, relative room effect level at high frequencies (WIN32/XBOX) */ public void setRoomHF(int RoomHF) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_RoomHF(pointer, RoomHF); } /** * @return value of RoomHF */ public int getRoomHF() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_RoomHF(pointer); } /** * -10000, 0, 0, main obstruction control (attenuation at high frequencies) (WIN32/XBOX) */ public void setObstruction(int Obstruction) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Obstruction(pointer, Obstruction); } /** * @return value of Obstruction */ public int getObstruction() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Obstruction(pointer); } /** * 0.0, 1.0, 0.0, obstruction low-frequency level re. main control (WIN32/XBOX) */ public void setObstructionLFRatio(float ObstructionLFRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_ObstructionLFRatio(pointer, ObstructionLFRatio); } /** * @return value of ObstructionLFRatio */ public float getObstructionLFRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_ObstructionLFRatio(pointer); } /** * -10000, 0, 0, main occlusion control (attenuation at high frequencies) (WIN32/XBOX) */ public void setOcclusion(int Occlusion) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Occlusion(pointer, Occlusion); } /** * @return value of Occlusion */ public int getOcclusion() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Occlusion(pointer); } /** * 0.0, 1.0, 0.25, occlusion low-frequency level re. main control (WIN32/XBOX) */ public void setOcclusionLFRatio(float OcclusionLFRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionLFRatio(pointer, OcclusionLFRatio); } /** * @return value of OcclusionLFRatio */ public float getOcclusionLFRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionLFRatio(pointer); } /** * 0.0, 10.0, 1.5, relative occlusion control for room effect (WIN32) */ public void setOcclusionRoomRatio(float OcclusionRoomRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionRoomRatio(pointer, OcclusionRoomRatio); } /** * @return value of OcclusionRoomRatio */ public float getOcclusionRoomRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionRoomRatio(pointer); } /** * 0.0, 10.0, 1.0, relative occlusion control for direct path (WIN32) */ public void setOcclusionDirectRatio(float OcclusionDirectRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionDirectRatio(pointer, OcclusionDirectRatio); } /** * @return value of OcclusionDirectRatio */ public float getOcclusionDirectRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionDirectRatio(pointer); } /** * -10000, 0, 0, main exlusion control (attenuation at high frequencies) (WIN32) */ public void setExclusion(int Exclusion) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Exclusion(pointer, Exclusion); } /** * @return value of Exclusion */ public int getExclusion() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Exclusion(pointer); } /** * 0.0, 1.0, 1.0, exclusion low-frequency level re. main control (WIN32) */ public void setExclusionLFRatio(float ExclusionLFRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_ExclusionLFRatio(pointer, ExclusionLFRatio); } /** * @return value of ExclusionLFRatio */ public float getExclusionLFRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_ExclusionLFRatio(pointer); } /** * -10000, 0, 0, outside sound cone level at high frequencies (WIN32) */ public void setOutsideVolumeHF(int OutsideVolumeHF) { if(pointer == 0) throw new NullPointerException(); StructureJNI .set_FSOUND_REVERB_CHANNELPROPERTIES_OutsideVolumeHF(pointer, OutsideVolumeHF); } /** * @return value of OutsideVolumeHF */ public int getOutsideVolumeHF() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OutsideVolumeHF(pointer); } /** * 0.0, 10.0, 0.0, like DS3D flDopplerFactor but per source (WIN32) */ public void setDopplerFactor(float DopplerFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_DopplerFactor(pointer, DopplerFactor); } /** * @return value of DopplerFactor */ public float getDopplerFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_DopplerFactor(pointer); } /** * 0.0, 10.0, 0.0, like DS3D flRolloffFactor but per source (WIN32) */ public void setRolloffFactor(float RolloffFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_RolloffFactor(pointer, RolloffFactor); } /** * @return value of RolloffFactor */ public float getRolloffFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_RolloffFactor(pointer); } /** * 0.0, 10.0, 0.0, like DS3D flRolloffFactor but for room effect (WIN32/XBOX) */ public void setRoomRolloffFactor(float RoomRolloffFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_RoomRolloffFactor(pointer, RoomRolloffFactor); } /** * @return value of RoomRolloverFactor */ public float getRoomRolloffFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_RoomRolloffFactor(pointer); } /** * 0.0, 10.0, 1.0, multiplies AirAbsorptionHF member of FSOUND_REVERB_PROPERTIES (WIN32) * */ public void setAirAbsorptionFactor(float AirAbsorptionFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_AirAbsorptionFactor(pointer, AirAbsorptionFactor); } /** * @return value of AirAbsorptionFactor */ public float getAirAbsorptionFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_AirAbsorptionFactor(pointer); } /** * FSOUND_REVERB_CHANNELFLAGS - modifies the behavior of properties (WIN32) */ public void setFlags(int Flags) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Flags(pointer, Flags); } /** * @return value of EchoTime */ public int getFlags() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Flags(pointer); } }
jerome-jouvie/NativeFmod
src-java/org/jouvieje/Fmod/Structures/FSOUND_REVERB_CHANNELPROPERTIES.java
Java
lgpl-2.1
13,664
/* * Multisim: a microprocessor architecture exploration framework * Copyright (C) 2014 Tommy Thorn * * 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. */ int SZ(loadelf,)(memory_t *m, char *name, FILE *f, elf_info_t *elf_info) { memset(elf_info, 0, sizeof *elf_info); SZ(Elf,_Ehdr) ehdr; SZ(Elf,_Phdr) *ph; if (fread(&ehdr, sizeof ehdr, 1, f) != 1) { fprintf(stderr, "%s: short header read, file corrupted?\n", name); return 10; } if (ehdr.e_ident[EI_DATA] != ELFDATA2MSB && ehdr.e_ident[EI_DATA] != ELFDATA2LSB) { fprintf(stderr, "%s: Unsupported endian (%d)\n", name, ehdr.e_ident[EI_DATA]); return 11; } elf_info->endian_is_big = ehdr.e_ident[EI_DATA] == ELFDATA2MSB; memory_set_endian(m, elf_info->endian_is_big); if (NATIVE(ehdr.e_type) != ET_EXEC) { fprintf(stderr, "%s: Need a fully linked ELF executable, not type %d\n", name, NATIVE(ehdr.e_type)); return 12; } elf_info->machine = NATIVE(ehdr.e_machine); if (elf_info->machine != EM_ALPHA && elf_info->machine != EM_RISCV && elf_info->machine != EM_LM32 && elf_info->machine != EM_LM32_ALT) { fprintf(stderr, "%s: Unsupported machine architecture %d\n", name, NATIVE(ehdr.e_machine)); return 13; } if (enable_verb_prog_sec) { printf("%s:\n", name); printf("%sendian\n", elf_info->endian_is_big ? "big" : "little"); printf("Entry: %016"PRIx64"\n", (uint64_t) NATIVE(ehdr.e_entry)); /* Entry point virtual address */ printf("Proc Flags: %08x\n", NATIVE(ehdr.e_flags)); /* Processor-specific flags */ printf("Phdr.tbl entry cnt % 8d\n", NATIVE(ehdr.e_phnum)); /*Program header table entry count */ printf("Shdr.tbl entry cnt % 8d\n", NATIVE(ehdr.e_shnum)); /*Section header table entry count */ printf("Shdr.str tbl idx % 8d\n", NATIVE(ehdr.e_shstrndx)); /*Section header string table index */ } elf_info->program_entry = NATIVE(ehdr.e_entry); if (NATIVE(ehdr.e_ehsize) != sizeof ehdr) { return 14; } if (NATIVE(ehdr.e_shentsize) != sizeof(SZ(Elf,_Shdr))) { return 15; } // Allocate program headers ph = alloca(sizeof *ph * NATIVE(ehdr.e_phnum)); int phnum = NATIVE(ehdr.e_phnum); for (int i = 0; i < phnum; ++i) { fseek(f, NATIVE(ehdr.e_phoff) + i * NATIVE(ehdr.e_phentsize), SEEK_SET); if (fread(ph + i, sizeof *ph, 1, f) != 1) return 16; if (enable_verb_prog_sec) { printf("\nProgram header #%d (%lx)\n", i, ftell(f)); printf(" type %08x\n", NATIVE(ph[i].p_type)); printf(" filesz %016"PRIx64"\n", (uint64_t)NATIVE(ph[i].p_filesz)); printf(" offset %016"PRIx64"\n", (uint64_t)NATIVE(ph[i].p_offset)); printf(" vaddr %016"PRIx64"\n", (uint64_t)NATIVE(ph[i].p_vaddr)); printf(" paddr %016"PRIx64"\n", (uint64_t)NATIVE(ph[i].p_paddr)); printf(" memsz %016"PRIx64"\n", (uint64_t)NATIVE(ph[i].p_memsz)); printf(" flags %08x\n", NATIVE(ph[i].p_flags)); printf(" align %016"PRIx64"\n", (uint64_t)NATIVE(ph[i].p_align)); } if (NATIVE(ph[i].p_type) == PT_LOAD && NATIVE(ph[i].p_filesz)) { if (enable_verb_prog_sec) fprintf(stderr, "Loading section [%016"PRIx64"; %016"PRIx64"]\n", (uint64_t)NATIVE(ph[i].p_vaddr), (uint64_t)NATIVE(ph[i].p_vaddr) + NATIVE(ph[i].p_memsz) - 1); loadsection(f, (unsigned)NATIVE(ph[i].p_offset), (unsigned)NATIVE(ph[i].p_filesz), m, NATIVE(ph[i].p_vaddr), NATIVE(ph[i].p_memsz), elf_info); } if (ph[i].p_flags & 1) { elf_info->text_segments++; elf_info->text_start = NATIVE(ph[i].p_vaddr); elf_info->text_size = NATIVE(ph[i].p_memsz); } } if (enable_verb_elf) { printf("\n"); fseek(f, NATIVE(ehdr.e_shoff), SEEK_SET); int shnum = NATIVE(ehdr.e_shnum); for (int i = 0; i < shnum; ++i) { SZ(Elf,_Shdr) sh; if (fread(&sh, sizeof sh, 1, f) != 1) return 17; printf("\nSection header #%d (%lx)\n", i, ftell(f)); printf(" name %08x\n", NATIVE(sh.sh_name)); printf(" type %08x\n", NATIVE(sh.sh_type)); printf(" flags %016"PRIx64"\n", (uint64_t)NATIVE(sh.sh_flags)); printf(" addr %016"PRIx64"\n", (uint64_t)NATIVE(sh.sh_addr)); printf(" offset %016"PRIx64"\n", (uint64_t)NATIVE(sh.sh_offset)); printf(" size %016"PRIx64"\n", (uint64_t)NATIVE(sh.sh_size)); printf(" link %08x\n", NATIVE(sh.sh_link)); printf(" info %08x\n", NATIVE(sh.sh_info)); printf(" addralign %016"PRIx64"\n", (uint64_t)NATIVE(sh.sh_addralign)); printf(" entsize %016"PRIx64"\n", (uint64_t)NATIVE(sh.sh_entsize)); } printf(" (now at %lx)\n", ftell(f)); } return 0; } // Local Variables: // mode: C // c-style-variables-are-local-p: t // c-file-style: "stroustrup" // End:
tommythorn/multisim
loadelf_temp.c
C
lgpl-2.1
6,328
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>getBytes</title> <!-- <script src="http://use.edgefonts.net/source-sans-pro;source-code-pro.js"></script> --> <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic|Source+Code+Pro:300,400,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="../assets/css/bootstrap.css"> <link rel="stylesheet" href="../assets/css/jquery.bonsai.css"> <link rel="stylesheet" href="../assets/css/main.css"> <link rel="stylesheet" href="../assets/css/icons.css"> <script type="text/javascript" src="../assets/js/jquery-2.1.0.min.js"></script> <script type="text/javascript" src="../assets/js/bootstrap.js"></script> <script type="text/javascript" src="../assets/js/jquery.bonsai.js"></script> <!-- <script type="text/javascript" src="../assets/js/main.js"></script> --> </head> <body> <div> <!-- Name Title --> <h1>getBytes</h1> <!-- Type and Stereotype --> <section style="margin-top: .5em;"> <span class="alert alert-info"> <span class="node-icon _icon-UMLOperation"></span> UMLOperation </span> </section> <!-- Path --> <section style="margin-top: 10px"> <span class="label label-info"><a href='cf9c8b720f3815adeccaf3ef6e48c6c4.html'><span class='node-icon _icon-Project'></span>Untitled</a></span> <span>::</span> <span class="label label-info"><a href='6550300e57d7fc770bd2e9afbcdb3ecb.html'><span class='node-icon _icon-UMLModel'></span>JavaReverse</a></span> <span>::</span> <span class="label label-info"><a href='7ff2d96ca3eb7f62f48c1a30b3c7c990.html'><span class='node-icon _icon-UMLPackage'></span>net</a></span> <span>::</span> <span class="label label-info"><a href='7adc4be4f2e4859086f068fc27512d85.html'><span class='node-icon _icon-UMLPackage'></span>gleamynode</a></span> <span>::</span> <span class="label label-info"><a href='bb15307bdbbaf31bfef4f71be74150ae.html'><span class='node-icon _icon-UMLPackage'></span>netty</a></span> <span>::</span> <span class="label label-info"><a href='13ebeea6c90c35d72f303d2d478d584e.html'><span class='node-icon _icon-UMLPackage'></span>buffer</a></span> <span>::</span> <span class="label label-info"><a href='cb2e81bf6fa08af090f5bd728f5884e7.html'><span class='node-icon _icon-UMLClass'></span>DynamicChannelBuffer</a></span> <span>::</span> <span class="label label-info"><a href='5dbf13610803e568d209258ff152c232.html'><span class='node-icon _icon-UMLOperation'></span>getBytes</a></span> </section> <!-- Diagram --> <!-- Description --> <section> <h3>Description</h3> <div> <span class="label label-info">none</span> </div> </section> <!-- Specification --> <!-- Directed Relationship --> <!-- Undirected Relationship --> <!-- Classifier --> <!-- Interface --> <!-- Component --> <!-- Node --> <!-- Actor --> <!-- Use Case --> <!-- Template Parameters --> <!-- Literals --> <!-- Attributes --> <!-- Operations --> <!-- Receptions --> <!-- Extension Points --> <!-- Parameters --> <section> <h3>Parameters</h3> <table class="table table-striped table-bordered"> <tr> <th>Direction</th> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr> <td>in</td> <td><a href="8a1ae1290c4853091cbbd9134dfc989f.html">index</a></td> <td>int</td> <td></td> </tr> <tr> <td>in</td> <td><a href="718af3560069519895f7ba3fde3cab13.html">dst</a></td> <td><a href='6a3cd6770cde0833c191b1edd40d225c.html'><span class='node-icon _icon-UMLClass'></span>ByteBuffer</a></td> <td></td> </tr> <tr> <td>return</td> <td><a href="977ac87f8fef3f04dc8885021a167d8c.html">(unnamed)</a></td> <td>void</td> <td></td> </tr> </table> </section> <!-- Diagrams --> <!-- Behavior --> <!-- Action --> <!-- Interaction --> <!-- CombinedFragment --> <!-- Activity --> <!-- State Machine --> <!-- State Machine --> <!-- State --> <!-- Vertex --> <!-- Transition --> <!-- Properties --> <section> <h3>Properties</h3> <table class="table table-striped table-bordered"> <tr> <th width="50%">Name</th> <th width="50%">Value</th> </tr> <tr> <td>name</td> <td>getBytes</td> </tr> <tr> <td>stereotype</td> <td><span class='label label-info'>null</span></td> </tr> <tr> <td>visibility</td> <td>public</td> </tr> <tr> <td>isStatic</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>isLeaf</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>parameters</td> <td> <a href='8a1ae1290c4853091cbbd9134dfc989f.html'><span class='node-icon _icon-UMLParameter'></span>index</a> <span>, </span> <a href='718af3560069519895f7ba3fde3cab13.html'><span class='node-icon _icon-UMLParameter'></span>dst</a> <span>, </span> <a href='977ac87f8fef3f04dc8885021a167d8c.html'><span class='node-icon _icon-UMLParameter'></span>(Parameter)</a> </td> </tr> <tr> <td>raisedExceptions</td> <td> </td> </tr> <tr> <td>concurrency</td> <td>sequential</td> </tr> <tr> <td>isQuery</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>isAbstract</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>specification</td> <td></td> </tr> </table> </section> <!-- Tags --> <!-- Constraints, Dependencies, Dependants --> <!-- Relationships --> <!-- Owned Elements --> </div> </body> </html>
jiangbo212/netty-init
html-docs/contents/5dbf13610803e568d209258ff152c232.html
HTML
lgpl-2.1
8,746
//Copyright (c) Microsoft Corporation. All rights reserved. // AddIn.cpp : Implementation of DLL Exports. #include "stdafx.h" #include "resource.h" #include "AddIn.h" CAddInModule _AtlModule; // DLL Entry Point extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { _AtlModule.SetResourceInstance(hInstance); return _AtlModule.DllMain(dwReason, lpReserved); } // Used to determine whether the DLL can be unloaded by OLE STDAPI DllCanUnloadNow(void) { return _AtlModule.DllCanUnloadNow(); } // Returns a class factory to create an object of the requested type STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { return _AtlModule.DllGetClassObject(rclsid, riid, ppv); } void CreateRegistrationKey(const CString& version, const CString& modulePath, const CString& moduleShortName) { CString path = "Software\\Microsoft\\VisualStudio\\" + version; CRegKey devKey; if (devKey.Open(HKEY_LOCAL_MACHINE, path) == ERROR_SUCCESS) { // Auto create the addins key if it isn't already there. if (devKey.Create(HKEY_LOCAL_MACHINE, path + "\\AddIns") == ERROR_SUCCESS) { // Create the WorkspaceWhiz.DSAddin.1 key. if (devKey.Create(HKEY_LOCAL_MACHINE, path + "\\AddIns\\LuaPlusDebugger.Connect") == ERROR_SUCCESS) { // Remove all old entries. devKey.SetStringValue("SatelliteDLLPath", modulePath); devKey.SetStringValue("SatelliteDLLName", moduleShortName); devKey.SetDWORDValue("LoadBehavior", 3); devKey.SetStringValue("FriendlyName", "LuaPlus Debugger Window"); devKey.SetStringValue("Description", "The LuaPlus Debugger Window add-in provides support for viewing Lua tables while debugging."); devKey.SetDWORDValue("CommandPreload", 1); } } } if (devKey.Open(HKEY_CURRENT_USER, path + "\\PreloadAddinState") == ERROR_SUCCESS) { devKey.SetDWORDValue("LuaPlusDebugger.Connect", 1); } } void DestroyRegistrationKey(const CString& version) { CString path = "Software\\Microsoft\\VisualStudio\\" + version; CRegKey key; if (key.Open(HKEY_LOCAL_MACHINE, path + "\\AddIns") == ERROR_SUCCESS) { // Remove all old entries. key.RecurseDeleteKey("LuaPlusDebugger.Connect"); } } // DllRegisterServer - Adds entries to the system registry STDAPI DllRegisterServer(void) { // registers object, typelib and all interfaces in typelib HRESULT hr = _AtlModule.DllRegisterServer(); // Get the module name. TCHAR moduleName[_MAX_PATH]; moduleName[0] = 0; ::GetModuleFileName(_AtlModule.GetResourceInstance(), (TCHAR*)&moduleName, _MAX_PATH); // Get the module path. TCHAR modulePath[_MAX_PATH]; _tcscpy(modulePath, moduleName); TCHAR* ptr = _tcsrchr(modulePath, '\\'); ptr++; *ptr++ = 0; // Get the short module name. TCHAR moduleShortName[_MAX_PATH]; ptr = _tcsrchr(moduleName, '\\'); _tcscpy(moduleShortName, ptr + 1); // Register the add-in? CreateRegistrationKey("7.0", modulePath, moduleShortName); CreateRegistrationKey("7.1", modulePath, moduleShortName); return hr; } // DllUnregisterServer - Removes entries from the system registry STDAPI DllUnregisterServer(void) { HRESULT hr = _AtlModule.DllUnregisterServer(); // Remove entries. DestroyRegistrationKey("7.0"); DestroyRegistrationKey("7.1"); return hr; }
MikeMcShaffry/gamecode3
Dev/Source/3rdParty/LuaPlus/Tools/LuaPlusDebuggerAddin/LuaPlusDebuggerAddin/AddIn.cpp
C++
lgpl-2.1
3,265
//------------------------------------------------------------------------------ // <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.LandXml20 { public enum CurveType { [StringValue("arc")] Arc, [StringValue("chord")] Chord, } } #endif
jlroviramartin/XsdProcessor
LandXml20/CurveType.cs
C#
lgpl-2.1
777
import json import etcd from tendrl.gluster_bridge.atoms.volume.set import Set class SetVolumeOption(object): def __init__(self, api_job): super(SetVolumeOption, self).__init__() self.api_job = api_job self.atom = SetVolumeOption def start(self): attributes = json.loads(self.api_job['attributes'].decode('utf-8')) vol_name = attributes['volname'] option = attributes['option_name'] option_value = attributes['option_value'] self.atom().start(vol_name, option, option_value) self.api_job['status'] = "finished" etcd.Client().write(self.api_job['request_id'], json.dumps(self.api_job))
shtripat/gluster_bridge
tendrl/gluster_bridge/flows/set_volume_option.py
Python
lgpl-2.1
705
## State Machine Sequences and Wave-forms This section provides additional explanation to particular functions of [API Functions](readme.md#functions) by presenting screenshots of state machine sequence diagrams and wave-forms. All wave-forms were taken during operation of application with DimSwitch library controlling OSRAM QUICKTRONIC - INTELLIGENT QTi DALI 2x28/54 DIM electronic ballast. ### Table of Contents * [Toggle Relay](#toggle-relay) * [Sequence](#toggle-relay-sequence) * [Wave-forms](#toggle-relay-wave-forms) * [Power On](#power-on) * [Sequence](#power-on-sequence) * [Wave-forms](#power-on-wave-forms) * [Power Off](#power-off) * [Sequence](#power-off-sequence) * [Wave-forms](#power-off-wave-forms) * [Calibrate](#calibrate) * [Sequence](#calibrate-sequence) * [Wave-forms](#calibrate-wave-forms) * [Set Intensity](#set-intensity) * [Sequence](#set-intensity-sequence) * [Wave-forms](#set-intensity-wave-forms) ### Toggle Relay #### Toggle Relay Sequence ![State Machine Sequence - Toggle Relay](pictures/sms-toggle-on.png) #### Toggle Relay Wave-forms ![Wave-forms - Toggle Relay](pictures/wvf-1-power-on.png) ### Power On #### Power On Sequence ![State Machine Sequence - Power On](pictures/sms-power-on.png) #### Power On Wave-forms ![Wave-forms - Power On](pictures/wvf-1-power-on.png) ### Power Off #### Power Off Sequence ![State Machine Sequence - Power Off](pictures/sms-power-off.png) #### Power Off Wave-forms ![Wave-forms - Power Off](pictures/wvf-2-power-off-max.png) ![Wave-forms - Power Off](pictures/wvf-3-power-off-min.png) ### Calibrate #### Calibrate Sequence ![State Machine Sequence - Calibrate](pictures/sms-calibrate.png) #### Calibrate Wave-forms ![Wave-forms - Calibrate](pictures/wvf-8-calibrate.png) ![Wave-forms - Calibrate](pictures/wvf-9-calibrate-another.png) ### Set Intensity #### Set Intensity Sequence ![State Machine Sequence - Set Intensity](pictures/sms-set-intensity.png) #### Set Intensity Wave-forms Sequence of setting light intensity depends on initial lamp state (if it is off or already on) and initial direction of intensity change. In later case if initial direction is opposite from desired, the relay is momentary toggled off to change it. See the following wave-forms that illustrate particular cases. Set the light intensity when the lamp is initially off (below). ![Wave-forms - Set Intensity](pictures/wvf-4-set-intensity-from-off.png) Set the light intensity when the lamp is already on (below). ![Wave-forms - Set Intensity](pictures/wvf-5-set-intensity-when-on.png) Set the light intensity with altering direction change (below). ![Wave-forms - Set Intensity](pictures/wvf-6-set-intensity-altering.png) Set the light intensity with altering direction change - another example (below). ![Wave-forms - Set Intensity](pictures/wvf-7-set-intensity-altering-another.png)
krzychb/DimSwitch
extras/sms-and-wvf.md
Markdown
lgpl-2.1
2,907
/** * @file common/js/xml_handler.js * @brief XE에서 ajax기능을 이용함에 있어 module, act를 잘 사용하기 위한 자바스크립트 **/ // xml handler을 이용하는 user function var show_waiting_message = true; /* This work is licensed under Creative Commons GNU LGPL License. License: http://creativecommons.org/licenses/LGPL/2.1/ Version: 0.9 Author: Stefan Goessner/2006 Web: http://goessner.net/ */ function xml2json(xml, tab, ignoreAttrib) { var X = { toObj: function(xml) { var o = {}; if (xml.nodeType==1) { // element node .. if (ignoreAttrib && xml.attributes.length) // element with attributes .. for (var i=0; i<xml.attributes.length; i++) o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString(); if (xml.firstChild) { // element has child nodes .. var textChild=0, cdataChild=0, hasElementChild=false; for (var n=xml.firstChild; n; n=n.nextSibling) { if (n.nodeType==1) hasElementChild = true; else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text else if (n.nodeType==4) cdataChild++; // cdata section node } if (hasElementChild) { if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node .. X.removeWhite(xml); for (var n=xml.firstChild; n; n=n.nextSibling) { if (n.nodeType == 3) // text node o = X.escape(n.nodeValue); else if (n.nodeType == 4) // cdata node // o["#cdata"] = X.escape(n.nodeValue); o = X.escape(n.nodeValue); else if (o[n.nodeName]) { // multiple occurence of element .. if (o[n.nodeName] instanceof Array) o[n.nodeName][o[n.nodeName].length] = X.toObj(n); else o[n.nodeName] = [o[n.nodeName], X.toObj(n)]; } else // first occurence of element.. o[n.nodeName] = X.toObj(n); } } else { // mixed content if (!xml.attributes.length) o = X.escape(X.innerXml(xml)); else o["#text"] = X.escape(X.innerXml(xml)); } } else if (textChild) { // pure text if (!xml.attributes.length) o = X.escape(X.innerXml(xml)); else o["#text"] = X.escape(X.innerXml(xml)); } else if (cdataChild) { // cdata if (cdataChild > 1) o = X.escape(X.innerXml(xml)); else for (var n=xml.firstChild; n; n=n.nextSibling){ //o["#cdata"] = X.escape(n.nodeValue); o = X.escape(n.nodeValue); } } } if (!xml.attributes.length && !xml.firstChild) o = null; } else if (xml.nodeType==9) { // document.node o = X.toObj(xml.documentElement); } else alert("unhandled node type: " + xml.nodeType); return o; }, toJson: function(o, name, ind) { var json = name ? ("\""+name+"\"") : ""; if (o instanceof Array) { for (var i=0,n=o.length; i<n; i++) o[i] = X.toJson(o[i], "", ind+"\t"); json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]"; } else if (o == null) json += (name&&":") + "null"; else if (typeof(o) == "object") { var arr = []; for (var m in o) arr[arr.length] = X.toJson(o[m], m, ind+"\t"); json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}"; } else if (typeof(o) == "string") json += (name&&":") + "\"" + o.toString() + "\""; else json += (name&&":") + o.toString(); return json; }, innerXml: function(node) { var s = "" if ("innerHTML" in node) s = node.innerHTML; else { var asXml = function(n) { var s = ""; if (n.nodeType == 1) { s += "<" + n.nodeName; for (var i=0; i<n.attributes.length;i++) s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\""; if (n.firstChild) { s += ">"; for (var c=n.firstChild; c; c=c.nextSibling) s += asXml(c); s += "</"+n.nodeName+">"; } else s += "/>"; } else if (n.nodeType == 3) s += n.nodeValue; else if (n.nodeType == 4) s += "<![CDATA[" + n.nodeValue + "]]>"; return s; }; for (var c=node.firstChild; c; c=c.nextSibling) s += asXml(c); } return s; }, escape: function(txt) { return txt.replace(/[\\]/g, "\\\\") .replace(/[\"]/g, '\\"') .replace(/[\n]/g, '\\n') .replace(/[\r]/g, '\\r'); }, removeWhite: function(e) { e.normalize(); for (var n = e.firstChild; n; ) { if (n.nodeType == 3) { // text node if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node var nxt = n.nextSibling; e.removeChild(n); n = nxt; } else n = n.nextSibling; } else if (n.nodeType == 1) { // element node X.removeWhite(n); n = n.nextSibling; } else // any other node n = n.nextSibling; } return e; } }; if (xml.nodeType == 9) // document node xml = xml.documentElement; var json_obj = X.toObj(X.removeWhite(xml)), json_str; if (typeof(JSON)=='object' && jQuery.isFunction(JSON.stringify) && false) { var obj = {}; obj[xml.nodeName] = json_obj; json_str = JSON.stringify(obj); return json_str; } else { json_str = X.toJson(json_obj, xml.nodeName, ""); return "{" + (tab ? json_str.replace(/\t/g, tab) : json_str.replace(/\t|\n/g, "")) + "}"; } } (function($){ /** * @brief exec_xml * @author NHN ([email protected]) **/ $.exec_xml = window.exec_xml = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) { var xml_path = request_uri+"index.php" if(!params) params = {}; // {{{ set parameters if($.isArray(params)) params = arr2obj(params); params['module'] = module; params['act'] = act; if(typeof(xeVid)!='undefined') params['vid'] = xeVid; if(typeof(response_tags)=="undefined" || response_tags.length<1) response_tags = ['error','message']; else { response_tags.push('error', 'message'); } // }}} set parameters // use ssl? if ($.isArray(ssl_actions) && params['act'] && $.inArray(params['act'], ssl_actions) >= 0) { var url = default_url || request_uri; var port = window.https_port || 443; var _ul = $('<a>').attr('href', url)[0]; var target = 'https://' + _ul.hostname.replace(/:\d+$/, ''); if(port != 443) target += ':'+port; if(_ul.pathname[0] != '/') target += '/'; target += _ul.pathname; xml_path = target.replace(/\/$/, '')+'/index.php'; } var _u1 = $('<a>').attr('href', location.href)[0]; var _u2 = $('<a>').attr('href', xml_path)[0]; // 현 url과 ajax call 대상 url의 schema 또는 port가 다르면 직접 form 전송 if(_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(xml_path, params); var xml = [], i = 0; xml[i++] = '<?xml version="1.0" encoding="utf-8" ?>'; xml[i++] = '<methodCall>'; xml[i++] = '<params>'; $.each(params, function(key, val) { xml[i++] = '<'+key+'><![CDATA['+val+']]></'+key+'>'; }); xml[i++] = '</params>'; xml[i++] = '</methodCall>'; var _xhr = null; if (_xhr && _xhr.readyState != 0) _xhr.abort(); // 전송 성공시 function onsuccess(data, textStatus, xhr) { var resp_xml = $(data).find('response')[0], resp_obj, txt='', ret=[], tags={}, json_str=''; waiting_obj.css('visibility', 'hidden'); if(!resp_xml) { alert(_xhr.responseText); return null; } json_str = xml2json(resp_xml, false, false); resp_obj = (typeof(JSON)=='object' && $.isFunction(JSON.parse))?JSON.parse(json_str):eval('('+json_str+')'); resp_obj = resp_obj.response; if (typeof(resp_obj)=='undefined') { ret['error'] = -1; ret['message'] = 'Unexpected error occured.'; try { if(typeof(txt=resp_xml.childNodes[0].firstChild.data)!='undefined') ret['message'] += '\r\n'+txt; } catch(e){}; return ret; } $.each(response_tags, function(key, val){ tags[val] = true; }); tags["redirect_url"] = true; tags["act"] = true; $.each(resp_obj, function(key, val){ if(tags[key]) ret[key] = val; }); if(ret['error'] != 0) { if ($.isFunction($.exec_xml.onerror)) { return $.exec_xml.onerror(module, act, ret, callback_func, response_tags, callback_func_arg, fo_obj); } alert(ret['message'] || 'error!'); return null; } if(ret['redirect_url']) { location.href = ret['redirect_url'].replace(/&amp;/g, '&'); return null; } if($.isFunction(callback_func)) callback_func(ret, response_tags, callback_func_arg, fo_obj); } // 모든 xml데이터는 POST방식으로 전송. try-catch문으로 오류 발생시 대처 try { $.ajax({ url : xml_path, type : 'POST', dataType : 'xml', data : xml.join('\n'), contentType : 'text/plain', beforeSend : function(xhr){ _xhr = xhr; }, success : onsuccess, error : function(xhr, textStatus) { waiting_obj.css('visibility', 'hidden'); var msg = ''; if (textStatus == 'parsererror') { msg = 'The result is not valid XML :\n-------------------------------------\n'; if(xhr.responseText == "") return; msg += xhr.responseText.replace(/<[^>]+>/g, ''); } else { msg = textStatus; } alert(msg); } }); } catch(e) { alert(e); return; } // ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음) var waiting_obj = $('#waitingforserverresponse'); if(show_waiting_message && waiting_obj.length) { var d = $(document); waiting_obj.html(waiting_message).css({ 'top' : (d.scrollTop()+20)+'px', 'left' : (d.scrollLeft()+20)+'px', 'visibility' : 'visible' }); } } function send_by_form(url, params) { var frame_id = 'xeTmpIframe'; var form_id = 'xeVirtualForm'; if (!$('#'+frame_id).length) { $('<iframe name="%id%" id="%id%" style="position:absolute;left:-1px;top:1px;width:1px;height:1px"></iframe>'.replace(/%id%/g, frame_id)).appendTo(document.body); } $('#'+form_id).remove(); var form = $('<form id="%id%"></form>'.replace(/%id%/g, form_id)).attr({ 'id' : form_id, 'method' : 'post', 'action' : url, 'target' : frame_id }); params['xeVirtualRequestMethod'] = 'xml'; params['xeRequestURI'] = location.href.replace(/#(.*)$/i,''); params['xeVirtualRequestUrl'] = request_uri; $.each(params, function(key, value){ $('<input type="hidden">').attr('name', key).attr('value', value).appendTo(form); }); form.appendTo(document.body).submit(); } function arr2obj(arr) { var ret = {}; for(var key in arr) { if(arr.hasOwnProperty(key)) ret[key] = arr[key]; } return ret; } /** * @brief exec_json (exec_xml와 같은 용도) **/ $.exec_json = function(action,data,func){ if(typeof(data) == 'undefined') data = {}; action = action.split("."); if(action.length == 2){ if(show_waiting_message) { $("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible'); } $.extend(data,{module:action[0],act:action[1]}); if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid}); $.ajax({ type:"POST" ,dataType:"json" ,url:request_uri ,contentType:"application/json" ,data:$.param(data) ,success : function(data){ $("#waitingforserverresponse").css('visibility','hidden'); if(data.error > 0) alert(data.message); if($.isFunction(func)) func(data); } }); } }; $.fn.exec_html = function(action,data,type,func,args){ if(typeof(data) == 'undefined') data = {}; if(!$.inArray(type, ['html','append','prepend'])) type = 'html'; var self = $(this); action = action.split("."); if(action.length == 2){ if(show_waiting_message) { $("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible'); } $.extend(data,{module:action[0],act:action[1]}); $.ajax({ type:"POST" ,dataType:"html" ,url:request_uri ,data:$.param(data) ,success : function(html){ $("#waitingforserverresponse").css('visibility','hidden'); self[type](html); if($.isFunction(func)) func(args); } }); } }; })(jQuery);
haegyung/xe-core
common/js/src/xml_handler.js
JavaScript
lgpl-2.1
14,624
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.kore.runtime.jsf.converter; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.FacesConverter; import org.kore.runtime.person.Titel; /** * * @author Konrad Renner */ @FacesConverter(value = "CurrencyConverter") public class TitelConverter implements Converter { @Override public Titel getAsObject(FacesContext fc, UIComponent uic, String string) { if (string == null || string.trim().length() == 0) { return null; } return new Titel(string.trim()); } @Override public String getAsString(FacesContext fc, UIComponent uic, Object o) { if (o == null) { return null; } if (o instanceof Titel) { return ((Titel) o).getValue(); } throw new IllegalArgumentException("Given object is not a org.kore.runtime.person.Titel"); } }
konradrenner/KoreRuntime-jsf
src/main/java/org/kore/runtime/jsf/converter/TitelConverter.java
Java
lgpl-2.1
1,145
#!/bin/bash # Copyright 2021 Collabora Ltd. # SPDX-License-Identifier: LGPL-2.0-or-later set -euo pipefail . $(dirname $0)/libtest.sh skip_without_bwrap echo "1..16" setup_repo install_repo cp -a "$G_TEST_BUILDDIR/try-syscall" "$test_tmpdir/try-syscall" # How this works: # try-syscall tries to make various syscalls, some benign, some not. # # The parameters are chosen to make them fail with EBADF or EFAULT if # not blocked. If they are blocked, we get ENOSYS or EPERM. If the syscall # is impossible for a particular architecture, we get ENOENT. # # The exit status is an errno value, which we can compare with the expected # errno value. eval "$("$test_tmpdir/try-syscall" print-errno-values)" try_syscall () { ${FLATPAK} run \ --filesystem="$test_tmpdir" \ --command="$test_tmpdir/try-syscall" \ $extra_argv \ org.test.Hello "$@" } for extra_argv in "" "--allow=multiarch"; do echo "# testing with extra argv: '$extra_argv'" echo "# chmod (benign)" e=0 try_syscall chmod || e="$?" assert_streq "$e" "$EFAULT" ok "chmod not blocked" echo "# chroot (harmful)" e=0 try_syscall chroot || e="$?" assert_streq "$e" "$EPERM" ok "chroot blocked with EPERM" echo "# clone3 (harmful)" e=0 try_syscall clone3 || e="$?" # This is either ENOSYS because the kernel genuinely doesn't implement it, # or because we successfully blocked it. We can't tell which. assert_streq "$e" "$ENOSYS" ok "clone3 blocked with ENOSYS (CVE-2021-41133)" echo "# ioctl TIOCNOTTY (benign)" e=0 try_syscall "ioctl TIOCNOTTY" || e="$?" assert_streq "$e" "$EBADF" ok "ioctl TIOCNOTTY not blocked" echo "# ioctl TIOCSTI (CVE-2017-5226)" e=0 try_syscall "ioctl TIOCSTI" || e="$?" assert_streq "$e" "$EPERM" ok "ioctl TIOCSTI blocked (CVE-2017-5226)" echo "# ioctl TIOCSTI (trying to repeat CVE-2019-10063)" e=0 try_syscall "ioctl TIOCSTI CVE-2019-10063" || e="$?" if test "$e" = "$ENOENT"; then echo "ok # SKIP Cannot replicate CVE-2019-10063 on 32-bit architecture" else assert_streq "$e" "$EPERM" ok "ioctl TIOCSTI with high bits blocked (CVE-2019-10063)" fi echo "# listen (benign)" e=0 try_syscall "listen" || e="$?" assert_streq "$e" "$EBADF" ok "listen not blocked" echo "# prctl (benign)" e=0 try_syscall "prctl" || e="$?" assert_streq "$e" "$EFAULT" ok "prctl not blocked" done
flatpak/flatpak
tests/test-seccomp.sh
Shell
lgpl-2.1
2,389
/* * The implementation of rb tree. * Copyright (C) 2008 - 2014 Wangbo * * 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 * * Author e-mail: [email protected] * [email protected] */ /** include section **/ #include <cstl/cstl_def.h> #include <cstl/cstl_alloc.h> #include <cstl/cstl_types.h> #include <cstl/citerator.h> #include <cstl/cstring.h> #include <cstl/cstl_rb_tree_iterator.h> #include <cstl/cstl_rb_tree_private.h> #include <cstl/cstl_rb_tree.h> #include "cstl_rb_tree_aux.h" /** local constant declaration and local macro section **/ /** local data type declaration and local struct, union, enum section **/ /** local function prototype section **/ /** exported global variable definition section **/ /** local global variable definition section **/ /** exported function implementation section **/ /** * Create rb tree container. */ _rb_tree_t* _create_rb_tree(const char* s_typename) { _rb_tree_t* pt_rb_tree = NULL; if ((pt_rb_tree = (_rb_tree_t*)malloc(sizeof(_rb_tree_t))) == NULL) { return NULL; } if (!_create_rb_tree_auxiliary(pt_rb_tree, s_typename)) { free(pt_rb_tree); return NULL; } return pt_rb_tree; } /** * Initialize rb tree container. */ void _rb_tree_init(_rb_tree_t* pt_rb_tree, bfun_t t_compare) { assert(pt_rb_tree != NULL); assert(_rb_tree_is_created(pt_rb_tree)); pt_rb_tree->_t_rbroot._pt_left = &pt_rb_tree->_t_rbroot; pt_rb_tree->_t_rbroot._pt_right = &pt_rb_tree->_t_rbroot; pt_rb_tree->_t_compare = t_compare != NULL ? t_compare : _GET_RB_TREE_TYPE_LESS_FUNCTION(pt_rb_tree); } /** * Destroy rb tree. */ void _rb_tree_destroy(_rb_tree_t* pt_rb_tree) { assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree) || _rb_tree_is_created(pt_rb_tree)); _rb_tree_destroy_auxiliary(pt_rb_tree); free(pt_rb_tree); } /** * Initialize rb tree container with rb tree. */ void _rb_tree_init_copy(_rb_tree_t* pt_dest, const _rb_tree_t* cpt_src) { _rb_tree_iterator_t it_iter; _rb_tree_iterator_t it_begin; _rb_tree_iterator_t it_end; assert(pt_dest != NULL); assert(cpt_src != NULL); assert(_rb_tree_is_created(pt_dest)); assert(_rb_tree_is_inited(cpt_src)); assert(_rb_tree_same_type(pt_dest, cpt_src)); _rb_tree_init(pt_dest, cpt_src->_t_compare); it_begin = _rb_tree_begin(cpt_src); it_end = _rb_tree_end(cpt_src); for (it_iter = it_begin; !_rb_tree_iterator_equal(it_iter, it_end); it_iter = _rb_tree_iterator_next(it_iter)) { _rb_tree_insert_equal(pt_dest, _rb_tree_iterator_get_pointer_ignore_cstr(it_iter)); } } /** * Initialize rb tree container with specific range. */ void _rb_tree_init_copy_equal_range(_rb_tree_t* pt_dest, iterator_t it_begin, iterator_t it_end) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(_rb_tree_same_iterator_type(pt_dest, it_begin)); assert(_rb_tree_same_iterator_type(pt_dest, it_end)); assert(iterator_equal(it_begin, it_end) || _iterator_before(it_begin, it_end)); _rb_tree_init(pt_dest, NULL); _rb_tree_insert_equal_range(pt_dest, it_begin, it_end); } /** * Initialize rb tree container with specific range. */ void _rb_tree_init_copy_unique_range(_rb_tree_t* pt_dest, iterator_t it_begin, iterator_t it_end) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(_rb_tree_same_iterator_type(pt_dest, it_begin)); assert(_rb_tree_same_iterator_type(pt_dest, it_end)); assert(iterator_equal(it_begin, it_end) || _iterator_before(it_begin, it_end)); _rb_tree_init(pt_dest, NULL); _rb_tree_insert_unique_range(pt_dest, it_begin, it_end); } /** * Initialize rb tree container with specific array. */ void _rb_tree_init_copy_equal_array(_rb_tree_t* pt_dest, const void* cpv_array, size_t t_count) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(cpv_array != NULL); _rb_tree_init(pt_dest, NULL); _rb_tree_insert_equal_array(pt_dest, cpv_array, t_count); } /** * Initialize rb tree container with specific array. */ void _rb_tree_init_copy_unique_array(_rb_tree_t* pt_dest, const void* cpv_array, size_t t_count) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(cpv_array != NULL); _rb_tree_init(pt_dest, NULL); _rb_tree_insert_unique_array(pt_dest, cpv_array, t_count); } /** * Initialize rb tree container with specific range and compare function. */ void _rb_tree_init_copy_equal_range_ex( _rb_tree_t* pt_dest, iterator_t it_begin, iterator_t it_end, bfun_t t_compare) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(_rb_tree_same_iterator_type(pt_dest, it_begin)); assert(_rb_tree_same_iterator_type(pt_dest, it_end)); assert(iterator_equal(it_begin, it_end) || _iterator_before(it_begin, it_end)); _rb_tree_init(pt_dest, t_compare); _rb_tree_insert_equal_range(pt_dest, it_begin, it_end); } /** * Initialize rb tree container with specific range and compare function. */ void _rb_tree_init_copy_unique_range_ex( _rb_tree_t* pt_dest, iterator_t it_begin, iterator_t it_end, bfun_t t_compare) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(_rb_tree_same_iterator_type(pt_dest, it_begin)); assert(_rb_tree_same_iterator_type(pt_dest, it_end)); assert(iterator_equal(it_begin, it_end) || _iterator_before(it_begin, it_end)); _rb_tree_init(pt_dest, t_compare); _rb_tree_insert_unique_range(pt_dest, it_begin, it_end); } /** * Initialize rb tree container with specific array and compare function. */ void _rb_tree_init_copy_equal_array_ex( _rb_tree_t* pt_dest, const void* cpv_array, size_t t_count, bfun_t t_compare) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(cpv_array != NULL); _rb_tree_init(pt_dest, t_compare); _rb_tree_insert_equal_array(pt_dest, cpv_array, t_count); } /** * Initialize rb tree container with specific array and compare function. */ void _rb_tree_init_copy_unique_array_ex( _rb_tree_t* pt_dest, const void* cpv_array, size_t t_count, bfun_t t_compare) { assert(pt_dest != NULL); assert(_rb_tree_is_created(pt_dest)); assert(cpv_array != NULL); _rb_tree_init(pt_dest, t_compare); _rb_tree_insert_unique_array(pt_dest, cpv_array, t_count); } /** * Assign rb tree container. */ void _rb_tree_assign(_rb_tree_t* pt_dest, const _rb_tree_t* cpt_src) { assert(pt_dest != NULL); assert(cpt_src != NULL); assert(_rb_tree_is_inited(pt_dest)); assert(_rb_tree_is_inited(cpt_src)); assert(_rb_tree_same_type_ex(pt_dest, cpt_src)); if (!_rb_tree_equal(pt_dest, cpt_src)) { _rb_tree_iterator_t it_iter; _rb_tree_iterator_t it_begin; _rb_tree_iterator_t it_end; /* clear dest rb tree */ _rb_tree_clear(pt_dest); it_begin = _rb_tree_begin(cpt_src); it_end = _rb_tree_end(cpt_src); /* insert all elements of src into dest */ for (it_iter = it_begin; !_rb_tree_iterator_equal(it_iter, it_end); it_iter = _rb_tree_iterator_next(it_iter)) { _rb_tree_insert_equal(pt_dest, _rb_tree_iterator_get_pointer_ignore_cstr(it_iter)); } } } /** * Test if an rb tree is empty. */ bool_t _rb_tree_empty(const _rb_tree_t* cpt_rb_tree) { assert(cpt_rb_tree != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); return cpt_rb_tree->_t_nodecount == 0 ? true : false; } /** * Get the number of elements int the rb tree. */ size_t _rb_tree_size(const _rb_tree_t* cpt_rb_tree) { assert(cpt_rb_tree != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); return cpt_rb_tree->_t_nodecount; } /** * Get the maximum number of elements int the rb tree. */ size_t _rb_tree_max_size(const _rb_tree_t* cpt_rb_tree) { assert(cpt_rb_tree != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); return (size_t)(-1) / _GET_RB_TREE_TYPE_SIZE(cpt_rb_tree); } /** * Return an iterator that addresses the first element in the rb tree. */ _rb_tree_iterator_t _rb_tree_begin(const _rb_tree_t* cpt_rb_tree) { _rb_tree_iterator_t it_begin = _create_rb_tree_iterator(); assert(cpt_rb_tree != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); _RB_TREE_ITERATOR_TREE_POINTER(it_begin) = (void*)cpt_rb_tree; _RB_TREE_ITERATOR_COREPOS(it_begin) = (_byte_t*)cpt_rb_tree->_t_rbroot._pt_left; return it_begin; } /** * Return an iterator that addresses the location succeeding the last element in the rb tree. */ _rb_tree_iterator_t _rb_tree_end(const _rb_tree_t* cpt_rb_tree) { _rb_tree_iterator_t it_end = _create_rb_tree_iterator(); assert(cpt_rb_tree != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); _RB_TREE_ITERATOR_TREE_POINTER(it_end) = (void*)cpt_rb_tree; _RB_TREE_ITERATOR_COREPOS(it_end) = (_byte_t*)&cpt_rb_tree->_t_rbroot; return it_end; } _rb_tree_iterator_t _rb_tree_rend(const _rb_tree_t* cpt_rb_tree) { _rb_tree_iterator_t it_newiterator = _create_rb_tree_iterator(); assert(cpt_rb_tree != NULL); _RB_TREE_ITERATOR_TREE_POINTER(it_newiterator) = (void*)cpt_rb_tree; _RB_TREE_ITERATOR_COREPOS(it_newiterator) = (_byte_t*)&cpt_rb_tree->_t_rbroot; return it_newiterator; } _rb_tree_iterator_t _rb_tree_rbegin(const _rb_tree_t* cpt_rb_tree) { _rb_tree_iterator_t it_newiterator = _create_rb_tree_iterator(); assert(cpt_rb_tree != NULL); _RB_TREE_ITERATOR_TREE_POINTER(it_newiterator) = (void*)cpt_rb_tree; _RB_TREE_ITERATOR_COREPOS(it_newiterator) = (_byte_t*)cpt_rb_tree->_t_rbroot._pt_right; return it_newiterator; } /** * Return the compare function of key. */ bfun_t _rb_tree_key_comp(const _rb_tree_t* cpt_rb_tree) { assert(cpt_rb_tree != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); return cpt_rb_tree->_t_compare; } /** * Find specific element. */ _rb_tree_iterator_t _rb_tree_find(const _rb_tree_t* cpt_rb_tree, const void* cpv_value) { _rb_tree_iterator_t it_iter; assert(cpt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); _RB_TREE_ITERATOR_TREE_POINTER(it_iter) = (void*)cpt_rb_tree; _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)_rb_tree_find_value( cpt_rb_tree, cpt_rb_tree->_t_rbroot._pt_parent, cpv_value); if (_RB_TREE_ITERATOR_COREPOS(it_iter) == NULL) { _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)&cpt_rb_tree->_t_rbroot; } return it_iter; } /** * Erases all the elements of an rb tree. */ void _rb_tree_clear(_rb_tree_t* pt_rb_tree) { assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); pt_rb_tree->_t_rbroot._pt_parent = _rb_tree_destroy_subtree(pt_rb_tree, pt_rb_tree->_t_rbroot._pt_parent); assert(pt_rb_tree->_t_rbroot._pt_parent == NULL); pt_rb_tree->_t_rbroot._pt_left = &pt_rb_tree->_t_rbroot; pt_rb_tree->_t_rbroot._pt_right = &pt_rb_tree->_t_rbroot; pt_rb_tree->_t_nodecount = 0; } /** * Tests if the two rb tree are equal. */ bool_t _rb_tree_equal(const _rb_tree_t* cpt_first, const _rb_tree_t* cpt_second) { _rb_tree_iterator_t it_first; _rb_tree_iterator_t it_first_begin; _rb_tree_iterator_t it_first_end; _rb_tree_iterator_t it_second; _rb_tree_iterator_t it_second_begin; _rb_tree_iterator_t it_second_end; bool_t b_less = false; bool_t b_greater = false; assert(cpt_first != NULL); assert(cpt_second != NULL); assert(_rb_tree_is_inited(cpt_first)); assert(_rb_tree_is_inited(cpt_second)); assert(_rb_tree_same_type_ex(cpt_first, cpt_second)); if (cpt_first == cpt_second) { return true; } /* test rb tree size */ if (_rb_tree_size(cpt_first) != _rb_tree_size(cpt_second)) { return false; } it_first_begin = _rb_tree_begin(cpt_first); it_first_end = _rb_tree_end(cpt_first); it_second_begin = _rb_tree_begin(cpt_second); it_second_end = _rb_tree_end(cpt_second); /* test each element */ for (it_first = it_first_begin, it_second = it_second_begin; !_rb_tree_iterator_equal(it_first, it_first_end) && !_rb_tree_iterator_equal(it_second, it_second_end); it_first = _rb_tree_iterator_next(it_first), it_second = _rb_tree_iterator_next(it_second)) { b_less = b_greater = _GET_RB_TREE_TYPE_SIZE(cpt_first); _GET_RB_TREE_TYPE_LESS_FUNCTION(cpt_first)( ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_first))->_pby_data, ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_second))->_pby_data, &b_less); _GET_RB_TREE_TYPE_LESS_FUNCTION(cpt_first)( ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_second))->_pby_data, ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_first))->_pby_data, &b_greater); if (b_less || b_greater) { return false; } } assert(_rb_tree_iterator_equal(it_first, it_first_end) && _rb_tree_iterator_equal(it_second, it_second_end)); return true; } /** * Tests if the two rb tree are not equal. */ bool_t _rb_tree_not_equal(const _rb_tree_t* cpt_first, const _rb_tree_t* cpt_second) { return !_rb_tree_equal(cpt_first, cpt_second); } /** * Tests if the first rb tree is less than the second rb tree. */ bool_t _rb_tree_less(const _rb_tree_t* cpt_first, const _rb_tree_t* cpt_second) { _rb_tree_iterator_t it_first; _rb_tree_iterator_t it_first_begin; _rb_tree_iterator_t it_first_end; _rb_tree_iterator_t it_second; _rb_tree_iterator_t it_second_begin; _rb_tree_iterator_t it_second_end; bool_t b_result = false; assert(cpt_first != NULL); assert(cpt_second != NULL); assert(_rb_tree_is_inited(cpt_first)); assert(_rb_tree_is_inited(cpt_second)); assert(_rb_tree_same_type_ex(cpt_first, cpt_second)); it_first_begin = _rb_tree_begin(cpt_first); it_first_end = _rb_tree_end(cpt_first); it_second_begin = _rb_tree_begin(cpt_second); it_second_end = _rb_tree_end(cpt_second); /* test each element */ for (it_first = it_first_begin, it_second = it_second_begin; !_rb_tree_iterator_equal(it_first, it_first_end) && !_rb_tree_iterator_equal(it_second, it_second_end); it_first = _rb_tree_iterator_next(it_first), it_second = _rb_tree_iterator_next(it_second)) { b_result = _GET_RB_TREE_TYPE_SIZE(cpt_first); _GET_RB_TREE_TYPE_LESS_FUNCTION(cpt_first)( ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_first))->_pby_data, ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_second))->_pby_data, &b_result); if (b_result) { return true; } b_result = _GET_RB_TREE_TYPE_SIZE(cpt_first); _GET_RB_TREE_TYPE_LESS_FUNCTION(cpt_first)( ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_second))->_pby_data, ((_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_first))->_pby_data, &b_result); if (b_result) { return false; } } return _rb_tree_size(cpt_first) < _rb_tree_size(cpt_second) ? true : false; } /** * Tests if the first rb tree is less than or equal to the second rb tree. */ bool_t _rb_tree_less_equal(const _rb_tree_t* cpt_first, const _rb_tree_t* cpt_second) { return (_rb_tree_less(cpt_first, cpt_second) || _rb_tree_equal(cpt_first, cpt_second)) ? true : false; } /** * Tests if the first rb tree is greater than the second rb tree. */ bool_t _rb_tree_greater(const _rb_tree_t* cpt_first, const _rb_tree_t* cpt_second) { return _rb_tree_less(cpt_second, cpt_first); } /** * Tests if the first rb tree is greater than or equal to the second rb tree. */ bool_t _rb_tree_greater_equal(const _rb_tree_t* cpt_first, const _rb_tree_t* cpt_second) { return (_rb_tree_greater(cpt_first, cpt_second) || _rb_tree_equal(cpt_first, cpt_second)) ? true : false; } /** * Swap the datas of first rb_tree and second rb_tree. */ void _rb_tree_swap(_rb_tree_t* pt_first, _rb_tree_t* pt_second) { _rb_tree_t t_temp; assert(pt_first != NULL); assert(pt_second != NULL); assert(_rb_tree_is_inited(pt_first)); assert(_rb_tree_is_inited(pt_second)); assert(_rb_tree_same_type_ex(pt_first, pt_second)); if (_rb_tree_equal(pt_first, pt_second)) { return; } t_temp = *pt_first; *pt_first = *pt_second; *pt_second = t_temp; if (_rb_tree_empty(pt_first)) { pt_first->_t_rbroot._pt_left = &pt_first->_t_rbroot; pt_first->_t_rbroot._pt_right = &pt_first->_t_rbroot; } else { pt_first->_t_rbroot._pt_parent->_pt_parent = &pt_first->_t_rbroot; } if (_rb_tree_empty(pt_second)) { pt_second->_t_rbroot._pt_left = &pt_second->_t_rbroot; pt_second->_t_rbroot._pt_right = &pt_second->_t_rbroot; } else { pt_second->_t_rbroot._pt_parent->_pt_parent = &pt_second->_t_rbroot; } } /** * Return the number of specific elements in an rb tree */ size_t _rb_tree_count(const _rb_tree_t* cpt_rb_tree, const void* cpv_value) { range_t r_range; assert(cpt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); r_range = _rb_tree_equal_range(cpt_rb_tree, cpv_value); return abs(_rb_tree_iterator_distance(r_range.it_begin, r_range.it_end)); } /** * Return an iterator to the first element that is equal to or greater than a specific element. */ _rb_tree_iterator_t _rb_tree_lower_bound(const _rb_tree_t* cpt_rb_tree, const void* cpv_value) { _rbnode_t* pt_cur = NULL; _rbnode_t* pt_prev = NULL; _rb_tree_iterator_t it_iter; bool_t b_less = false; bool_t b_greater = false; assert(cpt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); it_iter = _create_rb_tree_iterator(); _RB_TREE_ITERATOR_TREE_POINTER(it_iter) = (void*)cpt_rb_tree; if (!_rb_tree_empty(cpt_rb_tree)) { pt_prev = cpt_rb_tree->_t_rbroot._pt_parent; b_less = b_greater = _GET_RB_TREE_TYPE_SIZE(cpt_rb_tree); _rb_tree_elem_compare_auxiliary(cpt_rb_tree, cpv_value, pt_prev->_pby_data, &b_less); _rb_tree_elem_compare_auxiliary(cpt_rb_tree, pt_prev->_pby_data, cpv_value, &b_greater); pt_cur = (b_less || !b_greater) ? pt_prev->_pt_left : pt_prev->_pt_right; while (pt_cur != NULL) { pt_prev = pt_cur; b_less = b_greater = _GET_RB_TREE_TYPE_SIZE(cpt_rb_tree); _rb_tree_elem_compare_auxiliary(cpt_rb_tree, cpv_value, pt_prev->_pby_data, &b_less); _rb_tree_elem_compare_auxiliary(cpt_rb_tree, pt_prev->_pby_data, cpv_value, &b_greater); pt_cur = (b_less || !b_greater) ? pt_prev->_pt_left : pt_prev->_pt_right; } if (b_less || !b_greater) { assert(pt_prev->_pt_left == NULL); _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)pt_prev; assert(_rb_tree_iterator_belong_to_rb_tree(cpt_rb_tree, it_iter)); } else { assert(pt_prev->_pt_right == NULL); _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)pt_prev; it_iter = _rb_tree_iterator_next(it_iter); } } else { it_iter = _rb_tree_end(cpt_rb_tree); } return it_iter; } /** * Return an iterator to the first element that is greater than a specific element. */ _rb_tree_iterator_t _rb_tree_upper_bound(const _rb_tree_t* cpt_rb_tree, const void* cpv_value) { _rbnode_t* pt_cur = NULL; _rbnode_t* pt_prev = NULL; _rb_tree_iterator_t it_iter; bool_t b_result = false; assert(cpt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); it_iter = _create_rb_tree_iterator(); _RB_TREE_ITERATOR_TREE_POINTER(it_iter) = (void*)cpt_rb_tree; if (!_rb_tree_empty(cpt_rb_tree)) { pt_prev = cpt_rb_tree->_t_rbroot._pt_parent; b_result = _GET_RB_TREE_TYPE_SIZE(cpt_rb_tree); _rb_tree_elem_compare_auxiliary(cpt_rb_tree, cpv_value, pt_prev->_pby_data, &b_result); pt_cur = b_result ? pt_prev->_pt_left : pt_prev->_pt_right; while (pt_cur != NULL) { pt_prev = pt_cur; b_result = _GET_RB_TREE_TYPE_SIZE(cpt_rb_tree); _rb_tree_elem_compare_auxiliary(cpt_rb_tree, cpv_value, pt_prev->_pby_data, &b_result); pt_cur = b_result ? pt_prev->_pt_left : pt_prev->_pt_right; } if (b_result) { assert(pt_prev->_pt_left == NULL); _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)pt_prev; assert(_rb_tree_iterator_belong_to_rb_tree(cpt_rb_tree, it_iter)); } else { assert(pt_prev->_pt_right == NULL); _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)pt_prev; it_iter = _rb_tree_iterator_next(it_iter); } } else { it_iter = _rb_tree_end(cpt_rb_tree); } return it_iter; } /** * Return an iterator range that is equal to a specific element. */ range_t _rb_tree_equal_range(const _rb_tree_t* cpt_rb_tree, const void* cpv_value) { range_t r_range; assert(cpt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(cpt_rb_tree)); r_range.it_begin = _rb_tree_lower_bound(cpt_rb_tree, cpv_value); r_range.it_end = _rb_tree_upper_bound(cpt_rb_tree, cpv_value); return r_range; } /** * Inserts an element into a rb tree. */ _rb_tree_iterator_t _rb_tree_insert_equal(_rb_tree_t* pt_rb_tree, const void* cpv_value) { _rb_tree_iterator_t it_iter = _create_rb_tree_iterator(); assert(pt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); _RB_TREE_ITERATOR_TREE_POINTER(it_iter) = pt_rb_tree; _RB_TREE_ITERATOR_COREPOS(it_iter) = (_byte_t*)_rb_tree_insert_rbnode(pt_rb_tree, cpv_value); pt_rb_tree->_t_rbroot._pt_left = _rb_tree_get_min_rbnode(pt_rb_tree->_t_rbroot._pt_parent); pt_rb_tree->_t_rbroot._pt_right = _rb_tree_get_max_rbnode(pt_rb_tree->_t_rbroot._pt_parent); pt_rb_tree->_t_nodecount++; return it_iter; } /** * Inserts an unique element into a rb tree. */ _rb_tree_iterator_t _rb_tree_insert_unique(_rb_tree_t* pt_rb_tree, const void* cpv_value) { assert(pt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); /* if the rb tree is empty */ if (_rb_tree_empty(pt_rb_tree)) { return _rb_tree_insert_equal(pt_rb_tree, cpv_value); } else { /* find value in rb tree */ _rb_tree_iterator_t it_iter = _rb_tree_find(pt_rb_tree, cpv_value); /* if the value is exist */ if (!_rb_tree_iterator_equal(it_iter, _rb_tree_end(pt_rb_tree))) { return _rb_tree_end(pt_rb_tree); } else { /* insert value into rb tree */ return _rb_tree_insert_equal(pt_rb_tree, cpv_value); } } } /** * Inserts an range into a rb tree. */ void _rb_tree_insert_equal_range(_rb_tree_t* pt_rb_tree, iterator_t it_begin, iterator_t it_end) { iterator_t it_iter; assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); assert(_rb_tree_same_iterator_type(pt_rb_tree, it_begin)); assert(_rb_tree_same_iterator_type(pt_rb_tree, it_end)); assert(iterator_equal(it_begin, it_end) || _iterator_before(it_begin, it_end)); for (it_iter = it_begin; !iterator_equal(it_iter, it_end); it_iter = iterator_next(it_iter)) { _rb_tree_insert_equal(pt_rb_tree, _iterator_get_pointer_ignore_cstr(it_iter)); } } /** * Inserts an array into a rb tree. */ void _rb_tree_insert_equal_array(_rb_tree_t* pt_rb_tree, const void* cpv_array, size_t t_count) { size_t i = 0; assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); assert(cpv_array != NULL); /* * Copy the elements from src array to dest rb tree. * The array of c builtin and user define or cstl builtin are different, * the elements of c builtin array are element itself, but the elements of * c string, user define or cstl are pointer of element. */ if (strncmp(_GET_RB_TREE_TYPE_BASENAME(pt_rb_tree), _C_STRING_TYPE, _TYPE_NAME_SIZE) == 0) { /* * We need built a string_t for c string element. */ string_t* pstr_elem = create_string(); assert(pstr_elem != NULL); string_init(pstr_elem); for (i = 0; i < t_count; ++i) { string_assign_cstr(pstr_elem, *((const char**)cpv_array + i)); _rb_tree_insert_equal(pt_rb_tree, pstr_elem); } string_destroy(pstr_elem); } else if (_GET_RB_TREE_TYPE_STYLE(pt_rb_tree) == _TYPE_C_BUILTIN) { for (i = 0; i < t_count; ++i) { _rb_tree_insert_equal(pt_rb_tree, (unsigned char*)cpv_array + i * _GET_RB_TREE_TYPE_SIZE(pt_rb_tree)); } } else { for (i = 0; i < t_count; ++i) { _rb_tree_insert_equal(pt_rb_tree, *((void**)cpv_array + i)); } } } /** * Inserts an range of unique element into a rb tree. */ void _rb_tree_insert_unique_range(_rb_tree_t* pt_rb_tree, iterator_t it_begin, iterator_t it_end) { iterator_t it_iter; assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); assert(_rb_tree_same_iterator_type(pt_rb_tree, it_begin)); assert(_rb_tree_same_iterator_type(pt_rb_tree, it_end)); assert(iterator_equal(it_begin, it_end) || _iterator_before(it_begin, it_end)); for (it_iter = it_begin; !iterator_equal(it_iter, it_end); it_iter = iterator_next(it_iter)) { _rb_tree_insert_unique(pt_rb_tree, _iterator_get_pointer_ignore_cstr(it_iter)); } } /** * Inserts an array of unique element into a rb tree. */ void _rb_tree_insert_unique_array(_rb_tree_t* pt_rb_tree, const void* cpv_array, size_t t_count) { size_t i = 0; assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); assert(cpv_array != NULL); /* * Copy the elements from src array to dest rb tree. * The array of c builtin and user define or cstl builtin are different, * the elements of c builtin array are element itself, but the elements of * c string, user define or cstl are pointer of element. */ if (strncmp(_GET_RB_TREE_TYPE_BASENAME(pt_rb_tree), _C_STRING_TYPE, _TYPE_NAME_SIZE) == 0) { /* * We need built a string_t for c string element. */ string_t* pstr_elem = create_string(); assert(pstr_elem != NULL); string_init(pstr_elem); for (i = 0; i < t_count; ++i) { string_assign_cstr(pstr_elem, *((const char**)cpv_array + i)); _rb_tree_insert_unique(pt_rb_tree, pstr_elem); } string_destroy(pstr_elem); } else if (_GET_RB_TREE_TYPE_STYLE(pt_rb_tree) == _TYPE_C_BUILTIN) { for (i = 0; i < t_count; ++i) { _rb_tree_insert_unique(pt_rb_tree, (unsigned char*)cpv_array + i * _GET_RB_TREE_TYPE_SIZE(pt_rb_tree)); } } else { for (i = 0; i < t_count; ++i) { _rb_tree_insert_unique(pt_rb_tree, *((void**)cpv_array + i)); } } } /* * Erase an element in an rb tree from specificed position. */ void _rb_tree_erase_pos(_rb_tree_t* pt_rb_tree, _rb_tree_iterator_t it_pos) { _rbnode_t* pt_parent = NULL; _rbnode_t* pt_cur = NULL; _rbnode_t* pt_parenttmp = NULL; _rbnode_t* pt_curtmp = NULL; _color_t t_colortmp; /* temporary color for deletion */ bool_t b_result = false; assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); assert(_rb_tree_iterator_belong_to_rb_tree(pt_rb_tree, it_pos)); assert(!_rb_tree_iterator_equal(it_pos, _rb_tree_end(pt_rb_tree))); pt_cur = (_rbnode_t*)_RB_TREE_ITERATOR_COREPOS(it_pos); pt_parent = pt_cur->_pt_parent; /* delete the current node pointted by it_pos */ if (pt_cur == pt_parent->_pt_parent) { assert(pt_cur == pt_rb_tree->_t_rbroot._pt_parent); if (pt_cur->_pt_left == NULL && pt_cur->_pt_right == NULL) { /* * p p * | => * c */ pt_parent->_pt_parent = NULL; } else if (pt_cur->_pt_left != NULL && pt_cur->_pt_right == NULL) { /* * p p * | | * c => l * / * l */ pt_parent->_pt_parent = pt_cur->_pt_left; pt_parent->_pt_parent->_pt_parent = pt_parent; pt_parent->_pt_parent->_t_color = _COLOR_BLACK; } else if (pt_cur->_pt_left == NULL && pt_cur->_pt_right != NULL) { /* * p p * | | * c => r * \ * r */ pt_parent->_pt_parent = pt_cur->_pt_right; pt_parent->_pt_parent->_pt_parent = pt_parent; pt_parent->_pt_parent->_t_color = _COLOR_BLACK; } else { /* * here the real deleted node is pt_curtmp, so the * color of pt_curtmp is used. */ pt_curtmp = _rb_tree_get_min_rbnode(pt_cur->_pt_right); t_colortmp = pt_curtmp->_t_color; if (pt_cur == pt_curtmp->_pt_parent) { /* * p p * | | * c => r * / \ / \ * l r l rr * \ * rr */ pt_curtmp->_pt_left = pt_cur->_pt_left; pt_curtmp->_pt_left->_pt_parent = pt_curtmp; pt_curtmp->_pt_parent = pt_cur->_pt_parent; pt_curtmp->_pt_parent->_pt_parent = pt_curtmp; pt_curtmp->_t_color = pt_cur->_t_color; pt_cur->_t_color = t_colortmp; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_curtmp->_pt_right, pt_curtmp); } } else { /* * p p * | | * c => rll * / \ / \ * l r l r * / \ / \ * rl rr rl rr * / \ \ \ \ * rll rlr rrr rlr rrr */ pt_parenttmp = pt_curtmp->_pt_parent; pt_parenttmp->_pt_left = pt_curtmp->_pt_right; if (pt_parenttmp->_pt_left != NULL) { pt_parenttmp->_pt_left->_pt_parent = pt_parenttmp; } pt_curtmp->_pt_left = pt_cur->_pt_left; pt_curtmp->_pt_left->_pt_parent = pt_curtmp; pt_curtmp->_pt_right = pt_cur->_pt_right; pt_curtmp->_pt_right->_pt_parent = pt_curtmp; pt_curtmp->_pt_parent = pt_cur->_pt_parent; pt_curtmp->_pt_parent->_pt_parent = pt_curtmp; pt_curtmp->_t_color = pt_cur->_t_color; pt_cur->_t_color = t_colortmp; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parenttmp->_pt_left, pt_parenttmp); } } } } else if (pt_cur == pt_parent->_pt_left) { if (pt_cur->_pt_left == NULL && pt_cur->_pt_right == NULL) { /* * p p * / => * c */ pt_parent->_pt_left = NULL; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parent->_pt_left, pt_parent); } } else if (pt_cur->_pt_left != NULL && pt_cur->_pt_right == NULL) { /* * p p * / / * c => l * / * l */ pt_parent->_pt_left = pt_cur->_pt_left; pt_parent->_pt_left->_pt_parent = pt_parent; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parent->_pt_left, pt_parent); } } else if (pt_cur->_pt_left == NULL && pt_cur->_pt_right != NULL) { /* * p p * / / * c => r * \ * r */ pt_parent->_pt_left = pt_cur->_pt_right; pt_parent->_pt_left->_pt_parent = pt_parent; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parent->_pt_left, pt_parent); } } else { /* * here the real deleted node is pt_curtmp, so the * color of pt_curtmp is used. */ pt_curtmp = _rb_tree_get_min_rbnode(pt_cur->_pt_right); t_colortmp = pt_curtmp->_t_color; if (pt_cur == pt_curtmp->_pt_parent) { /* * p p * / / * c => r * / \ / \ * l r l rr * \ * rr */ pt_curtmp->_pt_left = pt_cur->_pt_left; pt_curtmp->_pt_left->_pt_parent = pt_curtmp; pt_curtmp->_pt_parent = pt_cur->_pt_parent; pt_curtmp->_pt_parent->_pt_left = pt_curtmp; pt_curtmp->_t_color = pt_cur->_t_color; pt_cur->_t_color = t_colortmp; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_curtmp->_pt_right, pt_curtmp); } } else { /* * p p * / / * c => rll * / \ / \ * l r l r * / \ / \ * rl rr rl rr * / \ \ \ \ * rll rlr rrr rlr rrr */ pt_parenttmp = pt_curtmp->_pt_parent; pt_parenttmp->_pt_left = pt_curtmp->_pt_right; if (pt_parenttmp->_pt_left != NULL) { pt_parenttmp->_pt_left->_pt_parent = pt_parenttmp; } pt_curtmp->_pt_left = pt_cur->_pt_left; pt_curtmp->_pt_left->_pt_parent = pt_curtmp; pt_curtmp->_pt_right = pt_cur->_pt_right; pt_curtmp->_pt_right->_pt_parent = pt_curtmp; pt_curtmp->_pt_parent = pt_cur->_pt_parent; pt_curtmp->_pt_parent->_pt_left = pt_curtmp; pt_curtmp->_t_color = pt_cur->_t_color; pt_cur->_t_color = t_colortmp; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parenttmp->_pt_left, pt_parenttmp); } } } } else { if (pt_cur->_pt_left == NULL && pt_cur->_pt_right == NULL) { /* * p p * \ => * c */ pt_parent->_pt_right = NULL; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parent->_pt_right, pt_parent); } } else if (pt_cur->_pt_left != NULL && pt_cur->_pt_right == NULL) { /* * p p * \ \ * c => l * / * l */ pt_parent->_pt_right = pt_cur->_pt_left; pt_parent->_pt_right->_pt_parent = pt_parent; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parent->_pt_right, pt_parent); } } else if (pt_cur->_pt_left == NULL && pt_cur->_pt_right != NULL) { /* * p p * \ \ * c => r * \ * r */ pt_parent->_pt_right = pt_cur->_pt_right; pt_parent->_pt_right->_pt_parent = pt_parent; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parent->_pt_right, pt_parent); } } else { /* * here the real deleted node is pt_curtmp, so the * color of pt_curtmp is used. */ pt_curtmp = _rb_tree_get_min_rbnode(pt_cur->_pt_right); t_colortmp = pt_curtmp->_t_color; if (pt_cur == pt_curtmp->_pt_parent) { /* * p p * \ \ * c => r * / \ / \ * l r l rr * \ * rr */ pt_curtmp->_pt_left = pt_cur->_pt_left; pt_curtmp->_pt_left->_pt_parent = pt_curtmp; pt_curtmp->_pt_parent = pt_cur->_pt_parent; pt_curtmp->_pt_parent->_pt_right = pt_curtmp; pt_curtmp->_t_color = pt_cur->_t_color; pt_cur->_t_color = t_colortmp; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_curtmp->_pt_right, pt_curtmp); } } else { /* * p p * \ \ * c => rll * / \ / \ * l r l r * / \ / \ * rl rr rl rr * / \ \ \ \ * rll rlr rrr rlr rrr */ pt_parenttmp = pt_curtmp->_pt_parent; pt_parenttmp->_pt_left = pt_curtmp->_pt_right; if (pt_parenttmp->_pt_left != NULL) { pt_parenttmp->_pt_left->_pt_parent = pt_parenttmp; } pt_curtmp->_pt_left = pt_cur->_pt_left; pt_curtmp->_pt_left->_pt_parent = pt_curtmp; pt_curtmp->_pt_right = pt_cur->_pt_right; pt_curtmp->_pt_right->_pt_parent = pt_curtmp; pt_curtmp->_pt_parent = pt_cur->_pt_parent; pt_curtmp->_pt_parent->_pt_right = pt_curtmp; pt_curtmp->_t_color = pt_cur->_t_color; pt_cur->_t_color = t_colortmp; if (_rb_tree_get_color(pt_cur) == _COLOR_BLACK) { _rb_tree_fixup_deletion(pt_rb_tree, pt_parenttmp->_pt_left, pt_parenttmp); } } } } /* destroy the node */ b_result = _GET_RB_TREE_TYPE_SIZE(pt_rb_tree); _GET_RB_TREE_TYPE_DESTROY_FUNCTION(pt_rb_tree)(pt_cur->_pby_data, &b_result); assert(b_result); _alloc_deallocate(&pt_rb_tree->_t_allocator, pt_cur, _RB_TREE_NODE_SIZE(_GET_RB_TREE_TYPE_SIZE(pt_rb_tree)), 1); pt_rb_tree->_t_nodecount--; /* update the left and right pointer */ if (pt_rb_tree->_t_nodecount == 0) { pt_rb_tree->_t_rbroot._pt_parent = NULL; pt_rb_tree->_t_rbroot._pt_left = &pt_rb_tree->_t_rbroot; pt_rb_tree->_t_rbroot._pt_right = &pt_rb_tree->_t_rbroot; } else { pt_rb_tree->_t_rbroot._pt_left = _rb_tree_get_min_rbnode(pt_rb_tree->_t_rbroot._pt_parent); pt_rb_tree->_t_rbroot._pt_right = _rb_tree_get_max_rbnode(pt_rb_tree->_t_rbroot._pt_parent); } } /* * Erase a range of element in an rb tree. */ void _rb_tree_erase_range(_rb_tree_t* pt_rb_tree, _rb_tree_iterator_t it_begin, _rb_tree_iterator_t it_end) { _rb_tree_iterator_t it_iter; _rb_tree_iterator_t it_next; assert(pt_rb_tree != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); assert(_rb_tree_same_rb_tree_iterator_type(pt_rb_tree, it_begin)); assert(_rb_tree_same_rb_tree_iterator_type(pt_rb_tree, it_end)); assert(_rb_tree_iterator_equal(it_begin, it_end) || _rb_tree_iterator_before(it_begin, it_end)); it_iter = it_next = it_begin; if (!_rb_tree_iterator_equal(it_next, _rb_tree_end(pt_rb_tree))) { it_next = _rb_tree_iterator_next(it_next); } while (!_rb_tree_iterator_equal(it_iter, it_end)) { _rb_tree_erase_pos(pt_rb_tree, it_iter); it_iter = it_next; if (!_rb_tree_iterator_equal(it_next, _rb_tree_end(pt_rb_tree))) { it_next = _rb_tree_iterator_next(it_next); } } } /** * Erase an element from a rb tree that match a specified element. */ size_t _rb_tree_erase(_rb_tree_t* pt_rb_tree, const void* cpv_value) { size_t t_count = 0; range_t r_range; assert(pt_rb_tree != NULL); assert(cpv_value != NULL); assert(_rb_tree_is_inited(pt_rb_tree)); t_count = _rb_tree_count(pt_rb_tree, cpv_value); r_range = _rb_tree_equal_range(pt_rb_tree, cpv_value); if (!_rb_tree_iterator_equal(r_range.it_begin, _rb_tree_end(pt_rb_tree))) { _rb_tree_erase_range(pt_rb_tree, r_range.it_begin, r_range.it_end); } return t_count; } /** local function implementation section **/ /** eof **/
activesys/libcstl
src/cstl_rb_tree.c
C
lgpl-2.1
42,916
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** 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. ** ** If you have questions regarding the use of this file, please contact ** Nokia at [email protected]. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QtTest/QtTest> #include <qvariant.h> class tst_QGuiVariant : public QObject { Q_OBJECT public: tst_QGuiVariant(); private slots: void variantWithoutApplication(); }; tst_QGuiVariant::tst_QGuiVariant() {} void tst_QGuiVariant::variantWithoutApplication() { QVariant v = QString("red"); QVERIFY(qvariant_cast<QColor>(v) == QColor(Qt::red)); } QTEST_APPLESS_MAIN(tst_QGuiVariant) #include "tst_qguivariant.moc"
radekp/qt
tests/auto/qguivariant/tst_qguivariant.cpp
C++
lgpl-2.1
1,941
/* * crypt.c - blowfish-cbc code * * This file is part of the SSH Library * * Copyright (c) 2003 by Aris Adamantiadis * * The SSH 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. * * The SSH 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 the SSH Library; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #include "config.h" #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #ifndef _WIN32 #include <netinet/in.h> #include <arpa/inet.h> #endif #ifdef OPENSSL_CRYPTO #include <openssl/blowfish.h> #include <openssl/evp.h> #include <openssl/hmac.h> #endif #include "libssh/priv.h" #include "libssh/session.h" #include "libssh/wrapper.h" #include "libssh/crypto.h" #include "libssh/buffer.h" uint32_t packet_decrypt_len(ssh_session session, char *crypted){ uint32_t decrypted; if (session->current_crypto) { if (packet_decrypt(session, crypted, session->current_crypto->in_cipher->blocksize) < 0) { return 0; } } memcpy(&decrypted,crypted,sizeof(decrypted)); return ntohl(decrypted); } int packet_decrypt(ssh_session session, void *data,uint32_t len) { struct ssh_cipher_struct *crypto = session->current_crypto->in_cipher; char *out = NULL; assert(len); if(len % session->current_crypto->in_cipher->blocksize != 0){ ssh_set_error(session, SSH_FATAL, "Cryptographic functions must be set on at least one blocksize (received %d)",len); return SSH_ERROR; } out = malloc(len); if (out == NULL) { return -1; } if (crypto->set_decrypt_key(crypto, session->current_crypto->decryptkey, session->current_crypto->decryptIV) < 0) { SAFE_FREE(out); return -1; } crypto->cbc_decrypt(crypto,data,out,len); memcpy(data,out,len); memset(out,0,len); SAFE_FREE(out); return 0; } unsigned char *packet_encrypt(ssh_session session, void *data, uint32_t len) { struct ssh_cipher_struct *crypto = NULL; HMACCTX ctx = NULL; char *out = NULL; unsigned int finallen; uint32_t seq; assert(len); if (!session->current_crypto) { return NULL; /* nothing to do here */ } if(len % session->current_crypto->in_cipher->blocksize != 0){ ssh_set_error(session, SSH_FATAL, "Cryptographic functions must be set on at least one blocksize (received %d)",len); return NULL; } out = malloc(len); if (out == NULL) { return NULL; } seq = ntohl(session->send_seq); crypto = session->current_crypto->out_cipher; if (crypto->set_encrypt_key(crypto, session->current_crypto->encryptkey, session->current_crypto->encryptIV) < 0) { SAFE_FREE(out); return NULL; } if (session->version == 2) { ctx = hmac_init(session->current_crypto->encryptMAC,20,SSH_HMAC_SHA1); if (ctx == NULL) { SAFE_FREE(out); return NULL; } hmac_update(ctx,(unsigned char *)&seq,sizeof(uint32_t)); hmac_update(ctx,data,len); hmac_final(ctx,session->current_crypto->hmacbuf,&finallen); #ifdef DEBUG_CRYPTO ssh_print_hexa("mac: ",data,len); if (finallen != 20) { printf("Final len is %d\n",finallen); } ssh_print_hexa("Packet hmac", session->current_crypto->hmacbuf, 20); #endif } crypto->cbc_encrypt(crypto, data, out, len); memcpy(data, out, len); memset(out, 0, len); SAFE_FREE(out); if (session->version == 2) { return session->current_crypto->hmacbuf; } return NULL; } /** * @internal * * @brief Verify the hmac of a packet * * @param session The session to use. * @param buffer The buffer to verify the hmac from. * @param mac The mac to compare with the hmac. * * @return 0 if hmac and mac are equal, < 0 if not or an error * occurred. */ int packet_hmac_verify(ssh_session session, ssh_buffer buffer, unsigned char *mac) { unsigned char hmacbuf[EVP_MAX_MD_SIZE] = {0}; HMACCTX ctx; unsigned int len; uint32_t seq; ctx = hmac_init(session->current_crypto->decryptMAC, 20, SSH_HMAC_SHA1); if (ctx == NULL) { return -1; } seq = htonl(session->recv_seq); hmac_update(ctx, (unsigned char *) &seq, sizeof(uint32_t)); hmac_update(ctx, buffer_get_rest(buffer), buffer_get_rest_len(buffer)); hmac_final(ctx, hmacbuf, &len); #ifdef DEBUG_CRYPTO ssh_print_hexa("received mac",mac,len); ssh_print_hexa("Computed mac",hmacbuf,len); ssh_print_hexa("seq",(unsigned char *)&seq,sizeof(uint32_t)); #endif if (memcmp(mac, hmacbuf, len) == 0) { return 0; } return -1; } /* vim: set ts=2 sw=2 et cindent: */
tux-mind/platform_external_libssh
src/packet_crypt.c
C
lgpl-2.1
5,124
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2012, Open Source Geospatial Foundation (OSGeo) * * 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. */ package org.geotools.referencing.factory.gridshift; import java.net.URL; import org.geotools.metadata.iso.citation.Citations; import org.geotools.util.factory.AbstractFactory; import org.opengis.metadata.citation.Citation; /** * Default grid shift file locator, looks up grids in the classpath * * @author Andrea Aime - GeoSolutions */ public class ClasspathGridShiftLocator extends AbstractFactory implements GridShiftLocator { public ClasspathGridShiftLocator() { super(NORMAL_PRIORITY); } @Override public Citation getVendor() { return Citations.GEOTOOLS; } @Override public URL locateGrid(String grid) { return getClass().getResource(grid); } }
geotools/geotools
modules/library/referencing/src/main/java/org/geotools/referencing/factory/gridshift/ClasspathGridShiftLocator.java
Java
lgpl-2.1
1,361
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.dialect.identity; import java.sql.PreparedStatement; import java.sql.SQLException; import org.hibernate.HibernateException; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.identity.GetGeneratedKeysDelegate; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.id.PostInsertIdentityPersister; /** * @author Andrea Boriero */ public class Oracle12cGetGeneratedKeysDelegate extends GetGeneratedKeysDelegate { private String[] keyColumns; public Oracle12cGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect) { super( persister, dialect ); this.keyColumns = getPersister().getRootTableKeyColumnNames(); if ( keyColumns.length > 1 ) { throw new HibernateException( "Identity generator cannot be used with multi-column keys" ); } } @Override protected PreparedStatement prepare(String insertSQL, SessionImplementor session) throws SQLException { return session .getJdbcCoordinator() .getStatementPreparer() .prepareStatement( insertSQL, keyColumns ); } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/main/java/org/hibernate/dialect/identity/Oracle12cGetGeneratedKeysDelegate.java
Java
lgpl-2.1
1,313
/******************************************************************************* * Copyright (c) 2012 Scott Ross. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * * Contributors: * Scott Ross - initial API and implementation ******************************************************************************/ package org.alms.messages; import org.alms.beans.*; import javax.ws.rs.core.HttpHeaders; public interface IMsg { public void setHeader(HttpHeaders msgHeaders); public void setIncomingMessage(String incomingMessage); public Boolean checkMessageVocubulary(); public RelatedParty getMsgDestination(); public RelatedParty getMsgSending(); public String getMsgId(); public String getUserName(); public String getPassword(); public String getXSDLocation(); public String getIncomingMessage(); public String receiverTransmissionType(); }
sross07/alms
src/main/java/org/alms/messages/IMsg.java
Java
lgpl-2.1
1,077
<?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: ks_prefreport.php 57954 2016-03-17 19:34:29Z jyhem $ // outputs the prefreport as a pipe delimited file // Usage: From the command line: // php doc/devtools/prefreport.php // resulting file can be found at dump/prefreport.txt // // also check out doc/devtools/securitycheck.php to see in which files are // used each pref (and permission name too) // $ourFileName = "dump/prefreport.txt"; require_once 'tiki-setup.php'; $prefslib = TikiLib::lib('prefs'); $defaultValues = get_default_prefs(); $fields = array( 'preference' => '', 'name' => '', 'description' => '', 'default' => '', 'help' => '', 'hard_to_search' => false, 'duplicate_name' => 0, 'duplicate_description' => 0, 'word_count' => 0, 'filter' => '', 'locations' => '', 'dependencies' => '', 'type' => '', 'options' => '', 'admin' => '', 'module' => '', 'view' => '', 'permission' => '', 'plugin' => '', 'extensions' => '', 'tags' => '', 'parameters' => '', 'detail' => '', 'warning' => '', 'hint' => '', 'shorthint' => '', 'perspective' => '', 'separator' => '', ); $stopWords = array('', 'in', 'and', 'a', 'to', 'be', 'of', 'on', 'the', 'for', 'as', 'it', 'or', 'with', 'by', 'is', 'an'); $data = array(); error_reporting(E_ALL);ini_set('display_errors', 'on'); $data = collect_raw_data($fields); remove_fake_descriptions($data); set_default_values($data, $defaultValues); collect_locations($data); $index = array( 'name' => index_data($data, 'name'), 'description' => index_data($data, 'description'), ); update_search_flag($data, $index, $stopWords); $ourFileHandle = fopen($ourFileName, 'w+') or die("can't open file"); // Output results fputcsv($ourFileHandle, array_keys($fields), '|'); foreach ($data as $values) { fputcsv($ourFileHandle, array_values($values), '|'); } fclose($ourFileHandle); /** * @param $fields * @return array */ function collect_raw_data($fields) { $data = array(); foreach (glob('lib/prefs/*.php') as $file) { $name = substr(basename($file), 0, -4); $function = "prefs_{$name}_list"; if ($name == 'index') { continue; } include $file; $list = $function(); foreach ($list as $name => $raw) { $entry = $fields; $entry['preference'] = $name; $entry['name'] = isset($raw['name']) ? $raw['name'] : ''; $entry['description'] = isset($raw['description']) ? $raw['description'] : ''; $entry['filter'] = isset($raw['filter']) ? $raw['filter'] : ''; $entry['help'] = isset($raw['help']) ? $raw['help'] : ''; $entry['dependencies'] = !empty($raw['dependencies']) ? implode(',', (array) $raw['dependencies']) : ''; $entry['type'] = isset($raw['type']) ? $raw['type'] : ''; $entry['options'] = isset($raw['options']) ? implode(',', $raw['options']) : ''; $entry['admin'] = isset($raw['admin']) ? $raw['admin'] : ''; $entry['module'] = isset($raw['module']) ? $raw['module'] : ''; $entry['view'] = isset($raw['view']) ? $raw['view'] : ''; $entry['permission'] = isset($raw['permission']) ? implode(',', $raw['permission']) : ''; $entry['plugin'] = isset($raw['plugin']) ? $raw['plugin'] : ''; $entry['extensions'] = isset($raw['extensions']) ? implode(',', $raw['extensions']) : ''; $entry['tags'] = isset($raw['tags']) ? implode(',', $raw['tags']) : ''; $entry['parameters'] = isset($raw['parameters']) ? implode(',', $raw['parameters']) : ''; $entry['detail'] = isset($raw['detail']) ? $raw['detail'] : ''; $entry['warning'] = isset($raw['warning']) ? $raw['warning'] : ''; $entry['hint'] = isset($raw['hint']) ? $raw['hint'] : ''; $entry['shorthint'] = isset($raw['shorthint']) ? $raw['shorthint'] : ''; $entry['perspective'] = isset($raw['perspective']) ? $raw['perspective'] ? 'true' : 'false' : ''; $entry['separator'] = isset($raw['separator']) ? $raw['separator'] : ''; $data[] = $entry; } } return $data; } /** * @param $data */ function remove_fake_descriptions(& $data) { foreach ($data as & $row) { if ($row['name'] == $row['description']) { $row['description'] = ''; } } } /** * @param $data * @param $prefs */ function set_default_values(& $data, $prefs) { foreach ($data as & $row) { $row['default'] = isset($prefs[$row['preference']]) ? $prefs[$row['preference']] : ''; if (is_array($row['default'])) { $row['default'] = implode($row['separator'], $row['default']); } } } /** * @param $data * @param $field * @return array */ function index_data($data, $field) { $index = array(); foreach ($data as $row) { $value = strtolower($row[$field]); if (! isset($index[$value])) { $index[$value] = 0; } $index[$value]++; } return $index; } /** * @param $data */ function collect_locations(& $data) { $prefslib = TikiLib::lib('prefs'); foreach ($data as & $row) { $pages = $prefslib->getPreferenceLocations($row['preference']); foreach ($pages as & $page) { $page = $page[0] . '/' . $page[1]; } $row['locations'] = implode(', ', $pages); } } /** * @param $data * @param $index * @param $stopWords */ function update_search_flag(& $data, $index, $stopWords) { foreach ($data as & $row) { $name = strtolower($row['name']); $description = strtolower($row['description']); $words = array_diff(explode(' ', $name . ' ' . $description), $stopWords); $row['duplicate_name'] = $index['name'][$name]; if (! empty($description)) { $row['duplicate_description'] = $index['description'][$description]; } $row['word_count'] = count($words); if (count($words) < 5) { $row['hard_to_search'] = 'X'; } elseif ($index['name'][$name] > 2) { $row['hard_to_search'] = 'X'; } elseif ($index['description'][$description] > 2) { $row['hard_to_search'] = 'X'; } } }
XavierSolerFR/diem25tiki
doc/devtools/ks_prefreport.php
PHP
lgpl-2.1
5,981
/******************************************************************************* * File Name: HW_V1_config.h *******************************************************************************/ #ifndef __HWV1_CONFIG_H #define __HWV1_CONFIG_H #include "usb_type.h" #define BULK_MAX_PACKET_SIZE 0x00000040 #define TIM1_CR1 (*((vu32 *)(TIM1_BASE+0x00))) #define TIM1_CR2 (*((vu32 *)(TIM1_BASE+0x04))) #define TIM1_DIER (*((vu32 *)(TIM1_BASE+0x0C))) #define TIM1_SR (*((vu32 *)(TIM1_BASE+0x10))) #define TIM1_CCMR1 (*((vu32 *)(TIM1_BASE+0x18))) #define TIM1_CCER (*((vu32 *)(TIM1_BASE+0x20))) #define TIM1_PSC (*((vu32 *)(TIM1_BASE+0x28))) #define TIM1_ARR (*((vu32 *)(TIM1_BASE+0x2C))) #define TIM1_RCR (*((vu32 *)(TIM1_BASE+0x30))) #define TIM1_CCR1 (*((vu32 *)(TIM1_BASE+0x34))) #define TIM1_BDTR (*((vu32 *)(TIM1_BASE+0x44))) #define TIM2_CR1 (*((vu32 *)(TIM2_BASE+0x00))) #define TIM2_DIER (*((vu32 *)(TIM2_BASE+0x0C))) #define TIM2_SR (*((vu32 *)(TIM2_BASE+0x10))) #define TIM2_CCMR2 (*((vu32 *)(TIM2_BASE+0x1C))) #define TIM2_CCER (*((vu32 *)(TIM2_BASE+0x20))) #define TIM2_PSC (*((vu32 *)(TIM2_BASE+0x28))) #define TIM2_ARR (*((vu32 *)(TIM2_BASE+0x2C))) #define TIM2_CCR4 (*((vu32 *)(TIM2_BASE+0x40))) #define TIM3_CR1 (*((vu32 *)(TIM3_BASE+0x00))) #define TIM3_DIER (*((vu32 *)(TIM3_BASE+0x0C))) #define TIM3_SR (*((vu32 *)(TIM3_BASE+0x10))) #define TIM3_CCMR2 (*((vu32 *)(TIM3_BASE+0x1C))) #define TIM3_CCER (*((vu32 *)(TIM3_BASE+0x20))) #define TIM3_PSC (*((vu32 *)(TIM3_BASE+0x28))) #define TIM3_ARR (*((vu32 *)(TIM3_BASE+0x2C))) #define TIM3_CCR1 (*((vu32 *)(TIM3_BASE+0x34))) #define TIM4_CR1 (*((vu32 *)(TIM4_BASE+0x00))) #define TIM4_DIER (*((vu32 *)(TIM4_BASE+0x0C))) #define TIM4_SR (*((vu32 *)(TIM4_BASE+0x10))) #define TIM4_CCMR1 (*((vu32 *)(TIM4_BASE+0x18))) #define TIM4_CCMR2 (*((vu32 *)(TIM4_BASE+0x1C))) #define TIM4_CCER (*((vu32 *)(TIM4_BASE+0x20))) #define TIM4_PSC (*((vu32 *)(TIM4_BASE+0x28))) #define TIM4_ARR (*((vu32 *)(TIM4_BASE+0x2C))) #define TIM4_CCR1 (*((vu32 *)(TIM4_BASE+0x34))) typedef enum { BEEP_1MHz, BEEP_500kHz, BEEP_200kHz, BEEP_100kHz, BEEP_50kHz, BEEP_20kHz, BEEP_10kHz, BEEP_5kHz, BEEP_2kHz, BEEP_1kHz, BEEP_500Hz, BEEP_200Hz, BEEP_100Hz, BEEP_50Hz, BEEP_20Hz, BEEP_10Hz} beep_t; #define ADC2_CR1 (*((vu32 *)(ADC2_BASE+0x04))) #define ADC2_CR2 (*((vu32 *)(ADC2_BASE+0x08))) #define ADC2_SMPR1 (*((vu32 *)(ADC2_BASE+0x0C))) #define ADC2_SMPR2 (*((vu32 *)(ADC2_BASE+0x10))) #define ADC2_SQR1 (*((vu32 *)(ADC2_BASE+0x2C))) #define ADC2_SQR3 (*((vu32 *)(ADC2_BASE+0x34))) #define ADC1_CR1 (*((vu32 *)(0x40012400+0x04))) #define ADC1_CR2 (*((vu32 *)(0x40012400+0x08))) #define ADC1_SMPR1 (*((vu32 *)(0x40012400+0x0C))) #define ADC1_SMPR2 (*((vu32 *)(0x40012400+0x10))) #define ADC1_SQR1 (*((vu32 *)(0x40012400+0x2C))) #define ADC1_SQR3 (*((vu32 *)(0x40012400+0x34))) #define ADC_DR (*((vu32 *)(0x40012400+0x4C))) #define DMA_ISR (*((vu32 *)(0x40020000+0x00))) #define DMA_IFCR (*((vu32 *)(0x40020000+0x04))) #define DMA_CCR1 (*((vu32 *)(0x40020000+0x08))) #define DMA_CNDTR1 (*((vu32 *)(0x40020000+0x0C))) #define DMA_CPAR1 (*((vu32 *)(0x40020000+0x10))) #define DMA_CMAR1 (*((vu32 *)(0x40020000+0x14))) #define DMA_CCR2 (*((vu32 *)(0x40020000+0x1C))) #define DMA_CNDTR2 (*((vu32 *)(0x40020000+0x20))) #define DMA_CPAR2 (*((vu32 *)(0x40020000+0x24))) #define DMA_CMAR2 (*((vu32 *)(0x40020000+0x28))) #define ADC1_DR_ADDR ((u32)0x4001244C) #define GPIOA_CRL (*((vu32 *)(GPIOA_BASE+0x00))) #define GPIOB_CRL (*((vu32 *)(GPIOB_BASE+0x00))) #define GPIOC_CRL (*((vu32 *)(GPIOC_BASE+0x00))) #define GPIOD_CRL (*((vu32 *)(GPIOD_BASE+0x00))) #define GPIOE_CRL (*((vu32 *)(GPIOE_BASE+0x00))) #define GPIOA_CRH (*((vu32 *)(GPIOA_BASE+0x04))) #define GPIOB_CRH (*((vu32 *)(GPIOB_BASE+0x04))) #define GPIOC_CRH (*((vu32 *)(GPIOC_BASE+0x04))) #define GPIOD_CRH (*((vu32 *)(GPIOD_BASE+0x04))) #define GPIOE_CRH (*((vu32 *)(GPIOE_BASE+0x04))) #define GPIOA_ODR (*((vu32 *)(GPIOA_BASE+0x0C))) #define GPIOB_ODR (*((vu32 *)(GPIOB_BASE+0x0C))) #define GPIOC_ODR (*((vu32 *)(GPIOC_BASE+0x0C))) #define GPIOD_ODR (*((vu32 *)(GPIOD_BASE+0x0C))) #define GPIOE_ODR (*((vu32 *)(GPIOE_BASE+0x0C))) #define GPIOA_IDR (*((vu32 *)(GPIOA_BASE+0x08))) #define GPIOB_IDR (*((vu32 *)(GPIOB_BASE+0x08))) #define GPIOC_IDR (*((vu32 *)(GPIOC_BASE+0x08))) #define GPIOD_IDR (*((vu32 *)(GPIOD_BASE+0x08))) #define GPIOE_IDR (*((vu32 *)(GPIOE_BASE+0x08))) #define GPIOA_BSRR (*((vu32 *)(GPIOA_BASE+0x10))) #define GPIOB_BSRR (*((vu32 *)(GPIOB_BASE+0x10))) #define GPIOC_BSRR (*((vu32 *)(GPIOC_BASE+0x10))) #define GPIOD_BSRR (*((vu32 *)(GPIOD_BASE+0x10))) #define GPIOE_BSRR (*((vu32 *)(GPIOE_BASE+0x10))) #define GPIOA_BRR (*((vu32 *)(GPIOA_BASE+0x14))) #define GPIOB_BRR (*((vu32 *)(GPIOB_BASE+0x14))) #define GPIOC_BRR (*((vu32 *)(GPIOC_BASE+0x14))) #define GPIOD_BRR (*((vu32 *)(GPIOD_BASE+0x14))) #define GPIOE_BRR (*((vu32 *)(GPIOE_BASE+0x14))) #define AFIO_MAPR (*((vu32 *)(AFIO_BASE+0x04))) //These bits are written by software to select the source input for EXTIx external interrupt. #define PA_x_PIN 0000 #define PB_x_PIN 0001 #define PC_x_PIN 0010 #define PD_x_PIN 0011 #define PE_x_PIN 0100 #define PF_x_PIN 0101 #define PG_x_PIN 0110 #define AFIO_EXTICR1 (*((vu32 *)(AFIO_BASE+0x08))) //EXTI x configuration (x= 0 to 3) #define AFIO_EXTICR2 (*((vu32 *)(AFIO_BASE+0x0C))) //EXTI x configuration (x= 4 to 7) #define AFIO_EXTICR3 (*((vu32 *)(AFIO_BASE+0x10))) //EXTI x configuration (x= 8 to 11) #define AFIO_EXTICR4 (*((vu32 *)(AFIO_BASE+0x14))) //EXTI x configuration (x= 12 to 15) #define SCS_BASE ((u32)0xE000E000) #define SysTick_BASE (SCS_BASE + 0x0010) #define MSD_CS_LOW() GPIOB_BRR = GPIO_Pin_12 //Select MSD Card #define MSD_CS_HIGH() GPIOB_BSRR = GPIO_Pin_12 //Deselect MSD Card #define KEY_UP (GPIO_Pin_6) //GPIOA6 (PA_x_PIN << 8) #define KEY_DOWN (GPIO_Pin_9) //GPIOD9 (PD_x_PIN << 4) #define KEY_LEFT (GPIO_Pin_5) //GPIOA5 (PA_x_PIN << 4) #define KEY_RIGHT (GPIO_Pin_7) //GPIOA7 (PA_x_PIN << 12) #define KEY_PLAY (GPIO_Pin_4) //GPIOA4 (PA_x_PIN << 0) #define KEY_M (GPIO_Pin_11) //GPIOD11 (PD_x_PIN << 12) #define KEY_B (GPIO_Pin_3) //GPIOA3 (PA_x_PIN << 12) typedef enum { KEYCODE_VOID, KEYCODE_PLAY, KEYCODE_M, KEYCODE_B, KEYCODE_UP, KEYCODE_DOWN, KEYCODE_LEFT, KEYCODE_RIGHT} KeyCode_t; #define LDC_DATA_OUT GPIOE_ODR #define LDC_DATA_INP GPIOE_IDR #define LCD_DATA_BUS_INP() GPIOC_CRH = 0x44444444; GPIOE_CRL = 0x44444444 #define LCD_DATA_BUS_OUT() GPIOC_CRH = 0x33333333; GPIOE_CRL = 0x33333333 #define LCD_nRST_LOW() GPIOC_BRR = GPIO_Pin_0 #define LCD_nRST_HIGH() GPIOC_BSRR = GPIO_Pin_0 #define LCD_RS_LOW() GPIOD_BRR = GPIO_Pin_1 #define LCD_RS_HIGH() GPIOD_BSRR = GPIO_Pin_1 #define LCD_nWR_LOW() GPIOD_BRR = GPIO_Pin_5 #define LCD_nWR_HIGH() GPIOD_BSRR = GPIO_Pin_5 #define LCD_nWR_ACT() GPIOD_BRR = GPIO_Pin_5; GPIOD_BSRR = GPIO_Pin_5 #define LCD_nRD_LOW() GPIOD_BRR = GPIO_Pin_4 #define LCD_nRD_HIGH() GPIOD_BSRR = GPIO_Pin_4 #define LCD_nRD_ACT() GPIOB_BRR = GPIO_Pin_4; GPIOD_BSRR = GPIO_Pin_4 #define RANGE_A_LOW() GPIOB_BRR = GPIO_Pin_0 #define RANGE_A_HIGH() GPIOB_BSRR = GPIO_Pin_0 #define RANGE_B_LOW() GPIOC_BRR = GPIO_Pin_5 #define RANGE_B_HIGH() GPIOC_BSRR = GPIO_Pin_5 #define RANGE_C_LOW() GPIOC_BRR = GPIO_Pin_4 #define RANGE_C_HIGH() GPIOC_BSRR = GPIO_Pin_4 #define RANGE_D_LOW() GPIOB_BRR = GPIO_Pin_1 #define RANGE_D_HIGH() GPIOB_BSRR = GPIO_Pin_1 void Set_System(void); void NVIC_Configuration(void); void GPIO_Config(void); void Get_Medium_Characteristics(void); void SPI_Config(void); void DMA_Configuration(void); void ADC_Configuration(void); void Timer_Configuration(void); char KeyScan(void); unsigned char MSD_WriteByte(u8 byte); unsigned char MSD_ReadByte(void); void Battery_Detect(void); void Set_Range(char Range); void Set_Base(char Base); void ADC_Start(void); void Set_Y_Pos(unsigned short Y0); char Test_USB_ON(void); char SD_Card_ON(void); void Delayms(unsigned short delay); void WaitForKey(void); extern volatile unsigned short DelayCounter; extern volatile unsigned short BeepCounter; extern volatile KeyCode_t KeyBuffer; void Display_Info(char *Pre, unsigned long Num); #endif /****************************** END OF FILE ***********************************/
thinrope/Nano_MCA
src/MCA_LIB/include/HW_V1_Config.h
C
lgpl-2.1
8,731
#include "sparrowPrimitives.h"
theZiz/sparrow3d
sparrowPrimitivesAsm.h
C
lgpl-2.1
31
package jastadd.soot.JastAddJ; import java.util.HashSet;import java.util.LinkedHashSet;import java.io.File;import java.util.*;import jastadd.beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;import java.io.FileNotFoundException;import java.util.Collection;import soot.*;import soot.util.*;import soot.jimple.*;import soot.coffi.ClassFile;import soot.coffi.method_info;import soot.coffi.CONSTANT_Utf8_info;import soot.tagkit.SourceFileTag;import soot.coffi.CoffiMethodSource; public class ParClassInstanceExpr extends ClassInstanceExpr implements Cloneable { public void flushCache() { super.flushCache(); } public void flushCollectionCache() { super.flushCollectionCache(); } @SuppressWarnings({"unchecked", "cast"}) public ParClassInstanceExpr clone() throws CloneNotSupportedException { ParClassInstanceExpr node = (ParClassInstanceExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public ParClassInstanceExpr copy() { try { ParClassInstanceExpr node = clone(); if(children != null) node.children = children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public ParClassInstanceExpr fullCopy() { ParClassInstanceExpr res = copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in GenericMethods.jrag at line 160 public void toString(StringBuffer s) { s.append("<"); for(int i = 0; i < getNumTypeArgument(); i++) { if(i != 0) s.append(", "); getTypeArgument(i).toString(s); } s.append(">"); super.toString(s); } // Declared in GenericMethods.ast at line 3 // Declared in GenericMethods.ast line 15 public ParClassInstanceExpr() { super(); setChild(new List(), 1); setChild(new Opt(), 2); setChild(new List(), 3); } // Declared in GenericMethods.ast at line 13 // Declared in GenericMethods.ast line 15 public ParClassInstanceExpr(Access p0, List<Expr> p1, Opt<TypeDecl> p2, List<Access> p3) { setChild(p0, 0); setChild(p1, 1); setChild(p2, 2); setChild(p3, 3); } // Declared in GenericMethods.ast at line 20 protected int numChildren() { return 4; } // Declared in GenericMethods.ast at line 23 public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 34 public void setAccess(Access node) { setChild(node, 0); } // Declared in java.ast at line 5 public Access getAccess() { return (Access)getChild(0); } // Declared in java.ast at line 9 public Access getAccessNoTransform() { return (Access)getChildNoTransform(0); } // Declared in java.ast at line 2 // Declared in java.ast line 34 public void setArgList(List<Expr> list) { setChild(list, 1); } // Declared in java.ast at line 6 public int getNumArg() { return getArgList().getNumChild(); } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Expr getArg(int i) { return getArgList().getChild(i); } // Declared in java.ast at line 14 public void addArg(Expr node) { List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList(); list.addChild(node); } // Declared in java.ast at line 19 public void addArgNoTransform(Expr node) { List<Expr> list = getArgListNoTransform(); list.addChild(node); } // Declared in java.ast at line 24 public void setArg(Expr node, int i) { List<Expr> list = getArgList(); list.setChild(node, i); } // Declared in java.ast at line 28 public List<Expr> getArgs() { return getArgList(); } // Declared in java.ast at line 31 public List<Expr> getArgsNoTransform() { return getArgListNoTransform(); } // Declared in java.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<Expr> getArgList() { List<Expr> list = (List<Expr>)getChild(1); list.getNumChild(); return list; } // Declared in java.ast at line 41 @SuppressWarnings({"unchecked", "cast"}) public List<Expr> getArgListNoTransform() { return (List<Expr>)getChildNoTransform(1); } // Declared in java.ast at line 2 // Declared in java.ast line 34 public void setTypeDeclOpt(Opt<TypeDecl> opt) { setChild(opt, 2); } // Declared in java.ast at line 6 public boolean hasTypeDecl() { return getTypeDeclOpt().getNumChild() != 0; } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl getTypeDecl() { return getTypeDeclOpt().getChild(0); } // Declared in java.ast at line 14 public void setTypeDecl(TypeDecl node) { getTypeDeclOpt().setChild(node, 0); } // Declared in java.ast at line 17 @SuppressWarnings({"unchecked", "cast"}) public Opt<TypeDecl> getTypeDeclOpt() { return (Opt<TypeDecl>)getChild(2); } // Declared in java.ast at line 21 @SuppressWarnings({"unchecked", "cast"}) public Opt<TypeDecl> getTypeDeclOptNoTransform() { return (Opt<TypeDecl>)getChildNoTransform(2); } // Declared in GenericMethods.ast at line 2 // Declared in GenericMethods.ast line 15 public void setTypeArgumentList(List<Access> list) { setChild(list, 3); } // Declared in GenericMethods.ast at line 6 public int getNumTypeArgument() { return getTypeArgumentList().getNumChild(); } // Declared in GenericMethods.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Access getTypeArgument(int i) { return getTypeArgumentList().getChild(i); } // Declared in GenericMethods.ast at line 14 public void addTypeArgument(Access node) { List<Access> list = (parent == null || state == null) ? getTypeArgumentListNoTransform() : getTypeArgumentList(); list.addChild(node); } // Declared in GenericMethods.ast at line 19 public void addTypeArgumentNoTransform(Access node) { List<Access> list = getTypeArgumentListNoTransform(); list.addChild(node); } // Declared in GenericMethods.ast at line 24 public void setTypeArgument(Access node, int i) { List<Access> list = getTypeArgumentList(); list.setChild(node, i); } // Declared in GenericMethods.ast at line 28 public List<Access> getTypeArguments() { return getTypeArgumentList(); } // Declared in GenericMethods.ast at line 31 public List<Access> getTypeArgumentsNoTransform() { return getTypeArgumentListNoTransform(); } // Declared in GenericMethods.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<Access> getTypeArgumentList() { List<Access> list = (List<Access>)getChild(3); list.getNumChild(); return list; } // Declared in GenericMethods.ast at line 41 @SuppressWarnings({"unchecked", "cast"}) public List<Access> getTypeArgumentListNoTransform() { return (List<Access>)getChildNoTransform(3); } // Declared in GenericMethods.jrag at line 126 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getTypeArgumentListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return NameType.TYPE_NAME; } return super.Define_NameType_nameType(caller, child); } // Declared in GenericMethods.jrag at line 127 public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { if(caller == getTypeArgumentListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return unqualifiedScope().lookupType(name); } return super.Define_SimpleSet_lookupType(caller, child, name); } public ASTNode rewriteTo() { return super.rewriteTo(); } }
plast-lab/soot
src/jastadd/soot/JastAddJ/ParClassInstanceExpr.java
Java
lgpl-2.1
8,648
/* * filter_glsl_manager.cpp * Copyright (C) 2011-2012 Christophe Thommeret <[email protected]> * Copyright (C) 2013 Dan Dennedy <[email protected]> * * 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 2 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, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdlib.h> #include <string> #include "filter_glsl_manager.h" #include <movit/init.h> #include <movit/util.h> #include <movit/effect_chain.h> #include <movit/resource_pool.h> #include "mlt_movit_input.h" #include "mlt_flip_effect.h" #include <mlt++/MltEvent.h> #include <mlt++/MltProducer.h> extern "C" { #include <framework/mlt_factory.h> } #if defined(__APPLE__) #include <OpenGL/OpenGL.h> #elif defined(_WIN32) #include <windows.h> #include <wingdi.h> #else #include <GL/glx.h> #endif using namespace movit; void dec_ref_and_delete(GlslManager *p) { if (p->dec_ref() == 0) { delete p; } } GlslManager::GlslManager() : Mlt::Filter( mlt_filter_new() ) , resource_pool(new ResourcePool()) , pbo(0) , initEvent(0) , closeEvent(0) , prev_sync(NULL) { mlt_filter filter = get_filter(); if ( filter ) { // Set the mlt_filter child in case we choose to override virtual functions. filter->child = this; add_ref(mlt_global_properties()); mlt_events_register( get_properties(), "init glsl", NULL ); mlt_events_register( get_properties(), "close glsl", NULL ); initEvent = listen("init glsl", this, (mlt_listener) GlslManager::onInit); closeEvent = listen("close glsl", this, (mlt_listener) GlslManager::onClose); } } GlslManager::~GlslManager() { mlt_log_debug(get_service(), "%s\n", __FUNCTION__); cleanupContext(); // XXX If there is still a frame holding a reference to a texture after this // destructor is called, then it will crash in release_texture(). // while (texture_list.peek_back()) // delete (glsl_texture) texture_list.pop_back(); delete initEvent; delete closeEvent; if (prev_sync != NULL) { glDeleteSync( prev_sync ); } while (syncs_to_delete.count() > 0) { GLsync sync = (GLsync) syncs_to_delete.pop_front(); glDeleteSync( sync ); } delete resource_pool; } void GlslManager::add_ref(mlt_properties properties) { inc_ref(); mlt_properties_set_data(properties, "glslManager", this, 0, (mlt_destructor) dec_ref_and_delete, NULL); } GlslManager* GlslManager::get_instance() { return (GlslManager*) mlt_properties_get_data(mlt_global_properties(), "glslManager", 0); } glsl_texture GlslManager::get_texture(int width, int height, GLint internal_format) { lock(); for (int i = 0; i < texture_list.count(); ++i) { glsl_texture tex = (glsl_texture) texture_list.peek(i); if (!tex->used && (tex->width == width) && (tex->height == height) && (tex->internal_format == internal_format)) { glBindTexture(GL_TEXTURE_2D, tex->texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glBindTexture( GL_TEXTURE_2D, 0); tex->used = 1; unlock(); return tex; } } unlock(); GLuint tex = 0; glGenTextures(1, &tex); if (!tex) { return NULL; } glsl_texture gtex = new glsl_texture_s; if (!gtex) { glDeleteTextures(1, &tex); return NULL; } glBindTexture( GL_TEXTURE_2D, tex ); glTexImage2D( GL_TEXTURE_2D, 0, internal_format, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); glBindTexture( GL_TEXTURE_2D, 0 ); gtex->texture = tex; gtex->width = width; gtex->height = height; gtex->internal_format = internal_format; gtex->used = 1; lock(); texture_list.push_back(gtex); unlock(); return gtex; } void GlslManager::release_texture(glsl_texture texture) { texture->used = 0; } void GlslManager::delete_sync(GLsync sync) { // We do not know which thread we are called from, and we can only // delete this if we are in one with a valid OpenGL context. // Thus, store it for later deletion in render_frame_texture(). GlslManager* g = GlslManager::get_instance(); g->lock(); g->syncs_to_delete.push_back(sync); g->unlock(); } glsl_pbo GlslManager::get_pbo(int size) { lock(); if (!pbo) { GLuint pb = 0; glGenBuffers(1, &pb); if (!pb) { unlock(); return NULL; } pbo = new glsl_pbo_s; if (!pbo) { glDeleteBuffers(1, &pb); unlock(); return NULL; } pbo->pbo = pb; pbo->size = 0; } if (size > pbo->size) { glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo->pbo); glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size, NULL, GL_STREAM_DRAW); glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); pbo->size = size; } unlock(); return pbo; } void GlslManager::cleanupContext() { lock(); while (texture_list.peek_back()) { glsl_texture texture = (glsl_texture) texture_list.peek_back(); glDeleteTextures(1, &texture->texture); delete texture; texture_list.pop_back(); } if (pbo) { glDeleteBuffers(1, &pbo->pbo); delete pbo; pbo = 0; } unlock(); } void GlslManager::onInit( mlt_properties owner, GlslManager* filter ) { mlt_log_debug( filter->get_service(), "%s\n", __FUNCTION__ ); #ifdef _WIN32 std::string path = std::string(mlt_environment("MLT_APPDIR")).append("\\share\\movit"); #elif defined(__APPLE__) && defined(RELOCATABLE) std::string path = std::string(mlt_environment("MLT_APPDIR")).append("/share/movit"); #else std::string path = std::string(getenv("MLT_MOVIT_PATH") ? getenv("MLT_MOVIT_PATH") : SHADERDIR); #endif bool success = init_movit( path, mlt_log_get_level() == MLT_LOG_DEBUG? MOVIT_DEBUG_ON : MOVIT_DEBUG_OFF ); filter->set( "glsl_supported", success ); } void GlslManager::onClose( mlt_properties owner, GlslManager *filter ) { filter->cleanupContext(); } void GlslManager::onServiceChanged( mlt_properties owner, mlt_service aservice ) { Mlt::Service service( aservice ); service.lock(); service.set( "movit chain", NULL, 0 ); service.unlock(); } void GlslManager::onPropertyChanged( mlt_properties owner, mlt_service service, const char* property ) { if ( property && std::string( property ) == "disable" ) onServiceChanged( owner, service ); } extern "C" { mlt_filter filter_glsl_manager_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { GlslManager* g = GlslManager::get_instance(); if (g) g->inc_ref(); else g = new GlslManager(); return g->get_filter(); } } // extern "C" static void deleteChain( GlslChain* chain ) { // The Input* is owned by the EffectChain, but the MltInput* is not. // Thus, we have to delete it here. for (std::map<mlt_producer, MltInput*>::iterator input_it = chain->inputs.begin(); input_it != chain->inputs.end(); ++input_it) { delete input_it->second; } delete chain->effect_chain; delete chain; } void* GlslManager::get_frame_specific_data( mlt_service service, mlt_frame frame, const char *key, int *length ) { const char *unique_id = mlt_properties_get( MLT_SERVICE_PROPERTIES(service), "_unique_id" ); char buf[256]; snprintf( buf, sizeof(buf), "%s_%s", key, unique_id ); return mlt_properties_get_data( MLT_FRAME_PROPERTIES(frame), buf, length ); } int GlslManager::set_frame_specific_data( mlt_service service, mlt_frame frame, const char *key, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise ) { const char *unique_id = mlt_properties_get( MLT_SERVICE_PROPERTIES(service), "_unique_id" ); char buf[256]; snprintf( buf, sizeof(buf), "%s_%s", key, unique_id ); return mlt_properties_set_data( MLT_FRAME_PROPERTIES(frame), buf, value, length, destroy, serialise ); } void GlslManager::set_chain( mlt_service service, GlslChain* chain ) { mlt_properties_set_data( MLT_SERVICE_PROPERTIES(service), "_movit chain", chain, 0, (mlt_destructor) deleteChain, NULL ); } GlslChain* GlslManager::get_chain( mlt_service service ) { return (GlslChain*) mlt_properties_get_data( MLT_SERVICE_PROPERTIES(service), "_movit chain", NULL ); } Effect* GlslManager::get_effect( mlt_service service, mlt_frame frame ) { return (Effect*) get_frame_specific_data( service, frame, "_movit effect", NULL ); } Effect* GlslManager::set_effect( mlt_service service, mlt_frame frame, Effect* effect ) { set_frame_specific_data( service, frame, "_movit effect", effect, 0, NULL, NULL ); return effect; } MltInput* GlslManager::get_input( mlt_producer producer, mlt_frame frame ) { return (MltInput*) get_frame_specific_data( MLT_PRODUCER_SERVICE(producer), frame, "_movit input", NULL ); } MltInput* GlslManager::set_input( mlt_producer producer, mlt_frame frame, MltInput* input ) { set_frame_specific_data( MLT_PRODUCER_SERVICE(producer), frame, "_movit input", input, 0, NULL, NULL ); return input; } uint8_t* GlslManager::get_input_pixel_pointer( mlt_producer producer, mlt_frame frame ) { return (uint8_t*) get_frame_specific_data( MLT_PRODUCER_SERVICE(producer), frame, "_movit input pp", NULL ); } uint8_t* GlslManager::set_input_pixel_pointer( mlt_producer producer, mlt_frame frame, uint8_t* image ) { set_frame_specific_data( MLT_PRODUCER_SERVICE(producer), frame, "_movit input pp", image, 0, NULL, NULL ); return image; } mlt_service GlslManager::get_effect_input( mlt_service service, mlt_frame frame ) { return (mlt_service) get_frame_specific_data( service, frame, "_movit effect input", NULL ); } void GlslManager::set_effect_input( mlt_service service, mlt_frame frame, mlt_service input_service ) { set_frame_specific_data( service, frame, "_movit effect input", input_service, 0, NULL, NULL ); } void GlslManager::get_effect_secondary_input( mlt_service service, mlt_frame frame, mlt_service *input_service, mlt_frame *input_frame) { *input_service = (mlt_service) get_frame_specific_data( service, frame, "_movit effect secondary input", NULL ); *input_frame = (mlt_frame) get_frame_specific_data( service, frame, "_movit effect secondary input frame", NULL ); } void GlslManager::set_effect_secondary_input( mlt_service service, mlt_frame frame, mlt_service input_service, mlt_frame input_frame ) { set_frame_specific_data( service, frame, "_movit effect secondary input", input_service, 0, NULL, NULL ); set_frame_specific_data( service, frame, "_movit effect secondary input frame", input_frame, 0, NULL, NULL ); } void GlslManager::get_effect_third_input( mlt_service service, mlt_frame frame, mlt_service *input_service, mlt_frame *input_frame) { *input_service = (mlt_service) get_frame_specific_data( service, frame, "_movit effect third input", NULL ); *input_frame = (mlt_frame) get_frame_specific_data( service, frame, "_movit effect third input frame", NULL ); } void GlslManager::set_effect_third_input( mlt_service service, mlt_frame frame, mlt_service input_service, mlt_frame input_frame ) { set_frame_specific_data( service, frame, "_movit effect third input", input_service, 0, NULL, NULL ); set_frame_specific_data( service, frame, "_movit effect third input frame", input_frame, 0, NULL, NULL ); } int GlslManager::render_frame_texture(EffectChain *chain, mlt_frame frame, int width, int height, uint8_t **image) { glsl_texture texture = get_texture( width, height, GL_RGBA8 ); if (!texture) { return 1; } GLuint fbo; glGenFramebuffers( 1, &fbo ); check_error(); glBindFramebuffer( GL_FRAMEBUFFER, fbo ); check_error(); glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->texture, 0 ); check_error(); glBindFramebuffer( GL_FRAMEBUFFER, 0 ); check_error(); lock(); while (syncs_to_delete.count() > 0) { GLsync sync = (GLsync) syncs_to_delete.pop_front(); glDeleteSync( sync ); } unlock(); // Make sure we never have more than one frame pending at any time. // This ensures we do not swamp the GPU with so much work // that we cannot actually display the frames we generate. if (prev_sync != NULL) { glFlush(); glClientWaitSync( prev_sync, 0, GL_TIMEOUT_IGNORED ); glDeleteSync( prev_sync ); } chain->render_to_fbo( fbo, width, height ); prev_sync = glFenceSync( GL_SYNC_GPU_COMMANDS_COMPLETE, 0 ); GLsync sync = glFenceSync( GL_SYNC_GPU_COMMANDS_COMPLETE, 0 ); check_error(); glBindFramebuffer( GL_FRAMEBUFFER, 0 ); check_error(); glDeleteFramebuffers( 1, &fbo ); check_error(); *image = (uint8_t*) &texture->texture; mlt_frame_set_image( frame, *image, 0, NULL ); mlt_properties_set_data( MLT_FRAME_PROPERTIES(frame), "movit.convert.texture", texture, 0, (mlt_destructor) GlslManager::release_texture, NULL ); mlt_properties_set_data( MLT_FRAME_PROPERTIES(frame), "movit.convert.fence", sync, 0, (mlt_destructor) GlslManager::delete_sync, NULL ); return 0; } int GlslManager::render_frame_rgba(EffectChain *chain, mlt_frame frame, int width, int height, uint8_t **image) { glsl_texture texture = get_texture( width, height, GL_RGBA8 ); if (!texture) { return 1; } // Use a PBO to hold the data we read back with glReadPixels(). // (Intel/DRI goes into a slow path if we don't read to PBO.) int img_size = width * height * 4; glsl_pbo pbo = get_pbo( img_size ); if (!pbo) { release_texture(texture); return 1; } // Set the FBO GLuint fbo; glGenFramebuffers( 1, &fbo ); check_error(); glBindFramebuffer( GL_FRAMEBUFFER, fbo ); check_error(); glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->texture, 0 ); check_error(); glBindFramebuffer( GL_FRAMEBUFFER, 0 ); check_error(); chain->render_to_fbo( fbo, width, height ); // Read FBO into PBO glBindFramebuffer( GL_FRAMEBUFFER, fbo ); check_error(); glBindBuffer( GL_PIXEL_PACK_BUFFER_ARB, pbo->pbo ); check_error(); glBufferData( GL_PIXEL_PACK_BUFFER_ARB, img_size, NULL, GL_STREAM_READ ); check_error(); glReadPixels( 0, 0, width, height, GL_BGRA, GL_UNSIGNED_BYTE, BUFFER_OFFSET(0) ); check_error(); // Copy from PBO uint8_t* buf = (uint8_t*) glMapBuffer( GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY ); check_error(); *image = (uint8_t*) mlt_pool_alloc( img_size ); mlt_frame_set_image( frame, *image, img_size, mlt_pool_release ); memcpy( *image, buf, img_size ); // Convert BGRA to RGBA register uint8_t *p = *image; register int n = width * height + 1; while ( --n ) { uint8_t b = p[0]; *p = p[2]; p += 2; *p = b; p += 2; } // Release PBO and FBO glUnmapBuffer( GL_PIXEL_PACK_BUFFER_ARB ); check_error(); glBindBuffer( GL_PIXEL_PACK_BUFFER_ARB, 0 ); check_error(); glBindFramebuffer( GL_FRAMEBUFFER, 0 ); check_error(); glBindTexture( GL_TEXTURE_2D, 0 ); check_error(); mlt_properties_set_data( MLT_FRAME_PROPERTIES(frame), "movit.convert.texture", texture, 0, (mlt_destructor) GlslManager::release_texture, NULL); glDeleteFramebuffers( 1, &fbo ); check_error(); return 0; } void GlslManager::lock_service( mlt_frame frame ) { Mlt::Producer producer( mlt_producer_cut_parent( mlt_frame_get_original_producer( frame ) ) ); producer.lock(); } void GlslManager::unlock_service( mlt_frame frame ) { Mlt::Producer producer( mlt_producer_cut_parent( mlt_frame_get_original_producer( frame ) ) ); producer.unlock(); }
xzhavilla/mlt
src/modules/opengl/filter_glsl_manager.cpp
C++
lgpl-2.1
15,812
package org.wingx; import java.awt.Color; import org.wings.*; import org.wings.style.CSSAttributeSet; import org.wings.style.CSSProperty; import org.wings.style.CSSStyle; import org.wings.style.CSSStyleSheet; import org.wings.style.Selector; import org.wings.style.Style; public class XDivision extends SContainer implements LowLevelEventListener { String title; SIcon icon; /** * Is the XDivision shaded? */ boolean shaded; /** * Is the title clickable? Default is false. */ protected boolean isTitleClickable = false; public static final Selector SELECTOR_TITLE = new Selector("xdiv.title"); /** * Creates a XDivision instance with the specified LayoutManager * @param l the LayoutManager */ public XDivision(SLayoutManager l) { super(l); } /** * Creates a XDivision instance */ public XDivision() { } public XDivision(String title) { this.title = title; } /** * Returns the title of the XDivision. * @return String the title */ public String getTitle() { return title; } /** * Sets the title of the XDivision. * @param title the title */ public void setTitle(String title) { String oldVal = this.title; reloadIfChange(this.title, title); this.title = title; propertyChangeSupport.firePropertyChange("title", oldVal, this.title); } /** * Sets the title-font of the XDivision. * @param titleFont the font for the title */ public void setTitleFont( org.wings.SFont titleFont) { SFont oldVal = this.getTitleFont(); CSSAttributeSet attributes = CSSStyleSheet.getAttributes(titleFont); Style style = getDynamicStyle(SELECTOR_TITLE); if (style == null) { addDynamicStyle(new CSSStyle(SELECTOR_TITLE, attributes)); } else { style.remove(CSSProperty.FONT); style.remove(CSSProperty.FONT_FAMILY); style.remove(CSSProperty.FONT_SIZE); style.remove(CSSProperty.FONT_STYLE); style.remove(CSSProperty.FONT_WEIGHT); style.putAll(attributes); } propertyChangeSupport.firePropertyChange("titleFont", oldVal, this.getTitleFont()); } /** * Returns the title-font of the XDivision. * @return SFont the font for the title */ public SFont getTitleFont() { return dynamicStyles == null || dynamicStyles.get(SELECTOR_TITLE) == null ? null : CSSStyleSheet.getFont((CSSAttributeSet) dynamicStyles.get(SELECTOR_TITLE)); } /** * Sets the title-color of the XDivision. * @param titleColor the color for the title */ public void setTitleColor( Color titleColor ) { Color oldVal = this.getTitleColor(); setAttribute( SELECTOR_TITLE, CSSProperty.COLOR, CSSStyleSheet.getAttribute( titleColor ) ); propertyChangeSupport.firePropertyChange("titleColor", oldVal, this.getTitleColor()); } /** * Returns the title-color of the XDivision. * @return titleColor the color for the title */ public Color getTitleColor() { return dynamicStyles == null || dynamicStyles.get(SELECTOR_TITLE) == null ? null : CSSStyleSheet.getForeground((CSSAttributeSet) dynamicStyles.get(SELECTOR_TITLE)); } /** * Determines whether or not the title is clickable. * @param clickable true if the title is clickable */ public void setTitleClickable( boolean clickable ) { boolean oldVal = this.isTitleClickable; this.isTitleClickable = clickable; propertyChangeSupport.firePropertyChange("titleClickable", oldVal, this.isTitleClickable); } /** * Returns true if the title is clickable. * @return boolean true if the title is clickable */ public boolean isTitleClickable() { return this.isTitleClickable; } public SIcon getIcon() { return icon; } public void setIcon(SIcon icon) { SIcon oldVal = this.icon; reloadIfChange(this.icon, icon); this.icon = icon; propertyChangeSupport.firePropertyChange("icon", oldVal, this.icon); } /** * Returns true if the XDivision is shaded. * @return boolean true if the XDivision is shaded */ public boolean isShaded() { return shaded; } /** * Determines whether or not the XDivision is shaded. * @param shaded true if the XDivision is shaded */ public void setShaded(boolean shaded) { if (this.shaded != shaded) { reload(); this.shaded = shaded; propertyChangeSupport.firePropertyChange("shaded", !this.shaded, this.shaded); setRecursivelyVisible(isRecursivelyVisible()); } } @Override public void processLowLevelEvent(String name, String... values) { if (values.length == 1 && "t".equals(values[0])) { setShaded(!shaded); } /* TODO: first focusable component if (!shaded && getComponentCount() > 0) getComponent(0).requestFocus(); else requestFocus(); */ } @Override public void fireIntermediateEvents() { } @Override public boolean isEpochCheckEnabled() { return false; } @Override protected boolean isShowingChildren() { return !shaded; } }
dheid/wings3
wingx/src/main/java/org/wingx/XDivision.java
Java
lgpl-2.1
5,529
/* * $Id: IpWatch.java 3905 2008-07-28 13:55:03Z uckelman $ * * Copyright (c) 2007-2008 by Rodney Kinney * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License (LGPL) 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, copies are available * at http://www.opensource.org. */ package VASSAL.chat.peer2peer; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.net.InetAddress; import java.net.UnknownHostException; public class IpWatch implements Runnable { private PropertyChangeSupport propSupport = new PropertyChangeSupport(this); private String currentIp; private long wait = 1000; public IpWatch(long waitInterval) { wait = waitInterval; currentIp = findIp(); } public IpWatch() { this(1000); } public void addPropertyChangeListener(PropertyChangeListener l) { propSupport.addPropertyChangeListener(l); } public void run() { while (true) { String newIp = findIp(); propSupport.firePropertyChange("address", currentIp, newIp); //$NON-NLS-1$ currentIp = newIp; try { Thread.sleep(wait); } catch (InterruptedException ex) { } } } public String getCurrentIp() { return currentIp; } private String findIp() { try { InetAddress a[] = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName()); final StringBuilder buff = new StringBuilder(); for (int i = 0; i < a.length; ++i) { buff.append(a[i].getHostAddress()); if (i < a.length - 1) { buff.append(","); //$NON-NLS-1$ } } return buff.toString(); } // FIXME: review error message catch (UnknownHostException e) { return null; } } public static void main(String[] args) { IpWatch w = new IpWatch(); w.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { System.out.println("Address = " + evt.getNewValue()); //$NON-NLS-1$ } }); System.out.println("Address = " + w.getCurrentIp()); //$NON-NLS-1$ new Thread(w).start(); } }
caiusb/vassal
src/VASSAL/chat/peer2peer/IpWatch.java
Java
lgpl-2.1
2,630
/** * Copyright (C) 2013 Rohan Padhye * * 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 program. If not, see <http://www.gnu.org/licenses/>. * */ package vasco.soot.examples; import java.util.Map; import org.junit.Test; import soot.Local; import soot.PackManager; import soot.SceneTransformer; import soot.SootMethod; import soot.Transform; import soot.Unit; import vasco.DataFlowSolution; import vasco.soot.examples.SignAnalysis.Sign; /** * A Soot {@link SceneTransformer} for performing {@link SignAnalysis}. * * @author Rohan Padhye */ public class SignTest extends SceneTransformer { private SignAnalysis analysis; @Override protected void internalTransform(String arg0, @SuppressWarnings("rawtypes") Map arg1) { analysis = new SignAnalysis(); analysis.doAnalysis(); DataFlowSolution<Unit,Map<Local,Sign>> solution = analysis.getMeetOverValidPathsSolution(); System.out.println("----------------------------------------------------------------"); for (SootMethod sootMethod : analysis.getMethods()) { System.out.println(sootMethod); for (Unit unit : sootMethod.getActiveBody().getUnits()) { System.out.println("----------------------------------------------------------------"); System.out.println(unit); System.out.println("IN: " + formatConstants(solution.getValueBefore(unit))); System.out.println("OUT: " + formatConstants(solution.getValueAfter(unit))); } System.out.println("----------------------------------------------------------------"); } } public static String formatConstants(Map<Local, Sign> value) { if (value == null) { return ""; } StringBuffer sb = new StringBuffer(); for (Map.Entry<Local,Sign> entry : value.entrySet()) { Local local = entry.getKey(); Sign sign = entry.getValue(); if (sign != null) { sb.append("(").append(local).append(": ").append(sign.toString()).append(") "); } } return sb.toString(); } public SignAnalysis getAnalysis() { return analysis; } public static void main(String args[]) { String classPath = System.getProperty("java.class.path"); String mainClass = null; /* ------------------- OPTIONS ---------------------- */ try { int i=0; while(true){ if (args[i].equals("-cp")) { classPath = args[i+1]; i += 2; } else { mainClass = args[i]; i++; break; } } if (i != args.length || mainClass == null) throw new Exception(); } catch (Exception e) { System.err.println("Usage: java SignTest [-cp CLASSPATH] MAIN_CLASS"); System.exit(1); } String[] sootArgs = { "-cp", classPath, "-pp", "-w", "-app", "-keep-line-number", "-keep-bytecode-offset", "-p", "jb", "use-original-names", "-p", "cg", "implicit-entry:false", "-p", "cg.spark", "enabled", "-p", "cg.spark", "simulate-natives", "-p", "cg", "safe-forname", "-p", "cg", "safe-newinstance", "-main-class", mainClass, "-f", "none", mainClass }; SignTest sgn = new SignTest(); PackManager.v().getPack("wjtp").add(new Transform("wjtp.sgn", sgn)); soot.Main.main(sootArgs); } @Test public void testSignAnalysis() { // TODO: Compare output with an ideal (expected) output SignTest.main(new String[]{"vasco.tests.SignTestCase"}); } }
rohanpadhye/vasco
src/test/java/vasco/soot/examples/SignTest.java
Java
lgpl-2.1
3,854
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** 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 [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef S60CCAMERAENGINE_H #define S60CCAMERAENGINE_H // INCLUDES #include <e32base.h> #include <ecam.h> // for MCameraObserver(2) #ifdef S60_CAM_AUTOFOCUS_SUPPORT #include <ccamautofocus.h> // for CCamAutoFocus, MCamAutoFocusObserver #endif // FORWARD DECLARATIONS class MCameraEngineObserver; class MCameraEngineImageCaptureObserver; class MAdvancedSettingsObserver; class MCameraViewfinderObserver; /* * CameraEngine handling ECam operations needed. */ NONSHARABLE_CLASS( CCameraEngine ) : public CBase, public MCameraObserver, public MCameraObserver2 #ifdef S60_CAM_AUTOFOCUS_SUPPORT ,public MCamAutoFocusObserver #endif { public: // Enums enum TCameraEngineState { EEngineNotReady = 0, // 0 - No resources reserved EEngineInitializing, // 1 - Reserving and Powering On EEngineIdle, // 2 - Reseved and Powered On EEngineCapturing, // 3 - Capturing Still Image EEngineFocusing // 4 - Focusing }; public: // Constructor & Destructor static CCameraEngine* NewL( TInt aCameraHandle, TInt aPriority, MCameraEngineObserver* aObserver ); ~CCameraEngine(); public: /** * External Advanced Settings callback observer. */ void SetAdvancedObserver(MAdvancedSettingsObserver *aAdvancedSettingsObserver); /** * External Image Capture callback observer. */ void SetImageCaptureObserver(MCameraEngineImageCaptureObserver *aImageCaptureObserver); /** * External Viewfinder callback observer. */ void SetViewfinderObserver(MCameraViewfinderObserver *aViewfinderObserver); /** * Static function that returns the number of cameras on the device. */ static TInt CamerasAvailable(); /** * Returns the index of the currently active camera device */ TInt currentCameraIndex() const { return iCameraIndex; } /** * Returns the current state (TCameraEngineState) * of the camera engine. */ TCameraEngineState State() const { return iEngineState; } /** * Returns true if the camera has been reserved and * powered on, and not recording or capturing image */ TBool IsCameraReady() const; /** * Returns whether DirectScreen ViewFinder is supported by the platform */ TBool IsDirectViewFinderSupported() const; /** * Returns true if the camera supports AutoFocus. */ TBool IsAutoFocusSupported() const; /** * Returns camera info */ TCameraInfo *cameraInfo(); /** * Captures an image. When complete, observer will receive * MceoCapturedDataReady() or MceoCapturedBitmapReady() callback, * depending on which image format was used in PrepareL(). * @leave May leave with KErrNotReady if camera is not * reserved or prepared for capture. */ void CaptureL(); /** * Cancels ongoing image capture */ void cancelCapture(); /** * Reserves and powers on the camera. When complete, * observer will receive MceoCameraReady() callback * */ void ReserveAndPowerOn(); /** * Releases and powers off the camera * */ void ReleaseAndPowerOff(); /** * Prepares for image capture. * @param aCaptureSize requested capture size. On return, * contains the selected size (closest match) * @param aFormat Image format to use. Default is JPEG with * EXIF information as provided by the camera module * @leave KErrNotSupported, KErrNoMemory, KErrNotReady */ void PrepareL( TSize& aCaptureSize, CCamera::TFormat aFormat = CCamera::EFormatExif ); /** * Starts the viewfinder. Observer will receive * MceoViewFinderFrameReady() callbacks periodically. * @param aSize requested viewfinder size. On return, * contains the selected size. * * @leave KErrNotSupported is viewfinding with bitmaps is not * supported, KErrNotReady */ void StartViewFinderL( TSize& aSize ); /** * Stops the viewfinder if active. */ void StopViewFinder(); void StartDirectViewFinderL(RWsSession& aSession, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, TRect& aSize); /** * Releases memory for the last received viewfinder frame. * Client must call this in response to MceoViewFinderFrameReady() * callback, after drawing the viewfinder frame is complete. */ void ReleaseViewFinderBuffer(); /** * Releases memory for the last captured image. * Client must call this in response to MceoCapturedDataReady() * or MceoCapturedBitmapReady()callback, after processing the * data/bitmap is complete. */ void ReleaseImageBuffer(); /** * Starts focusing. Does nothing if AutoFocus is not supported. * When complete, observer will receive MceoFocusComplete() * callback. * @leave KErrInUse, KErrNotReady */ void StartFocusL(); /** * Cancels the ongoing focusing operation. */ void FocusCancel(); /** * Gets a bitfield of supported focus ranges. * @param aSupportedRanges a bitfield of either TAutoFocusRange * (S60 3.0/3.1 devices) or TFocusRange (S60 3.2 and onwards) values */ void SupportedFocusRanges( TInt& aSupportedRanges ) const; /** * Sets the focus range * @param aFocusRange one of the values returned by * SupportedFocusRanges(). */ void SetFocusRange( TInt aFocusRange ); /** * Returns a pointer to CCamera object used by the engine. * Allows getting access to additional functionality * from CCamera - do not use for functionality already provided * by CCameraEngine methods. */ CCamera* Camera() { return iCamera; } protected: // Protected constructors CCameraEngine(); CCameraEngine( TInt aCameraHandle, TInt aPriority, MCameraEngineObserver* aObserver ); void ConstructL(); protected: // MCameraObserver /** * From MCameraObserver * Gets called when CCamera::Reserve() is completed. * (V2: Called internally from HandleEvent) */ virtual void ReserveComplete(TInt aError); /** * From MCameraObserver. * Gets called when CCamera::PowerOn() is completed. * (V2: Called internally from HandleEvent) */ virtual void PowerOnComplete(TInt aError); /** * From MCameraObserver. * Gets called when CCamera::StartViewFinderBitmapsL() is completed. * (V2: Called internally from ViewFinderReady) */ virtual void ViewFinderFrameReady( CFbsBitmap& aFrame ); /** * From MCameraObserver. * Gets called when CCamera::CaptureImage() is completed. */ virtual void ImageReady( CFbsBitmap* aBitmap, HBufC8* aData, TInt aError ); /** * From MCameraObserver. * Video capture not implemented. */ virtual void FrameBufferReady( MFrameBuffer* /*aFrameBuffer*/, TInt /*aError*/ ) {} protected: // MCameraObserver2 /** * From MCameraObserver2 * Camera event handler */ virtual void HandleEvent(const TECAMEvent &aEvent); /** * From MCameraObserver2 * Notifies the client of new viewfinder data */ virtual void ViewFinderReady(MCameraBuffer &aCameraBuffer, TInt aError); /** * From MCameraObserver2 * Notifies the client of a new captured image */ virtual void ImageBufferReady(MCameraBuffer &aCameraBuffer, TInt aError); /** * From MCameraObserver2 * Video capture not implemented. */ virtual void VideoBufferReady(MCameraBuffer& /*aCameraBuffer*/, TInt /*aError*/) {} protected: // MCamAutoFocusObserver /** * From MCamAutoFocusObserver. * Delivers notification of completion of auto focus initialisation to * an interested party. * @param aError Reason for completion of focus request. */ virtual void InitComplete( TInt aError ); /** * From MCamAutoFocusObserver. * Gets called when CCamAutoFocus::AttemptOptimisedFocusL() is * completed. * (V2: Called internally from HandleEvent) */ virtual void OptimisedFocusComplete( TInt aError ); private: // Internal functions /** * Internal function to handle ImageReady callbacks from * both observer (V1 & V2) interfaces */ void HandleImageReady(const TInt aError, const bool isBitmap); private: // Data CCamera *iCamera; MCameraEngineObserver *iObserver; MCameraEngineImageCaptureObserver *iImageCaptureObserver; MAdvancedSettingsObserver *iAdvancedSettingsObserver; MCameraViewfinderObserver *iViewfinderObserver; MCameraBuffer *iViewFinderBuffer; /* * Following pointers are for the image buffers: * * Makes buffering of 2 concurrent image buffers possible */ MCameraBuffer *iImageBuffer1; MCameraBuffer *iImageBuffer2; TDesC8 *iImageData1; TDesC8 *iImageData2; CFbsBitmap *iImageBitmap1; CFbsBitmap *iImageBitmap2; TInt iCameraIndex; TInt iPriority; TCameraEngineState iEngineState; TCameraInfo iCameraInfo; CCamera::TFormat iImageCaptureFormat; bool iNew2LImplementation; int iLatestImageBufferIndex; // 0 = Buffer1, 1 = Buffer2 #ifdef S60_CAM_AUTOFOCUS_SUPPORT CCamAutoFocus* iAutoFocus; CCamAutoFocus::TAutoFocusRange iAFRange; #endif // S60_CAM_AUTOFOCUS_SUPPORT }; #endif // S60CCAMERAENGINE_H
robclark/qtmobility-1.1.0
plugins/multimedia/symbian/ecam/s60cameraengine.h
C
lgpl-2.1
12,226
<?php return header("HTTP/1.0 404 Not Found"); exit(); //Negar navegação | Deny navigation ?>{"who":"self","uniqid":"112155911efbb463150.09462133","number":74,"group":{"a":"8.61714409","b":"0.21359590","c":"2.62739917"},"unid":15,"collection":{"item":{"group":{"test":{"0":51,"1":2,"2":5,"gnulid":999}},"id":"$2y$10$b6bdf540lpjxsd0hgrtlx.emg\/pkce5laa.ul\/n1cc5qhl4voffou"}},"id":95}
darkziul/phpFlatFileDB
example/.data.flat/example.db/default.tb/c2b21c54.php
PHP
lgpl-2.1
385
#include "clar_libgit2.h" #include "git2/sys/repository.h" #include "fileops.h" #include "ignore.h" #include "status_helpers.h" #include "posix.h" #include "util.h" #include "path.h" static void cleanup_new_repo(void *path) { cl_fixture_cleanup((char *)path); } void test_status_worktree_init__cannot_retrieve_the_status_of_a_bare_repository(void) { git_repository *repo; unsigned int status = 0; cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); cl_assert_equal_i(GIT_EBAREREPO, git_status_file(&status, repo, "dummy")); git_repository_free(repo); } void test_status_worktree_init__first_commit_in_progress(void) { git_repository *repo; git_index *index; status_entry_single result; cl_set_cleanup(&cleanup_new_repo, "getting_started"); cl_git_pass(git_repository_init(&repo, "getting_started", 0)); cl_git_mkfile("getting_started/testfile.txt", "content\n"); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(1, result.count); cl_assert(result.status == GIT_STATUS_WT_NEW); cl_git_pass(git_repository_index(&index, repo)); cl_git_pass(git_index_add_bypath(index, "testfile.txt")); cl_git_pass(git_index_write(index)); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(1, result.count); cl_assert(result.status == GIT_STATUS_INDEX_NEW); git_index_free(index); git_repository_free(repo); } void test_status_worktree_init__status_file_without_index_or_workdir(void) { git_repository *repo; unsigned int status = 0; git_index *index; cl_git_pass(p_mkdir("wd", 0777)); cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); cl_git_pass(git_repository_set_workdir(repo, "wd", false)); cl_git_pass(git_index_open(&index, "empty-index")); cl_assert_equal_i(0, (int)git_index_entrycount(index)); git_repository_set_index(repo, index); cl_git_pass(git_status_file(&status, repo, "branch_file.txt")); cl_assert_equal_i(GIT_STATUS_INDEX_DELETED, status); git_repository_free(repo); git_index_free(index); cl_git_pass(p_rmdir("wd")); } static void fill_index_wth_head_entries(git_repository *repo, git_index *index) { git_oid oid; git_commit *commit; git_tree *tree; cl_git_pass(git_reference_name_to_id(&oid, repo, "HEAD")); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_commit_tree(&tree, commit)); cl_git_pass(git_index_read_tree(index, tree)); cl_git_pass(git_index_write(index)); git_tree_free(tree); git_commit_free(commit); } void test_status_worktree_init__status_file_with_clean_index_and_empty_workdir(void) { git_repository *repo; unsigned int status = 0; git_index *index; cl_git_pass(p_mkdir("wd", 0777)); cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); cl_git_pass(git_repository_set_workdir(repo, "wd", false)); cl_git_pass(git_index_open(&index, "my-index")); fill_index_wth_head_entries(repo, index); git_repository_set_index(repo, index); cl_git_pass(git_status_file(&status, repo, "branch_file.txt")); cl_assert_equal_i(GIT_STATUS_WT_DELETED, status); git_repository_free(repo); git_index_free(index); cl_git_pass(p_rmdir("wd")); cl_git_pass(p_unlink("my-index")); } void test_status_worktree_init__bracket_in_filename(void) { git_repository *repo; git_index *index; status_entry_single result; unsigned int status_flags; int error; #define FILE_WITH_BRACKET "LICENSE[1].md" #define FILE_WITHOUT_BRACKET "LICENSE1.md" cl_set_cleanup(&cleanup_new_repo, "with_bracket"); cl_git_pass(git_repository_init(&repo, "with_bracket", 0)); cl_git_mkfile("with_bracket/" FILE_WITH_BRACKET, "I have a bracket in my name\n"); /* file is new to working directory */ memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(1, result.count); cl_assert(result.status == GIT_STATUS_WT_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_BRACKET)); cl_assert(status_flags == GIT_STATUS_WT_NEW); /* ignore the file */ cl_git_rewritefile("with_bracket/.gitignore", "*.md\n.gitignore\n"); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(2, result.count); cl_assert(result.status == GIT_STATUS_IGNORED); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_BRACKET)); cl_assert(status_flags == GIT_STATUS_IGNORED); /* don't ignore the file */ cl_git_rewritefile("with_bracket/.gitignore", ".gitignore\n"); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(2, result.count); cl_assert(result.status == GIT_STATUS_WT_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_BRACKET)); cl_assert(status_flags == GIT_STATUS_WT_NEW); /* add the file to the index */ cl_git_pass(git_repository_index(&index, repo)); cl_git_pass(git_index_add_bypath(index, FILE_WITH_BRACKET)); cl_git_pass(git_index_write(index)); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(2, result.count); cl_assert(result.status == GIT_STATUS_INDEX_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_BRACKET)); cl_assert(status_flags == GIT_STATUS_INDEX_NEW); /* Create file without bracket */ cl_git_mkfile("with_bracket/" FILE_WITHOUT_BRACKET, "I have no bracket in my name!\n"); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITHOUT_BRACKET)); cl_assert(status_flags == GIT_STATUS_WT_NEW); cl_git_pass(git_status_file(&status_flags, repo, "LICENSE\\[1\\].md")); cl_assert(status_flags == GIT_STATUS_INDEX_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_BRACKET)); git_index_free(index); git_repository_free(repo); } void test_status_worktree_init__space_in_filename(void) { git_repository *repo; git_index *index; status_entry_single result; unsigned int status_flags; #define FILE_WITH_SPACE "LICENSE - copy.md" cl_set_cleanup(&cleanup_new_repo, "with_space"); cl_git_pass(git_repository_init(&repo, "with_space", 0)); cl_git_mkfile("with_space/" FILE_WITH_SPACE, "I have a space in my name\n"); /* file is new to working directory */ memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(1, result.count); cl_assert(result.status == GIT_STATUS_WT_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_SPACE)); cl_assert(status_flags == GIT_STATUS_WT_NEW); /* ignore the file */ cl_git_rewritefile("with_space/.gitignore", "*.md\n.gitignore\n"); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(2, result.count); cl_assert(result.status == GIT_STATUS_IGNORED); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_SPACE)); cl_assert(status_flags == GIT_STATUS_IGNORED); /* don't ignore the file */ cl_git_rewritefile("with_space/.gitignore", ".gitignore\n"); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(2, result.count); cl_assert(result.status == GIT_STATUS_WT_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_SPACE)); cl_assert(status_flags == GIT_STATUS_WT_NEW); /* add the file to the index */ cl_git_pass(git_repository_index(&index, repo)); cl_git_pass(git_index_add_bypath(index, FILE_WITH_SPACE)); cl_git_pass(git_index_write(index)); memset(&result, 0, sizeof(result)); cl_git_pass(git_status_foreach(repo, cb_status__single, &result)); cl_assert_equal_i(2, result.count); cl_assert(result.status == GIT_STATUS_INDEX_NEW); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_SPACE)); cl_assert(status_flags == GIT_STATUS_INDEX_NEW); git_index_free(index); git_repository_free(repo); } static int cb_status__expected_path(const char *p, unsigned int s, void *payload) { const char *expected_path = (const char *)payload; GIT_UNUSED(s); if (payload == NULL) cl_fail("Unexpected path"); cl_assert_equal_s(expected_path, p); return 0; } void test_status_worktree_init__disable_pathspec_match(void) { git_repository *repo; git_status_options opts = GIT_STATUS_OPTIONS_INIT; char *file_with_bracket = "LICENSE[1].md", *imaginary_file_with_bracket = "LICENSE[1-2].md"; cl_set_cleanup(&cleanup_new_repo, "pathspec"); cl_git_pass(git_repository_init(&repo, "pathspec", 0)); cl_git_mkfile("pathspec/LICENSE[1].md", "screaming bracket\n"); cl_git_mkfile("pathspec/LICENSE1.md", "no bracket\n"); opts.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH; opts.pathspec.count = 1; opts.pathspec.strings = &file_with_bracket; cl_git_pass( git_status_foreach_ext(repo, &opts, cb_status__expected_path, file_with_bracket) ); /* Test passing a pathspec matching files in the workdir. */ /* Must not match because pathspecs are disabled. */ opts.pathspec.strings = &imaginary_file_with_bracket; cl_git_pass( git_status_foreach_ext(repo, &opts, cb_status__expected_path, NULL) ); git_repository_free(repo); } void test_status_worktree_init__new_staged_file_must_handle_crlf(void) { git_repository *repo; git_index *index; unsigned int status; cl_set_cleanup(&cleanup_new_repo, "getting_started"); cl_git_pass(git_repository_init(&repo, "getting_started", 0)); /* Ensure that repo has core.autocrlf=true */ cl_repo_set_bool(repo, "core.autocrlf", true); cl_git_mkfile("getting_started/testfile.txt", "content\r\n"); /* Content with CRLF */ cl_git_pass(git_repository_index(&index, repo)); cl_git_pass(git_index_add_bypath(index, "testfile.txt")); cl_git_pass(git_index_write(index)); cl_git_pass(git_status_file(&status, repo, "testfile.txt")); cl_assert_equal_i(GIT_STATUS_INDEX_NEW, status); git_index_free(index); git_repository_free(repo); }
raybrad/libit2
tests/status/worktree_init.c
C
lgpl-2.1
10,050
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_40) on Wed Feb 10 11:30:31 CST 2016 --> <title>CurrentTenantIdentifierResolver (Hibernate JavaDocs)</title> <meta name="date" content="2016-02-10"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="CurrentTenantIdentifierResolver (Hibernate JavaDocs)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/CurrentTenantIdentifierResolver.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/hibernate/context/spi/CurrentSessionContext.html" title="interface in org.hibernate.context.spi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/hibernate/context/spi/CurrentTenantIdentifierResolver.html" target="_top">Frames</a></li> <li><a href="CurrentTenantIdentifierResolver.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.hibernate.context.spi</div> <h2 title="Interface CurrentTenantIdentifierResolver" class="title">Interface CurrentTenantIdentifierResolver</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public interface <span class="typeNameLabel">CurrentTenantIdentifierResolver</span></pre> <div class="block">A callback registered with the <a href="../../../../org/hibernate/SessionFactory.html" title="interface in org.hibernate"><code>SessionFactory</code></a> that is responsible for resolving the current tenant identifier for use with <a href="../../../../org/hibernate/context/spi/CurrentSessionContext.html" title="interface in org.hibernate.context.spi"><code>CurrentSessionContext</code></a> and <a href="../../../../org/hibernate/SessionFactory.html#getCurrentSession--"><code>SessionFactory.getCurrentSession()</code></a></div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/hibernate/context/spi/CurrentTenantIdentifierResolver.html#resolveCurrentTenantIdentifier--">resolveCurrentTenantIdentifier</a></span>()</code> <div class="block">Resolve the current tenant identifier.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/hibernate/context/spi/CurrentTenantIdentifierResolver.html#validateExistingCurrentSessions--">validateExistingCurrentSessions</a></span>()</code> <div class="block">Should we validate that the tenant identifier on "current sessions" that already exist when <a href="../../../../org/hibernate/context/spi/CurrentSessionContext.html#currentSession--"><code>CurrentSessionContext.currentSession()</code></a> is called matches the value returned here from <a href="../../../../org/hibernate/context/spi/CurrentTenantIdentifierResolver.html#resolveCurrentTenantIdentifier--"><code>resolveCurrentTenantIdentifier()</code></a>?</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="resolveCurrentTenantIdentifier--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>resolveCurrentTenantIdentifier</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;resolveCurrentTenantIdentifier()</pre> <div class="block">Resolve the current tenant identifier.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The current tenant identifier</dd> </dl> </li> </ul> <a name="validateExistingCurrentSessions--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>validateExistingCurrentSessions</h4> <pre>boolean&nbsp;validateExistingCurrentSessions()</pre> <div class="block">Should we validate that the tenant identifier on "current sessions" that already exist when <a href="../../../../org/hibernate/context/spi/CurrentSessionContext.html#currentSession--"><code>CurrentSessionContext.currentSession()</code></a> is called matches the value returned here from <a href="../../../../org/hibernate/context/spi/CurrentTenantIdentifierResolver.html#resolveCurrentTenantIdentifier--"><code>resolveCurrentTenantIdentifier()</code></a>?</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> indicates that the extra validation will be performed; <code>false</code> indicates it will not.</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../org/hibernate/context/TenantIdentifierMismatchException.html" title="class in org.hibernate.context"><code>TenantIdentifierMismatchException</code></a></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/CurrentTenantIdentifierResolver.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/hibernate/context/spi/CurrentSessionContext.html" title="interface in org.hibernate.context.spi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/hibernate/context/spi/CurrentTenantIdentifierResolver.html" target="_top">Frames</a></li> <li><a href="CurrentTenantIdentifierResolver.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2001-2016 <a href="http://redhat.com">Red Hat, Inc.</a> All Rights Reserved.</small></p> </body> </html>
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/documentation/javadocs/org/hibernate/context/spi/CurrentTenantIdentifierResolver.html
HTML
lgpl-2.1
10,677
/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at [email protected]. ** ** 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 ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef MABSTRACTWIDGETANIMATION_H #define MABSTRACTWIDGETANIMATION_H #include <mabstractwidgetanimationstyle.h> #include <mparallelanimationgroup.h> class MAbstractWidgetAnimationPrivate; /*! \class MAbstractWidgetAnimation \brief MAbstractWidgetAnimation class is a base class for all widget animations. */ class M_CORE_EXPORT MAbstractWidgetAnimation : public MParallelAnimationGroup { Q_OBJECT Q_DECLARE_PRIVATE(MAbstractWidgetAnimation) M_ANIMATION_GROUP(MAbstractWidgetAnimationStyle) protected: /*! \brief Constructs the widget animation. This constructor is meant to be used inside the libmeegotouch to share the private data class pointer. */ MAbstractWidgetAnimation(MAbstractWidgetAnimationPrivate *dd, QObject *parent); public: /*! * This enum defines the direction of the widget animation. */ enum TransitionDirection { In, //!< transitioning into the screen/display Out //!< transitioning out of the screen/display }; /*! \brief Constructs the widget animation. */ MAbstractWidgetAnimation(QObject *parent = NULL); /*! \brief Destructs the widget animation. */ virtual ~MAbstractWidgetAnimation(); /*! Restores the properties of the target widget back to their original state, before the animation changed them. */ virtual void restoreTargetWidgetState() = 0; virtual void setTargetWidget(MWidgetController *widget); virtual void setTransitionDirection(MAbstractWidgetAnimation::TransitionDirection direction) = 0; MWidgetController *targetWidget(); const MWidgetController *targetWidget() const; }; #endif
dudochkin-victor/libgogootouch
src/corelib/animation/widget/core/mabstractwidgetanimation.h
C
lgpl-2.1
2,451
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation ([email protected]) ** ** 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. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef OPENWITHDIALOG_H #define OPENWITHDIALOG_H #include <QtGui/QDialog> #include "ui_openwithdialog.h" namespace Core { class ICore; namespace Internal { // Present the user with a file name and a list of available // editor kinds to choose from. class OpenWithDialog : public QDialog, public Ui::OpenWithDialog { Q_OBJECT public: OpenWithDialog(const QString &fileName, QWidget *parent); void setEditors(const QStringList &); QString editor() const; void setCurrentEditor(int index); private slots: void currentItemChanged(QListWidgetItem *, QListWidgetItem *); private: void setOkButtonEnabled(bool); }; } // namespace Internal } // namespace Core #endif // OPENWITHDIALOG_H
enricoros/k-qt-creator-inspector
src/plugins/coreplugin/dialogs/openwithdialog.h
C
lgpl-2.1
1,946
/***************************************************************** JADE - Java Agent DEvelopment Framework is a framework to develop multi-agent systems in compliance with the FIPA specifications. Copyright (C) 2000 CSELT S.p.A. GNU Lesser General Public License 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. *****************************************************************/ package examples.O2AInterface; import jade.core.Runtime; import jade.core.Profile; import jade.core.ProfileImpl; import jade.wrapper.*; /** * This class shows an example of how to run JADE as a library from an external program * and in particular how to start an agent and interact with it by means of the * Object-to-Agent (O2A) interface. * * @author Giovanni Iavarone - Michele Izzo */ public class O2AInterfaceExample { public static void main(String[] args) throws StaleProxyException, InterruptedException { // Get a hold to the JADE runtime Runtime rt = Runtime.instance(); // Launch the Main Container (with the administration GUI on top) listening on port 8888 System.out.println(">>>>>>>>>>>>>>> Launching the platform Main Container..."); Profile pMain = new ProfileImpl(null, 8888, null); pMain.setParameter(Profile.GUI, "true"); ContainerController mainCtrl = rt.createMainContainer(pMain); // Create and start an agent of class CounterAgent System.out.println(">>>>>>>>>>>>>>> Starting up a CounterAgent..."); AgentController agentCtrl = mainCtrl.createNewAgent("CounterAgent", CounterAgent.class.getName(), new Object[0]); agentCtrl.start(); // Wait a bit System.out.println(">>>>>>>>>>>>>>> Wait a bit..."); Thread.sleep(10000); try { // Retrieve O2A interface CounterManager1 exposed by the agent to make it activate the counter System.out.println(">>>>>>>>>>>>>>> Activate counter"); CounterManager1 o2a1 = agentCtrl.getO2AInterface(CounterManager1.class); o2a1.activateCounter(); // Wait a bit System.out.println(">>>>>>>>>>>>>>> Wait a bit..."); Thread.sleep(30000); // Retrieve O2A interface CounterManager2 exposed by the agent to make it de-activate the counter System.out.println(">>>>>>>>>>>>>>> Deactivate counter"); CounterManager2 o2a2 = agentCtrl.getO2AInterface(CounterManager2.class); o2a2.deactivateCounter(); } catch (StaleProxyException e) { e.printStackTrace(); } } }
ekiwi/jade-mirror
src/examples/O2AInterface/O2AInterfaceExample.java
Java
lgpl-2.1
3,081
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace PubComp.Caching.Core.UnitTests { // http://softwareonastring.com/502/testing-every-implementer-of-an-interface-with-the-same-tests-using-mstest [TestClass] public abstract class CacheInterfaceTests { protected abstract ICache GetCache(string name); protected abstract ICache GetCacheWithSlidingExpiration(string name, TimeSpan slidingExpiration); protected abstract ICache GetCacheWithExpirationFromAdd(string name, TimeSpan expirationFromAdd); protected abstract ICache GetCacheWithAbsoluteExpiration(string name, DateTimeOffset expireAt); private IDisposable cacheDirectives; [TestInitialize] public void TestInitialize() { cacheDirectives = CacheDirectives.SetScope(CacheMethod.GetOrSet, DateTimeOffset.UtcNow); } [TestCleanup] public void TestCleanup() { cacheDirectives?.Dispose(); cacheDirectives = null; } [TestMethod] public void TestCacheStruct() { var cache = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache.ClearAll(); int hits = 0; Func<int> getter = () => { hits++; return hits; }; int result; result = cache.Get("key", getter); Assert.AreEqual(1, hits); Assert.AreEqual(1, result); result = cache.Get("key", getter); Assert.AreEqual(1, hits); Assert.AreEqual(1, result); } [TestMethod] public void TestCacheObject() { var cache = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache.ClearAll(); int hits = 0; Func<string> getter = () => { hits++; return hits.ToString(); }; string result; result = cache.Get("key", getter); Assert.AreEqual(1, hits); Assert.AreEqual("1", result); result = cache.Get("key", getter); Assert.AreEqual(1, hits); Assert.AreEqual("1", result); } [TestMethod] public async Task TestCacheObjectAsync() { var cache = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache.ClearAll(); int hits = 0; Func<Task<string>> getter = async () => { hits++; return hits.ToString(); }; string result; result = await cache.GetAsync("key", getter); Assert.AreEqual(1, hits); Assert.AreEqual("1", result); result = await cache.GetAsync("key", getter); Assert.AreEqual(1, hits); Assert.AreEqual("1", result); } [TestMethod] public void TestCacheNull() { var cache = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache.ClearAll(); int misses = 0; Func<string> getter = () => { misses++; return null; }; string result; result = cache.Get("key", getter); Assert.AreEqual(1, misses); Assert.AreEqual(null, result); result = cache.Get("key", getter); Assert.AreEqual(1, misses); Assert.AreEqual(null, result); } [TestMethod] public void TestCacheTimeToLive_FromInsert() { var ttl = 3; int misses = 0; string result; var stopwatch = new Stopwatch(); Func<string> getter = () => { misses++; return misses.ToString(); }; var cache = GetCacheWithExpirationFromAdd("insert-expire-cache", TimeSpan.FromSeconds(ttl)); cache.ClearAll(); stopwatch.Start(); result = cache.Get("key", getter); Assert.AreEqual(1, misses); Assert.AreEqual("1", result); result = cache.Get("key", getter); Assert.AreEqual(1, misses); Assert.AreEqual("1", result); CacheTestTools.AssertValueDoesntChangeWithin(cache, "key", "1", getter, stopwatch, ttl); // Should expire within TTL+60sec from insert CacheTestTools.AssertValueDoesChangeWithin(cache, "key", "1", getter, stopwatch, 60.1); result = cache.Get("key", getter); Assert.AreNotEqual(1, misses); Assert.AreNotEqual("1", result); } [TestMethod] public void TestCacheTimeToLive_Sliding() { return; var ttl = 3; int misses = 0; string result; var stopwatch = new Stopwatch(); Func<string> getter = () => { misses++; return misses.ToString(); }; var cache = GetCacheWithSlidingExpiration("sliding-expire-cache", TimeSpan.FromSeconds(ttl)); cache.ClearAll(); stopwatch.Start(); result = cache.Get("key", getter); DateTime insertTime = DateTime.Now; Assert.AreEqual(1, misses); Assert.AreEqual("1", result); result = cache.Get("key", getter); Assert.AreEqual(1, misses); Assert.AreEqual("1", result); CacheTestTools.AssertValueDoesntChangeWithin(cache, "key", "1", getter, stopwatch, ttl + 60); // Should expire within TTL+60sec from last access CacheTestTools.AssertValueDoesChangeAfter(cache, "key", "1", getter, stopwatch, ttl + 60.1); result = cache.Get("key", getter); Assert.AreNotEqual(1, misses); Assert.AreNotEqual("1", result); } [TestMethod] public void TestCacheTimeToLive_Constant() { var ttl = 3; int misses = 0; string result; var stopwatch = new Stopwatch(); Func<string> getter = () => { misses++; return misses.ToString(); }; var expireAt = DateTime.Now.AddSeconds(ttl); stopwatch.Start(); var cache = GetCacheWithAbsoluteExpiration("constant-expire", expireAt); cache.ClearAll(); result = cache.Get("key", getter); DateTime insertTime = DateTime.Now; Assert.AreEqual(1, misses); Assert.AreEqual("1", result); result = cache.Get("key", getter); Assert.AreEqual(1, misses); Assert.AreEqual("1", result); CacheTestTools.AssertValueDoesntChangeWithin(cache, "key", "1", getter, stopwatch, ttl); // Should expire within TTL+60sec from insert CacheTestTools.AssertValueDoesChangeWithin(cache, "key", "1", getter, stopwatch, 60.1); result = cache.Get("key", getter); Assert.AreNotEqual(1, misses); Assert.AreNotEqual("1", result); } [TestMethod] [Ignore("Diagnose manually the memory consumption")] public void LotsOfClearAll() { var cache = GetCache("cache1"); for (var i = 0; i < 5000; i++) { cache.ClearAll(); } Thread.Sleep(1000); GC.Collect(); Thread.Sleep(1000); for (var i = 0; i < 5000; i++) { cache.ClearAll(); } } [TestMethod] [Ignore("Diagnose manually the memory consumption")] public async Task LotsOfClearAsyncAll() { var cache = GetCache("cache1"); for (var i = 0; i < 5000; i++) { await cache.ClearAllAsync().ConfigureAwait(false); } await Task.Delay(1000); GC.Collect(); await Task.Delay(1000); for (var i = 0; i < 5000; i++) { await cache.ClearAllAsync().ConfigureAwait(false); } } [TestMethod] public void TestCacheTryGet() { var cache = GetCache("cache1"); cache.ClearAll(); cache.Set("key", "1"); var result = cache.TryGet<string>("key", out var value); Assert.AreEqual("1", value); Assert.IsTrue(result); } [TestMethod] public void TestCacheTryGet_NotFound() { var cache = GetCache("cache1"); cache.ClearAll(); cache.Set("key", "1"); var result = cache.TryGet<string>("wrongKey", out var value); Assert.AreEqual(null, value); Assert.IsFalse(result); } [TestMethod] public async Task TestCacheTryGetAsync() { var cache = GetCache("cache1"); cache.ClearAll(); cache.Set("key", "1"); var result = await cache.TryGetAsync<string>("key"); Assert.AreEqual("1", result.Value); Assert.IsTrue(result.WasFound); } [TestMethod] public async Task TestCacheTryGetAsync_NotFound() { var cache = GetCache("cache1"); cache.ClearAll(); cache.Set("key", "1"); var result = await cache.TryGetAsync<string>("wrongKey"); Assert.AreEqual(null, result.Value); Assert.IsFalse(result.WasFound); } [TestMethod] public void TestCacheGetTwice() { var cache = GetCache("cache1"); cache.ClearAll(); int misses = 0; Func<string> getter = () => { misses++; return misses.ToString(); }; string result; result = cache.Get("key", getter); Assert.AreEqual("1", result); result = cache.Get("key", getter); Assert.AreEqual("1", result); } [TestMethod] public void TestCacheSetTwice() { var cache = GetCache("cache1"); cache.ClearAll(); int misses = 0; Func<string> getter = () => { misses++; return misses.ToString(); }; string result; bool wasFound; cache.Set("key", getter()); wasFound = cache.TryGet("key", out result); Assert.AreEqual(true, wasFound); Assert.AreEqual("1", result); cache.Set("key", getter()); wasFound = cache.TryGet("key", out result); Assert.AreEqual(true, wasFound); Assert.AreEqual("2", result); } [TestMethod] public void TestCacheUpdated() { var cache = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache.ClearAll(); cache.Set("key", 1); var result = cache.Get("key", () => 0); Assert.AreEqual(1, result); cache.Set("key", 2); result = cache.Get("key", () => 0); Assert.AreEqual(2, result); } [TestMethod] public void TestCacheBasic() { var cache = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache.ClearAll(); int misses = 0; Func<string> getter = () => { misses++; return misses.ToString(); }; string result; result = cache.Get("key1", getter); Assert.AreEqual(1, misses); Assert.AreEqual("1", result); result = cache.Get("key2", getter); Assert.AreEqual(2, misses); Assert.AreEqual("2", result); cache.ClearAll(); result = cache.Get("key1", getter); Assert.AreEqual(3, misses); Assert.AreEqual("3", result); result = cache.Get("key2", getter); Assert.AreEqual(4, misses); Assert.AreEqual("4", result); } [TestMethod] public void TestCacheTwoCaches() { var cache1 = GetCacheWithSlidingExpiration("cache1", TimeSpan.FromMinutes(2)); cache1.ClearAll(); var cache2 = GetCacheWithSlidingExpiration("cache2", TimeSpan.FromMinutes(2)); cache2.ClearAll(); int misses1 = 0; Func<string> getter1 = () => { misses1++; return misses1.ToString(); }; int misses2 = 0; Func<string> getter2 = () => { misses2++; return misses2.ToString(); }; string result; result = cache1.Get("key1", getter1); Assert.AreEqual(1, misses1); Assert.AreEqual("1", result); result = cache1.Get("key2", getter1); Assert.AreEqual(2, misses1); Assert.AreEqual("2", result); result = cache2.Get("key1", getter2); Assert.AreEqual(1, misses2); Assert.AreEqual("1", result); result = cache2.Get("key2", getter2); Assert.AreEqual(2, misses2); Assert.AreEqual("2", result); cache1.ClearAll(); result = cache1.Get("key1", getter1); Assert.AreEqual(3, misses1); Assert.AreEqual("3", result); result = cache1.Get("key2", getter1); Assert.AreEqual(4, misses1); Assert.AreEqual("4", result); result = cache2.Get("key1", getter2); Assert.AreEqual(2, misses2); Assert.AreEqual("1", result); result = cache2.Get("key2", getter2); Assert.AreEqual(2, misses2); Assert.AreEqual("2", result); } } }
pub-comp/caching
Core.UnitTests/CacheInterfaceTests.cs
C#
lgpl-2.1
13,781
import sys import time sleep = time.sleep if sys.platform == 'win32': time = time.clock else: time = time.time
egbertbouman/tribler-g
Tribler/Core/DecentralizedTracking/pymdht/core/ptime.py
Python
lgpl-2.1
124
/* * Copyright (C) 2007 Sebastian Sauer <[email protected]> * * This file is part of SuperKaramba. * * SuperKaramba 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 2 of the License, or * (at your option) any later version. * * SuperKaramba 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 SuperKaramba; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "plasmaengine.h" #include <kdebug.h> #include <plasma/dataenginemanager.h> #if 0 #include <QFile> #include <QTextStream> #endif /// \internal helper function that translates plasma data into a QVariantMap. QVariantMap dataToMap(Plasma::DataEngine::Data data) { QVariantMap map; Plasma::DataEngine::DataIterator it(data); while( it.hasNext() ) { it.next(); map.insert(it.key(), it.value()); } return map; } /* /// \internal helper function that translates a QVariantMap into plasma data. Plasma::DataEngine::Data mapToData(QVariantMap map) { Plasma::DataEngine::Data data; for(QVariantMap::Iterator it = map.begin(); it != map.end(); ++it) data.insert(it.key(), it.value()); return data; } */ /***************************************************************************************** * PlasmaSensorConnector */ /// \internal d-pointer class. class PlasmaSensorConnector::Private { public: Meter* meter; QString source; QString format; }; PlasmaSensorConnector::PlasmaSensorConnector(Meter *meter, const QString& source) : QObject(meter), d(new Private) { //kDebug()<<"PlasmaSensorConnector Ctor"<<endl; setObjectName(source); d->meter = meter; d->source = source; } PlasmaSensorConnector::~PlasmaSensorConnector() { //kDebug()<<"PlasmaSensorConnector Dtor"<<endl; delete d; } Meter* PlasmaSensorConnector::meter() const { return d->meter; } QString PlasmaSensorConnector::source() const { return d->source; } void PlasmaSensorConnector::setSource(const QString& source) { d->source = source; } QString PlasmaSensorConnector::format() const { return d->format; } void PlasmaSensorConnector::setFormat(const QString& format) { d->format = format; } void PlasmaSensorConnector::dataUpdated(const QString& source, const Plasma::DataEngine::Data &data) { //kDebug()<<"PlasmaSensorConnector::dataUpdated d->source="<<d->source<<" source="<<source<<endl; if( d->source.isEmpty() ) { emit sourceUpdated(source, dataToMap(data)); return; } if( source != d->source ) { return; } QString v = d->format; Plasma::DataEngine::DataIterator it(data); while( it.hasNext() ) { it.next(); QString s = QString("%%1").arg( it.key() ); v.replace(s,it.value().toString()); } d->meter->setValue(v); } /***************************************************************************************** * PlasmaSensor */ /// \internal d-pointer class. class PlasmaSensor::Private { public: Plasma::DataEngine* engine; QString engineName; explicit Private() : engine(0) {} }; PlasmaSensor::PlasmaSensor(int msec) : Sensor(msec), d(new Private) { kDebug()<<"PlasmaSensor Ctor"<<endl; } PlasmaSensor::~PlasmaSensor() { kDebug()<<"PlasmaSensor Dtor"<<endl; delete d; } Plasma::DataEngine* PlasmaSensor::engineImpl() const { return d->engine; } void PlasmaSensor::setEngineImpl(Plasma::DataEngine* engine, const QString& engineName) { d->engine = engine; d->engineName = engineName; } QString PlasmaSensor::engine() { return d->engine ? d->engineName : QString(); } void PlasmaSensor::setEngine(const QString& name) { //kDebug()<<"PlasmaSensor::setEngine name="<<name<<endl; if( d->engine ) { disconnect(d->engine, SIGNAL(newSource(QString)), this, SIGNAL(sourceAdded(QString))); disconnect(d->engine, SIGNAL(sourceRemoved(QString)), this, SIGNAL(sourceRemoved(QString))); Plasma::DataEngineManager::self()->unloadEngine(d->engineName); } d->engineName.clear(); d->engine = Plasma::DataEngineManager::self()->engine(name); if( ! d->engine || ! d->engine->isValid() ) { d->engine = Plasma::DataEngineManager::self()->loadEngine(name); if( ! d->engine || ! d->engine->isValid() ) { kWarning()<<"PlasmaSensor::setEngine: No such engine: "<<name<<endl; return; } } d->engineName = name; connect(d->engine, SIGNAL(newSource(QString)), this, SIGNAL(sourceAdded(QString))); connect(d->engine, SIGNAL(sourceRemoved(QString)), this, SIGNAL(sourceRemoved(QString))); //d->engine->setProperty("reportSeconds", true); } bool PlasmaSensor::isValid() const { return d->engine && d->engine->isValid(); } QStringList PlasmaSensor::sources() const { return d->engine ? d->engine->sources() : QStringList(); } QVariant PlasmaSensor::property(const QByteArray& name) const { return d->engine ? d->engine->property(name) : QVariant(); } void PlasmaSensor::setProperty(const QByteArray& name, const QVariant& value) { if( d->engine ) d->engine->setProperty(name, value); } QVariantMap PlasmaSensor::query(const QString& source) { //kDebug()<<"PlasmaSensor::query"<<endl; return d->engine ? dataToMap(d->engine->query(source)) : QVariantMap(); } QObject* PlasmaSensor::connectSource(const QString& source, QObject* visualization) { //kDebug()<<"PlasmaSensor::connectSource source="<<source<<endl; if( ! d->engine ) { kWarning()<<"PlasmaSensor::connectSource: No engine"<<endl; return 0; } if( Meter* m = dynamic_cast<Meter*>(visualization) ) { PlasmaSensorConnector* c = new PlasmaSensorConnector(m, source); d->engine->connectSource(source, c); kDebug()<<"PlasmaSensor::connectSource meter, engine isValid="<<d->engine->isValid(); return c; } d->engine->connectSource(source, visualization ? visualization : this); return 0; } void PlasmaSensor::disconnectSource(const QString& source, QObject* visualization) { //kDebug()<<"PlasmaSensor::disconnectSource"<<endl; if( Meter* m = dynamic_cast<Meter*>(visualization) ) { foreach(PlasmaSensorConnector* c, m->findChildren<PlasmaSensorConnector*>(source)) if( c->meter() == m ) delete c; } else if( d->engine ) { d->engine->disconnectSource(source, visualization ? visualization : this); } else kWarning()<<"PlasmaSensor::disconnectSource: No engine"<<endl; } void PlasmaSensor::update() { kDebug()<<"PlasmaSensor::update"<<endl; /*TODO foreach(QObject *it, *objList) { SensorParams *sp = qobject_cast<SensorParams*>(it); Meter *meter = sp->getMeter(); const QString format = sp->getParam("FORMAT"); //if (format.length() == 0) format = "%um"; //format.replace(QRegExp("%fmb", Qt::CaseInsensitive),QString::number((int)((totalMem - usedMemNoBuffers) / 1024.0 + 0.5))); //meter->setValue(format); } */ } void PlasmaSensor::dataUpdated(const QString& source, Plasma::DataEngine::Data data) { //kDebug()<<"PlasmaSensor::dataUpdated source="<<source<<endl; emit sourceUpdated(source, dataToMap(data)); } #include "plasmaengine.moc"
KDE/superkaramba
src/sensors/plasmaengine.cpp
C++
lgpl-2.1
7,725
body { font-family: verdana, arial, helvetica, sans-serif; font-size: 63.125%; /* translate 1.0em to 10px, 1.5em to 15px, etc. */ } #content { margin:0 auto; width: 980px; text-align: left; } #identity { padding: 25px 0; } #identity h1 { font-size: 2.4em; font-weight: normal; color: #73736c; } p { margin: 0 0 1em 0; font-size: 1.3em; line-height: 1.4em; } a { color: #b31b1b; text-decoration: none; font-size: .9em; } a:visited { color: #b37474; } a:hover { color: #f00; border-color: #f00; } a:active { color: #b31b1b; border-color: #e5cfcf; } hr { display: none; } form { margin: 0 0 15px 0; padding: 0; float: left; } .form-submit { border: 1px solid #dbdbd2; margin: 8px; } fieldset { float: left; margin: 0 auto; padding: 1em 0 1.5em 0; width: 35em; } .form-pair { display: inline; float: left; margin: .5em .5em 0 .4em; width: 28em; } .form-item { float: left; margin-top: 5px; width: 8em; font-size: 1.2em; font-family: verdana, arial, helvetica, sans-serif; line-height: 1.5em; text-align: right; } .form-value { float: right; margin-top: 3px; width: 16em; font-size: 1.1em; font-family: verdana, arial, helvetica, sans-serif; line-height: 1.5em; margin-right: 0px; } .input-submit, .input-reset { font-family: verdana, arial, helvetica, sans-serif; font-size: 1.1em; border: 1px solid; background: #f0eee4; margin-top:0px; } .input-submit:hover{ background:#dbdbd2; } #offsetlinks ul { float: left; margin: 0 0 0 0; padding: 0px 0 10px 0; font-size: 1.3em; line-height: 1.4em; } #offsetlinks ul li { margin: 0 0 0 30em; padding: 0 0 0 15px;/*was 30*/ list-style: none; } #footer { margin: 0 auto; padding: 5px 0 1em 0; width: 68em; font-size: .9em; color: #73736c; float: left; margin-top: .5em; } #footer a { font-size: 1.0em; }
sross07/alms
src/main/webapp/css/salms.css
CSS
lgpl-2.1
1,853
tinymce.addI18n('it',{ "Cut": "Taglia", "Heading 5": "Intestazione 5", "Header 2": "Header 2", "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Il tuo browser non supporta l'accesso diretto negli Appunti. Per favore usa i tasti di scelta rapida Ctrl+X\/C\/V.", "Heading 4": "Intestazione 4", "Div": "Div", "Heading 2": "Intestazione 2", "Paste": "Incolla", "Close": "Chiudi", "Font Family": "Famiglia font", "Pre": "Pre", "Align right": "Allinea a Destra", "New document": "Nuovo Documento", "Blockquote": "Blockquote", "Numbered list": "Elenchi Numerati", "Heading 1": "Intestazione 1", "Headings": "Intestazioni", "Increase indent": "Aumenta Rientro", "Formats": "Formattazioni", "Headers": "Intestazioni", "Select all": "Seleziona Tutto", "Header 3": "Intestazione 3", "Blocks": "Blocchi", "Undo": "Indietro", "Strikethrough": "Barrato", "Bullet list": "Elenchi Puntati", "Header 1": "Intestazione 1", "Superscript": "Apice", "Clear formatting": "Cancella Formattazione", "Font Sizes": "Dimensioni font", "Subscript": "Pedice", "Header 6": "Intestazione 6", "Redo": "Ripeti", "Paragraph": "Paragrafo", "Ok": "Ok", "Bold": "Grassetto", "Code": "Codice", "Italic": "Corsivo", "Align center": "Allinea al Cento", "Header 5": "Intestazione 5", "Heading 6": "Intestazione 6", "Heading 3": "Intestazione 3", "Decrease indent": "Riduci Rientro", "Header 4": "Intestazione 4", "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Incolla \u00e8 in modalit\u00e0 testo normale. I contenuti sono incollati come testo normale se non disattivi l'opzione.", "Underline": "Sottolineato", "Cancel": "Annulla", "Justify": "Giustifica", "Inline": "Inlinea", "Copy": "Copia", "Align left": "Allinea a Sinistra", "Visual aids": "Elementi Visivi", "Lower Greek": "Greek Minore", "Square": "Quadrato", "Default": "Default", "Lower Alpha": "Alpha Minore", "Circle": "Cerchio", "Disc": "Disco", "Upper Alpha": "Alpha Superiore", "Upper Roman": "Roman Superiore", "Lower Roman": "Roman Minore", "Name": "Nome", "Anchor": "Fissa", "You have unsaved changes are you sure you want to navigate away?": "Non hai salvato delle modifiche, sei sicuro di andartene?", "Restore last draft": "Ripristina l'ultima bozza.", "Special character": "Carattere Speciale", "Source code": "Codice Sorgente", "B": "B", "R": "R", "G": "G", "Color": "Colore", "Right to left": "Da Destra a Sinistra", "Left to right": "Da Sinistra a Destra", "Emoticons": "Emoction", "Robots": "Robot", "Document properties": "Propriet\u00e0 Documento", "Title": "Titolo", "Keywords": "Parola Chiave", "Encoding": "Codifica", "Description": "Descrizione", "Author": "Autore", "Fullscreen": "Schermo Intero", "Horizontal line": "Linea Orizzontale", "Horizontal space": "Spazio Orizzontale", "Insert\/edit image": "Aggiungi\/Modifica Immagine", "General": "Generale", "Advanced": "Avanzato", "Source": "Fonte", "Border": "Bordo", "Constrain proportions": "Mantieni Proporzioni", "Vertical space": "Spazio Verticale", "Image description": "Descrizione Immagine", "Style": "Stile", "Dimensions": "Dimenzioni", "Insert image": "Inserisci immagine", "Zoom in": "Ingrandisci", "Contrast": "Contrasto", "Back": "Indietro", "Gamma": "Gamma", "Flip horizontally": "Rifletti orizzontalmente", "Resize": "Ridimensiona", "Sharpen": "Contrasta", "Zoom out": "Rimpicciolisci", "Image options": "Opzioni immagine", "Apply": "Applica", "Brightness": "Luminosit\u00e0", "Rotate clockwise": "Ruota in senso orario", "Rotate counterclockwise": "Ruota in senso antiorario", "Edit image": "Modifica immagine", "Color levels": "Livelli colore", "Crop": "Taglia", "Orientation": "Orientamento", "Flip vertically": "Rifletti verticalmente", "Invert": "Inverti", "Insert date\/time": "Inserisci Data\/Ora", "Remove link": "Rimuovi link", "Url": "Url", "Text to display": "Testo da Visualizzare", "Anchors": "Anchors", "Insert link": "Inserisci il Link", "New window": "Nuova Finestra", "None": "No", "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "L'URL inserito sembra essere un collegamento esterno. Vuoi aggiungere il prefisso necessario http:\/\/?", "Target": "Target", "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "L'URL inserito sembra essere un indirizzo email. Vuoi aggiungere il prefisso necessario mailto:?", "Insert\/edit link": "Inserisci\/Modifica Link", "Insert\/edit video": "Inserisci\/Modifica Video", "Poster": "Anteprima", "Alternative source": "Alternativo", "Paste your embed code below:": "Incolla il codice d'incorporamento qui:", "Insert video": "Inserisci Video", "Embed": "Incorporare", "Nonbreaking space": "Spazio unificatore", "Page break": "Interruzione di pagina", "Paste as text": "incolla come testo", "Preview": "Anteprima", "Print": "Stampa", "Save": "Salva", "Could not find the specified string.": "Impossibile trovare la parola specifica.", "Replace": "Sostituisci", "Next": "Successivo", "Whole words": "Parole Sbagliate", "Find and replace": "Trova e Sostituisci", "Replace with": "Sostituisci Con", "Find": "Trova", "Replace all": "Sostituisci Tutto", "Match case": "Maiuscole\/Minuscole ", "Prev": "Precedente", "Spellcheck": "Controllo ortografico", "Finish": "Termina", "Ignore all": "Ignora Tutto", "Ignore": "Ignora", "Add to Dictionary": "Aggiungi al Dizionario", "Insert row before": "Inserisci una Riga Prima", "Rows": "Righe", "Height": "Altezza", "Paste row after": "Incolla una Riga Dopo", "Alignment": "Allineamento", "Border color": "Colore bordo", "Column group": "Gruppo di Colonne", "Row": "Riga", "Insert column before": "Inserisci una Colonna Prima", "Split cell": "Dividi Cella", "Cell padding": "Padding della Cella", "Cell spacing": "Spaziatura della Cella", "Row type": "Tipo di Riga", "Insert table": "Inserisci Tabella", "Body": "Body", "Caption": "Didascalia", "Footer": "Footer", "Delete row": "Cancella Riga", "Paste row before": "Incolla una Riga Prima", "Scope": "Campo", "Delete table": "Cancella Tabella", "H Align": "Allineamento H", "Top": "In alto", "Header cell": "cella d'intestazione", "Column": "Colonna", "Row group": "Gruppo di Righe", "Cell": "Cella", "Middle": "In mezzo", "Cell type": "Tipo di Cella", "Copy row": "Copia Riga", "Row properties": "Propriet\u00e0 della Riga", "Table properties": "Propiet\u00e0 della Tabella", "Bottom": "In fondo", "V Align": "Allineamento V", "Header": "Header", "Right": "Destra", "Insert column after": "Inserisci una Colonna Dopo", "Cols": "Colonne", "Insert row after": "Inserisci una Riga Dopo", "Width": "Larghezza", "Cell properties": "Propiet\u00e0 della Cella", "Left": "Sinistra", "Cut row": "Taglia Riga", "Delete column": "Cancella Colonna", "Center": "Centro", "Merge cells": "Unisci Cella", "Insert template": "Inserisci Template", "Templates": "Template", "Background color": "Colore Background", "Custom...": "Personalizzato...", "Custom color": "Colore personalizzato", "No color": "Nessun colore", "Text color": "Colore Testo", "Show blocks": "Mostra Blocchi", "Show invisible characters": "Mostra Caratteri Invisibili", "Words: {0}": "Parole: {0}", "Insert": "Inserisci", "File": "File", "Edit": "Modifica", "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Premi ALT-F9 per il men\u00f9. Premi ALT-F10 per la barra degli strumenti. Premi ALT-0 per l'aiuto.", "Tools": "Strumenti", "View": "Visualizza", "Table": "Tabella", "Format": "Formato" });
OpenSlides/tinymce-i18n
langs/it.js
JavaScript
lgpl-2.1
7,599
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing ** ** This file is part of Qt Creator. ** ** 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 The Qt Company. For licensing terms and ** conditions see http://www.qt.io/terms-conditions. For further information ** use the contact form at http://www.qt.io/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 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. ** ** In addition, as a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef DIFFUTILS_H #define DIFFUTILS_H #include "diffeditor_global.h" #include <QString> #include <QMap> #include <QTextEdit> #include "texteditor/texteditorconstants.h" namespace TextEditor { class FontSettings; } namespace DiffEditor { class Diff; class DIFFEDITOR_EXPORT DiffFileInfo { public: DiffFileInfo() {} DiffFileInfo(const QString &file) : fileName(file) {} DiffFileInfo(const QString &file, const QString &type) : fileName(file), typeInfo(type) {} QString fileName; QString typeInfo; }; class DIFFEDITOR_EXPORT TextLineData { public: enum TextLineType { TextLine, Separator, Invalid }; TextLineData() : textLineType(Invalid) {} TextLineData(const QString &txt) : textLineType(TextLine), text(txt) {} TextLineData(TextLineType t) : textLineType(t) {} TextLineType textLineType; QString text; /* * <start position, end position> * <-1, n> means this is a continuation from the previous line * <n, -1> means this will be continued in the next line * <-1, -1> the whole line is a continuation (from the previous line to the next line) */ QMap<int, int> changedPositions; // counting from the beginning of the line }; class DIFFEDITOR_EXPORT RowData { public: RowData() : equal(false) {} RowData(const TextLineData &l) : leftLine(l), rightLine(l), equal(true) {} RowData(const TextLineData &l, const TextLineData &r) : leftLine(l), rightLine(r), equal(false) {} TextLineData leftLine; TextLineData rightLine; bool equal; }; class DIFFEDITOR_EXPORT ChunkData { public: ChunkData() : contextChunk(false), leftStartingLineNumber(0), rightStartingLineNumber(0) {} QList<RowData> rows; bool contextChunk; int leftStartingLineNumber; int rightStartingLineNumber; QString contextInfo; }; class DIFFEDITOR_EXPORT FileData { public: enum FileOperation { ChangeFile, NewFile, DeleteFile, CopyFile, RenameFile }; FileData() : fileOperation(ChangeFile), binaryFiles(false), lastChunkAtTheEndOfFile(false), contextChunksIncluded(false) {} FileData(const ChunkData &chunkData) : fileOperation(ChangeFile), binaryFiles(false), lastChunkAtTheEndOfFile(false), contextChunksIncluded(false) { chunks.append(chunkData); } QList<ChunkData> chunks; DiffFileInfo leftFileInfo; DiffFileInfo rightFileInfo; FileOperation fileOperation; bool binaryFiles; bool lastChunkAtTheEndOfFile; bool contextChunksIncluded; }; class DIFFEDITOR_EXPORT DiffUtils { public: enum PatchFormattingFlags { AddLevel = 0x1, // Add 'a/' , '/b' for git am GitFormat = AddLevel | 0x2, // Add line 'diff ..' as git does }; static ChunkData calculateOriginalData(const QList<Diff> &leftDiffList, const QList<Diff> &rightDiffList); static FileData calculateContextData(const ChunkData &originalData, int contextLinesNumber, int joinChunkThreshold = 1); static QString makePatchLine(const QChar &startLineCharacter, const QString &textLine, bool lastChunk, bool lastLine); static QString makePatch(const ChunkData &chunkData, bool lastChunk = false); static QString makePatch(const ChunkData &chunkData, const QString &leftFileName, const QString &rightFileName, bool lastChunk = false); static QString makePatch(const QList<FileData> &fileDataList, unsigned formatFlags = 0); static QList<FileData> readPatch(const QString &patch, bool *ok = 0); }; } // namespace DiffEditor #endif // DIFFUTILS_H
kuba1/qtcreator
src/plugins/diffeditor/diffutils.h
C
lgpl-2.1
5,593
<html dir="LTR" xmlns:ndoc="urn:ndoc-schema"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta content="history" name="save" /> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" /> <title>EntLibLogger Constructor</title> <xml> </xml> <link rel="stylesheet" type="text/css" href="MSDN.css" /> </head> <body id="bodyID" class="dtBODY"> <div id="nsbanner"> <div id="bannerrow1"> <table class="bannerparthead" cellspacing="0"> <tr id="hdr"> <td class="runninghead">Common Logging 2.0 API Reference</td> <td class="product"> </td> </tr> </table> </div> <div id="TitleRow"> <h1 class="dtH1">EntLibLogger Constructor</h1> </div> </div> <div id="nstext"> <p> Initializes a new instance of the <a href="Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLogger.html">EntLibLogger</a> class. </p> <div class="syntax"> <span class="lang">[Visual Basic]</span> <br />Public Sub New( _<br />   ByVal <i>category</i> As <a href="">String</a>, _<br />   ByVal <i>logWriter</i> As <a href="">LogWriter</a>, _<br />   ByVal <i>settings</i> As <a href="Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLoggerSettings.html">EntLibLoggerSettings</a> _<br />)</div> <div class="syntax"> <span class="lang">[C#]</span> <br /> <a href="Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLogger.html">EntLibLogger</a>(<br />   <a href="">string</a> <i>category</i>,<br />   <a href="">LogWriter</a> <i>logWriter</i>,<br />   <a href="Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLoggerSettings.html">EntLibLoggerSettings</a> <i>settings</i><br />);</div> <h4 class="dtH4">Parameters</h4> <dl> <dt> <i>category</i> </dt> <dd>The category.</dd> <dt> <i>logWriter</i> </dt> <dd>the <a href="Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLogger.LogWriter.html">LogWriter</a> to write log events to.</dd> <dt> <i>settings</i> </dt> <dd>the logger settings</dd> </dl> <h4 class="dtH4">See Also</h4> <p> <a href="Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLogger.html">EntLibLogger Class</a> | <a href="Common.Logging.EntLib41~Common.Logging.EntLib.html">Common.Logging.EntLib Namespace</a></p> <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"> <param name="Keyword" value="EntLibLogger class, constructor&#xD;&#xA; "> </param> </object> <hr /> <div id="footer"> <p> <a href="mailto:[email protected]?subject=Common%20Logging%202.0%20API%20Reference%20Documentation%20Feedback:%20EntLibLogger Constructor ">Send comments on this topic.</a> </p> <p> <a>© The Common Infrastructure Libraries for .NET Team 2009 All Rights Reserved.</a> </p> <p>Generated from assembly Common.Logging.EntLib41 [2.0.0.0] by <a href="http://ndoc3.sourceforget.net">NDoc3</a></p> </div> </div> </body> </html>
briandealwis/gt
Common.Logging/doc/api/html/Common.Logging.EntLib41~Common.Logging.EntLib.EntLibLogger.~ctor.html
HTML
lgpl-2.1
3,435
<?php /** * Naked Php is a framework that implements the Naked Objects pattern. * @copyright Copyright (C) 2009 Giorgio Sironi * @license http://www.gnu.org/licenses/lgpl-2.1.txt * * 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. * * @category NakedPhp * @package NakedPhp_MetaModel */ namespace NakedPhp\MetaModel; class NakedObjectFeatureTypeTest extends \PHPUnit_Framework_TestCase { public function testOnlyEnumeratedValuesAreAllowed() { $this->assertEquals('OBJECT', NakedObjectFeatureType::OBJECT); } }
giorgiosironi/NakedPhp
tests/NakedPhp/MetaModel/NakedObjectFeatureTypeTest.php
PHP
lgpl-2.1
759
# Authors: David Goodger; Gunnar Schwant # Contact: [email protected] # Revision: $Revision: 21817 $ # Date: $Date: 2005-07-21 13:39:57 -0700 (Thu, 21 Jul 2005) $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language: one in docutils/languages, the other in # docutils/parsers/rst/languages. """ German language mappings for language-dependent features of Docutils. """ __docformat__ = 'reStructuredText' labels = { 'author': 'Autor', 'authors': 'Autoren', 'organization': 'Organisation', 'address': 'Adresse', 'contact': 'Kontakt', 'version': 'Version', 'revision': 'Revision', 'status': 'Status', 'date': 'Datum', 'dedication': 'Widmung', 'copyright': 'Copyright', 'abstract': 'Zusammenfassung', 'attention': 'Achtung!', 'caution': 'Vorsicht!', 'danger': '!GEFAHR!', 'error': 'Fehler', 'hint': 'Hinweis', 'important': 'Wichtig', 'note': 'Bemerkung', 'tip': 'Tipp', 'warning': 'Warnung', 'contents': 'Inhalt'} """Mapping of node class name to label text.""" bibliographic_fields = { 'autor': 'author', 'autoren': 'authors', 'organisation': 'organization', 'adresse': 'address', 'kontakt': 'contact', 'version': 'version', 'revision': 'revision', 'status': 'status', 'datum': 'date', 'copyright': 'copyright', 'widmung': 'dedication', 'zusammenfassung': 'abstract'} """German (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] """List of separator strings for the 'Authors' bibliographic field. Tried in order."""
garinh/cs
docs/support/docutils/languages/de.py
Python
lgpl-2.1
1,814
<?php /** * PHPExcel 读取插件类 */ class PHPExcelReaderChajian extends Chajian{ protected function initChajian() { $this->Astr = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BO,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM,CN,CO,CP,CQ,CR,CS,CT,CU,CV,CW,CX,CY,CZ'; $this->A = explode(',', $this->Astr); $this->AT = array('A'=>0,'B'=>1,'C'=>2,'D'=>3,'E'=>4,'F'=>5,'G'=>6,'H'=>7,'I'=>8,'J'=>9,'K'=>10,'L'=>11,'M'=>12,'N'=>13,'O'=>14,'P'=>15,'Q'=>16,'R'=>17,'S'=>18,'T'=>19,'U'=>20,'V'=>21,'W'=>22,'X'=>23,'Y'=>24,'Z'=>25,'AA'=>26,'AB'=>27,'AC'=>28,'AD'=>29,'AE'=>30,'AF'=>31,'AG'=>32,'AH'=>33,'AI'=>34,'AJ'=>35,'AK'=>36,'AL'=>37,'AM'=>38,'AN'=>39,'AO'=>40,'AP'=>41,'AQ'=>42,'AR'=>43,'AS'=>44,'AT'=>45,'AU'=>46,'AV'=>47,'AW'=>48,'AX'=>49,'AY'=>50,'AZ'=>51,'BA'=>52,'BB'=>53,'BC'=>54,'BD'=>55,'BE'=>56,'BF'=>57,'BG'=>58,'BH'=>59,'BI'=>60,'BJ'=>61,'BK'=>62,'BL'=>63,'BM'=>64,'BN'=>65,'BO'=>66,'BP'=>67,'BQ'=>68,'BR'=>69,'BS'=>70,'BT'=>71,'BU'=>72,'BV'=>73,'BW'=>74,'BX'=>75,'BY'=>76,'BZ'=>77,'CA'=>78,'CB'=>79,'CC'=>80,'CD'=>81,'CE'=>82,'CF'=>83,'CG'=>84,'CH'=>85,'CI'=>86,'CJ'=>87,'CK'=>88,'CL'=>89,'CM'=>90,'CN'=>91,'CO'=>92,'CP'=>93,'CQ'=>94,'CR'=>95,'CS'=>96,'CT'=>97,'CU'=>98,'CV'=>99,'CW'=>100,'CX'=>101,'CY'=>102,'CZ'=>103); } public function reader($filePath=null, $index=2) { if(file_exists(ROOT_PATH.'/include/PHPExcel/Reader/Excel2007.php'))include_once(ROOT_PATH.'/include/PHPExcel/Reader/Excel2007.php'); if(file_exists(ROOT_PATH.'/include/PHPExcel/Reader/Excel5.php'))include_once(ROOT_PATH.'/include/PHPExcel/Reader/Excel5.php'); $help = c('xinhu')->helpstr('phpexcel'); if(!class_exists('PHPExcel_Reader_Excel2007'))return '没有安装PHPExcel插件'.$help.''; if($filePath==null)$filePath = $_FILES['file']['tmp_name']; $PHPReader = new PHPExcel_Reader_Excel2007(); if(!$PHPReader->canRead($filePath)){ $PHPReader = new PHPExcel_Reader_Excel5(); if(!$PHPReader->canRead($filePath)){ return '不是正规的Excel文件'.$help.''; } } $PHPExcel = $PHPReader->load($filePath); $rows = array(); $sheet = $PHPExcel->getSheet(0); //第一个表 $allColumn = $sheet->getHighestColumn(); $allRow = $sheet->getHighestRow(); $allCell = $this->AT[$allColumn]; for($row = $index; $row <= $allRow; $row++){ $arr = array(); for($cell= 0; $cell<= $allCell; $cell++){ $val = $sheet->getCellByColumnAndRow($cell, $row)->getValue(); $arr[$this->A[$cell]] = $val; } $rows[] = $arr; } return $rows; } /** 导入到表 */ public function importTable($table, $rows, $fields) { } }
holmesian/xinhu-project
include/chajian/PHPExcelReaderChajian.php
PHP
lgpl-2.1
2,818
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="Text/html; charset=iso-8859-1"> <meta name="Author" content = "misho" > <meta name="GENERATOR" content="VBDOX [1.0.24]" > <script SRC="linkcss.js"></script> <script SRC="langref.js"></script> <title>dx_GFX_class:&nbsp;DRAW_AdvMap</title> </head> <BODY TOPMARGIN="0"> <TABLE CLASS="buttonbarshade" CELLSPACING=0><TR><TD>&nbsp;</TD></TR></TABLE> <TABLE CLASS="buttonbartable" CELLSPACING=0> <TR ID="hdr"><TD CLASS="runninghead" NOWRAP>dx_GFX_class:&nbsp;DRAW_AdvMap</TD></TR> </TABLE> <!-- ============ METHOD ENTRY ============ --> <H1>DRAW_AdvMap</H1> <P>Función avanzada de <a href="dx_GFX_class.DRAW_MapEx.html">DRAW_MapEx</a>. Dibuja un <a href="REF_Maps.html">grafico</a> con efectos aplicándole perspectiva. <PRE class=syntax><B><font color="darkblue">&nbsp;Public</font><font color="darkblue">&nbsp;Sub</font><b><i>&nbsp;DRAW_AdvMap</i></b>( &nbsp;<b><i>&nbsp;Map</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>, &nbsp;<b><i>&nbsp;X</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>, &nbsp;<b><i>&nbsp;Y</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>, &nbsp;<b><i>&nbsp;Z</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>, &nbsp;<b><i>&nbsp;Width</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>, &nbsp;<i>&nbsp;Height</i><font color="darkblue">&nbsp;As&nbsp;Long</font>, &nbsp;<b><i>&nbsp;AlphaBlendMode</i></b><font color="darkblue">&nbsp;As</font><b><i>&nbsp;Blit_Alpha</i></b>, &nbsp;<b><i>&nbsp;Color</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>, &nbsp;<b><i>&nbsp;Mirror</i></b><font color="darkblue">&nbsp;As</font><b><i>&nbsp;Blit_Mirror</i></b>, &nbsp;<b><i>&nbsp;Filter</i></b><font color="darkblue">&nbsp;As</font><b><i>&nbsp;Blit_Filter</i></b>, &nbsp;<b><i>&nbsp;Perspective</i></b><font color="darkblue">&nbsp;As</font><b><i>&nbsp;Blit_Perspective</i></b>, &nbsp;<font color="darkblue">&nbsp;Optional</font><b><i>&nbsp;Factor</i></b><font color="darkblue">&nbsp;As</font><font color="darkblue">&nbsp;Long</font>&nbsp;)</B></PRE> <H4>Argumentos</H4> <DL> <DT><I>Map</I></TD> <DD> <B>Long</B>. Identificador del grafico. </DD> <DT><I>X</I></TD> <DD> <B>Long</B>. Coordenada horizontal de dibujo. </DD> <DT><I>Y</I></TD> <DD> <B>Long</B>. Coordenada vertical de dibujo. </DD> <DT><I>Z</I></TD> <DD> <B>Long</B>. Coordenada de profundidad de dibujo. Para saber como funciona este parámetro leer información acerca del <a href="REF_ZBuffer.html">ZBuffer</a>.</DD> <DT><I>Width</I></TD> <DD> <B>Long</B>. Anchura con la que se dibujara el grafico. Si el valor es 0 se toma las dimensiones originales del grafico, si el valor es -1 se toma la dimensiones del grafico en memoria. </DD> <DT><I>Height</I></TD> <DD> <B>Long</B>. Altura con la que se dibujara el grafico. Si el valor es 0 se toma las dimensiones originales del grafico, si el valor es -1 se toma la dimensiones del grafico en memoria. </DD> <DT><I>AlphaBlendMode</I></TD> <DD> <B><A href="dx_GFX_class.Blit_Alpha.html">Blit_Alpha</A></B>. Modo de opacidad. </DD> <DT><I>Color</I></TD> <DD> <B>Long</B>. Color <a href="REF_ARGB.html">ARGB</a> que se aplicara para realizar la operación de dibujo. Para que el grafico se dibuje con los colores originales el valor debe ser blanco puro <i>(&amp;HFFFFFFFF o ARGB 255, 255, 255, 255). </i>El componente Alpha del color no se aplicara en los modos de opacidad <a href="dx_GFX_class.Blit_Alpha.html">BlendOp_Aditive</a> y <a href="dx_GFX_class.Blit_Alpha.html">BlendOp_Sustrative</a>. </DD> <DT><I>Mirror</I></TD> <DD> <B><A href="dx_GFX_class.Blit_Mirror.html">Blit_Mirror</A></B>. Modo de espejado. </DD> <DT><I>Filter</I></TD> <DD> <B><A href="dx_GFX_class.Blit_Filter.html">Blit_Filter</A></B>. Filtro de suavizado que se utilizara para dibujar el grafico. </DD> <DT><I>Perspective</I></TD> <DD> <B><A href="dx_GFX_class.Blit_Perspective.html">Blit_Perspective</A></B>. Especifica el modo de perspectiva que tendrá el grafico en pantalla.</DD> <DT><I>Factor</I></TD> <DD> Optional. <B>Long</B>. Parámetro opcional que permite introducir un valor para alterar la perspectiva final. Este parametro no afecta a la constante <a href="dx_GFX_class.Blit_Perspective.html">Isometric_Base</a></DD> </DL> <H4>Comentarios</H4> <P>Esta función añade extras a la versión de <a href="dx_GFX_class.DRAW_Map.html">DRAW_Map</a> permitiendo operaciones de espejados, opacidad (Alpha Blending), filtrado para suavizar los píxeles del grafico en pantalla y posibilidad de proyectar un grafico en perspectiva tanto caballera como isométrica. </P> <H4>Vea también</H4> <P> <A HREF="dx_lib32.html">Proyecto dx_lib32 Descripción</A> <A HREF="dx_GFX_class.html">Clase dx_GFX_class Descripción</A> <A HREF="dx_GFX_class.html#public_props">dx_GFX_class Propiedades</A> <A HREF="dx_GFX_class.html#public_methods">dx_GFX_class Metodos</A> <B><A HREF="dx_GFX_class.DRAW_AdvBox.html">DRAW_AdvBox</A></B> <B><A HREF="dx_GFX_class.DRAW_Box.html">DRAW_Box</A></B> <DIV class=footer>dx_lib32 © 2004 - 2009 José Miguel Sánchez Fernández <P>Generado el viernes 02 de enero del 2009 con VBDOX 1.0.34 (<A href="http://vbdox.sourceforge.net/">http://vbdox.sourceforge.net</A>)<BR>Copyright &copy; 2000 - 2001 M.Stamenov</DIV> <DIV class=footer style="COLOR: #000000; FONT-SIZE: 90%"> </body> </html>
VisualStudioEX3/dx_lib32
Documentacion/dx_GFX_class.DRAW_AdvMap.html
HTML
lgpl-2.1
5,765
//---------------------------------------------------------------------------- // This is autogenerated code by CppSharp. // Do not edit this file or all your changes will be lost after re-generation. //---------------------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Security; namespace Webbed.Scripting.Interop { // DEBUG: typedef struct _WebKitIconDatabasePrivate WebKitIconDatabasePrivate // DEBUG: struct _WebKitIconDatabasePrivate [StructLayout(LayoutKind.Explicit, Size = 0)] public unsafe struct _cPrivate { } // DEBUG: struct _WebKitIconDatabase { GObject parent_instance; /*< private >*/ WebKitIconDatabasePrivate* priv;} [StructLayout(LayoutKind.Explicit, Size = 16)] public unsafe struct _WebKitIconDatabase { // DEBUG: GObject parent_instance [FieldOffset(0)] public _GObject parent_instance; // DEBUG: WebKitIconDatabasePrivate* priv [FieldOffset(12)] public global::System.IntPtr priv; } // DEBUG: struct _WebKitIconDatabaseClass { GObjectClass parent_class; /* Padding for future expansion */ void (*_webkit_reserved1) (void); void (*_webkit_reserved2) (void); void (*_webkit_reserved3) (void); void (*_webkit_reserved4) (void);} [StructLayout(LayoutKind.Explicit, Size = 84)] public unsafe struct _WebKitIconDatabaseClass { // DEBUG: GObjectClass parent_class [FieldOffset(0)] public _GObjectClass parent_class; } public unsafe partial class WebKitIconDatabase : GLib.Object { public WebKitIconDatabase(IntPtr handle):base(handle){}; // DEBUG: WEBKIT_API GTypewebkit_icon_database_get_type (void) [SuppressUnmanagedCodeSecurity] [DllImport("webkitgtk-1.0", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="webkit_icon_database_get_type")] internal static extern uint webkit_icon_database_get_type(); public GLib.GType Type { get { return new GLib.GType((IntPtr)webkit_icon_database_get_type()); } } // DEBUG: WEBKIT_API const gchar*webkit_icon_database_get_path (WebKitIconDatabase* database) [SuppressUnmanagedCodeSecurity] [DllImport("webkitgtk-1.0", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, CharSet = CharSet.Ansi EntryPoint="webkit_icon_database_get_path")] internal static extern string webkit_icon_database_get_path(global::System.IntPtr database); public string Path { get { return webkit_icon_database_get_path(this.Handle); } set{ webkit_icon_database_set_path(this.Handle, value); } } // DEBUG: WEBKIT_API voidwebkit_icon_database_set_path (WebKitIconDatabase* database, const gchar* path) [SuppressUnmanagedCodeSecurity] [DllImport("webkitgtk-1.0", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, CharSet = CharSet.Ansi EntryPoint="webkit_icon_database_set_path")] internal static extern void webkit_icon_database_set_path(global::System.IntPtr database, string path); // DEBUG: WEBKIT_API gchar*webkit_icon_database_get_icon_uri (WebKitIconDatabase* database, const gchar* page_uri) [SuppressUnmanagedCodeSecurity] [DllImport("webkitgtk-1.0", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, CharSet = CharSet.Ansi EntryPoint="webkit_icon_database_get_icon_uri")] internal static extern string webkit_icon_database_get_icon_uri(global::System.IntPtr database, string page_uri); public string GetIconUri(string page_uri){ return webkit_icon_database_get_icon_uri(this.Handle,page_uri); } // DEBUG: WEBKIT_API GdkPixbuf*webkit_icon_database_get_icon_pixbuf (WebKitIconDatabase* database, const gchar* page_uri) [SuppressUnmanagedCodeSecurity] [DllImport("webkitgtk-1.0", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, CharSet = CharSet.Ansi EntryPoint="webkit_icon_database_get_icon_pixbuf")] internal static extern global::System.IntPtr webkit_icon_database_get_icon_pixbuf(global::System.IntPtr database, string page_uri); public Gdk.Pixbuf GetIconPixbuf(string page_uri){ return new Gdk.Pixbuf( webkit_icon_database_get_icon_pixbuf(this.Handle,page_uri)); } // DEBUG: WEBKIT_API voidwebkit_icon_database_clear (WebKitIconDatabase* database) [SuppressUnmanagedCodeSecurity] [DllImport("webkitgtk-1.0", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="webkit_icon_database_clear")] internal static extern void webkit_icon_database_clear(global::System.IntPtr database); public void Clear(){ webkit_icon_database_clear(this.Handle); } } }
micrexp/gtkwebkitsharp
Webkit/webkiticondatabase.cs
C#
lgpl-2.1
5,202
#include "nova_renderer/util/platform.hpp" #ifdef NOVA_LINUX #include "x11_window.hpp" namespace nova::renderer { x11_window::x11_window(uint32_t width, uint32_t height, const std::string& title) { display = XOpenDisplay(nullptr); if(display == nullptr) { throw window_creation_error("Failed to open XDisplay"); } // NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) int screen = DefaultScreen(display); window = XCreateSimpleWindow(display, RootWindow(display, screen), // NOLINT(cppcoreguidelines-pro-type-cstyle-cast) 50, 50, width, height, 1, BlackPixel(display, screen), // NOLINT(cppcoreguidelines-pro-type-cstyle-cast) WhitePixel(display, screen)); // NOLINT(cppcoreguidelines-pro-type-cstyle-cast) XStoreName(display, window, title.c_str()); wm_protocols = XInternAtom(display, "WM_PROTOCOLS", 0); wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", 0); XSetWMProtocols(display, window, &wm_delete_window, 1); XSelectInput(display, window, ExposureMask | ButtonPressMask | KeyPressMask); XMapWindow(display, window); } x11_window::~x11_window() { XUnmapWindow(display, window); XDestroyWindow(display, window); XCloseDisplay(display); } Window& x11_window::get_x11_window() { return window; } Display* x11_window::get_display() { return display; } void x11_window::on_frame_end() { XEvent event; while(XPending(display) != 0) { XNextEvent(display, &event); switch(event.type) { case ClientMessage: { if(event.xclient.message_type == wm_protocols && event.xclient.data.l[0] == static_cast<long>(wm_delete_window)) { should_window_close = true; } break; } default: break; } } } bool x11_window::should_close() const { return should_window_close; } glm::uvec2 x11_window::get_window_size() const { Window root_window; int x_pos; int y_pos; uint32_t width; uint32_t height; uint32_t border_width; uint32_t depth; XGetGeometry(display, window, &root_window, &x_pos, &y_pos, &width, &height, &border_width, &depth); return {width, height}; } } // namespace nova::renderer #endif
DethRaid/vulkan-mod
src/render_engine/vulkan/x11_window.cpp
C++
lgpl-2.1
2,769
<?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: wateringconfigdialog.h Example File (help/contextsensitivehelp/wateringconfigdialog.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> <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">wateringconfigdialog.h Example File</h1> <span class="small-subtitle">help/contextsensitivehelp/wateringconfigdialog.h</span> <!-- $$$help/contextsensitivehelp/wateringconfigdialog.h-description --> <div class="descr"> <a name="details"></a> <pre class="cpp"> <span class="comment">/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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: ** ** &quot;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 Digia Plc 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 ** &quot;AS IS&quot; 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.&quot; ** ** $QT_END_LICENSE$ ** ****************************************************************************/</span> <span class="preprocessor">#ifndef WATERINGCONFIGDIALOG_H</span> <span class="preprocessor">#define WATERINGCONFIGDIALOG_H</span> <span class="preprocessor">#include &lt;QtGui/QDialog&gt;</span> <span class="preprocessor">#include &quot;ui_wateringconfigdialog.h&quot;</span> <span class="keyword">class</span> WateringConfigDialog : <span class="keyword">public</span> <span class="type"><a href="qdialog.html">QDialog</a></span> { Q_OBJECT <span class="keyword">public</span>: WateringConfigDialog(); <span class="keyword">private</span> <span class="keyword">slots</span>: <span class="type">void</span> focusChanged(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>old<span class="operator">,</span> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>now); <span class="keyword">private</span>: Ui<span class="operator">::</span>WateringConfigDialog m_ui; <span class="type"><a href="qmap.html">QMap</a></span><span class="operator">&lt;</span><span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">*</span><span class="operator">,</span> <span class="type"><a href="qstring.html">QString</a></span><span class="operator">&gt;</span> m_widgetInfo; }; <span class="preprocessor">#endif</span></pre> </div> <!-- @@@help/contextsensitivehelp/wateringconfigdialog.h --> </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/help-contextsensitivehelp-wateringconfigdialog-h.html
HTML
lgpl-2.1
12,785
package codechicken.lib.math; import net.minecraft.util.math.BlockPos; //TODO cleanup. public class MathHelper { public static final double phi = 1.618033988749894; public static final double pi = Math.PI; public static final double todeg = 57.29577951308232; public static final double torad = 0.017453292519943; public static final double sqrt2 = 1.414213562373095; public static double[] SIN_TABLE = new double[65536]; static { for (int i = 0; i < 65536; ++i) { SIN_TABLE[i] = Math.sin(i / 65536D * 2 * Math.PI); } SIN_TABLE[0] = 0; SIN_TABLE[16384] = 1; SIN_TABLE[32768] = 0; SIN_TABLE[49152] = 1; } public static double sin(double d) { return SIN_TABLE[(int) ((float) d * 10430.378F) & 65535]; } public static double cos(double d) { return SIN_TABLE[(int) ((float) d * 10430.378F + 16384.0F) & 65535]; } /** * @param a The value * @param b The value to approach * @param max The maximum step * @return the closed value to b no less than max from a */ public static float approachLinear(float a, float b, float max) { return (a > b) ? (a - b < max ? b : a - max) : (b - a < max ? b : a + max); } /** * @param a The value * @param b The value to approach * @param max The maximum step * @return the closed value to b no less than max from a */ public static double approachLinear(double a, double b, double max) { return (a > b) ? (a - b < max ? b : a - max) : (b - a < max ? b : a + max); } /** * @param a The first value * @param b The second value * @param d The interpolation factor, between 0 and 1 * @return a+(b-a)*d */ public static float interpolate(float a, float b, float d) { return a + (b - a) * d; } /** * @param a The first value * @param b The second value * @param d The interpolation factor, between 0 and 1 * @return a+(b-a)*d */ public static double interpolate(double a, double b, double d) { return a + (b - a) * d; } /** * @param a The value * @param b The value to approach * @param ratio The ratio to reduce the difference by * @return a+(b-a)*ratio */ public static double approachExp(double a, double b, double ratio) { return a + (b - a) * ratio; } /** * @param a The value * @param b The value to approach * @param ratio The ratio to reduce the difference by * @param cap The maximum amount to advance by * @return a+(b-a)*ratio */ public static double approachExp(double a, double b, double ratio, double cap) { double d = (b - a) * ratio; if (Math.abs(d) > cap) { d = Math.signum(d) * cap; } return a + d; } /** * @param a The value * @param b The value to approach * @param ratio The ratio to reduce the difference by * @param c The value to retreat from * @param kick The difference when a == c * @return */ public static double retreatExp(double a, double b, double c, double ratio, double kick) { double d = (Math.abs(c - a) + kick) * ratio; if (d > Math.abs(b - a)) { return b; } return a + Math.signum(b - a) * d; } /** * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static double clip(double value, double min, double max) { if (value > max) { value = max; } if (value < min) { value = min; } return value; } /** * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static float clip(float value, float min, float max) { if (value > max) { value = max; } if (value < min) { value = min; } return value; } /** * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static int clip(int value, int min, int max) { if (value > max) { value = max; } if (value < min) { value = min; } return value; } /** * Maps a value range to another value range. * * @param valueIn The value to map. * @param inMin The minimum of the input value range. * @param inMax The maximum of the input value range * @param outMin The minimum of the output value range. * @param outMax The maximum of the output value range. * @return The mapped value. */ public static double map(double valueIn, double inMin, double inMax, double outMin, double outMax) { return (valueIn - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } /** * Maps a value range to another value range. * * @param valueIn The value to map. * @param inMin The minimum of the input value range. * @param inMax The maximum of the input value range * @param outMin The minimum of the output value range. * @param outMax The maximum of the output value range. * @return The mapped value. */ public static float map(float valueIn, float inMin, float inMax, float outMin, float outMax) { return (valueIn - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } /** * Rounds the number of decimal places based on the given multiplier.<br> * e.g.<br> * Input: 17.5245743<br> * multiplier: 1000<br> * Output: 17.534<br> * multiplier: 10<br> * Output 17.5<br><br> * * @param number The input value. * @param multiplier The multiplier. * @return The input rounded to a number of decimal places based on the multiplier. */ public static double round(double number, double multiplier) { return Math.round(number * multiplier) / multiplier; } /** * Rounds the number of decimal places based on the given multiplier.<br> * e.g.<br> * Input: 17.5245743<br> * multiplier: 1000<br> * Output: 17.534<br> * multiplier: 10<br> * Output 17.5<br><br> * * @param number The input value. * @param multiplier The multiplier. * @return The input rounded to a number of decimal places based on the multiplier. */ public static float round(float number, float multiplier) { return Math.round(number * multiplier) / multiplier; } /** * @return min <= value <= max */ public static boolean between(double min, double value, double max) { return min <= value && value <= max; } public static int approachExpI(int a, int b, double ratio) { int r = (int) Math.round(approachExp(a, b, ratio)); return r == a ? b : r; } public static int retreatExpI(int a, int b, int c, double ratio, int kick) { int r = (int) Math.round(retreatExp(a, b, c, ratio, kick)); return r == a ? b : r; } public static int floor(double d) { return net.minecraft.util.math.MathHelper.floor_double(d); } public static int floor(float d) { return net.minecraft.util.math.MathHelper.floor_float(d); } public static int ceil(double d) { return net.minecraft.util.math.MathHelper.ceiling_double_int(d); } public static int ceil(float d) { return net.minecraft.util.math.MathHelper.ceiling_float_int(d); } public static float sqrt(float f) { return net.minecraft.util.math.MathHelper.sqrt_float(f); } public static float sqrt(double f) { return net.minecraft.util.math.MathHelper.sqrt_double(f); } public static int roundAway(double d) { return (int) (d < 0 ? Math.floor(d) : Math.ceil(d)); } public static int compare(int a, int b) { return a == b ? 0 : a < b ? -1 : 1; } public static int compare(double a, double b) { return a == b ? 0 : a < b ? -1 : 1; } public static int absSum(BlockPos pos) { return (pos.getX() < 0 ? -pos.getX() : pos.getX()) + (pos.getY() < 0 ? -pos.getY() : pos.getY()) + (pos.getZ() < 0 ? -pos.getZ() : pos.getZ()); } public static boolean isAxial(BlockPos pos) { return pos.getX() == 0 ? (pos.getY() == 0 || pos.getZ() == 0) : (pos.getY() == 0 && pos.getZ() == 0); } public static int toSide(BlockPos pos) { if (!isAxial(pos)) { return -1; } if (pos.getY() < 0) { return 0; } if (pos.getY() > 0) { return 1; } if (pos.getZ() < 0) { return 2; } if (pos.getZ() > 0) { return 3; } if (pos.getX() < 0) { return 4; } if (pos.getX() > 0) { return 5; } return -1; } }
darkeports/tc5-port
src/main/java/thaumcraft/codechicken/lib/math/MathHelper.java
Java
lgpl-2.1
9,265
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"); /*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background-color: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { font-size: 2em; margin: 0.67em 0; } mark { background: #ff0; color: #000; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { box-sizing: content-box; height: 0; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-appearance: textfield; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; box-shadow: none !important; text-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } .navbar { display: none; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url('../../../vendor_bundled/vendor/twitter/bootstrap/fonts/glyphicons-halflings-regular.eot'); src: url('../../../vendor_bundled/vendor/twitter/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../../../vendor_bundled/vendor/twitter/bootstrap/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../../../vendor_bundled/vendor/twitter/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'), url('../../../vendor_bundled/vendor/twitter/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../../../vendor_bundled/vendor/twitter/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { content: "\002a"; } .glyphicon-plus:before { content: "\002b"; } .glyphicon-euro:before, .glyphicon-eur:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-lock:before { content: "\e033"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-bookmark:before { content: "\e044"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-camera:before { content: "\e046"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-fire:before { content: "\e104"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-calendar:before { content: "\e109"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-bell:before { content: "\e123"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-wrench:before { content: "\e136"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-briefcase:before { content: "\e139"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-paperclip:before { content: "\e142"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-pushpin:before { content: "\e146"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } .glyphicon-cd:before { content: "\e201"; } .glyphicon-save-file:before { content: "\e202"; } .glyphicon-open-file:before { content: "\e203"; } .glyphicon-level-up:before { content: "\e204"; } .glyphicon-copy:before { content: "\e205"; } .glyphicon-paste:before { content: "\e206"; } .glyphicon-alert:before { content: "\e209"; } .glyphicon-equalizer:before { content: "\e210"; } .glyphicon-king:before { content: "\e211"; } .glyphicon-queen:before { content: "\e212"; } .glyphicon-pawn:before { content: "\e213"; } .glyphicon-bishop:before { content: "\e214"; } .glyphicon-knight:before { content: "\e215"; } .glyphicon-baby-formula:before { content: "\e216"; } .glyphicon-tent:before { content: "\26fa"; } .glyphicon-blackboard:before { content: "\e218"; } .glyphicon-bed:before { content: "\e219"; } .glyphicon-apple:before { content: "\f8ff"; } .glyphicon-erase:before { content: "\e221"; } .glyphicon-hourglass:before { content: "\231b"; } .glyphicon-lamp:before { content: "\e223"; } .glyphicon-duplicate:before { content: "\e224"; } .glyphicon-piggy-bank:before { content: "\e225"; } .glyphicon-scissors:before { content: "\e226"; } .glyphicon-bitcoin:before { content: "\e227"; } .glyphicon-btc:before { content: "\e227"; } .glyphicon-xbt:before { content: "\e227"; } .glyphicon-yen:before { content: "\00a5"; } .glyphicon-jpy:before { content: "\00a5"; } .glyphicon-ruble:before { content: "\20bd"; } .glyphicon-rub:before { content: "\20bd"; } .glyphicon-scale:before { content: "\e230"; } .glyphicon-ice-lolly:before { content: "\e231"; } .glyphicon-ice-lolly-tasted:before { content: "\e232"; } .glyphicon-education:before { content: "\e233"; } .glyphicon-option-horizontal:before { content: "\e234"; } .glyphicon-option-vertical:before { content: "\e235"; } .glyphicon-menu-hamburger:before { content: "\e236"; } .glyphicon-modal-window:before { content: "\e237"; } .glyphicon-oil:before { content: "\e238"; } .glyphicon-grain:before { content: "\e239"; } .glyphicon-sunglasses:before { content: "\e240"; } .glyphicon-text-size:before { content: "\e241"; } .glyphicon-text-color:before { content: "\e242"; } .glyphicon-text-background:before { content: "\e243"; } .glyphicon-object-align-top:before { content: "\e244"; } .glyphicon-object-align-bottom:before { content: "\e245"; } .glyphicon-object-align-horizontal:before { content: "\e246"; } .glyphicon-object-align-left:before { content: "\e247"; } .glyphicon-object-align-vertical:before { content: "\e248"; } .glyphicon-object-align-right:before { content: "\e249"; } .glyphicon-triangle-right:before { content: "\e250"; } .glyphicon-triangle-left:before { content: "\e251"; } .glyphicon-triangle-bottom:before { content: "\e252"; } .glyphicon-triangle-top:before { content: "\e253"; } .glyphicon-console:before { content: "\e254"; } .glyphicon-superscript:before { content: "\e255"; } .glyphicon-subscript:before { content: "\e256"; } .glyphicon-menu-left:before { content: "\e257"; } .glyphicon-menu-right:before { content: "\e258"; } .glyphicon-menu-down:before { content: "\e259"; } .glyphicon-menu-up:before { content: "\e260"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.846; color: #666666; background-color: #ffffff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #2196f3; text-decoration: none; } a:hover, a:focus { color: #0a6ebd; text-decoration: underline; } a:focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; } .img-rounded { border-radius: 3px; } .img-thumbnail { padding: 4px; line-height: 1.846; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 3px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 23px; margin-bottom: 23px; border: 0; border-top: 1px solid #eeeeee; } .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } [role="button"] { cursor: pointer; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 400; line-height: 1.1; color: #444444; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { font-weight: normal; line-height: 1; color: #bbbbbb; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 23px; margin-bottom: 11.5px; } h1 small, .h1 small, h2 small, .h2 small, h3 small, .h3 small, h1 .small, .h1 .small, h2 .small, .h2 .small, h3 .small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 11.5px; margin-bottom: 11.5px; } h4 small, .h4 small, h5 small, .h5 small, h6 small, .h6 small, h4 .small, .h4 .small, h5 .small, .h5 .small, h6 .small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 56px; } h2, .h2 { font-size: 45px; } h3, .h3 { font-size: 34px; } h4, .h4 { font-size: 24px; } h5, .h5 { font-size: 20px; } h6, .h6 { font-size: 14px; } p { margin: 0 0 11.5px; } .lead { margin-bottom: 23px; font-size: 14px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 19.5px; } } small, .small { font-size: 92%; } mark, .mark { background-color: #ffe0b2; padding: .2em; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } .text-nowrap { white-space: nowrap; } .text-lowercase { text-transform: lowercase; } .text-uppercase { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #bbbbbb; } .text-primary { color: #2196f3; } a.text-primary:hover, a.text-primary:focus { color: #0c7cd5; } .text-success { color: #4caf50; } a.text-success:hover, a.text-success:focus { color: #3d8b40; } .text-info { color: #9c27b0; } a.text-info:hover, a.text-info:focus { color: #771e86; } .text-warning { color: #ff9800; } a.text-warning:hover, a.text-warning:focus { color: #cc7a00; } .text-danger { color: #e51c23; } a.text-danger:hover, a.text-danger:focus { color: #b9151b; } .bg-primary { color: #fff; background-color: #2196f3; } a.bg-primary:hover, a.bg-primary:focus { background-color: #0c7cd5; } .bg-success { background-color: #dff0d8; } a.bg-success:hover, a.bg-success:focus { background-color: #c1e2b3; } .bg-info { background-color: #e1bee7; } a.bg-info:hover, a.bg-info:focus { background-color: #d099d9; } .bg-warning { background-color: #ffe0b2; } a.bg-warning:hover, a.bg-warning:focus { background-color: #ffcb7f; } .bg-danger { background-color: #f9bdbb; } a.bg-danger:hover, a.bg-danger:focus { background-color: #f5908c; } .page-header { padding-bottom: 10.5px; margin: 46px 0 23px; border-bottom: 1px solid #eeeeee; } ul, ol { margin-top: 0; margin-bottom: 11.5px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; margin-left: -5px; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } dl { margin-top: 0; margin-bottom: 23px; } dt, dd { line-height: 1.846; } dt { font-weight: bold; } dd { margin-left: 0; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #bbbbbb; } .initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 11.5px 23px; margin: 0 0 23px; font-size: 16.25px; border-left: 5px solid #eeeeee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.846; color: #bbbbbb; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; text-align: right; } .blockquote-reverse footer:before, blockquote.pull-right footer:before, .blockquote-reverse small:before, blockquote.pull-right small:before, .blockquote-reverse .small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, blockquote.pull-right footer:after, .blockquote-reverse small:after, blockquote.pull-right small:after, .blockquote-reverse .small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } address { margin-bottom: 23px; font-style: normal; line-height: 1.846; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #444444; background-color: #f8f8f8; border-radius: 3px; } kbd { padding: 2px 4px; font-size: 90%; color: #ffffff; background-color: #333333; border-radius: 3px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } kbd kbd { padding: 0; font-size: 100%; font-weight: bold; box-shadow: none; } pre { display: block; padding: 11px; margin: 0 0 11.5px; font-size: 12px; line-height: 1.846; word-break: break-all; word-wrap: break-word; color: #212121; background-color: #f5f5f5; border: 1px solid #cccccc; border-radius: 3px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } } .container-fluid { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .row { margin-left: -15px; margin-right: -15px; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { float: left; } .col-xs-12 { width: 100%; } .col-xs-11 { width: 91.66666667%; } .col-xs-10 { width: 83.33333333%; } .col-xs-9 { width: 75%; } .col-xs-8 { width: 66.66666667%; } .col-xs-7 { width: 58.33333333%; } .col-xs-6 { width: 50%; } .col-xs-5 { width: 41.66666667%; } .col-xs-4 { width: 33.33333333%; } .col-xs-3 { width: 25%; } .col-xs-2 { width: 16.66666667%; } .col-xs-1 { width: 8.33333333%; } .col-xs-pull-12 { right: 100%; } .col-xs-pull-11 { right: 91.66666667%; } .col-xs-pull-10 { right: 83.33333333%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-8 { right: 66.66666667%; } .col-xs-pull-7 { right: 58.33333333%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-5 { right: 41.66666667%; } .col-xs-pull-4 { right: 33.33333333%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-2 { right: 16.66666667%; } .col-xs-pull-1 { right: 8.33333333%; } .col-xs-pull-0 { right: auto; } .col-xs-push-12 { left: 100%; } .col-xs-push-11 { left: 91.66666667%; } .col-xs-push-10 { left: 83.33333333%; } .col-xs-push-9 { left: 75%; } .col-xs-push-8 { left: 66.66666667%; } .col-xs-push-7 { left: 58.33333333%; } .col-xs-push-6 { left: 50%; } .col-xs-push-5 { left: 41.66666667%; } .col-xs-push-4 { left: 33.33333333%; } .col-xs-push-3 { left: 25%; } .col-xs-push-2 { left: 16.66666667%; } .col-xs-push-1 { left: 8.33333333%; } .col-xs-push-0 { left: auto; } .col-xs-offset-12 { margin-left: 100%; } .col-xs-offset-11 { margin-left: 91.66666667%; } .col-xs-offset-10 { margin-left: 83.33333333%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-8 { margin-left: 66.66666667%; } .col-xs-offset-7 { margin-left: 58.33333333%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-5 { margin-left: 41.66666667%; } .col-xs-offset-4 { margin-left: 33.33333333%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-2 { margin-left: 16.66666667%; } .col-xs-offset-1 { margin-left: 8.33333333%; } .col-xs-offset-0 { margin-left: 0%; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-12 { width: 100%; } .col-sm-11 { width: 91.66666667%; } .col-sm-10 { width: 83.33333333%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.66666667%; } .col-sm-7 { width: 58.33333333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.66666667%; } .col-sm-4 { width: 33.33333333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.66666667%; } .col-sm-1 { width: 8.33333333%; } .col-sm-pull-12 { right: 100%; } .col-sm-pull-11 { right: 91.66666667%; } .col-sm-pull-10 { right: 83.33333333%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-8 { right: 66.66666667%; } .col-sm-pull-7 { right: 58.33333333%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-5 { right: 41.66666667%; } .col-sm-pull-4 { right: 33.33333333%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-2 { right: 16.66666667%; } .col-sm-pull-1 { right: 8.33333333%; } .col-sm-pull-0 { right: auto; } .col-sm-push-12 { left: 100%; } .col-sm-push-11 { left: 91.66666667%; } .col-sm-push-10 { left: 83.33333333%; } .col-sm-push-9 { left: 75%; } .col-sm-push-8 { left: 66.66666667%; } .col-sm-push-7 { left: 58.33333333%; } .col-sm-push-6 { left: 50%; } .col-sm-push-5 { left: 41.66666667%; } .col-sm-push-4 { left: 33.33333333%; } .col-sm-push-3 { left: 25%; } .col-sm-push-2 { left: 16.66666667%; } .col-sm-push-1 { left: 8.33333333%; } .col-sm-push-0 { left: auto; } .col-sm-offset-12 { margin-left: 100%; } .col-sm-offset-11 { margin-left: 91.66666667%; } .col-sm-offset-10 { margin-left: 83.33333333%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-8 { margin-left: 66.66666667%; } .col-sm-offset-7 { margin-left: 58.33333333%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-5 { margin-left: 41.66666667%; } .col-sm-offset-4 { margin-left: 33.33333333%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-2 { margin-left: 16.66666667%; } .col-sm-offset-1 { margin-left: 8.33333333%; } .col-sm-offset-0 { margin-left: 0%; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-12 { width: 100%; } .col-md-11 { width: 91.66666667%; } .col-md-10 { width: 83.33333333%; } .col-md-9 { width: 75%; } .col-md-8 { width: 66.66666667%; } .col-md-7 { width: 58.33333333%; } .col-md-6 { width: 50%; } .col-md-5 { width: 41.66666667%; } .col-md-4 { width: 33.33333333%; } .col-md-3 { width: 25%; } .col-md-2 { width: 16.66666667%; } .col-md-1 { width: 8.33333333%; } .col-md-pull-12 { right: 100%; } .col-md-pull-11 { right: 91.66666667%; } .col-md-pull-10 { right: 83.33333333%; } .col-md-pull-9 { right: 75%; } .col-md-pull-8 { right: 66.66666667%; } .col-md-pull-7 { right: 58.33333333%; } .col-md-pull-6 { right: 50%; } .col-md-pull-5 { right: 41.66666667%; } .col-md-pull-4 { right: 33.33333333%; } .col-md-pull-3 { right: 25%; } .col-md-pull-2 { right: 16.66666667%; } .col-md-pull-1 { right: 8.33333333%; } .col-md-pull-0 { right: auto; } .col-md-push-12 { left: 100%; } .col-md-push-11 { left: 91.66666667%; } .col-md-push-10 { left: 83.33333333%; } .col-md-push-9 { left: 75%; } .col-md-push-8 { left: 66.66666667%; } .col-md-push-7 { left: 58.33333333%; } .col-md-push-6 { left: 50%; } .col-md-push-5 { left: 41.66666667%; } .col-md-push-4 { left: 33.33333333%; } .col-md-push-3 { left: 25%; } .col-md-push-2 { left: 16.66666667%; } .col-md-push-1 { left: 8.33333333%; } .col-md-push-0 { left: auto; } .col-md-offset-12 { margin-left: 100%; } .col-md-offset-11 { margin-left: 91.66666667%; } .col-md-offset-10 { margin-left: 83.33333333%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-8 { margin-left: 66.66666667%; } .col-md-offset-7 { margin-left: 58.33333333%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-5 { margin-left: 41.66666667%; } .col-md-offset-4 { margin-left: 33.33333333%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-2 { margin-left: 16.66666667%; } .col-md-offset-1 { margin-left: 8.33333333%; } .col-md-offset-0 { margin-left: 0%; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66666667%; } .col-lg-10 { width: 83.33333333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66666667%; } .col-lg-7 { width: 58.33333333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66666667%; } .col-lg-1 { width: 8.33333333%; } .col-lg-pull-12 { right: 100%; } .col-lg-pull-11 { right: 91.66666667%; } .col-lg-pull-10 { right: 83.33333333%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-8 { right: 66.66666667%; } .col-lg-pull-7 { right: 58.33333333%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-5 { right: 41.66666667%; } .col-lg-pull-4 { right: 33.33333333%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-2 { right: 16.66666667%; } .col-lg-pull-1 { right: 8.33333333%; } .col-lg-pull-0 { right: auto; } .col-lg-push-12 { left: 100%; } .col-lg-push-11 { left: 91.66666667%; } .col-lg-push-10 { left: 83.33333333%; } .col-lg-push-9 { left: 75%; } .col-lg-push-8 { left: 66.66666667%; } .col-lg-push-7 { left: 58.33333333%; } .col-lg-push-6 { left: 50%; } .col-lg-push-5 { left: 41.66666667%; } .col-lg-push-4 { left: 33.33333333%; } .col-lg-push-3 { left: 25%; } .col-lg-push-2 { left: 16.66666667%; } .col-lg-push-1 { left: 8.33333333%; } .col-lg-push-0 { left: auto; } .col-lg-offset-12 { margin-left: 100%; } .col-lg-offset-11 { margin-left: 91.66666667%; } .col-lg-offset-10 { margin-left: 83.33333333%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-8 { margin-left: 66.66666667%; } .col-lg-offset-7 { margin-left: 58.33333333%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-5 { margin-left: 41.66666667%; } .col-lg-offset-4 { margin-left: 33.33333333%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-2 { margin-left: 16.66666667%; } .col-lg-offset-1 { margin-left: 8.33333333%; } .col-lg-offset-0 { margin-left: 0%; } } table { background-color: transparent; } caption { padding-top: 8px; padding-bottom: 8px; color: #bbbbbb; text-align: left; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 23px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.846; vertical-align: top; border-top: 1px solid #dddddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #dddddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #dddddd; } .table .table { background-color: #ffffff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9f9f9; } .table-hover > tbody > tr:hover { background-color: #f5f5f5; } table col[class*="col-"] { position: static; float: none; display: table-column; } table td[class*="col-"], table th[class*="col-"] { position: static; float: none; display: table-cell; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #e1bee7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #d8abe0; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #ffe0b2; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #ffd699; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f9bdbb; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #f7a6a4; } .table-responsive { overflow-x: auto; min-height: 0.01%; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 17.25px; overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #dddddd; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; min-width: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 23px; font-size: 19.5px; line-height: inherit; color: #212121; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 13px; line-height: 1.846; color: #666666; } .form-control { display: block; width: 100%; height: 37px; padding: 6px 16px; font-size: 13px; line-height: 1.846; color: #666666; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 3px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { color: #bbbbbb; opacity: 1; } .form-control:-ms-input-placeholder { color: #bbbbbb; } .form-control::-webkit-input-placeholder { color: #bbbbbb; } .form-control::-ms-expand { border: 0; background-color: transparent; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: transparent; opacity: 1; } .form-control[disabled], fieldset[disabled] .form-control { cursor: not-allowed; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } @media screen and (-webkit-min-device-pixel-ratio: 0) { input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control, input[type="month"].form-control { line-height: 37px; } input[type="date"].input-sm, input[type="time"].input-sm, input[type="datetime-local"].input-sm, input[type="month"].input-sm, .input-group-sm input[type="date"], .input-group-sm input[type="time"], .input-group-sm input[type="datetime-local"], .input-group-sm input[type="month"] { line-height: 30px; } input[type="date"].input-lg, input[type="time"].input-lg, input[type="datetime-local"].input-lg, input[type="month"].input-lg, .input-group-lg input[type="date"], .input-group-lg input[type="time"], .input-group-lg input[type="datetime-local"], .input-group-lg input[type="month"] { line-height: 45px; } } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { min-height: 23px; padding-left: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: absolute; margin-left: -20px; margin-top: 4px \9; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"].disabled, input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, .checkbox-inline.disabled, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, .checkbox.disabled label, fieldset[disabled] .radio label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; min-height: 36px; } .form-control-static.input-lg, .form-control-static.input-sm { padding-left: 0; padding-right: 0; } .input-sm { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm, select[multiple].input-sm { height: auto; } .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .form-group-sm select.form-control { height: 30px; line-height: 30px; } .form-group-sm textarea.form-control, .form-group-sm select[multiple].form-control { height: auto; } .form-group-sm .form-control-static { height: 30px; min-height: 35px; padding: 6px 10px; font-size: 12px; line-height: 1.5; } .input-lg { height: 45px; padding: 10px 16px; font-size: 17px; line-height: 1.3333333; border-radius: 3px; } select.input-lg { height: 45px; line-height: 45px; } textarea.input-lg, select[multiple].input-lg { height: auto; } .form-group-lg .form-control { height: 45px; padding: 10px 16px; font-size: 17px; line-height: 1.3333333; border-radius: 3px; } .form-group-lg select.form-control { height: 45px; line-height: 45px; } .form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control { height: auto; } .form-group-lg .form-control-static { height: 45px; min-height: 40px; padding: 11px 16px; font-size: 17px; line-height: 1.3333333; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 46.25px; } .form-control-feedback { position: absolute; top: 0; right: 0; z-index: 2; display: block; width: 37px; height: 37px; line-height: 37px; text-align: center; pointer-events: none; } .input-lg + .form-control-feedback, .input-group-lg + .form-control-feedback, .form-group-lg .form-control + .form-control-feedback { width: 45px; height: 45px; line-height: 45px; } .input-sm + .form-control-feedback, .input-group-sm + .form-control-feedback, .form-group-sm .form-control + .form-control-feedback { width: 30px; height: 30px; line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #4caf50; } .has-success .form-control { border-color: #4caf50; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-success .form-control:focus { border-color: #3d8b40; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #92cf94; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #92cf94; } .has-success .input-group-addon { color: #4caf50; border-color: #4caf50; background-color: #dff0d8; } .has-success .form-control-feedback { color: #4caf50; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #ff9800; } .has-warning .form-control { border-color: #ff9800; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-warning .form-control:focus { border-color: #cc7a00; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffc166; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffc166; } .has-warning .input-group-addon { color: #ff9800; border-color: #ff9800; background-color: #ffe0b2; } .has-warning .form-control-feedback { color: #ff9800; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #e51c23; } .has-error .form-control { border-color: #e51c23; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-error .form-control:focus { border-color: #b9151b; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ef787c; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ef787c; } .has-error .input-group-addon { color: #e51c23; border-color: #e51c23; background-color: #f9bdbb; } .has-error .form-control-feedback { color: #e51c23; } .has-feedback label ~ .form-control-feedback { top: 28px; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #a6a6a6; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-static { display: inline-block; } .form-inline .input-group { display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control { width: auto; } .form-inline .input-group > .form-control { width: 100%; } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .form-inline .radio label, .form-inline .checkbox label { padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { margin-top: 0; margin-bottom: 0; padding-top: 7px; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 30px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; padding-top: 7px; } } .form-horizontal .has-feedback .form-control-feedback { right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 11px; font-size: 17px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; font-size: 12px; } } .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 16px; font-size: 13px; line-height: 1.846; border-radius: 3px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn.active.focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus, .btn.focus { color: #444444; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } a.btn.disabled, fieldset[disabled] a.btn { pointer-events: none; } .btn-default { color: #444444; background-color: #ffffff; border-color: transparent; } .btn-default:focus, .btn-default.focus { color: #444444; background-color: #e6e6e6; border-color: rgba(0, 0, 0, 0); } .btn-default:hover { color: #444444; background-color: #e6e6e6; border-color: rgba(0, 0, 0, 0); } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #444444; background-color: #e6e6e6; border-color: rgba(0, 0, 0, 0); } .btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus { color: #444444; background-color: #d4d4d4; border-color: rgba(0, 0, 0, 0); } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus { background-color: #ffffff; border-color: transparent; } .btn-default .badge { color: #ffffff; background-color: #444444; } .btn-primary { color: #ffffff; background-color: #2196f3; border-color: transparent; } .btn-primary:focus, .btn-primary.focus { color: #ffffff; background-color: #0c7cd5; border-color: rgba(0, 0, 0, 0); } .btn-primary:hover { color: #ffffff; background-color: #0c7cd5; border-color: rgba(0, 0, 0, 0); } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #ffffff; background-color: #0c7cd5; border-color: rgba(0, 0, 0, 0); } .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { color: #ffffff; background-color: #0a68b4; border-color: rgba(0, 0, 0, 0); } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus { background-color: #2196f3; border-color: transparent; } .btn-primary .badge { color: #2196f3; background-color: #ffffff; } .btn-success { color: #ffffff; background-color: #4caf50; border-color: transparent; } .btn-success:focus, .btn-success.focus { color: #ffffff; background-color: #3d8b40; border-color: rgba(0, 0, 0, 0); } .btn-success:hover { color: #ffffff; background-color: #3d8b40; border-color: rgba(0, 0, 0, 0); } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #ffffff; background-color: #3d8b40; border-color: rgba(0, 0, 0, 0); } .btn-success:active:hover, .btn-success.active:hover, .open > .dropdown-toggle.btn-success:hover, .btn-success:active:focus, .btn-success.active:focus, .open > .dropdown-toggle.btn-success:focus, .btn-success:active.focus, .btn-success.active.focus, .open > .dropdown-toggle.btn-success.focus { color: #ffffff; background-color: #327334; border-color: rgba(0, 0, 0, 0); } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus { background-color: #4caf50; border-color: transparent; } .btn-success .badge { color: #4caf50; background-color: #ffffff; } .btn-info { color: #ffffff; background-color: #9c27b0; border-color: transparent; } .btn-info:focus, .btn-info.focus { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .btn-info:hover { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .btn-info:active:hover, .btn-info.active:hover, .open > .dropdown-toggle.btn-info:hover, .btn-info:active:focus, .btn-info.active:focus, .open > .dropdown-toggle.btn-info:focus, .btn-info:active.focus, .btn-info.active.focus, .open > .dropdown-toggle.btn-info.focus { color: #ffffff; background-color: #5d1769; border-color: rgba(0, 0, 0, 0); } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus { background-color: #9c27b0; border-color: transparent; } .btn-info .badge { color: #9c27b0; background-color: #ffffff; } .btn-warning { color: #ffffff; background-color: #ff9800; border-color: transparent; } .btn-warning:focus, .btn-warning.focus { color: #ffffff; background-color: #cc7a00; border-color: rgba(0, 0, 0, 0); } .btn-warning:hover { color: #ffffff; background-color: #cc7a00; border-color: rgba(0, 0, 0, 0); } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #ffffff; background-color: #cc7a00; border-color: rgba(0, 0, 0, 0); } .btn-warning:active:hover, .btn-warning.active:hover, .open > .dropdown-toggle.btn-warning:hover, .btn-warning:active:focus, .btn-warning.active:focus, .open > .dropdown-toggle.btn-warning:focus, .btn-warning:active.focus, .btn-warning.active.focus, .open > .dropdown-toggle.btn-warning.focus { color: #ffffff; background-color: #a86400; border-color: rgba(0, 0, 0, 0); } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus { background-color: #ff9800; border-color: transparent; } .btn-warning .badge { color: #ff9800; background-color: #ffffff; } .btn-danger { color: #ffffff; background-color: #e51c23; border-color: transparent; } .btn-danger:focus, .btn-danger.focus { color: #ffffff; background-color: #b9151b; border-color: rgba(0, 0, 0, 0); } .btn-danger:hover { color: #ffffff; background-color: #b9151b; border-color: rgba(0, 0, 0, 0); } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #ffffff; background-color: #b9151b; border-color: rgba(0, 0, 0, 0); } .btn-danger:active:hover, .btn-danger.active:hover, .open > .dropdown-toggle.btn-danger:hover, .btn-danger:active:focus, .btn-danger.active:focus, .open > .dropdown-toggle.btn-danger:focus, .btn-danger:active.focus, .btn-danger.active.focus, .open > .dropdown-toggle.btn-danger.focus { color: #ffffff; background-color: #991216; border-color: rgba(0, 0, 0, 0); } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus { background-color: #e51c23; border-color: transparent; } .btn-danger .badge { color: #e51c23; background-color: #ffffff; } .btn-link { color: #2196f3; font-weight: normal; border-radius: 0; } .btn-link, .btn-link:active, .btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #0a6ebd; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #bbbbbb; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 17px; line-height: 1.3333333; border-radius: 3px; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } tr.collapse.in { display: table-row; } tbody.collapse.in { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition-property: height, visibility; transition-property: height, visibility; -webkit-transition-duration: 0.35s; transition-duration: 0.35s; -webkit-transition-timing-function: ease; transition-timing-function: ease; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px dashed; border-top: 4px solid \9; border-right: 4px solid transparent; border-left: 4px solid transparent; } .dropup, .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; font-size: 13px; text-align: left; background-color: #ffffff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 3px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 10.5px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.846; color: #666666; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #141414; background-color: #eeeeee; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; outline: 0; background-color: #2196f3; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #bbbbbb; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: not-allowed; } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { left: auto; right: 0; } .dropdown-menu-left { left: 0; right: auto; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.846; color: #bbbbbb; white-space: nowrap; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 2px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { left: auto; right: 0; } .navbar-right .dropdown-menu-left { left: 0; right: auto; } } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar .btn, .btn-toolbar .btn-group, .btn-toolbar .input-group { float: left; } .btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { margin-left: 5px; } .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; } .btn-group > .btn-lg + .dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn-group.open .dropdown-toggle.btn-link { -webkit-box-shadow: none; box-shadow: none; } .btn .caret { margin-left: 0; } .btn-lg .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 3px; border-top-left-radius: 3px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-top-right-radius: 0; border-top-left-radius: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { float: none; display: table-cell; width: 1%; } .btn-group-justified > .btn-group .btn { width: 100%; } .btn-group-justified > .btn-group .dropdown-menu { left: auto; } [data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: table; border-collapse: separate; } .input-group[class*="col-"] { float: none; padding-left: 0; padding-right: 0; } .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; margin-bottom: 0; } .input-group .form-control:focus { z-index: 3; } .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 45px; padding: 10px 16px; font-size: 17px; line-height: 1.3333333; border-radius: 3px; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 45px; line-height: 45px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn, select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn, select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 16px; font-size: 13px; font-weight: normal; line-height: 1; color: #666666; text-align: center; background-color: transparent; border: 1px solid transparent; border-radius: 3px; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 17px; border-radius: 3px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; border-top-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-bottom-left-radius: 0; border-top-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; font-size: 0; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -1px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { z-index: 2; } .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { margin-right: -1px; } .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { z-index: 2; margin-left: -1px; } .nav { margin-bottom: 0; padding-left: 0; list-style: none; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li.disabled > a { color: #bbbbbb; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #bbbbbb; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; border-color: #2196f3; } .nav .nav-divider { height: 1px; margin: 10.5px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid transparent; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.846; border: 1px solid transparent; border-radius: 3px 3px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee transparent; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #666666; background-color: transparent; border: 1px solid transparent; border-bottom-color: transparent; cursor: default; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-tabs.nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 3px; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid transparent; } @media (min-width: 768px) { .nav-tabs.nav-justified > li > a { border-bottom: 1px solid transparent; border-radius: 3px 3px 0 0; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #ffffff; } } .nav-pills > li { float: left; } .nav-pills > li > a { border-radius: 3px; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #ffffff; background-color: #2196f3; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { margin-right: 0; border-radius: 3px; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid transparent; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid transparent; border-radius: 3px 3px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #ffffff; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar { position: relative; min-height: 64px; margin-bottom: 23px; border: 1px solid transparent; } @media (min-width: 768px) { .navbar { border-radius: 3px; } } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); -webkit-overflow-scrolling: touch; } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-left: 0; padding-right: 0; } } .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 340px; } @media (max-device-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; padding: 20.5px 15px; font-size: 17px; line-height: 23px; height: 64px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: block; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; margin-right: 15px; padding: 9px 10px; margin-top: 15px; margin-bottom: 15px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 3px; } .navbar-toggle:focus { outline: 0; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 10.25px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 23px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 23px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 20.5px; padding-bottom: 20.5px; } } .navbar-form { margin-left: -15px; margin-right: -15px; padding: 10px 15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 13.5px; margin-bottom: 13.5px; } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; width: auto; vertical-align: middle; } .navbar-form .form-control-static { display: inline-block; } .navbar-form .input-group { display: inline-table; vertical-align: middle; } .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control { width: auto; } .navbar-form .input-group > .form-control { width: 100%; } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .navbar-form .radio label, .navbar-form .checkbox label { padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { top: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } .navbar-form .form-group:last-child { margin-bottom: 0; } } @media (min-width: 768px) { .navbar-form { width: auto; border: 0; margin-left: 0; margin-right: 0; padding-top: 0; padding-bottom: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; border-top-right-radius: 3px; border-top-left-radius: 3px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 13.5px; margin-bottom: 13.5px; } .navbar-btn.btn-sm { margin-top: 17px; margin-bottom: 17px; } .navbar-btn.btn-xs { margin-top: 21px; margin-bottom: 21px; } .navbar-text { margin-top: 20.5px; margin-bottom: 20.5px; } @media (min-width: 768px) { .navbar-text { float: left; margin-left: 15px; margin-right: 15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; margin-right: -15px; } .navbar-right ~ .navbar-right { margin-right: 0; } } .navbar-default { background-color: #ffffff; border-color: transparent; } .navbar-default .navbar-brand { color: #666666; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #212121; background-color: transparent; } .navbar-default .navbar-text { color: #bbbbbb; } .navbar-default .navbar-nav > li > a { color: #666666; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #212121; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #212121; background-color: #eeeeee; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #cccccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: transparent; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: transparent; } .navbar-default .navbar-toggle .icon-bar { background-color: rgba(0, 0, 0, 0.5); } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: transparent; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: #eeeeee; color: #212121; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #666666; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #212121; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #212121; background-color: #eeeeee; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #cccccc; background-color: transparent; } } .navbar-default .navbar-link { color: #666666; } .navbar-default .navbar-link:hover { color: #212121; } .navbar-default .btn-link { color: #666666; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #212121; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #cccccc; } .navbar-inverse { background-color: #2196f3; border-color: transparent; } .navbar-inverse .navbar-brand { color: #b2dbfb; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-text { color: #bbbbbb; } .navbar-inverse .navbar-nav > li > a { color: #b2dbfb; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #ffffff; background-color: #0c7cd5; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: transparent; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: transparent; } .navbar-inverse .navbar-toggle .icon-bar { background-color: rgba(0, 0, 0, 0.5); } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #0c84e4; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { background-color: #0c7cd5; color: #ffffff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #b2dbfb; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #ffffff; background-color: #0c7cd5; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #b2dbfb; } .navbar-inverse .navbar-link:hover { color: #ffffff; } .navbar-inverse .btn-link { color: #b2dbfb; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #ffffff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444444; } .breadcrumb { padding: 8px 15px; margin-bottom: 23px; list-style: none; background-color: #f5f5f5; border-radius: 3px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/\00a0"; padding: 0 5px; color: #cccccc; } .breadcrumb > .active { color: #bbbbbb; } .pagination { display: inline-block; padding-left: 0; margin: 23px 0; border-radius: 3px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 16px; line-height: 1.846; text-decoration: none; color: #2196f3; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { z-index: 2; color: #0a6ebd; background-color: #eeeeee; border-color: #dddddd; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 3; color: #ffffff; background-color: #2196f3; border-color: #2196f3; cursor: default; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #bbbbbb; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 17px; line-height: 1.3333333; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 23px 0; list-style: none; text-align: center; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eeeeee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #bbbbbb; background-color: #ffffff; cursor: not-allowed; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #ffffff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } a.label:hover, a.label:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } .label-default { background-color: #bbbbbb; } .label-default[href]:hover, .label-default[href]:focus { background-color: #a2a2a2; } .label-primary { background-color: #2196f3; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #0c7cd5; } .label-success { background-color: #4caf50; } .label-success[href]:hover, .label-success[href]:focus { background-color: #3d8b40; } .label-info { background-color: #9c27b0; } .label-info[href]:hover, .label-info[href]:focus { background-color: #771e86; } .label-warning { background-color: #ff9800; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #cc7a00; } .label-danger { background-color: #e51c23; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #b9151b; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: normal; color: #ffffff; line-height: 1; vertical-align: middle; white-space: nowrap; text-align: center; background-color: #bbbbbb; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge, .btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } a.badge:hover, a.badge:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #2196f3; background-color: #ffffff; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding-top: 30px; padding-bottom: 30px; margin-bottom: 30px; color: inherit; background-color: #f9f9f9; } .jumbotron h1, .jumbotron .h1 { color: #444444; } .jumbotron p { margin-bottom: 15px; font-size: 20px; font-weight: 200; } .jumbotron > hr { border-top-color: #e0e0e0; } .container .jumbotron, .container-fluid .jumbotron { border-radius: 3px; padding-left: 15px; padding-right: 15px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron, .container-fluid .jumbotron { padding-left: 60px; padding-right: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 59px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 23px; line-height: 1.846; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 3px; -webkit-transition: border 0.2s ease-in-out; -o-transition: border 0.2s ease-in-out; transition: border 0.2s ease-in-out; } .thumbnail > img, .thumbnail a > img { margin-left: auto; margin-right: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #2196f3; } .thumbnail .caption { padding: 9px; color: #666666; } .alert { padding: 15px; margin-bottom: 23px; border: 1px solid transparent; border-radius: 3px; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable, .alert-dismissible { padding-right: 35px; } .alert-dismissable .close, .alert-dismissible .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #4caf50; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #3d8b40; } .alert-info { background-color: #e1bee7; border-color: #cba4dd; color: #9c27b0; } .alert-info hr { border-top-color: #c191d6; } .alert-info .alert-link { color: #771e86; } .alert-warning { background-color: #ffe0b2; border-color: #ffc599; color: #ff9800; } .alert-warning hr { border-top-color: #ffb67f; } .alert-warning .alert-link { color: #cc7a00; } .alert-danger { background-color: #f9bdbb; border-color: #f7a4af; color: #e51c23; } .alert-danger hr { border-top-color: #f58c9a; } .alert-danger .alert-link { color: #b9151b; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 23px; margin-bottom: 23px; background-color: #f5f5f5; border-radius: 3px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; line-height: 23px; color: #ffffff; text-align: center; background-color: #2196f3; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; } .progress.active .progress-bar, .progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { background-color: #4caf50; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #9c27b0; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #ff9800; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #e51c23; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media, .media-body { zoom: 1; overflow: hidden; } .media-body { width: 10000px; } .media-object { display: block; } .media-object.img-thumbnail { max-width: none; } .media-right, .media > .pull-right { padding-left: 10px; } .media-left, .media > .pull-left { padding-right: 10px; } .media-left, .media-right, .media-body { display: table-cell; vertical-align: top; } .media-middle { vertical-align: middle; } .media-bottom { vertical-align: bottom; } .media-heading { margin-top: 0; margin-bottom: 5px; } .media-list { padding-left: 0; list-style: none; } .list-group { margin-bottom: 20px; padding-left: 0; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #ffffff; border: 1px solid #dddddd; } .list-group-item:first-child { border-top-right-radius: 3px; border-top-left-radius: 3px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } a.list-group-item, button.list-group-item { color: #555555; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #333333; } a.list-group-item:hover, button.list-group-item:hover, a.list-group-item:focus, button.list-group-item:focus { text-decoration: none; color: #555555; background-color: #f5f5f5; } button.list-group-item { width: 100%; text-align: left; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { background-color: #eeeeee; color: #bbbbbb; cursor: not-allowed; } .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { color: inherit; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #bbbbbb; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #ffffff; background-color: #2196f3; border-color: #2196f3; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #e3f2fd; } .list-group-item-success { color: #4caf50; background-color: #dff0d8; } a.list-group-item-success, button.list-group-item-success { color: #4caf50; } a.list-group-item-success .list-group-item-heading, button.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, button.list-group-item-success:hover, a.list-group-item-success:focus, button.list-group-item-success:focus { color: #4caf50; background-color: #d0e9c6; } a.list-group-item-success.active, button.list-group-item-success.active, a.list-group-item-success.active:hover, button.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active:focus { color: #fff; background-color: #4caf50; border-color: #4caf50; } .list-group-item-info { color: #9c27b0; background-color: #e1bee7; } a.list-group-item-info, button.list-group-item-info { color: #9c27b0; } a.list-group-item-info .list-group-item-heading, button.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, button.list-group-item-info:hover, a.list-group-item-info:focus, button.list-group-item-info:focus { color: #9c27b0; background-color: #d8abe0; } a.list-group-item-info.active, button.list-group-item-info.active, a.list-group-item-info.active:hover, button.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active:focus { color: #fff; background-color: #9c27b0; border-color: #9c27b0; } .list-group-item-warning { color: #ff9800; background-color: #ffe0b2; } a.list-group-item-warning, button.list-group-item-warning { color: #ff9800; } a.list-group-item-warning .list-group-item-heading, button.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, button.list-group-item-warning:hover, a.list-group-item-warning:focus, button.list-group-item-warning:focus { color: #ff9800; background-color: #ffd699; } a.list-group-item-warning.active, button.list-group-item-warning.active, a.list-group-item-warning.active:hover, button.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active:focus { color: #fff; background-color: #ff9800; border-color: #ff9800; } .list-group-item-danger { color: #e51c23; background-color: #f9bdbb; } a.list-group-item-danger, button.list-group-item-danger { color: #e51c23; } a.list-group-item-danger .list-group-item-heading, button.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, button.list-group-item-danger:hover, a.list-group-item-danger:focus, button.list-group-item-danger:focus { color: #e51c23; background-color: #f7a6a4; } a.list-group-item-danger.active, button.list-group-item-danger.active, a.list-group-item-danger.active:hover, button.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active:focus { color: #fff; background-color: #e51c23; border-color: #e51c23; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 23px; background-color: #ffffff; border: 1px solid transparent; border-radius: 3px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 2px; border-top-left-radius: 2px; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 15px; color: inherit; } .panel-title > a, .panel-title > small, .panel-title > .small, .panel-title > small > a, .panel-title > .small > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #dddddd; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; } .panel > .list-group, .panel > .panel-collapse > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { border-top: 0; border-top-right-radius: 2px; border-top-left-radius: 2px; } .panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { border-bottom: 0; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; } .panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .list-group + .panel-footer { border-top-width: 0; } .panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table { margin-bottom: 0; } .panel > .table caption, .panel > .table-responsive > .table caption, .panel > .panel-collapse > .table caption { padding-left: 15px; padding-right: 15px; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-right-radius: 2px; border-top-left-radius: 2px; } .panel > .table:first-child > thead:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { border-top-left-radius: 2px; border-top-right-radius: 2px; } .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 2px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 2px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; } .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 2px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 2px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { border-top: 1px solid #dddddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { border: 0; margin-bottom: 0; } .panel-group { margin-bottom: 23px; } .panel-group .panel { margin-bottom: 0; border-radius: 3px; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse > .panel-body, .panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #dddddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #dddddd; } .panel-default { border-color: #dddddd; } .panel-default > .panel-heading { color: #212121; background-color: #f5f5f5; border-color: #dddddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #dddddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #212121; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #dddddd; } .panel-primary { border-color: #2196f3; } .panel-primary > .panel-heading { color: #ffffff; background-color: #2196f3; border-color: #2196f3; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #2196f3; } .panel-primary > .panel-heading .badge { color: #2196f3; background-color: #ffffff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #2196f3; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #ffffff; background-color: #4caf50; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #4caf50; background-color: #ffffff; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #cba4dd; } .panel-info > .panel-heading { color: #ffffff; background-color: #9c27b0; border-color: #cba4dd; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #cba4dd; } .panel-info > .panel-heading .badge { color: #9c27b0; background-color: #ffffff; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #cba4dd; } .panel-warning { border-color: #ffc599; } .panel-warning > .panel-heading { color: #ffffff; background-color: #ff9800; border-color: #ffc599; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ffc599; } .panel-warning > .panel-heading .badge { color: #ff9800; background-color: #ffffff; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ffc599; } .panel-danger { border-color: #f7a4af; } .panel-danger > .panel-heading { color: #ffffff; background-color: #e51c23; border-color: #f7a4af; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #f7a4af; } .panel-danger > .panel-heading .badge { color: #e51c23; background-color: #ffffff; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #f7a4af; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; left: 0; bottom: 0; height: 100%; width: 100%; border: 0; } .embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f9f9f9; border: 1px solid transparent; border-radius: 3px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 24px; border-radius: 3px; } .well-sm { padding: 9px; border-radius: 3px; } .close { float: right; font-size: 19.5px; font-weight: normal; line-height: 1; color: #000000; text-shadow: none; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000000; text-decoration: none; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal { display: none; overflow: hidden; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #ffffff; border: 1px solid #999999; border: 1px solid transparent; border-radius: 3px; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000; } .modal-backdrop.fade { opacity: 0; filter: alpha(opacity=0); } .modal-backdrop.in { opacity: 0.5; filter: alpha(opacity=50); } .modal-header { padding: 15px; border-bottom: 1px solid transparent; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.846; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid transparent; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; margin: 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } .modal-sm { width: 300px; } } @media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; z-index: 1070; display: block; font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.846; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 12px; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.9; filter: alpha(opacity=90); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; background-color: #727272; border-radius: 3px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #727272; } .tooltip.top-left .tooltip-arrow { bottom: 0; right: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #727272; } .tooltip.top-right .tooltip-arrow { bottom: 0; left: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #727272; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #727272; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #727272; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #727272; } .tooltip.bottom-left .tooltip-arrow { top: 0; right: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #727272; } .tooltip.bottom-right .tooltip-arrow { top: 0; left: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #727272; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.846; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 13px; background-color: #ffffff; background-clip: padding-box; border: 1px solid transparent; border-radius: 3px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 13px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 2px 2px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { border-width: 10px; content: ""; } .popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0.075); bottom: -11px; } .popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0.075); } .popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } .popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0.075); top: -11px; } .popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0.075); } .popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #ffffff; bottom: -10px; } .carousel { position: relative; } .carousel-inner { position: relative; overflow: hidden; width: 100%; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { line-height: 1; } @media all and (transform-3d), (-webkit-transform-3d) { .carousel-inner > .item { -webkit-transition: -webkit-transform 0.6s ease-in-out; -moz-transition: -moz-transform 0.6s ease-in-out; -o-transition: -o-transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; -moz-perspective: 1000px; perspective: 1000px; } .carousel-inner > .item.next, .carousel-inner > .item.active.right { -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); left: 0; } .carousel-inner > .item.prev, .carousel-inner > .item.active.left { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); left: 0; } .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); left: 0; } } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; left: 0; bottom: 0; width: 15%; opacity: 0.5; filter: alpha(opacity=50); font-size: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); background-color: rgba(0, 0, 0, 0); } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } .carousel-control.right { left: auto; right: 0; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { outline: 0; color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; margin-top: -10px; z-index: 5; display: inline-block; } .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; line-height: 1; font-family: serif; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; margin-left: -30%; padding-left: 0; list-style: none; text-align: center; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; border: 1px solid #ffffff; border-radius: 10px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #ffffff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -10px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -10px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -10px; } .carousel-caption { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-header:before, .modal-header:after, .modal-footer:before, .modal-footer:after { content: " "; display: table; } .clearfix:after, .dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, .form-horizontal .form-group:after, .btn-toolbar:after, .btn-group-vertical > .btn-group:after, .nav:after, .navbar:after, .navbar-header:after, .navbar-collapse:after, .pager:after, .panel-body:after, .modal-header:after, .modal-footer:after { clear: both; } .center-block { display: block; margin-left: auto; margin-right: auto; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .hidden { display: none !important; } .affix { position: fixed; } @-ms-viewport { width: device-width; } .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table !important; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } table.visible-sm { display: table !important; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } table.visible-md { display: table !important; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } table.visible-lg { display: table !important; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: block !important; } table.visible-print { display: table !important; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } } .visible-print-block { display: none !important; } @media print { .visible-print-block { display: block !important; } } .visible-print-inline { display: none !important; } @media print { .visible-print-inline { display: inline !important; } } .visible-print-inline-block { display: none !important; } @media print { .visible-print-inline-block { display: inline-block !important; } } @media print { .hidden-print { display: none !important; } } header.page-header::before, .layout_social > .container:before { content: none; } .topbar { margin-bottom: 20px; } .cssmenu_horiz li ul, .cssmenu_vert li ul { padding: 0; margin: 2px 0 0; background-color: #ffffff; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 3px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); -webkit-background-clip: padding-box; background-clip: padding-box; } .cssmenu_horiz li ul > li > a, .cssmenu_vert li ul > li > a { padding: 3px 20px; font-weight: normal; line-height: 1.846; color: #666666; } .cssmenu_horiz > li > ul { border-top-left-radius: 0; border-top-right-radius: 0; margin: 0; } .cssmenu_horiz > li > a:hover, .cssmenu_vert > li > a:hover, .cssmenu_horiz ul > li > a:hover, .cssmenu_vert ul > li > a:hover, .cssmenu_horiz > li > a:focus, .cssmenu_vert > li > a:focus, .cssmenu_horiz ul > li > a:focus, .cssmenu_vert ul > li > a:focus { text-decoration: none; color: #141414; background-color: #eeeeee; } .topbar .nav > li.selected > a, .topbar .nav > li.selected > a:hover { background: #eeeeee; } .sf-arrows .sf-with-ul:after { border: 5px solid transparent; border-top-color: #666666; } .sf-arrows ul .sf-with-ul:after, .cssmenu_vert.sf-arrows > li > .sf-with-ul:after { border-color: transparent; border-left-color: #666666; } .sf-arrows ul li > .sf-with-ul:focus:after, .sf-arrows ul li:hover > .sf-with-ul:after, .sf-arrows ul .sfHover > .sf-with-ul:after { border-color: transparent; border-left-color: #141414; } .cssmenu_vert.sf-arrows li > .sf-with-ul:focus:after, .cssmenu_vert.sf-arrows li:hover > .sf-with-ul:after, .cssmenu_vert.sf-arrows .sfHover > .sf-with-ul:after { border-color: transparent; border-left-color: #141414; } .dropdown-menu li { background-color: #ffffff; color: #666666; } .dropdown-menu li:hover, .dropdown-menu li:focus { background-color: #eeeeee; color: #141414; } .navbar { border: none; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); } .navbar-brand { font-size: 24px; } .navbar-inverse .navbar-form input[type=text], .navbar-inverse .navbar-form input[type=password] { color: #ffffff; -webkit-box-shadow: inset 0 -1px 0 #b2dbfb; box-shadow: inset 0 -1px 0 #b2dbfb; } .navbar-inverse .navbar-form input[type=text]::-moz-placeholder, .navbar-inverse .navbar-form input[type=password]::-moz-placeholder { color: #b2dbfb; opacity: 1; } .navbar-inverse .navbar-form input[type=text]:-ms-input-placeholder, .navbar-inverse .navbar-form input[type=password]:-ms-input-placeholder { color: #b2dbfb; } .navbar-inverse .navbar-form input[type=text]::-webkit-input-placeholder, .navbar-inverse .navbar-form input[type=password]::-webkit-input-placeholder { color: #b2dbfb; } .navbar-inverse .navbar-form input[type=text]:focus, .navbar-inverse .navbar-form input[type=password]:focus { -webkit-box-shadow: inset 0 -2px 0 #ffffff; box-shadow: inset 0 -2px 0 #ffffff; } .btn-default { background-size: 200%; background-position: 50%; } .btn-default:focus { background-color: #ffffff; } .btn-default:hover, .btn-default:active:hover { background-color: #f0f0f0; } .btn-default:active { background-color: #e0e0e0; background-image: -webkit-radial-gradient(circle, #e0e0e0 10%, #ffffff 11%); background-image: radial-gradient(circle, #e0e0e0 10%, #ffffff 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn-primary { background-size: 200%; background-position: 50%; } .btn-primary:focus { background-color: #2196f3; } .btn-primary:hover, .btn-primary:active:hover { background-color: #0d87e9; } .btn-primary:active { background-color: #0b76cc; background-image: -webkit-radial-gradient(circle, #0b76cc 10%, #2196f3 11%); background-image: radial-gradient(circle, #0b76cc 10%, #2196f3 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn-success { background-size: 200%; background-position: 50%; } .btn-success:focus { background-color: #4caf50; } .btn-success:hover, .btn-success:active:hover { background-color: #439a46; } .btn-success:active { background-color: #39843c; background-image: -webkit-radial-gradient(circle, #39843c 10%, #4caf50 11%); background-image: radial-gradient(circle, #39843c 10%, #4caf50 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn-info { background-size: 200%; background-position: 50%; } .btn-info:focus { background-color: #9c27b0; } .btn-info:hover, .btn-info:active:hover { background-color: #862197; } .btn-info:active { background-color: #701c7e; background-image: -webkit-radial-gradient(circle, #701c7e 10%, #9c27b0 11%); background-image: radial-gradient(circle, #701c7e 10%, #9c27b0 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn-warning { background-size: 200%; background-position: 50%; } .btn-warning:focus { background-color: #ff9800; } .btn-warning:hover, .btn-warning:active:hover { background-color: #e08600; } .btn-warning:active { background-color: #c27400; background-image: -webkit-radial-gradient(circle, #c27400 10%, #ff9800 11%); background-image: radial-gradient(circle, #c27400 10%, #ff9800 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn-danger { background-size: 200%; background-position: 50%; } .btn-danger:focus { background-color: #e51c23; } .btn-danger:hover, .btn-danger:active:hover { background-color: #cb171e; } .btn-danger:active { background-color: #b0141a; background-image: -webkit-radial-gradient(circle, #b0141a 10%, #e51c23 11%); background-image: radial-gradient(circle, #b0141a 10%, #e51c23 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn-link { background-size: 200%; background-position: 50%; } .btn-link:focus { background-color: #ffffff; } .btn-link:hover, .btn-link:active:hover { background-color: #f0f0f0; } .btn-link:active { background-color: #e0e0e0; background-image: -webkit-radial-gradient(circle, #e0e0e0 10%, #ffffff 11%); background-image: radial-gradient(circle, #e0e0e0 10%, #ffffff 11%); background-repeat: no-repeat; background-size: 1000%; -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } .btn { text-transform: uppercase; border: none; -webkit-box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4); box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4); -webkit-transition: all 0.4s; -o-transition: all 0.4s; transition: all 0.4s; } .btn-link { border-radius: 3px; -webkit-box-shadow: none; box-shadow: none; color: #444444; } .btn-link:hover, .btn-link:focus { -webkit-box-shadow: none; box-shadow: none; color: #444444; text-decoration: none; } .btn-default.disabled { background-color: rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.4); opacity: 1; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: 0; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: 0; } body { -webkit-font-smoothing: antialiased; letter-spacing: .1px; } p { margin: 0 0 1em; } input, button { -webkit-font-smoothing: antialiased; letter-spacing: .1px; } a { -webkit-transition: all 0.2s; -o-transition: all 0.2s; transition: all 0.2s; } .table-hover > tbody > tr, .table-hover > tbody > tr > th, .table-hover > tbody > tr > td { -webkit-transition: all 0.2s; -o-transition: all 0.2s; transition: all 0.2s; } label { font-weight: normal; } textarea, textarea.form-control, input.form-control, input[type=text], input[type=password], input[type=email], input[type=number], [type=text].form-control, [type=password].form-control, [type=email].form-control, [type=tel].form-control, [contenteditable].form-control { padding: 0; border: none; border-radius: 0; -webkit-appearance: none; -webkit-box-shadow: inset 0 -1px 0 #dddddd; box-shadow: inset 0 -1px 0 #dddddd; font-size: 16px; } textarea:focus, textarea.form-control:focus, input.form-control:focus, input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=number]:focus, [type=text].form-control:focus, [type=password].form-control:focus, [type=email].form-control:focus, [type=tel].form-control:focus, [contenteditable].form-control:focus { -webkit-box-shadow: inset 0 -2px 0 #2196f3; box-shadow: inset 0 -2px 0 #2196f3; } textarea[disabled], textarea.form-control[disabled], input.form-control[disabled], input[type=text][disabled], input[type=password][disabled], input[type=email][disabled], input[type=number][disabled], [type=text].form-control[disabled], [type=password].form-control[disabled], [type=email].form-control[disabled], [type=tel].form-control[disabled], [contenteditable].form-control[disabled], textarea[readonly], textarea.form-control[readonly], input.form-control[readonly], input[type=text][readonly], input[type=password][readonly], input[type=email][readonly], input[type=number][readonly], [type=text].form-control[readonly], [type=password].form-control[readonly], [type=email].form-control[readonly], [type=tel].form-control[readonly], [contenteditable].form-control[readonly] { -webkit-box-shadow: none; box-shadow: none; border-bottom: 1px dotted #dddddd; } textarea.input-sm, textarea.form-control.input-sm, input.form-control.input-sm, input[type=text].input-sm, input[type=password].input-sm, input[type=email].input-sm, input[type=number].input-sm, [type=text].form-control.input-sm, [type=password].form-control.input-sm, [type=email].form-control.input-sm, [type=tel].form-control.input-sm, [contenteditable].form-control.input-sm { font-size: 12px; } textarea.input-lg, textarea.form-control.input-lg, input.form-control.input-lg, input[type=text].input-lg, input[type=password].input-lg, input[type=email].input-lg, input[type=number].input-lg, [type=text].form-control.input-lg, [type=password].form-control.input-lg, [type=email].form-control.input-lg, [type=tel].form-control.input-lg, [contenteditable].form-control.input-lg { font-size: 17px; } select, select.form-control { border: 0; border-radius: 0; -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-left: 0; padding-right: 0\9; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAAJ1BMVEVmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmaP/QSjAAAADHRSTlMAAgMJC0uWpKa6wMxMdjkoAAAANUlEQVR4AeXJyQEAERAAsNl7Hf3X6xt0QL6JpZWq30pdvdadme+0PMdzvHm8YThHcT1H7K0BtOMDniZhWOgAAAAASUVORK5CYII=); background-size: 13px; background-repeat: no-repeat; background-position: right center; -webkit-box-shadow: inset 0 -1px 0 #dddddd; box-shadow: inset 0 -1px 0 #dddddd; font-size: 16px; line-height: 1.5; } select::-ms-expand, select.form-control::-ms-expand { display: none; } select.input-sm, select.form-control.input-sm { font-size: 12px; } select.input-lg, select.form-control.input-lg { font-size: 17px; } select:focus, select.form-control:focus { -webkit-box-shadow: inset 0 -2px 0 #2196f3; box-shadow: inset 0 -2px 0 #2196f3; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAAJ1BMVEUhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISF8S9ewAAAADHRSTlMAAgMJC0uWpKa6wMxMdjkoAAAANUlEQVR4AeXJyQEAERAAsNl7Hf3X6xt0QL6JpZWq30pdvdadme+0PMdzvHm8YThHcT1H7K0BtOMDniZhWOgAAAAASUVORK5CYII=); } select[multiple], select.form-control[multiple] { background: none; } .radio label, .radio-inline label, .checkbox label, .checkbox-inline label { padding-left: 25px; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="radio"], .checkbox-inline input[type="radio"], .radio input[type="checkbox"], .radio-inline input[type="checkbox"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { margin-left: -25px; } input[type="radio"], .radio input[type="radio"], .radio-inline input[type="radio"] { position: relative; margin-top: 6px; margin-right: 4px; vertical-align: top; border: none; background-color: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; } input[type="radio"]:focus, .radio input[type="radio"]:focus, .radio-inline input[type="radio"]:focus { outline: none; } input[type="radio"]:before, .radio input[type="radio"]:before, .radio-inline input[type="radio"]:before, input[type="radio"]:after, .radio input[type="radio"]:after, .radio-inline input[type="radio"]:after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; -webkit-transition: 240ms; -o-transition: 240ms; transition: 240ms; } input[type="radio"]:before, .radio input[type="radio"]:before, .radio-inline input[type="radio"]:before { position: absolute; left: 0; top: -3px; background-color: #2196f3; -webkit-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); } input[type="radio"]:after, .radio input[type="radio"]:after, .radio-inline input[type="radio"]:after { position: relative; top: -3px; border: 2px solid #666666; } input[type="radio"]:checked:before, .radio input[type="radio"]:checked:before, .radio-inline input[type="radio"]:checked:before { -webkit-transform: scale(0.5); -ms-transform: scale(0.5); -o-transform: scale(0.5); transform: scale(0.5); } input[type="radio"]:disabled:checked:before, .radio input[type="radio"]:disabled:checked:before, .radio-inline input[type="radio"]:disabled:checked:before { background-color: #bbbbbb; } input[type="radio"]:checked:after, .radio input[type="radio"]:checked:after, .radio-inline input[type="radio"]:checked:after { border-color: #2196f3; } input[type="radio"]:disabled:after, .radio input[type="radio"]:disabled:after, .radio-inline input[type="radio"]:disabled:after, input[type="radio"]:disabled:checked:after, .radio input[type="radio"]:disabled:checked:after, .radio-inline input[type="radio"]:disabled:checked:after { border-color: #bbbbbb; } input[type="checkbox"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: relative; border: none; margin-bottom: -4px; -webkit-appearance: none; appearance: none; cursor: pointer; } input[type="checkbox"]:focus, .checkbox input[type="checkbox"]:focus, .checkbox-inline input[type="checkbox"]:focus { outline: none; } input[type="checkbox"]:focus:after, .checkbox input[type="checkbox"]:focus:after, .checkbox-inline input[type="checkbox"]:focus:after { border-color: #2196f3; } input[type="checkbox"]:after, .checkbox input[type="checkbox"]:after, .checkbox-inline input[type="checkbox"]:after { content: ""; display: block; width: 18px; height: 18px; margin-top: -2px; margin-right: 5px; border: 2px solid #666666; border-radius: 2px; -webkit-transition: 240ms; -o-transition: 240ms; transition: 240ms; } input[type="checkbox"]:checked:before, .checkbox input[type="checkbox"]:checked:before, .checkbox-inline input[type="checkbox"]:checked:before { content: ""; position: absolute; top: 0; left: 6px; display: table; width: 6px; height: 12px; border: 2px solid #ffffff; border-top-width: 0; border-left-width: 0; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } input[type="checkbox"]:checked:after, .checkbox input[type="checkbox"]:checked:after, .checkbox-inline input[type="checkbox"]:checked:after { background-color: #2196f3; border-color: #2196f3; } input[type="checkbox"]:disabled:after, .checkbox input[type="checkbox"]:disabled:after, .checkbox-inline input[type="checkbox"]:disabled:after { border-color: #bbbbbb; } input[type="checkbox"]:disabled:checked:after, .checkbox input[type="checkbox"]:disabled:checked:after, .checkbox-inline input[type="checkbox"]:disabled:checked:after { background-color: #bbbbbb; border-color: transparent; } .has-warning input:not([type=checkbox]), .has-warning .form-control, .has-warning input.form-control[readonly], .has-warning input[type=text][readonly], .has-warning [type=text].form-control[readonly], .has-warning input:not([type=checkbox]):focus, .has-warning .form-control:focus { border-bottom: none; -webkit-box-shadow: inset 0 -2px 0 #ff9800; box-shadow: inset 0 -2px 0 #ff9800; } .has-error input:not([type=checkbox]), .has-error .form-control, .has-error input.form-control[readonly], .has-error input[type=text][readonly], .has-error [type=text].form-control[readonly], .has-error input:not([type=checkbox]):focus, .has-error .form-control:focus { border-bottom: none; -webkit-box-shadow: inset 0 -2px 0 #e51c23; box-shadow: inset 0 -2px 0 #e51c23; } .has-success input:not([type=checkbox]), .has-success .form-control, .has-success input.form-control[readonly], .has-success input[type=text][readonly], .has-success [type=text].form-control[readonly], .has-success input:not([type=checkbox]):focus, .has-success .form-control:focus { border-bottom: none; -webkit-box-shadow: inset 0 -2px 0 #4caf50; box-shadow: inset 0 -2px 0 #4caf50; } .has-warning .input-group-addon, .has-error .input-group-addon, .has-success .input-group-addon { color: #666666; border-color: transparent; background-color: transparent; } .nav-tabs > li > a, .nav-tabs > li > a:focus { margin-right: 0; background-color: transparent; border: none; color: #666666; -webkit-box-shadow: inset 0 -1px 0 #dddddd; box-shadow: inset 0 -1px 0 #dddddd; -webkit-transition: all 0.2s; -o-transition: all 0.2s; transition: all 0.2s; } .nav-tabs > li > a:hover, .nav-tabs > li > a:focus:hover { background-color: transparent; -webkit-box-shadow: inset 0 -2px 0 #2196f3; box-shadow: inset 0 -2px 0 #2196f3; color: #2196f3; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus { border: none; -webkit-box-shadow: inset 0 -2px 0 #2196f3; box-shadow: inset 0 -2px 0 #2196f3; color: #2196f3; } .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus:hover { border: none; color: #2196f3; } .nav-tabs > li.disabled > a { -webkit-box-shadow: inset 0 -1px 0 #dddddd; box-shadow: inset 0 -1px 0 #dddddd; } .nav-tabs.nav-justified > li > a, .nav-tabs.nav-justified > li > a:hover, .nav-tabs.nav-justified > li > a:focus, .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: none; } .nav-tabs .dropdown-menu { margin-top: 0; } .dropdown-menu { margin-top: 0; border: none; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); } .alert { border: none; color: #ffffff; } .alert-success { background-color: #4caf50; } .alert-info { background-color: #9c27b0; } .alert-warning { background-color: #ff9800; } .alert-danger { background-color: #e51c23; } .alert a:not(.close), .alert .alert-link { color: #ffffff; font-weight: bold; } .alert .close { color: #ffffff; } .badge { padding: 4px 6px 4px; } .progress { position: relative; z-index: 1; height: 6px; border-radius: 0; -webkit-box-shadow: none; box-shadow: none; } .progress-bar { -webkit-box-shadow: none; box-shadow: none; } .progress-bar:last-child { border-radius: 0 3px 3px 0; } .progress-bar:last-child:before { display: block; content: ""; position: absolute; width: 100%; height: 100%; left: 0; right: 0; z-index: -1; background-color: #cae6fc; } .progress-bar-success:last-child.progress-bar:before { background-color: #c7e7c8; } .progress-bar-info:last-child.progress-bar:before { background-color: #edc9f3; } .progress-bar-warning:last-child.progress-bar:before { background-color: #ffe0b3; } .progress-bar-danger:last-child.progress-bar:before { background-color: #f28e92; } .close { font-size: 34px; font-weight: 300; line-height: 24px; opacity: 0.6; -webkit-transition: all 0.2s; -o-transition: all 0.2s; transition: all 0.2s; } .close:hover { opacity: 1; } .list-group-item { padding: 15px; } .list-group-item-text { color: #bbbbbb; } .well { border-radius: 0; -webkit-box-shadow: none; box-shadow: none; } .panel { border: none; border-radius: 2px; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); } .panel-heading { border-bottom: none; } .panel-footer { border-top: none; } .popover { border: none; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); } .carousel-caption h1, .carousel-caption h2, .carousel-caption h3, .carousel-caption h4, .carousel-caption h5, .carousel-caption h6 { color: inherit; } .margin-bottom-xs { margin-bottom: 6px; } .margin-bottom-sm { margin-bottom: 12px; } .margin-bottom-md { margin-bottom: 23px; } .margin-bottom-lg { margin-bottom: 46px; } .navbar-collapse.collapse.in { background: #ffffff; } .warning a, .warning a:link, .warning a:visited { color: #ff9800; } .calhighlight { color: #9c27b0; background: #e1bee7; } a.fc-event:hover { color: #ffffff; } .filter .fancyfilter { border: thin solid transparent /*black*/; } .filter .fancyfilter .token { background: #ffffff; border: 1px solid #bbbbbb; font-size: 11px; padding: 3px; } .note-list .postbody-title { background: #ffffff; color: #212121; } .post-approved-n { border-left: 3px dotted #4caf50; } .post-approved-r { border-left: 3px double #ff9800; } .post-approved-r .content * { background: url('../../../img/icons/dots.gif'); } .dropdown-menu { color: #bbbbbb; } .cssmenu_horiz > li:hover, .cssmenu_horiz > li.sfHover, .cssmenu_vert > li:hover, .cssmenu_vert > li.sfHover { -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; } .topbar .nav > li > a:hover, .topbar .nav > li > a:focus { background: transparent; } .cssmenu_horiz ul, .cssmenu_vert ul { border: rgba(0, 0, 0, 0.15); } .cssmenu_horiz ul li a, .cssmenu_vert ul li a { background: #ffffff; color: #666666; } .cssmenu_horiz > ul > li:hover > a, .cssmenu_vert > ul > li:hover > a { color: #141414; background: #eeeeee; } .sf-arrows .sf-with-ul:after { border: 5px solid transparent; border-top-color: #2196f3; } .cssmenu_vert.sf-arrows li > .sf-with-ul:after { border-color: transparent; border-left-color: #2196f3; /* edit this to suit design (no rgba in IE8) */ } .sf-arrows ul .sf-with-ul:after, .cssmenu_vert.sf-arrows ul > li > .sf-with-ul:after { border-color: transparent; border-left-color: #666666; /* edit this to suit design (no rgba in IE8) */ } .sf-arrows ul li > .sf-with-ul:focus:after, .sf-arrows ul li:hover > .sf-with-ul:after, .sf-arrows ul .sfHover > .sf-with-ul:after { border-color: transparent; border-left-color: #141414; } .cssmenu_vert.sf-arrows li > .sf-with-ul:focus:after, .cssmenu_vert.sf-arrows li:hover > .sf-with-ul:after, .cssmenu_vert.sf-arrows .sfHover > .sf-with-ul:after { border-color: transparent; border-left-color: #141414; } .topbar, .topbar .navbar-default .navbar-nav > li, .topbar .nav > li { background: #ffffff; color: #bbbbbb; } .topbar > a, .topbar .navbar-default .navbar-nav > li > a, .topbar .nav > li > a { color: #666666; padding-top: 20.5px; padding-bottom: 20.5px; } .topbar > a:hover, .topbar .navbar-default .navbar-nav > li > a:hover, .topbar .nav > li > a:hover, .topbar > a:focus, .topbar .navbar-default .navbar-nav > li > a:focus, .topbar .nav > li > a:focus { color: #212121; } .topbar .cssmenu_horiz ul { background: #ffffff; } .topbar .cssmenu_horiz.sf-arrows > .menuSection0 > .sf-with-ul:after { border: 5px solid transparent; border-top-color: #666666; } .topbar .cssmenu_horiz.sf-arrows > .menuSection0:hover > .sf-with-ul:after, .topbar .cssmenu_horiz.sf-arrows > .menuSection0.sfhover > .sf-with-ul:after { border-top-color: #212121; } /* order of following 3 rules important for fallbacks to work */ .dropdown-menu .dropdown-title, .dropdown-menu li label { color: #666666; } .thumbinfosothers { color: #eeeeee; } table.treetable.objectperms td.added { background-color: #dff0d8; } table.treetable.objectperms td.removed { background-color: #ffe0b2; } .progressBarInProgress { background-color: #9c27b0; color: #e1bee7; } .progressBarComplete { background-color: #4caf50; color: #dff0d8; } .progressBarError { background-color: #ff9800; color: #ffe0b2; } .progressContainer { border: solid 1px transparent; background-color: #ffffff; } .filter-panel-heading a:after { color: #666666; } .olControlMousePosition { background: rgba(0, 0, 0, 0.75); color: #ffffff; } .olControlScaleLineTop, .olControlScaleLineBottom { background-color: rgba(255, 255, 255, 0.5); } .ui-selectmenu-icon { background-color: inherit; border: solid 5px transparent !important; -webkit-box-shadow: -5px 0 5px 2px rgba(0, 0, 0, 0.1), -1px 0 0 rgba(0, 0, 0, 0.1), -2px 0 0 rgba(255, 255, 255, 0.25); box-shadow: -5px 0 5px 2px rgba(0, 0, 0, 0.1), -1px 0 0 rgba(0, 0, 0, 0.1), -2px 0 0 rgba(255, 255, 255, 0.25); } .dirsitetrail { color: #f5f5f5; } .dirsitecats { color: #f5f5f5; } #resultzone > div:hover { background: #4caf50; } .searchresults blockquote em, .highlight, .btn-default.highlight a, .btn-default a.highlight { background: #f9bdbb; color: #e51c23; border-color: #f7a4af; } .btn-default.highlight:hover { background: #f37975; } .btn-default.btn-link, .btn-default.btn-link:hover { background: transparent; border: none; } #ajaxLoadingBG { background: transparent url('../../../img/overlay-light.png'); } #ajaxLoading { color: #eeeeee; background: transparent url('../../../img/loading-light.gif') no-repeat 50% 50%; } #cookie_consent_div { padding: 15px; border: 1px solid #cba4dd; color: #9c27b0; background-color: #e1bee7; } #cookie_consent_div.banner { padding: 15px; border: 1px solid #cba4dd; } html#print, body.print * { background: #ffffff; color: #000000; } body.fullscreen { background: #ffffff; } .attention { color: #e51c23; } #debugconsole { background: #2196f3; color: #b2dbfb; border: 2px solid transparent; } #debugconsole form { color: #bbbbbb; } #debugconsole a { color: #ffffff; } #debugconsole a.btn { color: #666666; } a.icon, img.icon { background: transparent; } div #metadata fieldset.tabcontent, div #metadata div.tabs { background-color: transparent; } .openid_url { background: #ffffff url('../../../img/icons/login-OpenID-bg.gif') 1px 1px no-repeat; } input:-webkit-autofill { background-color: transparent !important; /* needs important because Chrome has it already important */ background-image: none !important; color: #666666 !important; /* the Google guys forgot the number-one rule... when they specify background they should specify forgeround color too ;) */ } #cboxTitle { background-color: #ffffff; } #captchaImg { border: 1px solid #dddddd; } form.simple label.error { background: url('../../../img/icons/error.png') no-repeat 0 4px; color: #e51c23; } form.simple label .warning { color: #e51c23; } .tiki-modal .mask { background-color: #ffffff; } .ui-dialog { background: #ffffff; color: #666666; } .cssmenu_horiz ul li.selected a, .cssmenu_vert ul li.selected a, .cssmenu_horiz ul li a:hover, .cssmenu_vert ul li a:hover { text-decoration: none; color: #141414; background-color: #eeeeee; } .box-quickadmin .cssmenu_horiz ul li { background-color: #ffffff; } .box-switch_lang .box-data img.highlight { border: 0.1em solid #f7a4af; } .box-switch_lang .box-data .highlight { border: 0.1em solid #f7a4af; } div.cvsup { color: #bbbbbb; } .layout_social .topbar_modules h1.sitetitle, .layout_social_modules .topbar_modules h1.sitetitle, .layout_fixed_top_modules #top_modules h1.sitetitle { color: #666666; } .layout_social .topbar_modules .navbar-inverse .navbar-collapse, .layout_social_modules .topbar_modules .navbar-inverse .navbar-collapse, .layout_fixed_top_modules #top_modules .navbar-inverse .navbar-collapse, .layout_social .topbar_modules .navbar-inverse .navbar-form, .layout_social_modules .topbar_modules .navbar-inverse .navbar-form, .layout_fixed_top_modules #top_modules .navbar-inverse .navbar-form, .layout_social .topbar_modules .navbar-inverse, .layout_social_modules .topbar_modules .navbar-inverse, .layout_fixed_top_modules #top_modules .navbar-inverse { border-color: transparent; } .prio1 { background: inherit; } .prio2 { background: #dff0d8; color: #4caf50; border: #d6e9c6; } .prio2 a { color: #4caf50; } .prio3 { background: #e1bee7; color: #9c27b0; border: #cba4dd; } .prio3 a { color: #9c27b0; } .prio4 { background: #ffe0b2; color: #ff9800; border: #ffc599; } .prio4 a { color: #ff9800; } .prio5 { background: #f9bdbb; color: #e51c23; border: #f7a4af; } .prio5 a { color: #e51c23; } .messureadflag { background: #666666; } .messureadhead { background: #bbbbbb; } .messureadbody { background: #eeeeee; } .readlink { color: #666666; } .webmail_item { border: 1px solid #dddddd; } .webmail_list .odd { background: #f9f9f9; } .webmail_list .button { background: #ffffff; border: 1px solid #2196f3; } .webmail_list .webmail_read { background: #e1bee7; } .webmail_list .webmail_replied { background: #dff0d8; } .webmail_list .webmail_taken { border: #ffc599; color: #ff9800; } .webmail_message { background: #ffffff; } .webmail_message_headers { background: #ffffff; } .webmail_message_headers th { background: transparent; } .tiki_sheet table td { border: 1px solid #dddddd; } .odd { background: transparent; color: #666666; } .even { background: #f9f9f9; color: #666666; } .objectperms .checkBoxHeader:nth-of-type(odd) > div > label, .objectperms td.checkBoxCell:nth-of-type(odd), .objectperms .checkBoxHeader:nth-of-type(odd) > .checkBoxLabel { background: #ececec; } .helptool-admin { border-left: medium double #bbbbbb; } .toolbar-list { border-left: medium double #bbbbbb; } .toolbars-picker { background: #ffffff; border: thin solid #666666; color: #666666; } .toolbars-picker a { border: 1px solid #ffffff; color: #666666; } .toolbars-picker a:hover { border: 1px solid #e51c23; background: #bbbbbb; color: #666666; } .textarea-toolbar > div { background-color: #eeeeee; border: outset 1px #eeeeee; } #intertrans-indicator { background-color: #dff0d8; color: #4caf50; } #intertrans-form { background-color: #ffffff; border: 1px solid #dddddd; color: #212121; } #edit_translations tr.last { border-bottom: 2px solid #d6e9c6; } ul.all_languages > li { border: 1px solid #d6e9c6; } .plugin-mouseover { background: #ffffff; border: 1px solid transparent; } .mandatory_note { color: #e51c23; } .author0 { color: #ffffff; } .author1 { color: #ffffff; } .author2 { color: #ffffff; } .author3 { color: #ffffff; } .author4 { color: #ffffff; } .author5 { color: #ffffff; } .author6 { color: #ffffff; } .author7 { color: #ffffff; } .author8 { color: #ffffff; } .author9 { color: #ffffff; } .author10 { color: #ffffff; } .author11 { color: #ffffff; } .author12 { color: #ffffff; } .author13 { color: #ffffff; } .author14 { color: #ffffff; } .author15 { color: #ffffff; } .structuremenu .menuSection { border-left: 1px dotted #666666; } .cke_editable:hover { outline: #666666 dotted 1px; } .tiki .cke_wysiwyg_frame, .tiki .cke_wysiwyg_div { background: #ffffff; color: #666666; } .tiki_plugin { background-color: transparent; border: 1px solid #bbbbbb; } .unsavedChangesInEditor { border: 1px solid; border-color: #ffc599; } .autotoc > .nav { background: #ffffff; border: 1px solid #dddddd; border-radius: 3px; } .autotoc * { color: #2196f3; } .autotoc .nav > li > a:hover, .autotoc .nav .nav > li > a:hover { color: #0a6ebd; } .plugin-form-float { background: #ffffff; color: #666666; border: solid 2px #666666; } body.wikitext { background: #ffffff; color: #666666; } .editable-inline { background: transparent url('../../../img/icons/database_lightning.png') no-repeat top right; padding-right: 20px; display: inline-block; } .editable-inline.loaded { background: #ffffff; padding: 6px; border: 1px solid #eee; border-radius: 4px; z-index: 2; } .editable-inline.failure { background: transparent url('../../../img/icons/lock_gray.png') no-repeat top right; } .editable-inline.modified { border: solid 2px transparent; padding: 2px; } .editable-inline.unsaved { border: solid 2px transparent; } .structure_select .cssmenu_horiz ul li { border: 1px solid #666666; } .admintoclevel .actions input { border: solid 1px #666666; } .TextArea-fullscreen { background-color: #666666; } .TextArea-fullscreen .actions, .CodeMirror-fullscreen .actions { background-color: #ffffff; border-top: #eeeeee 1px solid; } #autosave_preview { background-color: #ffffff; color: #666666; } #autosave_preview_grippy { background-color: #eeeeee; background-image: url('../../../img/icons/shading.png'); } h1:hover a.tiki_anchor, h2:hover a.tiki_anchor, h3:hover a.tiki_anchor, h4:hover a.tiki_anchor, h5:hover a.tiki_anchor, h6:hover a.tiki_anchor { color: #eeeeee; } h1 a.tiki_anchor:hover, h2 a.tiki_anchor:hover, h3 a.tiki_anchor:hover, h4 a.tiki_anchor:hover, h5 a.tiki_anchor:hover, h6 a.tiki_anchor:hover { color: #666666; } .wiki .namespace { background: #eeeeee; } .site_report a { border-left: 1px solid #666666; border-right: 1px solid #666666; } .quotebody { border-left: 2px solid #bbbbbb; } .mandatory_star { color: #e51c23; font-size: 120%; } .trackerplugindesc { color: #212121; } .charCount { color: #212121; } .imgbox { border: 1px solid transparent; background-color: #ffffff; } .ic_button { border: 2px solid #dddddd; } .ic_active { border: 2px solid #2196f3; } .ic_caption { background: #2196f3; color: #bbbbbb; } .wp-cookie-consent-required { color: #e51c23; } .wp-sign { color: #ffffff; background-color: #727272; } .wp-sign a, .wp-sign a:visited { color: #ffffff; } .wp-sign a:hover, .wp-sign a:visited:hover { color: #ffffff; text-decoration: none; } .toc { border-top: 1px dotted #bbbbbb; border-bottom: 1px dotted #bbbbbb; } .diff td { border: 1px solid #212121; } .diff div { border-top: 1px solid #bbbbbb; } .diffadded { background: #dff0d8; color: #4caf50; } .diffdeleted { background: #f9bdbb; color: #e51c23; } .diffinldel { background: #ffe0b2; } .diffbody { background: #eeeeee; color: #222222; } .diffchar { color: #ea4a4f; } .diffadded .diffchar { color: #6ec071; } .searchresults blockquote em.hlt1, .searchresults blockquote em.hlt6, .highlight_word_0 { color: #ffffff; background: #4caf50; } .searchresults blockquote em.hlt2, .searchresults blockquote em.hlt7, .highlight_word_1 { color: #ffffff; background: #9c27b0; } .searchresults blockquote em.hlt3, .searchresults blockquote em.hlt8, .highlight_word_2 { color: #ffffff; background: #ff9800; } .searchresults blockquote em.hlt4, .searchresults blockquote em.hlt9, .highlight_word_3 { color: #ffffff; background: #e51c23; } .searchresults blockquote em.hlt5, .searchresults blockquote em.hlt10, .highlight_word_4 { color: #ffffff; background: #e5581c; } /* Structures drill-down menu */ div.drillshow { border: 1px solid #bbbbbb; } .tiki .chosen-container-single .chosen-single { height: 37px; padding: 6px 6px; font-size: 13px; line-height: 1.846; } .chosen-container-multi .chosen-choices { background-color: rgba(26, 26, 26, 0); color: #666666; border: 1px solid transparent; } .chosen-container-single .chosen-single, .chosen-container-active.chosen-with-drop .chosen-single, .chosen-container .chosen-drop, .chosen-container-multi .chosen-choices .search-choice { background-color: transparent; color: #666666; border: 1px solid transparent; } .chosen-container-single .chosen-search input[type="text"] { background-color: transparent; border: 1px solid transparent; } .chosen-container .chosen-results li.highlighted { background-color: #eeeeee; color: #141414; } .tiki .chosen-container .active-result { color: #666666; } .breadcrumb { font-style: normal; font-size: 90%; display: block; } a.admbox.off { border: 1px solid rgba(0, 0, 0, 0); color: #999999; } a.admbox.off:hover, a.admbox.off:focus, a.admbox.off:active { border: 1px solid rgba(0, 0, 0, 0); color: #999999; } .tiki .ui-widget-content, span.plugin-mouseover { background: #ffffff; color: #666666; border: 1px solid transparent; } .tiki .ui-widget-header { background: #ffffff; color: #666666; border: 1px solid transparent; } .tiki .ui-dialog-content { background: #ffffff; color: #666666; } .tiki .ui-dialog-content select, .tiki .ui-dialog-content input, .tiki .ui-dialog-content optgroup, .tiki .ui-dialog-content textarea { background: transparent; color: #666666; } .tiki .ui-widget button { background: #ffffff; color: #444444; } .tiki .modal-content .ui-state-default { color: #2196f3; } .tiki .modal-content .ui-state-hover:hover { color: #0a6ebd; } .dropdown-menu { color: #666666; } .tiki .col1 .table-responsive { border: 1px solid #dddddd; } .codecaption { display: inline-block; color: #444444; background: #f8f8f8; border: 1px solid #dddddd; border-bottom: none; padding: 2px 9.5px; font-size: 0.8em; font-weight: bold; } code, pre.codelisting { color: #444444; background: #f8f8f8; border: 1px solid #dddddd; border-radius: 1px; } .edit-menu { position: absolute; top: 6px; right: 2px; } @media (min-width: 992px) { .edit-menu { display: none; } .navbar-default:hover .edit-menu { display: block; } } @media (max-width: 767px) { .navbar-default .edit-menu { top: 48px; } } .adminoptionboxchild { border-bottom: 1px solid #eeeeee; } .adminoptionboxchild legend { font-size: 18px; } input[type="checkbox"].preffilter-toggle-round + label { background-color: #bbbbbb; } input[type="checkbox"].preffilter-toggle-round + label:before { color: #444444; background-color: #ffffff; border-color: transparent; } input[type="checkbox"].preffilter-toggle-round:checked + label:before { color: #ffffff; background-color: #2196f3; border-color: transparent; } .tiki .chosen-container-single .chosen-single, .tiki .chosen-container-active.chosen-with-drop .chosen-single, .tiki .chosen-container .chosen-drop, .tiki .chosen-container-multi .chosen-choices .search-choice { background-color: #ffffff; border: 1px solid transparent; color: #666666; } .topbar { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); } .topbar .navbar { box-shadow: none; } .cssmenu_horiz ul li a:hover, .cssmenu_vert ul li a:hover { color: #141414; background-color: #eeeeee; } .cssmenu_horiz ul li.selected a, .cssmenu_vert ul li.selected a { text-decoration: none; color: #ffffff; background-color: #2196f3; } /* black */ /* white */ /* automatically choose the correct arrow/text color */ .tsFilterInput { border: none; background-color: #f7f7f7; } table.tablesorter { /* style header */ } table.tablesorter thead tr.tablesorter-headerRow th.tablesorter-headerUnSorted:not(.sorter-false) { background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); } table.tablesorter thead tr.tablesorter-headerRow th.tablesorter-headerAsc { background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); } table.tablesorter thead tr.tablesorter-headerRow th.tablesorter-headerDesc { background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); } table.tablesorter thead tr.tablesorter-filter-row input.tablesorter-filter { border: none; background-color: #f7f7f7; } table.tablesorter thead tr.tablesorter-filter-row input.dateFrom, table.tablesorter thead tr.tablesorter-filter-row input.dateTo { border: none; background-color: #f7f7f7; } table.tablesorter thead tr.tablesorter-headerRow, table.tablesorter thead tr.tablesorter-filter-row { background-color: #ffffff; } .tiki .pvtUi { color: #666666; } .tiki table.pvtTable { font-size: 13px; } .tiki table.pvtTable tr th { background-color: #9c27b0; color: #ffffff; border: 1px solid #dddddd; font-size: 13px; padding: 5px; } .tiki table.pvtTable tr td { color: #666666; background-color: transparent; border-color: #dddddd; } .tiki .pvtTotal, .tiki .pvtGrandTotal { font-weight: bold; } .tiki .pvtVals { text-align: center; } .tiki .pvtAggregator, .tiki .pvtRenderer, .tiki .pvtSearch, .tiki .pvtAttrDropdown { margin-bottom: 5px; background: transparent; color: #666666; border: 1px solid transparent; border-radius: 3px; } .tiki .pvtAxisContainer, .tiki .pvtVals { border-color: #dddddd; background: #ffffff; padding: 5px; } .tiki .pvtAxisContainer li.pvtPlaceholder { padding: 3px 15px; border-radius: 5px; border: 1px dashed #dddddd; } .tiki .pvtAxisContainer li span.pvtAttr { -webkit-text-size-adjust: 100%; padding: 2px 5px; white-space: nowrap; background: #ffffff; border: 1px solid transparent; border-radius: 3px; color: #444444; } .tiki .pvtTriangle { cursor: pointer; color: grey; } .tiki .pvtHorizList li { display: inline; } .tiki .pvtVertList { vertical-align: top; } .tiki .pvtFilteredAttribute { font-style: italic; } .tiki .pvtFilterBox { z-index: 100; width: 280px; border: 1px solid #dddddd; background-color: #ffffff; position: absolute; padding: 20px; text-align: center; } .tiki .pvtFilterBox h4 { margin: 0; } .tiki .pvtFilterBox p { margin: 1em auto; } .tiki .pvtFilterBox label { font-weight: normal; } .tiki .pvtFilterBox input[type='checkbox'] { margin-right: 5px; } .tiki .pvtCheckContainer { text-align: left; overflow: auto; width: 100%; max-height: 200px; } .tiki .pvtCheckContainer p { margin: 5px; } .tiki .pvtRendererArea { padding: 5px; } .tiki .pvtFilterBox button { background: #ffffff; border: 1px solid transparent; border-radius: 3px; color: #444444; } .tiki .pvtFilterBox button:hover { background: #ffffff; } .tiki .pvtFilterBox button + button { margin-left: 4px; margin-bottom: 4px; } .tiki .c3 line, .tiki .c3 path, .tiki .c3 svg { fill: none; stroke: #666666; } .tiki select { font-size: 13px; } .tiki .ui-state-default, .tiki .ui-widget-content .ui-state-default, .tiki .ui-widget-header .ui-state-default, .tiki .ui-button, .tiki html .ui-button.ui-state-disabled:hover, .tiki html .ui-button.ui-state-disabled:active { border: 1px solid transparent; background: #ffffff; font-weight: normal; color: #444444; font-size: 13px; } .tiki .ui-state-hover, .tiki .ui-widget-content .ui-state-hover, .tiki .ui-widget-header .ui-state-hover, .tiki .ui-state-focus, .tiki .ui-widget-content .ui-state-focus, .tiki .ui-widget-header .ui-state-focus, .tiki .ui-button:hover, .tiki .ui-button:focus { border: 1px solid transparent; background: #ffffff; font-weight: normal; color: #444444; } .tiki .ui-widget-header a { color: #2196f3; } .tiki #converse-embedded-chat, .tiki #conversejs { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; color: #666666; } .tiki #converse-embedded-chat a, .tiki #conversejs a, .tiki #converse-embedded-chat a:visited, .tiki #conversejs a:visited { color: #2196f3; } .tiki #converse-embedded-chat input[type=text], .tiki #conversejs input[type=text], .tiki #converse-embedded-chat textarea, .tiki #conversejs textarea, .tiki #converse-embedded-chat select, .tiki #conversejs select { background-color: transparent; color: #666666; border-color: transparent; } .tiki #converse-embedded-chat form.pure-form input[type=text], .tiki #conversejs form.pure-form input[type=text], .tiki #converse-embedded-chat form.pure-form textarea, .tiki #conversejs form.pure-form textarea, .tiki #converse-embedded-chat form.pure-form select, .tiki #conversejs form.pure-form select { background-color: transparent; color: #666666; border-color: transparent; } .tiki #converse-embedded-chat form.pure-form.converse-form, .tiki #conversejs form.pure-form.converse-form { background-color: inherit; } .tiki #converse-embedded-chat form.pure-form.converse-form .form-help, .tiki #conversejs form.pure-form.converse-form .form-help, .tiki #converse-embedded-chat form.pure-form.converse-form .form-help:hover, .tiki #conversejs form.pure-form.converse-form .form-help:hover { color: #666666; } .tiki #converse-embedded-chat .button-primary, .tiki #conversejs .button-primary { color: #ffffff; background-color: #2196f3; border-color: transparent; } .tiki #converse-embedded-chat .button-primary:focus, .tiki #conversejs .button-primary:focus, .tiki #converse-embedded-chat .button-primary.focus, .tiki #conversejs .button-primary.focus { color: #ffffff; background-color: #0c7cd5; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-primary:hover, .tiki #conversejs .button-primary:hover { color: #ffffff; background-color: #0c7cd5; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-primary:active, .tiki #conversejs .button-primary:active, .tiki #converse-embedded-chat .button-primary.active, .tiki #conversejs .button-primary.active, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-primary, .open > .dropdown-toggle.tiki #conversejs .button-primary { color: #ffffff; background-color: #0c7cd5; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-primary:active:hover, .tiki #conversejs .button-primary:active:hover, .tiki #converse-embedded-chat .button-primary.active:hover, .tiki #conversejs .button-primary.active:hover, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-primary:hover, .open > .dropdown-toggle.tiki #conversejs .button-primary:hover, .tiki #converse-embedded-chat .button-primary:active:focus, .tiki #conversejs .button-primary:active:focus, .tiki #converse-embedded-chat .button-primary.active:focus, .tiki #conversejs .button-primary.active:focus, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-primary:focus, .open > .dropdown-toggle.tiki #conversejs .button-primary:focus, .tiki #converse-embedded-chat .button-primary:active.focus, .tiki #conversejs .button-primary:active.focus, .tiki #converse-embedded-chat .button-primary.active.focus, .tiki #conversejs .button-primary.active.focus, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-primary.focus, .open > .dropdown-toggle.tiki #conversejs .button-primary.focus { color: #ffffff; background-color: #0a68b4; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-primary:active, .tiki #conversejs .button-primary:active, .tiki #converse-embedded-chat .button-primary.active, .tiki #conversejs .button-primary.active, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-primary, .open > .dropdown-toggle.tiki #conversejs .button-primary { background-image: none; } .tiki #converse-embedded-chat .button-primary.disabled:hover, .tiki #conversejs .button-primary.disabled:hover, .tiki #converse-embedded-chat .button-primary[disabled]:hover, .tiki #conversejs .button-primary[disabled]:hover, fieldset[disabled] .tiki #converse-embedded-chat .button-primary:hover, fieldset[disabled] .tiki #conversejs .button-primary:hover, .tiki #converse-embedded-chat .button-primary.disabled:focus, .tiki #conversejs .button-primary.disabled:focus, .tiki #converse-embedded-chat .button-primary[disabled]:focus, .tiki #conversejs .button-primary[disabled]:focus, fieldset[disabled] .tiki #converse-embedded-chat .button-primary:focus, fieldset[disabled] .tiki #conversejs .button-primary:focus, .tiki #converse-embedded-chat .button-primary.disabled.focus, .tiki #conversejs .button-primary.disabled.focus, .tiki #converse-embedded-chat .button-primary[disabled].focus, .tiki #conversejs .button-primary[disabled].focus, fieldset[disabled] .tiki #converse-embedded-chat .button-primary.focus, fieldset[disabled] .tiki #conversejs .button-primary.focus { background-color: #2196f3; border-color: transparent; } .tiki #converse-embedded-chat .button-primary .badge, .tiki #conversejs .button-primary .badge { color: #2196f3; background-color: #ffffff; } .tiki #converse-embedded-chat .button-secondary, .tiki #conversejs .button-secondary { color: #ffffff; background-color: #9c27b0; border-color: transparent; } .tiki #converse-embedded-chat .button-secondary:focus, .tiki #conversejs .button-secondary:focus, .tiki #converse-embedded-chat .button-secondary.focus, .tiki #conversejs .button-secondary.focus { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-secondary:hover, .tiki #conversejs .button-secondary:hover { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-secondary:active, .tiki #conversejs .button-secondary:active, .tiki #converse-embedded-chat .button-secondary.active, .tiki #conversejs .button-secondary.active, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-secondary, .open > .dropdown-toggle.tiki #conversejs .button-secondary { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-secondary:active:hover, .tiki #conversejs .button-secondary:active:hover, .tiki #converse-embedded-chat .button-secondary.active:hover, .tiki #conversejs .button-secondary.active:hover, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-secondary:hover, .open > .dropdown-toggle.tiki #conversejs .button-secondary:hover, .tiki #converse-embedded-chat .button-secondary:active:focus, .tiki #conversejs .button-secondary:active:focus, .tiki #converse-embedded-chat .button-secondary.active:focus, .tiki #conversejs .button-secondary.active:focus, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-secondary:focus, .open > .dropdown-toggle.tiki #conversejs .button-secondary:focus, .tiki #converse-embedded-chat .button-secondary:active.focus, .tiki #conversejs .button-secondary:active.focus, .tiki #converse-embedded-chat .button-secondary.active.focus, .tiki #conversejs .button-secondary.active.focus, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-secondary.focus, .open > .dropdown-toggle.tiki #conversejs .button-secondary.focus { color: #ffffff; background-color: #5d1769; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat .button-secondary:active, .tiki #conversejs .button-secondary:active, .tiki #converse-embedded-chat .button-secondary.active, .tiki #conversejs .button-secondary.active, .open > .dropdown-toggle.tiki #converse-embedded-chat .button-secondary, .open > .dropdown-toggle.tiki #conversejs .button-secondary { background-image: none; } .tiki #converse-embedded-chat .button-secondary.disabled:hover, .tiki #conversejs .button-secondary.disabled:hover, .tiki #converse-embedded-chat .button-secondary[disabled]:hover, .tiki #conversejs .button-secondary[disabled]:hover, fieldset[disabled] .tiki #converse-embedded-chat .button-secondary:hover, fieldset[disabled] .tiki #conversejs .button-secondary:hover, .tiki #converse-embedded-chat .button-secondary.disabled:focus, .tiki #conversejs .button-secondary.disabled:focus, .tiki #converse-embedded-chat .button-secondary[disabled]:focus, .tiki #conversejs .button-secondary[disabled]:focus, fieldset[disabled] .tiki #converse-embedded-chat .button-secondary:focus, fieldset[disabled] .tiki #conversejs .button-secondary:focus, .tiki #converse-embedded-chat .button-secondary.disabled.focus, .tiki #conversejs .button-secondary.disabled.focus, .tiki #converse-embedded-chat .button-secondary[disabled].focus, .tiki #conversejs .button-secondary[disabled].focus, fieldset[disabled] .tiki #converse-embedded-chat .button-secondary.focus, fieldset[disabled] .tiki #conversejs .button-secondary.focus { background-color: #9c27b0; border-color: transparent; } .tiki #converse-embedded-chat .button-secondary .badge, .tiki #conversejs .button-secondary .badge { color: #9c27b0; background-color: #ffffff; } .tiki #converse-embedded-chat .toggle-controlbox, .tiki #conversejs .toggle-controlbox { background-color: #2196f3; padding: 8px 10px 0 10px; } .tiki #converse-embedded-chat .toggle-controlbox span, .tiki #conversejs .toggle-controlbox span { color: #ffffff; } .tiki #converse-embedded-chat #minimized-chats .chat-head-chatbox, .tiki #conversejs #minimized-chats .chat-head-chatbox { background-color: #2196f3; } .tiki #converse-embedded-chat #minimized-chats .chat-head-chatbox .restore-chat, .tiki #conversejs #minimized-chats .chat-head-chatbox .restore-chat, .tiki #converse-embedded-chat #minimized-chats .chat-head-chatbox .chatbox-btn, .tiki #conversejs #minimized-chats .chat-head-chatbox .chatbox-btn { color: #ffffff; } .tiki #converse-embedded-chat #minimized-chats .chat-head-chatroom, .tiki #conversejs #minimized-chats .chat-head-chatroom { background-color: #9c27b0; } .tiki #converse-embedded-chat #minimized-chats .chat-head-chatroom .restore-chat, .tiki #conversejs #minimized-chats .chat-head-chatroom .restore-chat, .tiki #converse-embedded-chat #minimized-chats .chat-head-chatroom .chatbox-btn, .tiki #conversejs #minimized-chats .chat-head-chatroom .chatbox-btn { color: #ffffff; } .tiki #converse-embedded-chat #controlbox .box-flyout, .tiki #conversejs #controlbox .box-flyout, .tiki #converse-embedded-chat .chatbox .box-flyout, .tiki #conversejs .chatbox .box-flyout { background-color: #ffffff; } .tiki #converse-embedded-chat #controlbox .controlbox-head, .tiki #conversejs #controlbox .controlbox-head, .tiki #converse-embedded-chat #controlbox .controlbox-panes, .tiki #conversejs #controlbox .controlbox-panes, .tiki #converse-embedded-chat #controlbox .controlbox-pane, .tiki #conversejs #controlbox .controlbox-pane { background-color: inherit; } .tiki #converse-embedded-chat #controlbox .controlbox-head, .tiki #conversejs #controlbox .controlbox-head { border-bottom: 1px solid transparent; } .tiki #converse-embedded-chat #controlbox .controlbox-head .chatbox-btn, .tiki #conversejs #controlbox .controlbox-head .chatbox-btn { color: #666666; } .tiki #converse-embedded-chat #controlbox #controlbox-tabs, .tiki #conversejs #controlbox #controlbox-tabs { border-bottom: 1px solid transparent; } .tiki #converse-embedded-chat #controlbox #controlbox-tabs li a, .tiki #conversejs #controlbox #controlbox-tabs li a { margin-left: 2px; height: 48px; line-height: 48px; color: #2196f3; border: 1px solid transparent; box-shadow: none; background-color: transparent; } .tiki #converse-embedded-chat #controlbox #controlbox-tabs li a:hover, .tiki #conversejs #controlbox #controlbox-tabs li a:hover { color: #2196f3; } .tiki #converse-embedded-chat #controlbox #controlbox-tabs li a.current, .tiki #conversejs #controlbox #controlbox-tabs li a.current, .tiki #converse-embedded-chat #controlbox #controlbox-tabs li a.current:hover, .tiki #conversejs #controlbox #controlbox-tabs li a.current:hover, .tiki #converse-embedded-chat #controlbox #controlbox-tabs li a.current:focus, .tiki #conversejs #controlbox #controlbox-tabs li a.current:focus { color: #666666; background-color: transparent; border: 1px solid transparent; border-bottom-color: transparent; height: 48px; } .tiki #converse-embedded-chat #controlbox #chatrooms dl.rooms-list dt, .tiki #conversejs #controlbox #chatrooms dl.rooms-list dt { color: #666666; text-shadow: none; } .tiki #converse-embedded-chat #controlbox #chatrooms dl.rooms-list dd.available-chatroom:hover, .tiki #conversejs #controlbox #chatrooms dl.rooms-list dd.available-chatroom:hover { background-color: inherit; } .tiki #converse-embedded-chat #controlbox #chatrooms dl.rooms-list dd.available-chatroom:hover a, .tiki #conversejs #controlbox #chatrooms dl.rooms-list dd.available-chatroom:hover a { color: #666666; } .tiki #converse-embedded-chat #controlbox #chatrooms dl.rooms-list dd.available-chatroom a.room-info, .tiki #conversejs #controlbox #chatrooms dl.rooms-list dd.available-chatroom a.room-info { margin-top: 2px; } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select, .tiki #conversejs #controlbox #fancy-xmpp-status-select, .tiki #converse-embedded-chat #controlbox .fancy-dropdown, .tiki #conversejs #controlbox .fancy-dropdown { color: #ffffff; background-color: #9c27b0; border-color: transparent; } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select:focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:focus, .tiki #conversejs #controlbox .fancy-dropdown:focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select.focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.focus, .tiki #conversejs #controlbox .fancy-dropdown.focus { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:hover, .tiki #conversejs #controlbox #fancy-xmpp-status-select:hover, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:hover, .tiki #conversejs #controlbox .fancy-dropdown:hover { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:active, .tiki #conversejs #controlbox #fancy-xmpp-status-select:active, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:active, .tiki #conversejs #controlbox .fancy-dropdown:active, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.active, .tiki #conversejs #controlbox #fancy-xmpp-status-select.active, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.active, .tiki #conversejs #controlbox .fancy-dropdown.active, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select, .open > .dropdown-toggle.tiki #conversejs #controlbox #fancy-xmpp-status-select, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox .fancy-dropdown, .open > .dropdown-toggle.tiki #conversejs #controlbox .fancy-dropdown { color: #ffffff; background-color: #771e86; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:active:hover, .tiki #conversejs #controlbox #fancy-xmpp-status-select:active:hover, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:active:hover, .tiki #conversejs #controlbox .fancy-dropdown:active:hover, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.active:hover, .tiki #conversejs #controlbox #fancy-xmpp-status-select.active:hover, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.active:hover, .tiki #conversejs #controlbox .fancy-dropdown.active:hover, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:hover, .open > .dropdown-toggle.tiki #conversejs #controlbox #fancy-xmpp-status-select:hover, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox .fancy-dropdown:hover, .open > .dropdown-toggle.tiki #conversejs #controlbox .fancy-dropdown:hover, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:active:focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select:active:focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:active:focus, .tiki #conversejs #controlbox .fancy-dropdown:active:focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.active:focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select.active:focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.active:focus, .tiki #conversejs #controlbox .fancy-dropdown.active:focus, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:focus, .open > .dropdown-toggle.tiki #conversejs #controlbox #fancy-xmpp-status-select:focus, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox .fancy-dropdown:focus, .open > .dropdown-toggle.tiki #conversejs #controlbox .fancy-dropdown:focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:active.focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select:active.focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:active.focus, .tiki #conversejs #controlbox .fancy-dropdown:active.focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.active.focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select.active.focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.active.focus, .tiki #conversejs #controlbox .fancy-dropdown.active.focus, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.focus, .open > .dropdown-toggle.tiki #conversejs #controlbox #fancy-xmpp-status-select.focus, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox .fancy-dropdown.focus, .open > .dropdown-toggle.tiki #conversejs #controlbox .fancy-dropdown.focus { color: #ffffff; background-color: #5d1769; border-color: rgba(0, 0, 0, 0); } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:active, .tiki #conversejs #controlbox #fancy-xmpp-status-select:active, .tiki #converse-embedded-chat #controlbox .fancy-dropdown:active, .tiki #conversejs #controlbox .fancy-dropdown:active, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.active, .tiki #conversejs #controlbox #fancy-xmpp-status-select.active, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.active, .tiki #conversejs #controlbox .fancy-dropdown.active, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select, .open > .dropdown-toggle.tiki #conversejs #controlbox #fancy-xmpp-status-select, .open > .dropdown-toggle.tiki #converse-embedded-chat #controlbox .fancy-dropdown, .open > .dropdown-toggle.tiki #conversejs #controlbox .fancy-dropdown { background-image: none; } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.disabled:hover, .tiki #conversejs #controlbox #fancy-xmpp-status-select.disabled:hover, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.disabled:hover, .tiki #conversejs #controlbox .fancy-dropdown.disabled:hover, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select[disabled]:hover, .tiki #conversejs #controlbox #fancy-xmpp-status-select[disabled]:hover, .tiki #converse-embedded-chat #controlbox .fancy-dropdown[disabled]:hover, .tiki #conversejs #controlbox .fancy-dropdown[disabled]:hover, fieldset[disabled] .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:hover, fieldset[disabled] .tiki #conversejs #controlbox #fancy-xmpp-status-select:hover, fieldset[disabled] .tiki #converse-embedded-chat #controlbox .fancy-dropdown:hover, fieldset[disabled] .tiki #conversejs #controlbox .fancy-dropdown:hover, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.disabled:focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select.disabled:focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.disabled:focus, .tiki #conversejs #controlbox .fancy-dropdown.disabled:focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select[disabled]:focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select[disabled]:focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown[disabled]:focus, .tiki #conversejs #controlbox .fancy-dropdown[disabled]:focus, fieldset[disabled] .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select:focus, fieldset[disabled] .tiki #conversejs #controlbox #fancy-xmpp-status-select:focus, fieldset[disabled] .tiki #converse-embedded-chat #controlbox .fancy-dropdown:focus, fieldset[disabled] .tiki #conversejs #controlbox .fancy-dropdown:focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.disabled.focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select.disabled.focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown.disabled.focus, .tiki #conversejs #controlbox .fancy-dropdown.disabled.focus, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select[disabled].focus, .tiki #conversejs #controlbox #fancy-xmpp-status-select[disabled].focus, .tiki #converse-embedded-chat #controlbox .fancy-dropdown[disabled].focus, .tiki #conversejs #controlbox .fancy-dropdown[disabled].focus, fieldset[disabled] .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select.focus, fieldset[disabled] .tiki #conversejs #controlbox #fancy-xmpp-status-select.focus, fieldset[disabled] .tiki #converse-embedded-chat #controlbox .fancy-dropdown.focus, fieldset[disabled] .tiki #conversejs #controlbox .fancy-dropdown.focus { background-color: #9c27b0; border-color: transparent; } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select .badge, .tiki #conversejs #controlbox #fancy-xmpp-status-select .badge, .tiki #converse-embedded-chat #controlbox .fancy-dropdown .badge, .tiki #conversejs #controlbox .fancy-dropdown .badge { color: #9c27b0; background-color: #ffffff; } .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select .choose-xmpp-status, .tiki #conversejs #controlbox #fancy-xmpp-status-select .choose-xmpp-status, .tiki #converse-embedded-chat #controlbox .fancy-dropdown .choose-xmpp-status, .tiki #conversejs #controlbox .fancy-dropdown .choose-xmpp-status, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select .toggle-xmpp-contact-form, .tiki #conversejs #controlbox #fancy-xmpp-status-select .toggle-xmpp-contact-form, .tiki #converse-embedded-chat #controlbox .fancy-dropdown .toggle-xmpp-contact-form, .tiki #conversejs #controlbox .fancy-dropdown .toggle-xmpp-contact-form, .tiki #converse-embedded-chat #controlbox #fancy-xmpp-status-select a.change-xmpp-status-message, .tiki #conversejs #controlbox #fancy-xmpp-status-select a.change-xmpp-status-message, .tiki #converse-embedded-chat #controlbox .fancy-dropdown a.change-xmpp-status-message, .tiki #conversejs #controlbox .fancy-dropdown a.change-xmpp-status-message { color: inherit; text-shadow: none; } .tiki #converse-embedded-chat #controlbox .xmpp-status-menu li a.online, .tiki #conversejs #controlbox .xmpp-status-menu li a.online, .tiki #converse-embedded-chat #controlbox .xmpp-status-menu li a.dnd, .tiki #conversejs #controlbox .xmpp-status-menu li a.dnd, .tiki #converse-embedded-chat #controlbox .xmpp-status-menu li a.away, .tiki #conversejs #controlbox .xmpp-status-menu li a.away { color: #1f7e9a; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-filter-form .filter-type, .tiki #conversejs #controlbox #converse-roster .roster-filter-form .filter-type { border-color: transparent; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-filter-form .roster-filter, .tiki #conversejs #controlbox #converse-roster .roster-filter-form .roster-filter { background-color: transparent; color: #666666; border-color: transparent; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dt, .tiki #conversejs #controlbox #converse-roster .roster-contacts dt { color: #666666; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dt a, .tiki #conversejs #controlbox #converse-roster .roster-contacts dt a { color: inherit; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dt:hover, .tiki #conversejs #controlbox #converse-roster .roster-contacts dt:hover { background-color: transparent; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dd, .tiki #conversejs #controlbox #converse-roster .roster-contacts dd { color: #2196f3; background-color: transparent; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dd a, .tiki #conversejs #controlbox #converse-roster .roster-contacts dd a, .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dd span, .tiki #conversejs #controlbox #converse-roster .roster-contacts dd span { color: inherit; text-shadow: none; } .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dd a:hover, .tiki #conversejs #controlbox #converse-roster .roster-contacts dd a:hover, .tiki #converse-embedded-chat #controlbox #converse-roster .roster-contacts dd span:hover, .tiki #conversejs #controlbox #converse-roster .roster-contacts dd span:hover { color: #666666; } .tiki #converse-embedded-chat #controlbox #converse-register, .tiki #conversejs #controlbox #converse-register { background-color: transparent; } .tiki #converse-embedded-chat #controlbox #converse-register .form-help .url, .tiki #conversejs #controlbox #converse-register .form-help .url { color: #2196f3; } .tiki #converse-embedded-chat #controlbox #converse-register .form-help .url:hover, .tiki #conversejs #controlbox #converse-register .form-help .url:hover { color: #0a6ebd; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar { background-color: #2196f3; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar ul, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar ul { background-color: #2196f3; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar > li, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar > li { margin: -2px; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar a, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar a, .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar .toggle-smiley, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar .toggle-smiley, .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar .unencrypted, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar .unencrypted { color: #ffffff; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar .toggle-smiley ul li:hover, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar .toggle-smiley ul li:hover { background-color: #ffffff; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar .toggle-smiley ul li:hover a, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar .toggle-smiley ul li:hover a { color: #2196f3; } .tiki #converse-embedded-chat .chatbox form.sendXMPPMessage .chat-toolbar .chat-toolbar-text, .tiki #conversejs .chatbox form.sendXMPPMessage .chat-toolbar .chat-toolbar-text { text-shadow: none; } .tiki #converse-embedded-chat .chatbox .dropdown, .tiki #conversejs .chatbox .dropdown { background-color: transparent; } .tiki #converse-embedded-chat .chatbox .chat-head, .tiki #conversejs .chatbox .chat-head { border-bottom: 1px solid #666666; } .tiki #converse-embedded-chat .chatbox .chat-head.chat-head-chatbox, .tiki #conversejs .chatbox .chat-head.chat-head-chatbox { background-color: #2196f3; } .tiki #converse-embedded-chat .chatbox .chat-head .chat-title, .tiki #conversejs .chatbox .chat-head .chat-title, .tiki #converse-embedded-chat .chatbox .chat-head .close-chatbox-button, .tiki #conversejs .chatbox .chat-head .close-chatbox-button, .tiki #converse-embedded-chat .chatbox .chat-head .toggle-chatbox-button, .tiki #conversejs .chatbox .chat-head .toggle-chatbox-button { color: #ffffff; } .tiki #converse-embedded-chat .chatbox .chat-body, .tiki #conversejs .chatbox .chat-body { background-color: inherit; } .tiki #converse-embedded-chat .chatbox .chat-body .chat-content, .tiki #conversejs .chatbox .chat-body .chat-content { height: calc(100% - 95px); color: #666666; background-color: inherit; } .tiki #converse-embedded-chat .chatbox .chat-body .chat-info, .tiki #conversejs .chatbox .chat-body .chat-info { color: #2196f3; } .tiki #converse-embedded-chat .chatbox .chat-body .chat-message span.chat-msg-me, .tiki #conversejs .chatbox .chat-body .chat-message span.chat-msg-me { color: #9c27b0; } .tiki #converse-embedded-chat .chatbox .chat-body .chat-message span.chat-msg-them, .tiki #conversejs .chatbox .chat-body .chat-message span.chat-msg-them { color: #2196f3; } .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom { background-color: #9c27b0; } .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom .close-chatbox-button, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom .close-chatbox-button, .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom .toggle-chatbox-button, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom .toggle-chatbox-button, .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom .toggle-bookmark, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom .toggle-bookmark, .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom .chat-title, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom .chat-title, .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom .chatroom-description, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom .chatroom-description, .tiki #converse-embedded-chat .chatroom .box-flyout .chat-head-chatroom .configure-chatroom-button, .tiki #conversejs .chatroom .box-flyout .chat-head-chatroom .configure-chatroom-button { color: #ffffff; } .tiki #converse-embedded-chat .chatroom .box-flyout .chatroom-body p, .tiki #conversejs .chatroom .box-flyout .chatroom-body p { color: #666666; } .tiki #converse-embedded-chat .chatroom .box-flyout .chatroom-body .occupants, .tiki #conversejs .chatroom .box-flyout .chatroom-body .occupants { background-color: inherit; border-left-color: #666666; } .tiki #converse-embedded-chat .chatroom .box-flyout .chatroom-body .occupants ul li.moderator, .tiki #conversejs .chatroom .box-flyout .chatroom-body .occupants ul li.moderator { color: #2196f3; } .tiki #converse-embedded-chat .chatroom .box-flyout .chatroom-body .occupants ul li.occupant .occupant-status, .tiki #conversejs .chatroom .box-flyout .chatroom-body .occupants ul li.occupant .occupant-status { margin-left: 1px; box-shadow: 0px 0px 1px 1px #444; } .tiki #converse-embedded-chat .chatroom .box-flyout .chatroom-body .chatroom-form-container, .tiki #conversejs .chatroom .box-flyout .chatroom-body .chatroom-form-container { background-color: inherit; color: #666666; } .tiki #converse-embedded-chat .chatroom .box-flyout .chatroom-body .room-invite .invited-contact, .tiki #conversejs .chatroom .box-flyout .chatroom-body .room-invite .invited-contact { border-color: transparent; }
tikiorg/tiki
themes/paper/css/paper.css
CSS
lgpl-2.1
221,717
/******************************************************************************* * Copyright 2002 National Student Clearinghouse * * This code is part of the Meteor system as defined and specified * by the National Student Clearinghouse and the Meteor Sponsors. * * 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.meteornetwork.meteor.common.abstraction.index; import org.meteornetwork.meteor.common.xml.indexresponse.DataProvider; import org.meteornetwork.meteor.common.xml.indexresponse.DataProviders; import org.meteornetwork.meteor.common.xml.indexresponse.IndexProviderData; import org.meteornetwork.meteor.common.xml.indexresponse.IndexProviderMessages; import org.meteornetwork.meteor.common.xml.indexresponse.Message; import org.meteornetwork.meteor.common.xml.indexresponse.MeteorIndexResponse; import org.meteornetwork.meteor.common.xml.indexresponse.types.RsMsgLevelEnum; public class MeteorIndexResponseWrapper { private final MeteorIndexResponse response; public MeteorIndexResponseWrapper() { response = new MeteorIndexResponse(); response.setDataProviders(new DataProviders()); } /** * Add index provider information to the response. * * @param id * the ID of this index provider * @param name * the name of this index provider * @param url * the contact URL of this index provider */ public void setIndexProviderData(String id, String name, String url) { IndexProviderData data = new IndexProviderData(); data.setEntityID(id); data.setEntityName(name); data.setEntityURL(url); response.setIndexProviderData(data); } /** * Add a message to this response * * @param messageText * the text of the message * @param level * the severity level of the message */ public void addMessage(String messageText, RsMsgLevelEnum level) { Message message = new Message(); message.setRsMsg(messageText); message.setRsMsgLevel(level.name()); if (response.getIndexProviderMessages() == null) { response.setIndexProviderMessages(new IndexProviderMessages()); } response.getIndexProviderMessages().addMessage(message); } /** * Add one or more Data Provider objects to the response * * @param dataProviders * the data providers to add to the response */ public void addDataProviders(DataProvider... dataProviders) { for (DataProvider dataProvider : dataProviders) { response.getDataProviders().addDataProvider(dataProvider); } } /** * Add Data Provider objects to the response * * @param dataProviders * an iterable collection of Data Providers to add to the * response */ public void addDataProviders(Iterable<DataProvider> dataProviders) { for (DataProvider dataProvider : dataProviders) { response.getDataProviders().addDataProvider(dataProvider); } } /** * Access a mutable version of the response. * * @return A mutable version of the internal MeteorIndexResponse object */ public MeteorIndexResponse getResponse() { return response; } }
NationalStudentClearinghouse/Meteor4
meteorlib/src/main/java/org/meteornetwork/meteor/common/abstraction/index/MeteorIndexResponseWrapper.java
Java
lgpl-2.1
3,856
// The libMesh Finite Element Library. // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner // 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 // Local includes #include "libmesh/side.h" #include "libmesh/edge_edge3.h" #include "libmesh/face_quad9.h" #include "libmesh/enum_io_package.h" #include "libmesh/enum_order.h" namespace libMesh { // ------------------------------------------------------------ // Quad9 class static member initializations const int Quad9::num_nodes; const int Quad9::num_sides; const int Quad9::num_children; const int Quad9::nodes_per_side; const unsigned int Quad9::side_nodes_map[Quad9::num_sides][Quad9::nodes_per_side] = { {0, 1, 4}, // Side 0 {1, 2, 5}, // Side 1 {2, 3, 6}, // Side 2 {3, 0, 7} // Side 3 }; #ifdef LIBMESH_ENABLE_AMR const float Quad9::_embedding_matrix[Quad9::num_children][Quad9::num_nodes][Quad9::num_nodes] = { // embedding matrix for child 0 { // 0 1 2 3 4 5 6 7 8 { 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 0 { 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 1 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 }, // 2 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000 }, // 3 { 0.375000, -0.125000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 4 { 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.00000, 0.750000 }, // 5 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.750000 }, // 6 { 0.375000, 0.00000, 0.00000, -0.125000, 0.00000, 0.00000, 0.00000, 0.750000, 0.00000 }, // 7 { 0.140625, -0.0468750, 0.0156250, -0.0468750, 0.281250, -0.0937500, -0.0937500, 0.281250, 0.562500 } // 8 }, // embedding matrix for child 1 { // 0 1 2 3 4 5 6 7 8 { 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 0 { 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 1 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000 }, // 2 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 }, // 3 { -0.125000, 0.375000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 4 { 0.00000, 0.375000, -0.125000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000 }, // 5 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.750000 }, // 6 { 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.00000, 0.750000 }, // 7 { -0.0468750, 0.140625, -0.0468750, 0.0156250, 0.281250, 0.281250, -0.0937500, -0.0937500, 0.562500 } // 8 }, // embedding matrix for child 2 { // 0 1 2 3 4 5 6 7 8 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000 }, // 0 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 }, // 1 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000 }, // 2 { 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 3 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.750000 }, // 4 { 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.00000, 0.750000 }, // 5 { 0.00000, 0.00000, -0.125000, 0.375000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000 }, // 6 { -0.125000, 0.00000, 0.00000, 0.375000, 0.00000, 0.00000, 0.00000, 0.750000, 0.00000 }, // 7 { -0.0468750, 0.0156250, -0.0468750, 0.140625, -0.0937500, -0.0937500, 0.281250, 0.281250, 0.562500 } // 8 }, // embedding matrix for child 3 { // 0 1 2 3 4 5 6 7 8 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000 }, // 0 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000 }, // 1 { 0.00000, 0.00000, 1.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 }, // 2 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 1.00000, 0.00000, 0.00000 }, // 3 { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.375000, 0.00000, -0.125000, 0.750000 }, // 4 { 0.00000, -0.125000, 0.375000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000, 0.00000 }, // 5 { 0.00000, 0.00000, 0.375000, -0.125000, 0.00000, 0.00000, 0.750000, 0.00000, 0.00000 }, // 6 { 0.00000, 0.00000, 0.00000, 0.00000, -0.125000, 0.00000, 0.375000, 0.00000, 0.750000 }, // 7 { 0.0156250, -0.0468750, 0.140625, -0.0468750, -0.0937500, 0.281250, 0.281250, -0.0937500, 0.562500 } // 8 } }; #endif // ------------------------------------------------------------ // Quad9 class member functions bool Quad9::is_vertex(const unsigned int i) const { if (i < 4) return true; return false; } bool Quad9::is_edge(const unsigned int i) const { if (i < 4) return false; if (i > 7) return false; return true; } bool Quad9::is_face(const unsigned int i) const { if (i > 7) return true; return false; } bool Quad9::is_node_on_side(const unsigned int n, const unsigned int s) const { libmesh_assert_less (s, n_sides()); return std::find(std::begin(side_nodes_map[s]), std::end(side_nodes_map[s]), n) != std::end(side_nodes_map[s]); } std::vector<unsigned> Quad9::nodes_on_side(const unsigned int s) const { libmesh_assert_less(s, n_sides()); return {std::begin(side_nodes_map[s]), std::end(side_nodes_map[s])}; } bool Quad9::has_affine_map() const { // make sure corners form a parallelogram Point v = this->point(1) - this->point(0); if (!v.relative_fuzzy_equals(this->point(2) - this->point(3))) return false; // make sure "horizontal" sides are straight v /= 2; if (!v.relative_fuzzy_equals(this->point(4) - this->point(0)) || !v.relative_fuzzy_equals(this->point(6) - this->point(3))) return false; // make sure "vertical" sides are straight // and the center node is centered v = (this->point(3) - this->point(0))/2; if (!v.relative_fuzzy_equals(this->point(7) - this->point(0)) || !v.relative_fuzzy_equals(this->point(5) - this->point(1)) || !v.relative_fuzzy_equals(this->point(8) - this->point(4))) return false; return true; } Order Quad9::default_order() const { return SECOND; } dof_id_type Quad9::key (const unsigned int s) const { libmesh_assert_less (s, this->n_sides()); switch (s) { case 0: return this->compute_key (this->node_id(4)); case 1: return this->compute_key (this->node_id(5)); case 2: return this->compute_key (this->node_id(6)); case 3: return this->compute_key (this->node_id(7)); default: libmesh_error_msg("Invalid side s = " << s); } } dof_id_type Quad9::key () const { return this->compute_key(this->node_id(8)); } unsigned int Quad9::which_node_am_i(unsigned int side, unsigned int side_node) const { libmesh_assert_less (side, this->n_sides()); libmesh_assert_less (side_node, Quad9::nodes_per_side); return Quad9::side_nodes_map[side][side_node]; } std::unique_ptr<Elem> Quad9::build_side_ptr (const unsigned int i, bool proxy) { libmesh_assert_less (i, this->n_sides()); if (proxy) return libmesh_make_unique<Side<Edge3,Quad9>>(this,i); else { std::unique_ptr<Elem> edge = libmesh_make_unique<Edge3>(); edge->subdomain_id() = this->subdomain_id(); // Set the nodes for (unsigned n=0; n<edge->n_nodes(); ++n) edge->set_node(n) = this->node_ptr(Quad9::side_nodes_map[i][n]); return edge; } } void Quad9::connectivity(const unsigned int sf, const IOPackage iop, std::vector<dof_id_type> & conn) const { libmesh_assert_less (sf, this->n_sub_elem()); libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE); conn.resize(4); switch (iop) { case TECPLOT: { switch(sf) { case 0: // linear sub-quad 0 conn[0] = this->node_id(0)+1; conn[1] = this->node_id(4)+1; conn[2] = this->node_id(8)+1; conn[3] = this->node_id(7)+1; return; case 1: // linear sub-quad 1 conn[0] = this->node_id(4)+1; conn[1] = this->node_id(1)+1; conn[2] = this->node_id(5)+1; conn[3] = this->node_id(8)+1; return; case 2: // linear sub-quad 2 conn[0] = this->node_id(7)+1; conn[1] = this->node_id(8)+1; conn[2] = this->node_id(6)+1; conn[3] = this->node_id(3)+1; return; case 3: // linear sub-quad 3 conn[0] = this->node_id(8)+1; conn[1] = this->node_id(5)+1; conn[2] = this->node_id(2)+1; conn[3] = this->node_id(6)+1; return; default: libmesh_error_msg("Invalid sf = " << sf); } } case VTK: { conn.resize(9); conn[0] = this->node_id(0); conn[1] = this->node_id(1); conn[2] = this->node_id(2); conn[3] = this->node_id(3); conn[4] = this->node_id(4); conn[5] = this->node_id(5); conn[6] = this->node_id(6); conn[7] = this->node_id(7); conn[8] = this->node_id(8); return; /* switch(sf) { case 0: // linear sub-quad 0 conn[0] = this->node_id(0); conn[1] = this->node_id(4); conn[2] = this->node_id(8); conn[3] = this->node_id(7); return; case 1: // linear sub-quad 1 conn[0] = this->node_id(4); conn[1] = this->node_id(1); conn[2] = this->node_id(5); conn[3] = this->node_id(8); return; case 2: // linear sub-quad 2 conn[0] = this->node_id(7); conn[1] = this->node_id(8); conn[2] = this->node_id(6); conn[3] = this->node_id(3); return; case 3: // linear sub-quad 3 conn[0] = this->node_id(8); conn[1] = this->node_id(5); conn[2] = this->node_id(2); conn[3] = this->node_id(6); return; default: libmesh_error_msg("Invalid sf = " << sf); }*/ } default: libmesh_error_msg("Unsupported IO package " << iop); } } BoundingBox Quad9::loose_bounding_box () const { // This might have curved edges, or might be a curved surface in // 3-space, in which case the full bounding box can be larger than // the bounding box of just the nodes. // // // FIXME - I haven't yet proven the formula below to be correct for // biquadratics - RHS Point pmin, pmax; for (unsigned d=0; d<LIBMESH_DIM; ++d) { const Real center = this->point(8)(d); Real hd = std::abs(center - this->point(0)(d)); for (unsigned int p=0; p != 8; ++p) hd = std::max(hd, std::abs(center - this->point(p)(d))); pmin(d) = center - hd; pmax(d) = center + hd; } return BoundingBox(pmin, pmax); } Real Quad9::volume () const { // Make copies of our points. It makes the subsequent calculations a bit // shorter and avoids dereferencing the same pointer multiple times. Point x0 = point(0), x1 = point(1), x2 = point(2), x3 = point(3), x4 = point(4), x5 = point(5), x6 = point(6), x7 = point(7), x8 = point(8); // Construct constant data vectors. // \vec{x}_{\xi} = \vec{a1}*xi*eta^2 + \vec{b1}*eta**2 + \vec{c1}*xi*eta + \vec{d1}*xi + \vec{e1}*eta + \vec{f1} // \vec{x}_{\eta} = \vec{a2}*xi^2*eta + \vec{b2}*xi**2 + \vec{c2}*xi*eta + \vec{d2}*xi + \vec{e2}*eta + \vec{f2} // This is copy-pasted directly from the output of a Python script. Point a1 = x0/2 + x1/2 + x2/2 + x3/2 - x4 - x5 - x6 - x7 + 2*x8, b1 = -x0/4 + x1/4 + x2/4 - x3/4 - x5/2 + x7/2, c1 = -x0/2 - x1/2 + x2/2 + x3/2 + x4 - x6, d1 = x5 + x7 - 2*x8, e1 = x0/4 - x1/4 + x2/4 - x3/4, f1 = x5/2 - x7/2, a2 = a1, b2 = -x0/4 - x1/4 + x2/4 + x3/4 + x4/2 - x6/2, c2 = -x0/2 + x1/2 + x2/2 - x3/2 - x5 + x7, d2 = x0/4 - x1/4 + x2/4 - x3/4, e2 = x4 + x6 - 2*x8, f2 = -x4/2 + x6/2; // 3x3 quadrature, exact for bi-quintics const unsigned int N = 3; const Real q[N] = {-std::sqrt(15)/5., 0., std::sqrt(15)/5.}; const Real w[N] = {5./9, 8./9, 5./9}; Real vol=0.; for (unsigned int i=0; i<N; ++i) for (unsigned int j=0; j<N; ++j) vol += w[i] * w[j] * cross_norm(q[i]*q[j]*q[j]*a1 + q[j]*q[j]*b1 + q[j]*q[i]*c1 + q[i]*d1 + q[j]*e1 + f1, q[i]*q[i]*q[j]*a2 + q[i]*q[i]*b2 + q[j]*q[i]*c2 + q[i]*d2 + q[j]*e2 + f2); return vol; } unsigned int Quad9::n_second_order_adjacent_vertices (const unsigned int n) const { switch (n) { case 4: case 5: case 6: case 7: return 2; case 8: return 4; default: libmesh_error_msg("Invalid n = " << n); } } unsigned short int Quad9::second_order_adjacent_vertex (const unsigned int n, const unsigned int v) const { libmesh_assert_greater_equal (n, this->n_vertices()); libmesh_assert_less (n, this->n_nodes()); switch (n) { case 8: { libmesh_assert_less (v, 4); return static_cast<unsigned short int>(v); } default: { libmesh_assert_less (v, 2); // use the matrix that we inherited from \p Quad return _second_order_adjacent_vertices[n-this->n_vertices()][v]; } } } std::pair<unsigned short int, unsigned short int> Quad9::second_order_child_vertex (const unsigned int n) const { libmesh_assert_greater_equal (n, this->n_vertices()); libmesh_assert_less (n, this->n_nodes()); /* * the _second_order_vertex_child_* vectors are * stored in face_quad.C, since they are identical * for Quad8 and Quad9 (for the first 4 higher-order nodes) */ return std::pair<unsigned short int, unsigned short int> (_second_order_vertex_child_number[n], _second_order_vertex_child_index[n]); } } // namespace libMesh
giorgiobornia/libmesh
src/geom/face_quad9.C
C++
lgpl-2.1
16,533
/*************************************************************************** * Copyright (C) 2011-2015 by Fabrizio Montesi <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 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 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. * * * * For details about the authors of this software, see the AUTHORS file. * ***************************************************************************/ package jolie.runtime.typing; import jolie.lang.Constants; /** * * @author Fabrizio Montesi */ public class TypeCastingException extends Exception { public final static long serialVersionUID = Constants.serialVersionUID(); public TypeCastingException() { super(); } public TypeCastingException( String message ) { super( message ); } /* * @Override public Throwable fillInStackTrace() { return this; } */ }
jolie/jolie
jolie/src/main/java/jolie/runtime/typing/TypeCastingException.java
Java
lgpl-2.1
1,972
/* * bsb2png.c - Convert a bsb raster image to a Portable Network Graphics (png). * See http://www.libpng.org for details of the PNG format and how * to use libpng. * * Copyright (C) 2004 Stefan Petersen <[email protected]> * * 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 * * $Id: bsb2png.c,v 1.7 2007/02/05 17:08:18 mikrom Exp $ * */ #include <stdlib.h> #include <stdio.h> #include <bsb.h> #include <png.h> static void copy_bsb_to_png(BSBImage *image, png_structp png_ptr) { int row, bp, pp; uint8_t *bsb_row, *png_row; bsb_row = (uint8_t *)malloc(image->height * sizeof(uint8_t *)); png_row = (uint8_t *)malloc(image->height * sizeof(uint8_t *) * image->depth); /* Copy row by row */ for (row = 0; row < image->height; row++) { bsb_seek_to_row(image, row); bsb_read_row(image, bsb_row); for (bp = 0, pp = 0; bp < image->width; bp++) { png_row[pp++] = image->red[bsb_row[bp]]; png_row[pp++] = image->green[bsb_row[bp]]; png_row[pp++] = image->blue[bsb_row[bp]]; } png_write_row(png_ptr, png_row); } free(bsb_row); free(png_row); } /* copy_bsb_to_png */ int main(int argc, char *argv[]) { BSBImage image; FILE *png_fd; png_structp png_ptr; png_infop info_ptr; png_text text[2]; if (argc != 3) { fprintf(stderr, "Usage:\n\tbsb2png input.kap output.png\n"); exit(1); } png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png_ptr == NULL) { fprintf(stderr, "png_ptr == NULL\n"); exit(1); } info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { fprintf(stderr, "info_ptr == NULL\n"); png_destroy_write_struct(&png_ptr, (png_infopp)NULL); exit(1); } if ((png_fd = fopen(argv[2], "wb")) == NULL) { perror("fopen"); exit(1); } png_init_io(png_ptr, png_fd); if (! bsb_open_header(argv[1], &image)) { exit(1); } png_set_IHDR(png_ptr, info_ptr, image.width, image.height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); /* Some text to go with the png image */ text[0].key = "Title"; text[0].text = argv[2]; text[0].compression = PNG_TEXT_COMPRESSION_NONE; text[1].key = "Generator"; text[1].text = "bsb2png"; text[1].compression = PNG_TEXT_COMPRESSION_NONE; png_set_text(png_ptr, info_ptr, text, 2); /* Write header data */ png_write_info(png_ptr, info_ptr); /* Copy the image in itself */ copy_bsb_to_png(&image, png_ptr); png_write_end(png_ptr, NULL); fclose(png_fd); png_destroy_write_struct(&png_ptr, &info_ptr); bsb_close(&image); return 0; }
nohal/libbsb
bsb2png.c
C
lgpl-2.1
3,266
/****************************************************************************** * * Copyright (C) 2006-2015 by * The Salk Institute for Biological Studies and * Pittsburgh Supercomputing Center, Carnegie Mellon University * * 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 2 * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * ******************************************************************************/ #include "config.h" #include "logging.h" #include "mem_util.h" #include <stdio.h> #include <stdlib.h> #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #include <string.h> /* Our log file */ static FILE *mcell_log_file = NULL; /* Our warning/error file */ static FILE *mcell_error_file = NULL; /* Get the log file. */ FILE *mcell_get_log_file(void) { if (mcell_log_file == NULL) { #ifdef DEBUG setvbuf(stdout, NULL, _IONBF, 0); #endif mcell_log_file = stdout; } return mcell_log_file; } /* Get the error file. */ FILE *mcell_get_error_file(void) { if (mcell_error_file == NULL) { #ifdef DEBUG setvbuf(stderr, NULL, _IONBF, 0); #endif mcell_error_file = stderr; } return mcell_error_file; } /* Set the log file. */ void mcell_set_log_file(FILE *f) { if (mcell_log_file != NULL && mcell_log_file != stdout && mcell_log_file != stderr) fclose(mcell_log_file); mcell_log_file = f; #ifdef DEBUG setvbuf(mcell_log_file, NULL, _IONBF, 0); #else setvbuf(mcell_log_file, NULL, _IOLBF, 128); #endif } /* Set the error file. */ void mcell_set_error_file(FILE *f) { if (mcell_error_file != NULL && mcell_error_file != stdout && mcell_error_file != stderr) fclose(mcell_error_file); mcell_error_file = f; #ifdef DEBUG setvbuf(mcell_error_file, NULL, _IONBF, 0); #else setvbuf(mcell_error_file, NULL, _IOLBF, 128); #endif } /* Log a message. */ void mcell_log_raw(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_logv_raw(fmt, args); va_end(args); } /* Log a message (va_list version). */ void mcell_logv_raw(char const *fmt, va_list args) { vfprintf(mcell_get_log_file(), fmt, args); } /* Log a message. */ void mcell_error_raw(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_errorv_raw(fmt, args); va_end(args); } /* Log a message (va_list version). */ void mcell_errorv_raw(char const *fmt, va_list args) { vfprintf(mcell_get_error_file(), fmt, args); } /* Log a message. */ void mcell_log(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_logv(fmt, args); va_end(args); } /* Log a message (va_list version). */ void mcell_logv(char const *fmt, va_list args) { mcell_logv_raw(fmt, args); fprintf(mcell_get_log_file(), "\n"); } /* Log a warning. */ void mcell_warn(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_warnv(fmt, args); va_end(args); } /* Log a warning (va_list version). */ void mcell_warnv(char const *fmt, va_list args) { fprintf(mcell_get_error_file(), "Warning: "); mcell_errorv_raw(fmt, args); fprintf(mcell_get_error_file(), "\n"); } /* Log an error and carry on. */ void mcell_error_nodie(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_errorv_nodie(fmt, args); va_end(args); } /* Log an error and carry on (va_list version). */ void mcell_errorv_nodie(char const *fmt, va_list args) { fprintf(mcell_get_error_file(), "Fatal error: "); mcell_errorv_raw(fmt, args); fprintf(mcell_get_error_file(), "\n"); } /* Log an error and exit. */ void mcell_error(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_errorv(fmt, args); va_end(args); } /* Log an error and exit (va_list version). */ void mcell_errorv(char const *fmt, va_list args) { mcell_errorv_nodie(fmt, args); mcell_die(); } /* Log an internal error and exit. */ void mcell_internal_error_(char const *file, unsigned int line, char const *func, char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_internal_errorv_(file, line, func, fmt, args); va_end(args); } /* Log an error and exit (va_list version). */ void mcell_internal_errorv_(char const *file, unsigned int line, char const *func, char const *fmt, va_list args) { fprintf(mcell_get_error_file(), "****************\n"); fprintf(mcell_get_error_file(), "INTERNAL ERROR at %s:%u [%s]: ", file, line, func); mcell_errorv_raw(fmt, args); fprintf(mcell_get_error_file(), "\n"); fprintf(mcell_get_error_file(), "MCell has detected an internal program error.\n"); fprintf(mcell_get_error_file(), "Please report this error to the MCell developers at <%s>.\n", PACKAGE_BUGREPORT); fprintf(mcell_get_error_file(), "****************\n"); mcell_die(); } /* Get a copy of a string giving an error message. */ char *mcell_strerror(int err) { char buffer[2048]; #ifdef STRERROR_R_CHAR_P char *pbuf = strerror_r(err, buffer, sizeof(buffer)); if (pbuf != NULL) return CHECKED_STRDUP(pbuf, "error description"); else return CHECKED_SPRINTF("UNIX error code %d.", err); #else if (strerror_r(err, buffer, sizeof(buffer)) == 0) return CHECKED_STRDUP(buffer, "error description"); else return CHECKED_SPRINTF("UNIX error code %d.", err); #endif } /* Log an error due to a failed standard library call, and exit. */ void mcell_perror_nodie(int err, char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_perrorv_nodie(err, fmt, args); va_end(args); } /* Log an error due to a failed standard library call, and exit (va_list * version). */ void mcell_perrorv_nodie(int err, char const *fmt, va_list args) { char buffer[2048]; fprintf(mcell_get_error_file(), "Fatal error: "); mcell_errorv_raw(fmt, args); #ifdef STRERROR_R_CHAR_P fprintf(mcell_get_error_file(), ": %s\n", strerror_r(err, buffer, sizeof(buffer))); #else if (strerror_r(err, buffer, sizeof(buffer)) == 0) fprintf(mcell_get_error_file(), ": %s\n", buffer); else fprintf(mcell_get_error_file(), "\n"); #endif } /* Log an error due to a failed standard library call, and exit. */ void mcell_perror(int err, char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_perrorv(err, fmt, args); va_end(args); } /* Log an error due to a failed standard library call, and exit (va_list * version). */ void mcell_perrorv(int err, char const *fmt, va_list args) { mcell_perrorv_nodie(err, fmt, args); mcell_die(); } /* Log an error due to failed memory allocation, but do not exit. */ void mcell_allocfailed_nodie(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_allocfailedv_nodie(fmt, args); va_end(args); } /* Log an error due to failed memory allocation, but do not exit (va_list * version). */ void mcell_allocfailedv_nodie(char const *fmt, va_list args) { fprintf(mcell_get_error_file(), "Fatal error: "); mcell_errorv_raw(fmt, args); fprintf(mcell_get_error_file(), "\n"); fprintf(mcell_get_error_file(), "Fatal error: Out of memory\n\n"); mem_dump_stats(mcell_get_error_file()); } /* Log an error due to failed memory allocation, and exit. */ void mcell_allocfailed(char const *fmt, ...) { va_list args; va_start(args, fmt); mcell_allocfailedv_nodie(fmt, args); va_end(args); mcell_die(); } /* Log an error due to failed memory allocation, and exit (va_list version). */ void mcell_allocfailedv(char const *fmt, va_list args) { mcell_allocfailedv_nodie(fmt, args); mcell_die(); } /* Terminate program execution due to an error. */ void mcell_die(void) { exit(EXIT_FAILURE); }
jczech/appveyor_test
mcell/src/logging.c
C
lgpl-2.1
8,209
/* mgrp_test.c * * Test messenger group broadcast/receive functionality and concurrency. * Each thread broadcasts a counter from 0 to ITERS, to all other threads * (but not itself). * Every receiving thread should sum received integers into a per-thread * rx_sum variable. * Every thread should accumulate the same rx_sum, which is: * (ITERS -1) * ITERS * (THREAD_CNT -1) * 0.5 * (see memorywell/test/well_test.c for more details). * * (c) 2018 Sirio Balmelli and Anthony Soenen */ #include <ndebug.h> #include <posigs.h> /* use atomic PSG kill flag as a global error flag */ #include <pcg_rand.h> #include <messenger.h> #include <pthread.h> #include <stdbool.h> #include <unistd.h> #include <fcntl.h> #define THREAD_CNT 2 #define ITERS 2 /* How many messages each thread should send. * TODO: increase once registration/rcu issue is resolved. */ /* thread() */ void *thread(void* arg) { struct mgrp *group = arg; int pvc[2] = { 0, 0 }; size_t rx_sum = 0, rx_i = 0; size_t message; NB_die_if( pipe(pvc) || fcntl(pvc[0], F_SETFL, fcntl(pvc[0], F_GETFL) | O_NONBLOCK) , ""); NB_die_if( mgrp_subscribe(group, pvc[1]) , ""); /* Don't start broadcasting until everyone is subscribed. * We could use pthread_barrier_t but that's not implemented on macOS, * and anyways messenger()'s mgrp_count uses acquire/release semantics. */ while (mgrp_count(group) != THREAD_CNT && !psg_kill_check()) sched_yield(); /* generate ITERS broadcasts; receive others' broadcasts */ for (size_t i = 0; i < ITERS && !psg_kill_check(); i++) { NB_die_if( mgrp_broadcast(group, pvc[1], &i, sizeof(i)) , ""); while ((mg_recv(pvc[0], &message) > 0) && !psg_kill_check()) { rx_sum += message; rx_i++; sched_yield(); /* prevent deadlock: give other threads a chance to write */ } errno = 0; /* _should_ be EINVAL: don't pollute later prints */ } /* wait for all other senders */ while (rx_i < ITERS * (THREAD_CNT -1) && !psg_kill_check()) { if ((mg_recv(pvc[0], &message) > 0)) { rx_sum += message; rx_i++; } else { sched_yield(); } } die: NB_err_if( mgrp_unsubscribe(group, pvc[1]) , "fd %d unsubscribe fail", pvc[1]); if (err_cnt) psg_kill(); if (pvc[0]) { close(pvc[1]); close(pvc[0]); } return (void *)rx_sum; } /* main() */ int main() { int err_cnt = 0; struct mgrp *group = NULL; pthread_t threads[THREAD_CNT]; NB_die_if(!( group = mgrp_new() ), ""); /* run all threads */ for (unsigned int i=0; i < THREAD_CNT; i++) { NB_die_if(pthread_create(&threads[i], NULL, thread, group), ""); } /* test results */ size_t expected = (ITERS -1) * ITERS * (THREAD_CNT -1) * 0.5; for (unsigned int i=0; i < THREAD_CNT; i++) { size_t rx_sum; NB_die_if( pthread_join(threads[i], (void **)&rx_sum) , ""); NB_err_if(rx_sum != expected, "thread %zu != expected %zu", rx_sum, expected); } die: mgrp_free(group); err_cnt += psg_kill_check(); /* return any error from any thread */ return err_cnt; }
siriobalmelli/nonlibc
test/mgrp_test.c
C
lgpl-2.1
3,010
/* Copyright 2010, 2011 Michael Steinert * This file is part of Log4g. * * Log4g 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. * * Log4g 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 Log4g. If not, see <http://www.gnu.org/licenses/>. */ /** * SECTION: logging-event * @short_description: The internal representation of logging events * * Once an affirmative decision is made to log an event a logging event * instance is created. This instance is passed to appenders and filters to * perform actual logging. * * <note><para> * This class is only useful to those wishing to extend Log4g. * </para></note> */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <errno.h> #include "log4g/helpers/thread.h" #include "log4g/logging-event.h" #include "log4g/mdc.h" #include "log4g/ndc.h" G_DEFINE_TYPE(Log4gLoggingEvent, log4g_logging_event, G_TYPE_OBJECT) #define ASSIGN_PRIVATE(instance) \ (G_TYPE_INSTANCE_GET_PRIVATE(instance, LOG4G_TYPE_LOGGING_EVENT, \ struct Private)) #define GET_PRIVATE(instance) \ ((struct Private *)((Log4gLoggingEvent *)instance)->priv) struct Private { gchar *logger; Log4gLevel *level; gchar *message; GTimeVal timestamp; gboolean thread_lookup_required; gchar *thread; gboolean ndc_lookup_required; gchar *ndc; gboolean mdc_lookup_required; GHashTable *mdc; const gchar *function; const gchar *file; const gchar *line; gchar *fullinfo; GArray *keys; }; static void log4g_logging_event_init(Log4gLoggingEvent *self) { self->priv = ASSIGN_PRIVATE(self); struct Private *priv = GET_PRIVATE(self); priv->thread_lookup_required = TRUE; priv->ndc_lookup_required = TRUE; priv->mdc_lookup_required = TRUE; } static void dispose(GObject *base) { struct Private *priv = GET_PRIVATE(base); if (priv->level) { g_object_unref(priv->level); priv->level = NULL; } G_OBJECT_CLASS(log4g_logging_event_parent_class)->dispose(base); } static void finalize(GObject *base) { struct Private *priv = GET_PRIVATE(base); g_free(priv->logger); g_free(priv->message); g_free(priv->ndc); g_free(priv->fullinfo); g_free(priv->thread); if (priv->mdc) { g_hash_table_destroy(priv->mdc); } if (priv->keys) { g_array_free(priv->keys, TRUE); } G_OBJECT_CLASS(log4g_logging_event_parent_class)->finalize(base); } static void log4g_logging_event_class_init(Log4gLoggingEventClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); object_class->dispose = dispose; object_class->finalize = finalize; GTimeVal start; g_get_current_time(&start); klass->start = (start.tv_sec * 1000) + (start.tv_usec * 0.001); g_type_class_add_private(klass, sizeof(struct Private)); } /** * log4g_logging_event_new: * @logger: The name of the logger that is creating this event. * @level: The log level of this event. * @function: The function where this event was logged. * @file: The file where this event was logged. * @line: The line in @file where this event was logged. * @message: A printf formatted log message. * @ap: Format parameters. * * Create a new logging event. * * Returns: A new logging event object. * Since: 0.1 */ Log4gLoggingEvent * log4g_logging_event_new(const gchar *logger, Log4gLevel *level, const gchar *function, const gchar *file, const gchar *line, const gchar *message, va_list ap) { Log4gLoggingEvent *self = g_object_new(LOG4G_TYPE_LOGGING_EVENT, NULL); if (!self) { return NULL; } struct Private *priv = GET_PRIVATE(self); if (logger) { priv->logger = g_strdup(logger); if (!priv->logger) { goto error; } } if (level) { g_object_ref(level); priv->level = level; } if (message) { priv->message = g_strdup_vprintf(message, ap); if (!priv->message) { goto error; } } priv->function = function; priv->file = file; priv->line = line; g_get_current_time(&priv->timestamp); return self; error: g_object_unref(self); return NULL; } /** * log4g_logging_event_get_level: * @self: A logging event object. * * Calls the @get_level function from the #Log4gLoggingEventClass of @self. * * Returns: (transfer none): The log level of @self. * Since: 0.1 */ Log4gLevel * log4g_logging_event_get_level(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); return priv->level; } /** * log4g_logging_event_get_logger_name: * @self: A logging event object. * * Retrieve the name of the logger that created a logging event. * * Returns: The name of the logger that created @self. * Since: 0.1 */ const gchar * log4g_logging_event_get_logger_name(Log4gLoggingEvent *self) { return GET_PRIVATE(self)->logger; } /** * log4g_logging_event_get_rendered_message: * @self: A logging event object. * * Retrieve the rendered logging message. * * See: log4g_logging_event_get_message() * * Returns: The rendered logging message. * Since: 0.1 */ const gchar * log4g_logging_event_get_rendered_message(Log4gLoggingEvent *self) { return GET_PRIVATE(self)->message; } /** * log4g_logging_event_get_message: * @self: A logging event object. * * Retrieve the log message. * * This function is equivalent to log4g_logging_event_get_rendered_message(). * * Returns: The log message. * Since: 0.1 */ const gchar * log4g_logging_event_get_message(Log4gLoggingEvent *self) { return GET_PRIVATE(self)->message; } /** * log4g_logging_event_get_mdc: * @self: A logging event object. * @key: A mapped data context key. * * Retrieve a mapped data context value for a logging event. * * See: #Log4gMDC * * Returns: The MDC value for @key. * Since: 0.1 */ const gchar * log4g_logging_event_get_mdc(Log4gLoggingEvent *self, const gchar *key) { struct Private *priv = GET_PRIVATE(self); if (priv->mdc) { const gchar *value = g_hash_table_lookup(priv->mdc, key); if (value) { return value; } } if (priv->mdc_lookup_required) { return log4g_mdc_get(key); } return NULL; } /** * log4g_logging_event_get_time_stamp: * @self: A logging event object. * * Retrieve the timestamp of a logging event. * * Returns: (transfer none): The timestamp of @self. * Since: 0.1 */ const GTimeVal * log4g_logging_event_get_time_stamp(Log4gLoggingEvent *self) { return &GET_PRIVATE(self)->timestamp; } /** * log4g_logging_event_get_thread_name: * @self: A logging event object. * * Retrieve the name of the thread where a logging event was logged. * * Returns: The name of the thread where @self was logged. * Since: 0.1 */ const gchar * log4g_logging_event_get_thread_name(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (priv->thread) { return priv->thread; } if (priv->thread_lookup_required) { return log4g_thread_get_name(); } return NULL; } /** * log4g_logging_event_get_ndc: * @self: A logging event object. * * Retrieve the nested data context for a logging event. * * See: #Log4gNDC * * Returns: The rendered NDC string for @self. * Since: 0.1 */ const gchar * log4g_logging_event_get_ndc(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (priv->ndc) { return priv->ndc; } if (priv->ndc_lookup_required) { return log4g_ndc_get(); } return NULL; } /** * get_keys_: * @key: The hash table key. * @value: The hash table value (unused). * @user_data: An array to append @key to. * * Callback for g_hash_table_foreach(). */ static void get_keys_(gpointer key, G_GNUC_UNUSED gpointer value, gpointer user_data) { g_array_append_val((GArray *)user_data, key); } /** * get_property_key_set_: * @self: A logging event object. * @mdc: The hash table to get keys from. * * Construct a key set from an MDC hash table. */ static void get_property_key_set_(Log4gLoggingEvent *self, GHashTable *mdc) { guint size = g_hash_table_size((GHashTable *)mdc); struct Private *priv = GET_PRIVATE(self); if (!size) { return; } if (priv->keys) { g_array_free(priv->keys, TRUE); } priv->keys = g_array_sized_new(FALSE, FALSE, sizeof(gchar *), size); if (!priv->keys) { return; } g_hash_table_foreach(mdc, get_keys_, priv->keys); } /** * log4g_logging_event_get_property_key_set: * @self: A logging event object. * * Get the MDC keys (if any) for this event. * * See: #Log4gMDC * * Returns: An array of keys, or %NULL if no keys exist. * Since: 0.1 */ const GArray * log4g_logging_event_get_property_key_set(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (priv->mdc) { if (!priv->keys) { get_property_key_set_(self, priv->mdc); } } else { const GHashTable *mdc = log4g_mdc_get_context(); if (mdc) { get_property_key_set_(self, (GHashTable *)mdc); } } return priv->keys; } /** * mdc_copy_: * @key: The hash table key. * @value: The hash table value (unused). * @user_data: A hash table to insert @key & @value into. * * Callback for g_hash_table_foreach(). */ static void mdc_copy_(gpointer key, gpointer value, gpointer user_data) { g_hash_table_insert((GHashTable *)user_data, key, value); } /** * log4g_logging_event_get_thread_copy: * @self: A logging event object. * * Copy the current thread name into a logging object. * * Asynchronous appenders should call this function. * * See: #Log4gThreadClass */ void log4g_logging_event_get_thread_copy(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (!priv->thread_lookup_required) { return; } priv->thread_lookup_required = FALSE; priv->thread = g_strdup(log4g_thread_get_name()); } /** * log4g_logging_event_get_mdc_copy: * @self: A logging event object. * * Copy the current mapped data context into a logging event. * * Asynchronous appenders should call this function. * * See #Log4gMDC * * Since: 0.1 */ void log4g_logging_event_get_mdc_copy(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (!priv->mdc_lookup_required) { return; } const GHashTable *mdc; priv->mdc_lookup_required = FALSE; mdc = log4g_mdc_get_context(); if (!mdc) { return; } priv->mdc = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); if (!priv->mdc) { return; } g_hash_table_foreach((GHashTable *)mdc, mdc_copy_, priv->mdc); } /** * log4g_logging_event_get_ndc_copy: * @self: A logging event object. * * Copy the current nested data context into a logging event. * * Asynchronous appenders should call this function. * * See #Log4gNDC * * Since: 0.1 */ void log4g_logging_event_get_ndc_copy(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (!priv->ndc_lookup_required) { return; } priv->ndc_lookup_required = FALSE; priv->ndc = g_strdup(log4g_ndc_get()); } /** * log4g_logging_event_get_function_name: * @self: A logging event object. * * Retrieve the function where a logging event was logged. * * Returns: The function where @self was logged. * Since: 0.1 */ const gchar * log4g_logging_event_get_function_name(Log4gLoggingEvent *self) { const gchar *function = GET_PRIVATE(self)->function; return (function ? function : "?"); } /** * log4g_logging_event_get_file_name: * @self: A logging event object. * * Retrieve the file where a logging event was logged. * * Returns: The file where @self was logged. * Since: 0.1 */ const gchar * log4g_logging_event_get_file_name(Log4gLoggingEvent *self) { const gchar *file = GET_PRIVATE(self)->file; return (file ? file : "?"); } /** * log4g_logging_event_get_line_number: * @self: A logging event object. * * Retrieve the line number where a logging event was logged. * * Returns: The line number where @self was logged. * Since: 0.1 */ const gchar * log4g_logging_event_get_line_number(Log4gLoggingEvent *self) { const gchar *line = GET_PRIVATE(self)->line; return (line ? line : "?"); } /** * log4g_logging_event_get_full_info: * @self: A logging event object. * * Retrieve the full location information where a logging event was logged. * * The full location information is in the format: * * |[ * function(file:line) * ]| * * Returns: The full log location information for @self. * Since: 0.1 */ const gchar * log4g_logging_event_get_full_info(Log4gLoggingEvent *self) { struct Private *priv = GET_PRIVATE(self); if (!priv->fullinfo) { priv->fullinfo = g_strdup_printf("%s(%s:%s)", (priv->function ? priv->function : "?"), (priv->file ? priv->file : "?"), (priv->line ? priv->line : "?")); } return priv->fullinfo; } /** * log4g_logging_event_get_start_time: * * Retrieve the time when the log system was initialized. * * Returns: The number of seconds elapsed since the Unix epoch when the log * system was initialized * Since: 0.1 */ glong log4g_logging_event_get_start_time(void) { Log4gLoggingEventClass *klass = g_type_class_peek(LOG4G_TYPE_LOGGING_EVENT); return klass->start; }
msteinert/log4g
log4g/logging-event.c
C
lgpl-2.1
13,236
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * qimsys * * Copyright (C) 2010-2016 by Tasuku Suzuki <[email protected]> * * Copyright (C) 2016 by Takahiro Hashimoto <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Lesser Public License as * * published by the Free Software Foundation; either version 2 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "../qimsysimcontext.h" #include <gtk/gtk.h> #include <gdk/gdkx.h> #include <qimsysdebug.h> #include <qimsysapplicationmanager.h> #include <qimsysinputmethodmanager.h> #include <qimsyskeymanager.h> #include <qimsyskeyboardmanager.h> #include <qimsyspreeditmanager.h> #include <string.h> #include "../gtk2qt.h" #define QIMSYS_IM_CONTEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), QIMSYS_IM_CONTEXT_TYPE, QimsysIMContextPrivate)) struct _QimsysIMContextPrivate { GtkIMContext *slave; QimsysApplicationManager *application_manager; QimsysInputMethodManager *inputmethod_manager; QimsysKeyManager *key_manager; QimsysKeyboardManager *keyboard_manager; QimsysPreeditManager *preedit_manager; QimsysPreeditItem *item; GdkWindow *client_window; }; static GType _qimsys_im_context_type = 0; static GtkIMContextClass *_parent_im_context_class = NULL; static GtkIMContext *_focus_im_context = NULL; static void qimsys_im_context_class_init(QimsysIMContextClass *klass); static void qimsys_im_context_init(QimsysIMContext *self); static void qimsys_im_context_dispose(GObject *object); static void qimsys_im_context_reset(GtkIMContext *context); static gboolean qimsys_im_context_filter_keypress(GtkIMContext *context, GdkEventKey *key); static void qimsys_im_context_focus_in(GtkIMContext *context); static void qimsys_im_context_focus_out(GtkIMContext *context); static void qimsys_im_context_get_preedit_string(GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos); static void qimsys_im_context_set_client_window(GtkIMContext *context, GdkWindow *client_window); static void qimsys_im_context_set_cursor_location(GtkIMContext *context, GdkRectangle *area); static void qimsys_im_context_set_use_preedit(GtkIMContext *context, gboolean use_preedit); static void qimsys_im_context_set_surrounding(GtkIMContext *context, const gchar *text, gint len, gint cursor_index); static void qimsys_im_context_get_surrounding(GtkIMContext *context, gchar **text, gint *cursor_index); static void qimsys_im_context_delete_surrounding(GtkIMContext *context, gint offset, gint n_chars); static void qimsys_im_context_preedit_item_changed(gpointer data, QimsysPreeditItem *item, QimsysPreeditManager *preedit_manager); static void qimsys_im_context_preedit_committed(gpointer data, char *text, gulong target, QimsysPreeditManager *preedit_manager); static void qimsys_im_context_slave_commit(GtkIMContext *slave, char *text, QimsysIMContext *master); static void qimsys_im_context_slave_preedit_start(GtkIMContext *slave, QimsysIMContext *master); static void qimsys_im_context_slave_preedit_end(GtkIMContext *slave, QimsysIMContext *master); static void qimsys_im_context_slave_preedit_changed(GtkIMContext *slave, QimsysIMContext *master); static void qimsys_im_context_slave_retrieve_surrounding(GtkIMContext *slave, QimsysIMContext *master); static void qimsys_im_context_slave_delete_surrounding(GtkIMContext *slave, gint offset, gint n_chars, QimsysIMContext *master); void qimsys_im_context_register_type(GTypeModule *module) { static const GTypeInfo qimsys_im_context_info = { sizeof(QimsysIMContextClass) , (GBaseInitFunc)NULL , (GBaseFinalizeFunc)NULL , (GClassInitFunc)qimsys_im_context_class_init , (GClassFinalizeFunc)NULL , (gconstpointer)NULL , sizeof(QimsysIMContext) , 0 , (GInstanceInitFunc)qimsys_im_context_init , (GTypeValueTable *)NULL }; qimsys_debug_in(); if (!qimsys_im_context_get_type()) { GType type = g_type_module_register_type(module , GTK_TYPE_IM_CONTEXT , "QimsysIMContext" , &qimsys_im_context_info , (GTypeFlags)0 ); _qimsys_im_context_type = type; } qimsys_debug_out(); } GType qimsys_im_context_get_type() { return _qimsys_im_context_type; } QimsysIMContext *qimsys_im_context_new() { QimsysIMContext *ret; qimsys_debug_in(); ret = QIMSYS_IM_CONTEXT(g_object_new(QIMSYS_IM_CONTEXT_TYPE, NULL)); qimsys_debug_out(); return ret; } static void qimsys_im_context_class_init(QimsysIMContextClass *klass) { GtkIMContextClass *im_context_class; GObjectClass *gobject_class; qimsys_debug_in(); _parent_im_context_class = (GtkIMContextClass *)g_type_class_peek_parent(klass); im_context_class = GTK_IM_CONTEXT_CLASS(klass); im_context_class->reset = qimsys_im_context_reset; im_context_class->focus_in = qimsys_im_context_focus_in; im_context_class->focus_out = qimsys_im_context_focus_out; im_context_class->filter_keypress = qimsys_im_context_filter_keypress; im_context_class->get_preedit_string = qimsys_im_context_get_preedit_string; im_context_class->set_client_window = qimsys_im_context_set_client_window; im_context_class->set_cursor_location = qimsys_im_context_set_cursor_location; im_context_class->set_use_preedit = qimsys_im_context_set_use_preedit; im_context_class->set_surrounding = qimsys_im_context_set_surrounding; im_context_class->get_surrounding = qimsys_im_context_get_surrounding; im_context_class->delete_surrounding = qimsys_im_context_delete_surrounding; gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = qimsys_im_context_dispose; g_type_class_add_private(klass, sizeof(QimsysIMContextPrivate)); qimsys_debug_out(); } static void qimsys_im_context_init(QimsysIMContext *self) { qimsys_debug_in(); self->d = QIMSYS_IM_CONTEXT_GET_PRIVATE(self); self->d->slave = gtk_im_context_simple_new(); g_signal_connect(self->d->slave, "commit", G_CALLBACK(qimsys_im_context_slave_commit), self); g_signal_connect(self->d->slave, "preedit-start", G_CALLBACK(qimsys_im_context_slave_preedit_start), self); g_signal_connect(self->d->slave, "preedit-end", G_CALLBACK(qimsys_im_context_slave_preedit_end), self); g_signal_connect(self->d->slave, "preedit-changed", G_CALLBACK(qimsys_im_context_slave_preedit_changed), self); g_signal_connect(self->d->slave, "retrieve-surrounding", G_CALLBACK(qimsys_im_context_slave_retrieve_surrounding), self); g_signal_connect(self->d->slave, "delete-surrounding", G_CALLBACK(qimsys_im_context_slave_delete_surrounding), self); self->d->application_manager = NULL; self->d->inputmethod_manager = NULL; self->d->key_manager = NULL; self->d->keyboard_manager = NULL; self->d->preedit_manager = NULL; self->d->item = NULL; self->d->client_window = NULL; qimsys_debug_out(); } static void qimsys_im_context_dispose(GObject *object) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(object); qimsys_im_context_set_client_window(GTK_IM_CONTEXT(self), NULL); if (self->d->item) { g_object_unref(self->d->item); } G_OBJECT_CLASS(_parent_im_context_class)->dispose(object); qimsys_debug_out(); } static void qimsys_im_context_reset(GtkIMContext *context) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); if (self->d->application_manager) qimsys_application_manager_exec(self->d->application_manager, 0 /* Reset */); gtk_im_context_reset(self->d->slave); if (self->d->keyboard_manager) { qimsys_keyboard_manager_set_visible(self->d->keyboard_manager, TRUE); } qimsys_debug_out(); } static gboolean qimsys_im_context_filter_keypress(GtkIMContext *context, GdkEventKey *event) { gboolean ret = FALSE; QimsysIMContext *self; int modifiers = 0; qimsys_debug_in(); qimsys_debug("\ttype = %d\n", event->type); qimsys_debug("\tsend_event = %d\n", event->send_event); qimsys_debug("\tstate = %X\n", event->state); qimsys_debug("\tkeyval = %X(%X)\n", event->keyval, qimsys_gtk2qt_key_convert(event->keyval)); qimsys_debug("\tis_modifier = %d\n", event->is_modifier); if (event->state & 0x1) modifiers |= 0x02000000; if (event->state & 0x4) modifiers |= 0x04000000; if (event->state & 0x8) modifiers |= 0x08000000; if (event->state & 4000040) modifiers |= 0x10000000; self = QIMSYS_IM_CONTEXT(context); if (self->d->key_manager) { switch (event->type) { case GDK_KEY_PRESS: qimsys_key_manager_key_press(self->d->key_manager, event->string, qimsys_gtk2qt_key_convert(event->keyval), modifiers, FALSE, &ret); break; case GDK_KEY_RELEASE: qimsys_key_manager_key_release(self->d->key_manager, event->string, qimsys_gtk2qt_key_convert(event->keyval), modifiers, FALSE, &ret); break; default: break; } } if (!ret) { ret = gtk_im_context_filter_keypress(self->d->slave, event); } qimsys_debug_out(); return ret; } static void qimsys_im_context_focus_in(GtkIMContext *context) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); if (_focus_im_context != NULL && _focus_im_context != GTK_IM_CONTEXT(self)) { gtk_im_context_focus_out(_focus_im_context); } _focus_im_context = GTK_IM_CONTEXT(self); g_object_ref(_focus_im_context); if (!self->d->application_manager) { self->d->application_manager = qimsys_application_manager_new(); } if (!self->d->inputmethod_manager) { self->d->inputmethod_manager = qimsys_inputmethod_manager_new(); } if (!self->d->key_manager) { self->d->key_manager = qimsys_key_manager_new(); } if (!self->d->keyboard_manager) { self->d->keyboard_manager = qimsys_keyboard_manager_new(); if (self->d->keyboard_manager) { qimsys_keyboard_manager_set_visible(self->d->keyboard_manager, FALSE); } } if (!self->d->preedit_manager) { self->d->preedit_manager = qimsys_preedit_manager_new(); if (self->d->preedit_manager) { g_signal_connect_swapped(self->d->preedit_manager, "item-changed", G_CALLBACK(qimsys_im_context_preedit_item_changed), self); g_signal_connect_swapped(self->d->preedit_manager, "committed", G_CALLBACK(qimsys_im_context_preedit_committed), self); } } if (self->d->application_manager) { if (self->d->client_window) { qimsys_application_manager_set_window(self->d->application_manager, gdk_x11_drawable_get_xid(self->d->client_window)); qimsys_application_manager_set_widget(self->d->application_manager, gdk_x11_drawable_get_xid(self->d->client_window)); } qimsys_application_manager_set_focus(self->d->application_manager, TRUE); } gtk_im_context_focus_in(self->d->slave); qimsys_debug_out(); } static void qimsys_im_context_focus_out(GtkIMContext *context) { QimsysIMContext *self; gulonglong client_window = 0; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); if (_focus_im_context == GTK_IM_CONTEXT(self)) { g_object_unref(_focus_im_context); _focus_im_context = NULL; } if (self->d->application_manager) { qimsys_application_manager_set_focus(self->d->application_manager, FALSE); qimsys_application_manager_get_widget(self->d->application_manager, &client_window); if (self->d->client_window && gdk_x11_drawable_get_xid(self->d->client_window) == client_window) { qimsys_application_manager_set_window(self->d->application_manager, 0); qimsys_application_manager_set_widget(self->d->application_manager, 0); } g_object_unref(self->d->application_manager); self->d->application_manager = NULL; } if (self->d->inputmethod_manager) { g_object_unref(self->d->inputmethod_manager); self->d->inputmethod_manager = NULL; } if (self->d->key_manager) { g_object_unref(self->d->key_manager); self->d->key_manager = NULL; } if (self->d->keyboard_manager) { qimsys_keyboard_manager_set_visible(self->d->keyboard_manager, FALSE); g_object_unref(self->d->keyboard_manager); self->d->keyboard_manager = NULL; } if (self->d->preedit_manager) { g_object_unref(self->d->preedit_manager); self->d->preedit_manager = 0; } gtk_im_context_focus_out(self->d->slave); qimsys_debug_out(); } static void qimsys_im_context_get_preedit_string(GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos) { gboolean ret; guint i = 0; QimsysIMContext *self; QimsysPreeditItem *item; char *preedit_string; char **strv_ptr; char *buf; int cursor; int selection = 0; int start_index = 0; int end_index = 0; PangoAttrList *attr_list; PangoAttribute *attr; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); preedit_string = g_strdup(""); cursor = 0; attr_list = pango_attr_list_new(); if (self->d->application_manager) { qimsys_application_manager_get_composing(self->d->application_manager, &ret); if (ret) { if (self->d->item) { item = self->d->item; if (item->cursor >= 0) { cursor = g_utf8_strlen(preedit_string, -1) + item->cursor; if (item->selection != 0) { selection = item->selection; } } qimsys_debug("%s(%d)\n", __FUNCTION__, __LINE__); attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); qimsys_debug("%s(%d)\n", __FUNCTION__, __LINE__); attr->start_index = strlen(preedit_string); attr->end_index = attr->start_index; qimsys_debug("%s(%d)\n", __FUNCTION__, __LINE__); for (strv_ptr = item->to; *strv_ptr != NULL; *strv_ptr++) { qimsys_debug("%s(%d) %x\n", __FUNCTION__, __LINE__, (void*)*strv_ptr); qimsys_debug("%s(%d) %s\n", __FUNCTION__, __LINE__, *strv_ptr); attr->end_index += strlen(*strv_ptr); } qimsys_debug("%s(%d)\n", __FUNCTION__, __LINE__); pango_attr_list_insert(attr_list, attr); qimsys_debug("%s(%d)\n", __FUNCTION__, __LINE__); for (strv_ptr = item->to; *strv_ptr != NULL; *strv_ptr++) { buf = g_strconcat(preedit_string, *strv_ptr, NULL); g_free(preedit_string); preedit_string = buf; } qimsys_debug("\t%d: %s %d %d %d\n", i, preedit_string, item->cursor, item->selection, item->modified); if (selection != 0) { buf = g_strdup(preedit_string); g_utf8_strncpy(buf, preedit_string, cursor); start_index = strlen(buf); qimsys_debug("start_index: %d(%d) - %s\n", start_index, cursor, buf); g_utf8_strncpy(buf, preedit_string, cursor + selection); end_index = strlen(buf); g_free(buf); qimsys_debug("end_index: %d(%d + %d) - %s\n", end_index, cursor, selection, buf); attr = pango_attr_foreground_new(0xffff, 0xffff, 0xffff); attr->start_index = start_index; attr->end_index = end_index; pango_attr_list_insert(attr_list, attr); attr = pango_attr_background_new(0, 0, 0x8fff); attr->start_index = start_index; attr->end_index = end_index; pango_attr_list_insert(attr_list, attr); } } else { // qimsys_preedit_manager_get_item(self->d->preedit_manager, &item); } if (str) { *str = preedit_string; } else { g_free(preedit_string); } if (cursor_pos) { *cursor_pos = cursor; } if (attrs) { *attrs = attr_list; } else { pango_attr_list_unref(attr_list); } } else { gtk_im_context_get_preedit_string(self->d->slave, str, attrs, cursor_pos); } } else { gtk_im_context_get_preedit_string(self->d->slave, str, attrs, cursor_pos); } qimsys_debug_out(); } static void qimsys_im_context_set_client_window(GtkIMContext *context, GdkWindow *client_window) { QimsysIMContext *self; self = QIMSYS_IM_CONTEXT(context); if (self->d->client_window == client_window) return; qimsys_debug_in(); if (self->d->client_window != NULL) g_object_unref(self->d->client_window); self->d->client_window = client_window; if (client_window != NULL) { g_object_ref(client_window); } gtk_im_context_set_client_window(self->d->slave, client_window); if (self->d->application_manager) { if (client_window) { qimsys_application_manager_set_window(self->d->application_manager, gdk_x11_drawable_get_xid(client_window)); qimsys_application_manager_set_widget(self->d->application_manager, gdk_x11_drawable_get_xid(client_window)); } else { qimsys_application_manager_set_window(self->d->application_manager, 0); qimsys_application_manager_set_widget(self->d->application_manager, 0); } } qimsys_debug_out(); } static void qimsys_im_context_set_cursor_location(GtkIMContext *context, GdkRectangle *area) { QimsysIMContext *self; int x = 0; int y = 0; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); if (self->d->client_window) { gdk_window_get_origin (self->d->client_window, &x, &y); } if (self->d->preedit_manager) { qimsys_preedit_manager_set_rect(self->d->preedit_manager, x + area->x, y + area->y, area->width, area->height); } gtk_im_context_set_cursor_location(self->d->slave, area); qimsys_debug_out(); } static void qimsys_im_context_set_use_preedit(GtkIMContext *context, gboolean use_preedit) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); gtk_im_context_set_use_preedit(self->d->slave, use_preedit); qimsys_debug_out(); } static void qimsys_im_context_set_surrounding(GtkIMContext *context, const gchar *text, gint len, gint cursor_index) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); qimsys_debug("text: %s, len: %d, cursor_index, %d\n", text, len, cursor_index); qimsys_preedit_manager_set_surrounding_text(self->d->preedit_manager, text); qimsys_preedit_manager_set_cursor_position(self->d->preedit_manager, cursor_index); // gtk_im_context_set_surrounding(self->d->slave, text, len, cursor_index); qimsys_debug_out(); } static void qimsys_im_context_get_surrounding(GtkIMContext *context, gchar **text, gint *cursor_index) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); qimsys_preedit_manager_get_cursor_position(self->d->preedit_manager, cursor_index); qimsys_preedit_manager_get_surrounding_text(self->d->preedit_manager, text); // gtk_im_context_get_surrounding(self->d->slave, text, cursor_index); qimsys_debug_out(); } static void qimsys_im_context_delete_surrounding(GtkIMContext *context, gint offset, gint n_chars) { QimsysIMContext *self; qimsys_debug_in(); self = QIMSYS_IM_CONTEXT(context); qimsys_debug("offset: %d, n_chars: %d\n", offset, n_chars); // qimsys_preedit_manager_set_surrounding_text(self->d->preedit, text); gtk_im_context_delete_surrounding(self->d->slave, offset, n_chars); qimsys_debug_out(); } static void qimsys_im_context_preedit_item_changed(gpointer data, QimsysPreeditItem *item, QimsysPreeditManager *preedit_manager) { QimsysIMContext *context = QIMSYS_IM_CONTEXT(data); qimsys_debug_in(); if (_focus_im_context == GTK_IM_CONTEXT(context)) { if (context->d->item) { // has preedit g_object_unref(context->d->item); if (g_strv_length(item->to) > 0) { context->d->item = item; g_object_ref(context->d->item); g_signal_emit_by_name(context, "preedit-changed"); } else { context->d->item = NULL; g_signal_emit_by_name(context, "preedit-changed"); g_signal_emit_by_name(context, "preedit-end"); } } else { if (g_strv_length(item->to) > 0) { context->d->item = item; g_object_ref(context->d->item); g_signal_emit_by_name(context, "preedit-start"); g_signal_emit_by_name(context, "preedit-changed"); } else { // } } } qimsys_debug_out(); } static void qimsys_im_context_preedit_committed(gpointer data, char *text, gulong target, QimsysPreeditManager *preedit_manager) { QimsysIMContext *context = QIMSYS_IM_CONTEXT(data); qimsys_debug_in(); if (context->d->client_window && target == gdk_x11_drawable_get_xid(context->d->client_window)) { // \todo g_signal_emit_by_name(context, "commit", text); } qimsys_debug_out(); } static void qimsys_im_context_slave_commit(GtkIMContext *slave, char *text, QimsysIMContext *master) { g_signal_emit_by_name(master, "commit", text); } static void qimsys_im_context_slave_preedit_start(GtkIMContext *slave, QimsysIMContext *master) { g_signal_emit_by_name(master, "preedit-start"); } static void qimsys_im_context_slave_preedit_end(GtkIMContext *slave, QimsysIMContext *master) { g_signal_emit_by_name(master, "preedit-end"); } static void qimsys_im_context_slave_preedit_changed(GtkIMContext *slave, QimsysIMContext *master) { g_signal_emit_by_name(master, "preedit-changed"); } static void qimsys_im_context_slave_retrieve_surrounding(GtkIMContext *slave, QimsysIMContext *master) { g_signal_emit_by_name(master, "retrieve-surrounding"); } static void qimsys_im_context_slave_delete_surrounding(GtkIMContext *slave, gint offset, gint n_chars, QimsysIMContext *master) { g_signal_emit_by_name(master, "delete-surrounding", offset, n_chars); }
qt-users-jp/qimsys
src/plugins/clients/gtkimmodule/gtk2/qimsysimcontext.c
C
lgpl-2.1
24,160
/* optiondialog.hpp * * Copyright (C) 2010 Martin Skowronski * * 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 2 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, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OPTIONDIALOG_HPP #define OPTIONDIALOG_HPP #include <QDialog> namespace Ui { class OptionDialog; } class OptionDialog : public QDialog { Q_OBJECT public: explicit OptionDialog(QWidget *parent = 0); ~OptionDialog(); private: Ui::OptionDialog *ui; }; #endif // OPTIONDIALOG_HPP
skoma/shengci
src/optiondialog.hpp
C++
lgpl-2.1
1,100
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ //$Id: $ package org.hibernate.test.join; /** * @author Chris Jones */ public class Thing { private Employee salesperson; private String comments; /** * @return Returns the salesperson. */ public Employee getSalesperson() { return salesperson; } /** * @param salesperson The salesperson to set. */ public void setSalesperson(Employee salesperson) { this.salesperson = salesperson; } /** * @return Returns the comments. */ public String getComments() { return comments; } /** * @param comments The comments to set. */ public void setComments(String comments) { this.comments = comments; } Long id; String name; /** * @return Returns the ID. */ public Long getId() { return id; } /** * @param id The ID to set. */ public void setId(Long id) { this.id = id; } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name = name; } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/test/java/org/hibernate/test/join/Thing.java
Java
lgpl-2.1
1,249
<?php /** * @package copix * @subpackage smarty_plugins * @author Steevan BARBOYON * @copyright 2001-2007 CopixTeam * @link http://copix.org * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file */ /** * Smarty {tabs}{/tabs} block plugin * * Type: block function * Name: tabs * Purpose: make tabs with ul / li and css styles * @param ul_class: string -> class du tag ul * @param li_class: string -> class du tag li, si non selectionne * @param li_class_selected: string -> class du tag li, si selectionne * @param values: string -> url*caption|url*caption, lien et texte de chaque onglet * @param selected: string -> url de l'onglet selectionne * @return string -> html du ul / li */ function smarty_block_tabs($params, $content, &$me) { if (is_null ($content)){ return; } if (isset ($params['assign'])){ $me->assign ($params['assign'], _tag ('tabs', $params, $content)); } return _tag ('tabs', $params, $content); }
lilobase/ICONTO-EcoleNumerique
utils/copix/smarty_plugins/block.tabs.php
PHP
lgpl-2.1
1,040
/* * Copyright (C) 2008 Trustin Heuiseung Lee * * 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, 5th Floor, Boston, MA 02110-1301 USA */ package net.gleamynode.netty.channel; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import net.gleamynode.netty.logging.Logger; public class DefaultChannelFuture implements ChannelFuture { private static final Logger logger = Logger.getLogger(DefaultChannelFuture.class); private static final int DEAD_LOCK_CHECK_INTERVAL = 5000; private static final Throwable CANCELLED = new Throwable(); private final Channel channel; private final boolean cancellable; private ChannelFutureListener firstListener; private List<ChannelFutureListener> otherListeners; private boolean done; private Throwable cause; private int waiters; public DefaultChannelFuture(Channel channel, boolean cancellable) { this.channel = channel; this.cancellable = cancellable; } public Channel getChannel() { return channel; } public synchronized boolean isDone() { return done; } public synchronized boolean isSuccess() { return cause == null; } public synchronized Throwable getCause() { if (cause != CANCELLED) { return cause; } else { return null; } } public synchronized boolean isCancelled() { return cause == CANCELLED; } public void addListener(ChannelFutureListener listener) { if (listener == null) { throw new NullPointerException("listener"); } boolean notifyNow = false; synchronized (this) { if (done) { notifyNow = true; } else { if (firstListener == null) { firstListener = listener; } else { if (otherListeners == null) { otherListeners = new ArrayList<ChannelFutureListener>(1); } otherListeners.add(listener); } } } if (notifyNow) { notifyListener(listener); } } public void removeListener(ChannelFutureListener listener) { if (listener == null) { throw new NullPointerException("listener"); } synchronized (this) { if (!done) { if (listener == firstListener) { if (otherListeners != null && !otherListeners.isEmpty()) { firstListener = otherListeners.remove(0); } else { firstListener = null; } } else if (otherListeners != null) { otherListeners.remove(listener); } } } } public ChannelFuture await() throws InterruptedException { synchronized (this) { while (!done) { waiters++; try { this.wait(DEAD_LOCK_CHECK_INTERVAL); checkDeadLock(); } finally { waiters--; } } } return this; } public boolean await(long timeout, TimeUnit unit) throws InterruptedException { return await(unit.toMillis(timeout)); } public boolean await(long timeoutMillis) throws InterruptedException { return await0(timeoutMillis, true); } public ChannelFuture awaitUninterruptibly() { synchronized (this) { while (!done) { waiters++; try { this.wait(DEAD_LOCK_CHECK_INTERVAL); } catch (InterruptedException e) { // Ignore. } finally { waiters--; if (!done) { checkDeadLock(); } } } } return this; } public boolean awaitUninterruptibly(long timeout, TimeUnit unit) { return awaitUninterruptibly(unit.toMillis(timeout)); } public boolean awaitUninterruptibly(long timeoutMillis) { try { return await0(timeoutMillis, false); } catch (InterruptedException e) { throw new InternalError(); } } private boolean await0(long timeoutMillis, boolean interruptable) throws InterruptedException { long startTime = timeoutMillis <= 0 ? 0 : System.currentTimeMillis(); long waitTime = timeoutMillis; synchronized (this) { if (done) { return done; } else if (waitTime <= 0) { return done; } waiters++; try { for (;;) { try { this.wait(Math.min(waitTime, DEAD_LOCK_CHECK_INTERVAL)); } catch (InterruptedException e) { if (interruptable) { throw e; } } if (done) { return true; } else { waitTime = timeoutMillis - (System.currentTimeMillis() - startTime); if (waitTime <= 0) { return done; } } } } finally { waiters--; if (!done) { checkDeadLock(); } } } } private void checkDeadLock() { // IllegalStateException e = new IllegalStateException( // "DEAD LOCK: " + ChannelFuture.class.getSimpleName() + // ".await() was invoked from an I/O processor thread. " + // "Please use " + ChannelFutureListener.class.getSimpleName() + // " or configure a proper thread model alternatively."); // // StackTraceElement[] stackTrace = e.getStackTrace(); // // // Simple and quick check. // for (StackTraceElement s: stackTrace) { // if (AbstractPollingIoProcessor.class.getName().equals(s.getClassName())) { // throw e; // } // } // // // And then more precisely. // for (StackTraceElement s: stackTrace) { // try { // Class<?> cls = DefaultChannelFuture.class.getClassLoader().loadClass(s.getClassName()); // if (IoProcessor.class.isAssignableFrom(cls)) { // throw e; // } // } catch (Exception cnfe) { // // Ignore // } // } } public void setSuccess() { synchronized (this) { // Allow only once. if (done) { return; } done = true; if (waiters > 0) { this.notifyAll(); } } notifyListeners(); } public void setFailure(Throwable cause) { synchronized (this) { // Allow only once. if (done) { return; } this.cause = cause; done = true; if (waiters > 0) { this.notifyAll(); } } notifyListeners(); } public boolean cancel() { if (!cancellable) { return false; } synchronized (this) { // Allow only once. if (done) { return false; } cause = CANCELLED; done = true; if (waiters > 0) { this.notifyAll(); } } notifyListeners(); return true; } private void notifyListeners() { // There won't be any visibility problem or concurrent modification // because 'ready' flag will be checked against both addListener and // removeListener calls. if (firstListener != null) { notifyListener(firstListener); firstListener = null; if (otherListeners != null) { for (ChannelFutureListener l: otherListeners) { notifyListener(l); } otherListeners = null; } } } private void notifyListener(ChannelFutureListener l) { try { l.operationComplete(this); } catch (Throwable t) { logger.warn( "An exception was thrown by " + ChannelFutureListener.class.getSimpleName() + ".", t); } } }
jiangbo212/netty-init
src/main/java/net/gleamynode/netty/channel/DefaultChannelFuture.java
Java
lgpl-2.1
9,495
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|02 Jan 2009 17:15:39 -0000 vti_extenderversion:SR|6.0.2.8161 vti_author:SR|EX3\\José Miguel Sánchez vti_modifiedby:SR|VPCXNAGS20\\EX3 vti_timecreated:TR|24 Jan 2006 03:59:18 -0000 vti_title:SR|dx_Sound_Class: CD_NextTrack vti_backlinkinfo:VX|dx_Sound_Class.CD_Pause.html dx_Sound_Class.html dx_Sound_Class.CD_GetVolume.html vti_nexttolasttimemodified:TR|02 Jan 2009 17:12:58 -0000 vti_cacheddtm:TX|02 Jan 2009 17:15:39 -0000 vti_filesize:IR|1831 vti_cachedtitle:SR|dx_Sound_Class: CD_NextTrack vti_cachedbodystyle:SR|<BODY TOPMARGIN="0"> vti_cachedlinkinfo:VX|S|linkcss.js S|langref.js H|dx_lib32.html H|dx_Sound_Class.html K|dx_Sound_Class.html K|dx_Sound_Class.html H|dx_Sound_Class.CD_GetVolume.html H|dx_Sound_Class.CD_Pause.html H|http://vbdox.sourceforge.net/ vti_cachedsvcrellinks:VX|FSUS|linkcss.js FSUS|langref.js FHUS|dx_lib32.html FHUS|dx_Sound_Class.html FHUS|dx_Sound_Class.html FHUS|dx_Sound_Class.html FHUS|dx_Sound_Class.CD_GetVolume.html FHUS|dx_Sound_Class.CD_Pause.html NHHS|http://vbdox.sourceforge.net/ vti_cachedneedsrewrite:BR|false vti_cachedhasbots:BR|false vti_cachedhastheme:BR|false vti_cachedhasborder:BR|false vti_metatags:VR|HTTP-EQUIV=Content-Type Text/html;\\ charset=iso-8859-1 Author misho GENERATOR VBDOX\\ [1.0.24] vti_charset:SR|iso-8859-1 vti_generator:SR|VBDOX [1.0.24]
VisualStudioEX3/dx_lib32
Documentacion/_vti_cnf/dx_Sound_Class.CD_NextTrack.html
HTML
lgpl-2.1
1,384
/** * Contains the service and the class filter required for this bundle. */ package org.awb.env.networkModel.classFilter;
EnFlexIT/AgentWorkbench
eclipseProjects/org.agentgui/bundles/org.awb.env.networkModel/src/org/awb/env/networkModel/classFilter/package-info.java
Java
lgpl-2.1
127
# # Dockerfile for the basic link-grammar source download. # No compilation is performed. # FROM ubuntu:14.04 MAINTAINER Linas Vepstas [email protected] RUN apt-get update RUN apt-get -y install apt-utils RUN apt-get -y install gcc g++ make # Need wget to download link-grammar source RUN apt-get -y install wget # Download the current released version of link-grammar. # RUN http://www.abisource.com/downloads/link-grammar/current/link-grammar-5*.tar.gz # The wget tries to guess the correct file to download w/ wildcard RUN wget -r --no-parent -nH --cut-dirs=2 http://www.abisource.com/downloads/link-grammar/current/ # Unpack the sources, too. RUN tar -zxf current/link-grammar-5*.tar.gz # Need the locales for utf8 RUN apt-get install locales RUN (echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "he_IL.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "lt_LT.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "fa_IR.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "ar_AE.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "kk_KZ.UTF-8 UTF-8" >> /etc/locale.gen && \ echo "tr_TR.UTF-8 UTF-8" >> /etc/locale.gen) # WTF. In debian wheezy, it is enough to just say locale-gen without # any arguments. But in trusty, we eneed to be explicit. I'm confused. # RUN locale-gen # Note also: under trusty, fa_IR.UTF-8 causes locale-gen to fail, # must use the naked fa_IR # Note also: Kazakh is kk_KZ not kz_KZ RUN locale-gen en_US.UTF-8 ru_RU.UTF-8 he_IL.UTF-8 de_DE.UTF-8 lt_LT.UTF-8 fa_IR ar_AE.UTF-8 kk_KZ.UTF-8 tr_TR.UTF-8
MadBomber/link-grammar
docker/docker-base/Dockerfile
Dockerfile
lgpl-2.1
1,648
# Set the ERL environnement variable if you want to use a specific erl ERL ?= $(shell which erl) EJABBERD_DEV ?= ../ejabberd-modules/ejabberd-dev/trunk all: clean $(ERL) -pa $(EJABBERD_DEV)/ebin -make clean: rm -f ebin/*.beam dist-clean: clean find . \( -name \*~ -o -name *.swp \) -exec rm -f {} \;
brendoncrawford/ejabberd_mod_log_rest
Makefile
Makefile
lgpl-2.1
308
class CfmxCompat class Version MAJOR = 0 MINOR = 0 PATCH = 1 PRE = nil class << self def to_s [MAJOR, MINOR, PATCH, PRE].compact.join(".") end end end end
globaldev/cfmx_compat
lib/cfmx_compat/version.rb
Ruby
lgpl-2.1
204
# Orca # # Copyright 2005-2009 Sun Microsystems Inc. # # 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., Franklin Street, Fifth Floor, # Boston MA 02110-1301 USA. """Displays a GUI for the user to set Orca preferences.""" __id__ = "$Id$" __version__ = "$Revision$" __date__ = "$Date$" __copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc." __license__ = "LGPL" import os from gi.repository import Gdk from gi.repository import GLib from gi.repository import Gtk from gi.repository import GObject from gi.repository import Pango import pyatspi import time from . import acss from . import debug from . import guilabels from . import messages from . import orca from . import orca_gtkbuilder from . import orca_gui_profile from . import orca_state from . import orca_platform from . import settings from . import settings_manager from . import input_event from . import keybindings from . import pronunciation_dict from . import braille from . import speech from . import speechserver from . import text_attribute_names _settingsManager = settings_manager.getManager() try: import louis except ImportError: louis = None from .orca_platform import tablesdir if louis and not tablesdir: louis = None (HANDLER, DESCRIP, MOD_MASK1, MOD_USED1, KEY1, CLICK_COUNT1, OLDTEXT1, \ TEXT1, MODIF, EDITABLE) = list(range(10)) (NAME, IS_SPOKEN, IS_BRAILLED, VALUE) = list(range(4)) (ACTUAL, REPLACEMENT) = list(range(2)) # Must match the order of voice types in the GtkBuilder file. # (DEFAULT, UPPERCASE, HYPERLINK, SYSTEM) = list(range(4)) # Must match the order that the timeFormatCombo is populated. # (TIME_FORMAT_LOCALE, TIME_FORMAT_12_HM, TIME_FORMAT_12_HMS, TIME_FORMAT_24_HMS, TIME_FORMAT_24_HMS_WITH_WORDS, TIME_FORMAT_24_HM, TIME_FORMAT_24_HM_WITH_WORDS) = list(range(7)) # Must match the order that the dateFormatCombo is populated. # (DATE_FORMAT_LOCALE, DATE_FORMAT_NUMBERS_DM, DATE_FORMAT_NUMBERS_MD, DATE_FORMAT_NUMBERS_DMY, DATE_FORMAT_NUMBERS_MDY, DATE_FORMAT_NUMBERS_YMD, DATE_FORMAT_FULL_DM, DATE_FORMAT_FULL_MD, DATE_FORMAT_FULL_DMY, DATE_FORMAT_FULL_MDY, DATE_FORMAT_FULL_YMD, DATE_FORMAT_ABBREVIATED_DM, DATE_FORMAT_ABBREVIATED_MD, DATE_FORMAT_ABBREVIATED_DMY, DATE_FORMAT_ABBREVIATED_MDY, DATE_FORMAT_ABBREVIATED_YMD) = list(range(16)) class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper): def __init__(self, fileName, windowName, prefsDict): """Initialize the Orca configuration GUI. Arguments: - fileName: name of the GtkBuilder file. - windowName: name of the component to get from the GtkBuilder file. - prefsDict: dictionary of preferences to use during initialization """ orca_gtkbuilder.GtkBuilderWrapper.__init__(self, fileName, windowName) self.prefsDict = prefsDict self._defaultProfile = ['Default', 'default'] # Initialize variables to None to keep pylint happy. # self.bbindings = None self.cellRendererText = None self.defaultVoice = None self.disableKeyGrabPref = None self.getTextAttributesView = None self.hyperlinkVoice = None self.initializingSpeech = None self.kbindings = None self.keyBindingsModel = None self.keyBindView = None self.newBinding = None self.pendingKeyBindings = None self.planeCellRendererText = None self.pronunciationModel = None self.pronunciationView = None self.screenHeight = None self.screenWidth = None self.speechFamiliesChoice = None self.speechFamiliesChoices = None self.speechFamiliesModel = None self.speechLanguagesChoice = None self.speechLanguagesChoices = None self.speechLanguagesModel = None self.speechFamilies = [] self.speechServersChoice = None self.speechServersChoices = None self.speechServersModel = None self.speechSystemsChoice = None self.speechSystemsChoices = None self.speechSystemsModel = None self.systemVoice = None self.uppercaseVoice = None self.window = None self.workingFactories = None self.savedGain = None self.savedPitch = None self.savedRate = None self._isInitialSetup = False self.selectedFamilyChoices = {} self.selectedLanguageChoices = {} self.profilesCombo = None self.profilesComboModel = None self.startingProfileCombo = None self._capturedKey = [] self.script = None def init(self, script): """Initialize the Orca configuration GUI. Read the users current set of preferences and set the GUI state to match. Setup speech support and populate the combo box lists on the Speech Tab pane accordingly. """ self.script = script # Restore the default rate/pitch/gain, # in case the user played with the sliders. # try: voices = _settingsManager.getSetting('voices') defaultVoice = voices[settings.DEFAULT_VOICE] except KeyError: defaultVoice = {} try: self.savedGain = defaultVoice[acss.ACSS.GAIN] except KeyError: self.savedGain = 10.0 try: self.savedPitch = defaultVoice[acss.ACSS.AVERAGE_PITCH] except KeyError: self.savedPitch = 5.0 try: self.savedRate = defaultVoice[acss.ACSS.RATE] except KeyError: self.savedRate = 50.0 # ***** Key Bindings treeview initialization ***** self.keyBindView = self.get_widget("keyBindingsTreeview") if self.keyBindView.get_columns(): for column in self.keyBindView.get_columns(): self.keyBindView.remove_column(column) self.keyBindingsModel = Gtk.TreeStore( GObject.TYPE_STRING, # Handler name GObject.TYPE_STRING, # Human Readable Description GObject.TYPE_STRING, # Modifier mask 1 GObject.TYPE_STRING, # Used Modifiers 1 GObject.TYPE_STRING, # Modifier key name 1 GObject.TYPE_STRING, # Click count 1 GObject.TYPE_STRING, # Original Text of the Key Binding Shown 1 GObject.TYPE_STRING, # Text of the Key Binding Shown 1 GObject.TYPE_BOOLEAN, # Key Modified by User GObject.TYPE_BOOLEAN) # Row with fields editable or not self.planeCellRendererText = Gtk.CellRendererText() self.cellRendererText = Gtk.CellRendererText() self.cellRendererText.set_property("ellipsize", Pango.EllipsizeMode.END) # HANDLER - invisble column # column = Gtk.TreeViewColumn("Handler", self.planeCellRendererText, text=HANDLER) column.set_resizable(True) column.set_visible(False) column.set_sort_column_id(HANDLER) self.keyBindView.append_column(column) # DESCRIP # column = Gtk.TreeViewColumn(guilabels.KB_HEADER_FUNCTION, self.cellRendererText, text=DESCRIP) column.set_resizable(True) column.set_min_width(380) column.set_sort_column_id(DESCRIP) self.keyBindView.append_column(column) # MOD_MASK1 - invisble column # column = Gtk.TreeViewColumn("Mod.Mask 1", self.planeCellRendererText, text=MOD_MASK1) column.set_visible(False) column.set_resizable(True) column.set_sort_column_id(MOD_MASK1) self.keyBindView.append_column(column) # MOD_USED1 - invisble column # column = Gtk.TreeViewColumn("Use Mod.1", self.planeCellRendererText, text=MOD_USED1) column.set_visible(False) column.set_resizable(True) column.set_sort_column_id(MOD_USED1) self.keyBindView.append_column(column) # KEY1 - invisble column # column = Gtk.TreeViewColumn("Key1", self.planeCellRendererText, text=KEY1) column.set_resizable(True) column.set_visible(False) column.set_sort_column_id(KEY1) self.keyBindView.append_column(column) # CLICK_COUNT1 - invisble column # column = Gtk.TreeViewColumn("ClickCount1", self.planeCellRendererText, text=CLICK_COUNT1) column.set_resizable(True) column.set_visible(False) column.set_sort_column_id(CLICK_COUNT1) self.keyBindView.append_column(column) # OLDTEXT1 - invisble column which will store a copy of the # original keybinding in TEXT1 prior to the Apply or OK # buttons being pressed. This will prevent automatic # resorting each time a cell is edited. # column = Gtk.TreeViewColumn("OldText1", self.planeCellRendererText, text=OLDTEXT1) column.set_resizable(True) column.set_visible(False) column.set_sort_column_id(OLDTEXT1) self.keyBindView.append_column(column) # TEXT1 # rendererText = Gtk.CellRendererText() rendererText.connect("editing-started", self.editingKey, self.keyBindingsModel) rendererText.connect("editing-canceled", self.editingCanceledKey) rendererText.connect('edited', self.editedKey, self.keyBindingsModel, MOD_MASK1, MOD_USED1, KEY1, CLICK_COUNT1, TEXT1) column = Gtk.TreeViewColumn(guilabels.KB_HEADER_KEY_BINDING, rendererText, text=TEXT1, editable=EDITABLE) column.set_resizable(True) column.set_sort_column_id(OLDTEXT1) self.keyBindView.append_column(column) # MODIF # rendererToggle = Gtk.CellRendererToggle() rendererToggle.connect('toggled', self.keyModifiedToggle, self.keyBindingsModel, MODIF) column = Gtk.TreeViewColumn(guilabels.KB_MODIFIED, rendererToggle, active=MODIF, activatable=EDITABLE) #column.set_visible(False) column.set_resizable(True) column.set_sort_column_id(MODIF) self.keyBindView.append_column(column) # EDITABLE - invisble column # rendererToggle = Gtk.CellRendererToggle() rendererToggle.set_property('activatable', False) column = Gtk.TreeViewColumn("Modified", rendererToggle, active=EDITABLE) column.set_visible(False) column.set_resizable(True) column.set_sort_column_id(EDITABLE) self.keyBindView.append_column(column) # Populates the treeview with all the keybindings: # self._populateKeyBindings() self.window = self.get_widget("orcaSetupWindow") self._setKeyEchoItems() self.speechSystemsModel = \ self._initComboBox(self.get_widget("speechSystems")) self.speechServersModel = \ self._initComboBox(self.get_widget("speechServers")) self.speechLanguagesModel = \ self._initComboBox(self.get_widget("speechLanguages")) self.speechFamiliesModel = \ self._initComboBox(self.get_widget("speechFamilies")) self._initSpeechState() # TODO - JD: Will this ever be the case?? self._isInitialSetup = \ not os.path.exists(_settingsManager.getPrefsDir()) appPage = self.script.getAppPreferencesGUI() if appPage: label = Gtk.Label(label=self.script.app.name) self.get_widget("notebook").append_page(appPage, label) self._initGUIState() def _getACSSForVoiceType(self, voiceType): """Return the ACSS value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM Returns the voice dictionary for the given voice type. """ if voiceType == DEFAULT: voiceACSS = self.defaultVoice elif voiceType == UPPERCASE: voiceACSS = self.uppercaseVoice elif voiceType == HYPERLINK: voiceACSS = self.hyperlinkVoice elif voiceType == SYSTEM: voiceACSS = self.systemVoice else: voiceACSS = self.defaultVoice return voiceACSS def writeUserPreferences(self): """Write out the user's generic Orca preferences. """ pronunciationDict = self.getModelDict(self.pronunciationModel) keyBindingsDict = self.getKeyBindingsModelDict(self.keyBindingsModel) self.prefsDict.update(self.script.getPreferencesFromGUI()) _settingsManager.saveSettings(self.script, self.prefsDict, pronunciationDict, keyBindingsDict) def _getKeyValueForVoiceType(self, voiceType, key, useDefault=True): """Look for the value of the given key in the voice dictionary for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM - key: the key to look for in the voice dictionary. - useDefault: if True, and the key isn't found for the given voice type, the look for it in the default voice dictionary as well. Returns the value of the given key, or None if it's not set. """ if voiceType == DEFAULT: voice = self.defaultVoice elif voiceType == UPPERCASE: voice = self.uppercaseVoice if key not in voice: if not useDefault: return None voice = self.defaultVoice elif voiceType == HYPERLINK: voice = self.hyperlinkVoice if key not in voice: if not useDefault: return None voice = self.defaultVoice elif voiceType == SYSTEM: voice = self.systemVoice if key not in voice: if not useDefault: return None voice = self.defaultVoice else: voice = self.defaultVoice if key in voice: return voice[key] else: return None def _getFamilyNameForVoiceType(self, voiceType): """Gets the name of the voice family for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM Returns the name of the voice family for the given voice type, or None if not set. """ familyName = None family = self._getKeyValueForVoiceType(voiceType, acss.ACSS.FAMILY) if family and speechserver.VoiceFamily.NAME in family: familyName = family[speechserver.VoiceFamily.NAME] return familyName def _setFamilyNameForVoiceType(self, voiceType, name, language, dialect, variant): """Sets the name of the voice family for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM - name: the name of the voice family to set. - language: the locale of the voice family to set. - dialect: the dialect of the voice family to set. """ family = self._getKeyValueForVoiceType(voiceType, acss.ACSS.FAMILY, False) voiceACSS = self._getACSSForVoiceType(voiceType) if family: family[speechserver.VoiceFamily.NAME] = name family[speechserver.VoiceFamily.LANG] = language family[speechserver.VoiceFamily.DIALECT] = dialect family[speechserver.VoiceFamily.VARIANT] = variant else: voiceACSS[acss.ACSS.FAMILY] = {} voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.NAME] = name voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.LANG] = language voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.DIALECT] = dialect voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.VARIANT] = variant voiceACSS['established'] = True #settings.voices[voiceType] = voiceACSS def _getRateForVoiceType(self, voiceType): """Gets the speaking rate value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM Returns the rate value for the given voice type, or None if not set. """ return self._getKeyValueForVoiceType(voiceType, acss.ACSS.RATE) def _setRateForVoiceType(self, voiceType, value): """Sets the speaking rate value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM - value: the rate value to set. """ voiceACSS = self._getACSSForVoiceType(voiceType) voiceACSS[acss.ACSS.RATE] = value voiceACSS['established'] = True #settings.voices[voiceType] = voiceACSS def _getPitchForVoiceType(self, voiceType): """Gets the pitch value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM Returns the pitch value for the given voice type, or None if not set. """ return self._getKeyValueForVoiceType(voiceType, acss.ACSS.AVERAGE_PITCH) def _setPitchForVoiceType(self, voiceType, value): """Sets the pitch value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM - value: the pitch value to set. """ voiceACSS = self._getACSSForVoiceType(voiceType) voiceACSS[acss.ACSS.AVERAGE_PITCH] = value voiceACSS['established'] = True #settings.voices[voiceType] = voiceACSS def _getVolumeForVoiceType(self, voiceType): """Gets the volume (gain) value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM Returns the volume (gain) value for the given voice type, or None if not set. """ return self._getKeyValueForVoiceType(voiceType, acss.ACSS.GAIN) def _setVolumeForVoiceType(self, voiceType, value): """Sets the volume (gain) value for the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM - value: the volume (gain) value to set. """ voiceACSS = self._getACSSForVoiceType(voiceType) voiceACSS[acss.ACSS.GAIN] = value voiceACSS['established'] = True #settings.voices[voiceType] = voiceACSS def _setVoiceSettingsForVoiceType(self, voiceType): """Sets the family, rate, pitch and volume GUI components based on the given voice type. Arguments: - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM """ familyName = self._getFamilyNameForVoiceType(voiceType) self._setSpeechFamiliesChoice(familyName) rate = self._getRateForVoiceType(voiceType) if rate is not None: self.get_widget("rateScale").set_value(rate) else: self.get_widget("rateScale").set_value(50.0) pitch = self._getPitchForVoiceType(voiceType) if pitch is not None: self.get_widget("pitchScale").set_value(pitch) else: self.get_widget("pitchScale").set_value(5.0) volume = self._getVolumeForVoiceType(voiceType) if volume is not None: self.get_widget("volumeScale").set_value(volume) else: self.get_widget("volumeScale").set_value(10.0) def _setSpeechFamiliesChoice(self, familyName): """Sets the active item in the families ("Person:") combo box to the given family name. Arguments: - familyName: the family name to use to set the active combo box item. """ if len(self.speechFamilies) == 0: return languageSet = False familySet = False for family in self.speechFamilies: name = family[speechserver.VoiceFamily.NAME] if name == familyName: lang = family[speechserver.VoiceFamily.LANG] dialect = family[speechserver.VoiceFamily.DIALECT] if dialect: language = lang + '-' + dialect else: language = lang i = 0 for languageChoice in self.speechLanguagesChoices: if languageChoice == language: self.get_widget("speechLanguages").set_active(i) self.speechLanguagesChoice = self.speechLanguagesChoices[i] languageSet = True self._setupFamilies() i = 0 for familyChoice in self.speechFamiliesChoices: name = familyChoice[speechserver.VoiceFamily.NAME] if name == familyName: self.get_widget("speechFamilies").set_active(i) self.speechFamiliesChoice = self.speechFamiliesChoices[i] familySet = True break i += 1 break i += 1 break if not languageSet: debug.println(debug.LEVEL_FINEST, "Could not find speech language match for %s" \ % familyName) self.get_widget("speechLanguages").set_active(0) self.speechLanguagesChoice = self.speechLanguagesChoices[0] if languageSet: self.selectedLanguageChoices[self.speechServersChoice] = i if not familySet: debug.println(debug.LEVEL_FINEST, "Could not find speech family match for %s" \ % familyName) self.get_widget("speechFamilies").set_active(0) self.speechFamiliesChoice = self.speechFamiliesChoices[0] if familySet: self.selectedFamilyChoices[self.speechServersChoice, self.speechLanguagesChoice] = i def _setupFamilies(self): """Gets the list of voice variants for the current speech server and current language. If there are variants, get the information associated with each voice variant and add an entry for it to the variants GtkComboBox list. """ self.speechFamiliesModel.clear() currentLanguage = self.speechLanguagesChoice i = 0 self.speechFamiliesChoices = [] for family in self.speechFamilies: lang = family[speechserver.VoiceFamily.LANG] dialect = family[speechserver.VoiceFamily.DIALECT] if dialect: language = lang + '-' + dialect else: language = lang if language != currentLanguage: continue name = family[speechserver.VoiceFamily.NAME] self.speechFamiliesChoices.append(family) self.speechFamiliesModel.append((i, name)) i += 1 if i == 0: debug.println(debug.LEVEL_SEVERE, "No speech family was available for %s." % str(currentLanguage)) debug.printStack(debug.LEVEL_FINEST) self.speechFamiliesChoice = None return # If user manually selected a family for the current speech server # this choice it's restored. In other case the first family # (usually the default one) is selected # selectedIndex = 0 if (self.speechServersChoice, self.speechLanguagesChoice) \ in self.selectedFamilyChoices: selectedIndex = self.selectedFamilyChoices[self.speechServersChoice, self.speechLanguagesChoice] self.get_widget("speechFamilies").set_active(selectedIndex) def _setSpeechLanguagesChoice(self, languageName): """Sets the active item in the languages ("Language:") combo box to the given language name. Arguments: - languageName: the language name to use to set the active combo box item. """ print("setSpeechLanguagesChoice") if len(self.speechLanguagesChoices) == 0: return valueSet = False i = 0 for language in self.speechLanguagesChoices: if language == languageName: self.get_widget("speechLanguages").set_active(i) self.speechLanguagesChoice = self.speechLanguagesChoices[i] valueSet = True break i += 1 if not valueSet: debug.println(debug.LEVEL_FINEST, "Could not find speech language match for %s" \ % languageName) self.get_widget("speechLanguages").set_active(0) self.speechLanguagesChoice = self.speechLanguagesChoices[0] if valueSet: self.selectedLanguageChoices[self.speechServersChoice] = i self._setupFamilies() def _setupVoices(self): """Gets the list of voices for the current speech server. If there are families, get the information associated with each voice family and add an entry for it to the families GtkComboBox list. """ self.speechLanguagesModel.clear() self.speechFamilies = self.speechServersChoice.getVoiceFamilies() self.speechLanguagesChoices = [] if len(self.speechFamilies) == 0: debug.println(debug.LEVEL_SEVERE, "No speech voice was available.") debug.printStack(debug.LEVEL_FINEST) self.speechLanguagesChoice = None return done = {} i = 0 for family in self.speechFamilies: lang = family[speechserver.VoiceFamily.LANG] dialect = family[speechserver.VoiceFamily.DIALECT] if (lang,dialect) in done: continue done[lang,dialect] = True if dialect: language = lang + '-' + dialect else: language = lang # TODO: get translated language name from CLDR or such msg = language if msg == "": # Unsupported locale msg = "default language" self.speechLanguagesChoices.append(language) self.speechLanguagesModel.append((i, msg)) i += 1 # If user manually selected a language for the current speech server # this choice it's restored. In other case the first language # (usually the default one) is selected # selectedIndex = 0 if self.speechServersChoice in self.selectedLanguageChoices: selectedIndex = self.selectedLanguageChoices[self.speechServersChoice] self.get_widget("speechLanguages").set_active(selectedIndex) if self.initializingSpeech: self.speechLanguagesChoice = self.speechLanguagesChoices[selectedIndex] self._setupFamilies() # The family name will be selected as part of selecting the # voice type. Whenever the families change, we'll reset the # voice type selection to the first one ("Default"). # comboBox = self.get_widget("voiceTypesCombo") types = [guilabels.SPEECH_VOICE_TYPE_DEFAULT, guilabels.SPEECH_VOICE_TYPE_UPPERCASE, guilabels.SPEECH_VOICE_TYPE_HYPERLINK, guilabels.SPEECH_VOICE_TYPE_SYSTEM] self.populateComboBox(comboBox, types) comboBox.set_active(DEFAULT) voiceType = comboBox.get_active() self._setVoiceSettingsForVoiceType(voiceType) def _setSpeechServersChoice(self, serverInfo): """Sets the active item in the speech servers combo box to the given server. Arguments: - serversChoices: the list of available speech servers. - serverInfo: the speech server to use to set the active combo box item. """ if len(self.speechServersChoices) == 0: return # We'll fallback to whatever we happen to be using in the event # that this preference has never been set. # if not serverInfo: serverInfo = speech.getInfo() valueSet = False i = 0 for server in self.speechServersChoices: if serverInfo == server.getInfo(): self.get_widget("speechServers").set_active(i) self.speechServersChoice = server valueSet = True break i += 1 if not valueSet: debug.println(debug.LEVEL_FINEST, "Could not find speech server match for %s" \ % repr(serverInfo)) self.get_widget("speechServers").set_active(0) self.speechServersChoice = self.speechServersChoices[0] self._setupVoices() def _setupSpeechServers(self): """Gets the list of speech servers for the current speech factory. If there are servers, get the information associated with each speech server and add an entry for it to the speechServers GtkComboBox list. Set the current choice to be the first item. """ self.speechServersModel.clear() self.speechServersChoices = \ self.speechSystemsChoice.SpeechServer.getSpeechServers() if len(self.speechServersChoices) == 0: debug.println(debug.LEVEL_SEVERE, "Speech not available.") debug.printStack(debug.LEVEL_FINEST) self.speechServersChoice = None self.speechLanguagesChoices = [] self.speechLanguagesChoice = None self.speechFamiliesChoices = [] self.speechFamiliesChoice = None return i = 0 for server in self.speechServersChoices: name = server.getInfo()[0] self.speechServersModel.append((i, name)) i += 1 self._setSpeechServersChoice(self.prefsDict["speechServerInfo"]) debug.println( debug.LEVEL_FINEST, "orca_gui_prefs._setupSpeechServers: speechServersChoice: %s" \ % self.speechServersChoice.getInfo()) def _setSpeechSystemsChoice(self, systemName): """Set the active item in the speech systems combo box to the given system name. Arguments: - factoryChoices: the list of available speech factories (systems). - systemName: the speech system name to use to set the active combo box item. """ systemName = systemName.strip("'") if len(self.speechSystemsChoices) == 0: self.speechSystemsChoice = None return valueSet = False i = 0 for speechSystem in self.speechSystemsChoices: name = speechSystem.__name__ if name.endswith(systemName): self.get_widget("speechSystems").set_active(i) self.speechSystemsChoice = self.speechSystemsChoices[i] valueSet = True break i += 1 if not valueSet: debug.println(debug.LEVEL_FINEST, "Could not find speech system match for %s" \ % systemName) self.get_widget("speechSystems").set_active(0) self.speechSystemsChoice = self.speechSystemsChoices[0] self._setupSpeechServers() def _setupSpeechSystems(self, factories): """Sets up the speech systems combo box and sets the selection to the preferred speech system. Arguments: -factories: the list of known speech factories (working or not) """ self.speechSystemsModel.clear() self.workingFactories = [] for factory in factories: try: servers = factory.SpeechServer.getSpeechServers() if len(servers): self.workingFactories.append(factory) except: debug.printException(debug.LEVEL_FINEST) self.speechSystemsChoices = [] if len(self.workingFactories) == 0: debug.println(debug.LEVEL_SEVERE, "Speech not available.") debug.printStack(debug.LEVEL_FINEST) self.speechSystemsChoice = None self.speechServersChoices = [] self.speechServersChoice = None self.speechLanguagesChoices = [] self.speechLanguagesChoice = None self.speechFamiliesChoices = [] self.speechFamiliesChoice = None return i = 0 for workingFactory in self.workingFactories: self.speechSystemsChoices.append(workingFactory) name = workingFactory.SpeechServer.getFactoryName() self.speechSystemsModel.append((i, name)) i += 1 if self.prefsDict["speechServerFactory"]: self._setSpeechSystemsChoice(self.prefsDict["speechServerFactory"]) else: self.speechSystemsChoice = None debug.println( debug.LEVEL_FINEST, "orca_gui_prefs._setupSpeechSystems: speechSystemsChoice: %s" \ % self.speechSystemsChoice) def _initSpeechState(self): """Initialize the various speech components. """ voices = self.prefsDict["voices"] self.defaultVoice = acss.ACSS(voices.get(settings.DEFAULT_VOICE)) self.uppercaseVoice = acss.ACSS(voices.get(settings.UPPERCASE_VOICE)) self.hyperlinkVoice = acss.ACSS(voices.get(settings.HYPERLINK_VOICE)) self.systemVoice = acss.ACSS(voices.get(settings.SYSTEM_VOICE)) # Just a note on general naming pattern: # # * = The name of the combobox # *Model = the name of the comobox model # *Choices = the Orca/speech python objects # *Choice = a value from *Choices # # Where * = speechSystems, speechServers, speechLanguages, speechFamilies # factories = _settingsManager.getSpeechServerFactories() if len(factories) == 0 or not self.prefsDict.get('enableSpeech', True): self.workingFactories = [] self.speechSystemsChoice = None self.speechServersChoices = [] self.speechServersChoice = None self.speechLanguagesChoices = [] self.speechLanguagesChoice = None self.speechFamiliesChoices = [] self.speechFamiliesChoice = None return try: speech.init() except: self.workingFactories = [] self.speechSystemsChoice = None self.speechServersChoices = [] self.speechServersChoice = None self.speechLanguagesChoices = [] self.speechLanguagesChoice = None self.speechFamiliesChoices = [] self.speechFamiliesChoice = None return # This cascades into systems->servers->voice_type->families... # self.initializingSpeech = True self._setupSpeechSystems(factories) self.initializingSpeech = False def _setSpokenTextAttributes(self, view, setAttributes, state, moveToTop=False): """Given a set of spoken text attributes, update the model used by the text attribute tree view. Arguments: - view: the text attribute tree view. - setAttributes: the list of spoken text attributes to update. - state: the state (True or False) that they all should be set to. - moveToTop: if True, move these attributes to the top of the list. """ model = view.get_model() view.set_model(None) [attrList, attrDict] = \ self.script.utilities.stringToKeysAndDict(setAttributes) [allAttrList, allAttrDict] = self.script.utilities.stringToKeysAndDict( _settingsManager.getSetting('allTextAttributes')) for i in range(0, len(attrList)): for path in range(0, len(allAttrList)): localizedKey = text_attribute_names.getTextAttributeName( attrList[i], self.script) localizedValue = text_attribute_names.getTextAttributeName( attrDict[attrList[i]], self.script) if localizedKey == model[path][NAME]: thisIter = model.get_iter(path) model.set_value(thisIter, NAME, localizedKey) model.set_value(thisIter, IS_SPOKEN, state) model.set_value(thisIter, VALUE, localizedValue) if moveToTop: thisIter = model.get_iter(path) otherIter = model.get_iter(i) model.move_before(thisIter, otherIter) break view.set_model(model) def _setBrailledTextAttributes(self, view, setAttributes, state): """Given a set of brailled text attributes, update the model used by the text attribute tree view. Arguments: - view: the text attribute tree view. - setAttributes: the list of brailled text attributes to update. - state: the state (True or False) that they all should be set to. """ model = view.get_model() view.set_model(None) [attrList, attrDict] = \ self.script.utilities.stringToKeysAndDict(setAttributes) [allAttrList, allAttrDict] = self.script.utilities.stringToKeysAndDict( _settingsManager.getSetting('allTextAttributes')) for i in range(0, len(attrList)): for path in range(0, len(allAttrList)): localizedKey = text_attribute_names.getTextAttributeName( attrList[i], self.script) if localizedKey == model[path][NAME]: thisIter = model.get_iter(path) model.set_value(thisIter, IS_BRAILLED, state) break view.set_model(model) def _getAppNameForAttribute(self, attributeName): """Converts the given Atk attribute name into the application's equivalent. This is necessary because an application or toolkit (e.g. Gecko) might invent entirely new names for the same text attributes. Arguments: - attribName: The name of the text attribute Returns the application's equivalent name if found or attribName otherwise. """ return self.script.utilities.getAppNameForAttribute(attributeName) def _updateTextDictEntry(self): """The user has updated the text attribute list in some way. Update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings to reflect the current state of the corresponding text attribute lists. """ model = self.getTextAttributesView.get_model() spokenAttrStr = "" brailledAttrStr = "" noRows = model.iter_n_children(None) for path in range(0, noRows): localizedKey = model[path][NAME] key = text_attribute_names.getTextAttributeKey(localizedKey) # Convert the normalized, Atk attribute name back into what # the app/toolkit uses. # key = self._getAppNameForAttribute(key) localizedValue = model[path][VALUE] value = text_attribute_names.getTextAttributeKey(localizedValue) if model[path][IS_SPOKEN]: spokenAttrStr += key + ":" + value + "; " if model[path][IS_BRAILLED]: brailledAttrStr += key + ":" + value + "; " self.prefsDict["enabledSpokenTextAttributes"] = spokenAttrStr self.prefsDict["enabledBrailledTextAttributes"] = brailledAttrStr def contractedBrailleToggled(self, checkbox): grid = self.get_widget('contractionTableGrid') grid.set_sensitive(checkbox.get_active()) self.prefsDict["enableContractedBraille"] = checkbox.get_active() def contractionTableComboChanged(self, combobox): model = combobox.get_model() myIter = combobox.get_active_iter() self.prefsDict["brailleContractionTable"] = model[myIter][1] def flashPersistenceToggled(self, checkbox): grid = self.get_widget('flashMessageDurationGrid') grid.set_sensitive(not checkbox.get_active()) self.prefsDict["flashIsPersistent"] = checkbox.get_active() def textAttributeSpokenToggled(self, cell, path, model): """The user has toggled the state of one of the text attribute checkboxes to be spoken. Update our model to reflect this, then update the "enabledSpokenTextAttributes" preference string. Arguments: - cell: the cell that changed. - path: the path of that cell. - model: the model that the cell is part of. """ thisIter = model.get_iter(path) model.set(thisIter, IS_SPOKEN, not model[path][IS_SPOKEN]) self._updateTextDictEntry() def textAttributeBrailledToggled(self, cell, path, model): """The user has toggled the state of one of the text attribute checkboxes to be brailled. Update our model to reflect this, then update the "enabledBrailledTextAttributes" preference string. Arguments: - cell: the cell that changed. - path: the path of that cell. - model: the model that the cell is part of. """ thisIter = model.get_iter(path) model.set(thisIter, IS_BRAILLED, not model[path][IS_BRAILLED]) self._updateTextDictEntry() def textAttrValueEdited(self, cell, path, new_text, model): """The user has edited the value of one of the text attributes. Update our model to reflect this, then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - cell: the cell that changed. - path: the path of that cell. - new_text: the new text attribute value string. - model: the model that the cell is part of. """ thisIter = model.get_iter(path) model.set(thisIter, VALUE, new_text) self._updateTextDictEntry() def textAttrCursorChanged(self, widget): """Set the search column in the text attribute tree view depending upon which column the user currently has the cursor in. """ [path, focusColumn] = self.getTextAttributesView.get_cursor() if focusColumn: noColumns = len(self.getTextAttributesView.get_columns()) for i in range(0, noColumns): col = self.getTextAttributesView.get_column(i) if focusColumn == col: self.getTextAttributesView.set_search_column(i) break def _createTextAttributesTreeView(self): """Create the text attributes tree view. The view is the textAttributesTreeView GtkTreeView widget. The view will consist of a list containing three columns: IS_SPOKEN - a checkbox whose state indicates whether this text attribute will be spoken or not. NAME - the text attribute name. VALUE - if set, (and this attributes is enabled for speaking), then this attribute will be spoken unless it equals this value. """ self.getTextAttributesView = self.get_widget("textAttributesTreeView") if self.getTextAttributesView.get_columns(): for column in self.getTextAttributesView.get_columns(): self.getTextAttributesView.remove_column(column) model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_BOOLEAN, GObject.TYPE_BOOLEAN, GObject.TYPE_STRING) # Initially setup the list store model based on the values of all # the known text attributes. # [allAttrList, allAttrDict] = self.script.utilities.stringToKeysAndDict( _settingsManager.getSetting('allTextAttributes')) for i in range(0, len(allAttrList)): thisIter = model.append() localizedKey = text_attribute_names.getTextAttributeName( allAttrList[i], self.script) localizedValue = text_attribute_names.getTextAttributeName( allAttrDict[allAttrList[i]], self.script) model.set_value(thisIter, NAME, localizedKey) model.set_value(thisIter, IS_SPOKEN, False) model.set_value(thisIter, IS_BRAILLED, False) model.set_value(thisIter, VALUE, localizedValue) self.getTextAttributesView.set_model(model) # Attribute Name column (NAME). column = Gtk.TreeViewColumn(guilabels.TEXT_ATTRIBUTE_NAME) column.set_min_width(250) column.set_resizable(True) renderer = Gtk.CellRendererText() column.pack_end(renderer, True) column.add_attribute(renderer, 'text', NAME) self.getTextAttributesView.insert_column(column, 0) # Attribute Speak column (IS_SPOKEN). speakAttrColumnLabel = guilabels.PRESENTATION_SPEAK column = Gtk.TreeViewColumn(speakAttrColumnLabel) renderer = Gtk.CellRendererToggle() column.pack_start(renderer, False) column.add_attribute(renderer, 'active', IS_SPOKEN) renderer.connect("toggled", self.textAttributeSpokenToggled, model) self.getTextAttributesView.insert_column(column, 1) column.clicked() # Attribute Mark in Braille column (IS_BRAILLED). markAttrColumnLabel = guilabels.PRESENTATION_MARK_IN_BRAILLE column = Gtk.TreeViewColumn(markAttrColumnLabel) renderer = Gtk.CellRendererToggle() column.pack_start(renderer, False) column.add_attribute(renderer, 'active', IS_BRAILLED) renderer.connect("toggled", self.textAttributeBrailledToggled, model) self.getTextAttributesView.insert_column(column, 2) column.clicked() # Attribute Value column (VALUE) column = Gtk.TreeViewColumn(guilabels.PRESENTATION_PRESENT_UNLESS) renderer = Gtk.CellRendererText() renderer.set_property('editable', True) column.pack_end(renderer, True) column.add_attribute(renderer, 'text', VALUE) renderer.connect("edited", self.textAttrValueEdited, model) self.getTextAttributesView.insert_column(column, 4) # Check all the enabled (spoken) text attributes. # self._setSpokenTextAttributes( self.getTextAttributesView, _settingsManager.getSetting('enabledSpokenTextAttributes'), True, True) # Check all the enabled (brailled) text attributes. # self._setBrailledTextAttributes( self.getTextAttributesView, _settingsManager.getSetting('enabledBrailledTextAttributes'), True) # Connect a handler for when the user changes columns within the # view, so that we can adjust the search column for item lookups. # self.getTextAttributesView.connect("cursor_changed", self.textAttrCursorChanged) def pronActualValueEdited(self, cell, path, new_text, model): """The user has edited the value of one of the actual strings in the pronunciation dictionary. Update our model to reflect this. Arguments: - cell: the cell that changed. - path: the path of that cell. - new_text: the new pronunciation dictionary actual string. - model: the model that the cell is part of. """ thisIter = model.get_iter(path) model.set(thisIter, ACTUAL, new_text) def pronReplacementValueEdited(self, cell, path, new_text, model): """The user has edited the value of one of the replacement strings in the pronunciation dictionary. Update our model to reflect this. Arguments: - cell: the cell that changed. - path: the path of that cell. - new_text: the new pronunciation dictionary replacement string. - model: the model that the cell is part of. """ thisIter = model.get_iter(path) model.set(thisIter, REPLACEMENT, new_text) def pronunciationFocusChange(self, widget, event, isFocused): """Callback for the pronunciation tree's focus-{in,out}-event signal.""" _settingsManager.setSetting('usePronunciationDictionary', not isFocused) def pronunciationCursorChanged(self, widget): """Set the search column in the pronunciation dictionary tree view depending upon which column the user currently has the cursor in. """ [path, focusColumn] = self.pronunciationView.get_cursor() if focusColumn: noColumns = len(self.pronunciationView.get_columns()) for i in range(0, noColumns): col = self.pronunciationView.get_column(i) if focusColumn == col: self.pronunciationView.set_search_column(i) break def _createPronunciationTreeView(self): """Create the pronunciation dictionary tree view. The view is the pronunciationTreeView GtkTreeView widget. The view will consist of a list containing two columns: ACTUAL - the actual text string (word). REPLACEMENT - the string that is used to pronounce that word. """ self.pronunciationView = self.get_widget("pronunciationTreeView") if self.pronunciationView.get_columns(): for column in self.pronunciationView.get_columns(): self.pronunciationView.remove_column(column) model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING) # Initially setup the list store model based on the values of all # existing entries in the pronunciation dictionary -- unless it's # the default script. # if not self.script.app: _profile = self.prefsDict.get('activeProfile')[1] pronDict = _settingsManager.getPronunciations(_profile) else: pronDict = pronunciation_dict.pronunciation_dict for pronKey in sorted(pronDict.keys()): thisIter = model.append() try: actual, replacement = pronDict[pronKey] except: # Try to do something sensible for the previous format of # pronunciation dictionary entries. See bug #464754 for # more details. # actual = pronKey replacement = pronDict[pronKey] model.set(thisIter, ACTUAL, actual, REPLACEMENT, replacement) self.pronunciationView.set_model(model) # Pronunciation Dictionary actual string (word) column (ACTUAL). column = Gtk.TreeViewColumn(guilabels.DICTIONARY_ACTUAL_STRING) column.set_min_width(250) column.set_resizable(True) renderer = Gtk.CellRendererText() renderer.set_property('editable', True) column.pack_end(renderer, True) column.add_attribute(renderer, 'text', ACTUAL) renderer.connect("edited", self.pronActualValueEdited, model) self.pronunciationView.insert_column(column, 0) # Pronunciation Dictionary replacement string column (REPLACEMENT) column = Gtk.TreeViewColumn(guilabels.DICTIONARY_REPLACEMENT_STRING) renderer = Gtk.CellRendererText() renderer.set_property('editable', True) column.pack_end(renderer, True) column.add_attribute(renderer, 'text', REPLACEMENT) renderer.connect("edited", self.pronReplacementValueEdited, model) self.pronunciationView.insert_column(column, 1) self.pronunciationModel = model # Connect a handler for when the user changes columns within the # view, so that we can adjust the search column for item lookups. # self.pronunciationView.connect("cursor_changed", self.pronunciationCursorChanged) self.pronunciationView.connect( "focus_in_event", self.pronunciationFocusChange, True) self.pronunciationView.connect( "focus_out_event", self.pronunciationFocusChange, False) def _initGUIState(self): """Adjust the settings of the various components on the configuration GUI depending upon the users preferences. """ prefs = self.prefsDict # Speech pane. # enable = prefs["enableSpeech"] self.get_widget("speechSupportCheckButton").set_active(enable) self.get_widget("speechOptionsGrid").set_sensitive(enable) enable = prefs["onlySpeakDisplayedText"] self.get_widget("onlySpeakDisplayedTextCheckButton").set_active(enable) self.get_widget("contextOptionsGrid").set_sensitive(not enable) if prefs["verbalizePunctuationStyle"] == \ settings.PUNCTUATION_STYLE_NONE: self.get_widget("noneButton").set_active(True) elif prefs["verbalizePunctuationStyle"] == \ settings.PUNCTUATION_STYLE_SOME: self.get_widget("someButton").set_active(True) elif prefs["verbalizePunctuationStyle"] == \ settings.PUNCTUATION_STYLE_MOST: self.get_widget("mostButton").set_active(True) else: self.get_widget("allButton").set_active(True) if prefs["speechVerbosityLevel"] == settings.VERBOSITY_LEVEL_BRIEF: self.get_widget("speechBriefButton").set_active(True) else: self.get_widget("speechVerboseButton").set_active(True) self.get_widget("onlySpeakDisplayedTextCheckButton").set_active( prefs["onlySpeakDisplayedText"]) self.get_widget("enableSpeechIndentationCheckButton").set_active(\ prefs["enableSpeechIndentation"]) self.get_widget("speakBlankLinesCheckButton").set_active(\ prefs["speakBlankLines"]) self.get_widget("speakMultiCaseStringsAsWordsCheckButton").set_active(\ prefs["speakMultiCaseStringsAsWords"]) self.get_widget("speakNumbersAsDigitsCheckButton").set_active( prefs.get("speakNumbersAsDigits", settings.speakNumbersAsDigits)) self.get_widget("enableTutorialMessagesCheckButton").set_active(\ prefs["enableTutorialMessages"]) self.get_widget("enablePauseBreaksCheckButton").set_active(\ prefs["enablePauseBreaks"]) self.get_widget("enablePositionSpeakingCheckButton").set_active(\ prefs["enablePositionSpeaking"]) self.get_widget("enableMnemonicSpeakingCheckButton").set_active(\ prefs["enableMnemonicSpeaking"]) self.get_widget("speakMisspelledIndicatorCheckButton").set_active( prefs.get("speakMisspelledIndicator", settings.speakMisspelledIndicator)) self.get_widget("speakDescriptionCheckButton").set_active( prefs.get("speakDescription", settings.speakDescription)) self.get_widget("speakContextBlockquoteCheckButton").set_active( prefs.get("speakContextBlockquote", settings.speakContextList)) self.get_widget("speakContextLandmarkCheckButton").set_active( prefs.get("speakContextLandmark", settings.speakContextLandmark)) self.get_widget("speakContextNonLandmarkFormCheckButton").set_active( prefs.get("speakContextNonLandmarkForm", settings.speakContextNonLandmarkForm)) self.get_widget("speakContextListCheckButton").set_active( prefs.get("speakContextList", settings.speakContextList)) self.get_widget("speakContextPanelCheckButton").set_active( prefs.get("speakContextPanel", settings.speakContextPanel)) self.get_widget("speakContextTableCheckButton").set_active( prefs.get("speakContextTable", settings.speakContextTable)) enable = prefs.get("messagesAreDetailed", settings.messagesAreDetailed) self.get_widget("messagesAreDetailedCheckButton").set_active(enable) enable = prefs.get("useColorNames", settings.useColorNames) self.get_widget("useColorNamesCheckButton").set_active(enable) enable = prefs.get("readFullRowInGUITable", settings.readFullRowInGUITable) self.get_widget("readFullRowInGUITableCheckButton").set_active(enable) enable = prefs.get("readFullRowInDocumentTable", settings.readFullRowInDocumentTable) self.get_widget("readFullRowInDocumentTableCheckButton").set_active(enable) enable = prefs.get("readFullRowInSpreadSheet", settings.readFullRowInSpreadSheet) self.get_widget("readFullRowInSpreadSheetCheckButton").set_active(enable) style = prefs.get("capitalizationStyle", settings.capitalizationStyle) combobox = self.get_widget("capitalizationStyle") options = [guilabels.CAPITALIZATION_STYLE_NONE, guilabels.CAPITALIZATION_STYLE_ICON, guilabels.CAPITALIZATION_STYLE_SPELL] self.populateComboBox(combobox, options) if style == settings.CAPITALIZATION_STYLE_ICON: value = guilabels.CAPITALIZATION_STYLE_ICON elif style == settings.CAPITALIZATION_STYLE_SPELL: value = guilabels.CAPITALIZATION_STYLE_SPELL else: value = guilabels.CAPITALIZATION_STYLE_NONE combobox.set_active(options.index(value)) combobox2 = self.get_widget("dateFormatCombo") sdtime = time.strftime ltime = time.localtime self.populateComboBox(combobox2, [sdtime(messages.DATE_FORMAT_LOCALE, ltime()), sdtime(messages.DATE_FORMAT_NUMBERS_DM, ltime()), sdtime(messages.DATE_FORMAT_NUMBERS_MD, ltime()), sdtime(messages.DATE_FORMAT_NUMBERS_DMY, ltime()), sdtime(messages.DATE_FORMAT_NUMBERS_MDY, ltime()), sdtime(messages.DATE_FORMAT_NUMBERS_YMD, ltime()), sdtime(messages.DATE_FORMAT_FULL_DM, ltime()), sdtime(messages.DATE_FORMAT_FULL_MD, ltime()), sdtime(messages.DATE_FORMAT_FULL_DMY, ltime()), sdtime(messages.DATE_FORMAT_FULL_MDY, ltime()), sdtime(messages.DATE_FORMAT_FULL_YMD, ltime()), sdtime(messages.DATE_FORMAT_ABBREVIATED_DM, ltime()), sdtime(messages.DATE_FORMAT_ABBREVIATED_MD, ltime()), sdtime(messages.DATE_FORMAT_ABBREVIATED_DMY, ltime()), sdtime(messages.DATE_FORMAT_ABBREVIATED_MDY, ltime()), sdtime(messages.DATE_FORMAT_ABBREVIATED_YMD, ltime()) ]) indexdate = DATE_FORMAT_LOCALE dateFormat = self.prefsDict["presentDateFormat"] if dateFormat == messages.DATE_FORMAT_LOCALE: indexdate = DATE_FORMAT_LOCALE elif dateFormat == messages.DATE_FORMAT_NUMBERS_DM: indexdate = DATE_FORMAT_NUMBERS_DM elif dateFormat == messages.DATE_FORMAT_NUMBERS_MD: indexdate = DATE_FORMAT_NUMBERS_MD elif dateFormat == messages.DATE_FORMAT_NUMBERS_DMY: indexdate = DATE_FORMAT_NUMBERS_DMY elif dateFormat == messages.DATE_FORMAT_NUMBERS_MDY: indexdate = DATE_FORMAT_NUMBERS_MDY elif dateFormat == messages.DATE_FORMAT_NUMBERS_YMD: indexdate = DATE_FORMAT_NUMBERS_YMD elif dateFormat == messages.DATE_FORMAT_FULL_DM: indexdate = DATE_FORMAT_FULL_DM elif dateFormat == messages.DATE_FORMAT_FULL_MD: indexdate = DATE_FORMAT_FULL_MD elif dateFormat == messages.DATE_FORMAT_FULL_DMY: indexdate = DATE_FORMAT_FULL_DMY elif dateFormat == messages.DATE_FORMAT_FULL_MDY: indexdate = DATE_FORMAT_FULL_MDY elif dateFormat == messages.DATE_FORMAT_FULL_YMD: indexdate = DATE_FORMAT_FULL_YMD elif dateFormat == messages.DATE_FORMAT_ABBREVIATED_DM: indexdate = DATE_FORMAT_ABBREVIATED_DM elif dateFormat == messages.DATE_FORMAT_ABBREVIATED_MD: indexdate = DATE_FORMAT_ABBREVIATED_MD elif dateFormat == messages.DATE_FORMAT_ABBREVIATED_DMY: indexdate = DATE_FORMAT_ABBREVIATED_DMY elif dateFormat == messages.DATE_FORMAT_ABBREVIATED_MDY: indexdate = DATE_FORMAT_ABBREVIATED_MDY elif dateFormat == messages.DATE_FORMAT_ABBREVIATED_YMD: indexdate = DATE_FORMAT_ABBREVIATED_YMD combobox2.set_active (indexdate) combobox3 = self.get_widget("timeFormatCombo") self.populateComboBox(combobox3, [sdtime(messages.TIME_FORMAT_LOCALE, ltime()), sdtime(messages.TIME_FORMAT_12_HM, ltime()), sdtime(messages.TIME_FORMAT_12_HMS, ltime()), sdtime(messages.TIME_FORMAT_24_HMS, ltime()), sdtime(messages.TIME_FORMAT_24_HMS_WITH_WORDS, ltime()), sdtime(messages.TIME_FORMAT_24_HM, ltime()), sdtime(messages.TIME_FORMAT_24_HM_WITH_WORDS, ltime())]) indextime = TIME_FORMAT_LOCALE timeFormat = self.prefsDict["presentTimeFormat"] if timeFormat == messages.TIME_FORMAT_LOCALE: indextime = TIME_FORMAT_LOCALE elif timeFormat == messages.TIME_FORMAT_12_HM: indextime = TIME_FORMAT_12_HM elif timeFormat == messages.TIME_FORMAT_12_HMS: indextime = TIME_FORMAT_12_HMS elif timeFormat == messages.TIME_FORMAT_24_HMS: indextime = TIME_FORMAT_24_HMS elif timeFormat == messages.TIME_FORMAT_24_HMS_WITH_WORDS: indextime = TIME_FORMAT_24_HMS_WITH_WORDS elif timeFormat == messages.TIME_FORMAT_24_HM: indextime = TIME_FORMAT_24_HM elif timeFormat == messages.TIME_FORMAT_24_HM_WITH_WORDS: indextime = TIME_FORMAT_24_HM_WITH_WORDS combobox3.set_active (indextime) self.get_widget("speakProgressBarUpdatesCheckButton").set_active( prefs.get("speakProgressBarUpdates", settings.speakProgressBarUpdates)) self.get_widget("brailleProgressBarUpdatesCheckButton").set_active( prefs.get("brailleProgressBarUpdates", settings.brailleProgressBarUpdates)) self.get_widget("beepProgressBarUpdatesCheckButton").set_active( prefs.get("beepProgressBarUpdates", settings.beepProgressBarUpdates)) interval = prefs["progressBarUpdateInterval"] self.get_widget("progressBarUpdateIntervalSpinButton").set_value(interval) comboBox = self.get_widget("progressBarVerbosity") levels = [guilabels.PROGRESS_BAR_ALL, guilabels.PROGRESS_BAR_APPLICATION, guilabels.PROGRESS_BAR_WINDOW] self.populateComboBox(comboBox, levels) comboBox.set_active(prefs["progressBarVerbosity"]) enable = prefs["enableMouseReview"] self.get_widget("enableMouseReviewCheckButton").set_active(enable) # Braille pane. # self.get_widget("enableBrailleCheckButton").set_active( \ prefs["enableBraille"]) state = prefs["brailleRolenameStyle"] == \ settings.BRAILLE_ROLENAME_STYLE_SHORT self.get_widget("abbrevRolenames").set_active(state) self.get_widget("disableBrailleEOLCheckButton").set_active( prefs["disableBrailleEOL"]) if louis is None: self.get_widget( \ "contractedBrailleCheckButton").set_sensitive(False) else: self.get_widget("contractedBrailleCheckButton").set_active( \ prefs["enableContractedBraille"]) # Set up contraction table combo box and set it to the # currently used one. # tablesCombo = self.get_widget("contractionTableCombo") tableDict = braille.listTables() selectedTableIter = None selectedTable = prefs["brailleContractionTable"] or \ braille.getDefaultTable() if tableDict: tablesModel = Gtk.ListStore(str, str) names = sorted(tableDict.keys()) for name in names: fname = tableDict[name] it = tablesModel.append([name, fname]) if os.path.join(braille.tablesdir, fname) == \ selectedTable: selectedTableIter = it cell = self.planeCellRendererText tablesCombo.clear() tablesCombo.pack_start(cell, True) tablesCombo.add_attribute(cell, 'text', 0) tablesCombo.set_model(tablesModel) if selectedTableIter: tablesCombo.set_active_iter(selectedTableIter) else: tablesCombo.set_active(0) else: tablesCombo.set_sensitive(False) if prefs["brailleVerbosityLevel"] == settings.VERBOSITY_LEVEL_BRIEF: self.get_widget("brailleBriefButton").set_active(True) else: self.get_widget("brailleVerboseButton").set_active(True) self.get_widget("enableBrailleWordWrapCheckButton").set_active( prefs.get("enableBrailleWordWrap", settings.enableBrailleWordWrap)) selectionIndicator = prefs["brailleSelectorIndicator"] if selectionIndicator == settings.BRAILLE_UNDERLINE_7: self.get_widget("brailleSelection7Button").set_active(True) elif selectionIndicator == settings.BRAILLE_UNDERLINE_8: self.get_widget("brailleSelection8Button").set_active(True) elif selectionIndicator == settings.BRAILLE_UNDERLINE_BOTH: self.get_widget("brailleSelectionBothButton").set_active(True) else: self.get_widget("brailleSelectionNoneButton").set_active(True) linkIndicator = prefs["brailleLinkIndicator"] if linkIndicator == settings.BRAILLE_UNDERLINE_7: self.get_widget("brailleLink7Button").set_active(True) elif linkIndicator == settings.BRAILLE_UNDERLINE_8: self.get_widget("brailleLink8Button").set_active(True) elif linkIndicator == settings.BRAILLE_UNDERLINE_BOTH: self.get_widget("brailleLinkBothButton").set_active(True) else: self.get_widget("brailleLinkNoneButton").set_active(True) enable = prefs.get("enableFlashMessages", settings.enableFlashMessages) self.get_widget("enableFlashMessagesCheckButton").set_active(enable) enable = prefs.get("flashIsPersistent", settings.flashIsPersistent) self.get_widget("flashIsPersistentCheckButton").set_active(enable) enable = prefs.get("flashIsDetailed", settings.flashIsDetailed) self.get_widget("flashIsDetailedCheckButton").set_active(enable) duration = prefs["brailleFlashTime"] self.get_widget("brailleFlashTimeSpinButton").set_value(duration / 1000) # Key Echo pane. # self.get_widget("keyEchoCheckButton").set_active( \ prefs["enableKeyEcho"]) self.get_widget("enableAlphabeticKeysCheckButton").set_active( prefs.get("enableAlphabeticKeys", settings.enableAlphabeticKeys)) self.get_widget("enableNumericKeysCheckButton").set_active( prefs.get("enableNumericKeys", settings.enableNumericKeys)) self.get_widget("enablePunctuationKeysCheckButton").set_active( prefs.get("enablePunctuationKeys", settings.enablePunctuationKeys)) self.get_widget("enableSpaceCheckButton").set_active( prefs.get("enableSpace", settings.enableSpace)) self.get_widget("enableModifierKeysCheckButton").set_active( \ prefs["enableModifierKeys"]) self.get_widget("enableFunctionKeysCheckButton").set_active( \ prefs["enableFunctionKeys"]) self.get_widget("enableActionKeysCheckButton").set_active( \ prefs["enableActionKeys"]) self.get_widget("enableNavigationKeysCheckButton").set_active( \ prefs["enableNavigationKeys"]) self.get_widget("enableDiacriticalKeysCheckButton").set_active( \ prefs["enableDiacriticalKeys"]) self.get_widget("enableEchoByCharacterCheckButton").set_active( \ prefs["enableEchoByCharacter"]) self.get_widget("enableEchoByWordCheckButton").set_active( \ prefs["enableEchoByWord"]) self.get_widget("enableEchoBySentenceCheckButton").set_active( \ prefs["enableEchoBySentence"]) # Text attributes pane. # self._createTextAttributesTreeView() brailleIndicator = prefs["textAttributesBrailleIndicator"] if brailleIndicator == settings.BRAILLE_UNDERLINE_7: self.get_widget("textBraille7Button").set_active(True) elif brailleIndicator == settings.BRAILLE_UNDERLINE_8: self.get_widget("textBraille8Button").set_active(True) elif brailleIndicator == settings.BRAILLE_UNDERLINE_BOTH: self.get_widget("textBrailleBothButton").set_active(True) else: self.get_widget("textBrailleNoneButton").set_active(True) # Pronunciation dictionary pane. # self._createPronunciationTreeView() # General pane. # self.get_widget("presentToolTipsCheckButton").set_active( prefs["presentToolTips"]) if prefs["keyboardLayout"] == settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP: self.get_widget("generalDesktopButton").set_active(True) else: self.get_widget("generalLaptopButton").set_active(True) combobox = self.get_widget("sayAllStyle") self.populateComboBox(combobox, [guilabels.SAY_ALL_STYLE_LINE, guilabels.SAY_ALL_STYLE_SENTENCE]) combobox.set_active(prefs["sayAllStyle"]) self.get_widget("rewindAndFastForwardInSayAllCheckButton").set_active( prefs.get("rewindAndFastForwardInSayAll", settings.rewindAndFastForwardInSayAll)) self.get_widget("structNavInSayAllCheckButton").set_active( prefs.get("structNavInSayAll", settings.structNavInSayAll)) self.get_widget("sayAllContextBlockquoteCheckButton").set_active( prefs.get("sayAllContextBlockquote", settings.sayAllContextBlockquote)) self.get_widget("sayAllContextLandmarkCheckButton").set_active( prefs.get("sayAllContextLandmark", settings.sayAllContextLandmark)) self.get_widget("sayAllContextNonLandmarkFormCheckButton").set_active( prefs.get("sayAllContextNonLandmarkForm", settings.sayAllContextNonLandmarkForm)) self.get_widget("sayAllContextListCheckButton").set_active( prefs.get("sayAllContextList", settings.sayAllContextList)) self.get_widget("sayAllContextPanelCheckButton").set_active( prefs.get("sayAllContextPanel", settings.sayAllContextPanel)) self.get_widget("sayAllContextTableCheckButton").set_active( prefs.get("sayAllContextTable", settings.sayAllContextTable)) # Orca User Profiles # self.profilesCombo = self.get_widget('availableProfilesComboBox1') self.startingProfileCombo = self.get_widget('availableProfilesComboBox2') self.profilesComboModel = self.get_widget('model9') self.__initProfileCombo() if self.script.app: self.get_widget('profilesFrame').set_sensitive(False) def __initProfileCombo(self): """Adding available profiles and setting active as the active one""" availableProfiles = self.__getAvailableProfiles() self.profilesComboModel.clear() if not len(availableProfiles): self.profilesComboModel.append(self._defaultProfile) else: for profile in availableProfiles: self.profilesComboModel.append(profile) activeProfile = self.prefsDict.get('activeProfile') or self._defaultProfile startingProfile = self.prefsDict.get('startingProfile') or self._defaultProfile activeProfileIter = self.getComboBoxIndex(self.profilesCombo, activeProfile[0]) startingProfileIter = self.getComboBoxIndex(self.startingProfileCombo, startingProfile[0]) self.profilesCombo.set_active(activeProfileIter) self.startingProfileCombo.set_active(startingProfileIter) def __getAvailableProfiles(self): """Get available user profiles.""" return _settingsManager.availableProfiles() def _updateOrcaModifier(self): combobox = self.get_widget("orcaModifierComboBox") keystring = ", ".join(self.prefsDict["orcaModifierKeys"]) combobox.set_active(self.getComboBoxIndex(combobox, keystring)) def populateComboBox(self, combobox, items): """Populates the combobox with the items provided. Arguments: - combobox: the GtkComboBox to populate - items: the list of strings with which to populate it """ model = Gtk.ListStore(str) for item in items: model.append([item]) combobox.set_model(model) def getComboBoxIndex(self, combobox, searchStr, col=0): """ For each of the entries in the given combo box, look for searchStr. Return the index of the entry if searchStr is found. Arguments: - combobox: the GtkComboBox to search. - searchStr: the string to search for. Returns the index of the first entry in combobox with searchStr, or 0 if not found. """ model = combobox.get_model() myiter = model.get_iter_first() for i in range(0, len(model)): name = model.get_value(myiter, col) if name == searchStr: return i myiter = model.iter_next(myiter) return 0 def getComboBoxList(self, combobox): """Get the list of values from the active combox """ active = combobox.get_active() model = combobox.get_model() activeIter = model.get_iter(active) activeLabel = model.get_value(activeIter, 0) activeName = model.get_value(activeIter, 1) return [activeLabel, activeName] def getKeyBindingsModelDict(self, model, modifiedOnly=True): modelDict = {} node = model.get_iter_first() while node: child = model.iter_children(node) while child: key, modified = model.get(child, HANDLER, MODIF) if modified or not modifiedOnly: value = [] value.append(list(model.get( child, KEY1, MOD_MASK1, MOD_USED1, CLICK_COUNT1))) modelDict[key] = value child = model.iter_next(child) node = model.iter_next(node) return modelDict def getModelDict(self, model): """Get the list of values from a list[str,str] model """ pronunciation_dict.pronunciation_dict = {} currentIter = model.get_iter_first() while currentIter is not None: key, value = model.get(currentIter, ACTUAL, REPLACEMENT) if key and value: pronunciation_dict.setPronunciation(key, value) currentIter = model.iter_next(currentIter) modelDict = pronunciation_dict.pronunciation_dict return modelDict def showGUI(self): """Show the Orca configuration GUI window. This assumes that the GUI has already been created. """ orcaSetupWindow = self.get_widget("orcaSetupWindow") accelGroup = Gtk.AccelGroup() orcaSetupWindow.add_accel_group(accelGroup) helpButton = self.get_widget("helpButton") (keyVal, modifierMask) = Gtk.accelerator_parse("F1") helpButton.add_accelerator("clicked", accelGroup, keyVal, modifierMask, 0) try: ts = orca_state.lastInputEvent.timestamp except: ts = 0 if ts == 0: ts = Gtk.get_current_event_time() orcaSetupWindow.present_with_time(ts) # We always want to re-order the text attributes page so that enabled # items are consistently at the top. # self._setSpokenTextAttributes( self.getTextAttributesView, _settingsManager.getSetting('enabledSpokenTextAttributes'), True, True) if self.script.app: title = guilabels.PREFERENCES_APPLICATION_TITLE % self.script.app.name orcaSetupWindow.set_title(title) orcaSetupWindow.show() def _initComboBox(self, combobox): """Initialize the given combo box to take a list of int/str pairs. Arguments: - combobox: the GtkComboBox to initialize. """ cell = Gtk.CellRendererText() combobox.pack_start(cell, True) # We only want to display one column; not two. # try: columnToDisplay = combobox.get_cells()[0] combobox.add_attribute(columnToDisplay, 'text', 1) except: combobox.add_attribute(cell, 'text', 1) model = Gtk.ListStore(int, str) combobox.set_model(model) # Force the display comboboxes to be left aligned. # if isinstance(combobox, Gtk.ComboBoxText): size = combobox.size_request() cell.set_fixed_size(size[0] - 29, -1) return model def _setKeyEchoItems(self): """[In]sensitize the checkboxes for the various types of key echo, depending upon whether the value of the key echo check button is set. """ enable = self.get_widget("keyEchoCheckButton").get_active() self.get_widget("enableAlphabeticKeysCheckButton").set_sensitive(enable) self.get_widget("enableNumericKeysCheckButton").set_sensitive(enable) self.get_widget("enablePunctuationKeysCheckButton").set_sensitive(enable) self.get_widget("enableSpaceCheckButton").set_sensitive(enable) self.get_widget("enableModifierKeysCheckButton").set_sensitive(enable) self.get_widget("enableFunctionKeysCheckButton").set_sensitive(enable) self.get_widget("enableActionKeysCheckButton").set_sensitive(enable) self.get_widget("enableNavigationKeysCheckButton").set_sensitive(enable) self.get_widget("enableDiacriticalKeysCheckButton").set_sensitive( \ enable) def _presentMessage(self, text, interrupt=False): """If the text field is not None, presents the given text, optionally interrupting anything currently being spoken. Arguments: - text: the text to present - interrupt: if True, interrupt any speech currently being spoken """ self.script.speakMessage(text, interrupt=interrupt) try: self.script.displayBrailleMessage(text, flashTime=-1) except: pass def _createNode(self, appName): """Create a new root node in the TreeStore model with the name of the application. Arguments: - appName: the name of the TreeStore Node (the same of the application) """ model = self.keyBindingsModel myiter = model.append(None) model.set_value(myiter, DESCRIP, appName) model.set_value(myiter, MODIF, False) return myiter def _getIterOf(self, appName): """Returns the Gtk.TreeIter of the TreeStore model that matches the application name passed as argument Arguments: - appName: a string with the name of the application of the node wanted it's the same that the field DESCRIP of the model treeStore """ model = self.keyBindingsModel for row in model: if ((model.iter_depth(row.iter) == 0) \ and (row[DESCRIP] == appName)): return row.iter return None def _clickCountToString(self, clickCount): """Given a numeric clickCount, returns a string for inclusion in the list of keybindings. Argument: - clickCount: the number of clicks associated with the keybinding. """ clickCountString = "" if clickCount == 2: clickCountString = " (%s)" % guilabels.CLICK_COUNT_DOUBLE elif clickCount == 3: clickCountString = " (%s)" % guilabels.CLICK_COUNT_TRIPLE return clickCountString def _insertRow(self, handl, kb, parent=None, modif=False): """Appends a new row with the new keybinding data to the treeview Arguments: - handl: the name of the handler associated to the keyBinding - kb: the new keybinding. - parent: the parent node of the treeview, where to append the kb - modif: whether to check the modified field or not. Returns a Gtk.TreeIter pointing at the new row. """ model = self.keyBindingsModel if parent is None: parent = self._getIterOf(guilabels.KB_GROUP_DEFAULT) if parent is not None: myiter = model.append(parent) if not kb.keysymstring: text = None else: clickCount = self._clickCountToString(kb.click_count) modifierNames = keybindings.getModifierNames(kb.modifiers) keysymstring = kb.keysymstring text = keybindings.getModifierNames(kb.modifiers) \ + keysymstring \ + clickCount model.set_value(myiter, HANDLER, handl) model.set_value(myiter, DESCRIP, kb.handler.description) model.set_value(myiter, MOD_MASK1, str(kb.modifier_mask)) model.set_value(myiter, MOD_USED1, str(kb.modifiers)) model.set_value(myiter, KEY1, kb.keysymstring) model.set_value(myiter, CLICK_COUNT1, str(kb.click_count)) if text is not None: model.set_value(myiter, OLDTEXT1, text) model.set_value(myiter, TEXT1, text) model.set_value(myiter, MODIF, modif) model.set_value(myiter, EDITABLE, True) return myiter else: return None def _insertRowBraille(self, handl, com, inputEvHand, parent=None, modif=False): """Appends a new row with the new braille binding data to the treeview Arguments: - handl: the name of the handler associated to the brailleBinding - com: the BrlTTY command - inputEvHand: the inputEventHandler with the new brailleBinding - parent: the parent node of the treeview, where to append the kb - modif: whether to check the modified field or not. Returns a Gtk.TreeIter pointing at the new row. """ model = self.keyBindingsModel if parent is None: parent = self._getIterOf(guilabels.KB_GROUP_BRAILLE) if parent is not None: myiter = model.append(parent) model.set_value(myiter, HANDLER, handl) model.set_value(myiter, DESCRIP, inputEvHand.description) model.set_value(myiter, KEY1, str(com)) model.set_value(myiter, TEXT1, braille.command_name[com]) model.set_value(myiter, MODIF, modif) model.set_value(myiter, EDITABLE, False) return myiter else: return None def _markModified(self): """ Mark as modified the user custom key bindings: """ try: self.script.setupInputEventHandlers() keyBinds = keybindings.KeyBindings() keyBinds = _settingsManager.overrideKeyBindings(self.script, keyBinds) keyBind = keybindings.KeyBinding(None, None, None, None) treeModel = self.keyBindingsModel myiter = treeModel.get_iter_first() while myiter is not None: iterChild = treeModel.iter_children(myiter) while iterChild is not None: descrip = treeModel.get_value(iterChild, DESCRIP) keyBind.handler = \ input_event.InputEventHandler(None, descrip) if keyBinds.hasKeyBinding(keyBind, typeOfSearch="description"): treeModel.set_value(iterChild, MODIF, True) iterChild = treeModel.iter_next(iterChild) myiter = treeModel.iter_next(myiter) except: debug.printException(debug.LEVEL_SEVERE) def _populateKeyBindings(self, clearModel=True): """Fills the TreeView with the list of Orca keybindings Arguments: - clearModel: if True, initially clear out the key bindings model. """ self.keyBindView.set_model(None) self.keyBindView.set_headers_visible(False) self.keyBindView.hide() if clearModel: self.keyBindingsModel.clear() self.kbindings = None try: appName = self.script.app.name except: appName = "" iterApp = self._createNode(appName) iterOrca = self._createNode(guilabels.KB_GROUP_DEFAULT) iterUnbound = self._createNode(guilabels.KB_GROUP_UNBOUND) if not self.kbindings: self.kbindings = keybindings.KeyBindings() self.script.setupInputEventHandlers() allKeyBindings = self.script.getKeyBindings() defKeyBindings = self.script.getDefaultKeyBindings() for kb in allKeyBindings.keyBindings: if not self.kbindings.hasKeyBinding(kb, "strict"): handl = self.script.getInputEventHandlerKey(kb.handler) if not defKeyBindings.hasKeyBinding(kb, "description"): self._insertRow(handl, kb, iterApp) elif kb.keysymstring: self._insertRow(handl, kb, iterOrca) else: self._insertRow(handl, kb, iterUnbound) self.kbindings.add(kb) if not self.keyBindingsModel.iter_has_child(iterApp): self.keyBindingsModel.remove(iterApp) if not self.keyBindingsModel.iter_has_child(iterUnbound): self.keyBindingsModel.remove(iterUnbound) self._updateOrcaModifier() self._markModified() iterBB = self._createNode(guilabels.KB_GROUP_BRAILLE) self.bbindings = self.script.getBrailleBindings() for com, inputEvHand in self.bbindings.items(): handl = self.script.getInputEventHandlerKey(inputEvHand) self._insertRowBraille(handl, com, inputEvHand, iterBB) self.keyBindView.set_model(self.keyBindingsModel) self.keyBindView.set_headers_visible(True) self.keyBindView.expand_all() self.keyBindingsModel.set_sort_column_id(OLDTEXT1, Gtk.SortType.ASCENDING) self.keyBindView.show() # Keep track of new/unbound keybindings that have yet to be applied. # self.pendingKeyBindings = {} def _cleanupSpeechServers(self): """Remove unwanted factories and drivers for the current active factory, when the user dismisses the Orca Preferences dialog.""" for workingFactory in self.workingFactories: if not (workingFactory == self.speechSystemsChoice): workingFactory.SpeechServer.shutdownActiveServers() else: servers = workingFactory.SpeechServer.getSpeechServers() for server in servers: if not (server == self.speechServersChoice): server.shutdown() def speechSupportChecked(self, widget): """Signal handler for the "toggled" signal for the speechSupportCheckButton GtkCheckButton widget. The user has [un]checked the 'Enable Speech' checkbox. Set the 'enableSpeech' preference to the new value. Set the rest of the speech pane items [in]sensensitive depending upon whether this checkbox is checked. Arguments: - widget: the component that generated the signal. """ enable = widget.get_active() self.prefsDict["enableSpeech"] = enable self.get_widget("speechOptionsGrid").set_sensitive(enable) def onlySpeakDisplayedTextToggled(self, widget): """Signal handler for the "toggled" signal for the GtkCheckButton onlySpeakDisplayedText. In addition to updating the preferences, set the sensitivity of the contextOptionsGrid. Arguments: - widget: the component that generated the signal. """ enable = widget.get_active() self.prefsDict["onlySpeakDisplayedText"] = enable self.get_widget("contextOptionsGrid").set_sensitive(not enable) def speechSystemsChanged(self, widget): """Signal handler for the "changed" signal for the speechSystems GtkComboBox widget. The user has selected a different speech system. Clear the existing list of speech servers, and setup a new list of speech servers based on the new choice. Setup a new list of voices for the first speech server in the list. Arguments: - widget: the component that generated the signal. """ if self.initializingSpeech: return selectedIndex = widget.get_active() self.speechSystemsChoice = self.speechSystemsChoices[selectedIndex] self._setupSpeechServers() def speechServersChanged(self, widget): """Signal handler for the "changed" signal for the speechServers GtkComboBox widget. The user has selected a different speech server. Clear the existing list of voices, and setup a new list of voices based on the new choice. Arguments: - widget: the component that generated the signal. """ if self.initializingSpeech: return selectedIndex = widget.get_active() self.speechServersChoice = self.speechServersChoices[selectedIndex] # Whenever the speech servers change, we need to make sure we # clear whatever family was in use by the current voice types. # Otherwise, we can end up with family names from one server # bleeding over (e.g., "Paul" from Fonix ends up getting in # the "Default" voice type after we switch to eSpeak). # try: del self.defaultVoice[acss.ACSS.FAMILY] del self.uppercaseVoice[acss.ACSS.FAMILY] del self.hyperlinkVoice[acss.ACSS.FAMILY] del self.systemVoice[acss.ACSS.FAMILY] except: pass self._setupVoices() def speechLanguagesChanged(self, widget): """Signal handler for the "value_changed" signal for the languages GtkComboBox widget. The user has selected a different voice language. Save the new voice language name based on the new choice. Arguments: - widget: the component that generated the signal. """ if self.initializingSpeech: return selectedIndex = widget.get_active() try: self.speechLanguagesChoice = self.speechLanguagesChoices[selectedIndex] if (self.speechServersChoice, self.speechLanguagesChoice) in \ self.selectedFamilyChoices: i = self.selectedFamilyChoices[self.speechServersChoice, \ self.speechLanguagesChoice] family = self.speechFamiliesChoices[i] name = family[speechserver.VoiceFamily.NAME] language = family[speechserver.VoiceFamily.LANG] dialect = family[speechserver.VoiceFamily.DIALECT] variant = family[speechserver.VoiceFamily.VARIANT] voiceType = self.get_widget("voiceTypesCombo").get_active() self._setFamilyNameForVoiceType(voiceType, name, language, dialect, variant) except: debug.printException(debug.LEVEL_SEVERE) # Remember the last family manually selected by the user for the # current speech server. # if not selectedIndex == -1: self.selectedLanguageChoices[self.speechServersChoice] = selectedIndex self._setupFamilies() def speechFamiliesChanged(self, widget): """Signal handler for the "value_changed" signal for the families GtkComboBox widget. The user has selected a different voice family. Save the new voice family name based on the new choice. Arguments: - widget: the component that generated the signal. """ if self.initializingSpeech: return selectedIndex = widget.get_active() try: family = self.speechFamiliesChoices[selectedIndex] name = family[speechserver.VoiceFamily.NAME] language = family[speechserver.VoiceFamily.LANG] dialect = family[speechserver.VoiceFamily.DIALECT] variant = family[speechserver.VoiceFamily.VARIANT] voiceType = self.get_widget("voiceTypesCombo").get_active() self._setFamilyNameForVoiceType(voiceType, name, language, dialect, variant) except: debug.printException(debug.LEVEL_SEVERE) # Remember the last family manually selected by the user for the # current speech server. # if not selectedIndex == -1: self.selectedFamilyChoices[self.speechServersChoice, \ self.speechLanguagesChoice] = selectedIndex def voiceTypesChanged(self, widget): """Signal handler for the "changed" signal for the voiceTypes GtkComboBox widget. The user has selected a different voice type. Setup the new family, rate, pitch and volume component values based on the new choice. Arguments: - widget: the component that generated the signal. """ if self.initializingSpeech: return voiceType = widget.get_active() self._setVoiceSettingsForVoiceType(voiceType) def rateValueChanged(self, widget): """Signal handler for the "value_changed" signal for the rateScale GtkScale widget. The user has changed the current rate value. Save the new rate value based on the currently selected voice type. Arguments: - widget: the component that generated the signal. """ rate = widget.get_value() voiceType = self.get_widget("voiceTypesCombo").get_active() self._setRateForVoiceType(voiceType, rate) voices = _settingsManager.getSetting('voices') voices[settings.DEFAULT_VOICE][acss.ACSS.RATE] = rate _settingsManager.setSetting('voices', voices) def pitchValueChanged(self, widget): """Signal handler for the "value_changed" signal for the pitchScale GtkScale widget. The user has changed the current pitch value. Save the new pitch value based on the currently selected voice type. Arguments: - widget: the component that generated the signal. """ pitch = widget.get_value() voiceType = self.get_widget("voiceTypesCombo").get_active() self._setPitchForVoiceType(voiceType, pitch) voices = _settingsManager.getSetting('voices') voices[settings.DEFAULT_VOICE][acss.ACSS.AVERAGE_PITCH] = pitch _settingsManager.setSetting('voices', voices) def volumeValueChanged(self, widget): """Signal handler for the "value_changed" signal for the voiceScale GtkScale widget. The user has changed the current volume value. Save the new volume value based on the currently selected voice type. Arguments: - widget: the component that generated the signal. """ volume = widget.get_value() voiceType = self.get_widget("voiceTypesCombo").get_active() self._setVolumeForVoiceType(voiceType, volume) voices = _settingsManager.getSetting('voices') voices[settings.DEFAULT_VOICE][acss.ACSS.GAIN] = volume _settingsManager.setSetting('voices', voices) def checkButtonToggled(self, widget): """Signal handler for "toggled" signal for basic GtkCheckButton widgets. The user has altered the state of the checkbox. Set the preference to the new value. Arguments: - widget: the component that generated the signal. """ # To use this default handler please make sure: # The name of the setting that will be changed is: settingName # The id of the widget in the ui should be: settingNameCheckButton # settingName = Gtk.Buildable.get_name(widget) # strip "CheckButton" from the end. settingName = settingName[:-11] self.prefsDict[settingName] = widget.get_active() def keyEchoChecked(self, widget): """Signal handler for the "toggled" signal for the keyEchoCheckbutton GtkCheckButton widget. The user has [un]checked the 'Enable Key Echo' checkbox. Set the 'enableKeyEcho' preference to the new value. [In]sensitize the checkboxes for the various types of key echo, depending upon whether this value is checked or unchecked. Arguments: - widget: the component that generated the signal. """ self.prefsDict["enableKeyEcho"] = widget.get_active() self._setKeyEchoItems() def brailleSelectionChanged(self, widget): """Signal handler for the "toggled" signal for the brailleSelectionNoneButton, brailleSelection7Button, brailleSelection8Button or brailleSelectionBothButton GtkRadioButton widgets. The user has toggled the braille selection indicator value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'brailleSelectorIndicator' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.BRAILLE_DOT_7: self.prefsDict["brailleSelectorIndicator"] = \ settings.BRAILLE_UNDERLINE_7 elif widget.get_label() == guilabels.BRAILLE_DOT_8: self.prefsDict["brailleSelectorIndicator"] = \ settings.BRAILLE_UNDERLINE_8 elif widget.get_label() == guilabels.BRAILLE_DOT_7_8: self.prefsDict["brailleSelectorIndicator"] = \ settings.BRAILLE_UNDERLINE_BOTH else: self.prefsDict["brailleSelectorIndicator"] = \ settings.BRAILLE_UNDERLINE_NONE def brailleLinkChanged(self, widget): """Signal handler for the "toggled" signal for the brailleLinkNoneButton, brailleLink7Button, brailleLink8Button or brailleLinkBothButton GtkRadioButton widgets. The user has toggled the braille link indicator value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'brailleLinkIndicator' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.BRAILLE_DOT_7: self.prefsDict["brailleLinkIndicator"] = \ settings.BRAILLE_UNDERLINE_7 elif widget.get_label() == guilabels.BRAILLE_DOT_8: self.prefsDict["brailleLinkIndicator"] = \ settings.BRAILLE_UNDERLINE_8 elif widget.get_label() == guilabels.BRAILLE_DOT_7_8: self.prefsDict["brailleLinkIndicator"] = \ settings.BRAILLE_UNDERLINE_BOTH else: self.prefsDict["brailleLinkIndicator"] = \ settings.BRAILLE_UNDERLINE_NONE def brailleIndicatorChanged(self, widget): """Signal handler for the "toggled" signal for the textBrailleNoneButton, textBraille7Button, textBraille8Button or textBrailleBothButton GtkRadioButton widgets. The user has toggled the text attributes braille indicator value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'textAttributesBrailleIndicator' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.BRAILLE_DOT_7: self.prefsDict["textAttributesBrailleIndicator"] = \ settings.BRAILLE_UNDERLINE_7 elif widget.get_label() == guilabels.BRAILLE_DOT_8: self.prefsDict["textAttributesBrailleIndicator"] = \ settings.BRAILLE_UNDERLINE_8 elif widget.get_label() == guilabels.BRAILLE_DOT_7_8: self.prefsDict["textAttributesBrailleIndicator"] = \ settings.BRAILLE_UNDERLINE_BOTH else: self.prefsDict["textAttributesBrailleIndicator"] = \ settings.BRAILLE_UNDERLINE_NONE def punctuationLevelChanged(self, widget): """Signal handler for the "toggled" signal for the noneButton, someButton or allButton GtkRadioButton widgets. The user has toggled the speech punctuation level value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'verbalizePunctuationStyle' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.PUNCTUATION_STYLE_NONE: self.prefsDict["verbalizePunctuationStyle"] = \ settings.PUNCTUATION_STYLE_NONE elif widget.get_label() == guilabels.PUNCTUATION_STYLE_SOME: self.prefsDict["verbalizePunctuationStyle"] = \ settings.PUNCTUATION_STYLE_SOME elif widget.get_label() == guilabels.PUNCTUATION_STYLE_MOST: self.prefsDict["verbalizePunctuationStyle"] = \ settings.PUNCTUATION_STYLE_MOST else: self.prefsDict["verbalizePunctuationStyle"] = \ settings.PUNCTUATION_STYLE_ALL def orcaModifierChanged(self, widget): """Signal handler for the changed signal for the orcaModifierComboBox Set the 'orcaModifierKeys' preference to the new value. Arguments: - widget: the component that generated the signal. """ model = widget.get_model() myIter = widget.get_active_iter() orcaModifier = model[myIter][0] self.prefsDict["orcaModifierKeys"] = orcaModifier.split(', ') def progressBarVerbosityChanged(self, widget): """Signal handler for the changed signal for the progressBarVerbosity GtkComboBox widget. Set the 'progressBarVerbosity' preference to the new value. Arguments: - widget: the component that generated the signal. """ model = widget.get_model() myIter = widget.get_active_iter() progressBarVerbosity = model[myIter][0] if progressBarVerbosity == guilabels.PROGRESS_BAR_ALL: self.prefsDict["progressBarVerbosity"] = \ settings.PROGRESS_BAR_ALL elif progressBarVerbosity == guilabels.PROGRESS_BAR_WINDOW: self.prefsDict["progressBarVerbosity"] = \ settings.PROGRESS_BAR_WINDOW else: self.prefsDict["progressBarVerbosity"] = \ settings.PROGRESS_BAR_APPLICATION def capitalizationStyleChanged(self, widget): model = widget.get_model() myIter = widget.get_active_iter() capitalizationStyle = model[myIter][0] if capitalizationStyle == guilabels.CAPITALIZATION_STYLE_ICON: self.prefsDict["capitalizationStyle"] = settings.CAPITALIZATION_STYLE_ICON elif capitalizationStyle == guilabels.CAPITALIZATION_STYLE_SPELL: self.prefsDict["capitalizationStyle"] = settings.CAPITALIZATION_STYLE_SPELL else: self.prefsDict["capitalizationStyle"] = settings.CAPITALIZATION_STYLE_NONE speech.updateCapitalizationStyle() def sayAllStyleChanged(self, widget): """Signal handler for the "changed" signal for the sayAllStyle GtkComboBox widget. Set the 'sayAllStyle' preference to the new value. Arguments: - widget: the component that generated the signal. """ model = widget.get_model() myIter = widget.get_active_iter() sayAllStyle = model[myIter][0] if sayAllStyle == guilabels.SAY_ALL_STYLE_LINE: self.prefsDict["sayAllStyle"] = settings.SAYALL_STYLE_LINE elif sayAllStyle == guilabels.SAY_ALL_STYLE_SENTENCE: self.prefsDict["sayAllStyle"] = settings.SAYALL_STYLE_SENTENCE def dateFormatChanged(self, widget): """Signal handler for the "changed" signal for the dateFormat GtkComboBox widget. Set the 'dateFormat' preference to the new value. Arguments: - widget: the component that generated the signal. """ dateFormatCombo = widget.get_active() if dateFormatCombo == DATE_FORMAT_LOCALE: newFormat = messages.DATE_FORMAT_LOCALE elif dateFormatCombo == DATE_FORMAT_NUMBERS_DM: newFormat = messages.DATE_FORMAT_NUMBERS_DM elif dateFormatCombo == DATE_FORMAT_NUMBERS_MD: newFormat = messages.DATE_FORMAT_NUMBERS_MD elif dateFormatCombo == DATE_FORMAT_NUMBERS_DMY: newFormat = messages.DATE_FORMAT_NUMBERS_DMY elif dateFormatCombo == DATE_FORMAT_NUMBERS_MDY: newFormat = messages.DATE_FORMAT_NUMBERS_MDY elif dateFormatCombo == DATE_FORMAT_NUMBERS_YMD: newFormat = messages.DATE_FORMAT_NUMBERS_YMD elif dateFormatCombo == DATE_FORMAT_FULL_DM: newFormat = messages.DATE_FORMAT_FULL_DM elif dateFormatCombo == DATE_FORMAT_FULL_MD: newFormat = messages.DATE_FORMAT_FULL_MD elif dateFormatCombo == DATE_FORMAT_FULL_DMY: newFormat = messages.DATE_FORMAT_FULL_DMY elif dateFormatCombo == DATE_FORMAT_FULL_MDY: newFormat = messages.DATE_FORMAT_FULL_MDY elif dateFormatCombo == DATE_FORMAT_FULL_YMD: newFormat = messages.DATE_FORMAT_FULL_YMD elif dateFormatCombo == DATE_FORMAT_ABBREVIATED_DM: newFormat = messages.DATE_FORMAT_ABBREVIATED_DM elif dateFormatCombo == DATE_FORMAT_ABBREVIATED_MD: newFormat = messages.DATE_FORMAT_ABBREVIATED_MD elif dateFormatCombo == DATE_FORMAT_ABBREVIATED_DMY: newFormat = messages.DATE_FORMAT_ABBREVIATED_DMY elif dateFormatCombo == DATE_FORMAT_ABBREVIATED_MDY: newFormat = messages.DATE_FORMAT_ABBREVIATED_MDY elif dateFormatCombo == DATE_FORMAT_ABBREVIATED_YMD: newFormat = messages.DATE_FORMAT_ABBREVIATED_YMD self.prefsDict["presentDateFormat"] = newFormat def timeFormatChanged(self, widget): """Signal handler for the "changed" signal for the timeFormat GtkComboBox widget. Set the 'timeFormat' preference to the new value. Arguments: - widget: the component that generated the signal. """ timeFormatCombo = widget.get_active() if timeFormatCombo == TIME_FORMAT_LOCALE: newFormat = messages.TIME_FORMAT_LOCALE elif timeFormatCombo == TIME_FORMAT_12_HM: newFormat = messages.TIME_FORMAT_12_HM elif timeFormatCombo == TIME_FORMAT_12_HMS: newFormat = messages.TIME_FORMAT_12_HMS elif timeFormatCombo == TIME_FORMAT_24_HMS: newFormat = messages.TIME_FORMAT_24_HMS elif timeFormatCombo == TIME_FORMAT_24_HMS_WITH_WORDS: newFormat = messages.TIME_FORMAT_24_HMS_WITH_WORDS elif timeFormatCombo == TIME_FORMAT_24_HM: newFormat = messages.TIME_FORMAT_24_HM elif timeFormatCombo == TIME_FORMAT_24_HM_WITH_WORDS: newFormat = messages.TIME_FORMAT_24_HM_WITH_WORDS self.prefsDict["presentTimeFormat"] = newFormat def speechVerbosityChanged(self, widget): """Signal handler for the "toggled" signal for the speechBriefButton, or speechVerboseButton GtkRadioButton widgets. The user has toggled the speech verbosity level value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'speechVerbosityLevel' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.VERBOSITY_LEVEL_BRIEF: self.prefsDict["speechVerbosityLevel"] = \ settings.VERBOSITY_LEVEL_BRIEF else: self.prefsDict["speechVerbosityLevel"] = \ settings.VERBOSITY_LEVEL_VERBOSE def progressBarUpdateIntervalValueChanged(self, widget): """Signal handler for the "value_changed" signal for the progressBarUpdateIntervalSpinButton GtkSpinButton widget. Arguments: - widget: the component that generated the signal. """ self.prefsDict["progressBarUpdateInterval"] = widget.get_value_as_int() def brailleFlashTimeValueChanged(self, widget): self.prefsDict["brailleFlashTime"] = widget.get_value_as_int() * 1000 def abbrevRolenamesChecked(self, widget): """Signal handler for the "toggled" signal for the abbrevRolenames GtkCheckButton widget. The user has [un]checked the 'Abbreviated Rolenames' checkbox. Set the 'brailleRolenameStyle' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): self.prefsDict["brailleRolenameStyle"] = \ settings.BRAILLE_ROLENAME_STYLE_SHORT else: self.prefsDict["brailleRolenameStyle"] = \ settings.BRAILLE_ROLENAME_STYLE_LONG def brailleVerbosityChanged(self, widget): """Signal handler for the "toggled" signal for the brailleBriefButton, or brailleVerboseButton GtkRadioButton widgets. The user has toggled the braille verbosity level value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'brailleVerbosityLevel' preference to the new value. Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.VERBOSITY_LEVEL_BRIEF: self.prefsDict["brailleVerbosityLevel"] = \ settings.VERBOSITY_LEVEL_BRIEF else: self.prefsDict["brailleVerbosityLevel"] = \ settings.VERBOSITY_LEVEL_VERBOSE def keyModifiedToggle(self, cell, path, model, col): """When the user changes a checkbox field (boolean field)""" model[path][col] = not model[path][col] return def editingKey(self, cell, editable, path, treeModel): """Starts user input of a Key for a selected key binding""" self._presentMessage(messages.KB_ENTER_NEW_KEY) orca_state.capturingKeys = True editable.connect('key-press-event', self.kbKeyPressed) return def editingCanceledKey(self, editable): """Stops user input of a Key for a selected key binding""" orca_state.capturingKeys = False self._capturedKey = [] return def _processKeyCaptured(self, keyPressedEvent): """Called when a new key event arrives and we are capturing keys. (used for key bindings redefinition) """ # We want the keyname rather than the printable character. # If it's not on the keypad, get the name of the unshifted # character. (i.e. "1" instead of "!") # keycode = keyPressedEvent.hardware_keycode keymap = Gdk.Keymap.get_default() entries_for_keycode = keymap.get_entries_for_keycode(keycode) entries = entries_for_keycode[-1] eventString = Gdk.keyval_name(entries[0]) eventState = keyPressedEvent.state orcaMods = settings.orcaModifierKeys if eventString in orcaMods: self._capturedKey = ['', keybindings.ORCA_MODIFIER_MASK, 0] return False modifierKeys = ['Alt_L', 'Alt_R', 'Control_L', 'Control_R', 'Shift_L', 'Shift_R', 'Meta_L', 'Meta_R', 'Num_Lock', 'Caps_Lock', 'Shift_Lock'] if eventString in modifierKeys: return False eventState = eventState & Gtk.accelerator_get_default_mod_mask() if not self._capturedKey \ or eventString in ['Return', 'Escape']: self._capturedKey = [eventString, eventState, 1] return True string, modifiers, clickCount = self._capturedKey isOrcaModifier = modifiers & keybindings.ORCA_MODIFIER_MASK if isOrcaModifier: eventState |= keybindings.ORCA_MODIFIER_MASK self._capturedKey = [eventString, eventState, clickCount + 1] return True def kbKeyPressed(self, editable, event): """Special handler for the key_pressed events when editing the keybindings. This lets us control what gets inserted into the entry. """ keyProcessed = self._processKeyCaptured(event) if not keyProcessed: return True if not self._capturedKey: return False keyName, modifiers, clickCount = self._capturedKey if not keyName or keyName in ["Return", "Escape"]: return False isOrcaModifier = modifiers & keybindings.ORCA_MODIFIER_MASK if keyName in ["Delete", "BackSpace"] and not isOrcaModifier: editable.set_text("") self._presentMessage(messages.KB_DELETED) self._capturedKey = [] self.newBinding = None return True self.newBinding = keybindings.KeyBinding(keyName, keybindings.defaultModifierMask, modifiers, None, clickCount) modifierNames = keybindings.getModifierNames(modifiers) clickCountString = self._clickCountToString(clickCount) newString = modifierNames + keyName + clickCountString description = self.pendingKeyBindings.get(newString) if description is None: match = lambda x: x.keysymstring == keyName \ and x.modifiers == modifiers \ and x.click_count == clickCount \ and x.handler matches = list(filter(match, self.kbindings.keyBindings)) if matches: description = matches[0].handler.description if description: msg = messages.KB_ALREADY_BOUND % description delay = int(1000 * settings.doubleClickTimeout) GLib.timeout_add(delay, self._presentMessage, msg) else: msg = messages.KB_CAPTURED % newString editable.set_text(newString) self._presentMessage(msg) return True def editedKey(self, cell, path, new_text, treeModel, modMask, modUsed, key, click_count, text): """The user changed the key for a Keybinding: update the model of the treeview. """ orca_state.capturingKeys = False self._capturedKey = [] myiter = treeModel.get_iter_from_string(path) try: originalBinding = treeModel.get_value(myiter, text) except: originalBinding = '' modified = (originalBinding != new_text) try: string = self.newBinding.keysymstring mods = self.newBinding.modifiers clickCount = self.newBinding.click_count except: string = '' mods = 0 clickCount = 1 mods = mods & Gdk.ModifierType.MODIFIER_MASK if mods & (1 << pyatspi.MODIFIER_SHIFTLOCK) \ and mods & keybindings.ORCA_MODIFIER_MASK: mods ^= (1 << pyatspi.MODIFIER_SHIFTLOCK) treeModel.set(myiter, modMask, str(keybindings.defaultModifierMask), modUsed, str(int(mods)), key, string, text, new_text, click_count, str(clickCount), MODIF, modified) speech.stop() if new_text: message = messages.KB_CAPTURED_CONFIRMATION % new_text description = treeModel.get_value(myiter, DESCRIP) self.pendingKeyBindings[new_text] = description else: message = messages.KB_DELETED_CONFIRMATION if modified: self._presentMessage(message) self.pendingKeyBindings[originalBinding] = "" return def presentToolTipsChecked(self, widget): """Signal handler for the "toggled" signal for the presentToolTipsCheckButton GtkCheckButton widget. The user has [un]checked the 'Present ToolTips' checkbox. Set the 'presentToolTips' preference to the new value if the user can present tooltips. Arguments: - widget: the component that generated the signal. """ self.prefsDict["presentToolTips"] = widget.get_active() def keyboardLayoutChanged(self, widget): """Signal handler for the "toggled" signal for the generalDesktopButton, or generalLaptopButton GtkRadioButton widgets. The user has toggled the keyboard layout value. If this signal was generated as the result of a radio button getting selected (as opposed to a radio button losing the selection), set the 'keyboardLayout' preference to the new value. Also set the matching list of Orca modifier keys Arguments: - widget: the component that generated the signal. """ if widget.get_active(): if widget.get_label() == guilabels.KEYBOARD_LAYOUT_DESKTOP: self.prefsDict["keyboardLayout"] = \ settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP self.prefsDict["orcaModifierKeys"] = \ settings.DESKTOP_MODIFIER_KEYS else: self.prefsDict["keyboardLayout"] = \ settings.GENERAL_KEYBOARD_LAYOUT_LAPTOP self.prefsDict["orcaModifierKeys"] = \ settings.LAPTOP_MODIFIER_KEYS def pronunciationAddButtonClicked(self, widget): """Signal handler for the "clicked" signal for the pronunciationAddButton GtkButton widget. The user has clicked the Add button on the Pronunciation pane. A new row will be added to the end of the pronunciation dictionary list. Both the actual and replacement strings will initially be set to an empty string. Focus will be moved to that row. Arguments: - widget: the component that generated the signal. """ model = self.pronunciationView.get_model() thisIter = model.append() model.set(thisIter, ACTUAL, "", REPLACEMENT, "") path = model.get_path(thisIter) col = self.pronunciationView.get_column(0) self.pronunciationView.grab_focus() self.pronunciationView.set_cursor(path, col, True) def pronunciationDeleteButtonClicked(self, widget): """Signal handler for the "clicked" signal for the pronunciationDeleteButton GtkButton widget. The user has clicked the Delete button on the Pronunciation pane. The row in the pronunciation dictionary list with focus will be deleted. Arguments: - widget: the component that generated the signal. """ model, oldIter = self.pronunciationView.get_selection().get_selected() model.remove(oldIter) def textSelectAllButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textSelectAllButton GtkButton widget. The user has clicked the Speak all button. Check all the text attributes and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ attributes = _settingsManager.getSetting('allTextAttributes') self._setSpokenTextAttributes( self.getTextAttributesView, attributes, True) self._setBrailledTextAttributes( self.getTextAttributesView, attributes, True) self._updateTextDictEntry() def textUnselectAllButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textUnselectAllButton GtkButton widget. The user has clicked the Speak none button. Uncheck all the text attributes and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ attributes = _settingsManager.getSetting('allTextAttributes') self._setSpokenTextAttributes( self.getTextAttributesView, attributes, False) self._setBrailledTextAttributes( self.getTextAttributesView, attributes, False) self._updateTextDictEntry() def textResetButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textResetButton GtkButton widget. The user has clicked the Reset button. Reset all the text attributes to their initial state and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ attributes = _settingsManager.getSetting('allTextAttributes') self._setSpokenTextAttributes( self.getTextAttributesView, attributes, False) self._setBrailledTextAttributes( self.getTextAttributesView, attributes, False) attributes = _settingsManager.getSetting('enabledSpokenTextAttributes') self._setSpokenTextAttributes( self.getTextAttributesView, attributes, True) attributes = \ _settingsManager.getSetting('enabledBrailledTextAttributes') self._setBrailledTextAttributes( self.getTextAttributesView, attributes, True) self._updateTextDictEntry() def textMoveToTopButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textMoveToTopButton GtkButton widget. The user has clicked the Move to top button. Move the selected rows in the text attribute view to the very top of the list and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ textSelection = self.getTextAttributesView.get_selection() [model, paths] = textSelection.get_selected_rows() for path in paths: thisIter = model.get_iter(path) model.move_after(thisIter, None) self._updateTextDictEntry() def textMoveUpOneButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textMoveUpOneButton GtkButton widget. The user has clicked the Move up one button. Move the selected rows in the text attribute view up one row in the list and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ textSelection = self.getTextAttributesView.get_selection() [model, paths] = textSelection.get_selected_rows() for path in paths: thisIter = model.get_iter(path) indices = path.get_indices() if indices[0]: otherIter = model.iter_nth_child(None, indices[0]-1) model.swap(thisIter, otherIter) self._updateTextDictEntry() def textMoveDownOneButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textMoveDownOneButton GtkButton widget. The user has clicked the Move down one button. Move the selected rows in the text attribute view down one row in the list and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ textSelection = self.getTextAttributesView.get_selection() [model, paths] = textSelection.get_selected_rows() noRows = model.iter_n_children(None) for path in paths: thisIter = model.get_iter(path) indices = path.get_indices() if indices[0] < noRows-1: otherIter = model.iter_next(thisIter) model.swap(thisIter, otherIter) self._updateTextDictEntry() def textMoveToBottomButtonClicked(self, widget): """Signal handler for the "clicked" signal for the textMoveToBottomButton GtkButton widget. The user has clicked the Move to bottom button. Move the selected rows in the text attribute view to the bottom of the list and then update the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes" preference strings. Arguments: - widget: the component that generated the signal. """ textSelection = self.getTextAttributesView.get_selection() [model, paths] = textSelection.get_selected_rows() for path in paths: thisIter = model.get_iter(path) model.move_before(thisIter, None) self._updateTextDictEntry() def helpButtonClicked(self, widget): """Signal handler for the "clicked" signal for the helpButton GtkButton widget. The user has clicked the Help button. Arguments: - widget: the component that generated the signal. """ orca.helpForOrca(page="preferences") def restoreSettings(self): """Restore the settings we saved away when opening the preferences dialog.""" # Restore the default rate/pitch/gain, # in case the user played with the sliders. # voices = _settingsManager.getSetting('voices') defaultVoice = voices[settings.DEFAULT_VOICE] defaultVoice[acss.ACSS.GAIN] = self.savedGain defaultVoice[acss.ACSS.AVERAGE_PITCH] = self.savedPitch defaultVoice[acss.ACSS.RATE] = self.savedRate def saveBasicSettings(self): if not self._isInitialSetup: self.restoreSettings() enable = self.get_widget("speechSupportCheckButton").get_active() self.prefsDict["enableSpeech"] = enable if self.speechSystemsChoice: self.prefsDict["speechServerFactory"] = \ self.speechSystemsChoice.__name__ if self.speechServersChoice: self.prefsDict["speechServerInfo"] = \ self.speechServersChoice.getInfo() if self.defaultVoice is not None: self.prefsDict["voices"] = { settings.DEFAULT_VOICE: acss.ACSS(self.defaultVoice), settings.UPPERCASE_VOICE: acss.ACSS(self.uppercaseVoice), settings.HYPERLINK_VOICE: acss.ACSS(self.hyperlinkVoice), settings.SYSTEM_VOICE: acss.ACSS(self.systemVoice), } def applyButtonClicked(self, widget): """Signal handler for the "clicked" signal for the applyButton GtkButton widget. The user has clicked the Apply button. Write out the users preferences. If GNOME accessibility hadn't previously been enabled, warn the user that they will need to log out. Shut down any active speech servers that were started. Reload the users preferences to get the new speech, braille and key echo value to take effect. Do not dismiss the configuration window. Arguments: - widget: the component that generated the signal. """ self.saveBasicSettings() activeProfile = self.getComboBoxList(self.profilesCombo) startingProfile = self.getComboBoxList(self.startingProfileCombo) self.prefsDict['profile'] = activeProfile self.prefsDict['activeProfile'] = activeProfile self.prefsDict['startingProfile'] = startingProfile _settingsManager.setStartingProfile(startingProfile) self.writeUserPreferences() orca.loadUserSettings(self.script) braille.checkBrailleSetting() self._initSpeechState() self._populateKeyBindings() self.__initProfileCombo() def cancelButtonClicked(self, widget): """Signal handler for the "clicked" signal for the cancelButton GtkButton widget. The user has clicked the Cancel button. Don't write out the preferences. Destroy the configuration window. Arguments: - widget: the component that generated the signal. """ self.windowClosed(widget) self.get_widget("orcaSetupWindow").destroy() def okButtonClicked(self, widget=None): """Signal handler for the "clicked" signal for the okButton GtkButton widget. The user has clicked the OK button. Write out the users preferences. If GNOME accessibility hadn't previously been enabled, warn the user that they will need to log out. Shut down any active speech servers that were started. Reload the users preferences to get the new speech, braille and key echo value to take effect. Hide the configuration window. Arguments: - widget: the component that generated the signal. """ self.applyButtonClicked(widget) self._cleanupSpeechServers() self.get_widget("orcaSetupWindow").destroy() def windowClosed(self, widget): """Signal handler for the "closed" signal for the orcaSetupWindow GtkWindow widget. This is effectively the same as pressing the cancel button, except the window is destroyed for us. Arguments: - widget: the component that generated the signal. """ factory = _settingsManager.getSetting('speechServerFactory') if factory: self._setSpeechSystemsChoice(factory) server = _settingsManager.getSetting('speechServerInfo') if server: self._setSpeechServersChoice(server) self._cleanupSpeechServers() self.restoreSettings() def windowDestroyed(self, widget): """Signal handler for the "destroyed" signal for the orcaSetupWindow GtkWindow widget. Reset orca_state.orcaOS to None, so that the GUI can be rebuilt from the GtkBuilder file the next time the user wants to display the configuration GUI. Arguments: - widget: the component that generated the signal. """ self.keyBindView.set_model(None) self.getTextAttributesView.set_model(None) self.pronunciationView.set_model(None) self.keyBindView.set_headers_visible(False) self.getTextAttributesView.set_headers_visible(False) self.pronunciationView.set_headers_visible(False) self.keyBindView.hide() self.getTextAttributesView.hide() self.pronunciationView.hide() orca_state.orcaOS = None def showProfileGUI(self, widget): """Show profile Dialog to add a new one""" orca_gui_profile.showProfileUI(self) def saveProfile(self, profileToSaveLabel): """Creates a new profile based on the name profileToSaveLabel and updates the Preferences dialog combo boxes accordingly.""" if not profileToSaveLabel: return profileToSave = profileToSaveLabel.replace(' ', '_').lower() profile = [profileToSaveLabel, profileToSave] def saveActiveProfile(newProfile = True): if newProfile: activeProfileIter = self.profilesComboModel.append(profile) self.profilesCombo.set_active_iter(activeProfileIter) self.prefsDict['profile'] = profile self.prefsDict['activeProfile'] = profile self.saveBasicSettings() self.writeUserPreferences() availableProfiles = [p[1] for p in self.__getAvailableProfiles()] if isinstance(profileToSave, str) \ and profileToSave != '' \ and not profileToSave in availableProfiles \ and profileToSave != self._defaultProfile[1]: saveActiveProfile() else: if profileToSave is not None: message = guilabels.PROFILE_CONFLICT_MESSAGE % \ ("<b>%s</b>" % GLib.markup_escape_text(profileToSaveLabel)) dialog = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, type=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.YES_NO) dialog.set_markup("<b>%s</b>" % guilabels.PROFILE_CONFLICT_LABEL) dialog.format_secondary_markup(message) dialog.set_title(guilabels.PROFILE_CONFLICT_TITLE) response = dialog.run() if response == Gtk.ResponseType.YES: dialog.destroy() saveActiveProfile(False) else: dialog.destroy() def removeProfileButtonClicked(self, widget): """Remove profile button clicked handler If we removed the last profile, a default one will automatically get added back by the settings manager. """ oldProfile = self.getComboBoxList(self.profilesCombo) message = guilabels.PROFILE_REMOVE_MESSAGE % \ ("<b>%s</b>" % GLib.markup_escape_text(oldProfile[0])) dialog = Gtk.MessageDialog(self.window, Gtk.DialogFlags.MODAL, type=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.YES_NO) dialog.set_markup("<b>%s</b>" % guilabels.PROFILE_REMOVE_LABEL) dialog.format_secondary_markup(message) if dialog.run() == Gtk.ResponseType.YES: # If we remove the currently used starting profile, fallback on # the first listed profile, or the default one if there's # nothing better newStartingProfile = self.prefsDict.get('startingProfile') if not newStartingProfile or newStartingProfile == oldProfile: newStartingProfile = self._defaultProfile for row in self.profilesComboModel: rowProfile = row[:] if rowProfile != oldProfile: newStartingProfile = rowProfile break # Update the current profile to the active profile unless we're # removing that one, in which case we use the new starting # profile newProfile = self.prefsDict.get('activeProfile') if not newProfile or newProfile == oldProfile: newProfile = newStartingProfile _settingsManager.removeProfile(oldProfile[1]) self.loadProfile(newProfile) # Make sure nothing is referencing the removed profile anymore startingProfile = self.prefsDict.get('startingProfile') if not startingProfile or startingProfile == oldProfile: self.prefsDict['startingProfile'] = newStartingProfile _settingsManager.setStartingProfile(newStartingProfile) self.writeUserPreferences() dialog.destroy() def loadProfileButtonClicked(self, widget): """Load profile button clicked handler""" if self._isInitialSetup: return dialog = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, type=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.YES_NO) dialog.set_markup("<b>%s</b>" % guilabels.PROFILE_LOAD_LABEL) dialog.format_secondary_markup(guilabels.PROFILE_LOAD_MESSAGE) response = dialog.run() if response == Gtk.ResponseType.YES: dialog.destroy() self.loadSelectedProfile() else: dialog.destroy() def loadSelectedProfile(self): """Load selected profile""" activeProfile = self.getComboBoxList(self.profilesCombo) self.loadProfile(activeProfile) def loadProfile(self, profile): """Load profile""" self.saveBasicSettings() self.prefsDict['activeProfile'] = profile _settingsManager.setProfile(profile[1]) self.prefsDict = _settingsManager.getGeneralSettings(profile[1]) orca.loadUserSettings(skipReloadMessage=True) self._initGUIState() braille.checkBrailleSetting() self._initSpeechState() self._populateKeyBindings() self.__initProfileCombo()
GNOME/orca
src/orca/orca_gui_prefs.py
Python
lgpl-2.1
142,434
# -*- coding: utf-8 -*- # Copyright (C) 2010, 2011, 2012, 2013 Sebastian Wiesner <[email protected]> # 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 St, Fifth Floor, Boston, MA 02110-1301 USA # pylint: disable=anomalous-backslash-in-string """ pyudev.pyqt4 ============ PyQt4 integration. :class:`MonitorObserver` integrates device monitoring into the PyQt4\_ mainloop by turning device events into Qt signals. :mod:`PyQt4.QtCore` from PyQt4\_ must be available when importing this module. .. _PyQt4: http://riverbankcomputing.co.uk/software/pyqt/intro .. moduleauthor:: Sebastian Wiesner <[email protected]> """ from __future__ import (print_function, division, unicode_literals, absolute_import) from PyQt4.QtCore import QSocketNotifier, QObject, pyqtSignal from pyudev._util import text_type from pyudev.core import Device from pyudev._qt_base import QUDevMonitorObserverMixin, MonitorObserverMixin class MonitorObserver(QObject, MonitorObserverMixin): """An observer for device events integrating into the :mod:`PyQt4` mainloop. This class inherits :class:`~PyQt4.QtCore.QObject` to turn device events into Qt signals: >>> from pyudev import Context, Monitor >>> from pyudev.pyqt4 import MonitorObserver >>> context = Context() >>> monitor = Monitor.from_netlink(context) >>> monitor.filter_by(subsystem='input') >>> observer = MonitorObserver(monitor) >>> def device_event(device): ... print('event {0} on device {1}'.format(device.action, device)) >>> observer.deviceEvent.connect(device_event) >>> monitor.start() This class is a child of :class:`~PyQt4.QtCore.QObject`. """ #: emitted upon arbitrary device events deviceEvent = pyqtSignal(Device) def __init__(self, monitor, parent=None): """ Observe the given ``monitor`` (a :class:`~pyudev.Monitor`): ``parent`` is the parent :class:`~PyQt4.QtCore.QObject` of this object. It is passed unchanged to the inherited constructor of :class:`~PyQt4.QtCore.QObject`. """ QObject.__init__(self, parent) self._setup_notifier(monitor, QSocketNotifier) class QUDevMonitorObserver(QObject, QUDevMonitorObserverMixin): """An observer for device events integrating into the :mod:`PyQt4` mainloop. .. deprecated:: 0.17 Will be removed in 1.0. Use :class:`MonitorObserver` instead. """ #: emitted upon arbitrary device events deviceEvent = pyqtSignal(text_type, Device) #: emitted, if a device was added deviceAdded = pyqtSignal(Device) #: emitted, if a device was removed deviceRemoved = pyqtSignal(Device) #: emitted, if a device was changed deviceChanged = pyqtSignal(Device) #: emitted, if a device was moved deviceMoved = pyqtSignal(Device) def __init__(self, monitor, parent=None): """ Observe the given ``monitor`` (a :class:`~pyudev.Monitor`): ``parent`` is the parent :class:`~PyQt4.QtCore.QObject` of this object. It is passed unchanged to the inherited constructor of :class:`~PyQt4.QtCore.QObject`. """ QObject.__init__(self, parent) self._setup_notifier(monitor, QSocketNotifier)
mulkieran/pyudev
pyudev/pyqt4.py
Python
lgpl-2.1
3,930
/** ****************************************************************************** * @file stm32l0xx_hal_usart_ex.h * @author MCD Application Team * @brief Header file of USART HAL Extended module. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 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 STM32L0xx_HAL_USART_EX_H #define STM32L0xx_HAL_USART_EX_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32l0xx_hal_def.h" /** @addtogroup STM32L0xx_HAL_Driver * @{ */ /** @addtogroup USARTEx * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /** @defgroup USARTEx_Exported_Constants USARTEx Exported Constants * @{ */ /** @defgroup USARTEx_Word_Length USARTEx Word Length * @{ */ #define USART_WORDLENGTH_7B ((uint32_t)USART_CR1_M1) /*!< 7-bit long USART frame */ #define USART_WORDLENGTH_8B 0x00000000U /*!< 8-bit long USART frame */ #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M0) /*!< 9-bit long USART frame */ /** * @} */ /** * @} */ /* Private macros ------------------------------------------------------------*/ /** @defgroup USARTEx_Private_Macros USARTEx Private Macros * @{ */ /** @brief Report the USART clock source. * @param __HANDLE__ specifies the USART Handle. * @param __CLOCKSOURCE__ output variable. * @retval the USART clocking source, written in __CLOCKSOURCE__. */ #if defined (STM32L051xx) || defined (STM32L052xx) || defined (STM32L053xx) || defined (STM32L061xx) || defined (STM32L062xx) || defined (STM32L063xx) #define USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ do { \ if((__HANDLE__)->Instance == USART1) \ { \ switch(__HAL_RCC_GET_USART1_SOURCE()) \ { \ case RCC_USART1CLKSOURCE_PCLK2: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK2; \ break; \ case RCC_USART1CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART1CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART1CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == USART2) \ { \ switch(__HAL_RCC_GET_USART2_SOURCE()) \ { \ case RCC_USART2CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_USART2CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART2CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART2CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else \ { \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ } \ } while(0U) #elif defined(STM32L071xx) || defined (STM32L081xx) || defined(STM32L072xx) || defined (STM32L082xx) || defined(STM32L073xx) || defined (STM32L083xx) #define USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ do { \ if((__HANDLE__)->Instance == USART1) \ { \ switch(__HAL_RCC_GET_USART1_SOURCE()) \ { \ case RCC_USART1CLKSOURCE_PCLK2: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK2; \ break; \ case RCC_USART1CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART1CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART1CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == USART2) \ { \ switch(__HAL_RCC_GET_USART2_SOURCE()) \ { \ case RCC_USART2CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_USART2CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART2CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART2CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == USART4) \ { \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \ } \ else if((__HANDLE__)->Instance == USART5) \ { \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \ } \ else \ { \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ } \ } while(0U) #else #define USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ do { \ if((__HANDLE__)->Instance == USART2) \ { \ switch(__HAL_RCC_GET_USART2_SOURCE()) \ { \ case RCC_USART2CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_USART2CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART2CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART2CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else \ { \ (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \ } \ } while(0U) #endif /** @brief Compute the USART mask to apply to retrieve the received data * according to the word length and to the parity bits activation. * @note If PCE = 1, the parity bit is not included in the data extracted * by the reception API(). * This masking operation is not carried out in the case of * DMA transfers. * @param __HANDLE__ specifies the USART Handle. * @retval None, the mask to apply to USART RDR register is stored in (__HANDLE__)->Mask field. */ #define USART_MASK_COMPUTATION(__HANDLE__) \ do { \ if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_9B) \ { \ if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \ { \ (__HANDLE__)->Mask = 0x01FFU; \ } \ else \ { \ (__HANDLE__)->Mask = 0x00FFU; \ } \ } \ else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_8B) \ { \ if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \ { \ (__HANDLE__)->Mask = 0x00FFU; \ } \ else \ { \ (__HANDLE__)->Mask = 0x007FU; \ } \ } \ else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_7B) \ { \ if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \ { \ (__HANDLE__)->Mask = 0x007FU; \ } \ else \ { \ (__HANDLE__)->Mask = 0x003FU; \ } \ } \ else \ { \ (__HANDLE__)->Mask = 0x0000U; \ } \ } while(0U) /** * @brief Ensure that USART frame length is valid. * @param __LENGTH__ USART frame length. * @retval SET (__LENGTH__ is valid) or RESET (__LENGTH__ is invalid) */ #define IS_USART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == USART_WORDLENGTH_7B) || \ ((__LENGTH__) == USART_WORDLENGTH_8B) || \ ((__LENGTH__) == USART_WORDLENGTH_9B)) /** * @} */ /* Exported functions --------------------------------------------------------*/ /** @addtogroup USARTEx_Exported_Functions * @{ */ /** @addtogroup USARTEx_Exported_Functions_Group1 * @{ */ /* IO operation functions *****************************************************/ /** * @} */ /** @addtogroup USARTEx_Exported_Functions_Group2 * @{ */ /* Peripheral Control functions ***********************************************/ /** * @} */ /** * @} */ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* STM32L0xx_HAL_USART_EX_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
prefetchnta/crhack
src/naked/arm-stm32/stm32l0xx/stm32l0xx_hal_usart_ex.h
C
lgpl-2.1
15,823
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** 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 [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QGEOMAPPINGMANAGERENGINE_H #define QGEOMAPPINGMANAGERENGINE_H #include "qgraphicsgeomap.h" #include <QObject> #include <QSize> #include <QPair> class QLocale; QTM_BEGIN_NAMESPACE class QGeoBoundingBox; class QGeoCoordinate; class QGeoMapData; class QGeoMappingManagerPrivate; class QGeoMapRequestOptions; class QGeoMappingManagerEnginePrivate; class Q_LOCATION_EXPORT QGeoMappingManagerEngine : public QObject { Q_OBJECT public: QGeoMappingManagerEngine(const QMap<QString, QVariant> &parameters, QObject *parent = 0); virtual ~QGeoMappingManagerEngine(); QString managerName() const; int managerVersion() const; virtual QGeoMapData* createMapData() = 0; QList<QGraphicsGeoMap::MapType> supportedMapTypes() const; QList<QGraphicsGeoMap::ConnectivityMode> supportedConnectivityModes() const; qreal minimumZoomLevel() const; qreal maximumZoomLevel() const; void setLocale(const QLocale &locale); QLocale locale() const; protected: QGeoMappingManagerEngine(QGeoMappingManagerEnginePrivate *dd, QObject *parent = 0); void setSupportedMapTypes(const QList<QGraphicsGeoMap::MapType> &mapTypes); void setSupportedConnectivityModes(const QList<QGraphicsGeoMap::ConnectivityMode> &connectivityModes); void setMinimumZoomLevel(qreal minimumZoom); void setMaximumZoomLevel(qreal maximumZoom); QGeoMappingManagerEnginePrivate* d_ptr; private: void setManagerName(const QString &managerName); void setManagerVersion(int managerVersion); Q_DECLARE_PRIVATE(QGeoMappingManagerEngine) Q_DISABLE_COPY(QGeoMappingManagerEngine) friend class QGeoServiceProvider; }; QTM_END_NAMESPACE #endif
robclark/qtmobility-1.1.0
src/location/maps/qgeomappingmanagerengine.h
C
lgpl-2.1
3,652